Version Description
Download this release
Release Info
Developer | gutenbergplugin |
Plugin | Gutenberg |
Version | 10.7.1 |
Comparing to | |
See all releases |
Code changes from version 10.7.0 to 10.7.1
- build/block-library/index.asset.php +1 -1
- build/block-library/index.js +2 -2
- changelog.txt +317 -300
- gutenberg.php +3 -3
- lib/block-patterns.php +38 -44
- lib/class-wp-rest-pattern-directory-controller.php +7 -7
- readme.txt +2 -2
build/block-library/index.asset.php
CHANGED
@@ -1 +1 @@
|
|
1 |
-
<?php return array('dependencies' => array('lodash', 'moment', 'react', 'wp-api-fetch', 'wp-autop', 'wp-blob', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-keycodes', 'wp-notices', 'wp-polyfill', 'wp-primitives', 'wp-reusable-blocks', 'wp-rich-text', 'wp-server-side-render', 'wp-url', 'wp-viewport'), 'version' => '
|
1 |
+
<?php return array('dependencies' => array('lodash', 'moment', 'react', 'wp-api-fetch', 'wp-autop', 'wp-blob', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-keycodes', 'wp-notices', 'wp-polyfill', 'wp-primitives', 'wp-reusable-blocks', 'wp-rich-text', 'wp-server-side-render', 'wp-url', 'wp-viewport'), 'version' => 'b92e6a807ca844617691631506f347c5');
|
build/block-library/index.js
CHANGED
@@ -25,7 +25,7 @@ content:Object(Be.__)("Etiam et egestas lorem. Vivamus sagittis sit amet dolor q
|
|
25 |
/* translators: example text. */
|
26 |
content:Object(Be.__)("Nam risus massa, ullamcorper consectetur eros fermentum, porta aliquet ligula. Sed vel mauris nec enim.")}}]}]},deprecated:br,edit:e=>{const{clientId:t}=e,n=Object(Ye.useSelect)(e=>e(Ce.store).getBlocks(t).length>0,[t])?jr:fr;return Object(Te.createElement)(n,e)},save:function({attributes:e}){const{verticalAlignment:t}=e,n=Me()({["are-vertically-aligned-"+t]:t});return Object(Te.createElement)("div",Ce.useBlockProps.save({className:n}),Object(Te.createElement)(Ce.InnerBlocks.Content,null))},transforms:_r};var Cr=Object(Te.createElement)(ze.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(Te.createElement)(ze.Path,{d:"M19 6H6c-1.1 0-2 .9-2 2v9c0 1.1.9 2 2 2h13c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zM6 17.5c-.3 0-.5-.2-.5-.5V8c0-.3.2-.5.5-.5h3v10H6zm13.5-.5c0 .3-.2.5-.5.5h-3v-10h3c.3 0 .5.2.5.5v9z"})),xr=[{attributes:{verticalAlignment:{type:"string"},width:{type:"number",min:0,max:100}},isEligible:({width:e})=>isFinite(e),migrate:e=>({...e,width:e.width+"%"}),save({attributes:e}){const{verticalAlignment:t,width:n}=e,o=Me()({["is-vertically-aligned-"+t]:t}),r={flexBasis:n+"%"};return Object(Te.createElement)("div",{className:o,style:r},Object(Te.createElement)(Ce.InnerBlocks.Content,null))}}];const Sr={apiVersion:2,name:"core/column",title:"Column",category:"text",parent:["core/columns"],description:"A single column within a columns block.",textdomain:"default",attributes:{verticalAlignment:{type:"string"},width:{type:"string"},templateLock:{enum:["all","insert",!1]}},supports:{anchor:!0,reusable:!1,html:!1,color:{gradients:!0,link:!0},spacing:{padding:!0}}},{name:Br}=Sr,Tr={icon:Cr,edit:function({attributes:{verticalAlignment:e,width:t,templateLock:n=!1},setAttributes:o,clientId:r}){const a=Me()("block-core-columns",{["is-vertically-aligned-"+e]:e}),c=Object(Le.__experimentalUseCustomUnits)({availableUnits:Object(Ce.useSetting)("layout.units")||["%","px","em","rem","vw"]}),{columnsIds:l,hasChildBlocks:i,rootClientId:s}=Object(Ye.useSelect)(e=>{const{getBlockOrder:t,getBlockRootClientId:n}=e(Ce.store),o=n(r);return{hasChildBlocks:t(r).length>0,rootClientId:o,columnsIds:t(o)}},[r]),{updateBlockAttributes:u}=Object(Ye.useDispatch)(Ce.store),m=Number.isFinite(t)?t+"%":t,d=Object(Ce.useBlockProps)({className:a,style:m?{flexBasis:m}:void 0}),b=l.length,p=l.indexOf(r)+1,g=Object(Be.sprintf)(
|
27 |
/* translators: 1: Block label (i.e. "Block: Column"), 2: Position of the selected block, 3: Total number of sibling blocks of the same type */
|
28 |
-
Object(Be.__)("%1$s (%2$d of %3$d)"),d["aria-label"],p,b),h=Object(Ce.__experimentalUseInnerBlocksProps)({...d,"aria-label":g},{templateLock:n,renderAppender:i?void 0:Ce.InnerBlocks.ButtonBlockAppender});return Object(Te.createElement)(Te.Fragment,null,Object(Te.createElement)(Ce.BlockControls,null,Object(Te.createElement)(Ce.BlockVerticalAlignmentToolbar,{onChange:e=>{o({verticalAlignment:e}),u(s,{verticalAlignment:null})},value:e})),Object(Te.createElement)(Ce.InspectorControls,null,Object(Te.createElement)(Le.PanelBody,{title:Object(Be.__)("Column settings")},Object(Te.createElement)(Le.__experimentalUnitControl,{label:Object(Be.__)("Width"),labelPosition:"edge",__unstableInputWidth:"80px",value:t||"",onChange:e=>{e=0>parseFloat(e)?"0":e,o({width:e})},units:c}))),Object(Te.createElement)("div",h))},save:function({attributes:e}){const{verticalAlignment:t,width:n}=e,o=Me()({["is-vertically-aligned-"+t]:t});let r;return n&&(r={flexBasis:Number.isFinite(n)?n+"%":n}),Object(Te.createElement)("div",Ce.useBlockProps.save({className:o,style:r}),Object(Te.createElement)(Ce.InnerBlocks.Content,null))},deprecated:xr};var zr=Object(Te.createElement)(ze.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(Te.createElement)(ze.Path,{d:"M18.7 3H5.3C4 3 3 4 3 5.3v13.4C3 20 4 21 5.3 21h13.4c1.3 0 2.3-1 2.3-2.3V5.3C21 4 20 3 18.7 3zm.8 15.7c0 .4-.4.8-.8.8H5.3c-.4 0-.8-.4-.8-.8V5.3c0-.4.4-.8.8-.8h6.2v8.9l2.5-3.1 2.5 3.1V4.5h2.2c.4 0 .8.4.8.8v13.4z"}));const Pr={"top left":"is-position-top-left","top center":"is-position-top-center","top right":"is-position-top-right","center left":"is-position-center-left","center center":"is-position-center-center",center:"is-position-center-center","center right":"is-position-center-right","bottom left":"is-position-bottom-left","bottom center":"is-position-bottom-center","bottom right":"is-position-bottom-right"};function Nr(e){return e?{backgroundImage:`url(${e})`}:{}}const Mr=["image","video"];function Vr(e){return 0!==e&&50!==e&&e?"has-background-dim-"+10*Math.round(e/10):null}function Ir(e){return!e||"center center"===e||"center"===e}function Hr(e){return Ir(e)?"":Pr[e]}const Rr={url:{type:"string"},id:{type:"number"},hasParallax:{type:"boolean",default:!1},dimRatio:{type:"number",default:50},overlayColor:{type:"string"},customOverlayColor:{type:"string"},backgroundType:{type:"string",default:"image"},focalPoint:{type:"object"}};var Ar=[{attributes:{...Rr,title:{type:"string",source:"html",selector:"p"},contentAlign:{type:"string",default:"center"},isRepeated:{type:"boolean",default:!1},minHeight:{type:"number"},minHeightUnit:{type:"string"},gradient:{type:"string"},customGradient:{type:"string"},contentPosition:{type:"string"}},supports:{align:!0},save({attributes:e}){const{backgroundType:t,gradient:n,contentPosition:o,customGradient:r,customOverlayColor:a,dimRatio:c,focalPoint:l,hasParallax:i,isRepeated:s,overlayColor:u,url:m,minHeight:d,minHeightUnit:b}=e,p=Object(Ce.getColorClassName)("background-color",u),g=Object(Ce.__experimentalGetGradientClass)(n),h=b?`${d}${b}`:d,v="image"===t,O="video"===t,j=v?Nr(m):{},f={};let y;p||(j.backgroundColor=a),r&&!m&&(j.background=r),j.minHeight=h||void 0,l&&(y=`${Math.round(100*l.x)}% ${Math.round(100*l.y)}%`,v&&!i&&(j.backgroundPosition=y),O&&(f.objectPosition=y));const _=Me()(Vr(c),p,{"has-background-dim":0!==c,"has-parallax":i,"is-repeated":s,"has-background-gradient":n||r,[g]:!m&&g,"has-custom-content-position":!Ir(o)},Hr(o));return Object(Te.createElement)("div",Ce.useBlockProps.save({className:_,style:j}),m&&(n||r)&&0!==c&&Object(Te.createElement)("span",{"aria-hidden":"true",className:Me()("wp-block-cover__gradient-background",g),style:r?{background:r}:void 0}),O&&m&&Object(Te.createElement)("video",{className:"wp-block-cover__video-background",autoPlay:!0,muted:!0,loop:!0,playsInline:!0,src:m,style:f}),Object(Te.createElement)("div",{className:"wp-block-cover__inner-container"},Object(Te.createElement)(Ce.InnerBlocks.Content,null)))}},{attributes:{...Rr,title:{type:"string",source:"html",selector:"p"},contentAlign:{type:"string",default:"center"},minHeight:{type:"number"},gradient:{type:"string"},customGradient:{type:"string"}},supports:{align:!0},save({attributes:e}){const{backgroundType:t,gradient:n,customGradient:o,customOverlayColor:r,dimRatio:a,focalPoint:c,hasParallax:l,overlayColor:i,url:s,minHeight:u}=e,m=Object(Ce.getColorClassName)("background-color",i),d=Object(Ce.__experimentalGetGradientClass)(n),b="image"===t?Nr(s):{};m||(b.backgroundColor=r),c&&!l&&(b.backgroundPosition=`${Math.round(100*c.x)}% ${Math.round(100*c.y)}%`),o&&!s&&(b.background=o),b.minHeight=u||void 0;const p=Me()(Vr(a),m,{"has-background-dim":0!==a,"has-parallax":l,"has-background-gradient":o,[d]:!s&&d});return Object(Te.createElement)("div",{className:p,style:b},s&&(n||o)&&0!==a&&Object(Te.createElement)("span",{"aria-hidden":"true",className:Me()("wp-block-cover__gradient-background",d),style:o?{background:o}:void 0}),"video"===t&&s&&Object(Te.createElement)("video",{className:"wp-block-cover__video-background",autoPlay:!0,muted:!0,loop:!0,src:s}),Object(Te.createElement)("div",{className:"wp-block-cover__inner-container"},Object(Te.createElement)(Ce.InnerBlocks.Content,null)))}},{attributes:{...Rr,title:{type:"string",source:"html",selector:"p"},contentAlign:{type:"string",default:"center"},minHeight:{type:"number"},gradient:{type:"string"},customGradient:{type:"string"}},supports:{align:!0},save({attributes:e}){const{backgroundType:t,gradient:n,customGradient:o,customOverlayColor:r,dimRatio:a,focalPoint:c,hasParallax:l,overlayColor:i,url:s,minHeight:u}=e,m=Object(Ce.getColorClassName)("background-color",i),d=Object(Ce.__experimentalGetGradientClass)(n),b="image"===t?Nr(s):{};m||(b.backgroundColor=r),c&&!l&&(b.backgroundPosition=`${100*c.x}% ${100*c.y}%`),o&&!s&&(b.background=o),b.minHeight=u||void 0;const p=Me()(Vr(a),m,{"has-background-dim":0!==a,"has-parallax":l,"has-background-gradient":o,[d]:!s&&d});return Object(Te.createElement)("div",{className:p,style:b},s&&(n||o)&&0!==a&&Object(Te.createElement)("span",{"aria-hidden":"true",className:Me()("wp-block-cover__gradient-background",d),style:o?{background:o}:void 0}),"video"===t&&s&&Object(Te.createElement)("video",{className:"wp-block-cover__video-background",autoPlay:!0,muted:!0,loop:!0,src:s}),Object(Te.createElement)("div",{className:"wp-block-cover__inner-container"},Object(Te.createElement)(Ce.InnerBlocks.Content,null)))}},{attributes:{...Rr,title:{type:"string",source:"html",selector:"p"},contentAlign:{type:"string",default:"center"}},supports:{align:!0},save({attributes:e}){const{backgroundType:t,contentAlign:n,customOverlayColor:o,dimRatio:r,focalPoint:a,hasParallax:c,overlayColor:l,title:i,url:s}=e,u=Object(Ce.getColorClassName)("background-color",l),m="image"===t?Nr(s):{};u||(m.backgroundColor=o),a&&!c&&(m.backgroundPosition=`${100*a.x}% ${100*a.y}%`);const d=Me()(Vr(r),u,{"has-background-dim":0!==r,"has-parallax":c,[`has-${n}-content`]:"center"!==n});return Object(Te.createElement)("div",{className:d,style:m},"video"===t&&s&&Object(Te.createElement)("video",{className:"wp-block-cover__video-background",autoPlay:!0,muted:!0,loop:!0,src:s}),!Ce.RichText.isEmpty(i)&&Object(Te.createElement)(Ce.RichText.Content,{tagName:"p",className:"wp-block-cover-text",value:i}))},migrate:e=>[Object(Se.omit)(e,["title","contentAlign"]),[Object(xe.createBlock)("core/paragraph",{content:e.title,align:e.contentAlign,fontSize:"large",placeholder:Object(Be.__)("Write title…")})]]},{attributes:{...Rr,title:{type:"string",source:"html",selector:"p"},contentAlign:{type:"string",default:"center"},align:{type:"string"}},supports:{className:!1},save({attributes:e}){const{url:t,title:n,hasParallax:o,dimRatio:r,align:a,contentAlign:c,overlayColor:l,customOverlayColor:i}=e,s=Object(Ce.getColorClassName)("background-color",l),u=Nr(t);s||(u.backgroundColor=i);const m=Me()("wp-block-cover-image",Vr(r),s,{"has-background-dim":0!==r,"has-parallax":o,[`has-${c}-content`]:"center"!==c},a?"align"+a:null);return Object(Te.createElement)("div",{className:m,style:u},!Ce.RichText.isEmpty(n)&&Object(Te.createElement)(Ce.RichText.Content,{tagName:"p",className:"wp-block-cover-image-text",value:n}))},migrate:e=>[Object(Se.omit)(e,["title","contentAlign","align"]),[Object(xe.createBlock)("core/paragraph",{content:e.title,align:e.contentAlign,fontSize:"large",placeholder:Object(Be.__)("Write title…")})]]},{attributes:{...Rr,title:{type:"string",source:"html",selector:"h2"},align:{type:"string"},contentAlign:{type:"string",default:"center"}},supports:{className:!1},save({attributes:e}){const{url:t,title:n,hasParallax:o,dimRatio:r,align:a}=e,c=Nr(t),l=Me()("wp-block-cover-image",Vr(r),{"has-background-dim":0!==r,"has-parallax":o},a?"align"+a:null);return Object(Te.createElement)("section",{className:l,style:c},Object(Te.createElement)(Ce.RichText.Content,{tagName:"h2",value:n}))},migrate:e=>[Object(Se.omit)(e,["title","contentAlign","align"]),[Object(xe.createBlock)("core/paragraph",{content:e.title,align:e.contentAlign,fontSize:"large",placeholder:Object(Be.__)("Write title…")})]]}],Lr=n(271),Dr=n.n(Lr),Fr=n(40),Gr=n.n(Fr);const Ur=[["core/paragraph",{align:"center",fontSize:"large",placeholder:Object(Be.__)("Write title…")}]],{__Visualizer:qr}=Le.__experimentalBoxControl;function Wr(){return Wr.fastAverageColor||(Wr.fastAverageColor=new Dr.a),Wr.fastAverageColor}function $r({onChange:e,onUnitChange:t,unit:n="px",value:o=""}){const[r,a]=Object(Te.useState)(null),c="block-cover-height-input-"+Object(Xe.useInstanceId)(Ce.__experimentalUnitControl),l="px"===n,i=Object(Le.__experimentalUseCustomUnits)({availableUnits:Object(Ce.useSetting)("spacing.units")||["px","em","rem","vw","vh"],defaultValues:{px:"430",em:"20",rem:"20",vw:"20",vh:"50"}}),s=null!==r?r:o,u=l?50:0;return Object(Te.createElement)(Le.BaseControl,{label:Object(Be.__)("Minimum height of cover"),id:c},Object(Te.createElement)(Ce.__experimentalUnitControl,{id:c,isResetValueOnUnitChange:!0,min:u,onBlur:()=>{null!==r&&a(null)},onChange:n=>{const o=""!==n?parseInt(n,10):void 0;isNaN(o)&&void 0!==o?a(n):(a(null),e(o),void 0===o&&t())},onUnitChange:t,step:"1",style:{maxWidth:80},unit:n,units:i,value:s}))}const Zr={top:!1,right:!1,bottom:!0,left:!1,topRight:!1,bottomRight:!1,bottomLeft:!1,topLeft:!1};function Qr({className:e,onResizeStart:t,onResize:n,onResizeStop:o,...r}){const[a,c]=Object(Te.useState)(!1);return Object(Te.createElement)(Le.ResizableBox,Object(Ae.a)({className:Me()(e,{"is-resizing":a}),enable:Zr,onResizeStart:(e,o,r)=>{t(r.clientHeight),n(r.clientHeight)},onResize:(e,t,o)=>{n(o.clientHeight),a||c(!0)},onResizeStop:(e,t,n)=>{o(n.clientHeight),c(!1)},minHeight:50},r))}function Jr({x:e,y:t}){return`${Math.round(100*e)}% ${Math.round(100*t)}%`}function Kr({disableMediaButtons:e=!1,children:t,noticeUI:n,noticeOperations:o,onSelectMedia:r}){const{removeAllNotices:a,createErrorNotice:c}=o;return Object(Te.createElement)(Ce.MediaPlaceholder,{icon:Object(Te.createElement)(Ce.BlockIcon,{icon:zr}),labels:{title:Object(Be.__)("Cover"),instructions:Object(Be.__)("Upload an image or video file, or pick one from your media library.")},onSelect:r,accept:"image/*,video/*",allowedTypes:Mr,notices:n,disableMediaButtons:e,onError:e=>{a(),c(e)}},t)}var Yr=Object(Xe.compose)([Object(Ye.withDispatch)(e=>{const{toggleSelection:t}=e(Ce.store);return{toggleSelection:t}}),Object(Ce.withColors)({overlayColor:"background-color"}),Le.withNotices,Xe.withInstanceId])((function({attributes:e,clientId:t,isSelected:n,noticeUI:o,noticeOperations:r,overlayColor:a,setAttributes:c,setOverlayColor:l,toggleSelection:i}){var s,u;const{contentPosition:m,id:d,backgroundType:b,dimRatio:p,focalPoint:g,hasParallax:h,isRepeated:v,minHeight:O,minHeightUnit:j,style:f,url:y}=e,{gradientClass:_,gradientValue:w,setGradient:k}=Object(Ce.__experimentalUseGradient)(),E=function(e){return t=>{if(!t||!t.url)return void e({url:void 0,id:void 0});let n;if(Object(Ke.isBlobURL)(t.url)&&(t.type=Object(Ke.getBlobTypeByURL)(t.url)),t.media_type)n="image"===t.media_type?"image":"video";else{if("image"!==t.type&&"video"!==t.type)return;n=t.type}e({url:t.url,id:t.id,backgroundType:n,..."video"===n?{focalPoint:void 0,hasParallax:void 0}:{}})}}(c),C=((e,t)=>!e&&Object(Ke.isBlobURL)(t))(d,y),[x,S]=Object(Te.useState)(O),[B,T]=Object(Te.useState)(j),z="vh"===j&&100===O,P=Object(Te.useRef)(),N=function(e,t=50,n,o){const[r,a]=Object(Te.useState)(!1);return Object(Te.useEffect)(()=>{e&&t<=50&&o.current&&Wr().getColorAsync(o.current,e=>{a(e.isDark)})},[e,e&&t<=50&&o.current,a]),Object(Te.useEffect)(()=>{if(t>50||!e){if(!n)return void a(!0);a(Gr()(n).isDark())}},[n,t>50||!e,a]),Object(Te.useEffect)(()=>{e||n||a(!1)},[!e&&!n,a]),r}(y,p,a.color,P),M="image"===b,V="video"===b,[I,H]=Object(Te.useState)(null),R=j?`${O}${j}`:O,A=!(h||v),L={...M&&!A?Nr(y):{backgroundImage:w||void 0},backgroundColor:a.color,minHeight:I||R||void 0},D={objectPosition:g&&A?Jr(g):void 0},F=!!(y||a.color||w),G=V||M&&(!h||v),U=e=>{const[t,n]=P.current?[P.current.style,"objectPosition"]:[$.current.style,"backgroundPosition"];t[n]=Jr(e)},q=Object(Ye.useSelect)(e=>e(Ce.store).getBlock(t).innerBlocks.length>0,[t]),W=Object(Te.createElement)(Te.Fragment,null,Object(Te.createElement)(Ce.BlockControls,{group:"block"},Object(Te.createElement)(Ce.__experimentalBlockAlignmentMatrixControl,{label:Object(Be.__)("Change content position"),value:m,onChange:e=>c({contentPosition:e}),isDisabled:!q}),Object(Te.createElement)(Ce.__experimentalBlockFullHeightAligmentControl,{isActive:z,onToggle:()=>z?c("vh"===B&&100===x?{minHeight:void 0,minHeightUnit:void 0}:{minHeight:x,minHeightUnit:B}):(S(O),T(j),c({minHeight:100,minHeightUnit:"vh"})),isDisabled:!q})),Object(Te.createElement)(Ce.BlockControls,{group:"other"},Object(Te.createElement)(Ce.MediaReplaceFlow,{mediaId:d,mediaURL:y,allowedTypes:Mr,accept:"image/*,video/*",onSelect:E,name:y?Object(Be.__)("Replace"):Object(Be.__)("Add Media")})),Object(Te.createElement)(Ce.InspectorControls,null,!!y&&Object(Te.createElement)(Le.PanelBody,{title:Object(Be.__)("Media settings")},M&&Object(Te.createElement)(Te.Fragment,null,Object(Te.createElement)(Le.ToggleControl,{label:Object(Be.__)("Fixed background"),checked:h,onChange:()=>{c({hasParallax:!h,...h?{}:{focalPoint:void 0}})}}),Object(Te.createElement)(Le.ToggleControl,{label:Object(Be.__)("Repeated background"),checked:v,onChange:()=>{c({isRepeated:!v})}})),G&&Object(Te.createElement)(Le.FocalPointPicker,{label:Object(Be.__)("Focal point picker"),url:y,value:g,onDragStart:U,onDrag:U,onChange:e=>c({focalPoint:e})}),Object(Te.createElement)(Le.PanelRow,null,Object(Te.createElement)(Le.Button,{isSecondary:!0,isSmall:!0,className:"block-library-cover__reset-button",onClick:()=>c({url:void 0,id:void 0,backgroundType:void 0,dimRatio:void 0,focalPoint:void 0,hasParallax:void 0,isRepeated:void 0})},Object(Be.__)("Clear Media")))),Object(Te.createElement)(Le.PanelBody,{title:Object(Be.__)("Dimensions")},Object(Te.createElement)($r,{value:I||O,unit:j,onChange:e=>c({minHeight:e}),onUnitChange:e=>c({minHeightUnit:e})})),Object(Te.createElement)(Ce.__experimentalPanelColorGradientSettings,{title:Object(Be.__)("Overlay"),initialOpen:!0,settings:[{colorValue:a.color,gradientValue:w,onColorChange:l,onGradientChange:k,label:Object(Be.__)("Color")}]},!!y&&Object(Te.createElement)(Le.RangeControl,{label:Object(Be.__)("Opacity"),value:p,onChange:e=>c({dimRatio:e}),min:0,max:100,step:10,required:!0})))),$=Object(Te.useRef)(),Z=Object(Ce.useBlockProps)({ref:$}),Q=Object(Ce.__experimentalUseInnerBlocksProps)({className:"wp-block-cover__inner-container"},{template:Ur,templateInsertUpdatesSelection:!0});if(!q&&!F)return Object(Te.createElement)(Te.Fragment,null,W,Object(Te.createElement)("div",Object(Ae.a)({},Z,{className:Me()("is-placeholder",Z.className)}),Object(Te.createElement)(Kr,{noticeUI:o,onSelectMedia:E,noticeOperations:r},Object(Te.createElement)("div",{className:"wp-block-cover__placeholder-background-options"},Object(Te.createElement)(Ce.ColorPalette,{disableCustomColors:!0,value:a.color,onChange:l,clearable:!1})))));const J=Me()(Vr(p),{"is-dark-theme":N,"has-background-dim":0!==p,"is-transient":C,"has-parallax":h,"is-repeated":v,[a.class]:a.class,"has-background-gradient":w,[_]:!y&&_,"has-custom-content-position":!Ir(m)},Hr(m));return Object(Te.createElement)(Te.Fragment,null,W,Object(Te.createElement)("div",Object(Ae.a)({},Z,{className:Me()(J,Z.className),style:{...L,...Z.style},"data-url":y}),Object(Te.createElement)(qr,{values:null==f||null===(s=f.spacing)||void 0===s?void 0:s.padding,showValues:null==f||null===(u=f.visualizers)||void 0===u?void 0:u.padding}),Object(Te.createElement)(Qr,{className:"block-library-cover__resize-container",onResizeStart:()=>{c({minHeightUnit:"px"}),i(!1)},onResize:H,onResizeStop:e=>{i(!0),c({minHeight:e}),H(null)},showHandle:n}),y&&w&&0!==p&&Object(Te.createElement)("span",{"aria-hidden":"true",className:Me()("wp-block-cover__gradient-background",_),style:{backgroundImage:w}}),y&&M&&A&&Object(Te.createElement)("img",{ref:P,className:"wp-block-cover__image-background",alt:"",src:y,style:D}),y&&V&&Object(Te.createElement)("video",{ref:P,className:"wp-block-cover__video-background",autoPlay:!0,muted:!0,loop:!0,src:y,style:D}),C&&Object(Te.createElement)(Le.Spinner,null),Object(Te.createElement)(Kr,{disableMediaButtons:!0,noticeUI:o,onSelectMedia:E,noticeOperations:r}),Object(Te.createElement)("div",Q)))})),Xr={from:[{type:"block",blocks:["core/image"],transform:({caption:e,url:t,align:n,id:o,anchor:r,style:a})=>{var c;return Object(xe.createBlock)("core/cover",{url:t,align:n,id:o,anchor:r,style:{color:{duotone:null==a||null===(c=a.color)||void 0===c?void 0:c.duotone}}},[Object(xe.createBlock)("core/paragraph",{content:e,fontSize:"large"})])}},{type:"block",blocks:["core/video"],transform:({caption:e,src:t,align:n,id:o,anchor:r})=>Object(xe.createBlock)("core/cover",{url:t,align:n,id:o,backgroundType:"video",anchor:r},[Object(xe.createBlock)("core/paragraph",{content:e,fontSize:"large"})])},{type:"block",blocks:["core/group"],isMatch:({backgroundColor:e,gradient:t,style:n})=>{var o,r;return e||(null==n||null===(o=n.color)||void 0===o?void 0:o.background)||(null==n||null===(r=n.color)||void 0===r?void 0:r.gradient)||t},transform:({align:e,anchor:t,backgroundColor:n,gradient:o,style:r},a)=>{var c,l;return Object(xe.createBlock)("core/cover",{align:e,anchor:t,overlayColor:n,customOverlayColor:null==r||null===(c=r.color)||void 0===c?void 0:c.background,gradient:o,customGradient:null==r||null===(l=r.color)||void 0===l?void 0:l.gradient},a)}}],to:[{type:"block",blocks:["core/image"],isMatch:({backgroundType:e,url:t,overlayColor:n,customOverlayColor:o,gradient:r,customGradient:a})=>t?"image"===e:!(n||o||r||a),transform:({title:e,url:t,align:n,id:o,anchor:r,style:a})=>Object(xe.createBlock)("core/image",{caption:e,url:t,align:n,id:o,anchor:r,style:{color:{duotone:a.color.duotone}}})},{type:"block",blocks:["core/video"],isMatch:({backgroundType:e,url:t,overlayColor:n,customOverlayColor:o,gradient:r,customGradient:a})=>t?"video"===e:!(n||o||r||a),transform:({title:e,url:t,align:n,id:o,anchor:r})=>Object(xe.createBlock)("core/video",{caption:e,src:t,id:o,align:n,anchor:r})}]};const ea={apiVersion:2,name:"core/cover",title:"Cover",category:"media",description:"Add an image or video with a text overlay — great for headers.",textdomain:"default",attributes:{url:{type:"string"},id:{type:"number"},hasParallax:{type:"boolean",default:!1},isRepeated:{type:"boolean",default:!1},dimRatio:{type:"number",default:50},overlayColor:{type:"string"},customOverlayColor:{type:"string"},backgroundType:{type:"string",default:"image"},focalPoint:{type:"object"},minHeight:{type:"number"},minHeightUnit:{type:"string"},gradient:{type:"string"},customGradient:{type:"string"},contentPosition:{type:"string"}},supports:{anchor:!0,align:!0,html:!1,spacing:{padding:!0},color:{__experimentalDuotone:"> .wp-block-cover__image-background, > .wp-block-cover__video-background",text:!1,background:!1}},editorStyle:"wp-block-cover-editor",style:"wp-block-cover"},{name:ta}=ea,na={icon:zr,example:{attributes:{customOverlayColor:"#065174",dimRatio:40,url:"https://s.w.org/images/core/5.3/Windbuchencom.jpg"},innerBlocks:[{name:"core/paragraph",attributes:{customFontSize:48,content:Object(Be.__)("<strong>Snow Patrol</strong>"),align:"center"}}]},transforms:Xr,save:function({attributes:e}){const{backgroundType:t,gradient:n,contentPosition:o,customGradient:r,customOverlayColor:a,dimRatio:c,focalPoint:l,hasParallax:i,isRepeated:s,overlayColor:u,url:m,id:d,minHeight:b,minHeightUnit:p}=e,g=Object(Ce.getColorClassName)("background-color",u),h=Object(Ce.__experimentalGetGradientClass)(n),v=p?`${b}${p}`:b,O="image"===t,j="video"===t,f=!(i||s),y={...O&&!f?Nr(m):{},backgroundColor:g?void 0:a,background:r&&!m?r:void 0,minHeight:v||void 0},_=l&&f?`${Math.round(100*l.x)}% ${Math.round(100*l.y)}%`:void 0,w=Me()(Vr(c),g,{"has-background-dim":0!==c,"has-parallax":i,"is-repeated":s,"has-background-gradient":n||r,[h]:!m&&h,"has-custom-content-position":!Ir(o)},Hr(o));return Object(Te.createElement)("div",Ce.useBlockProps.save({className:w,style:y}),m&&(n||r)&&0!==c&&Object(Te.createElement)("span",{"aria-hidden":"true",className:Me()("wp-block-cover__gradient-background",h),style:r?{background:r}:void 0}),O&&f&&m&&Object(Te.createElement)("img",{className:Me()("wp-block-cover__image-background",d?"wp-image-"+d:null),alt:"",src:m,style:{objectPosition:_},"data-object-fit":"cover","data-object-position":_}),j&&m&&Object(Te.createElement)("video",{className:Me()("wp-block-cover__video-background","intrinsic-ignore"),autoPlay:!0,muted:!0,loop:!0,playsInline:!0,src:m,style:{objectPosition:_},"data-object-fit":"cover","data-object-position":_}),Object(Te.createElement)("div",{className:"wp-block-cover__inner-container"},Object(Te.createElement)(Ce.InnerBlocks.Content,null)))},edit:Yr,deprecated:Ar};var oa=({blockSupportsResponsive:e,showEditButton:t,themeSupportsResponsive:n,allowResponsive:o,getResponsiveHelp:r,toggleResponsive:a,switchBackToURLInput:c})=>Object(Te.createElement)(Te.Fragment,null,Object(Te.createElement)(Ce.BlockControls,null,Object(Te.createElement)(Le.ToolbarGroup,null,t&&Object(Te.createElement)(Le.ToolbarButton,{className:"components-toolbar__control",label:Object(Be.__)("Edit URL"),icon:qn.a,onClick:c}))),n&&e&&Object(Te.createElement)(Ce.InspectorControls,null,Object(Te.createElement)(Le.PanelBody,{title:Object(Be.__)("Media settings"),className:"blocks-responsive"},Object(Te.createElement)(Le.ToggleControl,{label:Object(Be.__)("Resize for smaller devices"),checked:o,help:r,onChange:a}))));const ra=Object(Te.createElement)(Le.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(Te.createElement)(Le.Path,{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm.5 16c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V9.8l4.7-5.3H19c.3 0 .5.2.5.5v14zm-6-9.5L16 12l-2.5 2.8 1.1 1L18 12l-3.5-3.5-1 1zm-3 0l-1-1L6 12l3.5 3.8 1.1-1L8 12l2.5-2.5z"})),aa=Object(Te.createElement)(Le.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(Te.createElement)(Le.Path,{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm.5 16c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V9.8l4.7-5.3H19c.3 0 .5.2.5.5v14zM13.2 7.7c-.4.4-.7 1.1-.7 1.9v3.7c-.4-.3-.8-.4-1.3-.4-1.2 0-2.2 1-2.2 2.2 0 1.2 1 2.2 2.2 2.2.5 0 1-.2 1.4-.5.9-.6 1.4-1.6 1.4-2.6V9.6c0-.4.1-.6.2-.8.3-.3 1-.3 1.6-.3h.2V7h-.2c-.7 0-1.8 0-2.6.7z"})),ca=Object(Te.createElement)(Le.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(Te.createElement)(Le.Path,{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9.2 4.5H19c.3 0 .5.2.5.5v8.4l-3-2.9c-.3-.3-.8-.3-1 0L11.9 14 9 12c-.3-.2-.6-.2-.8 0l-3.6 2.6V9.8l4.6-5.3zm9.8 15H5c-.3 0-.5-.2-.5-.5v-2.4l4.1-3 3 1.9c.3.2.7.2.9-.1L16 12l3.5 3.4V19c0 .3-.2.5-.5.5z"})),la=Object(Te.createElement)(Le.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(Te.createElement)(Le.Path,{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm.5 16c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V9.8l4.7-5.3H19c.3 0 .5.2.5.5v14zM10 15l5-3-5-3v6z"})),ia={foreground:"#1da1f2",src:Object(Te.createElement)(Le.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(Te.createElement)(Le.G,null,Object(Te.createElement)(Le.Path,{d:"M22.23 5.924c-.736.326-1.527.547-2.357.646.847-.508 1.498-1.312 1.804-2.27-.793.47-1.67.812-2.606.996C18.325 4.498 17.258 4 16.078 4c-2.266 0-4.103 1.837-4.103 4.103 0 .322.036.635.106.935-3.41-.17-6.433-1.804-8.457-4.287-.353.607-.556 1.312-.556 2.064 0 1.424.724 2.68 1.825 3.415-.673-.022-1.305-.207-1.86-.514v.052c0 1.988 1.415 3.647 3.293 4.023-.344.095-.707.145-1.08.145-.265 0-.522-.026-.773-.074.522 1.63 2.038 2.817 3.833 2.85-1.404 1.1-3.174 1.757-5.096 1.757-.332 0-.66-.02-.98-.057 1.816 1.164 3.973 1.843 6.29 1.843 7.547 0 11.675-6.252 11.675-11.675 0-.178-.004-.355-.012-.53.802-.578 1.497-1.3 2.047-2.124z"})))},sa={foreground:"#ff0000",src:Object(Te.createElement)(Le.SVG,{viewBox:"0 0 24 24"},Object(Te.createElement)(Le.Path,{d:"M21.8 8s-.195-1.377-.795-1.984c-.76-.797-1.613-.8-2.004-.847-2.798-.203-6.996-.203-6.996-.203h-.01s-4.197 0-6.996.202c-.39.046-1.242.05-2.003.846C2.395 6.623 2.2 8 2.2 8S2 9.62 2 11.24v1.517c0 1.618.2 3.237.2 3.237s.195 1.378.795 1.985c.76.797 1.76.77 2.205.855 1.6.153 6.8.2 6.8.2s4.203-.005 7-.208c.392-.047 1.244-.05 2.005-.847.6-.607.795-1.985.795-1.985s.2-1.618.2-3.237v-1.517C22 9.62 21.8 8 21.8 8zM9.935 14.595v-5.62l5.403 2.82-5.403 2.8z"}))},ua={foreground:"#3b5998",src:Object(Te.createElement)(Le.SVG,{viewBox:"0 0 24 24"},Object(Te.createElement)(Le.Path,{d:"M20 3H4c-.6 0-1 .4-1 1v16c0 .5.4 1 1 1h8.6v-7h-2.3v-2.7h2.3v-2c0-2.3 1.4-3.6 3.5-3.6 1 0 1.8.1 2.1.1v2.4h-1.4c-1.1 0-1.3.5-1.3 1.3v1.7h2.7l-.4 2.8h-2.3v7H20c.5 0 1-.4 1-1V4c0-.6-.4-1-1-1z"}))},ma=Object(Te.createElement)(Le.SVG,{viewBox:"0 0 24 24"},Object(Te.createElement)(Le.G,null,Object(Te.createElement)(Le.Path,{d:"M12 4.622c2.403 0 2.688.01 3.637.052.877.04 1.354.187 1.67.31.42.163.72.358 1.036.673.315.315.51.615.673 1.035.123.317.27.794.31 1.67.043.95.052 1.235.052 3.638s-.01 2.688-.052 3.637c-.04.877-.187 1.354-.31 1.67-.163.42-.358.72-.673 1.036-.315.315-.615.51-1.035.673-.317.123-.794.27-1.67.31-.95.043-1.234.052-3.638.052s-2.688-.01-3.637-.052c-.877-.04-1.354-.187-1.67-.31-.42-.163-.72-.358-1.036-.673-.315-.315-.51-.615-.673-1.035-.123-.317-.27-.794-.31-1.67-.043-.95-.052-1.235-.052-3.638s.01-2.688.052-3.637c.04-.877.187-1.354.31-1.67.163-.42.358-.72.673-1.036.315-.315.615-.51 1.035-.673.317-.123.794-.27 1.67-.31.95-.043 1.235-.052 3.638-.052M12 3c-2.444 0-2.75.01-3.71.054s-1.613.196-2.185.418c-.592.23-1.094.538-1.594 1.04-.5.5-.807 1-1.037 1.593-.223.572-.375 1.226-.42 2.184C3.01 9.25 3 9.555 3 12s.01 2.75.054 3.71.196 1.613.418 2.186c.23.592.538 1.094 1.038 1.594s1.002.808 1.594 1.038c.572.222 1.227.375 2.185.418.96.044 1.266.054 3.71.054s2.75-.01 3.71-.054 1.613-.196 2.186-.418c.592-.23 1.094-.538 1.594-1.038s.808-1.002 1.038-1.594c.222-.572.375-1.227.418-2.185.044-.96.054-1.266.054-3.71s-.01-2.75-.054-3.71-.196-1.613-.418-2.186c-.23-.592-.538-1.094-1.038-1.594s-1.002-.808-1.594-1.038c-.572-.222-1.227-.375-2.185-.418C14.75 3.01 14.445 3 12 3zm0 4.378c-2.552 0-4.622 2.07-4.622 4.622s2.07 4.622 4.622 4.622 4.622-2.07 4.622-4.622S14.552 7.378 12 7.378zM12 15c-1.657 0-3-1.343-3-3s1.343-3 3-3 3 1.343 3 3-1.343 3-3 3zm4.804-8.884c-.596 0-1.08.484-1.08 1.08s.484 1.08 1.08 1.08c.596 0 1.08-.484 1.08-1.08s-.483-1.08-1.08-1.08z"}))),da={foreground:"#0073AA",src:Object(Te.createElement)(Le.SVG,{viewBox:"0 0 24 24"},Object(Te.createElement)(Le.G,null,Object(Te.createElement)(Le.Path,{d:"M12.158 12.786l-2.698 7.84c.806.236 1.657.365 2.54.365 1.047 0 2.05-.18 2.986-.51-.024-.037-.046-.078-.065-.123l-2.762-7.57zM3.008 12c0 3.56 2.07 6.634 5.068 8.092L3.788 8.342c-.5 1.117-.78 2.354-.78 3.658zm15.06-.454c0-1.112-.398-1.88-.74-2.48-.456-.74-.883-1.368-.883-2.11 0-.825.627-1.595 1.51-1.595.04 0 .078.006.116.008-1.598-1.464-3.73-2.36-6.07-2.36-3.14 0-5.904 1.613-7.512 4.053.21.008.41.012.58.012.94 0 2.395-.114 2.395-.114.484-.028.54.684.057.74 0 0-.487.058-1.03.086l3.275 9.74 1.968-5.902-1.4-3.838c-.485-.028-.944-.085-.944-.085-.486-.03-.43-.77.056-.742 0 0 1.484.114 2.368.114.94 0 2.397-.114 2.397-.114.486-.028.543.684.058.74 0 0-.488.058-1.03.086l3.25 9.665.897-2.997c.456-1.17.684-2.137.684-2.907zm1.82-3.86c.04.286.06.593.06.924 0 .912-.17 1.938-.683 3.22l-2.746 7.94c2.672-1.558 4.47-4.454 4.47-7.77 0-1.564-.4-3.033-1.1-4.314zM12 22C6.486 22 2 17.514 2 12S6.486 2 12 2s10 4.486 10 10-4.486 10-10 10z"})))},ba={foreground:"#1db954",src:Object(Te.createElement)(Le.SVG,{viewBox:"0 0 24 24"},Object(Te.createElement)(Le.Path,{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2m4.586 14.424c-.18.295-.563.387-.857.207-2.35-1.434-5.305-1.76-8.786-.963-.335.077-.67-.133-.746-.47-.077-.334.132-.67.47-.745 3.808-.87 7.076-.496 9.712 1.115.293.18.386.563.206.857M17.81 13.7c-.226.367-.706.482-1.072.257-2.687-1.652-6.785-2.13-9.965-1.166-.413.127-.848-.106-.973-.517-.125-.413.108-.848.52-.973 3.632-1.102 8.147-.568 11.234 1.328.366.226.48.707.256 1.072m.105-2.835C14.692 8.95 9.375 8.775 6.297 9.71c-.493.15-1.016-.13-1.166-.624-.148-.495.13-1.017.625-1.167 3.532-1.073 9.404-.866 13.115 1.337.445.264.59.838.327 1.282-.264.443-.838.59-1.282.325"}))},pa=Object(Te.createElement)(Le.SVG,{viewBox:"0 0 24 24"},Object(Te.createElement)(Le.Path,{d:"m6.5 7c-2.75 0-5 2.25-5 5s2.25 5 5 5 5-2.25 5-5-2.25-5-5-5zm11 0c-2.75 0-5 2.25-5 5s2.25 5 5 5 5-2.25 5-5-2.25-5-5-5z"})),ga={foreground:"#1ab7ea",src:Object(Te.createElement)(Le.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(Te.createElement)(Le.G,null,Object(Te.createElement)(Le.Path,{d:"M22.396 7.164c-.093 2.026-1.507 4.8-4.245 8.32C15.323 19.16 12.93 21 10.97 21c-1.214 0-2.24-1.12-3.08-3.36-.56-2.052-1.118-4.105-1.68-6.158-.622-2.24-1.29-3.36-2.004-3.36-.156 0-.7.328-1.634.98l-.978-1.26c1.027-.903 2.04-1.806 3.037-2.71C6 3.95 7.03 3.328 7.716 3.265c1.62-.156 2.616.95 2.99 3.32.404 2.558.685 4.148.84 4.77.468 2.12.982 3.18 1.543 3.18.435 0 1.09-.687 1.963-2.064.872-1.376 1.34-2.422 1.402-3.142.125-1.187-.343-1.782-1.4-1.782-.5 0-1.013.115-1.542.34 1.023-3.35 2.977-4.976 5.862-4.883 2.14.063 3.148 1.45 3.024 4.16z"})))},ha=Object(Te.createElement)(Le.SVG,{viewBox:"0 0 24 24"},Object(Te.createElement)(Le.Path,{d:"M22 11.816c0-1.256-1.02-2.277-2.277-2.277-.593 0-1.122.24-1.526.613-1.48-.965-3.455-1.594-5.647-1.69l1.17-3.702 3.18.75c.01 1.027.847 1.86 1.877 1.86 1.035 0 1.877-.84 1.877-1.877 0-1.035-.842-1.877-1.877-1.877-.77 0-1.43.466-1.72 1.13L13.55 3.92c-.204-.047-.4.067-.46.26l-1.35 4.27c-2.317.037-4.412.67-5.97 1.67-.402-.355-.917-.58-1.493-.58C3.02 9.54 2 10.56 2 11.815c0 .814.433 1.523 1.078 1.925-.037.222-.06.445-.06.673 0 3.292 4.01 5.97 8.94 5.97s8.94-2.678 8.94-5.97c0-.214-.02-.424-.052-.632.687-.39 1.154-1.12 1.154-1.964zm-3.224-7.422c.606 0 1.1.493 1.1 1.1s-.493 1.1-1.1 1.1-1.1-.494-1.1-1.1.493-1.1 1.1-1.1zm-16 7.422c0-.827.673-1.5 1.5-1.5.313 0 .598.103.838.27-.85.675-1.477 1.478-1.812 2.36-.32-.274-.525-.676-.525-1.13zm9.183 7.79c-4.502 0-8.165-2.33-8.165-5.193S7.457 9.22 11.96 9.22s8.163 2.33 8.163 5.193-3.663 5.193-8.164 5.193zM20.635 13c-.326-.89-.948-1.7-1.797-2.383.247-.186.55-.3.882-.3.827 0 1.5.672 1.5 1.5 0 .482-.23.91-.586 1.184zm-11.64 1.704c-.76 0-1.397-.616-1.397-1.376 0-.76.636-1.397 1.396-1.397.76 0 1.376.638 1.376 1.398 0 .76-.616 1.376-1.376 1.376zm7.405-1.376c0 .76-.615 1.376-1.375 1.376s-1.4-.616-1.4-1.376c0-.76.64-1.397 1.4-1.397.76 0 1.376.638 1.376 1.398zm-1.17 3.38c.15.152.15.398 0 .55-.675.674-1.728 1.002-3.22 1.002l-.01-.002-.012.002c-1.492 0-2.544-.328-3.218-1.002-.152-.152-.152-.398 0-.55.152-.152.4-.15.55 0 .52.52 1.394.775 2.67.775l.01.002.01-.002c1.276 0 2.15-.253 2.67-.775.15-.152.398-.152.55 0z"})),va={foreground:"#35465c",src:Object(Te.createElement)(Le.SVG,{viewBox:"0 0 24 24"},Object(Te.createElement)(Le.Path,{d:"M19 3H5a2 2 0 00-2 2v14c0 1.1.9 2 2 2h14a2 2 0 002-2V5a2 2 0 00-2-2zm-5.69 14.66c-2.72 0-3.1-1.9-3.1-3.16v-3.56H8.49V8.99c1.7-.62 2.54-1.99 2.64-2.87 0-.06.06-.41.06-.58h1.9v3.1h2.17v2.3h-2.18v3.1c0 .47.13 1.3 1.2 1.26h1.1v2.36c-1.01.02-2.07 0-2.07 0z"}))},Oa=Object(Te.createElement)(Le.SVG,{viewBox:"0 0 24 24"},Object(Te.createElement)(Le.Path,{d:"M18.42 14.58c-.51-.66-1.05-1.23-1.05-2.5V7.87c0-1.8.15-3.45-1.2-4.68-1.05-1.02-2.79-1.35-4.14-1.35-2.6 0-5.52.96-6.12 4.14-.06.36.18.54.4.57l2.66.3c.24-.03.42-.27.48-.5.24-1.12 1.17-1.63 2.2-1.63.56 0 1.22.21 1.55.7.4.56.33 1.31.33 1.97v.36c-1.59.18-3.66.27-5.16.93a4.63 4.63 0 0 0-2.93 4.44c0 2.82 1.8 4.23 4.1 4.23 1.95 0 3.03-.45 4.53-1.98.51.72.66 1.08 1.59 1.83.18.09.45.09.63-.1v.04l2.1-1.8c.24-.21.2-.48.03-.75zm-5.4-1.2c-.45.75-1.14 1.23-1.92 1.23-1.05 0-1.65-.81-1.65-1.98 0-2.31 2.1-2.73 4.08-2.73v.6c0 1.05.03 1.92-.5 2.88z"}),Object(Te.createElement)(Le.Path,{d:"M21.69 19.2a17.62 17.62 0 0 1-21.6-1.57c-.23-.2 0-.5.28-.33a23.88 23.88 0 0 0 20.93 1.3c.45-.19.84.3.39.6z"}),Object(Te.createElement)(Le.Path,{d:"M22.8 17.96c-.36-.45-2.22-.2-3.1-.12-.23.03-.3-.18-.05-.36 1.5-1.05 3.96-.75 4.26-.39.3.36-.1 2.82-1.5 4.02-.21.18-.42.1-.3-.15.3-.8 1.02-2.58.69-3z"})),ja=Object(Te.createElement)(Le.SVG,{viewBox:"0 0 24 24"},Object(Te.createElement)(Le.Path,{d:"m.0206909 21 19.8160091-13.07806 3.5831 6.20826z",fill:"#4bc7ee"}),Object(Te.createElement)(Le.Path,{d:"m23.7254 19.0205-10.1074-17.18468c-.6421-1.114428-1.7087-1.114428-2.3249 0l-11.2931 19.16418h22.5655c1.279 0 1.8019-.8905 1.1599-1.9795z",fill:"#d4cdcb"}),Object(Te.createElement)(Le.Path,{d:"m.0206909 21 15.2439091-16.38571 4.3029 7.32271z",fill:"#c3d82e"}),Object(Te.createElement)(Le.Path,{d:"m13.618 1.83582c-.6421-1.114428-1.7087-1.114428-2.3249 0l-11.2931 19.16418 15.2646-16.38573z",fill:"#e4ecb0"}),Object(Te.createElement)(Le.Path,{d:"m.0206909 21 19.5468091-9.063 1.6621 2.8344z",fill:"#209dbd"}),Object(Te.createElement)(Le.Path,{d:"m.0206909 21 17.9209091-11.82623 1.6259 2.76323z",fill:"#7cb3c9"})),fa=Object(Te.createElement)(Le.SVG,{viewBox:"0 0 24 24"},Object(Te.createElement)(Le.Path,{d:"m12.1479 18.5957c-2.4949 0-4.28131-1.7558-4.28131-4.0658 0-2.2176 1.78641-4.0965 4.09651-4.0965 2.2793 0 4.0349 1.7864 4.0349 4.1581 0 2.2794-1.7556 4.0042-3.8501 4.0042zm8.3521-18.5957-4.5329 1v7c-1.1088-1.41691-2.8028-1.8787-4.8049-1.8787-2.09443 0-3.97329.76993-5.5133 2.27917-1.72483 1.66323-2.6489 3.78863-2.6489 6.16033 0 2.5873.98562 4.8049 2.89526 6.499 1.44763 1.2936 3.17251 1.9402 5.17454 1.9402 1.9713 0 3.4498-.5236 4.8973-1.9402v1.9402h4.5329c0-7.6359 0-15.3641 0-23z",fill:"#333436"}));var ya=()=>Object(Te.createElement)("div",{className:"wp-block-embed is-loading"},Object(Te.createElement)(Le.Spinner,null),Object(Te.createElement)("p",null,Object(Be.__)("Embedding…"))),_a=({icon:e,label:t,value:n,onSubmit:o,onChange:r,cannotEmbed:a,fallback:c,tryAgain:l})=>Object(Te.createElement)(Le.Placeholder,{icon:Object(Te.createElement)(Ce.BlockIcon,{icon:e,showColors:!0}),label:t,className:"wp-block-embed",instructions:Object(Be.__)("Paste a link to the content you want to display on your site.")},Object(Te.createElement)("form",{onSubmit:o},Object(Te.createElement)("input",{type:"url",value:n||"",className:"components-placeholder__input","aria-label":t,placeholder:Object(Be.__)("Enter URL to embed here…"),onChange:r}),Object(Te.createElement)(Le.Button,{isPrimary:!0,type:"submit"},Object(Be._x)("Embed","button label"))),Object(Te.createElement)("div",{className:"components-placeholder__learn-more"},Object(Te.createElement)(Le.ExternalLink,{href:Object(Be.__)("https://wordpress.org/support/article/embeds/")},Object(Be.__)("Learn more about embeds"))),a&&Object(Te.createElement)("div",{className:"components-placeholder__error"},Object(Te.createElement)("div",{className:"components-placeholder__instructions"},Object(Be.__)("Sorry, this content could not be embedded.")),Object(Te.createElement)(Le.Button,{isSecondary:!0,onClick:l},Object(Be._x)("Try again","button label"))," ",Object(Te.createElement)(Le.Button,{isSecondary:!0,onClick:c},Object(Be._x)("Convert to link","button label"))));function wa({html:e}){const t=Object(Te.useRef)();Object(Te.useEffect)(()=>{const{ownerDocument:e}=t.current,{defaultView:n}=e;function o({data:{secret:t,message:n,value:o}={}}){[t,n,o].some(e=>!e)||"height"!==n||e.querySelectorAll(`iframe[data-secret="${t}"`).forEach(e=>{+e.height!==o&&(e.height=o)})}function r(){const{activeElement:n}=e;"IFRAME"===n.tagName&&n.parentNode===t.current&&n.focus()}return n.addEventListener("message",o),n.addEventListener("blur",r),()=>{n.removeEventListener("message",o),n.removeEventListener("blur",r)}},[]);const n=Object(Te.useMemo)(()=>{const t=(new window.DOMParser).parseFromString(e,"text/html"),n=t.querySelector("iframe");n&&n.removeAttribute("style");const o=t.querySelector("blockquote");return o&&(o.style.display="none"),t.body.innerHTML},[e]);return Object(Te.createElement)("div",{ref:t,className:"wp-block-embed__wrapper",dangerouslySetInnerHTML:{__html:n}})}class ka extends Te.Component{constructor(){super(...arguments),this.hideOverlay=this.hideOverlay.bind(this),this.state={interactive:!1}}static getDerivedStateFromProps(e,t){return!e.isSelected&&t.interactive?{interactive:!1}:null}hideOverlay(){this.setState({interactive:!0})}render(){const{preview:e,previewable:t,url:n,type:o,caption:r,onCaptionChange:a,isSelected:c,className:l,icon:i,label:s,insertBlocksAfter:u}=this.props,{scripts:m}=e,{interactive:d}=this.state,b="photo"===o?(e=>{const t=e.thumbnail_url||e.url,n=Object(Te.createElement)("p",null,Object(Te.createElement)("img",{src:t,alt:e.title,width:"100%"}));return Object(Te.renderToString)(n)})(e):e.html,p=new URL(n).host.split("."),g=p.splice(p.length-2,p.length-1).join("."),h=Object(Be.sprintf)(// translators: %s: host providing embed content e.g: www.youtube.com
|
29 |
Object(Be.__)("Embedded content from %s"),g),v=lt()(o,l,"wp-block-embed__wrapper"),O="wp-embed"===o?Object(Te.createElement)(wa,{html:b}):Object(Te.createElement)("div",{className:"wp-block-embed__wrapper"},Object(Te.createElement)(Le.SandBox,{html:b,scripts:m,title:h,type:v,onFocus:this.hideOverlay}),!d&&Object(Te.createElement)("div",{className:"block-library-embed__interactive-overlay",onMouseUp:this.hideOverlay}));return Object(Te.createElement)("figure",{className:lt()(l,"wp-block-embed",{"is-type-video":"video"===o})},t?O:Object(Te.createElement)(Le.Placeholder,{icon:Object(Te.createElement)(Ce.BlockIcon,{icon:i,showColors:!0}),label:s},Object(Te.createElement)("p",{className:"components-placeholder__error"},Object(Te.createElement)("a",{href:n},n)),Object(Te.createElement)("p",{className:"components-placeholder__error"},Object(Be.sprintf)(
|
30 |
/* translators: %s: host providing embed content e.g: www.youtube.com */
|
31 |
Object(Be.__)("Embedded content from %s can't be previewed in the editor."),g))),(!Ce.RichText.isEmpty(r)||c)&&Object(Te.createElement)(Ce.RichText,{tagName:"figcaption",placeholder:Object(Be.__)("Add caption"),value:r,onChange:a,inlineToolbar:!0,__unstableOnSplitAtEnd:()=>u(Object(xe.createBlock)("core/paragraph"))}))}}var Ea=ka;function Ca(e){return e?Object(Be.__)("This embed will preserve its aspect ratio when the browser is resized."):Object(Be.__)("This embed may not preserve its aspect ratio when the browser is resized.")}const{name:xa}={apiVersion:2,name:"core/embed",title:"Embed",category:"embed",description:"Add a block that displays content pulled from other sites, like Twitter, Instagram or YouTube.",textdomain:"default",attributes:{url:{type:"string"},caption:{type:"string",source:"html",selector:"figcaption"},type:{type:"string"},providerNameSlug:{type:"string"},allowResponsive:{type:"boolean",default:!0},responsive:{type:"boolean",default:!1},previewable:{type:"boolean",default:!0}},supports:{align:!0},editorStyle:"wp-block-embed-editor",style:"wp-block-embed"};var Sa={from:[{type:"raw",isMatch:e=>{var t,n;return"P"===e.nodeName&&/^\s*(https?:\/\/\S+)\s*$/i.test(e.textContent)&&1===(null===(t=e.textContent)||void 0===t||null===(n=t.match(/https/gi))||void 0===n?void 0:n.length)},transform:e=>Object(xe.createBlock)(xa,{url:e.textContent.trim()})}],to:[{type:"block",blocks:["core/paragraph"],transform:({url:e,caption:t})=>{const n=Object(Te.createElement)("a",{href:e},t||e);return Object(xe.createBlock)("core/paragraph",{content:Object(Te.renderToString)(n)})}}]};const Ba=[{name:"twitter",title:"Twitter",icon:ia,keywords:["tweet",Object(Be.__)("social")],description:Object(Be.__)("Embed a tweet."),patterns:[/^https?:\/\/(www\.)?twitter\.com\/.+/i],attributes:{providerNameSlug:"twitter",responsive:!0}},{name:"youtube",title:"YouTube",icon:sa,keywords:[Object(Be.__)("music"),Object(Be.__)("video")],description:Object(Be.__)("Embed a YouTube video."),patterns:[/^https?:\/\/((m|www)\.)?youtube\.com\/.+/i,/^https?:\/\/youtu\.be\/.+/i],attributes:{providerNameSlug:"youtube",responsive:!0}},{name:"facebook",title:"Facebook",icon:ua,keywords:[Object(Be.__)("social")],description:Object(Be.__)("Embed a Facebook post."),scope:["block"],patterns:[],attributes:{providerNameSlug:"facebook",previewable:!1,responsive:!0}},{name:"instagram",title:"Instagram",icon:ma,keywords:[Object(Be.__)("image"),Object(Be.__)("social")],description:Object(Be.__)("Embed an Instagram post."),scope:["block"],patterns:[],attributes:{providerNameSlug:"instagram",responsive:!0}},{name:"wordpress",title:"WordPress",icon:da,keywords:[Object(Be.__)("post"),Object(Be.__)("blog")],description:Object(Be.__)("Embed a WordPress post."),attributes:{providerNameSlug:"wordpress"}},{name:"soundcloud",title:"SoundCloud",icon:aa,keywords:[Object(Be.__)("music"),Object(Be.__)("audio")],description:Object(Be.__)("Embed SoundCloud content."),patterns:[/^https?:\/\/(www\.)?soundcloud\.com\/.+/i],attributes:{providerNameSlug:"soundcloud",responsive:!0}},{name:"spotify",title:"Spotify",icon:ba,keywords:[Object(Be.__)("music"),Object(Be.__)("audio")],description:Object(Be.__)("Embed Spotify content."),patterns:[/^https?:\/\/(open|play)\.spotify\.com\/.+/i],attributes:{providerNameSlug:"spotify",responsive:!0}},{name:"flickr",title:"Flickr",icon:pa,keywords:[Object(Be.__)("image")],description:Object(Be.__)("Embed Flickr content."),patterns:[/^https?:\/\/(www\.)?flickr\.com\/.+/i,/^https?:\/\/flic\.kr\/.+/i],attributes:{providerNameSlug:"flickr",responsive:!0}},{name:"vimeo",title:"Vimeo",icon:ga,keywords:[Object(Be.__)("video")],description:Object(Be.__)("Embed a Vimeo video."),patterns:[/^https?:\/\/(www\.)?vimeo\.com\/.+/i],attributes:{providerNameSlug:"vimeo",responsive:!0}},{name:"animoto",title:"Animoto",icon:ja,description:Object(Be.__)("Embed an Animoto video."),patterns:[/^https?:\/\/(www\.)?(animoto|video214)\.com\/.+/i],attributes:{providerNameSlug:"animoto",responsive:!0}},{name:"cloudup",title:"Cloudup",icon:ra,description:Object(Be.__)("Embed Cloudup content."),patterns:[/^https?:\/\/cloudup\.com\/.+/i],attributes:{providerNameSlug:"cloudup",responsive:!0}},{name:"collegehumor",title:"CollegeHumor",icon:la,description:Object(Be.__)("Embed CollegeHumor content."),scope:["block"],patterns:[],attributes:{providerNameSlug:"collegehumor",responsive:!0}},{name:"crowdsignal",title:"Crowdsignal",icon:ra,keywords:["polldaddy",Object(Be.__)("survey")],description:Object(Be.__)("Embed Crowdsignal (formerly Polldaddy) content."),patterns:[/^https?:\/\/((.+\.)?polldaddy\.com|poll\.fm|.+\.survey\.fm)\/.+/i],attributes:{providerNameSlug:"crowdsignal",responsive:!0}},{name:"dailymotion",title:"Dailymotion",icon:fa,keywords:[Object(Be.__)("video")],description:Object(Be.__)("Embed a Dailymotion video."),patterns:[/^https?:\/\/(www\.)?dailymotion\.com\/.+/i],attributes:{providerNameSlug:"dailymotion",responsive:!0}},{name:"imgur",title:"Imgur",icon:ca,description:Object(Be.__)("Embed Imgur content."),patterns:[/^https?:\/\/(.+\.)?imgur\.com\/.+/i],attributes:{providerNameSlug:"imgur",responsive:!0}},{name:"issuu",title:"Issuu",icon:ra,description:Object(Be.__)("Embed Issuu content."),patterns:[/^https?:\/\/(www\.)?issuu\.com\/.+/i],attributes:{providerNameSlug:"issuu",responsive:!0}},{name:"kickstarter",title:"Kickstarter",icon:ra,description:Object(Be.__)("Embed Kickstarter content."),patterns:[/^https?:\/\/(www\.)?kickstarter\.com\/.+/i,/^https?:\/\/kck\.st\/.+/i],attributes:{providerNameSlug:"kickstarter",responsive:!0}},{name:"meetup-com",title:"Meetup.com",icon:ra,description:Object(Be.__)("Embed Meetup.com content."),patterns:[/^https?:\/\/(www\.)?meetu(\.ps|p\.com)\/.+/i],attributes:{providerNameSlug:"meetup-com",responsive:!0}},{name:"mixcloud",title:"Mixcloud",icon:aa,keywords:[Object(Be.__)("music"),Object(Be.__)("audio")],description:Object(Be.__)("Embed Mixcloud content."),patterns:[/^https?:\/\/(www\.)?mixcloud\.com\/.+/i],attributes:{providerNameSlug:"mixcloud",responsive:!0}},{name:"reddit",title:"Reddit",icon:ha,description:Object(Be.__)("Embed a Reddit thread."),patterns:[/^https?:\/\/(www\.)?reddit\.com\/.+/i],attributes:{providerNameSlug:"reddit",responsive:!0}},{name:"reverbnation",title:"ReverbNation",icon:aa,description:Object(Be.__)("Embed ReverbNation content."),patterns:[/^https?:\/\/(www\.)?reverbnation\.com\/.+/i],attributes:{providerNameSlug:"reverbnation",responsive:!0}},{name:"screencast",title:"Screencast",icon:la,description:Object(Be.__)("Embed Screencast content."),patterns:[/^https?:\/\/(www\.)?screencast\.com\/.+/i],attributes:{providerNameSlug:"screencast",responsive:!0}},{name:"scribd",title:"Scribd",icon:ra,description:Object(Be.__)("Embed Scribd content."),patterns:[/^https?:\/\/(www\.)?scribd\.com\/.+/i],attributes:{providerNameSlug:"scribd",responsive:!0}},{name:"slideshare",title:"Slideshare",icon:ra,description:Object(Be.__)("Embed Slideshare content."),patterns:[/^https?:\/\/(.+?\.)?slideshare\.net\/.+/i],attributes:{providerNameSlug:"slideshare",responsive:!0}},{name:"smugmug",title:"SmugMug",icon:ca,description:Object(Be.__)("Embed SmugMug content."),patterns:[/^https?:\/\/(.+\.)?smugmug\.com\/.*/i],attributes:{providerNameSlug:"smugmug",previewable:!1,responsive:!0}},{name:"speaker-deck",title:"Speaker Deck",icon:ra,description:Object(Be.__)("Embed Speaker Deck content."),patterns:[/^https?:\/\/(www\.)?speakerdeck\.com\/.+/i],attributes:{providerNameSlug:"speaker-deck",responsive:!0}},{name:"tiktok",title:"TikTok",icon:la,keywords:[Object(Be.__)("video")],description:Object(Be.__)("Embed a TikTok video."),patterns:[/^https?:\/\/(www\.)?tiktok\.com\/.+/i],attributes:{providerNameSlug:"tiktok",responsive:!0}},{name:"ted",title:"TED",icon:la,description:Object(Be.__)("Embed a TED video."),patterns:[/^https?:\/\/(www\.|embed\.)?ted\.com\/.+/i],attributes:{providerNameSlug:"ted",responsive:!0}},{name:"tumblr",title:"Tumblr",icon:va,keywords:[Object(Be.__)("social")],description:Object(Be.__)("Embed a Tumblr post."),patterns:[/^https?:\/\/(www\.)?tumblr\.com\/.+/i],attributes:{providerNameSlug:"tumblr",responsive:!0}},{name:"videopress",title:"VideoPress",icon:la,keywords:[Object(Be.__)("video")],description:Object(Be.__)("Embed a VideoPress video."),patterns:[/^https?:\/\/videopress\.com\/.+/i],attributes:{providerNameSlug:"videopress",responsive:!0}},{name:"wordpress-tv",title:"WordPress.tv",icon:la,description:Object(Be.__)("Embed a WordPress.tv video."),patterns:[/^https?:\/\/wordpress\.tv\/.+/i],attributes:{providerNameSlug:"wordpress-tv",responsive:!0}},{name:"amazon-kindle",title:"Amazon Kindle",icon:Oa,keywords:[Object(Be.__)("ebook")],description:Object(Be.__)("Embed Amazon Kindle content."),patterns:[/^https?:\/\/([a-z0-9-]+\.)?(amazon|amzn)(\.[a-z]{2,4})+\/.+/i,/^https?:\/\/(www\.)?(a\.co|z\.cn)\/.+/i],attributes:{providerNameSlug:"amazon-kindle"}}];Ba.forEach(e=>{e.isActive||(e.isActive=(e,t)=>e.providerNameSlug===t.providerNameSlug)});var Ta=Ba;const{attributes:za}={apiVersion:2,name:"core/embed",title:"Embed",category:"embed",description:"Add a block that displays content pulled from other sites, like Twitter, Instagram or YouTube.",textdomain:"default",attributes:{url:{type:"string"},caption:{type:"string",source:"html",selector:"figcaption"},type:{type:"string"},providerNameSlug:{type:"string"},allowResponsive:{type:"boolean",default:!0},responsive:{type:"boolean",default:!1},previewable:{type:"boolean",default:!0}},supports:{align:!0},editorStyle:"wp-block-embed-editor",style:"wp-block-embed"};var Pa=[{attributes:za,save({attributes:{url:e,caption:t,type:n,providerNameSlug:o}}){if(!e)return null;const r=Me()("wp-block-embed",{["is-type-"+n]:n,["is-provider-"+o]:o});return Object(Te.createElement)("figure",{className:r},`\n${e}\n`,!Ce.RichText.isEmpty(t)&&Object(Te.createElement)(Ce.RichText.Content,{tagName:"figcaption",value:t}))}}];const Na={apiVersion:2,name:"core/embed",title:"Embed",category:"embed",description:"Add a block that displays content pulled from other sites, like Twitter, Instagram or YouTube.",textdomain:"default",attributes:{url:{type:"string"},caption:{type:"string",source:"html",selector:"figcaption"},type:{type:"string"},providerNameSlug:{type:"string"},allowResponsive:{type:"boolean",default:!0},responsive:{type:"boolean",default:!1},previewable:{type:"boolean",default:!0}},supports:{align:!0},editorStyle:"wp-block-embed-editor",style:"wp-block-embed"},{name:Ma}=Na,Va={icon:ra,edit:e=>{const{attributes:{providerNameSlug:t,previewable:n,responsive:o,url:r},attributes:a,isSelected:c,onReplace:l,setAttributes:i,insertBlocksAfter:s,onFocus:u}=e,m={title:Object(Be._x)("Embed","block title"),icon:ra},{icon:d,title:b}=(p=t,(null===(g=Object(xe.getBlockVariations)(ut))||void 0===g?void 0:g.find(({name:e})=>e===p))||m);var p,g;const[h,v]=Object(Te.useState)(r),[O,j]=Object(Te.useState)(!1),{invalidateResolution:f}=Object(Ye.useDispatch)("core/data"),{preview:y,fetching:_,themeSupportsResponsive:w,cannotEmbed:k}=Object(Ye.useSelect)(e=>{var t;const{getEmbedPreview:n,isPreviewEmbedFallback:o,isRequestingEmbedPreview:a,getThemeSupports:c}=e(Ee.store);if(!r)return{fetching:!1,cannotEmbed:!1};const l=n(r),i=o(r),s=!1===(null==l?void 0:l.html)&&void 0===(null==l?void 0:l.type),u=404===(null==l||null===(t=l.data)||void 0===t?void 0:t.status),m=!!l&&!s&&!u;return{preview:m?l:void 0,fetching:a(r),themeSupportsResponsive:c()["responsive-embeds"],cannotEmbed:!m||i}},[r]),E=()=>{const{allowResponsive:e,className:t}=a;return{...a,...gt(y,b,t,o,e)}};Object(Te.useEffect)(()=>{if(null==y||!y.html||!k||_)return;const e=r.replace(/\/$/,"");v(e),j(!1),i({url:e})},[null==y?void 0:y.html,r]),Object(Te.useEffect)(()=>{if(y&&!O&&(i(E()),l)){const t=dt(e,E());t&&l(t)}},[y,O]);const C=Object(Ce.useBlockProps)();if(_)return Object(Te.createElement)(ze.View,C,Object(Te.createElement)(ya,null));const x=Te.Platform.select({
|
@@ -50,7 +50,7 @@ q=Object(Be.__)("Select a tag");break;default:
|
|
50 |
/* translators: label for missing values in navigation link block */
|
51 |
q=Object(Be.__)("Add a link")}return Object(Te.createElement)(Te.Fragment,null,Object(Te.createElement)(Ce.BlockControls,null,Object(Te.createElement)(Le.ToolbarGroup,null,Object(Te.createElement)(Le.KeyboardShortcuts,{bindGlobal:!0,shortcuts:{[vn.rawShortcut.primary("k")]:()=>S(!0)}}),Object(Te.createElement)(Le.ToolbarButton,{name:"link",icon:Po.a,title:Object(Be.__)("Link"),shortcut:vn.displayShortcut.primary("k"),onClick:()=>S(!0)}),!N&&Object(Te.createElement)(Le.ToolbarButton,{name:"submenu",icon:Dc,title:Object(Be.__)("Add submenu"),onClick:function(){const e=R,t=Object(xe.createBlock)("core/navigation-link");C(t,e,l)}}))),Object(Te.createElement)(Ce.InspectorControls,null,Object(Te.createElement)(Le.PanelBody,{title:Object(Be.__)("Link settings")},Object(Te.createElement)(Le.TextareaControl,{value:h||"",onChange:e=>{n({description:e})},label:Object(Be.__)("Description"),help:Object(Be.__)("The description will be displayed in the menu if the current theme supports it.")}),Object(Te.createElement)(Le.TextControl,{value:O||"",onChange:e=>{n({title:e})},label:Object(Be.__)("Link title"),autoComplete:"off"}),Object(Te.createElement)(Le.TextControl,{value:v||"",onChange:e=>{n({rel:e})},label:Object(Be.__)("Link rel"),autoComplete:"off"}))),Object(Te.createElement)("li",F,Object(Te.createElement)("a",{className:U},g?Object(Te.createElement)(Ce.RichText,{ref:P,identifier:"label",className:"wp-block-navigation-link__label",value:d,onChange:e=>n({label:e}),onMerge:r,onReplace:a,__unstableOnSplitAtEnd:()=>o(Object(xe.createBlock)("core/navigation-link")),"aria-label":Object(Be.__)("Navigation link text"),placeholder:z,withoutInteractiveFormatting:!0,allowedFormats:["core/bold","core/italic","core/image","core/strikethrough"],onClick:()=>{g||S(!0)}}):Object(Te.createElement)("div",{className:"wp-block-navigation-link__placeholder-text"},Object(Te.createElement)(Le.KeyboardShortcuts,{shortcuts:{enter:()=>t&&S(!0)}}),q),x&&Object(Te.createElement)(Le.Popover,{position:"bottom center",onClose:()=>S(!1),anchorRef:B.current},Object(Te.createElement)(Le.KeyboardShortcuts,{bindGlobal:!0,shortcuts:{escape:()=>S(!1)}}),Object(Te.createElement)(Ce.__experimentalLinkControl,{className:"wp-block-navigation-link__inline-link-input",value:f,showInitialSuggestions:!0,withCreateSuggestion:D,createSuggestion:async function(e){const t=b||"page",n=await E("postType",t,{title:e,status:"draft"});return{id:n.id,type:t,title:n.title.rendered,url:n.link,kind:"post-type"}},createSuggestionButtonText:e=>{let t;
|
52 |
/* translators: %s: search term. */
|
53 |
-
return t="post"===b?Object(Be.__)("Create draft post: <mark>%s</mark>"):Object(Be.__)("Create draft page: <mark>%s</mark>"),Object(Te.createInterpolateElement)(Object(Be.sprintf)(t,e),{mark:Object(Te.createElement)("mark",null)})},noDirectEntry:!!b,noURLSuggestion:!!b,suggestionsQuery:qc(b,j),onChange:t=>((e={},t,n={})=>{const{label:o="",kind:r="",type:a=""}=n,{title:c="",url:l="",opensInNewTab:i,id:s,kind:u=r,type:m=a}=e,d=c.replace(/http(s?):\/\//gi,""),b=l.replace(/http(s?):\/\//gi,""),p=""!==c&&d!==b&&o!==c?Object(Se.escape)(c):o||Object(Se.escape)(b),g="post_tag"===m?"tag":m.replace("-","_"),h=["post","page","tag","category"].indexOf(g)>-1,v=!u&&!h||"custom"===u?"custom":u;t({...l&&{url:encodeURI(l)},...p&&{label:p},...void 0!==i&&{opensInNewTab:i},...s&&Number.isInteger(s)&&{id:s},...v&&{kind:v},...g&&"URL"!==g&&{type:g}})})(t,n,e)}))),I&&k&&Object(Te.createElement)("span",{className:"wp-block-navigation-link__submenu-icon"},Object(Te.createElement)(Fc,null)),Object(Te.createElement)("ul",G)))},save:function(){return Object(Te.createElement)(Ce.InnerBlocks.Content,null)},example:{attributes:{label:Object(Be._x)("Example Link","navigation link preview example"),url:"https://example.com"}},deprecated:[{isEligible:e=>e.nofollow,attributes:{label:{type:"string"},type:{type:"string"},nofollow:{type:"boolean"},description:{type:"string"},id:{type:"number"},opensInNewTab:{type:"boolean",default:!1},url:{type:"string"}},migrate:({nofollow:e,...t})=>({rel:e?"nofollow":"",...t}),save:()=>Object(Te.createElement)(Ce.InnerBlocks.Content,null)}]};Object(Rt.addFilter)("blocks.registerBlockType","core/navigation-link",(function(e,t){if("core/navigation-link"!==t)return e;if(!e.variations)return{...e,variations:Kc};if(e.variations){const t=(e,t)=>e.type===t.type,n=e.variations.map(e=>({...e,...!e.icon&&{icon:Yc(e.name)},...!e.isActive&&{isActive:t}}));return{...e,variations:n}}return e}));var nl=Object(Te.createElement)(ze.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(Te.createElement)(ze.Path,{d:"M12 4L4 7.9V20h16V7.9L12 4zm6.5 14.5H14V13h-4v5.5H5.5V8.8L12 5.7l6.5 3.1v9.7z"}));const ol=e=>e.preventDefault(),rl={apiVersion:2,name:"core/home-link",category:"design",parent:["core/navigation"],title:"Home Link",description:"Create a link that always points to the homepage of the site. Usually not necessary if there is already a site title link present in the header.",textdomain:"default",attributes:{label:{type:"string"}},usesContext:["textColor","customTextColor","backgroundColor","customBackgroundColor","fontSize","customFontSize","style"],supports:{reusable:!1,html:!1},editorStyle:"wp-block-home-link-editor",style:"wp-block-home-link"},{name:al}=rl,cl={icon:nl,edit:function({attributes:e,setAttributes:t,context:n,clientId:o}){var r,a,c,l;const{homeUrl:i}=Object(Ye.useSelect)(e=>{var t;const{getUnstableBase:n}=e(Ee.store);return{homeUrl:null===(t=n())||void 0===t?void 0:t.home}},[o]),{textColor:s,backgroundColor:u,style:m}=n,d=Object(Ce.useBlockProps)({className:Me()({"has-text-color":!!s||!(null==m||null===(r=m.color)||void 0===r||!r.text),[`has-${s}-color`]:!!s,"has-background":!!u||!(null==m||null===(a=m.color)||void 0===a||!a.background),[`has-${u}-background-color`]:!!u}),style:{color:null==m||null===(c=m.color)||void 0===c?void 0:c.text,backgroundColor:null==m||null===(l=m.color)||void 0===l?void 0:l.background}}),{label:b}=e;return Object(Te.useEffect)(()=>{void 0===b&&t({label:Object(Be.__)("Home")})},[o,b]),Object(Te.createElement)(Te.Fragment,null,Object(Te.createElement)("li",d,Object(Te.createElement)("a",{className:"wp-block-home-link__content",href:i,onClick:ol},Object(Te.createElement)(Ce.RichText,{identifier:"label",className:"wp-block-home-link__label",value:b,onChange:e=>{t({label:e})},"aria-label":Object(Be.__)("Home link text"),placeholder:Object(Be.__)("Add home link"),withoutInteractiveFormatting:!0,allowedFormats:["core/bold","core/italic","core/image","core/strikethrough"]}))))},save:function(){return Object(Te.createElement)(Ce.InnerBlocks.Content,null)},example:{attributes:{label:Object(Be._x)("Home Link","block example")}}};var ll=Object(Te.createElement)(ze.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(Te.createElement)(ze.Path,{d:"M18 4H6c-1.1 0-2 .9-2 2v12.9c0 .6.5 1.1 1.1 1.1.3 0 .5-.1.8-.3L8.5 17H18c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 11c0 .3-.2.5-.5.5H7.9l-2.4 2.4V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v9z"}));const il={apiVersion:2,name:"core/latest-comments",title:"Latest Comments",category:"widgets",description:"Display a list of your most recent comments.",keywords:["recent comments"],textdomain:"default",attributes:{commentsToShow:{type:"number",default:5,minimum:1,maximum:100},displayAvatar:{type:"boolean",default:!0},displayDate:{type:"boolean",default:!0},displayExcerpt:{type:"boolean",default:!0}},supports:{align:!0,html:!1},editorStyle:"wp-block-latest-comments-editor",style:"wp-block-latest-comments"},{name:sl}=il,ul={icon:ll,example:{},edit:function({attributes:e,setAttributes:t}){const{commentsToShow:n,displayAvatar:o,displayDate:r,displayExcerpt:a}=e;return Object(Te.createElement)("div",Object(Ce.useBlockProps)(),Object(Te.createElement)(Ce.InspectorControls,null,Object(Te.createElement)(Le.PanelBody,{title:Object(Be.__)("Latest comments settings")},Object(Te.createElement)(Le.ToggleControl,{label:Object(Be.__)("Display avatar"),checked:o,onChange:()=>t({displayAvatar:!o})}),Object(Te.createElement)(Le.ToggleControl,{label:Object(Be.__)("Display date"),checked:r,onChange:()=>t({displayDate:!r})}),Object(Te.createElement)(Le.ToggleControl,{label:Object(Be.__)("Display excerpt"),checked:a,onChange:()=>t({displayExcerpt:!a})}),Object(Te.createElement)(Le.RangeControl,{label:Object(Be.__)("Number of comments"),value:n,onChange:e=>t({commentsToShow:e}),min:1,max:100,required:!0}))),Object(Te.createElement)(Le.Disabled,null,Object(Te.createElement)(so.a,{block:"core/latest-comments",attributes:e})))}};var ml=Object(Te.createElement)(ze.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(Te.createElement)(ze.Path,{d:"M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 14c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v12zM7 11h2V9H7v2zm0 4h2v-2H7v2zm3-4h7V9h-7v2zm0 4h7v-2h-7v2z"}));const{attributes:dl}={apiVersion:2,name:"core/latest-posts",title:"Latest Posts",category:"widgets",description:"Display a list of your most recent posts.",keywords:["recent posts"],textdomain:"default",attributes:{categories:{type:"array",items:{type:"object"}},selectedAuthor:{type:"number"},postsToShow:{type:"number",default:5},displayPostContent:{type:"boolean",default:!1},displayPostContentRadio:{type:"string",default:"excerpt"},excerptLength:{type:"number",default:55},displayAuthor:{type:"boolean",default:!1},displayPostDate:{type:"boolean",default:!1},postLayout:{type:"string",default:"list"},columns:{type:"number",default:3},order:{type:"string",default:"desc"},orderBy:{type:"string",default:"date"},displayFeaturedImage:{type:"boolean",default:!1},featuredImageAlign:{type:"string",enum:["left","center","right"]},featuredImageSizeSlug:{type:"string",default:"thumbnail"},featuredImageSizeWidth:{type:"number",default:null},featuredImageSizeHeight:{type:"number",default:null},addLinkToFeaturedImage:{type:"boolean",default:!1}},supports:{align:!0,html:!1},editorStyle:"wp-block-latest-posts-editor",style:"wp-block-latest-posts"};var bl=[{attributes:{...dl,categories:{type:"string"}},supports:{align:!0,html:!1},migrate:e=>({...e,categories:[{id:Number(e.categories)}]}),isEligible:({categories:e})=>e&&"string"==typeof e,save:()=>null}],pl=n(48),gl=Object(Te.createElement)(ze.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(Te.createElement)(ze.Path,{d:"M4 4v1.5h16V4H4zm8 8.5h8V11h-8v1.5zM4 20h16v-1.5H4V20zm4-8c0-1.1-.9-2-2-2s-2 .9-2 2 .9 2 2 2 2-.9 2-2z"})),hl=n(301);const vl={per_page:-1},Ol={per_page:-1},jl={apiVersion:2,name:"core/latest-posts",title:"Latest Posts",category:"widgets",description:"Display a list of your most recent posts.",keywords:["recent posts"],textdomain:"default",attributes:{categories:{type:"array",items:{type:"object"}},selectedAuthor:{type:"number"},postsToShow:{type:"number",default:5},displayPostContent:{type:"boolean",default:!1},displayPostContentRadio:{type:"string",default:"excerpt"},excerptLength:{type:"number",default:55},displayAuthor:{type:"boolean",default:!1},displayPostDate:{type:"boolean",default:!1},postLayout:{type:"string",default:"list"},columns:{type:"number",default:3},order:{type:"string",default:"desc"},orderBy:{type:"string",default:"date"},displayFeaturedImage:{type:"boolean",default:!1},featuredImageAlign:{type:"string",enum:["left","center","right"]},featuredImageSizeSlug:{type:"string",default:"thumbnail"},featuredImageSizeWidth:{type:"number",default:null},featuredImageSizeHeight:{type:"number",default:null},addLinkToFeaturedImage:{type:"boolean",default:!1}},supports:{align:!0,html:!1},editorStyle:"wp-block-latest-posts-editor",style:"wp-block-latest-posts"},{name:fl}=jl,yl={icon:ml,example:{},edit:function({attributes:e,setAttributes:t}){const{postsToShow:n,order:o,orderBy:r,categories:a,selectedAuthor:c,displayFeaturedImage:l,displayPostContentRadio:i,displayPostContent:s,displayPostDate:u,displayAuthor:m,postLayout:d,columns:b,excerptLength:p,featuredImageAlign:g,featuredImageSizeSlug:h,featuredImageSizeWidth:v,featuredImageSizeHeight:O,addLinkToFeaturedImage:j}=e,{imageSizeOptions:f,latestPosts:y,defaultImageWidth:_,defaultImageHeight:w}=Object(Ye.useSelect)(e=>{const{getEntityRecords:t,getMedia:l}=e(Ee.store),{getSettings:i}=e(Ce.store),{imageSizes:s,imageDimensions:u}=i(),m=a&&a.length>0?a.map(e=>e.id):[],d=t("postType","post",Object(Se.pickBy)({categories:m,author:c,order:o,orderby:r,per_page:n},e=>!Object(Se.isUndefined)(e)));return{defaultImageWidth:Object(Se.get)(u,[h,"width"],0),defaultImageHeight:Object(Se.get)(u,[h,"height"],0),imageSizeOptions:s.filter(({slug:e})=>"full"!==e).map(({name:e,slug:t})=>({value:t,label:e})),latestPosts:Array.isArray(d)?d.map(e=>{if(!e.featured_media)return e;const t=l(e.featured_media);let n=Object(Se.get)(t,["media_details","sizes",h,"source_url"],null);n||(n=Object(Se.get)(t,"source_url",null));const o={url:n,alt:null==t?void 0:t.alt_text};return{...e,featuredImageInfo:o}}):d}},[h,n,o,r,a,c]),[k,E]=Object(Te.useState)([]),[C,x]=Object(Te.useState)([]),S=k.reduce((e,t)=>({...e,[t.name]:t}),{}),B=Object(Te.useRef)();Object(Te.useEffect)(()=>(B.current=!0,Ht()({path:Object(et.addQueryArgs)("/wp/v2/categories",vl)}).then(e=>{B.current&&E(e)}).catch(()=>{B.current&&E([])}),Ht()({path:Object(et.addQueryArgs)("/wp/v2/users",Ol)}).then(e=>{B.current&&x(e)}).catch(()=>{B.current&&x([])}),()=>{B.current=!1}),[]);const T=Object(Te.createElement)(Ce.InspectorControls,null,Object(Te.createElement)(Le.PanelBody,{title:Object(Be.__)("Post content settings")},Object(Te.createElement)(Le.ToggleControl,{label:Object(Be.__)("Post content"),checked:s,onChange:e=>t({displayPostContent:e})}),s&&Object(Te.createElement)(Le.RadioControl,{label:Object(Be.__)("Show:"),selected:i,options:[{label:Object(Be.__)("Excerpt"),value:"excerpt"},{label:Object(Be.__)("Full post"),value:"full_post"}],onChange:e=>t({displayPostContentRadio:e})}),s&&"excerpt"===i&&Object(Te.createElement)(Le.RangeControl,{label:Object(Be.__)("Max number of words in excerpt"),value:p,onChange:e=>t({excerptLength:e}),min:10,max:100})),Object(Te.createElement)(Le.PanelBody,{title:Object(Be.__)("Post meta settings")},Object(Te.createElement)(Le.ToggleControl,{label:Object(Be.__)("Display author name"),checked:m,onChange:e=>t({displayAuthor:e})}),Object(Te.createElement)(Le.ToggleControl,{label:Object(Be.__)("Display post date"),checked:u,onChange:e=>t({displayPostDate:e})})),Object(Te.createElement)(Le.PanelBody,{title:Object(Be.__)("Featured image settings")},Object(Te.createElement)(Le.ToggleControl,{label:Object(Be.__)("Display featured image"),checked:l,onChange:e=>t({displayFeaturedImage:e})}),l&&Object(Te.createElement)(Te.Fragment,null,Object(Te.createElement)(Ce.__experimentalImageSizeControl,{onChange:e=>{const n={};e.hasOwnProperty("width")&&(n.featuredImageSizeWidth=e.width),e.hasOwnProperty("height")&&(n.featuredImageSizeHeight=e.height),t(n)},slug:h,width:v,height:O,imageWidth:_,imageHeight:w,imageSizeOptions:f,onChangeImage:e=>t({featuredImageSizeSlug:e,featuredImageSizeWidth:void 0,featuredImageSizeHeight:void 0})}),Object(Te.createElement)(Le.BaseControl,{className:"block-editor-image-alignment-control__row"},Object(Te.createElement)(Le.BaseControl.VisualLabel,null,Object(Be.__)("Image alignment")),Object(Te.createElement)(Ce.BlockAlignmentToolbar,{value:g,onChange:e=>t({featuredImageAlign:e}),controls:["left","center","right"],isCollapsed:!1})),Object(Te.createElement)(Le.ToggleControl,{label:Object(Be.__)("Add link to featured image"),checked:j,onChange:e=>t({addLinkToFeaturedImage:e})}))),Object(Te.createElement)(Le.PanelBody,{title:Object(Be.__)("Sorting and filtering")},Object(Te.createElement)(Le.QueryControls,{order:o,orderBy:r,numberOfItems:n,onOrderChange:e=>t({order:e}),onOrderByChange:e=>t({orderBy:e}),onNumberOfItemsChange:e=>t({postsToShow:e}),categorySuggestions:S,onCategoryChange:e=>{if(e.some(e=>"string"==typeof e&&!S[e]))return;const n=e.map(e=>"string"==typeof e?S[e]:e);if(Object(Se.includes)(n,null))return!1;t({categories:n})},selectedCategories:a,onAuthorChange:e=>t({selectedAuthor:""!==e?Number(e):void 0}),authorList:C,selectedAuthorId:c}),"grid"===d&&Object(Te.createElement)(Le.RangeControl,{label:Object(Be.__)("Columns"),value:b,onChange:e=>t({columns:e}),min:2,max:P?Math.min(6,y.length):6,required:!0}))),z=Object(Ce.useBlockProps)({className:Me()({"wp-block-latest-posts__list":!0,"is-grid":"grid"===d,"has-dates":u,"has-author":m,["columns-"+b]:"grid"===d})}),P=Array.isArray(y)&&y.length;if(!P)return Object(Te.createElement)("div",z,T,Object(Te.createElement)(Le.Placeholder,{icon:er,label:Object(Be.__)("Latest Posts")},Array.isArray(y)?Object(Be.__)("No posts found."):Object(Te.createElement)(Le.Spinner,null)));const N=y.length>n?y.slice(0,n):y,M=[{icon:gl,title:Object(Be.__)("List view"),onClick:()=>t({postLayout:"list"}),isActive:"list"===d},{icon:hl.a,title:Object(Be.__)("Grid view"),onClick:()=>t({postLayout:"grid"}),isActive:"grid"===d}],V=Object(pl.__experimentalGetSettings)().formats.date;return Object(Te.createElement)("div",null,T,Object(Te.createElement)(Ce.BlockControls,null,Object(Te.createElement)(Le.ToolbarGroup,{controls:M})),Object(Te.createElement)("ul",z,N.map((e,t)=>{const n=Object(Se.invoke)(e,["title","rendered","trim"]);let o=e.excerpt.rendered;const r=C.find(t=>t.id===e.author),a=document.createElement("div");a.innerHTML=o,o=a.textContent||a.innerText||"";const{featuredImageInfo:{url:c,alt:d}={}}=e,b=Me()({"wp-block-latest-posts__featured-image":!0,["align"+g]:!!g}),h=l&&c,f=h&&Object(Te.createElement)("img",{src:c,alt:d,style:{maxWidth:v,maxHeight:O}}),y=p<o.trim().split(" ").length&&""===e.excerpt.raw?Object(Te.createElement)(Te.Fragment,null,o.trim().split(" ",p).join(" "),Object(Be.__)(" … "),Object(Te.createElement)("a",{href:e.link,rel:"noopener noreferrer"},Object(Be.__)("Read more"))):o;return Object(Te.createElement)("li",{key:t},h&&Object(Te.createElement)("div",{className:b},j?Object(Te.createElement)("a",{href:e.link,rel:"noreferrer noopener"},f):f),Object(Te.createElement)("a",{href:e.link,rel:"noreferrer noopener"},n?Object(Te.createElement)(Te.RawHTML,null,n):Object(Be.__)("(no title)")),m&&r&&Object(Te.createElement)("div",{className:"wp-block-latest-posts__post-author"},Object(Be.sprintf)(
|
54 |
/* translators: byline. %s: current author. */
|
55 |
Object(Be.__)("by %s"),r.name)),u&&e.date_gmt&&Object(Te.createElement)("time",{dateTime:Object(pl.format)("c",e.date_gmt),className:"wp-block-latest-posts__post-date"},Object(pl.dateI18n)(V,e.date_gmt)),s&&"excerpt"===i&&Object(Te.createElement)("div",{className:"wp-block-latest-posts__post-excerpt"},y),s&&"full_post"===i&&Object(Te.createElement)("div",{className:"wp-block-latest-posts__post-full-content"},Object(Te.createElement)(Te.RawHTML,{key:"html"},e.content.raw.trim())))})))},deprecated:bl};var _l=Object(Te.createElement)(ze.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(Te.createElement)(ze.Path,{d:"M7 11h2v2H7v-2zm14-5v14l-2 2H5l-2-2V6l2-2h1V2h2v2h8V2h2v2h1l2 2zM5 8h14V6H5v2zm14 12V10H5v10h14zm-4-7h2v-2h-2v2zm-4 0h2v-2h-2v2z"})),wl=Object(Te.createElement)(ze.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(Te.createElement)(ze.Path,{d:"M4 20h8v-1.5H4V20zM18.9 3.5c-.6-.6-1.5-.6-2.1 0l-7.2 7.2c-.4-.1-.7 0-1.1.1-.5.2-1.5.7-1.9 2.2-.4 1.7-.8 2.2-1.1 2.7-.1.1-.2.3-.3.4l-.6 1.1H6c2 0 3.4-.4 4.7-1.4.8-.6 1.2-1.4 1.3-2.3 0-.3 0-.5-.1-.7L19 5.7c.5-.6.5-1.6-.1-2.2zM9.7 14.7c-.7.5-1.5.8-2.4 1 .2-.5.5-1.2.8-2.3.2-.6.4-1 .8-1.1.5-.1 1 .1 1.3.3.2.2.3.5.2.8 0 .3-.1.9-.7 1.3z"})),kl=Object(Te.createElement)(ze.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},Object(Te.createElement)(ze.Path,{d:"M10.2 3.28c3.53 0 6.43 2.61 6.92 6h2.08l-3.5 4-3.5-4h2.32c-.45-1.97-2.21-3.45-4.32-3.45-1.45 0-2.73.71-3.54 1.78L4.95 5.66C6.23 4.2 8.11 3.28 10.2 3.28zm-.4 13.44c-3.52 0-6.43-2.61-6.92-6H.8l3.5-4c1.17 1.33 2.33 2.67 3.5 4H5.48c.45 1.97 2.21 3.45 4.32 3.45 1.45 0 2.73-.71 3.54-1.78l1.71 1.95c-1.28 1.46-3.15 2.38-5.25 2.38z"}));function El({selectedId:e,onSelect:t}){const n=Object(Ye.useSelect)(e=>{var t,n,o;const r=null!==(t=null===(n=e(Ce.store).getSettings())||void 0===n?void 0:n.widgetTypesToHideFromLegacyWidgetBlock)&&void 0!==t?t:[];return null===(o=e(Ee.store).getWidgetTypes({per_page:-1}))||void 0===o?void 0:o.filter(e=>!r.includes(e.id))},[]);return n?0===n.length?Object(Be.__)("There are no widgets available."):Object(Te.createElement)(Le.SelectControl,{label:Object(Be.__)("Select a legacy widget to display:"),value:null!=e?e:"",options:[{value:"",label:Object(Be.__)("Select widget")},...n.map(e=>({value:e.id,label:e.name}))],onChange:e=>{if(e){const o=n.find(t=>t.id===e);t({selectedId:o.id,isMulti:o.is_multi})}else t({selectedId:null})}}):Object(Te.createElement)(Le.Spinner,null)}function Cl({name:e,description:t}){return Object(Te.createElement)("div",{className:"wp-block-legacy-widget-inspector-card"},Object(Te.createElement)("h3",{className:"wp-block-legacy-widget-inspector-card__name"},e),Object(Te.createElement)("span",null,t))}class xl{constructor({id:e,idBase:t,instance:n,onChangeInstance:o,onChangeHasPreview:r,onError:a}){this.id=e,this.idBase=t,this._instance=n,this._hasPreview=null,this.onChangeInstance=o,this.onChangeHasPreview=r,this.onError=a,this.number=++Sl,this.handleFormChange=Object(Se.debounce)(this.saveForm.bind(this),200),this.handleFormSubmit=this.handleFormSubmit.bind(this),this.initDOM(),this.bindEvents(),this.loadContent()}destroy(){this.unbindEvents(),this.element.remove()}initDOM(){var e,t;this.element=Bl("div",{class:"widget open"},[Bl("div",{class:"widget-inside"},[this.form=Bl("form",{class:"form",method:"post"},[Bl("input",{class:"widget-id",type:"hidden",name:"widget-id",value:null!==(e=this.id)&&void 0!==e?e:`${this.idBase}-${this.number}`}),Bl("input",{class:"id_base",type:"hidden",name:"id_base",value:null!==(t=this.idBase)&&void 0!==t?t:this.id}),Bl("input",{class:"widget-width",type:"hidden",name:"widget-width",value:"250"}),Bl("input",{class:"widget-height",type:"hidden",name:"widget-height",value:"200"}),Bl("input",{class:"widget_number",type:"hidden",name:"widget_number",value:this.idBase?this.number.toString():""}),this.content=Bl("div",{class:"widget-content"}),this.id&&Bl("button",{class:"button is-primary",type:"submit"},Object(Be.__)("Save"))])])])}bindEvents(){if(window.jQuery){const{jQuery:e}=window;e(this.form).on("change",null,this.handleFormChange),e(this.form).on("input",null,this.handleFormChange),e(this.form).on("submit",this.handleFormSubmit)}else this.form.addEventListener("change",this.handleFormChange),this.form.addEventListener("input",this.handleFormChange),this.form.addEventListener("submit",this.handleFormSubmit)}unbindEvents(){if(window.jQuery){const{jQuery:e}=window;e(this.form).off("change",null,this.handleFormChange),e(this.form).off("input",null,this.handleFormChange),e(this.form).off("submit",this.handleFormSubmit)}else this.form.removeEventListener("change",this.handleFormChange),this.form.removeEventListener("input",this.handleFormChange),this.form.removeEventListener("submit",this.handleFormSubmit)}async loadContent(){try{if(this.id){const{form:e}=await Tl(this.id);this.content.innerHTML=e}else if(this.idBase){const{form:e,preview:t}=await zl({idBase:this.idBase,instance:this.instance,number:this.number});if(this.content.innerHTML=e,this.hasPreview=!Pl(t),!this.instance.hash){const{instance:e}=await zl({idBase:this.idBase,instance:this.instance,number:this.number,formData:Nl(this.form)});this.instance=e}}if(window.jQuery){const{jQuery:e}=window;e(document).trigger("widget-added",[e(this.element)])}}catch(e){this.onError(e)}}handleFormSubmit(e){e.preventDefault(),this.saveForm()}async saveForm(){const e=Nl(this.form);try{if(this.id){const{form:t}=await Tl(this.id,e);if(this.content.innerHTML=t,window.jQuery){const{jQuery:e}=window;e(document).trigger("widget-updated",[e(this.element)])}}else if(this.idBase){const{instance:t,preview:n}=await zl({idBase:this.idBase,instance:this.instance,number:this.number,formData:e});this.instance=t,this.hasPreview=!Pl(n)}}catch(e){this.onError(e)}}get instance(){return this._instance}set instance(e){this._instance!==e&&(this._instance=e,this.onChangeInstance(e))}get hasPreview(){return this._hasPreview}set hasPreview(e){this._hasPreview!==e&&(this._hasPreview=e,this.onChangeHasPreview(e))}}let Sl=0;function Bl(e,t={},n=null){const o=document.createElement(e);for(const[e,n]of Object.entries(t))o.setAttribute(e,n);if(Array.isArray(n))for(const e of n)e&&o.appendChild(e);else"string"==typeof n&&(o.innerText=n);return o}async function Tl(e,t=null){let n;return n=t?await Ht()({path:`/wp/v2/widgets/${e}?context=edit`,method:"PUT",data:{form_data:t}}):await Ht()({path:`/wp/v2/widgets/${e}?context=edit`,method:"GET"}),{form:n.rendered_form}}async function zl({idBase:e,instance:t,number:n,formData:o=null}){const r=await Ht()({path:`/wp/v2/widget-types/${e}/encode`,method:"POST",data:{instance:t,number:n,form_data:o}});return{instance:r.instance,form:r.form,preview:r.preview}}function Pl(e){const t=document.createElement("div");return t.innerHTML=e,""===t.innerText.trim()}function Nl(e){return new window.URLSearchParams(Array.from(new window.FormData(e))).toString()}function Ml({title:e,isVisible:t,id:n,idBase:o,instance:r,onChangeInstance:a,onChangeHasPreview:c}){const l=Object(Te.useRef)(),i=Object(Te.useRef)(new Set),s=Object(Te.useRef)(new Set),{createNotice:u}=Object(Ye.useDispatch)(rt.store);return Object(Te.useEffect)(()=>{if(s.current.has(r))return void s.current.delete(r);const e=new xl({id:n,idBase:o,instance:r,onChangeInstance(e){i.current.add(r),s.current.add(e),a(e)},onChangeHasPreview:c,onError(e){var t;u("error",null!==(t=null==e?void 0:e.message)&&void 0!==t?t:Object(Be.__)("An error occured while fetching or updating the widget."))}});return l.current.appendChild(e.element),()=>{i.current.has(r)?i.current.delete(r):e.destroy()}},[n,o,r,a,c]),Object(Te.createElement)("div",{ref:l,className:"wp-block-legacy-widget__edit-form",hidden:!t},Object(Te.createElement)("h3",{className:"wp-block-legacy-widget__edit-form-title"},e))}function Vl({idBase:e,instance:t,isVisible:n}){const[o,r]=Object(Te.useState)(null);return Object(Te.createElement)(Te.Fragment,null,n&&null===o&&Object(Te.createElement)(Le.Placeholder,null,Object(Te.createElement)(Le.Spinner,null)),Object(Te.createElement)("div",{className:Me()("wp-block-legacy-widget__edit-preview",{"is-offscreen":!n||null===o})},Object(Te.createElement)(Le.Disabled,null,Object(Te.createElement)("iframe",{className:"wp-block-legacy-widget__edit-preview-iframe",title:Object(Be.__)("Legacy Widget Preview"),src:Object(et.addQueryArgs)("themes.php",{page:"gutenberg-widgets","legacy-widget-preview":{idBase:e,instance:t}}),height:null!=o?o:100,onLoad:e=>{r(e.target.contentDocument.body.scrollHeight)}}))))}function Il({name:e}){return Object(Te.createElement)("div",{className:"wp-block-legacy-widget__edit-no-preview"},e&&Object(Te.createElement)("h3",null,e),Object(Te.createElement)("p",null,Object(Be.__)("No preview available.")))}function Hl({clientId:e,rawInstance:t}){const{replaceBlocks:n}=Object(Ye.useDispatch)(Ce.store);return Object(Te.createElement)(Le.ToolbarButton,{onClick:()=>{t.title?n(e,[Object(xe.createBlock)("core/heading",{content:t.title}),...Object(xe.rawHandler)({HTML:t.text})]):n(e,Object(xe.rawHandler)({HTML:t.text}))}},Object(Be.__)("Convert to blocks"))}function Rl({attributes:{id:e,idBase:t},setAttributes:n}){return Object(Te.createElement)(Le.Placeholder,{icon:Object(Te.createElement)(Ce.BlockIcon,{icon:wl}),label:Object(Be.__)("Legacy Widget")},Object(Te.createElement)(El,{selectedId:null!=e?e:t,onSelect:({selectedId:e,isMulti:t})=>{n(e?t?{id:null,idBase:e,instance:{}}:{id:e,idBase:null,instance:null}:{id:null,idBase:null,instance:null})}}))}function Al({attributes:{id:e,idBase:t,instance:n},setAttributes:o,clientId:r,isSelected:a}){const[c,l]=Object(Te.useState)(null),{widgetType:i,hasResolvedWidgetType:s,isWidgetTypeHidden:u,isNavigationMode:m}=Object(Ye.useSelect)(n=>{var o,r;const a=null!=e?e:t,c=null!==(o=null===(r=n(Ce.store).getSettings())||void 0===r?void 0:r.widgetTypesToHideFromLegacyWidgetBlock)&&void 0!==o?o:[];return{widgetType:n(Ee.store).getWidgetType(a),hasResolvedWidgetType:n(Ee.store).hasFinishedResolution("getWidgetType",[a]),isWidgetTypeHidden:c.includes(a),isNavigationMode:n(Ce.store).isNavigationMode()}},[e,t]),d=Object(Te.useCallback)(e=>{o({instance:e})},[]);if(!i&&s)return Object(Te.createElement)(Le.Placeholder,{icon:Object(Te.createElement)(Ce.BlockIcon,{icon:wl}),label:Object(Be.__)("Legacy Widget")},Object(Be.__)("Widget is missing."));if(!s)return Object(Te.createElement)(Le.Placeholder,null,Object(Te.createElement)(Le.Spinner,null));const b=m||!a?"preview":"edit";return Object(Te.createElement)(Te.Fragment,null,!u&&Object(Te.createElement)(Ce.BlockControls,{group:"block"},Object(Te.createElement)(Le.ToolbarButton,{label:Object(Be.__)("Change widget"),icon:kl,onClick:()=>o({id:null,idBase:null,instance:null})})),"text"===t&&Object(Te.createElement)(Ce.BlockControls,{group:"other"},Object(Te.createElement)(Hl,{clientId:r,rawInstance:n.raw})),Object(Te.createElement)(Ce.InspectorControls,null,Object(Te.createElement)(Cl,{name:i.name,description:i.description})),Object(Te.createElement)(Ml,{title:i.name,isVisible:"edit"===b,id:e,idBase:t,instance:n,onChangeInstance:d,onChangeHasPreview:l}),t&&Object(Te.createElement)(Te.Fragment,null,null===c&&"preview"===b&&Object(Te.createElement)(Le.Placeholder,null,Object(Te.createElement)(Le.Spinner,null)),!0===c&&Object(Te.createElement)(Vl,{idBase:t,instance:n,isVisible:"preview"===b}),!1===c&&"preview"===b&&Object(Te.createElement)(Il,{name:i.name})))}var Ll={to:[{block:"core/calendar",widget:"calendar"},{block:"core/search",widget:"search"},{block:"core/html",widget:"html",transform:({content:e})=>({content:e})},{block:"core/archives",widget:"archives",transform:({count:e,dropdown:t})=>({displayAsDropdown:!!t,showPostCounts:!!e})},{block:"core/latest-posts",widget:"recent-posts",transform:({show_date:e,number:t})=>({displayPostDate:!!e,postsToShow:t})},{block:"core/latest-comments",widget:"recent-comments",transform:({number:e})=>({commentsToShow:e})},{block:"core/tag-cloud",widget:"tag_cloud",transform:({taxonomy:e,count:t})=>({showTagCounts:!!t,taxonomy:e})},{block:"core/categories",widget:"categories",transform:({count:e,dropdown:t,hierarchical:n})=>({displayAsDropdown:!!t,showPostCounts:!!e,showHierarchy:!!n})},{block:"core/audio",widget:"media_audio",transform:({url:e,preload:t,loop:n,attachment_id:o})=>({src:e,id:o,preload:t,loop:n})},{block:"core/video",widget:"media_video",transform:({url:e,preload:t,loop:n,attachment_id:o})=>({src:e,id:o,preload:t,loop:n})},{block:"core/image",widget:"media_image",transform:({alt:e,attachment_id:t,caption:n,height:o,link_classes:r,link_rel:a,link_target_blank:c,link_type:l,link_url:i,size:s,url:u,width:m})=>({alt:e,caption:n,height:o,id:t,link:i,linkClass:r,linkDestination:l,linkTarget:c?"_blank":void 0,rel:a,sizeSlug:s,url:u,width:m})},{block:"core/gallery",widget:"media_gallery",transform:({ids:e,link_type:t,size:n,number:o})=>({ids:e,columns:o,linkTo:t,sizeSlug:n,images:e.map(e=>({id:e}))})},{block:"core/rss",widget:"rss",transform:({url:e,show_author:t,show_date:n,show_summary:o,items:r})=>({feedURL:e,displayAuthor:!!t,displayDate:!!n,displayExcerpt:!!o,itemsToShow:r})}].map(({block:e,widget:t,transform:n})=>({type:"block",blocks:[e],isMatch:({idBase:e,instance:n})=>e===t&&!(null==n||!n.raw),transform:({instance:t})=>{var o;const r=Object(xe.createBlock)(e,n?n(t.raw):void 0);return null!==(o=t.raw)&&void 0!==o&&o.title?[Object(xe.createBlock)("core/heading",{content:t.raw.title}),r]:r}}))};const Dl={apiVersion:2,name:"core/legacy-widget",title:"Legacy Widget",category:"widgets",description:"Display a legacy widget.",textdomain:"default",attributes:{id:{type:"string",default:null},idBase:{type:"string",default:null},instance:{type:"object",default:null}},supports:{html:!1,customClassName:!1,reusable:!1},editorStyle:"wp-block-legacy-widget-editor"},{name:Fl}=Dl,Gl={icon:_l,edit:function(e){const{id:t,idBase:n}=e.attributes;return Object(Te.createElement)("div",Object(Ce.useBlockProps)(),t||n?Object(Te.createElement)(Al,e):Object(Te.createElement)(Rl,e))},transforms:Ll};var Ul=Object(Te.createElement)(ze.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(Te.createElement)(ze.Path,{d:"M11 14.5l1.1 1.1 3-3 .5-.5-.6-.6-3-3-1 1 1.7 1.7H5v1.5h7.7L11 14.5zM16.8 5h-7c-1.1 0-2 .9-2 2v1.5h1.5V7c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5v10c0 .3-.2.5-.5.5h-7c-.3 0-.5-.2-.5-.5v-1.5H7.8V17c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2z"}));const ql={apiVersion:2,name:"core/loginout",title:"Login/out",category:"design",description:"Show login & logout links.",keywords:["login","logout","form"],textdomain:"default",attributes:{displayLoginAsForm:{type:"boolean",default:!1},redirectToCurrent:{type:"boolean",default:!0}},supports:{className:!0,fontSize:!1}},{name:Wl}=ql,$l={icon:Ul,edit:function({attributes:e,setAttributes:t}){const{displayLoginAsForm:n,redirectToCurrent:o}=e;return Object(Te.createElement)(Te.Fragment,null,Object(Te.createElement)(Ce.InspectorControls,null,Object(Te.createElement)(Le.PanelBody,{title:Object(Be.__)("Login/out settings")},Object(Te.createElement)(Le.ToggleControl,{label:Object(Be.__)("Display login as form"),checked:n,onChange:()=>t({displayLoginAsForm:!n})}),Object(Te.createElement)(Le.ToggleControl,{label:Object(Be.__)("Redirect to current URL"),checked:o,onChange:()=>t({redirectToCurrent:!o})}))),Object(Te.createElement)("div",Object(Ce.useBlockProps)({className:"logged-in"}),Object(Te.createElement)("a",{href:"#login-pseudo-link"},Object(Be.__)("Log out"))))}};var Zl=Object(Te.createElement)(ze.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(Te.createElement)(ze.Path,{d:"M4 8.8h8.9V7.2H4v1.6zm0 7h8.9v-1.5H4v1.5zM18 13c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-3c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z"})),Ql=Object(Te.createElement)(ze.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(Te.createElement)(ze.Path,{d:"M11.1 15.8H20v-1.5h-8.9v1.5zm0-8.6v1.5H20V7.2h-8.9zM6 13c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-7c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"})),Jl=Object(Te.createElement)(ze.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(Te.createElement)(ze.Path,{d:"M3.8 15.8h8.9v-1.5H3.8v1.5zm0-7h8.9V7.2H3.8v1.6zm14.7-2.1V10h1V5.3l-2.2.7.3 1 .9-.3zm1.2 6.1c-.5-.6-1.2-.5-1.7-.4-.3.1-.5.2-.7.3l.1 1.1c.2-.2.5-.4.8-.5.3-.1.6 0 .7.1.2.3 0 .8-.2 1.1-.5.8-.9 1.6-1.4 2.5H20v-1h-.9c.3-.6.8-1.4.9-2.1 0-.3 0-.8-.3-1.1z"})),Kl=Object(Te.createElement)(ze.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(Te.createElement)(ze.Path,{d:"M11.1 15.8H20v-1.5h-8.9v1.5zm0-8.6v1.5H20V7.2h-8.9zM5 6.7V10h1V5.3L3.8 6l.4 1 .8-.3zm-.4 5.7c-.3.1-.5.2-.7.3l.1 1.1c.2-.2.5-.4.8-.5.3-.1.6 0 .7.1.2.3 0 .8-.2 1.1-.5.8-.9 1.6-1.4 2.5h2.7v-1h-1c.3-.6.8-1.4.9-2.1.1-.3 0-.8-.2-1.1-.5-.6-1.3-.5-1.7-.4z"})),Yl=Object(Te.createElement)(ze.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(Te.createElement)(ze.Path,{d:"M20 5.5H4V4H20V5.5ZM12 12.5H4V11H12V12.5ZM20 20V18.5H4V20H20ZM15.4697 14.9697L18.4393 12L15.4697 9.03033L16.5303 7.96967L20.0303 11.4697L20.5607 12L20.0303 12.5303L16.5303 16.0303L15.4697 14.9697Z"})),Xl=Object(Te.createElement)(ze.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(Te.createElement)(ze.Path,{d:"M4 7.2v1.5h16V7.2H4zm8 8.6h8v-1.5h-8v1.5zm-4-4.6l-4 4 4 4 1-1-3-3 3-3-1-1z"})),ei=Object(Te.createElement)(ze.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(Te.createElement)(ze.Path,{d:"M20 5.5H4V4H20V5.5ZM12 12.5H4V11H12V12.5ZM20 20V18.5H4V20H20ZM20.0303 9.03033L17.0607 12L20.0303 14.9697L18.9697 16.0303L15.4697 12.5303L14.9393 12L15.4697 11.4697L18.9697 7.96967L20.0303 9.03033Z"})),ti=Object(Te.createElement)(ze.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(Te.createElement)(ze.Path,{d:"M4 7.2v1.5h16V7.2H4zm8 8.6h8v-1.5h-8v1.5zm-8-3.5l3 3-3 3 1 1 4-4-4-4-1 1z"})),ni=({setAttributes:e,reversed:t,start:n})=>Object(Te.createElement)(Ce.InspectorControls,null,Object(Te.createElement)(Le.PanelBody,{title:Object(Be.__)("Ordered list settings")},Object(Te.createElement)(Le.TextControl,{label:Object(Be.__)("Start value"),type:"number",onChange:t=>{const n=parseInt(t,10);e({start:isNaN(n)?void 0:n})},value:Number.isInteger(n)?n.toString(10):"",step:"1"}),Object(Te.createElement)(Le.ToggleControl,{label:Object(Be.__)("Reverse list numbering"),checked:t||!1,onChange:t=>{e({reversed:t||void 0})}})));function oi({phrasingContentSchema:e}){const t={...e,ul:{},ol:{attributes:["type","start","reversed"]}};return["ul","ol"].forEach(e=>{t[e].children={li:{children:t}}}),t}var ri={from:[{type:"block",isMultiBlock:!0,blocks:["core/paragraph","core/heading"],transform:e=>Object(xe.createBlock)("core/list",{values:Object(Pn.toHTMLString)({value:Object(Pn.join)(e.map(({content:t})=>{const n=Object(Pn.create)({html:t});return e.length>1?n:Object(Pn.replace)(n,/\n/g,Pn.__UNSTABLE_LINE_SEPARATOR)}),Pn.__UNSTABLE_LINE_SEPARATOR),multilineTag:"li"}),anchor:e.anchor})},{type:"block",blocks:["core/quote","core/pullquote"],transform:({value:e,anchor:t})=>Object(xe.createBlock)("core/list",{values:Object(Pn.toHTMLString)({value:Object(Pn.create)({html:e,multilineTag:"p"}),multilineTag:"li"}),anchor:t})},{type:"raw",selector:"ol,ul",schema:e=>({ol:oi(e).ol,ul:oi(e).ul}),transform(e){const t={ordered:"OL"===e.nodeName,anchor:""===e.id?void 0:e.id};if(t.ordered){const n=e.getAttribute("type");n&&(t.type=n),null!==e.getAttribute("reversed")&&(t.reversed=!0);const o=parseInt(e.getAttribute("start"),10);isNaN(o)||1===o&&!t.reversed||(t.start=o)}return Object(xe.createBlock)("core/list",{...Object(xe.getBlockAttributes)("core/list",e.outerHTML),...t})}},...["*","-"].map(e=>({type:"prefix",prefix:e,transform:e=>Object(xe.createBlock)("core/list",{values:`<li>${e}</li>`})})),...["1.","1)"].map(e=>({type:"prefix",prefix:e,transform:e=>Object(xe.createBlock)("core/list",{ordered:!0,values:`<li>${e}</li>`})}))],to:[{type:"block",blocks:["core/paragraph"],transform:({values:e})=>Object(Pn.split)(Object(Pn.create)({html:e,multilineTag:"li",multilineWrapperTags:["ul","ol"]}),Pn.__UNSTABLE_LINE_SEPARATOR).map(e=>Object(xe.createBlock)("core/paragraph",{content:Object(Pn.toHTMLString)({value:e})}))},{type:"block",blocks:["core/heading"],transform:({values:e})=>Object(Pn.split)(Object(Pn.create)({html:e,multilineTag:"li",multilineWrapperTags:["ul","ol"]}),Pn.__UNSTABLE_LINE_SEPARATOR).map(e=>Object(xe.createBlock)("core/heading",{content:Object(Pn.toHTMLString)({value:e})}))},{type:"block",blocks:["core/quote"],transform:({values:e,anchor:t})=>Object(xe.createBlock)("core/quote",{value:Object(Pn.toHTMLString)({value:Object(Pn.create)({html:e,multilineTag:"li",multilineWrapperTags:["ul","ol"]}),multilineTag:"p"}),anchor:t})},{type:"block",blocks:["core/pullquote"],transform:({values:e,anchor:t})=>Object(xe.createBlock)("core/pullquote",{value:Object(Pn.toHTMLString)({value:Object(Pn.create)({html:e,multilineTag:"li",multilineWrapperTags:["ul","ol"]}),multilineTag:"p"}),anchor:t})}]};const ai={apiVersion:2,name:"core/list",title:"List",category:"text",description:"Create a bulleted or numbered list.",keywords:["bullet list","ordered list","numbered list"],textdomain:"default",attributes:{ordered:{type:"boolean",default:!1,__experimentalRole:"content"},values:{type:"string",source:"html",selector:"ol,ul",multiline:"li",__unstableMultilineWrapperTags:["ol","ul"],default:"",__experimentalRole:"content"},type:{type:"string"},start:{type:"number"},reversed:{type:"boolean"},placeholder:{type:"string"}},supports:{anchor:!0,className:!1,fontSize:!0,color:{gradients:!0},__unstablePasteTextInline:!0},editorStyle:"wp-block-list-editor",style:"wp-block-list"},{name:ci}=ai,li={icon:gl,example:{attributes:{values:"<li>Alice.</li><li>The White Rabbit.</li><li>The Cheshire Cat.</li><li>The Mad Hatter.</li><li>The Queen of Hearts.</li>"}},transforms:ri,merge(e,t){const{values:n}=t;return n&&"<li></li>"!==n?{...e,values:e.values+n}:e},edit:function({attributes:e,setAttributes:t,mergeBlocks:n,onReplace:o}){const{ordered:r,values:a,type:c,reversed:l,start:i,placeholder:s}=e,u=r?"ol":"ul",m=Object(Ce.useBlockProps)();return Object(Te.createElement)(Te.Fragment,null,Object(Te.createElement)(Ce.RichText,Object(Ae.a)({identifier:"values",multiline:"li",tagName:u,onChange:e=>t({values:e}),value:a,"aria-label":Object(Be.__)("List text"),placeholder:s||Object(Be.__)("List"),onMerge:n,onSplit:t=>Object(xe.createBlock)(ci,{...e,values:t}),__unstableOnSplitMiddle:()=>Object(xe.createBlock)("core/paragraph"),onReplace:o,onRemove:()=>o([]),start:i,reversed:l,type:c},m),({value:e,onChange:n,onFocus:o})=>Object(Te.createElement)(Te.Fragment,null,Object(Te.createElement)(Ce.RichTextShortcut,{type:"primary",character:"[",onUse:()=>{n(Object(Pn.__unstableOutdentListItems)(e))}}),Object(Te.createElement)(Ce.RichTextShortcut,{type:"primary",character:"]",onUse:()=>{n(Object(Pn.__unstableIndentListItems)(e,{type:u}))}}),Object(Te.createElement)(Ce.RichTextShortcut,{type:"primary",character:"m",onUse:()=>{n(Object(Pn.__unstableIndentListItems)(e,{type:u}))}}),Object(Te.createElement)(Ce.RichTextShortcut,{type:"primaryShift",character:"m",onUse:()=>{n(Object(Pn.__unstableOutdentListItems)(e))}}),Object(Te.createElement)(Ce.BlockControls,{group:"block"},Object(Te.createElement)(Le.ToolbarButton,{icon:Object(Be.isRTL)()?Zl:Ql,title:Object(Be.__)("Unordered"),describedBy:Object(Be.__)("Convert to unordered list"),isActive:Object(Pn.__unstableIsActiveListType)(e,"ul",u),onClick:()=>{n(Object(Pn.__unstableChangeListType)(e,{type:"ul"})),o(),Object(Pn.__unstableIsListRootSelected)(e)&&t({ordered:!1})}}),Object(Te.createElement)(Le.ToolbarButton,{icon:Object(Be.isRTL)()?Jl:Kl,title:Object(Be.__)("Ordered"),describedBy:Object(Be.__)("Convert to ordered list"),isActive:Object(Pn.__unstableIsActiveListType)(e,"ol",u),onClick:()=>{n(Object(Pn.__unstableChangeListType)(e,{type:"ol"})),o(),Object(Pn.__unstableIsListRootSelected)(e)&&t({ordered:!0})}}),Object(Te.createElement)(Le.ToolbarButton,{icon:Object(Be.isRTL)()?Yl:Xl,title:Object(Be.__)("Outdent"),describedBy:Object(Be.__)("Outdent list item"),shortcut:Object(Be._x)("Backspace","keyboard key"),isDisabled:!Object(Pn.__unstableCanOutdentListItems)(e),onClick:()=>{n(Object(Pn.__unstableOutdentListItems)(e)),o()}}),Object(Te.createElement)(Le.ToolbarButton,{icon:Object(Be.isRTL)()?ei:ti,title:Object(Be.__)("Indent"),describedBy:Object(Be.__)("Indent list item"),shortcut:Object(Be._x)("Space","keyboard key"),isDisabled:!Object(Pn.__unstableCanIndentListItems)(e),onClick:()=>{n(Object(Pn.__unstableIndentListItems)(e,{type:u})),o()}})))),r&&Object(Te.createElement)(ni,{setAttributes:t,ordered:r,reversed:l,start:i,placeholder:s}))},save:function({attributes:e}){const{ordered:t,values:n,type:o,reversed:r,start:a}=e,c=t?"ol":"ul";return Object(Te.createElement)(c,Ce.useBlockProps.save({type:o,reversed:r,start:a}),Object(Te.createElement)(Ce.RichText.Content,{value:n,multiline:"li"}))}};var ii=Object(Ye.withDispatch)((e,{clientId:t,attributes:n})=>{const{replaceBlock:o}=e(Ce.store);return{convertToHTML(){o(t,Object(xe.createBlock)("core/html",{content:n.originalUndelimitedContent}))}}})((function({attributes:e,convertToHTML:t}){const{originalName:n,originalUndelimitedContent:o}=e,r=!!o,a=Object(xe.getBlockType)("core/html"),c=[];let l;return r&&a?(l=Object(Be.sprintf)(
|
56 |
/* translators: %s: block name */
|
25 |
/* translators: example text. */
|
26 |
content:Object(Be.__)("Nam risus massa, ullamcorper consectetur eros fermentum, porta aliquet ligula. Sed vel mauris nec enim.")}}]}]},deprecated:br,edit:e=>{const{clientId:t}=e,n=Object(Ye.useSelect)(e=>e(Ce.store).getBlocks(t).length>0,[t])?jr:fr;return Object(Te.createElement)(n,e)},save:function({attributes:e}){const{verticalAlignment:t}=e,n=Me()({["are-vertically-aligned-"+t]:t});return Object(Te.createElement)("div",Ce.useBlockProps.save({className:n}),Object(Te.createElement)(Ce.InnerBlocks.Content,null))},transforms:_r};var Cr=Object(Te.createElement)(ze.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(Te.createElement)(ze.Path,{d:"M19 6H6c-1.1 0-2 .9-2 2v9c0 1.1.9 2 2 2h13c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zM6 17.5c-.3 0-.5-.2-.5-.5V8c0-.3.2-.5.5-.5h3v10H6zm13.5-.5c0 .3-.2.5-.5.5h-3v-10h3c.3 0 .5.2.5.5v9z"})),xr=[{attributes:{verticalAlignment:{type:"string"},width:{type:"number",min:0,max:100}},isEligible:({width:e})=>isFinite(e),migrate:e=>({...e,width:e.width+"%"}),save({attributes:e}){const{verticalAlignment:t,width:n}=e,o=Me()({["is-vertically-aligned-"+t]:t}),r={flexBasis:n+"%"};return Object(Te.createElement)("div",{className:o,style:r},Object(Te.createElement)(Ce.InnerBlocks.Content,null))}}];const Sr={apiVersion:2,name:"core/column",title:"Column",category:"text",parent:["core/columns"],description:"A single column within a columns block.",textdomain:"default",attributes:{verticalAlignment:{type:"string"},width:{type:"string"},templateLock:{enum:["all","insert",!1]}},supports:{anchor:!0,reusable:!1,html:!1,color:{gradients:!0,link:!0},spacing:{padding:!0}}},{name:Br}=Sr,Tr={icon:Cr,edit:function({attributes:{verticalAlignment:e,width:t,templateLock:n=!1},setAttributes:o,clientId:r}){const a=Me()("block-core-columns",{["is-vertically-aligned-"+e]:e}),c=Object(Le.__experimentalUseCustomUnits)({availableUnits:Object(Ce.useSetting)("layout.units")||["%","px","em","rem","vw"]}),{columnsIds:l,hasChildBlocks:i,rootClientId:s}=Object(Ye.useSelect)(e=>{const{getBlockOrder:t,getBlockRootClientId:n}=e(Ce.store),o=n(r);return{hasChildBlocks:t(r).length>0,rootClientId:o,columnsIds:t(o)}},[r]),{updateBlockAttributes:u}=Object(Ye.useDispatch)(Ce.store),m=Number.isFinite(t)?t+"%":t,d=Object(Ce.useBlockProps)({className:a,style:m?{flexBasis:m}:void 0}),b=l.length,p=l.indexOf(r)+1,g=Object(Be.sprintf)(
|
27 |
/* translators: 1: Block label (i.e. "Block: Column"), 2: Position of the selected block, 3: Total number of sibling blocks of the same type */
|
28 |
+
Object(Be.__)("%1$s (%2$d of %3$d)"),d["aria-label"],p,b),h=Object(Ce.__experimentalUseInnerBlocksProps)({...d,"aria-label":g},{templateLock:n,renderAppender:i?void 0:Ce.InnerBlocks.ButtonBlockAppender});return Object(Te.createElement)(Te.Fragment,null,Object(Te.createElement)(Ce.BlockControls,null,Object(Te.createElement)(Ce.BlockVerticalAlignmentToolbar,{onChange:e=>{o({verticalAlignment:e}),u(s,{verticalAlignment:null})},value:e})),Object(Te.createElement)(Ce.InspectorControls,null,Object(Te.createElement)(Le.PanelBody,{title:Object(Be.__)("Column settings")},Object(Te.createElement)(Le.__experimentalUnitControl,{label:Object(Be.__)("Width"),labelPosition:"edge",__unstableInputWidth:"80px",value:t||"",onChange:e=>{e=0>parseFloat(e)?"0":e,o({width:e})},units:c}))),Object(Te.createElement)("div",h))},save:function({attributes:e}){const{verticalAlignment:t,width:n}=e,o=Me()({["is-vertically-aligned-"+t]:t});let r;return n&&(r={flexBasis:Number.isFinite(n)?n+"%":n}),Object(Te.createElement)("div",Ce.useBlockProps.save({className:o,style:r}),Object(Te.createElement)(Ce.InnerBlocks.Content,null))},deprecated:xr};var zr=Object(Te.createElement)(ze.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(Te.createElement)(ze.Path,{d:"M18.7 3H5.3C4 3 3 4 3 5.3v13.4C3 20 4 21 5.3 21h13.4c1.3 0 2.3-1 2.3-2.3V5.3C21 4 20 3 18.7 3zm.8 15.7c0 .4-.4.8-.8.8H5.3c-.4 0-.8-.4-.8-.8V5.3c0-.4.4-.8.8-.8h6.2v8.9l2.5-3.1 2.5 3.1V4.5h2.2c.4 0 .8.4.8.8v13.4z"}));const Pr={"top left":"is-position-top-left","top center":"is-position-top-center","top right":"is-position-top-right","center left":"is-position-center-left","center center":"is-position-center-center",center:"is-position-center-center","center right":"is-position-center-right","bottom left":"is-position-bottom-left","bottom center":"is-position-bottom-center","bottom right":"is-position-bottom-right"};function Nr(e){return e?{backgroundImage:`url(${e})`}:{}}const Mr=["image","video"];function Vr(e){return 0!==e&&50!==e&&e?"has-background-dim-"+10*Math.round(e/10):null}function Ir(e){return!e||"center center"===e||"center"===e}function Hr(e){return Ir(e)?"":Pr[e]}const Rr={url:{type:"string"},id:{type:"number"},hasParallax:{type:"boolean",default:!1},dimRatio:{type:"number",default:50},overlayColor:{type:"string"},customOverlayColor:{type:"string"},backgroundType:{type:"string",default:"image"},focalPoint:{type:"object"}};var Ar=[{attributes:{...Rr,title:{type:"string",source:"html",selector:"p"},contentAlign:{type:"string",default:"center"},isRepeated:{type:"boolean",default:!1},minHeight:{type:"number"},minHeightUnit:{type:"string"},gradient:{type:"string"},customGradient:{type:"string"},contentPosition:{type:"string"}},supports:{align:!0},save({attributes:e}){const{backgroundType:t,gradient:n,contentPosition:o,customGradient:r,customOverlayColor:a,dimRatio:c,focalPoint:l,hasParallax:i,isRepeated:s,overlayColor:u,url:m,minHeight:d,minHeightUnit:b}=e,p=Object(Ce.getColorClassName)("background-color",u),g=Object(Ce.__experimentalGetGradientClass)(n),h=b?`${d}${b}`:d,v="image"===t,O="video"===t,j=v?Nr(m):{},f={};let y;p||(j.backgroundColor=a),r&&!m&&(j.background=r),j.minHeight=h||void 0,l&&(y=`${Math.round(100*l.x)}% ${Math.round(100*l.y)}%`,v&&!i&&(j.backgroundPosition=y),O&&(f.objectPosition=y));const _=Me()(Vr(c),p,{"has-background-dim":0!==c,"has-parallax":i,"is-repeated":s,"has-background-gradient":n||r,[g]:!m&&g,"has-custom-content-position":!Ir(o)},Hr(o));return Object(Te.createElement)("div",Ce.useBlockProps.save({className:_,style:j}),m&&(n||r)&&0!==c&&Object(Te.createElement)("span",{"aria-hidden":"true",className:Me()("wp-block-cover__gradient-background",g),style:r?{background:r}:void 0}),O&&m&&Object(Te.createElement)("video",{className:"wp-block-cover__video-background",autoPlay:!0,muted:!0,loop:!0,playsInline:!0,src:m,style:f}),Object(Te.createElement)("div",{className:"wp-block-cover__inner-container"},Object(Te.createElement)(Ce.InnerBlocks.Content,null)))}},{attributes:{...Rr,title:{type:"string",source:"html",selector:"p"},contentAlign:{type:"string",default:"center"},minHeight:{type:"number"},gradient:{type:"string"},customGradient:{type:"string"}},supports:{align:!0},save({attributes:e}){const{backgroundType:t,gradient:n,customGradient:o,customOverlayColor:r,dimRatio:a,focalPoint:c,hasParallax:l,overlayColor:i,url:s,minHeight:u}=e,m=Object(Ce.getColorClassName)("background-color",i),d=Object(Ce.__experimentalGetGradientClass)(n),b="image"===t?Nr(s):{};m||(b.backgroundColor=r),c&&!l&&(b.backgroundPosition=`${Math.round(100*c.x)}% ${Math.round(100*c.y)}%`),o&&!s&&(b.background=o),b.minHeight=u||void 0;const p=Me()(Vr(a),m,{"has-background-dim":0!==a,"has-parallax":l,"has-background-gradient":o,[d]:!s&&d});return Object(Te.createElement)("div",{className:p,style:b},s&&(n||o)&&0!==a&&Object(Te.createElement)("span",{"aria-hidden":"true",className:Me()("wp-block-cover__gradient-background",d),style:o?{background:o}:void 0}),"video"===t&&s&&Object(Te.createElement)("video",{className:"wp-block-cover__video-background",autoPlay:!0,muted:!0,loop:!0,src:s}),Object(Te.createElement)("div",{className:"wp-block-cover__inner-container"},Object(Te.createElement)(Ce.InnerBlocks.Content,null)))}},{attributes:{...Rr,title:{type:"string",source:"html",selector:"p"},contentAlign:{type:"string",default:"center"},minHeight:{type:"number"},gradient:{type:"string"},customGradient:{type:"string"}},supports:{align:!0},save({attributes:e}){const{backgroundType:t,gradient:n,customGradient:o,customOverlayColor:r,dimRatio:a,focalPoint:c,hasParallax:l,overlayColor:i,url:s,minHeight:u}=e,m=Object(Ce.getColorClassName)("background-color",i),d=Object(Ce.__experimentalGetGradientClass)(n),b="image"===t?Nr(s):{};m||(b.backgroundColor=r),c&&!l&&(b.backgroundPosition=`${100*c.x}% ${100*c.y}%`),o&&!s&&(b.background=o),b.minHeight=u||void 0;const p=Me()(Vr(a),m,{"has-background-dim":0!==a,"has-parallax":l,"has-background-gradient":o,[d]:!s&&d});return Object(Te.createElement)("div",{className:p,style:b},s&&(n||o)&&0!==a&&Object(Te.createElement)("span",{"aria-hidden":"true",className:Me()("wp-block-cover__gradient-background",d),style:o?{background:o}:void 0}),"video"===t&&s&&Object(Te.createElement)("video",{className:"wp-block-cover__video-background",autoPlay:!0,muted:!0,loop:!0,src:s}),Object(Te.createElement)("div",{className:"wp-block-cover__inner-container"},Object(Te.createElement)(Ce.InnerBlocks.Content,null)))}},{attributes:{...Rr,title:{type:"string",source:"html",selector:"p"},contentAlign:{type:"string",default:"center"}},supports:{align:!0},save({attributes:e}){const{backgroundType:t,contentAlign:n,customOverlayColor:o,dimRatio:r,focalPoint:a,hasParallax:c,overlayColor:l,title:i,url:s}=e,u=Object(Ce.getColorClassName)("background-color",l),m="image"===t?Nr(s):{};u||(m.backgroundColor=o),a&&!c&&(m.backgroundPosition=`${100*a.x}% ${100*a.y}%`);const d=Me()(Vr(r),u,{"has-background-dim":0!==r,"has-parallax":c,[`has-${n}-content`]:"center"!==n});return Object(Te.createElement)("div",{className:d,style:m},"video"===t&&s&&Object(Te.createElement)("video",{className:"wp-block-cover__video-background",autoPlay:!0,muted:!0,loop:!0,src:s}),!Ce.RichText.isEmpty(i)&&Object(Te.createElement)(Ce.RichText.Content,{tagName:"p",className:"wp-block-cover-text",value:i}))},migrate:e=>[Object(Se.omit)(e,["title","contentAlign"]),[Object(xe.createBlock)("core/paragraph",{content:e.title,align:e.contentAlign,fontSize:"large",placeholder:Object(Be.__)("Write title…")})]]},{attributes:{...Rr,title:{type:"string",source:"html",selector:"p"},contentAlign:{type:"string",default:"center"},align:{type:"string"}},supports:{className:!1},save({attributes:e}){const{url:t,title:n,hasParallax:o,dimRatio:r,align:a,contentAlign:c,overlayColor:l,customOverlayColor:i}=e,s=Object(Ce.getColorClassName)("background-color",l),u=Nr(t);s||(u.backgroundColor=i);const m=Me()("wp-block-cover-image",Vr(r),s,{"has-background-dim":0!==r,"has-parallax":o,[`has-${c}-content`]:"center"!==c},a?"align"+a:null);return Object(Te.createElement)("div",{className:m,style:u},!Ce.RichText.isEmpty(n)&&Object(Te.createElement)(Ce.RichText.Content,{tagName:"p",className:"wp-block-cover-image-text",value:n}))},migrate:e=>[Object(Se.omit)(e,["title","contentAlign","align"]),[Object(xe.createBlock)("core/paragraph",{content:e.title,align:e.contentAlign,fontSize:"large",placeholder:Object(Be.__)("Write title…")})]]},{attributes:{...Rr,title:{type:"string",source:"html",selector:"h2"},align:{type:"string"},contentAlign:{type:"string",default:"center"}},supports:{className:!1},save({attributes:e}){const{url:t,title:n,hasParallax:o,dimRatio:r,align:a}=e,c=Nr(t),l=Me()("wp-block-cover-image",Vr(r),{"has-background-dim":0!==r,"has-parallax":o},a?"align"+a:null);return Object(Te.createElement)("section",{className:l,style:c},Object(Te.createElement)(Ce.RichText.Content,{tagName:"h2",value:n}))},migrate:e=>[Object(Se.omit)(e,["title","contentAlign","align"]),[Object(xe.createBlock)("core/paragraph",{content:e.title,align:e.contentAlign,fontSize:"large",placeholder:Object(Be.__)("Write title…")})]]}],Lr=n(271),Dr=n.n(Lr),Fr=n(40),Gr=n.n(Fr);const Ur=[["core/paragraph",{align:"center",fontSize:"large",placeholder:Object(Be.__)("Write title…")}]],{__Visualizer:qr}=Le.__experimentalBoxControl;function Wr(){return Wr.fastAverageColor||(Wr.fastAverageColor=new Dr.a),Wr.fastAverageColor}function $r({onChange:e,onUnitChange:t,unit:n="px",value:o=""}){const[r,a]=Object(Te.useState)(null),c="block-cover-height-input-"+Object(Xe.useInstanceId)(Ce.__experimentalUnitControl),l="px"===n,i=Object(Le.__experimentalUseCustomUnits)({availableUnits:Object(Ce.useSetting)("spacing.units")||["px","em","rem","vw","vh"],defaultValues:{px:"430",em:"20",rem:"20",vw:"20",vh:"50"}}),s=null!==r?r:o,u=l?50:0;return Object(Te.createElement)(Le.BaseControl,{label:Object(Be.__)("Minimum height of cover"),id:c},Object(Te.createElement)(Ce.__experimentalUnitControl,{id:c,isResetValueOnUnitChange:!0,min:u,onBlur:()=>{null!==r&&a(null)},onChange:n=>{const o=""!==n?parseInt(n,10):void 0;isNaN(o)&&void 0!==o?a(n):(a(null),e(o),void 0===o&&t())},onUnitChange:t,step:"1",style:{maxWidth:80},unit:n,units:i,value:s}))}const Zr={top:!1,right:!1,bottom:!0,left:!1,topRight:!1,bottomRight:!1,bottomLeft:!1,topLeft:!1};function Qr({className:e,onResizeStart:t,onResize:n,onResizeStop:o,...r}){const[a,c]=Object(Te.useState)(!1);return Object(Te.createElement)(Le.ResizableBox,Object(Ae.a)({className:Me()(e,{"is-resizing":a}),enable:Zr,onResizeStart:(e,o,r)=>{t(r.clientHeight),n(r.clientHeight)},onResize:(e,t,o)=>{n(o.clientHeight),a||c(!0)},onResizeStop:(e,t,n)=>{o(n.clientHeight),c(!1)},minHeight:50},r))}function Jr({x:e,y:t}){return`${Math.round(100*e)}% ${Math.round(100*t)}%`}function Kr({disableMediaButtons:e=!1,children:t,noticeUI:n,noticeOperations:o,onSelectMedia:r}){const{removeAllNotices:a,createErrorNotice:c}=o;return Object(Te.createElement)(Ce.MediaPlaceholder,{icon:Object(Te.createElement)(Ce.BlockIcon,{icon:zr}),labels:{title:Object(Be.__)("Cover"),instructions:Object(Be.__)("Upload an image or video file, or pick one from your media library.")},onSelect:r,accept:"image/*,video/*",allowedTypes:Mr,notices:n,disableMediaButtons:e,onError:e=>{a(),c(e)}},t)}var Yr=Object(Xe.compose)([Object(Ye.withDispatch)(e=>{const{toggleSelection:t}=e(Ce.store);return{toggleSelection:t}}),Object(Ce.withColors)({overlayColor:"background-color"}),Le.withNotices,Xe.withInstanceId])((function({attributes:e,clientId:t,isSelected:n,noticeUI:o,noticeOperations:r,overlayColor:a,setAttributes:c,setOverlayColor:l,toggleSelection:i}){var s,u;const{contentPosition:m,id:d,backgroundType:b,dimRatio:p,focalPoint:g,hasParallax:h,isRepeated:v,minHeight:O,minHeightUnit:j,style:f,url:y}=e,{gradientClass:_,gradientValue:w,setGradient:k}=Object(Ce.__experimentalUseGradient)(),E=function(e){return t=>{if(!t||!t.url)return void e({url:void 0,id:void 0});let n;if(Object(Ke.isBlobURL)(t.url)&&(t.type=Object(Ke.getBlobTypeByURL)(t.url)),t.media_type)n="image"===t.media_type?"image":"video";else{if("image"!==t.type&&"video"!==t.type)return;n=t.type}e({url:t.url,id:t.id,backgroundType:n,..."video"===n?{focalPoint:void 0,hasParallax:void 0}:{}})}}(c),C=((e,t)=>!e&&Object(Ke.isBlobURL)(t))(d,y),[x,S]=Object(Te.useState)(O),[B,T]=Object(Te.useState)(j),z="vh"===j&&100===O,P=Object(Te.useRef)(),N=function(e,t=50,n,o){const[r,a]=Object(Te.useState)(!1);return Object(Te.useEffect)(()=>{e&&t<=50&&o.current&&Wr().getColorAsync(o.current,e=>{a(e.isDark)})},[e,e&&t<=50&&o.current,a]),Object(Te.useEffect)(()=>{if(t>50||!e){if(!n)return void a(!0);a(Gr()(n).isDark())}},[n,t>50||!e,a]),Object(Te.useEffect)(()=>{e||n||a(!1)},[!e&&!n,a]),r}(y,p,a.color,P),M="image"===b,V="video"===b,[I,H]=Object(Te.useState)(null),R=j?`${O}${j}`:O,A=!(h||v),L={...M&&!A?Nr(y):{backgroundImage:w||void 0},backgroundColor:a.color,minHeight:I||R||void 0},D={objectPosition:g&&A?Jr(g):void 0},F=!!(y||a.color||w),G=V||M&&(!h||v),U=e=>{const[t,n]=P.current?[P.current.style,"objectPosition"]:[$.current.style,"backgroundPosition"];t[n]=Jr(e)},q=Object(Ye.useSelect)(e=>e(Ce.store).getBlock(t).innerBlocks.length>0,[t]),W=Object(Te.createElement)(Te.Fragment,null,Object(Te.createElement)(Ce.BlockControls,{group:"block"},Object(Te.createElement)(Ce.__experimentalBlockAlignmentMatrixControl,{label:Object(Be.__)("Change content position"),value:m,onChange:e=>c({contentPosition:e}),isDisabled:!q}),Object(Te.createElement)(Ce.__experimentalBlockFullHeightAligmentControl,{isActive:z,onToggle:()=>z?c("vh"===B&&100===x?{minHeight:void 0,minHeightUnit:void 0}:{minHeight:x,minHeightUnit:B}):(S(O),T(j),c({minHeight:100,minHeightUnit:"vh"})),isDisabled:!q})),Object(Te.createElement)(Ce.BlockControls,{group:"other"},Object(Te.createElement)(Ce.MediaReplaceFlow,{mediaId:d,mediaURL:y,allowedTypes:Mr,accept:"image/*,video/*",onSelect:E,name:y?Object(Be.__)("Replace"):Object(Be.__)("Add Media")})),Object(Te.createElement)(Ce.InspectorControls,null,!!y&&Object(Te.createElement)(Le.PanelBody,{title:Object(Be.__)("Media settings")},M&&Object(Te.createElement)(Te.Fragment,null,Object(Te.createElement)(Le.ToggleControl,{label:Object(Be.__)("Fixed background"),checked:h,onChange:()=>{c({hasParallax:!h,...h?{}:{focalPoint:void 0}})}}),Object(Te.createElement)(Le.ToggleControl,{label:Object(Be.__)("Repeated background"),checked:v,onChange:()=>{c({isRepeated:!v})}})),G&&Object(Te.createElement)(Le.FocalPointPicker,{label:Object(Be.__)("Focal point picker"),url:y,value:g,onDragStart:U,onDrag:U,onChange:e=>c({focalPoint:e})}),Object(Te.createElement)(Le.PanelRow,null,Object(Te.createElement)(Le.Button,{isSecondary:!0,isSmall:!0,className:"block-library-cover__reset-button",onClick:()=>c({url:void 0,id:void 0,backgroundType:void 0,dimRatio:void 0,focalPoint:void 0,hasParallax:void 0,isRepeated:void 0})},Object(Be.__)("Clear Media")))),Object(Te.createElement)(Le.PanelBody,{title:Object(Be.__)("Dimensions")},Object(Te.createElement)($r,{value:I||O,unit:j,onChange:e=>c({minHeight:e}),onUnitChange:e=>c({minHeightUnit:e})})),Object(Te.createElement)(Ce.__experimentalPanelColorGradientSettings,{title:Object(Be.__)("Overlay"),initialOpen:!0,settings:[{colorValue:a.color,gradientValue:w,onColorChange:l,onGradientChange:k,label:Object(Be.__)("Color")}]},!!y&&Object(Te.createElement)(Le.RangeControl,{label:Object(Be.__)("Opacity"),value:p,onChange:e=>c({dimRatio:e}),min:0,max:100,step:10,required:!0})))),$=Object(Te.useRef)(),Z=Object(Ce.useBlockProps)({ref:$}),Q=Object(Ce.__experimentalUseInnerBlocksProps)({className:"wp-block-cover__inner-container"},{template:Ur,templateInsertUpdatesSelection:!0});if(!q&&!F)return Object(Te.createElement)(Te.Fragment,null,W,Object(Te.createElement)("div",Object(Ae.a)({},Z,{className:Me()("is-placeholder",Z.className)}),Object(Te.createElement)(Kr,{noticeUI:o,onSelectMedia:E,noticeOperations:r},Object(Te.createElement)("div",{className:"wp-block-cover__placeholder-background-options"},Object(Te.createElement)(Ce.ColorPalette,{disableCustomColors:!0,value:a.color,onChange:l,clearable:!1})))));const J=Me()(Vr(p),{"is-dark-theme":N,"has-background-dim":0!==p,"is-transient":C,"has-parallax":h,"is-repeated":v,[a.class]:a.class,"has-background-gradient":w,[_]:!y&&_,"has-custom-content-position":!Ir(m)},Hr(m));return Object(Te.createElement)(Te.Fragment,null,W,Object(Te.createElement)("div",Object(Ae.a)({},Z,{className:Me()(J,Z.className),style:{...L,...Z.style},"data-url":y}),Object(Te.createElement)(qr,{values:null==f||null===(s=f.spacing)||void 0===s?void 0:s.padding,showValues:null==f||null===(u=f.visualizers)||void 0===u?void 0:u.padding}),Object(Te.createElement)(Qr,{className:"block-library-cover__resize-container",onResizeStart:()=>{c({minHeightUnit:"px"}),i(!1)},onResize:H,onResizeStop:e=>{i(!0),c({minHeight:e}),H(null)},showHandle:n}),y&&w&&0!==p&&Object(Te.createElement)("span",{"aria-hidden":"true",className:Me()("wp-block-cover__gradient-background",_),style:{backgroundImage:w}}),y&&M&&A&&Object(Te.createElement)("img",{ref:P,className:"wp-block-cover__image-background",alt:"",src:y,style:D}),y&&V&&Object(Te.createElement)("video",{ref:P,className:"wp-block-cover__video-background",autoPlay:!0,muted:!0,loop:!0,src:y,style:D}),C&&Object(Te.createElement)(Le.Spinner,null),Object(Te.createElement)(Kr,{disableMediaButtons:!0,noticeUI:o,onSelectMedia:E,noticeOperations:r}),Object(Te.createElement)("div",Q)))})),Xr={from:[{type:"block",blocks:["core/image"],transform:({caption:e,url:t,align:n,id:o,anchor:r,style:a})=>{var c;return Object(xe.createBlock)("core/cover",{url:t,align:n,id:o,anchor:r,style:{color:{duotone:null==a||null===(c=a.color)||void 0===c?void 0:c.duotone}}},[Object(xe.createBlock)("core/paragraph",{content:e,fontSize:"large"})])}},{type:"block",blocks:["core/video"],transform:({caption:e,src:t,align:n,id:o,anchor:r})=>Object(xe.createBlock)("core/cover",{url:t,align:n,id:o,backgroundType:"video",anchor:r},[Object(xe.createBlock)("core/paragraph",{content:e,fontSize:"large"})])},{type:"block",blocks:["core/group"],isMatch:({backgroundColor:e,gradient:t,style:n})=>{var o,r;return e||(null==n||null===(o=n.color)||void 0===o?void 0:o.background)||(null==n||null===(r=n.color)||void 0===r?void 0:r.gradient)||t},transform:({align:e,anchor:t,backgroundColor:n,gradient:o,style:r},a)=>{var c,l;return Object(xe.createBlock)("core/cover",{align:e,anchor:t,overlayColor:n,customOverlayColor:null==r||null===(c=r.color)||void 0===c?void 0:c.background,gradient:o,customGradient:null==r||null===(l=r.color)||void 0===l?void 0:l.gradient},a)}}],to:[{type:"block",blocks:["core/image"],isMatch:({backgroundType:e,url:t,overlayColor:n,customOverlayColor:o,gradient:r,customGradient:a})=>t?"image"===e:!(n||o||r||a),transform:({title:e,url:t,align:n,id:o,anchor:r,style:a})=>{var c;return Object(xe.createBlock)("core/image",{caption:e,url:t,align:n,id:o,anchor:r,style:{color:{duotone:null==a||null===(c=a.color)||void 0===c?void 0:c.duotone}}})}},{type:"block",blocks:["core/video"],isMatch:({backgroundType:e,url:t,overlayColor:n,customOverlayColor:o,gradient:r,customGradient:a})=>t?"video"===e:!(n||o||r||a),transform:({title:e,url:t,align:n,id:o,anchor:r})=>Object(xe.createBlock)("core/video",{caption:e,src:t,id:o,align:n,anchor:r})}]};const ea={apiVersion:2,name:"core/cover",title:"Cover",category:"media",description:"Add an image or video with a text overlay — great for headers.",textdomain:"default",attributes:{url:{type:"string"},id:{type:"number"},hasParallax:{type:"boolean",default:!1},isRepeated:{type:"boolean",default:!1},dimRatio:{type:"number",default:50},overlayColor:{type:"string"},customOverlayColor:{type:"string"},backgroundType:{type:"string",default:"image"},focalPoint:{type:"object"},minHeight:{type:"number"},minHeightUnit:{type:"string"},gradient:{type:"string"},customGradient:{type:"string"},contentPosition:{type:"string"}},supports:{anchor:!0,align:!0,html:!1,spacing:{padding:!0},color:{__experimentalDuotone:"> .wp-block-cover__image-background, > .wp-block-cover__video-background",text:!1,background:!1}},editorStyle:"wp-block-cover-editor",style:"wp-block-cover"},{name:ta}=ea,na={icon:zr,example:{attributes:{customOverlayColor:"#065174",dimRatio:40,url:"https://s.w.org/images/core/5.3/Windbuchencom.jpg"},innerBlocks:[{name:"core/paragraph",attributes:{customFontSize:48,content:Object(Be.__)("<strong>Snow Patrol</strong>"),align:"center"}}]},transforms:Xr,save:function({attributes:e}){const{backgroundType:t,gradient:n,contentPosition:o,customGradient:r,customOverlayColor:a,dimRatio:c,focalPoint:l,hasParallax:i,isRepeated:s,overlayColor:u,url:m,id:d,minHeight:b,minHeightUnit:p}=e,g=Object(Ce.getColorClassName)("background-color",u),h=Object(Ce.__experimentalGetGradientClass)(n),v=p?`${b}${p}`:b,O="image"===t,j="video"===t,f=!(i||s),y={...O&&!f?Nr(m):{},backgroundColor:g?void 0:a,background:r&&!m?r:void 0,minHeight:v||void 0},_=l&&f?`${Math.round(100*l.x)}% ${Math.round(100*l.y)}%`:void 0,w=Me()(Vr(c),g,{"has-background-dim":0!==c,"has-parallax":i,"is-repeated":s,"has-background-gradient":n||r,[h]:!m&&h,"has-custom-content-position":!Ir(o)},Hr(o));return Object(Te.createElement)("div",Ce.useBlockProps.save({className:w,style:y}),m&&(n||r)&&0!==c&&Object(Te.createElement)("span",{"aria-hidden":"true",className:Me()("wp-block-cover__gradient-background",h),style:r?{background:r}:void 0}),O&&f&&m&&Object(Te.createElement)("img",{className:Me()("wp-block-cover__image-background",d?"wp-image-"+d:null),alt:"",src:m,style:{objectPosition:_},"data-object-fit":"cover","data-object-position":_}),j&&m&&Object(Te.createElement)("video",{className:Me()("wp-block-cover__video-background","intrinsic-ignore"),autoPlay:!0,muted:!0,loop:!0,playsInline:!0,src:m,style:{objectPosition:_},"data-object-fit":"cover","data-object-position":_}),Object(Te.createElement)("div",{className:"wp-block-cover__inner-container"},Object(Te.createElement)(Ce.InnerBlocks.Content,null)))},edit:Yr,deprecated:Ar};var oa=({blockSupportsResponsive:e,showEditButton:t,themeSupportsResponsive:n,allowResponsive:o,getResponsiveHelp:r,toggleResponsive:a,switchBackToURLInput:c})=>Object(Te.createElement)(Te.Fragment,null,Object(Te.createElement)(Ce.BlockControls,null,Object(Te.createElement)(Le.ToolbarGroup,null,t&&Object(Te.createElement)(Le.ToolbarButton,{className:"components-toolbar__control",label:Object(Be.__)("Edit URL"),icon:qn.a,onClick:c}))),n&&e&&Object(Te.createElement)(Ce.InspectorControls,null,Object(Te.createElement)(Le.PanelBody,{title:Object(Be.__)("Media settings"),className:"blocks-responsive"},Object(Te.createElement)(Le.ToggleControl,{label:Object(Be.__)("Resize for smaller devices"),checked:o,help:r,onChange:a}))));const ra=Object(Te.createElement)(Le.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(Te.createElement)(Le.Path,{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm.5 16c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V9.8l4.7-5.3H19c.3 0 .5.2.5.5v14zm-6-9.5L16 12l-2.5 2.8 1.1 1L18 12l-3.5-3.5-1 1zm-3 0l-1-1L6 12l3.5 3.8 1.1-1L8 12l2.5-2.5z"})),aa=Object(Te.createElement)(Le.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(Te.createElement)(Le.Path,{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm.5 16c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V9.8l4.7-5.3H19c.3 0 .5.2.5.5v14zM13.2 7.7c-.4.4-.7 1.1-.7 1.9v3.7c-.4-.3-.8-.4-1.3-.4-1.2 0-2.2 1-2.2 2.2 0 1.2 1 2.2 2.2 2.2.5 0 1-.2 1.4-.5.9-.6 1.4-1.6 1.4-2.6V9.6c0-.4.1-.6.2-.8.3-.3 1-.3 1.6-.3h.2V7h-.2c-.7 0-1.8 0-2.6.7z"})),ca=Object(Te.createElement)(Le.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(Te.createElement)(Le.Path,{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9.2 4.5H19c.3 0 .5.2.5.5v8.4l-3-2.9c-.3-.3-.8-.3-1 0L11.9 14 9 12c-.3-.2-.6-.2-.8 0l-3.6 2.6V9.8l4.6-5.3zm9.8 15H5c-.3 0-.5-.2-.5-.5v-2.4l4.1-3 3 1.9c.3.2.7.2.9-.1L16 12l3.5 3.4V19c0 .3-.2.5-.5.5z"})),la=Object(Te.createElement)(Le.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(Te.createElement)(Le.Path,{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm.5 16c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V9.8l4.7-5.3H19c.3 0 .5.2.5.5v14zM10 15l5-3-5-3v6z"})),ia={foreground:"#1da1f2",src:Object(Te.createElement)(Le.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(Te.createElement)(Le.G,null,Object(Te.createElement)(Le.Path,{d:"M22.23 5.924c-.736.326-1.527.547-2.357.646.847-.508 1.498-1.312 1.804-2.27-.793.47-1.67.812-2.606.996C18.325 4.498 17.258 4 16.078 4c-2.266 0-4.103 1.837-4.103 4.103 0 .322.036.635.106.935-3.41-.17-6.433-1.804-8.457-4.287-.353.607-.556 1.312-.556 2.064 0 1.424.724 2.68 1.825 3.415-.673-.022-1.305-.207-1.86-.514v.052c0 1.988 1.415 3.647 3.293 4.023-.344.095-.707.145-1.08.145-.265 0-.522-.026-.773-.074.522 1.63 2.038 2.817 3.833 2.85-1.404 1.1-3.174 1.757-5.096 1.757-.332 0-.66-.02-.98-.057 1.816 1.164 3.973 1.843 6.29 1.843 7.547 0 11.675-6.252 11.675-11.675 0-.178-.004-.355-.012-.53.802-.578 1.497-1.3 2.047-2.124z"})))},sa={foreground:"#ff0000",src:Object(Te.createElement)(Le.SVG,{viewBox:"0 0 24 24"},Object(Te.createElement)(Le.Path,{d:"M21.8 8s-.195-1.377-.795-1.984c-.76-.797-1.613-.8-2.004-.847-2.798-.203-6.996-.203-6.996-.203h-.01s-4.197 0-6.996.202c-.39.046-1.242.05-2.003.846C2.395 6.623 2.2 8 2.2 8S2 9.62 2 11.24v1.517c0 1.618.2 3.237.2 3.237s.195 1.378.795 1.985c.76.797 1.76.77 2.205.855 1.6.153 6.8.2 6.8.2s4.203-.005 7-.208c.392-.047 1.244-.05 2.005-.847.6-.607.795-1.985.795-1.985s.2-1.618.2-3.237v-1.517C22 9.62 21.8 8 21.8 8zM9.935 14.595v-5.62l5.403 2.82-5.403 2.8z"}))},ua={foreground:"#3b5998",src:Object(Te.createElement)(Le.SVG,{viewBox:"0 0 24 24"},Object(Te.createElement)(Le.Path,{d:"M20 3H4c-.6 0-1 .4-1 1v16c0 .5.4 1 1 1h8.6v-7h-2.3v-2.7h2.3v-2c0-2.3 1.4-3.6 3.5-3.6 1 0 1.8.1 2.1.1v2.4h-1.4c-1.1 0-1.3.5-1.3 1.3v1.7h2.7l-.4 2.8h-2.3v7H20c.5 0 1-.4 1-1V4c0-.6-.4-1-1-1z"}))},ma=Object(Te.createElement)(Le.SVG,{viewBox:"0 0 24 24"},Object(Te.createElement)(Le.G,null,Object(Te.createElement)(Le.Path,{d:"M12 4.622c2.403 0 2.688.01 3.637.052.877.04 1.354.187 1.67.31.42.163.72.358 1.036.673.315.315.51.615.673 1.035.123.317.27.794.31 1.67.043.95.052 1.235.052 3.638s-.01 2.688-.052 3.637c-.04.877-.187 1.354-.31 1.67-.163.42-.358.72-.673 1.036-.315.315-.615.51-1.035.673-.317.123-.794.27-1.67.31-.95.043-1.234.052-3.638.052s-2.688-.01-3.637-.052c-.877-.04-1.354-.187-1.67-.31-.42-.163-.72-.358-1.036-.673-.315-.315-.51-.615-.673-1.035-.123-.317-.27-.794-.31-1.67-.043-.95-.052-1.235-.052-3.638s.01-2.688.052-3.637c.04-.877.187-1.354.31-1.67.163-.42.358-.72.673-1.036.315-.315.615-.51 1.035-.673.317-.123.794-.27 1.67-.31.95-.043 1.235-.052 3.638-.052M12 3c-2.444 0-2.75.01-3.71.054s-1.613.196-2.185.418c-.592.23-1.094.538-1.594 1.04-.5.5-.807 1-1.037 1.593-.223.572-.375 1.226-.42 2.184C3.01 9.25 3 9.555 3 12s.01 2.75.054 3.71.196 1.613.418 2.186c.23.592.538 1.094 1.038 1.594s1.002.808 1.594 1.038c.572.222 1.227.375 2.185.418.96.044 1.266.054 3.71.054s2.75-.01 3.71-.054 1.613-.196 2.186-.418c.592-.23 1.094-.538 1.594-1.038s.808-1.002 1.038-1.594c.222-.572.375-1.227.418-2.185.044-.96.054-1.266.054-3.71s-.01-2.75-.054-3.71-.196-1.613-.418-2.186c-.23-.592-.538-1.094-1.038-1.594s-1.002-.808-1.594-1.038c-.572-.222-1.227-.375-2.185-.418C14.75 3.01 14.445 3 12 3zm0 4.378c-2.552 0-4.622 2.07-4.622 4.622s2.07 4.622 4.622 4.622 4.622-2.07 4.622-4.622S14.552 7.378 12 7.378zM12 15c-1.657 0-3-1.343-3-3s1.343-3 3-3 3 1.343 3 3-1.343 3-3 3zm4.804-8.884c-.596 0-1.08.484-1.08 1.08s.484 1.08 1.08 1.08c.596 0 1.08-.484 1.08-1.08s-.483-1.08-1.08-1.08z"}))),da={foreground:"#0073AA",src:Object(Te.createElement)(Le.SVG,{viewBox:"0 0 24 24"},Object(Te.createElement)(Le.G,null,Object(Te.createElement)(Le.Path,{d:"M12.158 12.786l-2.698 7.84c.806.236 1.657.365 2.54.365 1.047 0 2.05-.18 2.986-.51-.024-.037-.046-.078-.065-.123l-2.762-7.57zM3.008 12c0 3.56 2.07 6.634 5.068 8.092L3.788 8.342c-.5 1.117-.78 2.354-.78 3.658zm15.06-.454c0-1.112-.398-1.88-.74-2.48-.456-.74-.883-1.368-.883-2.11 0-.825.627-1.595 1.51-1.595.04 0 .078.006.116.008-1.598-1.464-3.73-2.36-6.07-2.36-3.14 0-5.904 1.613-7.512 4.053.21.008.41.012.58.012.94 0 2.395-.114 2.395-.114.484-.028.54.684.057.74 0 0-.487.058-1.03.086l3.275 9.74 1.968-5.902-1.4-3.838c-.485-.028-.944-.085-.944-.085-.486-.03-.43-.77.056-.742 0 0 1.484.114 2.368.114.94 0 2.397-.114 2.397-.114.486-.028.543.684.058.74 0 0-.488.058-1.03.086l3.25 9.665.897-2.997c.456-1.17.684-2.137.684-2.907zm1.82-3.86c.04.286.06.593.06.924 0 .912-.17 1.938-.683 3.22l-2.746 7.94c2.672-1.558 4.47-4.454 4.47-7.77 0-1.564-.4-3.033-1.1-4.314zM12 22C6.486 22 2 17.514 2 12S6.486 2 12 2s10 4.486 10 10-4.486 10-10 10z"})))},ba={foreground:"#1db954",src:Object(Te.createElement)(Le.SVG,{viewBox:"0 0 24 24"},Object(Te.createElement)(Le.Path,{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2m4.586 14.424c-.18.295-.563.387-.857.207-2.35-1.434-5.305-1.76-8.786-.963-.335.077-.67-.133-.746-.47-.077-.334.132-.67.47-.745 3.808-.87 7.076-.496 9.712 1.115.293.18.386.563.206.857M17.81 13.7c-.226.367-.706.482-1.072.257-2.687-1.652-6.785-2.13-9.965-1.166-.413.127-.848-.106-.973-.517-.125-.413.108-.848.52-.973 3.632-1.102 8.147-.568 11.234 1.328.366.226.48.707.256 1.072m.105-2.835C14.692 8.95 9.375 8.775 6.297 9.71c-.493.15-1.016-.13-1.166-.624-.148-.495.13-1.017.625-1.167 3.532-1.073 9.404-.866 13.115 1.337.445.264.59.838.327 1.282-.264.443-.838.59-1.282.325"}))},pa=Object(Te.createElement)(Le.SVG,{viewBox:"0 0 24 24"},Object(Te.createElement)(Le.Path,{d:"m6.5 7c-2.75 0-5 2.25-5 5s2.25 5 5 5 5-2.25 5-5-2.25-5-5-5zm11 0c-2.75 0-5 2.25-5 5s2.25 5 5 5 5-2.25 5-5-2.25-5-5-5z"})),ga={foreground:"#1ab7ea",src:Object(Te.createElement)(Le.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(Te.createElement)(Le.G,null,Object(Te.createElement)(Le.Path,{d:"M22.396 7.164c-.093 2.026-1.507 4.8-4.245 8.32C15.323 19.16 12.93 21 10.97 21c-1.214 0-2.24-1.12-3.08-3.36-.56-2.052-1.118-4.105-1.68-6.158-.622-2.24-1.29-3.36-2.004-3.36-.156 0-.7.328-1.634.98l-.978-1.26c1.027-.903 2.04-1.806 3.037-2.71C6 3.95 7.03 3.328 7.716 3.265c1.62-.156 2.616.95 2.99 3.32.404 2.558.685 4.148.84 4.77.468 2.12.982 3.18 1.543 3.18.435 0 1.09-.687 1.963-2.064.872-1.376 1.34-2.422 1.402-3.142.125-1.187-.343-1.782-1.4-1.782-.5 0-1.013.115-1.542.34 1.023-3.35 2.977-4.976 5.862-4.883 2.14.063 3.148 1.45 3.024 4.16z"})))},ha=Object(Te.createElement)(Le.SVG,{viewBox:"0 0 24 24"},Object(Te.createElement)(Le.Path,{d:"M22 11.816c0-1.256-1.02-2.277-2.277-2.277-.593 0-1.122.24-1.526.613-1.48-.965-3.455-1.594-5.647-1.69l1.17-3.702 3.18.75c.01 1.027.847 1.86 1.877 1.86 1.035 0 1.877-.84 1.877-1.877 0-1.035-.842-1.877-1.877-1.877-.77 0-1.43.466-1.72 1.13L13.55 3.92c-.204-.047-.4.067-.46.26l-1.35 4.27c-2.317.037-4.412.67-5.97 1.67-.402-.355-.917-.58-1.493-.58C3.02 9.54 2 10.56 2 11.815c0 .814.433 1.523 1.078 1.925-.037.222-.06.445-.06.673 0 3.292 4.01 5.97 8.94 5.97s8.94-2.678 8.94-5.97c0-.214-.02-.424-.052-.632.687-.39 1.154-1.12 1.154-1.964zm-3.224-7.422c.606 0 1.1.493 1.1 1.1s-.493 1.1-1.1 1.1-1.1-.494-1.1-1.1.493-1.1 1.1-1.1zm-16 7.422c0-.827.673-1.5 1.5-1.5.313 0 .598.103.838.27-.85.675-1.477 1.478-1.812 2.36-.32-.274-.525-.676-.525-1.13zm9.183 7.79c-4.502 0-8.165-2.33-8.165-5.193S7.457 9.22 11.96 9.22s8.163 2.33 8.163 5.193-3.663 5.193-8.164 5.193zM20.635 13c-.326-.89-.948-1.7-1.797-2.383.247-.186.55-.3.882-.3.827 0 1.5.672 1.5 1.5 0 .482-.23.91-.586 1.184zm-11.64 1.704c-.76 0-1.397-.616-1.397-1.376 0-.76.636-1.397 1.396-1.397.76 0 1.376.638 1.376 1.398 0 .76-.616 1.376-1.376 1.376zm7.405-1.376c0 .76-.615 1.376-1.375 1.376s-1.4-.616-1.4-1.376c0-.76.64-1.397 1.4-1.397.76 0 1.376.638 1.376 1.398zm-1.17 3.38c.15.152.15.398 0 .55-.675.674-1.728 1.002-3.22 1.002l-.01-.002-.012.002c-1.492 0-2.544-.328-3.218-1.002-.152-.152-.152-.398 0-.55.152-.152.4-.15.55 0 .52.52 1.394.775 2.67.775l.01.002.01-.002c1.276 0 2.15-.253 2.67-.775.15-.152.398-.152.55 0z"})),va={foreground:"#35465c",src:Object(Te.createElement)(Le.SVG,{viewBox:"0 0 24 24"},Object(Te.createElement)(Le.Path,{d:"M19 3H5a2 2 0 00-2 2v14c0 1.1.9 2 2 2h14a2 2 0 002-2V5a2 2 0 00-2-2zm-5.69 14.66c-2.72 0-3.1-1.9-3.1-3.16v-3.56H8.49V8.99c1.7-.62 2.54-1.99 2.64-2.87 0-.06.06-.41.06-.58h1.9v3.1h2.17v2.3h-2.18v3.1c0 .47.13 1.3 1.2 1.26h1.1v2.36c-1.01.02-2.07 0-2.07 0z"}))},Oa=Object(Te.createElement)(Le.SVG,{viewBox:"0 0 24 24"},Object(Te.createElement)(Le.Path,{d:"M18.42 14.58c-.51-.66-1.05-1.23-1.05-2.5V7.87c0-1.8.15-3.45-1.2-4.68-1.05-1.02-2.79-1.35-4.14-1.35-2.6 0-5.52.96-6.12 4.14-.06.36.18.54.4.57l2.66.3c.24-.03.42-.27.48-.5.24-1.12 1.17-1.63 2.2-1.63.56 0 1.22.21 1.55.7.4.56.33 1.31.33 1.97v.36c-1.59.18-3.66.27-5.16.93a4.63 4.63 0 0 0-2.93 4.44c0 2.82 1.8 4.23 4.1 4.23 1.95 0 3.03-.45 4.53-1.98.51.72.66 1.08 1.59 1.83.18.09.45.09.63-.1v.04l2.1-1.8c.24-.21.2-.48.03-.75zm-5.4-1.2c-.45.75-1.14 1.23-1.92 1.23-1.05 0-1.65-.81-1.65-1.98 0-2.31 2.1-2.73 4.08-2.73v.6c0 1.05.03 1.92-.5 2.88z"}),Object(Te.createElement)(Le.Path,{d:"M21.69 19.2a17.62 17.62 0 0 1-21.6-1.57c-.23-.2 0-.5.28-.33a23.88 23.88 0 0 0 20.93 1.3c.45-.19.84.3.39.6z"}),Object(Te.createElement)(Le.Path,{d:"M22.8 17.96c-.36-.45-2.22-.2-3.1-.12-.23.03-.3-.18-.05-.36 1.5-1.05 3.96-.75 4.26-.39.3.36-.1 2.82-1.5 4.02-.21.18-.42.1-.3-.15.3-.8 1.02-2.58.69-3z"})),ja=Object(Te.createElement)(Le.SVG,{viewBox:"0 0 24 24"},Object(Te.createElement)(Le.Path,{d:"m.0206909 21 19.8160091-13.07806 3.5831 6.20826z",fill:"#4bc7ee"}),Object(Te.createElement)(Le.Path,{d:"m23.7254 19.0205-10.1074-17.18468c-.6421-1.114428-1.7087-1.114428-2.3249 0l-11.2931 19.16418h22.5655c1.279 0 1.8019-.8905 1.1599-1.9795z",fill:"#d4cdcb"}),Object(Te.createElement)(Le.Path,{d:"m.0206909 21 15.2439091-16.38571 4.3029 7.32271z",fill:"#c3d82e"}),Object(Te.createElement)(Le.Path,{d:"m13.618 1.83582c-.6421-1.114428-1.7087-1.114428-2.3249 0l-11.2931 19.16418 15.2646-16.38573z",fill:"#e4ecb0"}),Object(Te.createElement)(Le.Path,{d:"m.0206909 21 19.5468091-9.063 1.6621 2.8344z",fill:"#209dbd"}),Object(Te.createElement)(Le.Path,{d:"m.0206909 21 17.9209091-11.82623 1.6259 2.76323z",fill:"#7cb3c9"})),fa=Object(Te.createElement)(Le.SVG,{viewBox:"0 0 24 24"},Object(Te.createElement)(Le.Path,{d:"m12.1479 18.5957c-2.4949 0-4.28131-1.7558-4.28131-4.0658 0-2.2176 1.78641-4.0965 4.09651-4.0965 2.2793 0 4.0349 1.7864 4.0349 4.1581 0 2.2794-1.7556 4.0042-3.8501 4.0042zm8.3521-18.5957-4.5329 1v7c-1.1088-1.41691-2.8028-1.8787-4.8049-1.8787-2.09443 0-3.97329.76993-5.5133 2.27917-1.72483 1.66323-2.6489 3.78863-2.6489 6.16033 0 2.5873.98562 4.8049 2.89526 6.499 1.44763 1.2936 3.17251 1.9402 5.17454 1.9402 1.9713 0 3.4498-.5236 4.8973-1.9402v1.9402h4.5329c0-7.6359 0-15.3641 0-23z",fill:"#333436"}));var ya=()=>Object(Te.createElement)("div",{className:"wp-block-embed is-loading"},Object(Te.createElement)(Le.Spinner,null),Object(Te.createElement)("p",null,Object(Be.__)("Embedding…"))),_a=({icon:e,label:t,value:n,onSubmit:o,onChange:r,cannotEmbed:a,fallback:c,tryAgain:l})=>Object(Te.createElement)(Le.Placeholder,{icon:Object(Te.createElement)(Ce.BlockIcon,{icon:e,showColors:!0}),label:t,className:"wp-block-embed",instructions:Object(Be.__)("Paste a link to the content you want to display on your site.")},Object(Te.createElement)("form",{onSubmit:o},Object(Te.createElement)("input",{type:"url",value:n||"",className:"components-placeholder__input","aria-label":t,placeholder:Object(Be.__)("Enter URL to embed here…"),onChange:r}),Object(Te.createElement)(Le.Button,{isPrimary:!0,type:"submit"},Object(Be._x)("Embed","button label"))),Object(Te.createElement)("div",{className:"components-placeholder__learn-more"},Object(Te.createElement)(Le.ExternalLink,{href:Object(Be.__)("https://wordpress.org/support/article/embeds/")},Object(Be.__)("Learn more about embeds"))),a&&Object(Te.createElement)("div",{className:"components-placeholder__error"},Object(Te.createElement)("div",{className:"components-placeholder__instructions"},Object(Be.__)("Sorry, this content could not be embedded.")),Object(Te.createElement)(Le.Button,{isSecondary:!0,onClick:l},Object(Be._x)("Try again","button label"))," ",Object(Te.createElement)(Le.Button,{isSecondary:!0,onClick:c},Object(Be._x)("Convert to link","button label"))));function wa({html:e}){const t=Object(Te.useRef)();Object(Te.useEffect)(()=>{const{ownerDocument:e}=t.current,{defaultView:n}=e;function o({data:{secret:t,message:n,value:o}={}}){[t,n,o].some(e=>!e)||"height"!==n||e.querySelectorAll(`iframe[data-secret="${t}"`).forEach(e=>{+e.height!==o&&(e.height=o)})}function r(){const{activeElement:n}=e;"IFRAME"===n.tagName&&n.parentNode===t.current&&n.focus()}return n.addEventListener("message",o),n.addEventListener("blur",r),()=>{n.removeEventListener("message",o),n.removeEventListener("blur",r)}},[]);const n=Object(Te.useMemo)(()=>{const t=(new window.DOMParser).parseFromString(e,"text/html"),n=t.querySelector("iframe");n&&n.removeAttribute("style");const o=t.querySelector("blockquote");return o&&(o.style.display="none"),t.body.innerHTML},[e]);return Object(Te.createElement)("div",{ref:t,className:"wp-block-embed__wrapper",dangerouslySetInnerHTML:{__html:n}})}class ka extends Te.Component{constructor(){super(...arguments),this.hideOverlay=this.hideOverlay.bind(this),this.state={interactive:!1}}static getDerivedStateFromProps(e,t){return!e.isSelected&&t.interactive?{interactive:!1}:null}hideOverlay(){this.setState({interactive:!0})}render(){const{preview:e,previewable:t,url:n,type:o,caption:r,onCaptionChange:a,isSelected:c,className:l,icon:i,label:s,insertBlocksAfter:u}=this.props,{scripts:m}=e,{interactive:d}=this.state,b="photo"===o?(e=>{const t=e.thumbnail_url||e.url,n=Object(Te.createElement)("p",null,Object(Te.createElement)("img",{src:t,alt:e.title,width:"100%"}));return Object(Te.renderToString)(n)})(e):e.html,p=new URL(n).host.split("."),g=p.splice(p.length-2,p.length-1).join("."),h=Object(Be.sprintf)(// translators: %s: host providing embed content e.g: www.youtube.com
|
29 |
Object(Be.__)("Embedded content from %s"),g),v=lt()(o,l,"wp-block-embed__wrapper"),O="wp-embed"===o?Object(Te.createElement)(wa,{html:b}):Object(Te.createElement)("div",{className:"wp-block-embed__wrapper"},Object(Te.createElement)(Le.SandBox,{html:b,scripts:m,title:h,type:v,onFocus:this.hideOverlay}),!d&&Object(Te.createElement)("div",{className:"block-library-embed__interactive-overlay",onMouseUp:this.hideOverlay}));return Object(Te.createElement)("figure",{className:lt()(l,"wp-block-embed",{"is-type-video":"video"===o})},t?O:Object(Te.createElement)(Le.Placeholder,{icon:Object(Te.createElement)(Ce.BlockIcon,{icon:i,showColors:!0}),label:s},Object(Te.createElement)("p",{className:"components-placeholder__error"},Object(Te.createElement)("a",{href:n},n)),Object(Te.createElement)("p",{className:"components-placeholder__error"},Object(Be.sprintf)(
|
30 |
/* translators: %s: host providing embed content e.g: www.youtube.com */
|
31 |
Object(Be.__)("Embedded content from %s can't be previewed in the editor."),g))),(!Ce.RichText.isEmpty(r)||c)&&Object(Te.createElement)(Ce.RichText,{tagName:"figcaption",placeholder:Object(Be.__)("Add caption"),value:r,onChange:a,inlineToolbar:!0,__unstableOnSplitAtEnd:()=>u(Object(xe.createBlock)("core/paragraph"))}))}}var Ea=ka;function Ca(e){return e?Object(Be.__)("This embed will preserve its aspect ratio when the browser is resized."):Object(Be.__)("This embed may not preserve its aspect ratio when the browser is resized.")}const{name:xa}={apiVersion:2,name:"core/embed",title:"Embed",category:"embed",description:"Add a block that displays content pulled from other sites, like Twitter, Instagram or YouTube.",textdomain:"default",attributes:{url:{type:"string"},caption:{type:"string",source:"html",selector:"figcaption"},type:{type:"string"},providerNameSlug:{type:"string"},allowResponsive:{type:"boolean",default:!0},responsive:{type:"boolean",default:!1},previewable:{type:"boolean",default:!0}},supports:{align:!0},editorStyle:"wp-block-embed-editor",style:"wp-block-embed"};var Sa={from:[{type:"raw",isMatch:e=>{var t,n;return"P"===e.nodeName&&/^\s*(https?:\/\/\S+)\s*$/i.test(e.textContent)&&1===(null===(t=e.textContent)||void 0===t||null===(n=t.match(/https/gi))||void 0===n?void 0:n.length)},transform:e=>Object(xe.createBlock)(xa,{url:e.textContent.trim()})}],to:[{type:"block",blocks:["core/paragraph"],transform:({url:e,caption:t})=>{const n=Object(Te.createElement)("a",{href:e},t||e);return Object(xe.createBlock)("core/paragraph",{content:Object(Te.renderToString)(n)})}}]};const Ba=[{name:"twitter",title:"Twitter",icon:ia,keywords:["tweet",Object(Be.__)("social")],description:Object(Be.__)("Embed a tweet."),patterns:[/^https?:\/\/(www\.)?twitter\.com\/.+/i],attributes:{providerNameSlug:"twitter",responsive:!0}},{name:"youtube",title:"YouTube",icon:sa,keywords:[Object(Be.__)("music"),Object(Be.__)("video")],description:Object(Be.__)("Embed a YouTube video."),patterns:[/^https?:\/\/((m|www)\.)?youtube\.com\/.+/i,/^https?:\/\/youtu\.be\/.+/i],attributes:{providerNameSlug:"youtube",responsive:!0}},{name:"facebook",title:"Facebook",icon:ua,keywords:[Object(Be.__)("social")],description:Object(Be.__)("Embed a Facebook post."),scope:["block"],patterns:[],attributes:{providerNameSlug:"facebook",previewable:!1,responsive:!0}},{name:"instagram",title:"Instagram",icon:ma,keywords:[Object(Be.__)("image"),Object(Be.__)("social")],description:Object(Be.__)("Embed an Instagram post."),scope:["block"],patterns:[],attributes:{providerNameSlug:"instagram",responsive:!0}},{name:"wordpress",title:"WordPress",icon:da,keywords:[Object(Be.__)("post"),Object(Be.__)("blog")],description:Object(Be.__)("Embed a WordPress post."),attributes:{providerNameSlug:"wordpress"}},{name:"soundcloud",title:"SoundCloud",icon:aa,keywords:[Object(Be.__)("music"),Object(Be.__)("audio")],description:Object(Be.__)("Embed SoundCloud content."),patterns:[/^https?:\/\/(www\.)?soundcloud\.com\/.+/i],attributes:{providerNameSlug:"soundcloud",responsive:!0}},{name:"spotify",title:"Spotify",icon:ba,keywords:[Object(Be.__)("music"),Object(Be.__)("audio")],description:Object(Be.__)("Embed Spotify content."),patterns:[/^https?:\/\/(open|play)\.spotify\.com\/.+/i],attributes:{providerNameSlug:"spotify",responsive:!0}},{name:"flickr",title:"Flickr",icon:pa,keywords:[Object(Be.__)("image")],description:Object(Be.__)("Embed Flickr content."),patterns:[/^https?:\/\/(www\.)?flickr\.com\/.+/i,/^https?:\/\/flic\.kr\/.+/i],attributes:{providerNameSlug:"flickr",responsive:!0}},{name:"vimeo",title:"Vimeo",icon:ga,keywords:[Object(Be.__)("video")],description:Object(Be.__)("Embed a Vimeo video."),patterns:[/^https?:\/\/(www\.)?vimeo\.com\/.+/i],attributes:{providerNameSlug:"vimeo",responsive:!0}},{name:"animoto",title:"Animoto",icon:ja,description:Object(Be.__)("Embed an Animoto video."),patterns:[/^https?:\/\/(www\.)?(animoto|video214)\.com\/.+/i],attributes:{providerNameSlug:"animoto",responsive:!0}},{name:"cloudup",title:"Cloudup",icon:ra,description:Object(Be.__)("Embed Cloudup content."),patterns:[/^https?:\/\/cloudup\.com\/.+/i],attributes:{providerNameSlug:"cloudup",responsive:!0}},{name:"collegehumor",title:"CollegeHumor",icon:la,description:Object(Be.__)("Embed CollegeHumor content."),scope:["block"],patterns:[],attributes:{providerNameSlug:"collegehumor",responsive:!0}},{name:"crowdsignal",title:"Crowdsignal",icon:ra,keywords:["polldaddy",Object(Be.__)("survey")],description:Object(Be.__)("Embed Crowdsignal (formerly Polldaddy) content."),patterns:[/^https?:\/\/((.+\.)?polldaddy\.com|poll\.fm|.+\.survey\.fm)\/.+/i],attributes:{providerNameSlug:"crowdsignal",responsive:!0}},{name:"dailymotion",title:"Dailymotion",icon:fa,keywords:[Object(Be.__)("video")],description:Object(Be.__)("Embed a Dailymotion video."),patterns:[/^https?:\/\/(www\.)?dailymotion\.com\/.+/i],attributes:{providerNameSlug:"dailymotion",responsive:!0}},{name:"imgur",title:"Imgur",icon:ca,description:Object(Be.__)("Embed Imgur content."),patterns:[/^https?:\/\/(.+\.)?imgur\.com\/.+/i],attributes:{providerNameSlug:"imgur",responsive:!0}},{name:"issuu",title:"Issuu",icon:ra,description:Object(Be.__)("Embed Issuu content."),patterns:[/^https?:\/\/(www\.)?issuu\.com\/.+/i],attributes:{providerNameSlug:"issuu",responsive:!0}},{name:"kickstarter",title:"Kickstarter",icon:ra,description:Object(Be.__)("Embed Kickstarter content."),patterns:[/^https?:\/\/(www\.)?kickstarter\.com\/.+/i,/^https?:\/\/kck\.st\/.+/i],attributes:{providerNameSlug:"kickstarter",responsive:!0}},{name:"meetup-com",title:"Meetup.com",icon:ra,description:Object(Be.__)("Embed Meetup.com content."),patterns:[/^https?:\/\/(www\.)?meetu(\.ps|p\.com)\/.+/i],attributes:{providerNameSlug:"meetup-com",responsive:!0}},{name:"mixcloud",title:"Mixcloud",icon:aa,keywords:[Object(Be.__)("music"),Object(Be.__)("audio")],description:Object(Be.__)("Embed Mixcloud content."),patterns:[/^https?:\/\/(www\.)?mixcloud\.com\/.+/i],attributes:{providerNameSlug:"mixcloud",responsive:!0}},{name:"reddit",title:"Reddit",icon:ha,description:Object(Be.__)("Embed a Reddit thread."),patterns:[/^https?:\/\/(www\.)?reddit\.com\/.+/i],attributes:{providerNameSlug:"reddit",responsive:!0}},{name:"reverbnation",title:"ReverbNation",icon:aa,description:Object(Be.__)("Embed ReverbNation content."),patterns:[/^https?:\/\/(www\.)?reverbnation\.com\/.+/i],attributes:{providerNameSlug:"reverbnation",responsive:!0}},{name:"screencast",title:"Screencast",icon:la,description:Object(Be.__)("Embed Screencast content."),patterns:[/^https?:\/\/(www\.)?screencast\.com\/.+/i],attributes:{providerNameSlug:"screencast",responsive:!0}},{name:"scribd",title:"Scribd",icon:ra,description:Object(Be.__)("Embed Scribd content."),patterns:[/^https?:\/\/(www\.)?scribd\.com\/.+/i],attributes:{providerNameSlug:"scribd",responsive:!0}},{name:"slideshare",title:"Slideshare",icon:ra,description:Object(Be.__)("Embed Slideshare content."),patterns:[/^https?:\/\/(.+?\.)?slideshare\.net\/.+/i],attributes:{providerNameSlug:"slideshare",responsive:!0}},{name:"smugmug",title:"SmugMug",icon:ca,description:Object(Be.__)("Embed SmugMug content."),patterns:[/^https?:\/\/(.+\.)?smugmug\.com\/.*/i],attributes:{providerNameSlug:"smugmug",previewable:!1,responsive:!0}},{name:"speaker-deck",title:"Speaker Deck",icon:ra,description:Object(Be.__)("Embed Speaker Deck content."),patterns:[/^https?:\/\/(www\.)?speakerdeck\.com\/.+/i],attributes:{providerNameSlug:"speaker-deck",responsive:!0}},{name:"tiktok",title:"TikTok",icon:la,keywords:[Object(Be.__)("video")],description:Object(Be.__)("Embed a TikTok video."),patterns:[/^https?:\/\/(www\.)?tiktok\.com\/.+/i],attributes:{providerNameSlug:"tiktok",responsive:!0}},{name:"ted",title:"TED",icon:la,description:Object(Be.__)("Embed a TED video."),patterns:[/^https?:\/\/(www\.|embed\.)?ted\.com\/.+/i],attributes:{providerNameSlug:"ted",responsive:!0}},{name:"tumblr",title:"Tumblr",icon:va,keywords:[Object(Be.__)("social")],description:Object(Be.__)("Embed a Tumblr post."),patterns:[/^https?:\/\/(www\.)?tumblr\.com\/.+/i],attributes:{providerNameSlug:"tumblr",responsive:!0}},{name:"videopress",title:"VideoPress",icon:la,keywords:[Object(Be.__)("video")],description:Object(Be.__)("Embed a VideoPress video."),patterns:[/^https?:\/\/videopress\.com\/.+/i],attributes:{providerNameSlug:"videopress",responsive:!0}},{name:"wordpress-tv",title:"WordPress.tv",icon:la,description:Object(Be.__)("Embed a WordPress.tv video."),patterns:[/^https?:\/\/wordpress\.tv\/.+/i],attributes:{providerNameSlug:"wordpress-tv",responsive:!0}},{name:"amazon-kindle",title:"Amazon Kindle",icon:Oa,keywords:[Object(Be.__)("ebook")],description:Object(Be.__)("Embed Amazon Kindle content."),patterns:[/^https?:\/\/([a-z0-9-]+\.)?(amazon|amzn)(\.[a-z]{2,4})+\/.+/i,/^https?:\/\/(www\.)?(a\.co|z\.cn)\/.+/i],attributes:{providerNameSlug:"amazon-kindle"}}];Ba.forEach(e=>{e.isActive||(e.isActive=(e,t)=>e.providerNameSlug===t.providerNameSlug)});var Ta=Ba;const{attributes:za}={apiVersion:2,name:"core/embed",title:"Embed",category:"embed",description:"Add a block that displays content pulled from other sites, like Twitter, Instagram or YouTube.",textdomain:"default",attributes:{url:{type:"string"},caption:{type:"string",source:"html",selector:"figcaption"},type:{type:"string"},providerNameSlug:{type:"string"},allowResponsive:{type:"boolean",default:!0},responsive:{type:"boolean",default:!1},previewable:{type:"boolean",default:!0}},supports:{align:!0},editorStyle:"wp-block-embed-editor",style:"wp-block-embed"};var Pa=[{attributes:za,save({attributes:{url:e,caption:t,type:n,providerNameSlug:o}}){if(!e)return null;const r=Me()("wp-block-embed",{["is-type-"+n]:n,["is-provider-"+o]:o});return Object(Te.createElement)("figure",{className:r},`\n${e}\n`,!Ce.RichText.isEmpty(t)&&Object(Te.createElement)(Ce.RichText.Content,{tagName:"figcaption",value:t}))}}];const Na={apiVersion:2,name:"core/embed",title:"Embed",category:"embed",description:"Add a block that displays content pulled from other sites, like Twitter, Instagram or YouTube.",textdomain:"default",attributes:{url:{type:"string"},caption:{type:"string",source:"html",selector:"figcaption"},type:{type:"string"},providerNameSlug:{type:"string"},allowResponsive:{type:"boolean",default:!0},responsive:{type:"boolean",default:!1},previewable:{type:"boolean",default:!0}},supports:{align:!0},editorStyle:"wp-block-embed-editor",style:"wp-block-embed"},{name:Ma}=Na,Va={icon:ra,edit:e=>{const{attributes:{providerNameSlug:t,previewable:n,responsive:o,url:r},attributes:a,isSelected:c,onReplace:l,setAttributes:i,insertBlocksAfter:s,onFocus:u}=e,m={title:Object(Be._x)("Embed","block title"),icon:ra},{icon:d,title:b}=(p=t,(null===(g=Object(xe.getBlockVariations)(ut))||void 0===g?void 0:g.find(({name:e})=>e===p))||m);var p,g;const[h,v]=Object(Te.useState)(r),[O,j]=Object(Te.useState)(!1),{invalidateResolution:f}=Object(Ye.useDispatch)("core/data"),{preview:y,fetching:_,themeSupportsResponsive:w,cannotEmbed:k}=Object(Ye.useSelect)(e=>{var t;const{getEmbedPreview:n,isPreviewEmbedFallback:o,isRequestingEmbedPreview:a,getThemeSupports:c}=e(Ee.store);if(!r)return{fetching:!1,cannotEmbed:!1};const l=n(r),i=o(r),s=!1===(null==l?void 0:l.html)&&void 0===(null==l?void 0:l.type),u=404===(null==l||null===(t=l.data)||void 0===t?void 0:t.status),m=!!l&&!s&&!u;return{preview:m?l:void 0,fetching:a(r),themeSupportsResponsive:c()["responsive-embeds"],cannotEmbed:!m||i}},[r]),E=()=>{const{allowResponsive:e,className:t}=a;return{...a,...gt(y,b,t,o,e)}};Object(Te.useEffect)(()=>{if(null==y||!y.html||!k||_)return;const e=r.replace(/\/$/,"");v(e),j(!1),i({url:e})},[null==y?void 0:y.html,r]),Object(Te.useEffect)(()=>{if(y&&!O&&(i(E()),l)){const t=dt(e,E());t&&l(t)}},[y,O]);const C=Object(Ce.useBlockProps)();if(_)return Object(Te.createElement)(ze.View,C,Object(Te.createElement)(ya,null));const x=Te.Platform.select({
|
50 |
/* translators: label for missing values in navigation link block */
|
51 |
q=Object(Be.__)("Add a link")}return Object(Te.createElement)(Te.Fragment,null,Object(Te.createElement)(Ce.BlockControls,null,Object(Te.createElement)(Le.ToolbarGroup,null,Object(Te.createElement)(Le.KeyboardShortcuts,{bindGlobal:!0,shortcuts:{[vn.rawShortcut.primary("k")]:()=>S(!0)}}),Object(Te.createElement)(Le.ToolbarButton,{name:"link",icon:Po.a,title:Object(Be.__)("Link"),shortcut:vn.displayShortcut.primary("k"),onClick:()=>S(!0)}),!N&&Object(Te.createElement)(Le.ToolbarButton,{name:"submenu",icon:Dc,title:Object(Be.__)("Add submenu"),onClick:function(){const e=R,t=Object(xe.createBlock)("core/navigation-link");C(t,e,l)}}))),Object(Te.createElement)(Ce.InspectorControls,null,Object(Te.createElement)(Le.PanelBody,{title:Object(Be.__)("Link settings")},Object(Te.createElement)(Le.TextareaControl,{value:h||"",onChange:e=>{n({description:e})},label:Object(Be.__)("Description"),help:Object(Be.__)("The description will be displayed in the menu if the current theme supports it.")}),Object(Te.createElement)(Le.TextControl,{value:O||"",onChange:e=>{n({title:e})},label:Object(Be.__)("Link title"),autoComplete:"off"}),Object(Te.createElement)(Le.TextControl,{value:v||"",onChange:e=>{n({rel:e})},label:Object(Be.__)("Link rel"),autoComplete:"off"}))),Object(Te.createElement)("li",F,Object(Te.createElement)("a",{className:U},g?Object(Te.createElement)(Ce.RichText,{ref:P,identifier:"label",className:"wp-block-navigation-link__label",value:d,onChange:e=>n({label:e}),onMerge:r,onReplace:a,__unstableOnSplitAtEnd:()=>o(Object(xe.createBlock)("core/navigation-link")),"aria-label":Object(Be.__)("Navigation link text"),placeholder:z,withoutInteractiveFormatting:!0,allowedFormats:["core/bold","core/italic","core/image","core/strikethrough"],onClick:()=>{g||S(!0)}}):Object(Te.createElement)("div",{className:"wp-block-navigation-link__placeholder-text"},Object(Te.createElement)(Le.KeyboardShortcuts,{shortcuts:{enter:()=>t&&S(!0)}}),q),x&&Object(Te.createElement)(Le.Popover,{position:"bottom center",onClose:()=>S(!1),anchorRef:B.current},Object(Te.createElement)(Le.KeyboardShortcuts,{bindGlobal:!0,shortcuts:{escape:()=>S(!1)}}),Object(Te.createElement)(Ce.__experimentalLinkControl,{className:"wp-block-navigation-link__inline-link-input",value:f,showInitialSuggestions:!0,withCreateSuggestion:D,createSuggestion:async function(e){const t=b||"page",n=await E("postType",t,{title:e,status:"draft"});return{id:n.id,type:t,title:n.title.rendered,url:n.link,kind:"post-type"}},createSuggestionButtonText:e=>{let t;
|
52 |
/* translators: %s: search term. */
|
53 |
+
return t="post"===b?Object(Be.__)("Create draft post: <mark>%s</mark>"):Object(Be.__)("Create draft page: <mark>%s</mark>"),Object(Te.createInterpolateElement)(Object(Be.sprintf)(t,e),{mark:Object(Te.createElement)("mark",null)})},noDirectEntry:!!b,noURLSuggestion:!!b,suggestionsQuery:qc(b,j),onChange:t=>((e={},t,n={})=>{const{label:o="",kind:r="",type:a=""}=n,{title:c="",url:l="",opensInNewTab:i,id:s,kind:u=r,type:m=a}=e,d=c.replace(/http(s?):\/\//gi,""),b=l.replace(/http(s?):\/\//gi,""),p=""!==c&&d!==b&&o!==c?Object(Se.escape)(c):o||Object(Se.escape)(b),g="post_tag"===m?"tag":m.replace("-","_"),h=["post","page","tag","category"].indexOf(g)>-1,v=!u&&!h||"custom"===u?"custom":u;t({...l&&{url:encodeURI(l)},...p&&{label:p},...void 0!==i&&{opensInNewTab:i},...s&&Number.isInteger(s)&&{id:s},...v&&{kind:v},...g&&"URL"!==g&&{type:g}})})(t,n,e)}))),I&&k&&Object(Te.createElement)("span",{className:"wp-block-navigation-link__submenu-icon"},Object(Te.createElement)(Fc,null)),Object(Te.createElement)("ul",G)))},save:function(){return Object(Te.createElement)(Ce.InnerBlocks.Content,null)},example:{attributes:{label:Object(Be._x)("Example Link","navigation link preview example"),url:"https://example.com"}},deprecated:[{isEligible:e=>e.nofollow,attributes:{label:{type:"string"},type:{type:"string"},nofollow:{type:"boolean"},description:{type:"string"},id:{type:"number"},opensInNewTab:{type:"boolean",default:!1},url:{type:"string"}},migrate:({nofollow:e,...t})=>({rel:e?"nofollow":"",...t}),save:()=>Object(Te.createElement)(Ce.InnerBlocks.Content,null)}]};Object(Rt.addFilter)("blocks.registerBlockType","core/navigation-link",(function(e,t){if("core/navigation-link"!==t)return e;if(!e.variations)return{...e,variations:Kc};if(e.variations){const t=(e,t)=>e.type===t.type,n=e.variations.map(e=>({...e,...!e.icon&&{icon:Yc(e.name)},...!e.isActive&&{isActive:t}}));return{...e,variations:n}}return e}));var nl=Object(Te.createElement)(ze.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(Te.createElement)(ze.Path,{d:"M12 4L4 7.9V20h16V7.9L12 4zm6.5 14.5H14V13h-4v5.5H5.5V8.8L12 5.7l6.5 3.1v9.7z"}));const ol=e=>e.preventDefault(),rl={apiVersion:2,name:"core/home-link",category:"design",parent:["core/navigation"],title:"Home Link",description:"Create a link that always points to the homepage of the site. Usually not necessary if there is already a site title link present in the header.",textdomain:"default",attributes:{label:{type:"string"}},usesContext:["textColor","customTextColor","backgroundColor","customBackgroundColor","fontSize","customFontSize","style"],supports:{reusable:!1,html:!1},editorStyle:"wp-block-home-link-editor",style:"wp-block-home-link"},{name:al}=rl,cl={icon:nl,edit:function({attributes:e,setAttributes:t,context:n,clientId:o}){var r,a,c,l;const{homeUrl:i}=Object(Ye.useSelect)(e=>{var t;const{getUnstableBase:n}=e(Ee.store);return{homeUrl:null===(t=n())||void 0===t?void 0:t.home}},[o]),{textColor:s,backgroundColor:u,style:m}=n,d=Object(Ce.useBlockProps)({className:Me()({"has-text-color":!!s||!(null==m||null===(r=m.color)||void 0===r||!r.text),[`has-${s}-color`]:!!s,"has-background":!!u||!(null==m||null===(a=m.color)||void 0===a||!a.background),[`has-${u}-background-color`]:!!u}),style:{color:null==m||null===(c=m.color)||void 0===c?void 0:c.text,backgroundColor:null==m||null===(l=m.color)||void 0===l?void 0:l.background}}),{label:b}=e;return Object(Te.useEffect)(()=>{void 0===b&&t({label:Object(Be.__)("Home")})},[o,b]),Object(Te.createElement)(Te.Fragment,null,Object(Te.createElement)("li",d,Object(Te.createElement)("a",{className:"wp-block-home-link__content",href:i,onClick:ol},Object(Te.createElement)(Ce.RichText,{identifier:"label",className:"wp-block-home-link__label",value:b,onChange:e=>{t({label:e})},"aria-label":Object(Be.__)("Home link text"),placeholder:Object(Be.__)("Add home link"),withoutInteractiveFormatting:!0,allowedFormats:["core/bold","core/italic","core/image","core/strikethrough"]}))))},save:function(){return Object(Te.createElement)(Ce.InnerBlocks.Content,null)},example:{attributes:{label:Object(Be._x)("Home Link","block example")}}};var ll=Object(Te.createElement)(ze.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(Te.createElement)(ze.Path,{d:"M18 4H6c-1.1 0-2 .9-2 2v12.9c0 .6.5 1.1 1.1 1.1.3 0 .5-.1.8-.3L8.5 17H18c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 11c0 .3-.2.5-.5.5H7.9l-2.4 2.4V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v9z"}));const il={apiVersion:2,name:"core/latest-comments",title:"Latest Comments",category:"widgets",description:"Display a list of your most recent comments.",keywords:["recent comments"],textdomain:"default",attributes:{commentsToShow:{type:"number",default:5,minimum:1,maximum:100},displayAvatar:{type:"boolean",default:!0},displayDate:{type:"boolean",default:!0},displayExcerpt:{type:"boolean",default:!0}},supports:{align:!0,html:!1},editorStyle:"wp-block-latest-comments-editor",style:"wp-block-latest-comments"},{name:sl}=il,ul={icon:ll,example:{},edit:function({attributes:e,setAttributes:t}){const{commentsToShow:n,displayAvatar:o,displayDate:r,displayExcerpt:a}=e;return Object(Te.createElement)("div",Object(Ce.useBlockProps)(),Object(Te.createElement)(Ce.InspectorControls,null,Object(Te.createElement)(Le.PanelBody,{title:Object(Be.__)("Latest comments settings")},Object(Te.createElement)(Le.ToggleControl,{label:Object(Be.__)("Display avatar"),checked:o,onChange:()=>t({displayAvatar:!o})}),Object(Te.createElement)(Le.ToggleControl,{label:Object(Be.__)("Display date"),checked:r,onChange:()=>t({displayDate:!r})}),Object(Te.createElement)(Le.ToggleControl,{label:Object(Be.__)("Display excerpt"),checked:a,onChange:()=>t({displayExcerpt:!a})}),Object(Te.createElement)(Le.RangeControl,{label:Object(Be.__)("Number of comments"),value:n,onChange:e=>t({commentsToShow:e}),min:1,max:100,required:!0}))),Object(Te.createElement)(Le.Disabled,null,Object(Te.createElement)(so.a,{block:"core/latest-comments",attributes:e})))}};var ml=Object(Te.createElement)(ze.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(Te.createElement)(ze.Path,{d:"M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 14c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v12zM7 11h2V9H7v2zm0 4h2v-2H7v2zm3-4h7V9h-7v2zm0 4h7v-2h-7v2z"}));const{attributes:dl}={apiVersion:2,name:"core/latest-posts",title:"Latest Posts",category:"widgets",description:"Display a list of your most recent posts.",keywords:["recent posts"],textdomain:"default",attributes:{categories:{type:"array",items:{type:"object"}},selectedAuthor:{type:"number"},postsToShow:{type:"number",default:5},displayPostContent:{type:"boolean",default:!1},displayPostContentRadio:{type:"string",default:"excerpt"},excerptLength:{type:"number",default:55},displayAuthor:{type:"boolean",default:!1},displayPostDate:{type:"boolean",default:!1},postLayout:{type:"string",default:"list"},columns:{type:"number",default:3},order:{type:"string",default:"desc"},orderBy:{type:"string",default:"date"},displayFeaturedImage:{type:"boolean",default:!1},featuredImageAlign:{type:"string",enum:["left","center","right"]},featuredImageSizeSlug:{type:"string",default:"thumbnail"},featuredImageSizeWidth:{type:"number",default:null},featuredImageSizeHeight:{type:"number",default:null},addLinkToFeaturedImage:{type:"boolean",default:!1}},supports:{align:!0,html:!1},editorStyle:"wp-block-latest-posts-editor",style:"wp-block-latest-posts"};var bl=[{attributes:{...dl,categories:{type:"string"}},supports:{align:!0,html:!1},migrate:e=>({...e,categories:[{id:Number(e.categories)}]}),isEligible:({categories:e})=>e&&"string"==typeof e,save:()=>null}],pl=n(48),gl=Object(Te.createElement)(ze.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(Te.createElement)(ze.Path,{d:"M4 4v1.5h16V4H4zm8 8.5h8V11h-8v1.5zM4 20h16v-1.5H4V20zm4-8c0-1.1-.9-2-2-2s-2 .9-2 2 .9 2 2 2 2-.9 2-2z"})),hl=n(301);const vl={per_page:-1},Ol={per_page:-1},jl={apiVersion:2,name:"core/latest-posts",title:"Latest Posts",category:"widgets",description:"Display a list of your most recent posts.",keywords:["recent posts"],textdomain:"default",attributes:{categories:{type:"array",items:{type:"object"}},selectedAuthor:{type:"number"},postsToShow:{type:"number",default:5},displayPostContent:{type:"boolean",default:!1},displayPostContentRadio:{type:"string",default:"excerpt"},excerptLength:{type:"number",default:55},displayAuthor:{type:"boolean",default:!1},displayPostDate:{type:"boolean",default:!1},postLayout:{type:"string",default:"list"},columns:{type:"number",default:3},order:{type:"string",default:"desc"},orderBy:{type:"string",default:"date"},displayFeaturedImage:{type:"boolean",default:!1},featuredImageAlign:{type:"string",enum:["left","center","right"]},featuredImageSizeSlug:{type:"string",default:"thumbnail"},featuredImageSizeWidth:{type:"number",default:null},featuredImageSizeHeight:{type:"number",default:null},addLinkToFeaturedImage:{type:"boolean",default:!1}},supports:{align:!0,html:!1},editorStyle:"wp-block-latest-posts-editor",style:"wp-block-latest-posts"},{name:fl}=jl,yl={icon:ml,example:{},edit:function({attributes:e,setAttributes:t}){const{postsToShow:n,order:o,orderBy:r,categories:a,selectedAuthor:c,displayFeaturedImage:l,displayPostContentRadio:i,displayPostContent:s,displayPostDate:u,displayAuthor:m,postLayout:d,columns:b,excerptLength:p,featuredImageAlign:g,featuredImageSizeSlug:h,featuredImageSizeWidth:v,featuredImageSizeHeight:O,addLinkToFeaturedImage:j}=e,{imageSizeOptions:f,latestPosts:y,defaultImageWidth:_,defaultImageHeight:w}=Object(Ye.useSelect)(e=>{const{getEntityRecords:t,getMedia:l}=e(Ee.store),{getSettings:i}=e(Ce.store),{imageSizes:s,imageDimensions:u}=i(),m=a&&a.length>0?a.map(e=>e.id):[],d=t("postType","post",Object(Se.pickBy)({categories:m,author:c,order:o,orderby:r,per_page:n},e=>!Object(Se.isUndefined)(e)));return{defaultImageWidth:Object(Se.get)(u,[h,"width"],0),defaultImageHeight:Object(Se.get)(u,[h,"height"],0),imageSizeOptions:s.filter(({slug:e})=>"full"!==e).map(({name:e,slug:t})=>({value:t,label:e})),latestPosts:Array.isArray(d)?d.map(e=>{if(!e.featured_media)return e;const t=l(e.featured_media);let n=Object(Se.get)(t,["media_details","sizes",h,"source_url"],null);n||(n=Object(Se.get)(t,"source_url",null));const o={url:n,alt:null==t?void 0:t.alt_text};return{...e,featuredImageInfo:o}}):d}},[h,n,o,r,a,c]),[k,E]=Object(Te.useState)([]),[C,x]=Object(Te.useState)([]),S=k.reduce((e,t)=>({...e,[t.name]:t}),{}),B=Object(Te.useRef)();Object(Te.useEffect)(()=>(B.current=!0,Ht()({path:Object(et.addQueryArgs)("/wp/v2/categories",vl)}).then(e=>{B.current&&E(e)}).catch(()=>{B.current&&E([])}),Ht()({path:Object(et.addQueryArgs)("/wp/v2/users",Ol)}).then(e=>{B.current&&x(e)}).catch(()=>{B.current&&x([])}),()=>{B.current=!1}),[]);const T=!(null==y||!y.length),z=Object(Te.createElement)(Ce.InspectorControls,null,Object(Te.createElement)(Le.PanelBody,{title:Object(Be.__)("Post content settings")},Object(Te.createElement)(Le.ToggleControl,{label:Object(Be.__)("Post content"),checked:s,onChange:e=>t({displayPostContent:e})}),s&&Object(Te.createElement)(Le.RadioControl,{label:Object(Be.__)("Show:"),selected:i,options:[{label:Object(Be.__)("Excerpt"),value:"excerpt"},{label:Object(Be.__)("Full post"),value:"full_post"}],onChange:e=>t({displayPostContentRadio:e})}),s&&"excerpt"===i&&Object(Te.createElement)(Le.RangeControl,{label:Object(Be.__)("Max number of words in excerpt"),value:p,onChange:e=>t({excerptLength:e}),min:10,max:100})),Object(Te.createElement)(Le.PanelBody,{title:Object(Be.__)("Post meta settings")},Object(Te.createElement)(Le.ToggleControl,{label:Object(Be.__)("Display author name"),checked:m,onChange:e=>t({displayAuthor:e})}),Object(Te.createElement)(Le.ToggleControl,{label:Object(Be.__)("Display post date"),checked:u,onChange:e=>t({displayPostDate:e})})),Object(Te.createElement)(Le.PanelBody,{title:Object(Be.__)("Featured image settings")},Object(Te.createElement)(Le.ToggleControl,{label:Object(Be.__)("Display featured image"),checked:l,onChange:e=>t({displayFeaturedImage:e})}),l&&Object(Te.createElement)(Te.Fragment,null,Object(Te.createElement)(Ce.__experimentalImageSizeControl,{onChange:e=>{const n={};e.hasOwnProperty("width")&&(n.featuredImageSizeWidth=e.width),e.hasOwnProperty("height")&&(n.featuredImageSizeHeight=e.height),t(n)},slug:h,width:v,height:O,imageWidth:_,imageHeight:w,imageSizeOptions:f,onChangeImage:e=>t({featuredImageSizeSlug:e,featuredImageSizeWidth:void 0,featuredImageSizeHeight:void 0})}),Object(Te.createElement)(Le.BaseControl,{className:"block-editor-image-alignment-control__row"},Object(Te.createElement)(Le.BaseControl.VisualLabel,null,Object(Be.__)("Image alignment")),Object(Te.createElement)(Ce.BlockAlignmentToolbar,{value:g,onChange:e=>t({featuredImageAlign:e}),controls:["left","center","right"],isCollapsed:!1})),Object(Te.createElement)(Le.ToggleControl,{label:Object(Be.__)("Add link to featured image"),checked:j,onChange:e=>t({addLinkToFeaturedImage:e})}))),Object(Te.createElement)(Le.PanelBody,{title:Object(Be.__)("Sorting and filtering")},Object(Te.createElement)(Le.QueryControls,{order:o,orderBy:r,numberOfItems:n,onOrderChange:e=>t({order:e}),onOrderByChange:e=>t({orderBy:e}),onNumberOfItemsChange:e=>t({postsToShow:e}),categorySuggestions:S,onCategoryChange:e=>{if(e.some(e=>"string"==typeof e&&!S[e]))return;const n=e.map(e=>"string"==typeof e?S[e]:e);if(Object(Se.includes)(n,null))return!1;t({categories:n})},selectedCategories:a,onAuthorChange:e=>t({selectedAuthor:""!==e?Number(e):void 0}),authorList:C,selectedAuthorId:c}),"grid"===d&&Object(Te.createElement)(Le.RangeControl,{label:Object(Be.__)("Columns"),value:b,onChange:e=>t({columns:e}),min:2,max:T?Math.min(6,y.length):6,required:!0}))),P=Object(Ce.useBlockProps)({className:Me()({"wp-block-latest-posts__list":!0,"is-grid":"grid"===d,"has-dates":u,"has-author":m,["columns-"+b]:"grid"===d})});if(!T)return Object(Te.createElement)("div",P,z,Object(Te.createElement)(Le.Placeholder,{icon:er,label:Object(Be.__)("Latest Posts")},Array.isArray(y)?Object(Be.__)("No posts found."):Object(Te.createElement)(Le.Spinner,null)));const N=y.length>n?y.slice(0,n):y,M=[{icon:gl,title:Object(Be.__)("List view"),onClick:()=>t({postLayout:"list"}),isActive:"list"===d},{icon:hl.a,title:Object(Be.__)("Grid view"),onClick:()=>t({postLayout:"grid"}),isActive:"grid"===d}],V=Object(pl.__experimentalGetSettings)().formats.date;return Object(Te.createElement)("div",null,z,Object(Te.createElement)(Ce.BlockControls,null,Object(Te.createElement)(Le.ToolbarGroup,{controls:M})),Object(Te.createElement)("ul",P,N.map((e,t)=>{const n=Object(Se.invoke)(e,["title","rendered","trim"]);let o=e.excerpt.rendered;const r=C.find(t=>t.id===e.author),a=document.createElement("div");a.innerHTML=o,o=a.textContent||a.innerText||"";const{featuredImageInfo:{url:c,alt:d}={}}=e,b=Me()({"wp-block-latest-posts__featured-image":!0,["align"+g]:!!g}),h=l&&c,f=h&&Object(Te.createElement)("img",{src:c,alt:d,style:{maxWidth:v,maxHeight:O}}),y=p<o.trim().split(" ").length&&""===e.excerpt.raw?Object(Te.createElement)(Te.Fragment,null,o.trim().split(" ",p).join(" "),Object(Be.__)(" … "),Object(Te.createElement)("a",{href:e.link,rel:"noopener noreferrer"},Object(Be.__)("Read more"))):o;return Object(Te.createElement)("li",{key:t},h&&Object(Te.createElement)("div",{className:b},j?Object(Te.createElement)("a",{href:e.link,rel:"noreferrer noopener"},f):f),Object(Te.createElement)("a",{href:e.link,rel:"noreferrer noopener"},n?Object(Te.createElement)(Te.RawHTML,null,n):Object(Be.__)("(no title)")),m&&r&&Object(Te.createElement)("div",{className:"wp-block-latest-posts__post-author"},Object(Be.sprintf)(
|
54 |
/* translators: byline. %s: current author. */
|
55 |
Object(Be.__)("by %s"),r.name)),u&&e.date_gmt&&Object(Te.createElement)("time",{dateTime:Object(pl.format)("c",e.date_gmt),className:"wp-block-latest-posts__post-date"},Object(pl.dateI18n)(V,e.date_gmt)),s&&"excerpt"===i&&Object(Te.createElement)("div",{className:"wp-block-latest-posts__post-excerpt"},y),s&&"full_post"===i&&Object(Te.createElement)("div",{className:"wp-block-latest-posts__post-full-content"},Object(Te.createElement)(Te.RawHTML,{key:"html"},e.content.raw.trim())))})))},deprecated:bl};var _l=Object(Te.createElement)(ze.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(Te.createElement)(ze.Path,{d:"M7 11h2v2H7v-2zm14-5v14l-2 2H5l-2-2V6l2-2h1V2h2v2h8V2h2v2h1l2 2zM5 8h14V6H5v2zm14 12V10H5v10h14zm-4-7h2v-2h-2v2zm-4 0h2v-2h-2v2z"})),wl=Object(Te.createElement)(ze.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(Te.createElement)(ze.Path,{d:"M4 20h8v-1.5H4V20zM18.9 3.5c-.6-.6-1.5-.6-2.1 0l-7.2 7.2c-.4-.1-.7 0-1.1.1-.5.2-1.5.7-1.9 2.2-.4 1.7-.8 2.2-1.1 2.7-.1.1-.2.3-.3.4l-.6 1.1H6c2 0 3.4-.4 4.7-1.4.8-.6 1.2-1.4 1.3-2.3 0-.3 0-.5-.1-.7L19 5.7c.5-.6.5-1.6-.1-2.2zM9.7 14.7c-.7.5-1.5.8-2.4 1 .2-.5.5-1.2.8-2.3.2-.6.4-1 .8-1.1.5-.1 1 .1 1.3.3.2.2.3.5.2.8 0 .3-.1.9-.7 1.3z"})),kl=Object(Te.createElement)(ze.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},Object(Te.createElement)(ze.Path,{d:"M10.2 3.28c3.53 0 6.43 2.61 6.92 6h2.08l-3.5 4-3.5-4h2.32c-.45-1.97-2.21-3.45-4.32-3.45-1.45 0-2.73.71-3.54 1.78L4.95 5.66C6.23 4.2 8.11 3.28 10.2 3.28zm-.4 13.44c-3.52 0-6.43-2.61-6.92-6H.8l3.5-4c1.17 1.33 2.33 2.67 3.5 4H5.48c.45 1.97 2.21 3.45 4.32 3.45 1.45 0 2.73-.71 3.54-1.78l1.71 1.95c-1.28 1.46-3.15 2.38-5.25 2.38z"}));function El({selectedId:e,onSelect:t}){const n=Object(Ye.useSelect)(e=>{var t,n,o;const r=null!==(t=null===(n=e(Ce.store).getSettings())||void 0===n?void 0:n.widgetTypesToHideFromLegacyWidgetBlock)&&void 0!==t?t:[];return null===(o=e(Ee.store).getWidgetTypes({per_page:-1}))||void 0===o?void 0:o.filter(e=>!r.includes(e.id))},[]);return n?0===n.length?Object(Be.__)("There are no widgets available."):Object(Te.createElement)(Le.SelectControl,{label:Object(Be.__)("Select a legacy widget to display:"),value:null!=e?e:"",options:[{value:"",label:Object(Be.__)("Select widget")},...n.map(e=>({value:e.id,label:e.name}))],onChange:e=>{if(e){const o=n.find(t=>t.id===e);t({selectedId:o.id,isMulti:o.is_multi})}else t({selectedId:null})}}):Object(Te.createElement)(Le.Spinner,null)}function Cl({name:e,description:t}){return Object(Te.createElement)("div",{className:"wp-block-legacy-widget-inspector-card"},Object(Te.createElement)("h3",{className:"wp-block-legacy-widget-inspector-card__name"},e),Object(Te.createElement)("span",null,t))}class xl{constructor({id:e,idBase:t,instance:n,onChangeInstance:o,onChangeHasPreview:r,onError:a}){this.id=e,this.idBase=t,this._instance=n,this._hasPreview=null,this.onChangeInstance=o,this.onChangeHasPreview=r,this.onError=a,this.number=++Sl,this.handleFormChange=Object(Se.debounce)(this.saveForm.bind(this),200),this.handleFormSubmit=this.handleFormSubmit.bind(this),this.initDOM(),this.bindEvents(),this.loadContent()}destroy(){this.unbindEvents(),this.element.remove()}initDOM(){var e,t;this.element=Bl("div",{class:"widget open"},[Bl("div",{class:"widget-inside"},[this.form=Bl("form",{class:"form",method:"post"},[Bl("input",{class:"widget-id",type:"hidden",name:"widget-id",value:null!==(e=this.id)&&void 0!==e?e:`${this.idBase}-${this.number}`}),Bl("input",{class:"id_base",type:"hidden",name:"id_base",value:null!==(t=this.idBase)&&void 0!==t?t:this.id}),Bl("input",{class:"widget-width",type:"hidden",name:"widget-width",value:"250"}),Bl("input",{class:"widget-height",type:"hidden",name:"widget-height",value:"200"}),Bl("input",{class:"widget_number",type:"hidden",name:"widget_number",value:this.idBase?this.number.toString():""}),this.content=Bl("div",{class:"widget-content"}),this.id&&Bl("button",{class:"button is-primary",type:"submit"},Object(Be.__)("Save"))])])])}bindEvents(){if(window.jQuery){const{jQuery:e}=window;e(this.form).on("change",null,this.handleFormChange),e(this.form).on("input",null,this.handleFormChange),e(this.form).on("submit",this.handleFormSubmit)}else this.form.addEventListener("change",this.handleFormChange),this.form.addEventListener("input",this.handleFormChange),this.form.addEventListener("submit",this.handleFormSubmit)}unbindEvents(){if(window.jQuery){const{jQuery:e}=window;e(this.form).off("change",null,this.handleFormChange),e(this.form).off("input",null,this.handleFormChange),e(this.form).off("submit",this.handleFormSubmit)}else this.form.removeEventListener("change",this.handleFormChange),this.form.removeEventListener("input",this.handleFormChange),this.form.removeEventListener("submit",this.handleFormSubmit)}async loadContent(){try{if(this.id){const{form:e}=await Tl(this.id);this.content.innerHTML=e}else if(this.idBase){const{form:e,preview:t}=await zl({idBase:this.idBase,instance:this.instance,number:this.number});if(this.content.innerHTML=e,this.hasPreview=!Pl(t),!this.instance.hash){const{instance:e}=await zl({idBase:this.idBase,instance:this.instance,number:this.number,formData:Nl(this.form)});this.instance=e}}if(window.jQuery){const{jQuery:e}=window;e(document).trigger("widget-added",[e(this.element)])}}catch(e){this.onError(e)}}handleFormSubmit(e){e.preventDefault(),this.saveForm()}async saveForm(){const e=Nl(this.form);try{if(this.id){const{form:t}=await Tl(this.id,e);if(this.content.innerHTML=t,window.jQuery){const{jQuery:e}=window;e(document).trigger("widget-updated",[e(this.element)])}}else if(this.idBase){const{instance:t,preview:n}=await zl({idBase:this.idBase,instance:this.instance,number:this.number,formData:e});this.instance=t,this.hasPreview=!Pl(n)}}catch(e){this.onError(e)}}get instance(){return this._instance}set instance(e){this._instance!==e&&(this._instance=e,this.onChangeInstance(e))}get hasPreview(){return this._hasPreview}set hasPreview(e){this._hasPreview!==e&&(this._hasPreview=e,this.onChangeHasPreview(e))}}let Sl=0;function Bl(e,t={},n=null){const o=document.createElement(e);for(const[e,n]of Object.entries(t))o.setAttribute(e,n);if(Array.isArray(n))for(const e of n)e&&o.appendChild(e);else"string"==typeof n&&(o.innerText=n);return o}async function Tl(e,t=null){let n;return n=t?await Ht()({path:`/wp/v2/widgets/${e}?context=edit`,method:"PUT",data:{form_data:t}}):await Ht()({path:`/wp/v2/widgets/${e}?context=edit`,method:"GET"}),{form:n.rendered_form}}async function zl({idBase:e,instance:t,number:n,formData:o=null}){const r=await Ht()({path:`/wp/v2/widget-types/${e}/encode`,method:"POST",data:{instance:t,number:n,form_data:o}});return{instance:r.instance,form:r.form,preview:r.preview}}function Pl(e){const t=document.createElement("div");return t.innerHTML=e,""===t.innerText.trim()}function Nl(e){return new window.URLSearchParams(Array.from(new window.FormData(e))).toString()}function Ml({title:e,isVisible:t,id:n,idBase:o,instance:r,onChangeInstance:a,onChangeHasPreview:c}){const l=Object(Te.useRef)(),i=Object(Te.useRef)(new Set),s=Object(Te.useRef)(new Set),{createNotice:u}=Object(Ye.useDispatch)(rt.store);return Object(Te.useEffect)(()=>{if(s.current.has(r))return void s.current.delete(r);const e=new xl({id:n,idBase:o,instance:r,onChangeInstance(e){i.current.add(r),s.current.add(e),a(e)},onChangeHasPreview:c,onError(e){var t;u("error",null!==(t=null==e?void 0:e.message)&&void 0!==t?t:Object(Be.__)("An error occured while fetching or updating the widget."))}});return l.current.appendChild(e.element),()=>{i.current.has(r)?i.current.delete(r):e.destroy()}},[n,o,r,a,c]),Object(Te.createElement)("div",{ref:l,className:"wp-block-legacy-widget__edit-form",hidden:!t},Object(Te.createElement)("h3",{className:"wp-block-legacy-widget__edit-form-title"},e))}function Vl({idBase:e,instance:t,isVisible:n}){const[o,r]=Object(Te.useState)(null);return Object(Te.createElement)(Te.Fragment,null,n&&null===o&&Object(Te.createElement)(Le.Placeholder,null,Object(Te.createElement)(Le.Spinner,null)),Object(Te.createElement)("div",{className:Me()("wp-block-legacy-widget__edit-preview",{"is-offscreen":!n||null===o})},Object(Te.createElement)(Le.Disabled,null,Object(Te.createElement)("iframe",{className:"wp-block-legacy-widget__edit-preview-iframe",title:Object(Be.__)("Legacy Widget Preview"),src:Object(et.addQueryArgs)("themes.php",{page:"gutenberg-widgets","legacy-widget-preview":{idBase:e,instance:t}}),height:null!=o?o:100,onLoad:e=>{r(e.target.contentDocument.body.scrollHeight)}}))))}function Il({name:e}){return Object(Te.createElement)("div",{className:"wp-block-legacy-widget__edit-no-preview"},e&&Object(Te.createElement)("h3",null,e),Object(Te.createElement)("p",null,Object(Be.__)("No preview available.")))}function Hl({clientId:e,rawInstance:t}){const{replaceBlocks:n}=Object(Ye.useDispatch)(Ce.store);return Object(Te.createElement)(Le.ToolbarButton,{onClick:()=>{t.title?n(e,[Object(xe.createBlock)("core/heading",{content:t.title}),...Object(xe.rawHandler)({HTML:t.text})]):n(e,Object(xe.rawHandler)({HTML:t.text}))}},Object(Be.__)("Convert to blocks"))}function Rl({attributes:{id:e,idBase:t},setAttributes:n}){return Object(Te.createElement)(Le.Placeholder,{icon:Object(Te.createElement)(Ce.BlockIcon,{icon:wl}),label:Object(Be.__)("Legacy Widget")},Object(Te.createElement)(El,{selectedId:null!=e?e:t,onSelect:({selectedId:e,isMulti:t})=>{n(e?t?{id:null,idBase:e,instance:{}}:{id:e,idBase:null,instance:null}:{id:null,idBase:null,instance:null})}}))}function Al({attributes:{id:e,idBase:t,instance:n},setAttributes:o,clientId:r,isSelected:a}){const[c,l]=Object(Te.useState)(null),{widgetType:i,hasResolvedWidgetType:s,isWidgetTypeHidden:u,isNavigationMode:m}=Object(Ye.useSelect)(n=>{var o,r;const a=null!=e?e:t,c=null!==(o=null===(r=n(Ce.store).getSettings())||void 0===r?void 0:r.widgetTypesToHideFromLegacyWidgetBlock)&&void 0!==o?o:[];return{widgetType:n(Ee.store).getWidgetType(a),hasResolvedWidgetType:n(Ee.store).hasFinishedResolution("getWidgetType",[a]),isWidgetTypeHidden:c.includes(a),isNavigationMode:n(Ce.store).isNavigationMode()}},[e,t]),d=Object(Te.useCallback)(e=>{o({instance:e})},[]);if(!i&&s)return Object(Te.createElement)(Le.Placeholder,{icon:Object(Te.createElement)(Ce.BlockIcon,{icon:wl}),label:Object(Be.__)("Legacy Widget")},Object(Be.__)("Widget is missing."));if(!s)return Object(Te.createElement)(Le.Placeholder,null,Object(Te.createElement)(Le.Spinner,null));const b=m||!a?"preview":"edit";return Object(Te.createElement)(Te.Fragment,null,!u&&Object(Te.createElement)(Ce.BlockControls,{group:"block"},Object(Te.createElement)(Le.ToolbarButton,{label:Object(Be.__)("Change widget"),icon:kl,onClick:()=>o({id:null,idBase:null,instance:null})})),"text"===t&&Object(Te.createElement)(Ce.BlockControls,{group:"other"},Object(Te.createElement)(Hl,{clientId:r,rawInstance:n.raw})),Object(Te.createElement)(Ce.InspectorControls,null,Object(Te.createElement)(Cl,{name:i.name,description:i.description})),Object(Te.createElement)(Ml,{title:i.name,isVisible:"edit"===b,id:e,idBase:t,instance:n,onChangeInstance:d,onChangeHasPreview:l}),t&&Object(Te.createElement)(Te.Fragment,null,null===c&&"preview"===b&&Object(Te.createElement)(Le.Placeholder,null,Object(Te.createElement)(Le.Spinner,null)),!0===c&&Object(Te.createElement)(Vl,{idBase:t,instance:n,isVisible:"preview"===b}),!1===c&&"preview"===b&&Object(Te.createElement)(Il,{name:i.name})))}var Ll={to:[{block:"core/calendar",widget:"calendar"},{block:"core/search",widget:"search"},{block:"core/html",widget:"html",transform:({content:e})=>({content:e})},{block:"core/archives",widget:"archives",transform:({count:e,dropdown:t})=>({displayAsDropdown:!!t,showPostCounts:!!e})},{block:"core/latest-posts",widget:"recent-posts",transform:({show_date:e,number:t})=>({displayPostDate:!!e,postsToShow:t})},{block:"core/latest-comments",widget:"recent-comments",transform:({number:e})=>({commentsToShow:e})},{block:"core/tag-cloud",widget:"tag_cloud",transform:({taxonomy:e,count:t})=>({showTagCounts:!!t,taxonomy:e})},{block:"core/categories",widget:"categories",transform:({count:e,dropdown:t,hierarchical:n})=>({displayAsDropdown:!!t,showPostCounts:!!e,showHierarchy:!!n})},{block:"core/audio",widget:"media_audio",transform:({url:e,preload:t,loop:n,attachment_id:o})=>({src:e,id:o,preload:t,loop:n})},{block:"core/video",widget:"media_video",transform:({url:e,preload:t,loop:n,attachment_id:o})=>({src:e,id:o,preload:t,loop:n})},{block:"core/image",widget:"media_image",transform:({alt:e,attachment_id:t,caption:n,height:o,link_classes:r,link_rel:a,link_target_blank:c,link_type:l,link_url:i,size:s,url:u,width:m})=>({alt:e,caption:n,height:o,id:t,link:i,linkClass:r,linkDestination:l,linkTarget:c?"_blank":void 0,rel:a,sizeSlug:s,url:u,width:m})},{block:"core/gallery",widget:"media_gallery",transform:({ids:e,link_type:t,size:n,number:o})=>({ids:e,columns:o,linkTo:t,sizeSlug:n,images:e.map(e=>({id:e}))})},{block:"core/rss",widget:"rss",transform:({url:e,show_author:t,show_date:n,show_summary:o,items:r})=>({feedURL:e,displayAuthor:!!t,displayDate:!!n,displayExcerpt:!!o,itemsToShow:r})}].map(({block:e,widget:t,transform:n})=>({type:"block",blocks:[e],isMatch:({idBase:e,instance:n})=>e===t&&!(null==n||!n.raw),transform:({instance:t})=>{var o;const r=Object(xe.createBlock)(e,n?n(t.raw):void 0);return null!==(o=t.raw)&&void 0!==o&&o.title?[Object(xe.createBlock)("core/heading",{content:t.raw.title}),r]:r}}))};const Dl={apiVersion:2,name:"core/legacy-widget",title:"Legacy Widget",category:"widgets",description:"Display a legacy widget.",textdomain:"default",attributes:{id:{type:"string",default:null},idBase:{type:"string",default:null},instance:{type:"object",default:null}},supports:{html:!1,customClassName:!1,reusable:!1},editorStyle:"wp-block-legacy-widget-editor"},{name:Fl}=Dl,Gl={icon:_l,edit:function(e){const{id:t,idBase:n}=e.attributes;return Object(Te.createElement)("div",Object(Ce.useBlockProps)(),t||n?Object(Te.createElement)(Al,e):Object(Te.createElement)(Rl,e))},transforms:Ll};var Ul=Object(Te.createElement)(ze.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(Te.createElement)(ze.Path,{d:"M11 14.5l1.1 1.1 3-3 .5-.5-.6-.6-3-3-1 1 1.7 1.7H5v1.5h7.7L11 14.5zM16.8 5h-7c-1.1 0-2 .9-2 2v1.5h1.5V7c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5v10c0 .3-.2.5-.5.5h-7c-.3 0-.5-.2-.5-.5v-1.5H7.8V17c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2z"}));const ql={apiVersion:2,name:"core/loginout",title:"Login/out",category:"design",description:"Show login & logout links.",keywords:["login","logout","form"],textdomain:"default",attributes:{displayLoginAsForm:{type:"boolean",default:!1},redirectToCurrent:{type:"boolean",default:!0}},supports:{className:!0,fontSize:!1}},{name:Wl}=ql,$l={icon:Ul,edit:function({attributes:e,setAttributes:t}){const{displayLoginAsForm:n,redirectToCurrent:o}=e;return Object(Te.createElement)(Te.Fragment,null,Object(Te.createElement)(Ce.InspectorControls,null,Object(Te.createElement)(Le.PanelBody,{title:Object(Be.__)("Login/out settings")},Object(Te.createElement)(Le.ToggleControl,{label:Object(Be.__)("Display login as form"),checked:n,onChange:()=>t({displayLoginAsForm:!n})}),Object(Te.createElement)(Le.ToggleControl,{label:Object(Be.__)("Redirect to current URL"),checked:o,onChange:()=>t({redirectToCurrent:!o})}))),Object(Te.createElement)("div",Object(Ce.useBlockProps)({className:"logged-in"}),Object(Te.createElement)("a",{href:"#login-pseudo-link"},Object(Be.__)("Log out"))))}};var Zl=Object(Te.createElement)(ze.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(Te.createElement)(ze.Path,{d:"M4 8.8h8.9V7.2H4v1.6zm0 7h8.9v-1.5H4v1.5zM18 13c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-3c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z"})),Ql=Object(Te.createElement)(ze.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(Te.createElement)(ze.Path,{d:"M11.1 15.8H20v-1.5h-8.9v1.5zm0-8.6v1.5H20V7.2h-8.9zM6 13c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-7c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"})),Jl=Object(Te.createElement)(ze.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(Te.createElement)(ze.Path,{d:"M3.8 15.8h8.9v-1.5H3.8v1.5zm0-7h8.9V7.2H3.8v1.6zm14.7-2.1V10h1V5.3l-2.2.7.3 1 .9-.3zm1.2 6.1c-.5-.6-1.2-.5-1.7-.4-.3.1-.5.2-.7.3l.1 1.1c.2-.2.5-.4.8-.5.3-.1.6 0 .7.1.2.3 0 .8-.2 1.1-.5.8-.9 1.6-1.4 2.5H20v-1h-.9c.3-.6.8-1.4.9-2.1 0-.3 0-.8-.3-1.1z"})),Kl=Object(Te.createElement)(ze.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(Te.createElement)(ze.Path,{d:"M11.1 15.8H20v-1.5h-8.9v1.5zm0-8.6v1.5H20V7.2h-8.9zM5 6.7V10h1V5.3L3.8 6l.4 1 .8-.3zm-.4 5.7c-.3.1-.5.2-.7.3l.1 1.1c.2-.2.5-.4.8-.5.3-.1.6 0 .7.1.2.3 0 .8-.2 1.1-.5.8-.9 1.6-1.4 2.5h2.7v-1h-1c.3-.6.8-1.4.9-2.1.1-.3 0-.8-.2-1.1-.5-.6-1.3-.5-1.7-.4z"})),Yl=Object(Te.createElement)(ze.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(Te.createElement)(ze.Path,{d:"M20 5.5H4V4H20V5.5ZM12 12.5H4V11H12V12.5ZM20 20V18.5H4V20H20ZM15.4697 14.9697L18.4393 12L15.4697 9.03033L16.5303 7.96967L20.0303 11.4697L20.5607 12L20.0303 12.5303L16.5303 16.0303L15.4697 14.9697Z"})),Xl=Object(Te.createElement)(ze.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(Te.createElement)(ze.Path,{d:"M4 7.2v1.5h16V7.2H4zm8 8.6h8v-1.5h-8v1.5zm-4-4.6l-4 4 4 4 1-1-3-3 3-3-1-1z"})),ei=Object(Te.createElement)(ze.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(Te.createElement)(ze.Path,{d:"M20 5.5H4V4H20V5.5ZM12 12.5H4V11H12V12.5ZM20 20V18.5H4V20H20ZM20.0303 9.03033L17.0607 12L20.0303 14.9697L18.9697 16.0303L15.4697 12.5303L14.9393 12L15.4697 11.4697L18.9697 7.96967L20.0303 9.03033Z"})),ti=Object(Te.createElement)(ze.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(Te.createElement)(ze.Path,{d:"M4 7.2v1.5h16V7.2H4zm8 8.6h8v-1.5h-8v1.5zm-8-3.5l3 3-3 3 1 1 4-4-4-4-1 1z"})),ni=({setAttributes:e,reversed:t,start:n})=>Object(Te.createElement)(Ce.InspectorControls,null,Object(Te.createElement)(Le.PanelBody,{title:Object(Be.__)("Ordered list settings")},Object(Te.createElement)(Le.TextControl,{label:Object(Be.__)("Start value"),type:"number",onChange:t=>{const n=parseInt(t,10);e({start:isNaN(n)?void 0:n})},value:Number.isInteger(n)?n.toString(10):"",step:"1"}),Object(Te.createElement)(Le.ToggleControl,{label:Object(Be.__)("Reverse list numbering"),checked:t||!1,onChange:t=>{e({reversed:t||void 0})}})));function oi({phrasingContentSchema:e}){const t={...e,ul:{},ol:{attributes:["type","start","reversed"]}};return["ul","ol"].forEach(e=>{t[e].children={li:{children:t}}}),t}var ri={from:[{type:"block",isMultiBlock:!0,blocks:["core/paragraph","core/heading"],transform:e=>Object(xe.createBlock)("core/list",{values:Object(Pn.toHTMLString)({value:Object(Pn.join)(e.map(({content:t})=>{const n=Object(Pn.create)({html:t});return e.length>1?n:Object(Pn.replace)(n,/\n/g,Pn.__UNSTABLE_LINE_SEPARATOR)}),Pn.__UNSTABLE_LINE_SEPARATOR),multilineTag:"li"}),anchor:e.anchor})},{type:"block",blocks:["core/quote","core/pullquote"],transform:({value:e,anchor:t})=>Object(xe.createBlock)("core/list",{values:Object(Pn.toHTMLString)({value:Object(Pn.create)({html:e,multilineTag:"p"}),multilineTag:"li"}),anchor:t})},{type:"raw",selector:"ol,ul",schema:e=>({ol:oi(e).ol,ul:oi(e).ul}),transform(e){const t={ordered:"OL"===e.nodeName,anchor:""===e.id?void 0:e.id};if(t.ordered){const n=e.getAttribute("type");n&&(t.type=n),null!==e.getAttribute("reversed")&&(t.reversed=!0);const o=parseInt(e.getAttribute("start"),10);isNaN(o)||1===o&&!t.reversed||(t.start=o)}return Object(xe.createBlock)("core/list",{...Object(xe.getBlockAttributes)("core/list",e.outerHTML),...t})}},...["*","-"].map(e=>({type:"prefix",prefix:e,transform:e=>Object(xe.createBlock)("core/list",{values:`<li>${e}</li>`})})),...["1.","1)"].map(e=>({type:"prefix",prefix:e,transform:e=>Object(xe.createBlock)("core/list",{ordered:!0,values:`<li>${e}</li>`})}))],to:[{type:"block",blocks:["core/paragraph"],transform:({values:e})=>Object(Pn.split)(Object(Pn.create)({html:e,multilineTag:"li",multilineWrapperTags:["ul","ol"]}),Pn.__UNSTABLE_LINE_SEPARATOR).map(e=>Object(xe.createBlock)("core/paragraph",{content:Object(Pn.toHTMLString)({value:e})}))},{type:"block",blocks:["core/heading"],transform:({values:e})=>Object(Pn.split)(Object(Pn.create)({html:e,multilineTag:"li",multilineWrapperTags:["ul","ol"]}),Pn.__UNSTABLE_LINE_SEPARATOR).map(e=>Object(xe.createBlock)("core/heading",{content:Object(Pn.toHTMLString)({value:e})}))},{type:"block",blocks:["core/quote"],transform:({values:e,anchor:t})=>Object(xe.createBlock)("core/quote",{value:Object(Pn.toHTMLString)({value:Object(Pn.create)({html:e,multilineTag:"li",multilineWrapperTags:["ul","ol"]}),multilineTag:"p"}),anchor:t})},{type:"block",blocks:["core/pullquote"],transform:({values:e,anchor:t})=>Object(xe.createBlock)("core/pullquote",{value:Object(Pn.toHTMLString)({value:Object(Pn.create)({html:e,multilineTag:"li",multilineWrapperTags:["ul","ol"]}),multilineTag:"p"}),anchor:t})}]};const ai={apiVersion:2,name:"core/list",title:"List",category:"text",description:"Create a bulleted or numbered list.",keywords:["bullet list","ordered list","numbered list"],textdomain:"default",attributes:{ordered:{type:"boolean",default:!1,__experimentalRole:"content"},values:{type:"string",source:"html",selector:"ol,ul",multiline:"li",__unstableMultilineWrapperTags:["ol","ul"],default:"",__experimentalRole:"content"},type:{type:"string"},start:{type:"number"},reversed:{type:"boolean"},placeholder:{type:"string"}},supports:{anchor:!0,className:!1,fontSize:!0,color:{gradients:!0},__unstablePasteTextInline:!0},editorStyle:"wp-block-list-editor",style:"wp-block-list"},{name:ci}=ai,li={icon:gl,example:{attributes:{values:"<li>Alice.</li><li>The White Rabbit.</li><li>The Cheshire Cat.</li><li>The Mad Hatter.</li><li>The Queen of Hearts.</li>"}},transforms:ri,merge(e,t){const{values:n}=t;return n&&"<li></li>"!==n?{...e,values:e.values+n}:e},edit:function({attributes:e,setAttributes:t,mergeBlocks:n,onReplace:o}){const{ordered:r,values:a,type:c,reversed:l,start:i,placeholder:s}=e,u=r?"ol":"ul",m=Object(Ce.useBlockProps)();return Object(Te.createElement)(Te.Fragment,null,Object(Te.createElement)(Ce.RichText,Object(Ae.a)({identifier:"values",multiline:"li",tagName:u,onChange:e=>t({values:e}),value:a,"aria-label":Object(Be.__)("List text"),placeholder:s||Object(Be.__)("List"),onMerge:n,onSplit:t=>Object(xe.createBlock)(ci,{...e,values:t}),__unstableOnSplitMiddle:()=>Object(xe.createBlock)("core/paragraph"),onReplace:o,onRemove:()=>o([]),start:i,reversed:l,type:c},m),({value:e,onChange:n,onFocus:o})=>Object(Te.createElement)(Te.Fragment,null,Object(Te.createElement)(Ce.RichTextShortcut,{type:"primary",character:"[",onUse:()=>{n(Object(Pn.__unstableOutdentListItems)(e))}}),Object(Te.createElement)(Ce.RichTextShortcut,{type:"primary",character:"]",onUse:()=>{n(Object(Pn.__unstableIndentListItems)(e,{type:u}))}}),Object(Te.createElement)(Ce.RichTextShortcut,{type:"primary",character:"m",onUse:()=>{n(Object(Pn.__unstableIndentListItems)(e,{type:u}))}}),Object(Te.createElement)(Ce.RichTextShortcut,{type:"primaryShift",character:"m",onUse:()=>{n(Object(Pn.__unstableOutdentListItems)(e))}}),Object(Te.createElement)(Ce.BlockControls,{group:"block"},Object(Te.createElement)(Le.ToolbarButton,{icon:Object(Be.isRTL)()?Zl:Ql,title:Object(Be.__)("Unordered"),describedBy:Object(Be.__)("Convert to unordered list"),isActive:Object(Pn.__unstableIsActiveListType)(e,"ul",u),onClick:()=>{n(Object(Pn.__unstableChangeListType)(e,{type:"ul"})),o(),Object(Pn.__unstableIsListRootSelected)(e)&&t({ordered:!1})}}),Object(Te.createElement)(Le.ToolbarButton,{icon:Object(Be.isRTL)()?Jl:Kl,title:Object(Be.__)("Ordered"),describedBy:Object(Be.__)("Convert to ordered list"),isActive:Object(Pn.__unstableIsActiveListType)(e,"ol",u),onClick:()=>{n(Object(Pn.__unstableChangeListType)(e,{type:"ol"})),o(),Object(Pn.__unstableIsListRootSelected)(e)&&t({ordered:!0})}}),Object(Te.createElement)(Le.ToolbarButton,{icon:Object(Be.isRTL)()?Yl:Xl,title:Object(Be.__)("Outdent"),describedBy:Object(Be.__)("Outdent list item"),shortcut:Object(Be._x)("Backspace","keyboard key"),isDisabled:!Object(Pn.__unstableCanOutdentListItems)(e),onClick:()=>{n(Object(Pn.__unstableOutdentListItems)(e)),o()}}),Object(Te.createElement)(Le.ToolbarButton,{icon:Object(Be.isRTL)()?ei:ti,title:Object(Be.__)("Indent"),describedBy:Object(Be.__)("Indent list item"),shortcut:Object(Be._x)("Space","keyboard key"),isDisabled:!Object(Pn.__unstableCanIndentListItems)(e),onClick:()=>{n(Object(Pn.__unstableIndentListItems)(e,{type:u})),o()}})))),r&&Object(Te.createElement)(ni,{setAttributes:t,ordered:r,reversed:l,start:i,placeholder:s}))},save:function({attributes:e}){const{ordered:t,values:n,type:o,reversed:r,start:a}=e,c=t?"ol":"ul";return Object(Te.createElement)(c,Ce.useBlockProps.save({type:o,reversed:r,start:a}),Object(Te.createElement)(Ce.RichText.Content,{value:n,multiline:"li"}))}};var ii=Object(Ye.withDispatch)((e,{clientId:t,attributes:n})=>{const{replaceBlock:o}=e(Ce.store);return{convertToHTML(){o(t,Object(xe.createBlock)("core/html",{content:n.originalUndelimitedContent}))}}})((function({attributes:e,convertToHTML:t}){const{originalName:n,originalUndelimitedContent:o}=e,r=!!o,a=Object(xe.getBlockType)("core/html"),c=[];let l;return r&&a?(l=Object(Be.sprintf)(
|
56 |
/* translators: %s: block name */
|
changelog.txt
CHANGED
@@ -1,316 +1,333 @@
|
|
1 |
== Changelog ==
|
2 |
|
3 |
-
= 10.7.
|
4 |
|
5 |
-
### Enhancements
|
6 |
-
|
7 |
-
- Block Editor:
|
8 |
-
- Standardize block styles cursor on hover. ([31188](https://github.com/WordPress/gutenberg/pull/31188))
|
9 |
-
- Support scripts in iframed editors. ([31873](https://github.com/WordPress/gutenberg/pull/31873))
|
10 |
-
- Block Library:
|
11 |
-
- Normalize theme block toolbars. ([31952](https://github.com/WordPress/gutenberg/pull/31952))
|
12 |
-
- Buttons: Use `column-gap` for styling. ([31386](https://github.com/WordPress/gutenberg/pull/31386))
|
13 |
-
- Column: Add color and padding support to individual column block. ([31778](https://github.com/WordPress/gutenberg/pull/31778))
|
14 |
-
- Cover: Allow transforming from group block. ([30890](https://github.com/WordPress/gutenberg/pull/30890))
|
15 |
-
- Media & Text: Add media width control. ([31002](https://github.com/WordPress/gutenberg/pull/31002))
|
16 |
-
- Post Comments: Add basic CSS to the block. ([30382](https://github.com/WordPress/gutenberg/pull/30382))
|
17 |
-
- Post Excerpt: Update `read more` placeholder text. ([30959](https://github.com/WordPress/gutenberg/pull/30959))
|
18 |
-
- Post Featured Image: Change wrapper element to `figure`. ([31595](https://github.com/WordPress/gutenberg/pull/31595))
|
19 |
-
- Query:
|
20 |
-
- Add `layout` and `color` support. ([31833](https://github.com/WordPress/gutenberg/pull/31833))
|
21 |
-
- Update bundled patterns to have `inherit:False`. ([31856](https://github.com/WordPress/gutenberg/pull/31856))
|
22 |
-
- Allow term addition from user case-insensitive input. ([31301](https://github.com/WordPress/gutenberg/pull/31301))
|
23 |
-
- Site Logo:
|
24 |
-
- Add link toggle option. ([31162](https://github.com/WordPress/gutenberg/pull/31162))
|
25 |
-
- Use `custom_logo` theme-mod instead of `site_logo` setting for the site-logo block. ([31994](https://github.com/WordPress/gutenberg/pull/31994))
|
26 |
-
- Site Tagline:
|
27 |
-
- Add margin block support. ([31809](https://github.com/WordPress/gutenberg/pull/31809))
|
28 |
-
- Expand the site tagline block description. ([31426](https://github.com/WordPress/gutenberg/pull/31426))
|
29 |
-
- Site Title:
|
30 |
-
- Add additional text formatting options. ([31734](https://github.com/WordPress/gutenberg/pull/31734))
|
31 |
-
- Add margin block support. ([31728](https://github.com/WordPress/gutenberg/pull/31728))
|
32 |
-
- Social Links: Add some padding to the "click plus to add". ([31927](https://github.com/WordPress/gutenberg/pull/31927))
|
33 |
-
- Components
|
34 |
-
- Add Spacer. ([31509](https://github.com/WordPress/gutenberg/pull/31509))
|
35 |
-
- Improve display for multiple action buttons in notices. ([31799](https://github.com/WordPress/gutenberg/pull/31799))
|
36 |
-
- Polish the switcher for horizontal blocks. ([31645](https://github.com/WordPress/gutenberg/pull/31645))
|
37 |
-
- Promote Divider and use readable prop names. ([31556](https://github.com/WordPress/gutenberg/pull/31556))
|
38 |
-
- Promote Grid. ([31559](https://github.com/WordPress/gutenberg/pull/31559))
|
39 |
-
- Promote View. ([31542](https://github.com/WordPress/gutenberg/pull/31542))
|
40 |
-
- Promote VStack and HStack. ([31300](https://github.com/WordPress/gutenberg/pull/31300))
|
41 |
-
- UnitControl: Add support for unit step per unit type. ([30376](https://github.com/WordPress/gutenberg/pull/30376))
|
42 |
-
- Design tools:
|
43 |
-
- Add margin block support with configurable sides. ([30608](https://github.com/WordPress/gutenberg/pull/30608))
|
44 |
-
- Add option to disable duotone. ([32002](https://github.com/WordPress/gutenberg/pull/32002))
|
45 |
-
- Add reset button to Layout controls. ([30828](https://github.com/WordPress/gutenberg/pull/30828))
|
46 |
-
- Add server-side support for margins. ([31808](https://github.com/WordPress/gutenberg/pull/31808))
|
47 |
-
- Icons: Update icons. ([31533](https://github.com/WordPress/gutenberg/pull/31533))
|
48 |
-
- List View:
|
49 |
-
- Display block anchor in List View when set. ([31992](https://github.com/WordPress/gutenberg/pull/31992))
|
50 |
-
- Enable persistent List View in the post editor. ([31047](https://github.com/WordPress/gutenberg/pull/31047))
|
51 |
-
- Patterns: Load patterns from wordpress.org API. ([28800](https://github.com/WordPress/gutenberg/pull/28800))
|
52 |
-
- Template Editing Mode:
|
53 |
-
- Add a welcome guide to the template editor. ([31330](https://github.com/WordPress/gutenberg/pull/31330)) ([32055](https://github.com/WordPress/gutenberg/pull/32055))
|
54 |
-
- Add a `Delete template` action. ([31678](https://github.com/WordPress/gutenberg/pull/31678))
|
55 |
-
- Word count: Adjust to count numbers as words. ([27288](https://github.com/WordPress/gutenberg/pull/27288))
|
56 |
|
57 |
-
### New APIs
|
58 |
-
|
59 |
-
- Babel Preset Default: Configure @babel/preset-env preset to respect a local Browserslist configuration. ([31898](https://github.com/WordPress/gutenberg/pull/31898))
|
60 |
-
- Blocks: Deprecate `registerBlockTypeFromMetadata` in favor of `registerBlockType`. ([32030](https://github.com/WordPress/gutenberg/pull/32030))
|
61 |
-
- Global Styles: Rename and stabilize `useEditorFeature` as `useSetting`. ([31587](https://github.com/WordPress/gutenberg/pull/31587))
|
62 |
-
- Stacked/unified block toolbar. ([31134](https://github.com/WordPress/gutenberg/pull/31134))
|
63 |
-
- Babel Preset Default: Add polyfill for WordPress built from core-js. ([31279](https://github.com/WordPress/gutenberg/pull/31279))
|
64 |
|
65 |
### Bug Fixes
|
66 |
|
67 |
-
-
|
68 |
-
|
69 |
-
- Remove fixed background when previewed in patterns list. ([31640](https://github.com/WordPress/gutenberg/pull/31640))
|
70 |
-
- Show placeholder only if it has no inner blocks. ([31402](https://github.com/WordPress/gutenberg/pull/31402))
|
71 |
-
- Gallery:
|
72 |
-
- Fix focus caption prop for native. ([32029](https://github.com/WordPress/gutenberg/pull/32029))
|
73 |
-
- Fix identical images getting duplicated when moving. ([30555](https://github.com/WordPress/gutenberg/pull/30555))
|
74 |
-
- Image:
|
75 |
-
- Remove figure margins consistently in image blocks. ([31650](https://github.com/WordPress/gutenberg/pull/31650))
|
76 |
-
- Fix cover transform and excessive re-rendering. ([32102](https://github.com/WordPress/gutenberg/pull/32102))
|
77 |
-
- Post Content: Apply the_content filter even if content is empty. ([31997](https://github.com/WordPress/gutenberg/pull/31997))
|
78 |
-
- Post Comments Count: Fix attributes declaration. ([31976](https://github.com/WordPress/gutenberg/pull/31976))
|
79 |
-
- Post Comment Form:
|
80 |
-
- Fix stylesheet dependency. ([31528](https://github.com/WordPress/gutenberg/pull/31528))
|
81 |
-
- Fix to allow post comment button to inherit button & global styles automatically. ([31338](https://github.com/WordPress/gutenberg/pull/31338))
|
82 |
-
- Post Featured Image:
|
83 |
-
- Fix non-interactive placeholder when outside of a post context. ([31663](https://github.com/WordPress/gutenberg/pull/31663))
|
84 |
-
- Fix placeholder regression. ([31709](https://github.com/WordPress/gutenberg/pull/31709))
|
85 |
-
- Fix selection scroll into view. ([31835](https://github.com/WordPress/gutenberg/pull/31835))
|
86 |
-
- Fix image width for wide aligned Post featured image. ([32070](https://github.com/WordPress/gutenberg/pull/32070))
|
87 |
-
- Site Logo:
|
88 |
-
- Fix duplicate `supports` declaration. ([31544](https://github.com/WordPress/gutenberg/pull/31544))
|
89 |
-
- Return nothing if logo is not set. ([31513](https://github.com/WordPress/gutenberg/pull/31513))
|
90 |
-
- Only request media entity when a site logo has been chosen. ([31673](https://github.com/WordPress/gutenberg/pull/31673))
|
91 |
-
- Template Part:
|
92 |
-
- Don't show the currently used template part as an option in the 'replace' flow. ([31720](https://github.com/WordPress/gutenberg/pull/31720))
|
93 |
-
- Fix template part selection searches to use title/area instead of slug/theme. ([31520](https://github.com/WordPress/gutenberg/pull/31520))
|
94 |
-
- Use label and icon per variation when displaying placeholders. ([31721](https://github.com/WordPress/gutenberg/pull/31721))
|
95 |
-
- Block Editor:
|
96 |
-
- Clear selection on iframe html element click, fix bottom click redirect. ([31385](https://github.com/WordPress/gutenberg/pull/31385))
|
97 |
-
- Fix block ref when multiple useBlockProps hooks are called. ([31906](https://github.com/WordPress/gutenberg/pull/31906))
|
98 |
-
- Fix moving animation for nested blocks. ([31945](https://github.com/WordPress/gutenberg/pull/31945))
|
99 |
-
- Fix selecting aligned blocks. ([31904](https://github.com/WordPress/gutenberg/pull/31904))
|
100 |
-
- Fix scrolling to the inserted block issue in the iFramed block editor. ([31448](https://github.com/WordPress/gutenberg/pull/31448))
|
101 |
-
- Prevent rendering self also when the wrapper block matches the inserted block. ([31592](https://github.com/WordPress/gutenberg/pull/31592))
|
102 |
-
- Toolbar:
|
103 |
-
- Fix showing toolbar when caret enters formatting (and extract as implementation detail for the block editor). ([31664](https://github.com/WordPress/gutenberg/pull/31664))
|
104 |
-
- Fix toolbar in device preview. ([31600](https://github.com/WordPress/gutenberg/pull/31600))
|
105 |
-
- Design tools:
|
106 |
-
- BoxControl:
|
107 |
-
- Filter out unit only values when checking values defined. ([31779](https://github.com/WordPress/gutenberg/pull/31779))
|
108 |
-
- Fix tooltip display for unlinked box control inputs. ([31741](https://github.com/WordPress/gutenberg/pull/31741))
|
109 |
-
- Color picker:
|
110 |
-
- Fixes color picker segmented control rendering and scrolling issues. ([30994](https://github.com/WordPress/gutenberg/pull/30994))
|
111 |
-
- Fix text. ([30039](https://github.com/WordPress/gutenberg/pull/30039))
|
112 |
-
- Duotone:
|
113 |
-
- Fix duotone transform not transferring settings between blocks. ([31801](https://github.com/WordPress/gutenberg/pull/31801))
|
114 |
-
- Fix duotone padding crash. ([31780](https://github.com/WordPress/gutenberg/pull/31780))
|
115 |
-
- Font-family: Fix typo in font-family supports for dynamic blocks. ([31974](https://github.com/WordPress/gutenberg/pull/31974))
|
116 |
-
- Spacing Support:
|
117 |
-
- Properly hide UI for disabled properties. ([31726](https://github.com/WordPress/gutenberg/pull/31726))
|
118 |
-
- Fix custom units for margin. ([31776](https://github.com/WordPress/gutenberg/pull/31776))
|
119 |
-
- Inserter: Hide patterns tab if no patterns are available. ([31687](https://github.com/WordPress/gutenberg/pull/31687))
|
120 |
-
- Patterns:
|
121 |
-
- Check for allowed blocks recursively in patterns. ([30366](https://github.com/WordPress/gutenberg/pull/30366))
|
122 |
-
- Fix unregister_block_pattern notices. ([32025](https://github.com/WordPress/gutenberg/pull/32025))
|
123 |
-
- Post Editor: Fix template name displaying incorrectly. ([32035](https://github.com/WordPress/gutenberg/pull/32035))
|
124 |
-
- Server Side Rendering: Re-enable passing post_id query arg (#31786). ([31787](https://github.com/WordPress/gutenberg/pull/31787))
|
125 |
-
- Template Editing Mode: Fix wrapper block name for template mode. ([31985](https://github.com/WordPress/gutenberg/pull/31985))
|
126 |
-
- Writing flow, multi-selection:
|
127 |
-
- Fix caret placing when the target is out of view. ([31506](https://github.com/WordPress/gutenberg/pull/31506))
|
128 |
-
- Gradually 'select all' layers of nested blocks. ([31859](https://github.com/WordPress/gutenberg/pull/31859))
|
129 |
-
- Fix errors caused by commits to WordPress core. ([32176](https://github.com/WordPress/gutenberg/pull/32176)) ([32183](https://github.com/WordPress/gutenberg/pull/32183)) ([32059](https://github.com/WordPress/gutenberg/pull/32059))
|
130 |
-
- Components: Fix the list of package dependencies. ([32167](https://github.com/WordPress/gutenberg/pull/32167))
|
131 |
-
- Fix issue with customizer title overlapping block toolbar. ([32140](https://github.com/WordPress/gutenberg/pull/32140))
|
132 |
-
- Correctly read rawRequest for frontend ESM. ([31917](https://github.com/WordPress/gutenberg/pull/31917))
|
133 |
-
- Fix generation of presets classes per block. ([32190](https://github.com/WordPress/gutenberg/pull/32190))
|
134 |
-
- Widget Screen:
|
135 |
-
- Fix unsaved changes notification. ([31757](https://github.com/WordPress/gutenberg/pull/31757))
|
136 |
-
- Fix call to undefined __experimentalRegisterExperimentalCoreBlocks. ([32138](https://github.com/WordPress/gutenberg/pull/32138))
|
137 |
-
|
138 |
-
### Performance
|
139 |
-
|
140 |
-
- Block editor styles: Memoize transform. ([31553](https://github.com/WordPress/gutenberg/pull/31553))
|
141 |
-
- Block editor async mode: Enable only for blocks out of view. ([30995](https://github.com/WordPress/gutenberg/pull/30995))
|
142 |
-
- Improve performance of term search. ([31703](https://github.com/WordPress/gutenberg/pull/31703))
|
143 |
-
- Blocks package: Memoize getBlockVariations selector. ([32120](https://github.com/WordPress/gutenberg/pull/32120))
|
144 |
-
|
145 |
-
### Experiments
|
146 |
-
|
147 |
-
- Block Library: Hide the PostAuthor block behind the Gutenberg experimental flag. ([31983](https://github.com/WordPress/gutenberg/pull/31983))
|
148 |
-
- Block-based Widgets:
|
149 |
-
- API:
|
150 |
-
- Improve `get_merged_data` API so it requires less knowledge from the consumer. ([31552](https://github.com/WordPress/gutenberg/pull/31552))
|
151 |
-
- Customizer:
|
152 |
-
- Add 'more' menu. ([31970](https://github.com/WordPress/gutenberg/pull/31970))
|
153 |
-
- Add undo redo to Widgets Customizer. ([31653](https://github.com/WordPress/gutenberg/pull/31653))
|
154 |
-
- Add Welcome messaging. ([31968](https://github.com/WordPress/gutenberg/pull/31968))
|
155 |
-
- Clear selected block when focusing on element outside the editor. ([31530](https://github.com/WordPress/gutenberg/pull/31530))
|
156 |
-
- Fix removing legacy widget not working in customizer. ([31535](https://github.com/WordPress/gutenberg/pull/31535))
|
157 |
-
- Implement mobile responsive block toolbar. ([31589](https://github.com/WordPress/gutenberg/pull/31589))
|
158 |
-
- Remove Widgets Customizer experimental flag. ([31876](https://github.com/WordPress/gutenberg/pull/31876))
|
159 |
-
- Widgets Editor:
|
160 |
-
- Add default notices support. ([31578](https://github.com/WordPress/gutenberg/pull/31578))
|
161 |
-
- Add more menu. ([31926](https://github.com/WordPress/gutenberg/pull/31926))
|
162 |
-
- Add Welcome Guide. ([31925](https://github.com/WordPress/gutenberg/pull/31925))
|
163 |
-
- Remove widget screen empty link in admin. ([31408](https://github.com/WordPress/gutenberg/pull/31408))
|
164 |
-
- Update toolbar and notice positioning. ([31582](https://github.com/WordPress/gutenberg/pull/31582))
|
165 |
-
- Navigation Editor and Block:
|
166 |
-
- Add home link block. ([30926](https://github.com/WordPress/gutenberg/pull/30926))
|
167 |
-
- API:
|
168 |
-
- Add locations to the menu response. ([31656](https://github.com/WordPress/gutenberg/pull/31656))
|
169 |
-
- Change default to 100 menu items returned. ([21243](https://github.com/WordPress/gutenberg/pull/21243))
|
170 |
-
- Allow space between on page list. ([29771](https://github.com/WordPress/gutenberg/pull/29771))
|
171 |
-
- Bring implementations of convert nav menu items to blocks back into sync. ([31602](https://github.com/WordPress/gutenberg/pull/31602))
|
172 |
-
- Editor:
|
173 |
-
- "Add new pages" use menu entity. ([31643](https://github.com/WordPress/gutenberg/pull/31643))
|
174 |
-
- Add padding for navigation screen. ([31583](https://github.com/WordPress/gutenberg/pull/31583))
|
175 |
-
- Clear 'stub' navigation post edits on save. ([31735](https://github.com/WordPress/gutenberg/pull/31735))
|
176 |
-
- Fix menu location assignment. ([31594](https://github.com/WordPress/gutenberg/pull/31594))
|
177 |
-
- Fix editor margin. ([31493](https://github.com/WordPress/gutenberg/pull/31493))
|
178 |
-
- On mobile viewports, reveal the block inspector when clicking the menu name button. ([31220](https://github.com/WordPress/gutenberg/pull/31220))
|
179 |
-
- Update sidebar. ([31821](https://github.com/WordPress/gutenberg/pull/31821))
|
180 |
-
- Warn the user about unsaved changes. ([31197](https://github.com/WordPress/gutenberg/pull/31197))
|
181 |
-
- Enable justification for burger menu. ([31877](https://github.com/WordPress/gutenberg/pull/31877))
|
182 |
-
- Extract Navigation Block data fetching and management to hook(s). ([31825](https://github.com/WordPress/gutenberg/pull/31825))
|
183 |
-
- Fix nav block hover z index. ([31929](https://github.com/WordPress/gutenberg/pull/31929))
|
184 |
-
- Fix nav placeholder colors and height. ([31875](https://github.com/WordPress/gutenberg/pull/31875))
|
185 |
-
- Improve the navigation block setup state / placeholder. ([31371](https://github.com/WordPress/gutenberg/pull/31371))
|
186 |
-
- Introduce `useMenuEntityProp` hook. ([31132](https://github.com/WordPress/gutenberg/pull/31132))
|
187 |
-
- Normalize converting nav menu items to blocks between Editor and Block. ([31606](https://github.com/WordPress/gutenberg/pull/31606))
|
188 |
-
- Responsive Navigation. ([30047](https://github.com/WordPress/gutenberg/pull/30047))
|
189 |
-
- Submenus shouldn't take space unless they're actually open. ([31881](https://github.com/WordPress/gutenberg/pull/31881))
|
190 |
-
- Global Styles
|
191 |
-
- Block Supports: Allow skipping serialization of typography attributes. ([30880](https://github.com/WordPress/gutenberg/pull/30880))
|
192 |
-
- Fix condition for global styles on mobile. ([31844](https://github.com/WordPress/gutenberg/pull/31844))
|
193 |
-
- Fix global styles settings retrieval for REST. ([31534](https://github.com/WordPress/gutenberg/pull/31534))
|
194 |
-
- Make core color classes and custom properties always available. ([31669](https://github.com/WordPress/gutenberg/pull/31669))
|
195 |
-
- Remove color.link from valid styles and alphabetize the rest. ([31516](https://github.com/WordPress/gutenberg/pull/31516))
|
196 |
-
- Return consolidated global styles in REST Request. ([31762](https://github.com/WordPress/gutenberg/pull/31762))
|
197 |
-
- Use elements mechanism for link color instead of a CSS variable. ([31524](https://github.com/WordPress/gutenberg/pull/31524))
|
198 |
-
- Use mobile context in settings request & global styles. ([31819](https://github.com/WordPress/gutenberg/pull/31819))
|
199 |
-
- Use wp_theme taxonomy for wp_global_styles cpt. ([31436](https://github.com/WordPress/gutenberg/pull/31436))
|
200 |
-
- Theme.json:
|
201 |
-
- Make the `theme.json` examples copy-pasteable. ([32040](https://github.com/WordPress/gutenberg/pull/32040))
|
202 |
-
- Replace hardcoded `CSS_UNITS` and inherit units from `theme.json`. ([31822](https://github.com/WordPress/gutenberg/pull/31822))
|
203 |
-
- Full Site Editing:
|
204 |
-
- Template Loader: Make templates arg required. ([31671](https://github.com/WordPress/gutenberg/pull/31671))
|
205 |
-
- Simplify template loader logic. ([31604](https://github.com/WordPress/gutenberg/pull/31604))
|
206 |
|
207 |
-
###
|
208 |
|
209 |
-
-
|
210 |
-
|
211 |
-
- Add info on how to connect to the WP ENV MySQL database. ([31975](https://github.com/WordPress/gutenberg/pull/31975))
|
212 |
-
- Capitalize GitHub properly in contributors README. ([31549](https://github.com/WordPress/gutenberg/pull/31549))
|
213 |
-
- Clarify 'Applying styles from a stylesheet' how-to guide. ([31824](https://github.com/WordPress/gutenberg/pull/31824))
|
214 |
-
- First pass at the documentation for the Widgets Block Editor. ([31577](https://github.com/WordPress/gutenberg/pull/31577))
|
215 |
-
- Fix link to ESNext in callout. ([31512](https://github.com/WordPress/gutenberg/pull/31512))
|
216 |
-
- Update Glossary with more FSE terminology. ([31525](https://github.com/WordPress/gutenberg/pull/31525))
|
217 |
-
- Packages:
|
218 |
-
- Add required “directory” prop to package.json template in packages documentation. ([31570](https://github.com/WordPress/gutenberg/pull/31570))
|
219 |
-
- Fix typo: "packages" -> "package". ([32036](https://github.com/WordPress/gutenberg/pull/32036))
|
220 |
-
- Improve packages documentation - document root package json and public API knowledge. ([31598](https://github.com/WordPress/gutenberg/pull/31598))
|
221 |
-
- Remove duplicate 1.52.0 changelog entry. ([31659](https://github.com/WordPress/gutenberg/pull/31659))
|
222 |
-
- Scripts: Fix the CHANGELOG for `@wordpress/scripts` package. ([31532](https://github.com/WordPress/gutenberg/pull/31532))
|
223 |
-
- Typo in edit-navigation layout translators note. ([31541](https://github.com/WordPress/gutenberg/pull/31541))
|
224 |
-
|
225 |
-
### Code Quality
|
226 |
-
|
227 |
-
- Block editor:
|
228 |
-
- Block popover: Move scroll handling to block tools. ([31611](https://github.com/WordPress/gutenberg/pull/31611))
|
229 |
-
- Log an error if styles are loaded through the compatibility layer. ([31870](https://github.com/WordPress/gutenberg/pull/31870))
|
230 |
-
- Block Library:
|
231 |
-
- Post Comments: Make CSS less specific. ([31711](https://github.com/WordPress/gutenberg/pull/31711))
|
232 |
-
- Image/Gallery: Remove use of unstableOnFocus. ([31796](https://github.com/WordPress/gutenberg/pull/31796))
|
233 |
-
- Linting:
|
234 |
-
- Fix PHP lint issues. ([32039](https://github.com/WordPress/gutenberg/pull/32039))
|
235 |
-
- Fix PHPCS warning for alignment. ([31931](https://github.com/WordPress/gutenberg/pull/31931))
|
236 |
-
- Fix lint issues. ([31790](https://github.com/WordPress/gutenberg/pull/31790))
|
237 |
-
- Ignore data-no-store-string-literals rule for native files. ([31936](https://github.com/WordPress/gutenberg/pull/31936))
|
238 |
-
- Components:
|
239 |
-
- Add ToolbarDropdownMenu to render dropdown menus properly inside toolbars. ([31460](https://github.com/WordPress/gutenberg/pull/31460))
|
240 |
-
- Don't pass down index through context. ([31852](https://github.com/WordPress/gutenberg/pull/31852))
|
241 |
-
- Remove `color()` utility function, use values directly. ([31661](https://github.com/WordPress/gutenberg/pull/31661))
|
242 |
-
- Remove `config()` utility function, use values directly. ([31646](https://github.com/WordPress/gutenberg/pull/31646))
|
243 |
-
- Compose:
|
244 |
-
- Add types to withInstanceId and corresponding hook. ([31341](https://github.com/WordPress/gutenberg/pull/31341))
|
245 |
-
- Add types useConstrainedTabbing. ([31548](https://github.com/WordPress/gutenberg/pull/31548))
|
246 |
-
- Add types useAsyncList. ([31523](https://github.com/WordPress/gutenberg/pull/31523))
|
247 |
-
- Docgen:
|
248 |
-
- Replace assertions for `getIntermediateRepresentation` unit tests with snapshots. ([31547](https://github.com/WordPress/gutenberg/pull/31547))
|
249 |
-
- Split `getIntermediateRepresentation` unit tests in smaller tests. ([31468](https://github.com/WordPress/gutenberg/pull/31468))
|
250 |
-
- Inserter: Mark the inserter slot as unstable. ([31417](https://github.com/WordPress/gutenberg/pull/31417))
|
251 |
-
- Multi-select:
|
252 |
-
- Use ref callback for focus out, merge native selection hooks. ([31618](https://github.com/WordPress/gutenberg/pull/31618))
|
253 |
-
- Use writing flow container for focus. ([31572](https://github.com/WordPress/gutenberg/pull/31572))
|
254 |
-
- Rich text:
|
255 |
-
- Build in isSelected check for children. ([31802](https://github.com/WordPress/gutenberg/pull/31802))
|
256 |
-
- Consolidate applying from props. ([31635](https://github.com/WordPress/gutenberg/pull/31635))
|
257 |
-
- Each hook should create its own ref. ([31477](https://github.com/WordPress/gutenberg/pull/31477))
|
258 |
-
- Extract implementation-specific undo handling of automatic changes. ([31676](https://github.com/WordPress/gutenberg/pull/31676))
|
259 |
-
- Extract internal delete handling. ([31637](https://github.com/WordPress/gutenberg/pull/31637))
|
260 |
-
- Extract persistent change marking. ([31760](https://github.com/WordPress/gutenberg/pull/31760))
|
261 |
-
- Extract splitValue to separate file. ([31803](https://github.com/WordPress/gutenberg/pull/31803))
|
262 |
-
- Extract input and selection. ([31631](https://github.com/WordPress/gutenberg/pull/31631))
|
263 |
-
- Extract indent list item on space. ([31628](https://github.com/WordPress/gutenberg/pull/31628))
|
264 |
-
- Extract select object. ([31627](https://github.com/WordPress/gutenberg/pull/31627))
|
265 |
-
- Extract paste handler. ([31619](https://github.com/WordPress/gutenberg/pull/31619))
|
266 |
-
- Fix props on DOM element warnings. ([31883](https://github.com/WordPress/gutenberg/pull/31883))
|
267 |
-
- Move autocomplete key handler to ref callback. ([31770](https://github.com/WordPress/gutenberg/pull/31770))
|
268 |
-
- Move implementation specific attributes. ([31674](https://github.com/WordPress/gutenberg/pull/31674))
|
269 |
-
- Move implementation specific delete and enter handling. ([31644](https://github.com/WordPress/gutenberg/pull/31644))
|
270 |
-
- Remove avoiding setting selection on mount. ([31788](https://github.com/WordPress/gutenberg/pull/31788))
|
271 |
-
- Remove dependency on block client ID. ([31752](https://github.com/WordPress/gutenberg/pull/31752))
|
272 |
-
- Remove duplicate active formats state. ([31771](https://github.com/WordPress/gutenberg/pull/31771))
|
273 |
-
- Remove old broken format prop. ([31767](https://github.com/WordPress/gutenberg/pull/31767))
|
274 |
-
- Remove tag name dependency. ([31679](https://github.com/WordPress/gutenberg/pull/31679))
|
275 |
-
- Simplify with hooks. ([31718](https://github.com/WordPress/gutenberg/pull/31718))
|
276 |
-
- Rename `construct_wp_query_args` to `build_query_vars_from_query_block`. ([32041](https://github.com/WordPress/gutenberg/pull/32041))
|
277 |
-
- Theme.json:
|
278 |
-
- Remove unused code. ([31666](https://github.com/WordPress/gutenberg/pull/31666))
|
279 |
-
- Remove declarations so API has coherence. ([31596](https://github.com/WordPress/gutenberg/pull/31596))
|
280 |
-
- Remove: Declarations parameter from compute_style_properties. ([31573](https://github.com/WordPress/gutenberg/pull/31573))
|
281 |
-
- Writing flow:
|
282 |
-
- Extract and simplify "select all". ([31855](https://github.com/WordPress/gutenberg/pull/31855))
|
283 |
-
- Extract arrow nav. ([31851](https://github.com/WordPress/gutenberg/pull/31851))
|
284 |
-
- Extract tab behavior to hook. ([31834](https://github.com/WordPress/gutenberg/pull/31834))
|
285 |
-
- REST API: Use batch endpoint included in Core. ([32174](https://github.com/WordPress/gutenberg/pull/32174))
|
286 |
-
- Prepare for adding the Widgets block editor to Core. ([32136](https://github.com/WordPress/gutenberg/pull/32136))
|
287 |
-
- Remove `gutenberg` domain from core blocks. ([32152](https://github.com/WordPress/gutenberg/pull/32152))
|
288 |
-
- Remove filter_var from blocks. ([32046](https://github.com/WordPress/gutenberg/pull/32046))
|
289 |
-
- Plugin: Update block editor settings to work with context. ([32159](https://github.com/WordPress/gutenberg/pull/32159))
|
290 |
-
|
291 |
-
### Tools
|
292 |
-
|
293 |
-
- End-to-end tests:
|
294 |
-
- Add template loader unit tests. ([31498](https://github.com/WordPress/gutenberg/pull/31498))
|
295 |
-
- Fix end-to-end test inserting cover block. ([31866](https://github.com/WordPress/gutenberg/pull/31866))
|
296 |
-
- Fix flaky change detection tests causing intermittent failures. ([31861](https://github.com/WordPress/gutenberg/pull/31861))
|
297 |
-
- Fix intermittent embeds failure. ([31860](https://github.com/WordPress/gutenberg/pull/31860))
|
298 |
-
- Fix intermittent failure of rich text end-to-end test. ([31864](https://github.com/WordPress/gutenberg/pull/31864))
|
299 |
-
- Increase test coverage for pattern transforms. ([31689](https://github.com/WordPress/gutenberg/pull/31689))
|
300 |
-
- Navigation: Add unit tests for onChange handler and fix cases around custom links tags and post-format. ([31259](https://github.com/WordPress/gutenberg/pull/31259))
|
301 |
-
- Remove i18n filters performance test. ([32028](https://github.com/WordPress/gutenberg/pull/32028))
|
302 |
-
- Skip unstable end-to-end tests. ([32031](https://github.com/WordPress/gutenberg/pull/32031))
|
303 |
-
- Try stabilizing customize widgets end-to-end tests. ([32023](https://github.com/WordPress/gutenberg/pull/32023))
|
304 |
-
- Update skip failing template mode end to end test. ([32017](https://github.com/WordPress/gutenberg/pull/32017))
|
305 |
-
- Update tests for changes in core logic. ([31982](https://github.com/WordPress/gutenberg/pull/31982))
|
306 |
-
- Gutenberg plugin: Update compatibility layer for loading separate core block assets. ([31894](https://github.com/WordPress/gutenberg/pull/31894))
|
307 |
-
- Workflow:
|
308 |
-
- Replace the Cancel workflow with native GitHub Action functionality. ([32016](https://github.com/WordPress/gutenberg/pull/32016))
|
309 |
-
- Remove Custom Properties PostCSS plugin. ([31715](https://github.com/WordPress/gutenberg/pull/31715))
|
310 |
|
311 |
|
312 |
|
313 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
314 |
= 10.6.2 =
|
315 |
|
316 |
|
1 |
== Changelog ==
|
2 |
|
3 |
+
= 10.7.1 =
|
4 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
|
7 |
### Bug Fixes
|
8 |
|
9 |
+
- Latest Posts: Declare 'hasPosts' before 'inspectorControls'. ([32160](https://github.com/WordPress/gutenberg/pull/32160))
|
10 |
+
- Fix image/cover transform duotone error. ([32006](https://github.com/WordPress/gutenberg/pull/32006))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
|
12 |
+
### Various
|
13 |
|
14 |
+
- Block Patterns API: Update for core compatibility. ([32240](https://github.com/WordPress/gutenberg/pull/32240))
|
15 |
+
- [Patterns]: Prepare GB bundled patterns for core back port. ([32086](https://github.com/WordPress/gutenberg/pull/32086))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
+
= 10.7.0 =
|
21 |
+
|
22 |
+
### Enhancements
|
23 |
+
|
24 |
+
- Block Editor:
|
25 |
+
- Standardize block styles cursor on hover. ([31188](https://github.com/WordPress/gutenberg/pull/31188))
|
26 |
+
- Support scripts in iframed editors. ([31873](https://github.com/WordPress/gutenberg/pull/31873))
|
27 |
+
- Block Library:
|
28 |
+
- Normalize theme block toolbars. ([31952](https://github.com/WordPress/gutenberg/pull/31952))
|
29 |
+
- Buttons: Use `column-gap` for styling. ([31386](https://github.com/WordPress/gutenberg/pull/31386))
|
30 |
+
- Column: Add color and padding support to individual column block. ([31778](https://github.com/WordPress/gutenberg/pull/31778))
|
31 |
+
- Cover: Allow transforming from group block. ([30890](https://github.com/WordPress/gutenberg/pull/30890))
|
32 |
+
- Media & Text: Add media width control. ([31002](https://github.com/WordPress/gutenberg/pull/31002))
|
33 |
+
- Post Comments: Add basic CSS to the block. ([30382](https://github.com/WordPress/gutenberg/pull/30382))
|
34 |
+
- Post Excerpt: Update `read more` placeholder text. ([30959](https://github.com/WordPress/gutenberg/pull/30959))
|
35 |
+
- Post Featured Image: Change wrapper element to `figure`. ([31595](https://github.com/WordPress/gutenberg/pull/31595))
|
36 |
+
- Query:
|
37 |
+
- Add `layout` and `color` support. ([31833](https://github.com/WordPress/gutenberg/pull/31833))
|
38 |
+
- Update bundled patterns to have `inherit:False`. ([31856](https://github.com/WordPress/gutenberg/pull/31856))
|
39 |
+
- Allow term addition from user case-insensitive input. ([31301](https://github.com/WordPress/gutenberg/pull/31301))
|
40 |
+
- Site Logo:
|
41 |
+
- Add link toggle option. ([31162](https://github.com/WordPress/gutenberg/pull/31162))
|
42 |
+
- Use `custom_logo` theme-mod instead of `site_logo` setting for the site-logo block. ([31994](https://github.com/WordPress/gutenberg/pull/31994))
|
43 |
+
- Site Tagline:
|
44 |
+
- Add margin block support. ([31809](https://github.com/WordPress/gutenberg/pull/31809))
|
45 |
+
- Expand the site tagline block description. ([31426](https://github.com/WordPress/gutenberg/pull/31426))
|
46 |
+
- Site Title:
|
47 |
+
- Add additional text formatting options. ([31734](https://github.com/WordPress/gutenberg/pull/31734))
|
48 |
+
- Add margin block support. ([31728](https://github.com/WordPress/gutenberg/pull/31728))
|
49 |
+
- Social Links: Add some padding to the "click plus to add". ([31927](https://github.com/WordPress/gutenberg/pull/31927))
|
50 |
+
- Components
|
51 |
+
- Add Spacer. ([31509](https://github.com/WordPress/gutenberg/pull/31509))
|
52 |
+
- Improve display for multiple action buttons in notices. ([31799](https://github.com/WordPress/gutenberg/pull/31799))
|
53 |
+
- Polish the switcher for horizontal blocks. ([31645](https://github.com/WordPress/gutenberg/pull/31645))
|
54 |
+
- Promote Divider and use readable prop names. ([31556](https://github.com/WordPress/gutenberg/pull/31556))
|
55 |
+
- Promote Grid. ([31559](https://github.com/WordPress/gutenberg/pull/31559))
|
56 |
+
- Promote View. ([31542](https://github.com/WordPress/gutenberg/pull/31542))
|
57 |
+
- Promote VStack and HStack. ([31300](https://github.com/WordPress/gutenberg/pull/31300))
|
58 |
+
- UnitControl: Add support for unit step per unit type. ([30376](https://github.com/WordPress/gutenberg/pull/30376))
|
59 |
+
- Design tools:
|
60 |
+
- Add margin block support with configurable sides. ([30608](https://github.com/WordPress/gutenberg/pull/30608))
|
61 |
+
- Add option to disable duotone. ([32002](https://github.com/WordPress/gutenberg/pull/32002))
|
62 |
+
- Add reset button to Layout controls. ([30828](https://github.com/WordPress/gutenberg/pull/30828))
|
63 |
+
- Add server-side support for margins. ([31808](https://github.com/WordPress/gutenberg/pull/31808))
|
64 |
+
- Icons: Update icons. ([31533](https://github.com/WordPress/gutenberg/pull/31533))
|
65 |
+
- List View:
|
66 |
+
- Display block anchor in List View when set. ([31992](https://github.com/WordPress/gutenberg/pull/31992))
|
67 |
+
- Enable persistent List View in the post editor. ([31047](https://github.com/WordPress/gutenberg/pull/31047))
|
68 |
+
- Patterns: Load patterns from wordpress.org API. ([28800](https://github.com/WordPress/gutenberg/pull/28800))
|
69 |
+
- Template Editing Mode:
|
70 |
+
- Add a welcome guide to the template editor. ([31330](https://github.com/WordPress/gutenberg/pull/31330)) ([32055](https://github.com/WordPress/gutenberg/pull/32055))
|
71 |
+
- Add a `Delete template` action. ([31678](https://github.com/WordPress/gutenberg/pull/31678))
|
72 |
+
- Word count: Adjust to count numbers as words. ([27288](https://github.com/WordPress/gutenberg/pull/27288))
|
73 |
+
|
74 |
+
### New APIs
|
75 |
+
|
76 |
+
- Babel Preset Default: Configure @babel/preset-env preset to respect a local Browserslist configuration. ([31898](https://github.com/WordPress/gutenberg/pull/31898))
|
77 |
+
- Blocks: Deprecate `registerBlockTypeFromMetadata` in favor of `registerBlockType`. ([32030](https://github.com/WordPress/gutenberg/pull/32030))
|
78 |
+
- Global Styles: Rename and stabilize `useEditorFeature` as `useSetting`. ([31587](https://github.com/WordPress/gutenberg/pull/31587))
|
79 |
+
- Stacked/unified block toolbar. ([31134](https://github.com/WordPress/gutenberg/pull/31134))
|
80 |
+
- Babel Preset Default: Add polyfill for WordPress built from core-js. ([31279](https://github.com/WordPress/gutenberg/pull/31279))
|
81 |
+
|
82 |
+
### Bug Fixes
|
83 |
+
|
84 |
+
- Block Library:
|
85 |
+
- Cover:
|
86 |
+
- Remove fixed background when previewed in patterns list. ([31640](https://github.com/WordPress/gutenberg/pull/31640))
|
87 |
+
- Show placeholder only if it has no inner blocks. ([31402](https://github.com/WordPress/gutenberg/pull/31402))
|
88 |
+
- Gallery:
|
89 |
+
- Fix focus caption prop for native. ([32029](https://github.com/WordPress/gutenberg/pull/32029))
|
90 |
+
- Fix identical images getting duplicated when moving. ([30555](https://github.com/WordPress/gutenberg/pull/30555))
|
91 |
+
- Image:
|
92 |
+
- Remove figure margins consistently in image blocks. ([31650](https://github.com/WordPress/gutenberg/pull/31650))
|
93 |
+
- Fix cover transform and excessive re-rendering. ([32102](https://github.com/WordPress/gutenberg/pull/32102))
|
94 |
+
- Post Content: Apply the_content filter even if content is empty. ([31997](https://github.com/WordPress/gutenberg/pull/31997))
|
95 |
+
- Post Comments Count: Fix attributes declaration. ([31976](https://github.com/WordPress/gutenberg/pull/31976))
|
96 |
+
- Post Comment Form:
|
97 |
+
- Fix stylesheet dependency. ([31528](https://github.com/WordPress/gutenberg/pull/31528))
|
98 |
+
- Fix to allow post comment button to inherit button & global styles automatically. ([31338](https://github.com/WordPress/gutenberg/pull/31338))
|
99 |
+
- Post Featured Image:
|
100 |
+
- Fix non-interactive placeholder when outside of a post context. ([31663](https://github.com/WordPress/gutenberg/pull/31663))
|
101 |
+
- Fix placeholder regression. ([31709](https://github.com/WordPress/gutenberg/pull/31709))
|
102 |
+
- Fix selection scroll into view. ([31835](https://github.com/WordPress/gutenberg/pull/31835))
|
103 |
+
- Fix image width for wide aligned Post featured image. ([32070](https://github.com/WordPress/gutenberg/pull/32070))
|
104 |
+
- Site Logo:
|
105 |
+
- Fix duplicate `supports` declaration. ([31544](https://github.com/WordPress/gutenberg/pull/31544))
|
106 |
+
- Return nothing if logo is not set. ([31513](https://github.com/WordPress/gutenberg/pull/31513))
|
107 |
+
- Only request media entity when a site logo has been chosen. ([31673](https://github.com/WordPress/gutenberg/pull/31673))
|
108 |
+
- Template Part:
|
109 |
+
- Don't show the currently used template part as an option in the 'replace' flow. ([31720](https://github.com/WordPress/gutenberg/pull/31720))
|
110 |
+
- Fix template part selection searches to use title/area instead of slug/theme. ([31520](https://github.com/WordPress/gutenberg/pull/31520))
|
111 |
+
- Use label and icon per variation when displaying placeholders. ([31721](https://github.com/WordPress/gutenberg/pull/31721))
|
112 |
+
- Block Editor:
|
113 |
+
- Clear selection on iframe html element click, fix bottom click redirect. ([31385](https://github.com/WordPress/gutenberg/pull/31385))
|
114 |
+
- Fix block ref when multiple useBlockProps hooks are called. ([31906](https://github.com/WordPress/gutenberg/pull/31906))
|
115 |
+
- Fix moving animation for nested blocks. ([31945](https://github.com/WordPress/gutenberg/pull/31945))
|
116 |
+
- Fix selecting aligned blocks. ([31904](https://github.com/WordPress/gutenberg/pull/31904))
|
117 |
+
- Fix scrolling to the inserted block issue in the iFramed block editor. ([31448](https://github.com/WordPress/gutenberg/pull/31448))
|
118 |
+
- Prevent rendering self also when the wrapper block matches the inserted block. ([31592](https://github.com/WordPress/gutenberg/pull/31592))
|
119 |
+
- Toolbar:
|
120 |
+
- Fix showing toolbar when caret enters formatting (and extract as implementation detail for the block editor). ([31664](https://github.com/WordPress/gutenberg/pull/31664))
|
121 |
+
- Fix toolbar in device preview. ([31600](https://github.com/WordPress/gutenberg/pull/31600))
|
122 |
+
- Design tools:
|
123 |
+
- BoxControl:
|
124 |
+
- Filter out unit only values when checking values defined. ([31779](https://github.com/WordPress/gutenberg/pull/31779))
|
125 |
+
- Fix tooltip display for unlinked box control inputs. ([31741](https://github.com/WordPress/gutenberg/pull/31741))
|
126 |
+
- Color picker:
|
127 |
+
- Fixes color picker segmented control rendering and scrolling issues. ([30994](https://github.com/WordPress/gutenberg/pull/30994))
|
128 |
+
- Fix text. ([30039](https://github.com/WordPress/gutenberg/pull/30039))
|
129 |
+
- Duotone:
|
130 |
+
- Fix duotone transform not transferring settings between blocks. ([31801](https://github.com/WordPress/gutenberg/pull/31801))
|
131 |
+
- Fix duotone padding crash. ([31780](https://github.com/WordPress/gutenberg/pull/31780))
|
132 |
+
- Font-family: Fix typo in font-family supports for dynamic blocks. ([31974](https://github.com/WordPress/gutenberg/pull/31974))
|
133 |
+
- Spacing Support:
|
134 |
+
- Properly hide UI for disabled properties. ([31726](https://github.com/WordPress/gutenberg/pull/31726))
|
135 |
+
- Fix custom units for margin. ([31776](https://github.com/WordPress/gutenberg/pull/31776))
|
136 |
+
- Inserter: Hide patterns tab if no patterns are available. ([31687](https://github.com/WordPress/gutenberg/pull/31687))
|
137 |
+
- Patterns:
|
138 |
+
- Check for allowed blocks recursively in patterns. ([30366](https://github.com/WordPress/gutenberg/pull/30366))
|
139 |
+
- Fix unregister_block_pattern notices. ([32025](https://github.com/WordPress/gutenberg/pull/32025))
|
140 |
+
- Post Editor: Fix template name displaying incorrectly. ([32035](https://github.com/WordPress/gutenberg/pull/32035))
|
141 |
+
- Server Side Rendering: Re-enable passing post_id query arg (#31786). ([31787](https://github.com/WordPress/gutenberg/pull/31787))
|
142 |
+
- Template Editing Mode: Fix wrapper block name for template mode. ([31985](https://github.com/WordPress/gutenberg/pull/31985))
|
143 |
+
- Writing flow, multi-selection:
|
144 |
+
- Fix caret placing when the target is out of view. ([31506](https://github.com/WordPress/gutenberg/pull/31506))
|
145 |
+
- Gradually 'select all' layers of nested blocks. ([31859](https://github.com/WordPress/gutenberg/pull/31859))
|
146 |
+
- Fix errors caused by commits to WordPress core. ([32176](https://github.com/WordPress/gutenberg/pull/32176)) ([32183](https://github.com/WordPress/gutenberg/pull/32183)) ([32059](https://github.com/WordPress/gutenberg/pull/32059))
|
147 |
+
- Components: Fix the list of package dependencies. ([32167](https://github.com/WordPress/gutenberg/pull/32167))
|
148 |
+
- Fix issue with customizer title overlapping block toolbar. ([32140](https://github.com/WordPress/gutenberg/pull/32140))
|
149 |
+
- Correctly read rawRequest for frontend ESM. ([31917](https://github.com/WordPress/gutenberg/pull/31917))
|
150 |
+
- Fix generation of presets classes per block. ([32190](https://github.com/WordPress/gutenberg/pull/32190))
|
151 |
+
- Widget Screen:
|
152 |
+
- Fix unsaved changes notification. ([31757](https://github.com/WordPress/gutenberg/pull/31757))
|
153 |
+
- Fix call to undefined __experimentalRegisterExperimentalCoreBlocks. ([32138](https://github.com/WordPress/gutenberg/pull/32138))
|
154 |
+
|
155 |
+
### Performance
|
156 |
+
|
157 |
+
- Block editor styles: Memoize transform. ([31553](https://github.com/WordPress/gutenberg/pull/31553))
|
158 |
+
- Block editor async mode: Enable only for blocks out of view. ([30995](https://github.com/WordPress/gutenberg/pull/30995))
|
159 |
+
- Improve performance of term search. ([31703](https://github.com/WordPress/gutenberg/pull/31703))
|
160 |
+
- Blocks package: Memoize getBlockVariations selector. ([32120](https://github.com/WordPress/gutenberg/pull/32120))
|
161 |
+
|
162 |
+
### Experiments
|
163 |
+
|
164 |
+
- Block Library: Hide the PostAuthor block behind the Gutenberg experimental flag. ([31983](https://github.com/WordPress/gutenberg/pull/31983))
|
165 |
+
- Block-based Widgets:
|
166 |
+
- API:
|
167 |
+
- Improve `get_merged_data` API so it requires less knowledge from the consumer. ([31552](https://github.com/WordPress/gutenberg/pull/31552))
|
168 |
+
- Customizer:
|
169 |
+
- Add 'more' menu. ([31970](https://github.com/WordPress/gutenberg/pull/31970))
|
170 |
+
- Add undo redo to Widgets Customizer. ([31653](https://github.com/WordPress/gutenberg/pull/31653))
|
171 |
+
- Add Welcome messaging. ([31968](https://github.com/WordPress/gutenberg/pull/31968))
|
172 |
+
- Clear selected block when focusing on element outside the editor. ([31530](https://github.com/WordPress/gutenberg/pull/31530))
|
173 |
+
- Fix removing legacy widget not working in customizer. ([31535](https://github.com/WordPress/gutenberg/pull/31535))
|
174 |
+
- Implement mobile responsive block toolbar. ([31589](https://github.com/WordPress/gutenberg/pull/31589))
|
175 |
+
- Remove Widgets Customizer experimental flag. ([31876](https://github.com/WordPress/gutenberg/pull/31876))
|
176 |
+
- Widgets Editor:
|
177 |
+
- Add default notices support. ([31578](https://github.com/WordPress/gutenberg/pull/31578))
|
178 |
+
- Add more menu. ([31926](https://github.com/WordPress/gutenberg/pull/31926))
|
179 |
+
- Add Welcome Guide. ([31925](https://github.com/WordPress/gutenberg/pull/31925))
|
180 |
+
- Remove widget screen empty link in admin. ([31408](https://github.com/WordPress/gutenberg/pull/31408))
|
181 |
+
- Update toolbar and notice positioning. ([31582](https://github.com/WordPress/gutenberg/pull/31582))
|
182 |
+
- Navigation Editor and Block:
|
183 |
+
- Add home link block. ([30926](https://github.com/WordPress/gutenberg/pull/30926))
|
184 |
+
- API:
|
185 |
+
- Add locations to the menu response. ([31656](https://github.com/WordPress/gutenberg/pull/31656))
|
186 |
+
- Change default to 100 menu items returned. ([21243](https://github.com/WordPress/gutenberg/pull/21243))
|
187 |
+
- Allow space between on page list. ([29771](https://github.com/WordPress/gutenberg/pull/29771))
|
188 |
+
- Bring implementations of convert nav menu items to blocks back into sync. ([31602](https://github.com/WordPress/gutenberg/pull/31602))
|
189 |
+
- Editor:
|
190 |
+
- "Add new pages" use menu entity. ([31643](https://github.com/WordPress/gutenberg/pull/31643))
|
191 |
+
- Add padding for navigation screen. ([31583](https://github.com/WordPress/gutenberg/pull/31583))
|
192 |
+
- Clear 'stub' navigation post edits on save. ([31735](https://github.com/WordPress/gutenberg/pull/31735))
|
193 |
+
- Fix menu location assignment. ([31594](https://github.com/WordPress/gutenberg/pull/31594))
|
194 |
+
- Fix editor margin. ([31493](https://github.com/WordPress/gutenberg/pull/31493))
|
195 |
+
- On mobile viewports, reveal the block inspector when clicking the menu name button. ([31220](https://github.com/WordPress/gutenberg/pull/31220))
|
196 |
+
- Update sidebar. ([31821](https://github.com/WordPress/gutenberg/pull/31821))
|
197 |
+
- Warn the user about unsaved changes. ([31197](https://github.com/WordPress/gutenberg/pull/31197))
|
198 |
+
- Enable justification for burger menu. ([31877](https://github.com/WordPress/gutenberg/pull/31877))
|
199 |
+
- Extract Navigation Block data fetching and management to hook(s). ([31825](https://github.com/WordPress/gutenberg/pull/31825))
|
200 |
+
- Fix nav block hover z index. ([31929](https://github.com/WordPress/gutenberg/pull/31929))
|
201 |
+
- Fix nav placeholder colors and height. ([31875](https://github.com/WordPress/gutenberg/pull/31875))
|
202 |
+
- Improve the navigation block setup state / placeholder. ([31371](https://github.com/WordPress/gutenberg/pull/31371))
|
203 |
+
- Introduce `useMenuEntityProp` hook. ([31132](https://github.com/WordPress/gutenberg/pull/31132))
|
204 |
+
- Normalize converting nav menu items to blocks between Editor and Block. ([31606](https://github.com/WordPress/gutenberg/pull/31606))
|
205 |
+
- Responsive Navigation. ([30047](https://github.com/WordPress/gutenberg/pull/30047))
|
206 |
+
- Submenus shouldn't take space unless they're actually open. ([31881](https://github.com/WordPress/gutenberg/pull/31881))
|
207 |
+
- Global Styles
|
208 |
+
- Block Supports: Allow skipping serialization of typography attributes. ([30880](https://github.com/WordPress/gutenberg/pull/30880))
|
209 |
+
- Fix condition for global styles on mobile. ([31844](https://github.com/WordPress/gutenberg/pull/31844))
|
210 |
+
- Fix global styles settings retrieval for REST. ([31534](https://github.com/WordPress/gutenberg/pull/31534))
|
211 |
+
- Make core color classes and custom properties always available. ([31669](https://github.com/WordPress/gutenberg/pull/31669))
|
212 |
+
- Remove color.link from valid styles and alphabetize the rest. ([31516](https://github.com/WordPress/gutenberg/pull/31516))
|
213 |
+
- Return consolidated global styles in REST Request. ([31762](https://github.com/WordPress/gutenberg/pull/31762))
|
214 |
+
- Use elements mechanism for link color instead of a CSS variable. ([31524](https://github.com/WordPress/gutenberg/pull/31524))
|
215 |
+
- Use mobile context in settings request & global styles. ([31819](https://github.com/WordPress/gutenberg/pull/31819))
|
216 |
+
- Use wp_theme taxonomy for wp_global_styles cpt. ([31436](https://github.com/WordPress/gutenberg/pull/31436))
|
217 |
+
- Theme.json:
|
218 |
+
- Make the `theme.json` examples copy-pasteable. ([32040](https://github.com/WordPress/gutenberg/pull/32040))
|
219 |
+
- Replace hardcoded `CSS_UNITS` and inherit units from `theme.json`. ([31822](https://github.com/WordPress/gutenberg/pull/31822))
|
220 |
+
- Full Site Editing:
|
221 |
+
- Template Loader: Make templates arg required. ([31671](https://github.com/WordPress/gutenberg/pull/31671))
|
222 |
+
- Simplify template loader logic. ([31604](https://github.com/WordPress/gutenberg/pull/31604))
|
223 |
+
|
224 |
+
### Documentation
|
225 |
+
|
226 |
+
- Handbook:
|
227 |
+
- Add dedicated Block Styles page under Block API directory. ([31055](https://github.com/WordPress/gutenberg/pull/31055))
|
228 |
+
- Add info on how to connect to the WP ENV MySQL database. ([31975](https://github.com/WordPress/gutenberg/pull/31975))
|
229 |
+
- Capitalize GitHub properly in contributors README. ([31549](https://github.com/WordPress/gutenberg/pull/31549))
|
230 |
+
- Clarify 'Applying styles from a stylesheet' how-to guide. ([31824](https://github.com/WordPress/gutenberg/pull/31824))
|
231 |
+
- First pass at the documentation for the Widgets Block Editor. ([31577](https://github.com/WordPress/gutenberg/pull/31577))
|
232 |
+
- Fix link to ESNext in callout. ([31512](https://github.com/WordPress/gutenberg/pull/31512))
|
233 |
+
- Update Glossary with more FSE terminology. ([31525](https://github.com/WordPress/gutenberg/pull/31525))
|
234 |
+
- Packages:
|
235 |
+
- Add required “directory” prop to package.json template in packages documentation. ([31570](https://github.com/WordPress/gutenberg/pull/31570))
|
236 |
+
- Fix typo: "packages" -> "package". ([32036](https://github.com/WordPress/gutenberg/pull/32036))
|
237 |
+
- Improve packages documentation - document root package json and public API knowledge. ([31598](https://github.com/WordPress/gutenberg/pull/31598))
|
238 |
+
- Remove duplicate 1.52.0 changelog entry. ([31659](https://github.com/WordPress/gutenberg/pull/31659))
|
239 |
+
- Scripts: Fix the CHANGELOG for `@wordpress/scripts` package. ([31532](https://github.com/WordPress/gutenberg/pull/31532))
|
240 |
+
- Typo in edit-navigation layout translators note. ([31541](https://github.com/WordPress/gutenberg/pull/31541))
|
241 |
+
|
242 |
+
### Code Quality
|
243 |
+
|
244 |
+
- Block editor:
|
245 |
+
- Block popover: Move scroll handling to block tools. ([31611](https://github.com/WordPress/gutenberg/pull/31611))
|
246 |
+
- Log an error if styles are loaded through the compatibility layer. ([31870](https://github.com/WordPress/gutenberg/pull/31870))
|
247 |
+
- Block Library:
|
248 |
+
- Post Comments: Make CSS less specific. ([31711](https://github.com/WordPress/gutenberg/pull/31711))
|
249 |
+
- Image/Gallery: Remove use of unstableOnFocus. ([31796](https://github.com/WordPress/gutenberg/pull/31796))
|
250 |
+
- Linting:
|
251 |
+
- Fix PHP lint issues. ([32039](https://github.com/WordPress/gutenberg/pull/32039))
|
252 |
+
- Fix PHPCS warning for alignment. ([31931](https://github.com/WordPress/gutenberg/pull/31931))
|
253 |
+
- Fix lint issues. ([31790](https://github.com/WordPress/gutenberg/pull/31790))
|
254 |
+
- Ignore data-no-store-string-literals rule for native files. ([31936](https://github.com/WordPress/gutenberg/pull/31936))
|
255 |
+
- Components:
|
256 |
+
- Add ToolbarDropdownMenu to render dropdown menus properly inside toolbars. ([31460](https://github.com/WordPress/gutenberg/pull/31460))
|
257 |
+
- Don't pass down index through context. ([31852](https://github.com/WordPress/gutenberg/pull/31852))
|
258 |
+
- Remove `color()` utility function, use values directly. ([31661](https://github.com/WordPress/gutenberg/pull/31661))
|
259 |
+
- Remove `config()` utility function, use values directly. ([31646](https://github.com/WordPress/gutenberg/pull/31646))
|
260 |
+
- Compose:
|
261 |
+
- Add types to withInstanceId and corresponding hook. ([31341](https://github.com/WordPress/gutenberg/pull/31341))
|
262 |
+
- Add types useConstrainedTabbing. ([31548](https://github.com/WordPress/gutenberg/pull/31548))
|
263 |
+
- Add types useAsyncList. ([31523](https://github.com/WordPress/gutenberg/pull/31523))
|
264 |
+
- Docgen:
|
265 |
+
- Replace assertions for `getIntermediateRepresentation` unit tests with snapshots. ([31547](https://github.com/WordPress/gutenberg/pull/31547))
|
266 |
+
- Split `getIntermediateRepresentation` unit tests in smaller tests. ([31468](https://github.com/WordPress/gutenberg/pull/31468))
|
267 |
+
- Inserter: Mark the inserter slot as unstable. ([31417](https://github.com/WordPress/gutenberg/pull/31417))
|
268 |
+
- Multi-select:
|
269 |
+
- Use ref callback for focus out, merge native selection hooks. ([31618](https://github.com/WordPress/gutenberg/pull/31618))
|
270 |
+
- Use writing flow container for focus. ([31572](https://github.com/WordPress/gutenberg/pull/31572))
|
271 |
+
- Rich text:
|
272 |
+
- Build in isSelected check for children. ([31802](https://github.com/WordPress/gutenberg/pull/31802))
|
273 |
+
- Consolidate applying from props. ([31635](https://github.com/WordPress/gutenberg/pull/31635))
|
274 |
+
- Each hook should create its own ref. ([31477](https://github.com/WordPress/gutenberg/pull/31477))
|
275 |
+
- Extract implementation-specific undo handling of automatic changes. ([31676](https://github.com/WordPress/gutenberg/pull/31676))
|
276 |
+
- Extract internal delete handling. ([31637](https://github.com/WordPress/gutenberg/pull/31637))
|
277 |
+
- Extract persistent change marking. ([31760](https://github.com/WordPress/gutenberg/pull/31760))
|
278 |
+
- Extract splitValue to separate file. ([31803](https://github.com/WordPress/gutenberg/pull/31803))
|
279 |
+
- Extract input and selection. ([31631](https://github.com/WordPress/gutenberg/pull/31631))
|
280 |
+
- Extract indent list item on space. ([31628](https://github.com/WordPress/gutenberg/pull/31628))
|
281 |
+
- Extract select object. ([31627](https://github.com/WordPress/gutenberg/pull/31627))
|
282 |
+
- Extract paste handler. ([31619](https://github.com/WordPress/gutenberg/pull/31619))
|
283 |
+
- Fix props on DOM element warnings. ([31883](https://github.com/WordPress/gutenberg/pull/31883))
|
284 |
+
- Move autocomplete key handler to ref callback. ([31770](https://github.com/WordPress/gutenberg/pull/31770))
|
285 |
+
- Move implementation specific attributes. ([31674](https://github.com/WordPress/gutenberg/pull/31674))
|
286 |
+
- Move implementation specific delete and enter handling. ([31644](https://github.com/WordPress/gutenberg/pull/31644))
|
287 |
+
- Remove avoiding setting selection on mount. ([31788](https://github.com/WordPress/gutenberg/pull/31788))
|
288 |
+
- Remove dependency on block client ID. ([31752](https://github.com/WordPress/gutenberg/pull/31752))
|
289 |
+
- Remove duplicate active formats state. ([31771](https://github.com/WordPress/gutenberg/pull/31771))
|
290 |
+
- Remove old broken format prop. ([31767](https://github.com/WordPress/gutenberg/pull/31767))
|
291 |
+
- Remove tag name dependency. ([31679](https://github.com/WordPress/gutenberg/pull/31679))
|
292 |
+
- Simplify with hooks. ([31718](https://github.com/WordPress/gutenberg/pull/31718))
|
293 |
+
- Rename `construct_wp_query_args` to `build_query_vars_from_query_block`. ([32041](https://github.com/WordPress/gutenberg/pull/32041))
|
294 |
+
- Theme.json:
|
295 |
+
- Remove unused code. ([31666](https://github.com/WordPress/gutenberg/pull/31666))
|
296 |
+
- Remove declarations so API has coherence. ([31596](https://github.com/WordPress/gutenberg/pull/31596))
|
297 |
+
- Remove: Declarations parameter from compute_style_properties. ([31573](https://github.com/WordPress/gutenberg/pull/31573))
|
298 |
+
- Writing flow:
|
299 |
+
- Extract and simplify "select all". ([31855](https://github.com/WordPress/gutenberg/pull/31855))
|
300 |
+
- Extract arrow nav. ([31851](https://github.com/WordPress/gutenberg/pull/31851))
|
301 |
+
- Extract tab behavior to hook. ([31834](https://github.com/WordPress/gutenberg/pull/31834))
|
302 |
+
- REST API: Use batch endpoint included in Core. ([32174](https://github.com/WordPress/gutenberg/pull/32174))
|
303 |
+
- Prepare for adding the Widgets block editor to Core. ([32136](https://github.com/WordPress/gutenberg/pull/32136))
|
304 |
+
- Remove `gutenberg` domain from core blocks. ([32152](https://github.com/WordPress/gutenberg/pull/32152))
|
305 |
+
- Remove filter_var from blocks. ([32046](https://github.com/WordPress/gutenberg/pull/32046))
|
306 |
+
- Plugin: Update block editor settings to work with context. ([32159](https://github.com/WordPress/gutenberg/pull/32159))
|
307 |
+
|
308 |
+
### Tools
|
309 |
+
|
310 |
+
- End-to-end tests:
|
311 |
+
- Add template loader unit tests. ([31498](https://github.com/WordPress/gutenberg/pull/31498))
|
312 |
+
- Fix end-to-end test inserting cover block. ([31866](https://github.com/WordPress/gutenberg/pull/31866))
|
313 |
+
- Fix flaky change detection tests causing intermittent failures. ([31861](https://github.com/WordPress/gutenberg/pull/31861))
|
314 |
+
- Fix intermittent embeds failure. ([31860](https://github.com/WordPress/gutenberg/pull/31860))
|
315 |
+
- Fix intermittent failure of rich text end-to-end test. ([31864](https://github.com/WordPress/gutenberg/pull/31864))
|
316 |
+
- Increase test coverage for pattern transforms. ([31689](https://github.com/WordPress/gutenberg/pull/31689))
|
317 |
+
- Navigation: Add unit tests for onChange handler and fix cases around custom links tags and post-format. ([31259](https://github.com/WordPress/gutenberg/pull/31259))
|
318 |
+
- Remove i18n filters performance test. ([32028](https://github.com/WordPress/gutenberg/pull/32028))
|
319 |
+
- Skip unstable end-to-end tests. ([32031](https://github.com/WordPress/gutenberg/pull/32031))
|
320 |
+
- Try stabilizing customize widgets end-to-end tests. ([32023](https://github.com/WordPress/gutenberg/pull/32023))
|
321 |
+
- Update skip failing template mode end to end test. ([32017](https://github.com/WordPress/gutenberg/pull/32017))
|
322 |
+
- Update tests for changes in core logic. ([31982](https://github.com/WordPress/gutenberg/pull/31982))
|
323 |
+
- Gutenberg plugin: Update compatibility layer for loading separate core block assets. ([31894](https://github.com/WordPress/gutenberg/pull/31894))
|
324 |
+
- Workflow:
|
325 |
+
- Replace the Cancel workflow with native GitHub Action functionality. ([32016](https://github.com/WordPress/gutenberg/pull/32016))
|
326 |
+
- Remove Custom Properties PostCSS plugin. ([31715](https://github.com/WordPress/gutenberg/pull/31715))
|
327 |
+
|
328 |
+
|
329 |
+
|
330 |
+
|
331 |
= 10.6.2 =
|
332 |
|
333 |
|
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.7.
|
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.7.
|
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.7.1
|
9 |
* Author: Gutenberg Team
|
10 |
* Text Domain: gutenberg
|
11 |
*
|
13 |
*/
|
14 |
|
15 |
### BEGIN AUTO-GENERATED DEFINES
|
16 |
+
define( 'GUTENBERG_VERSION', '10.7.1' );
|
17 |
+
define( 'GUTENBERG_GIT_COMMIT', 'c2b9275b86eec1158bda9582161641a04314028e' );
|
18 |
### END AUTO-GENERATED DEFINES
|
19 |
|
20 |
gutenberg_pre_init();
|
lib/block-patterns.php
CHANGED
@@ -10,12 +10,12 @@
|
|
10 |
*/
|
11 |
function register_gutenberg_patterns() {
|
12 |
// Register categories used for block patterns.
|
13 |
-
|
|
|
|
|
14 |
|
15 |
-
|
16 |
-
|
17 |
-
'query/standard-posts',
|
18 |
-
array(
|
19 |
'title' => __( 'Standard', 'gutenberg' ),
|
20 |
'blockTypes' => array( 'core/query' ),
|
21 |
'categories' => array( 'query' ),
|
@@ -32,12 +32,8 @@ function register_gutenberg_patterns() {
|
|
32 |
<!-- /wp:query-loop -->
|
33 |
</div>
|
34 |
<!-- /wp:query -->',
|
35 |
-
)
|
36 |
-
|
37 |
-
|
38 |
-
register_block_pattern(
|
39 |
-
'query/medium-posts',
|
40 |
-
array(
|
41 |
'title' => __( 'Image at left', 'gutenberg' ),
|
42 |
'blockTypes' => array( 'core/query' ),
|
43 |
'categories' => array( 'query' ),
|
@@ -56,12 +52,8 @@ function register_gutenberg_patterns() {
|
|
56 |
<!-- /wp:query-loop -->
|
57 |
</div>
|
58 |
<!-- /wp:query -->',
|
59 |
-
)
|
60 |
-
|
61 |
-
|
62 |
-
register_block_pattern(
|
63 |
-
'query/small-posts',
|
64 |
-
array(
|
65 |
'title' => __( 'Small image and title', 'gutenberg' ),
|
66 |
'blockTypes' => array( 'core/query' ),
|
67 |
'categories' => array( 'query' ),
|
@@ -79,12 +71,8 @@ function register_gutenberg_patterns() {
|
|
79 |
<!-- /wp:query-loop -->
|
80 |
</div>
|
81 |
<!-- /wp:query -->',
|
82 |
-
)
|
83 |
-
|
84 |
-
|
85 |
-
register_block_pattern(
|
86 |
-
'query/grid-posts',
|
87 |
-
array(
|
88 |
'title' => __( 'Grid', 'gutenberg' ),
|
89 |
'blockTypes' => array( 'core/query' ),
|
90 |
'categories' => array( 'query' ),
|
@@ -99,12 +87,8 @@ function register_gutenberg_patterns() {
|
|
99 |
<!-- /wp:query-loop -->
|
100 |
</div>
|
101 |
<!-- /wp:query -->',
|
102 |
-
)
|
103 |
-
|
104 |
-
|
105 |
-
register_block_pattern(
|
106 |
-
'query/large-title-posts',
|
107 |
-
array(
|
108 |
'title' => __( 'Large title', 'gutenberg' ),
|
109 |
'blockTypes' => array( 'core/query' ),
|
110 |
'categories' => array( 'query' ),
|
@@ -127,12 +111,8 @@ function register_gutenberg_patterns() {
|
|
127 |
<!-- /wp:query-loop --></div>
|
128 |
<!-- /wp:query --></div>
|
129 |
<!-- /wp:group -->',
|
130 |
-
)
|
131 |
-
|
132 |
-
|
133 |
-
register_block_pattern(
|
134 |
-
'query/offset-posts',
|
135 |
-
array(
|
136 |
'title' => __( 'Offset', 'gutenberg' ),
|
137 |
'blockTypes' => array( 'core/query' ),
|
138 |
'categories' => array( 'query' ),
|
@@ -164,13 +144,9 @@ function register_gutenberg_patterns() {
|
|
164 |
<!-- /wp:column --></div>
|
165 |
<!-- /wp:columns --></main>
|
166 |
<!-- /wp:group -->',
|
167 |
-
)
|
168 |
-
|
169 |
-
|
170 |
-
// Initial block pattern to be used with block transformations with patterns.
|
171 |
-
register_block_pattern(
|
172 |
-
'social-links/shared-background-color',
|
173 |
-
array(
|
174 |
'title' => __( 'Social links with a shared background color', 'gutenberg' ),
|
175 |
'categories' => array( 'buttons' ),
|
176 |
'blockTypes' => array( 'core/social-links' ),
|
@@ -180,8 +156,15 @@ function register_gutenberg_patterns() {
|
|
180 |
<!-- wp:social-link {"url":"#","service":"chain"} /-->
|
181 |
<!-- wp:social-link {"url":"#","service":"mail"} /--></ul>
|
182 |
<!-- /wp:social-links -->',
|
183 |
-
)
|
184 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
185 |
}
|
186 |
|
187 |
/**
|
@@ -199,6 +182,13 @@ function remove_core_patterns() {
|
|
199 |
'three-buttons',
|
200 |
'heading-paragraph',
|
201 |
'quote',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
202 |
);
|
203 |
|
204 |
foreach ( $core_block_patterns as $core_block_pattern ) {
|
@@ -213,9 +203,13 @@ function remove_core_patterns() {
|
|
213 |
* Import patterns from wordpress.org/patterns.
|
214 |
*/
|
215 |
function load_remote_patterns() {
|
|
|
|
|
|
|
|
|
216 |
$patterns = get_transient( 'gutenberg_remote_block_patterns' );
|
217 |
if ( ! $patterns ) {
|
218 |
-
$request = new WP_REST_Request( 'GET', '/
|
219 |
$core_keyword_id = 11; // 11 is the ID for "core".
|
220 |
$request->set_param( 'keyword', $core_keyword_id );
|
221 |
$response = rest_do_request( $request );
|
10 |
*/
|
11 |
function register_gutenberg_patterns() {
|
12 |
// Register categories used for block patterns.
|
13 |
+
if ( ! WP_Block_Pattern_Categories_Registry::get_instance()->is_registered( 'query' ) ) {
|
14 |
+
register_block_pattern_category( 'query', array( 'label' => __( 'Query', 'gutenberg' ) ) );
|
15 |
+
}
|
16 |
|
17 |
+
$patterns = array(
|
18 |
+
'query-standard-posts' => array(
|
|
|
|
|
19 |
'title' => __( 'Standard', 'gutenberg' ),
|
20 |
'blockTypes' => array( 'core/query' ),
|
21 |
'categories' => array( 'query' ),
|
32 |
<!-- /wp:query-loop -->
|
33 |
</div>
|
34 |
<!-- /wp:query -->',
|
35 |
+
),
|
36 |
+
'query-medium-posts' => array(
|
|
|
|
|
|
|
|
|
37 |
'title' => __( 'Image at left', 'gutenberg' ),
|
38 |
'blockTypes' => array( 'core/query' ),
|
39 |
'categories' => array( 'query' ),
|
52 |
<!-- /wp:query-loop -->
|
53 |
</div>
|
54 |
<!-- /wp:query -->',
|
55 |
+
),
|
56 |
+
'query-small-posts' => array(
|
|
|
|
|
|
|
|
|
57 |
'title' => __( 'Small image and title', 'gutenberg' ),
|
58 |
'blockTypes' => array( 'core/query' ),
|
59 |
'categories' => array( 'query' ),
|
71 |
<!-- /wp:query-loop -->
|
72 |
</div>
|
73 |
<!-- /wp:query -->',
|
74 |
+
),
|
75 |
+
'query-grid-posts' => array(
|
|
|
|
|
|
|
|
|
76 |
'title' => __( 'Grid', 'gutenberg' ),
|
77 |
'blockTypes' => array( 'core/query' ),
|
78 |
'categories' => array( 'query' ),
|
87 |
<!-- /wp:query-loop -->
|
88 |
</div>
|
89 |
<!-- /wp:query -->',
|
90 |
+
),
|
91 |
+
'query-large-title-posts' => array(
|
|
|
|
|
|
|
|
|
92 |
'title' => __( 'Large title', 'gutenberg' ),
|
93 |
'blockTypes' => array( 'core/query' ),
|
94 |
'categories' => array( 'query' ),
|
111 |
<!-- /wp:query-loop --></div>
|
112 |
<!-- /wp:query --></div>
|
113 |
<!-- /wp:group -->',
|
114 |
+
),
|
115 |
+
'query-offset-posts' => array(
|
|
|
|
|
|
|
|
|
116 |
'title' => __( 'Offset', 'gutenberg' ),
|
117 |
'blockTypes' => array( 'core/query' ),
|
118 |
'categories' => array( 'query' ),
|
144 |
<!-- /wp:column --></div>
|
145 |
<!-- /wp:columns --></main>
|
146 |
<!-- /wp:group -->',
|
147 |
+
),
|
148 |
+
// Initial block pattern to be used with block transformations with patterns.
|
149 |
+
'social-links-shared-background-color' => array(
|
|
|
|
|
|
|
|
|
150 |
'title' => __( 'Social links with a shared background color', 'gutenberg' ),
|
151 |
'categories' => array( 'buttons' ),
|
152 |
'blockTypes' => array( 'core/social-links' ),
|
156 |
<!-- wp:social-link {"url":"#","service":"chain"} /-->
|
157 |
<!-- wp:social-link {"url":"#","service":"mail"} /--></ul>
|
158 |
<!-- /wp:social-links -->',
|
159 |
+
),
|
160 |
);
|
161 |
+
|
162 |
+
foreach ( $patterns as $name => $pattern ) {
|
163 |
+
$pattern_name = 'core/' . $name;
|
164 |
+
if ( ! WP_Block_Patterns_Registry::get_instance()->is_registered( $pattern_name ) ) {
|
165 |
+
register_block_pattern( $pattern_name, $pattern );
|
166 |
+
}
|
167 |
+
}
|
168 |
}
|
169 |
|
170 |
/**
|
182 |
'three-buttons',
|
183 |
'heading-paragraph',
|
184 |
'quote',
|
185 |
+
'query-standard-posts',
|
186 |
+
'query-medium-posts',
|
187 |
+
'query-small-posts',
|
188 |
+
'query-grid-posts',
|
189 |
+
'query-large-title-posts',
|
190 |
+
'query-offset-posts',
|
191 |
+
'social-links-shared-background-color',
|
192 |
);
|
193 |
|
194 |
foreach ( $core_block_patterns as $core_block_pattern ) {
|
203 |
* Import patterns from wordpress.org/patterns.
|
204 |
*/
|
205 |
function load_remote_patterns() {
|
206 |
+
// This is the core function that provides the same feature.
|
207 |
+
if ( function_exists( '_load_remote_block_patterns' ) ) {
|
208 |
+
return;
|
209 |
+
}
|
210 |
$patterns = get_transient( 'gutenberg_remote_block_patterns' );
|
211 |
if ( ! $patterns ) {
|
212 |
+
$request = new WP_REST_Request( 'GET', '/wp/v2/pattern-directory/patterns' );
|
213 |
$core_keyword_id = 11; // 11 is the ID for "core".
|
214 |
$request->set_param( 'keyword', $core_keyword_id );
|
215 |
$response = rest_do_request( $request );
|
lib/class-wp-rest-pattern-directory-controller.php
CHANGED
@@ -20,11 +20,12 @@
|
|
20 |
* @see WP_REST_Controller
|
21 |
*/
|
22 |
class WP_REST_Pattern_Directory_Controller extends WP_REST_Controller {
|
|
|
23 |
/**
|
24 |
* Constructs the controller.
|
25 |
*/
|
26 |
public function __construct() {
|
27 |
-
$this->namespace = '
|
28 |
$this->rest_base = 'pattern-directory';
|
29 |
}
|
30 |
|
@@ -56,7 +57,7 @@ class WP_REST_Pattern_Directory_Controller extends WP_REST_Controller {
|
|
56 |
*
|
57 |
* @return WP_Error|bool True if the request has permission, WP_Error object otherwise.
|
58 |
*/
|
59 |
-
public function get_items_permissions_check( $request ) {
|
60 |
if ( current_user_can( 'edit_posts' ) ) {
|
61 |
return true;
|
62 |
}
|
@@ -158,7 +159,7 @@ class WP_REST_Pattern_Directory_Controller extends WP_REST_Controller {
|
|
158 |
*
|
159 |
* @return WP_REST_Response
|
160 |
*/
|
161 |
-
public function prepare_item_for_response( $raw_pattern, $request ) {
|
162 |
$prepared_pattern = array(
|
163 |
'id' => absint( $raw_pattern->id ),
|
164 |
'title' => sanitize_text_field( $raw_pattern->title->rendered ),
|
@@ -167,7 +168,6 @@ class WP_REST_Pattern_Directory_Controller extends WP_REST_Controller {
|
|
167 |
'keywords' => array_map( 'sanitize_title', $raw_pattern->keyword_slugs ),
|
168 |
'description' => sanitize_text_field( $raw_pattern->meta->wpop_description ),
|
169 |
'viewport_width' => absint( $raw_pattern->meta->wpop_viewport_width ),
|
170 |
-
|
171 |
);
|
172 |
|
173 |
$prepared_pattern = $this->add_additional_fields_to_object( $prepared_pattern, $request );
|
@@ -183,7 +183,7 @@ class WP_REST_Pattern_Directory_Controller extends WP_REST_Controller {
|
|
183 |
* @param object $raw_pattern The unprepared pattern.
|
184 |
* @param WP_REST_Request $request The request object.
|
185 |
*/
|
186 |
-
return apply_filters( '
|
187 |
}
|
188 |
|
189 |
/**
|
@@ -261,7 +261,7 @@ class WP_REST_Pattern_Directory_Controller extends WP_REST_Controller {
|
|
261 |
/**
|
262 |
* Retrieves the search params for the patterns collection.
|
263 |
*
|
264 |
-
* @since 5.
|
265 |
*
|
266 |
* @return array Collection parameters.
|
267 |
*/
|
@@ -290,7 +290,7 @@ class WP_REST_Pattern_Directory_Controller extends WP_REST_Controller {
|
|
290 |
/**
|
291 |
* Filter collection parameters for the pattern directory controller.
|
292 |
*
|
293 |
-
* @since 5.
|
294 |
*
|
295 |
* @param array $query_params JSON Schema-formatted collection parameters.
|
296 |
*/
|
20 |
* @see WP_REST_Controller
|
21 |
*/
|
22 |
class WP_REST_Pattern_Directory_Controller extends WP_REST_Controller {
|
23 |
+
|
24 |
/**
|
25 |
* Constructs the controller.
|
26 |
*/
|
27 |
public function __construct() {
|
28 |
+
$this->namespace = 'wp/v2';
|
29 |
$this->rest_base = 'pattern-directory';
|
30 |
}
|
31 |
|
57 |
*
|
58 |
* @return WP_Error|bool True if the request has permission, WP_Error object otherwise.
|
59 |
*/
|
60 |
+
public function get_items_permissions_check( $request ) {
|
61 |
if ( current_user_can( 'edit_posts' ) ) {
|
62 |
return true;
|
63 |
}
|
159 |
*
|
160 |
* @return WP_REST_Response
|
161 |
*/
|
162 |
+
public function prepare_item_for_response( $raw_pattern, $request ) {
|
163 |
$prepared_pattern = array(
|
164 |
'id' => absint( $raw_pattern->id ),
|
165 |
'title' => sanitize_text_field( $raw_pattern->title->rendered ),
|
168 |
'keywords' => array_map( 'sanitize_title', $raw_pattern->keyword_slugs ),
|
169 |
'description' => sanitize_text_field( $raw_pattern->meta->wpop_description ),
|
170 |
'viewport_width' => absint( $raw_pattern->meta->wpop_viewport_width ),
|
|
|
171 |
);
|
172 |
|
173 |
$prepared_pattern = $this->add_additional_fields_to_object( $prepared_pattern, $request );
|
183 |
* @param object $raw_pattern The unprepared pattern.
|
184 |
* @param WP_REST_Request $request The request object.
|
185 |
*/
|
186 |
+
return apply_filters( 'rest_prepare_block_pattern', $response, $raw_pattern, $request );
|
187 |
}
|
188 |
|
189 |
/**
|
261 |
/**
|
262 |
* Retrieves the search params for the patterns collection.
|
263 |
*
|
264 |
+
* @since 5.8.0
|
265 |
*
|
266 |
* @return array Collection parameters.
|
267 |
*/
|
290 |
/**
|
291 |
* Filter collection parameters for the pattern directory controller.
|
292 |
*
|
293 |
+
* @since 5.8.0
|
294 |
*
|
295 |
* @param array $query_params JSON Schema-formatted collection parameters.
|
296 |
*/
|
readme.txt
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
=== Gutenberg ===
|
2 |
Contributors: matveb, joen, karmatosed
|
3 |
Tested up to: 5.7
|
4 |
-
Stable tag: 10.
|
5 |
License: GPLv2 or later
|
6 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
7 |
|
@@ -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.7.
|
1 |
=== Gutenberg ===
|
2 |
Contributors: matveb, joen, karmatosed
|
3 |
Tested up to: 5.7
|
4 |
+
Stable tag: 10.7.0
|
5 |
License: GPLv2 or later
|
6 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
7 |
|
55 |
|
56 |
== Changelog ==
|
57 |
|
58 |
+
To read the changelog for Gutenberg 10.7.1, please navigate to the <a href="https://github.com/WordPress/gutenberg/releases/tag/v10.7.1">release page</a>.
|