Version Description
Download this release
Release Info
Developer | youknowriad |
Plugin | Gutenberg |
Version | 8.7.1 |
Comparing to | |
See all releases |
Code changes from version 8.7.0 to 8.7.1
- build/block-editor/index.asset.php +1 -1
- build/block-editor/index.js +1 -1
- changelog.txt +8 -0
- gutenberg.php +3 -3
- lib/blocks.php +2 -2
- readme.txt +2 -2
build/block-editor/index.asset.php
CHANGED
@@ -1 +1 @@
|
|
1 |
-
<?php return array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-a11y', 'wp-blob', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-notices', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-shortcode', 'wp-token-list', 'wp-url', 'wp-viewport', 'wp-warning', 'wp-wordcount'), 'version' => '
|
1 |
+
<?php return array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-a11y', 'wp-blob', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-notices', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-shortcode', 'wp-token-list', 'wp-url', 'wp-viewport', 'wp-warning', 'wp-wordcount'), 'version' => 'd7f449b15752f622272ad2da43a7c963');
|
build/block-editor/index.js
CHANGED
@@ -65,7 +65,7 @@ Object(h._n)("%d result found, use up and down arrow keys to navigate.","%d resu
|
|
65 |
/* translators: %s: search term. */
|
66 |
Object(h.__)("New page: <mark>%s</mark>"),t),{mark:Object(d.createElement)("mark",null)})))):null},jd=Object(d.createElement)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},Object(d.createElement)(k.Path,{d:"M9 0C4.03 0 0 4.03 0 9s4.03 9 9 9 9-4.03 9-9-4.03-9-9-9zM1.11 9.68h2.51c.04.91.167 1.814.38 2.7H1.84c-.403-.85-.65-1.764-.73-2.7zm8.57-5.4V1.19c.964.366 1.756 1.08 2.22 2 .205.347.386.708.54 1.08l-2.76.01zm3.22 1.35c.232.883.37 1.788.41 2.7H9.68v-2.7h3.22zM8.32 1.19v3.09H5.56c.154-.372.335-.733.54-1.08.462-.924 1.255-1.64 2.22-2.01zm0 4.44v2.7H4.7c.04-.912.178-1.817.41-2.7h3.21zm-4.7 2.69H1.11c.08-.936.327-1.85.73-2.7H4c-.213.886-.34 1.79-.38 2.7zM4.7 9.68h3.62v2.7H5.11c-.232-.883-.37-1.788-.41-2.7zm3.63 4v3.09c-.964-.366-1.756-1.08-2.22-2-.205-.347-.386-.708-.54-1.08l2.76-.01zm1.35 3.09v-3.04h2.76c-.154.372-.335.733-.54 1.08-.464.92-1.256 1.634-2.22 2v-.04zm0-4.44v-2.7h3.62c-.04.912-.178 1.817-.41 2.7H9.68zm4.71-2.7h2.51c-.08.936-.327 1.85-.73 2.7H14c.21-.87.337-1.757.38-2.65l.01-.05zm0-1.35c-.046-.894-.176-1.78-.39-2.65h2.16c.403.85.65 1.764.73 2.7l-2.5-.05zm1-4H13.6c-.324-.91-.793-1.76-1.39-2.52 1.244.56 2.325 1.426 3.14 2.52h.04zm-9.6-2.52c-.597.76-1.066 1.61-1.39 2.52H2.65c.815-1.094 1.896-1.96 3.14-2.52zm-3.15 12H4.4c.324.91.793 1.76 1.39 2.52-1.248-.567-2.33-1.445-3.14-2.55l-.01.03zm9.56 2.52c.597-.76 1.066-1.61 1.39-2.52h1.76c-.82 1.08-1.9 1.933-3.14 2.48l-.01.04z"})),kd=function(e){var t=e.itemProps,n=e.suggestion,r=e.isSelected,o=void 0!==r&&r,c=e.onClick,i=e.isURL,a=void 0!==i&&i,l=e.searchTerm,u=void 0===l?"":l;return Object(d.createElement)(j.Button,Object(s.a)({},t,{onClick:c,className:f()("block-editor-link-control__search-item",{"is-selected":o,"is-url":a,"is-entity":!a})}),a&&Object(d.createElement)(Qr.a,{className:"block-editor-link-control__search-item-icon",icon:jd}),Object(d.createElement)("span",{className:"block-editor-link-control__search-item-header"},Object(d.createElement)("span",{className:"block-editor-link-control__search-item-title"},Object(d.createElement)(j.TextHighlight,{text:n.title,highlight:u})),Object(d.createElement)("span",{"aria-hidden":!a,className:"block-editor-link-control__search-item-info"},!a&&(Object(sl.filterURLForDisplay)(Object(sl.safeDecodeURI)(n.url))||""),a&&Object(h.__)("Press ENTER to add this link"))),n.type&&Object(d.createElement)("span",{className:"block-editor-link-control__search-item-type"},n.type))};function yd(e){var t=e.instanceId,n=e.withCreateSuggestion,r=e.currentInputValue,o=e.handleSuggestionClick,c=e.suggestionsListProps,i=e.buildSuggestionItemProps,a=e.suggestions,l=e.selectedSuggestion,u=e.isLoading,b=e.isInitialSuggestions,p=f()("block-editor-link-control__search-results",{"is-loading":u}),m=["url","mailto","tel","internal"],v=1===a.length&&m.includes(a[0].type.toLowerCase()),O=n&&!v&&!b,g="block-editor-link-control-search-results-label-".concat(t),k=b?Object(h.__)("Recently updated"):Object(h.sprintf)(
|
67 |
/* translators: %s: search term. */
|
68 |
-
Object(h.__)('Search results for "%s"'),r),y=Object(d.createElement)(b?d.Fragment:j.VisuallyHidden,{},Object(d.createElement)("span",{className:"block-editor-link-control__search-results-label",id:g},k));return Object(d.createElement)("div",{className:"block-editor-link-control__search-results-wrapper"},y,Object(d.createElement)("div",Object(s.a)({},c,{className:p,"aria-labelledby":g}),a.map((function(e,t){return O&&"__CREATE__"===e.type?Object(d.createElement)(hd,{searchTerm:r,onClick:function(){return o(e)},key:e.type,itemProps:i(e,t),isSelected:t===l}):"__CREATE__"===e.type?null:Object(d.createElement)(kd,{key:"".concat(e.id,"-").concat(e.type),itemProps:i(e,t),suggestion:e,index:t,onClick:function(){o(e)},isSelected:t===l,isURL:m.includes(e.type.toLowerCase()),searchTerm:r})}))))}function _d(e){var t=Object(p.startsWith)(e,"#");return Object(sl.isURL)(e)||e&&e.includes("www.")||t}function Ed(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Cd(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ed(Object(n),!0).forEach((function(t){Object(u.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ed(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var wd=function(){return Promise.resolve([])},Sd=function(e){var t="URL",n=Object(sl.getProtocol)(e)||"";return n.includes("mailto")&&(t="mailto"),n.includes("tel")&&(t="tel"),Object(p.startsWith)(e,"#")&&(t="internal"),Promise.resolve([{id:e,title:e,url:"URL"===t?Object(sl.prependHTTP)(e):e,type:t}])},Id=function(){var e=Object(lr.a)(ar.a.mark((function e(t,n,r,o,c){var i,a;return ar.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([r(t,Cd({},n.isInitialSuggestions?{perPage:3}:{})),o(t)]);case 2:if(i=e.sent,a=!t.includes(" "),i=a&&!n.isInitialSuggestions?i[0].concat(i[1]):i[0],!n.isInitialSuggestions){e.next=7;break}return e.abrupt("return",i);case 7:return e.abrupt("return",_d(t)||!c?i:i.concat({title:t,url:t,type:"__CREATE__"}));case 8:case"end":return e.stop()}}),e)})));return function(t,n,r,o,c){return e.apply(this,arguments)}}();function xd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Bd(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?xd(Object(n),!0).forEach((function(t){Object(u.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xd(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Pd=Promise.resolve([]),Td=Object(d.forwardRef)((function(e,t){var n=e.value,r=e.children,o=e.currentLink,c=void 0===o?{}:o,i=e.className,a=void 0===i?null:i,l=e.placeholder,s=void 0===l?null:l,u=e.withCreateSuggestion,b=void 0!==u&&u,f=e.onCreateSuggestion,v=void 0===f?p.noop:f,g=e.onChange,j=void 0===g?p.noop:g,k=e.onSelect,y=void 0===k?p.noop:k,_=e.showSuggestions,E=void 0===_||_,C=e.renderSuggestions,w=void 0===C?function(e){return Object(d.createElement)(yd,e)}:C,S=e.fetchSuggestions,I=void 0===S?null:S,x=e.allowDirectEntry,B=void 0===x||x,P=e.showInitialSuggestions,T=void 0!==P&&P,N=function(e,t){var n=Object(O.useSelect)((function(e){return{fetchSearchSuggestions:(0,e("core/block-editor").getSettings)().__experimentalFetchLinkSuggestions}}),[]).fetchSearchSuggestions,r=e?Sd:wd;return Object(d.useCallback)((function(e,o){return _d(e)?r(e,o):Id(e,o,n,r,t)}),[r,n,t])}(B,b),R=E?I||N:Pd,D=Object(m.useInstanceId)(Td),M=Object(d.useState)(),A=Object(te.a)(M,2),L=A[0],F=A[1],V=function(){var e=Object(lr.a)(ar.a.mark((function e(t){var n,r;return ar.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t,"__CREATE__"!==t.type){e.next=12;break}return e.prev=2,e.next=5,v(t.title);case 5:n=e.sent,(null===(r=n)||void 0===r?void 0:r.url)&&y(n),e.next=11;break;case 9:e.prev=9,e.t0=e.catch(2);case 11:return e.abrupt("return");case 12:(B||n&&Object.keys(n).length>=1)&&y(Bd({},Object(p.omit)(c,"id","url"),{},n),n);case 13:case"end":return e.stop()}}),e,null,[[2,9]])})));return function(t){return e.apply(this,arguments)}}();return Object(d.createElement)("form",{onSubmit:function(e){e.preventDefault(),V(L||{url:n})}},Object(d.createElement)(gd,{className:a,value:n,onChange:function(e,t){j(e),F(t)},placeholder:null!=s?s:Object(h.__)("Search or type url"),__experimentalRenderSuggestions:E?function(e){return w(Bd({},e,{instanceId:D,withCreateSuggestion:b,currentInputValue:n,handleSuggestionClick:function(t){e.handleSuggestionClick&&e.handleSuggestionClick(t),V(t)}}))}:null,__experimentalFetchLinkSuggestions:R,__experimentalHandleURLSuggestions:!0,__experimentalShowInitialSuggestions:T,ref:t}),r)})),Nd=Td,Rd=Object(j.createSlotFill)("BlockEditorLinkControlViewer"),Dd=Rd.Slot,Md=Rd.Fill;function Ad(e){var t=e.value,n=e.onEditClick,r=t&&Object(sl.filterURLForDisplay)(Object(sl.safeDecodeURI)(t.url))||"";return Object(d.createElement)("div",{"aria-label":Object(h.__)("Currently selected"),"aria-selected":"true",className:f()("block-editor-link-control__search-item",{"is-current":!0})},Object(d.createElement)("span",{className:"block-editor-link-control__search-item-header"},Object(d.createElement)(j.ExternalLink,{className:"block-editor-link-control__search-item-title",href:t.url},t&&t.title||r),t&&t.title&&Object(d.createElement)("span",{className:"block-editor-link-control__search-item-info"},r)),Object(d.createElement)(j.Button,{isSecondary:!0,onClick:function(){return n()},className:"block-editor-link-control__search-item-action"},Object(h.__)("Edit")),Object(d.createElement)(Dd,{fillProps:t}))}var Ld=function(e){var t=!1;return{promise:new Promise((function(n,r){e.then((function(e){return t?r({isCanceled:!0}):n(e)}),(function(e){return r(t?{isCanceled:!0}:e)}))})),cancel:function(){t=!0}}};function Fd(e){var t=e.searchInputPlaceholder,n=e.value,r=e.settings,o=e.onChange,c=void 0===o?p.noop:o,i=e.noDirectEntry,a=void 0!==i&&i,l=e.showSuggestions,s=void 0===l||l,u=e.showInitialSuggestions,b=e.forceIsEditingLink,f=e.createSuggestion,m=e.withCreateSuggestion,v=e.inputValue,O=void 0===v?"":v;void 0===m&&f&&(m=!0);var g=Object(d.useRef)(),k=Object(d.useState)(n&&n.url||""),y=Object(te.a)(k,2),_=y[0],E=y[1],C=O||_,w=Object(d.useState)(void 0!==b?b:!n||!n.url),S=Object(te.a)(w,2),I=S[0],x=S[1],B=Object(d.useRef)(!1);Object(d.useEffect)((function(){void 0!==b&&b!==I&&x(b)}),[b]),Object(d.useEffect)((function(){B.current&&g.current&&!g.current.contains(document.activeElement)&&(dr.focus.focusable.find(g.current)[0]||g.current).focus();B.current=!1}),[I]);var P=function(e){var t=Object(d.useRef)(),n=Object(d.useState)(!1),r=Object(te.a)(n,2),o=r[0],c=r[1],i=Object(d.useState)(null),a=Object(te.a)(i,2),l=a[0],s=a[1],u=function(){var n=Object(lr.a)(ar.a.mark((function n(r){return ar.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return c(!0),s(null),n.prev=2,t.current=Ld(Promise.resolve(e(r))),n.next=6,t.current.promise;case 6:return n.abrupt("return",n.sent);case 9:if(n.prev=9,n.t0=n.catch(2),!n.t0||!n.t0.isCanceled){n.next=13;break}return n.abrupt("return");case 13:throw s(n.t0.message||Object(h.__)("An unknown error occurred during creation. Please try again.")),n.t0;case 15:return n.prev=15,c(!1),n.finish(15);case 18:case"end":return n.stop()}}),n,null,[[2,9,15,18]])})));return function(e){return n.apply(this,arguments)}}();return Object(d.useEffect)((function(){return function(){t.current&&t.current.cancel()}}),[]),{createPage:u,isCreatingPage:o,errorMessage:l}}(f),T=P.createPage,N=P.isCreatingPage,R=P.errorMessage;return Object(d.createElement)("div",{tabIndex:-1,ref:g,className:"block-editor-link-control"},N&&Object(d.createElement)("div",{className:"block-editor-link-control__loading"},Object(d.createElement)(j.Spinner,null)," ",Object(h.__)("Creating"),"…"),(I||!n)&&!N&&Object(d.createElement)(d.Fragment,null,Object(d.createElement)("div",{className:"block-editor-link-control__search-input-wrapper"},Object(d.createElement)(Nd,{currentLink:n,className:"block-editor-link-control__search-input",placeholder:t,value:C,withCreateSuggestion:m,onCreateSuggestion:T,onChange:E,onSelect:function(e){var t;c(e),B.current=!!(null===(t=g.current)||void 0===t?void 0:t.contains(document.activeElement)),x(!1)},showInitialSuggestions:u,allowDirectEntry:!a,showSuggestions:s},Object(d.createElement)("div",{className:"block-editor-link-control__search-actions"},Object(d.createElement)(j.Button,{type:"submit",label:Object(h.__)("Submit"),icon:sd.a,className:"block-editor-link-control__search-submit"})))),R&&Object(d.createElement)(j.Notice,{className:"block-editor-link-control__search-error",status:"error",isDismissible:!1},R)),n&&!I&&!N&&Object(d.createElement)(Ad,{value:n,onEditClick:function(){return x(!0)}}),Object(d.createElement)(bd,{value:n,settings:r,onChange:c}))}Fd.ViewerFill=Md;var Vd=Fd,Hd=Object(d.createElement)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},Object(d.createElement)(k.Path,{d:"M13 11V4c0-.55-.45-1-1-1h-1.67L9 1H5L3.67 3H2c-.55 0-1 .45-1 1v7c0 .55.45 1 1 1h10c.55 0 1-.45 1-1zM7 4.5c1.38 0 2.5 1.12 2.5 2.5S8.38 9.5 7 9.5 4.5 8.38 4.5 7 5.62 4.5 7 4.5zM14 6h5v10.5c0 1.38-1.12 2.5-2.5 2.5S14 17.88 14 16.5s1.12-2.5 2.5-2.5c.17 0 .34.02.5.05V9h-3V6zm-4 8.05V13h2v3.5c0 1.38-1.12 2.5-2.5 2.5S7 17.88 7 16.5 8.12 14 9.5 14c.17 0 .34.02.5.05z"})),zd=n(209),Ud=Object(j.withFilters)("editor.MediaUpload")((function(){return null}));var Gd=function(e){var t=e.fallback,n=void 0===t?null:t,r=e.children;return Object(O.useSelect)((function(e){return!!(0,e("core/block-editor").getSettings)().mediaUpload}),[])?r:n},Kd=Object(m.compose)([Object(O.withDispatch)((function(e){var t=e("core/notices");return{createNotice:t.createNotice,removeNotice:t.removeNotice}})),Object(j.withFilters)("editor.MediaReplaceFlow")])((function(e){var t=e.mediaURL,n=e.mediaId,r=e.allowedTypes,o=e.accept,c=e.onSelect,i=e.onSelectURL,a=e.onFilesUpload,l=void 0===a?p.noop:a,s=e.name,u=void 0===s?Object(h.__)("Replace"):s,b=e.createNotice,f=e.removeNotice,m=Object(d.useState)(t),v=Object(te.a)(m,2),g=v[0],k=v[1],y=Object(O.useSelect)((function(e){return e("core/block-editor").getSettings().mediaUpload}),[]),_=Object(d.createRef)(),E=Object(p.uniqueId)("block-editor/media-replace-flow/error-notice/"),C=function(e){var t=document.createElement("div");t.innerHTML=Object(d.renderToString)(e);var n=t.textContent||t.innerText||"";setTimeout((function(){b("error",n,{speak:!0,id:E,isDismissible:!0})}),1e3)},w=function(e){c(e),k(e.url),Object(Te.speak)(Object(h.__)("The media file has been replaced")),f(E)},S=function(e){e.keyCode===et.DOWN&&(e.preventDefault(),e.stopPropagation(),e.target.click())};return Object(d.createElement)(j.Dropdown,{popoverProps:{isAlternate:!0},contentClassName:"block-editor-media-replace-flow__options",renderToggle:function(e){var t=e.isOpen,n=e.onToggle;return Object(d.createElement)(j.ToolbarGroup,{className:"media-replace-flow"},Object(d.createElement)(j.ToolbarButton,{ref:_,"aria-expanded":t,onClick:n,onKeyDown:S},u))},renderContent:function(e){e.onClose;return Object(d.createElement)(d.Fragment,null,Object(d.createElement)(j.NavigableMenu,{className:"block-editor-media-replace-flow__media-upload-menu"},Object(d.createElement)(Ud,{value:n,onSelect:function(e){return w(e)},allowedTypes:r,render:function(e){var t=e.open;return Object(d.createElement)(j.MenuItem,{icon:Hd,onClick:t},Object(h.__)("Open Media Library"))}}),Object(d.createElement)(Gd,null,Object(d.createElement)(j.FormFileUpload,{onChange:function(e){!function(e){var t=e.target.files;l(t);y({allowedTypes:r,filesList:t,onFileChange:function(e){var t=Object(te.a)(e,1)[0];w(t)},onError:C})}(e)},accept:o,render:function(e){var t=e.openFileDialog;return Object(d.createElement)(j.MenuItem,{icon:zd.a,onClick:function(){t()}},Object(h.__)("Upload"))}}))),i&&Object(d.createElement)("form",{className:"block-editor-media-flow__url-input",onKeyDown:function(e){e.stopPropagation()},onKeyPress:function(e){e.stopPropagation()}},Object(d.createElement)("span",{className:"block-editor-media-replace-flow__image-url-label"},Object(h.__)("Current media URL:")),Object(d.createElement)(Vd,{value:{url:g},settings:[],showSuggestions:!1,onChange:function(e){var t=e.url;k(t),i(t),_.current.focus()}})))}})})),Wd=n(210);function qd(e){var t=e.url,n=e.urlLabel,r=e.className,o=f()(r,"block-editor-url-popover__link-viewer-url");return t?Object(d.createElement)(j.ExternalLink,{className:o,href:t},n||Object(sl.filterURLForDisplay)(Object(sl.safeDecodeURI)(t))):Object(d.createElement)("span",{className:o})}function $d(e){var t=e.additionalControls,n=e.children,r=e.renderSettings,o=e.position,c=void 0===o?"bottom center":o,i=e.focusOnMount,a=void 0===i?"firstElement":i,l=Object(pe.a)(e,["additionalControls","children","renderSettings","position","focusOnMount"]),u=Object(d.useState)(!1),b=Object(te.a)(u,2),f=b[0],p=b[1],m=!!r&&f;return Object(d.createElement)(j.Popover,Object(s.a)({className:"block-editor-url-popover",focusOnMount:a,position:c},l),Object(d.createElement)("div",{className:"block-editor-url-popover__input-container"},Object(d.createElement)("div",{className:"block-editor-url-popover__row"},n,!!r&&Object(d.createElement)(j.Button,{className:"block-editor-url-popover__settings-toggle",icon:jr.a,label:Object(h.__)("Link settings"),onClick:function(){p(!f)},"aria-expanded":f})),m&&Object(d.createElement)("div",{className:"block-editor-url-popover__row block-editor-url-popover__settings"},r())),t&&!m&&Object(d.createElement)("div",{className:"block-editor-url-popover__additional-controls"},t))}$d.LinkEditor=function(e){var t=e.autocompleteRef,n=e.className,r=e.onChangeInputValue,o=e.value,c=Object(pe.a)(e,["autocompleteRef","className","onChangeInputValue","value"]);return Object(d.createElement)("form",Object(s.a)({className:f()("block-editor-url-popover__link-editor",n)},c),Object(d.createElement)(gd,{value:o,onChange:r,autocompleteRef:t}),Object(d.createElement)(j.Button,{icon:sd.a,label:Object(h.__)("Apply"),type:"submit"}))},$d.LinkViewer=function(e){var t=e.className,n=e.linkClassName,r=e.onEditLinkClick,o=e.url,c=e.urlLabel,i=Object(pe.a)(e,["className","linkClassName","onEditLinkClick","url","urlLabel"]);return Object(d.createElement)("div",Object(s.a)({className:f()("block-editor-url-popover__link-viewer",t)},i),Object(d.createElement)(qd,{url:o,urlLabel:c,className:n}),r&&Object(d.createElement)(j.Button,{icon:Wd.a,label:Object(h.__)("Edit"),onClick:r}))};var Yd=$d,Xd=function(e){var t=e.src,n=e.onChange,r=e.onSubmit,o=e.onClose;return Object(d.createElement)(Yd,{onClose:o},Object(d.createElement)("form",{className:"block-editor-media-placeholder__url-input-form",onSubmit:r},Object(d.createElement)("input",{className:"block-editor-media-placeholder__url-input-field",type:"url","aria-label":Object(h.__)("URL"),placeholder:Object(h.__)("Paste or type URL"),onChange:n,value:t}),Object(d.createElement)(j.Button,{className:"block-editor-media-placeholder__url-input-submit-button",icon:sd.a,label:Object(h.__)("Apply"),type:"submit"})))};var Qd=Object(j.withFilters)("editor.MediaPlaceholder")((function(e){var t=e.value,n=void 0===t?{}:t,r=e.allowedTypes,o=void 0===r?[]:r,c=e.className,i=e.icon,a=e.labels,l=void 0===a?{}:a,s=e.mediaPreview,u=e.notices,b=e.isAppender,m=e.accept,v=e.addToGallery,g=e.multiple,k=void 0!==g&&g,y=e.dropZoneUIOnly,_=e.disableDropZone,E=e.disableMediaButtons,C=e.onError,w=e.onSelect,S=e.onCancel,I=e.onSelectURL,x=e.onDoubleClick,B=e.onFilesPreUpload,P=void 0===B?p.noop:B,T=e.onHTMLDrop,N=void 0===T?p.noop:T,R=e.children,D=Object(O.useSelect)((function(e){return(0,e("core/block-editor").getSettings)().mediaUpload}),[]),M=Object(d.useState)(""),A=Object(te.a)(M,2),L=A[0],F=A[1],V=Object(d.useState)(!1),H=Object(te.a)(V,2),z=H[0],U=H[1];Object(d.useEffect)((function(){var e;F(null!==(e=null==n?void 0:n.src)&&void 0!==e?e:"")}),[n]);var G=function(e){F(e.target.value)},K=function(){U(!0)},W=function(){U(!1)},q=function(e){e.preventDefault(),L&&I&&(I(L),W())},$=function(e){var t;if(P(e),k)if(v){var r=[];t=function(e){var t=(null!=n?n:[]).filter((function(e){return e.id?!r.some((function(t){var n=t.id;return Number(n)===Number(e.id)})):!r.some((function(t){var n=t.urlSlug;return e.url.includes(n)}))}));w(t.concat(e)),r=e.map((function(e){var t=e.url.lastIndexOf("."),n=e.url.slice(0,t);return{id:e.id,urlSlug:n}}))}}else t=w;else t=function(e){var t=Object(te.a)(e,1)[0];return w(t)};D({allowedTypes:o,filesList:e,onFileChange:t,onError:C})},Y=function(e){$(e.target.files)},X=function(e,t){var n=l.instructions,r=l.title;if(D||I||(n=Object(h.__)("To edit this block, you need permission to upload media.")),void 0===n||void 0===r){var a=Object(te.a)(o,1)[0],p=1===o.length,m=p&&"audio"===a,v=p&&"image"===a,O=p&&"video"===a;void 0===n&&D&&(n=Object(h.__)("Upload a media file or pick one from your media library."),m?n=Object(h.__)("Upload an audio file, pick one from your media library, or add one with a URL."):v?n=Object(h.__)("Upload an image file, pick one from your media library, or add one with a URL."):O&&(n=Object(h.__)("Upload a video file, pick one from your media library, or add one with a URL."))),void 0===r&&(r=Object(h.__)("Media"),m?r=Object(h.__)("Audio"):v?r=Object(h.__)("Image"):O&&(r=Object(h.__)("Video")))}var g=f()("block-editor-media-placeholder",c,{"is-appender":b});return Object(d.createElement)(j.Placeholder,{icon:i,label:r,instructions:n,className:g,notices:u,onClick:t,onDoubleClick:x,preview:s},e,R)},Q=function(){return _?null:Object(d.createElement)(j.DropZone,{onFilesDrop:$,onHTMLDrop:N})},Z=function(){return S&&Object(d.createElement)(j.Button,{className:"block-editor-media-placeholder__cancel-button",title:Object(h.__)("Cancel"),isLink:!0,onClick:S},Object(h.__)("Cancel"))},J=function(){return I&&Object(d.createElement)("div",{className:"block-editor-media-placeholder__url-input-container"},Object(d.createElement)(j.Button,{className:"block-editor-media-placeholder__button",onClick:K,isPressed:z,isTertiary:!0},Object(h.__)("Insert from URL")),z&&Object(d.createElement)(Xd,{src:L,onChange:G,onSubmit:q,onClose:W}))};return y||E?(y&&hu()("wp.blockEditor.MediaPlaceholder dropZoneUIOnly prop",{alternative:"disableMediaButtons"}),Object(d.createElement)(Gd,null,Q())):Object(d.createElement)(Gd,{fallback:X(J())},function(){var e=Object(d.createElement)(Ud,{addToGallery:v,gallery:k&&o.every((function(e){return"image"===e||e.startsWith("image/")})),multiple:k,onSelect:w,allowedTypes:o,value:Array.isArray(n)?n.map((function(e){return e.id})):n.id,render:function(e){var t=e.open;return Object(d.createElement)(j.Button,{isTertiary:!0,onClick:function(e){e.stopPropagation(),t()}},Object(h.__)("Media Library"))}});if(D&&b)return Object(d.createElement)(d.Fragment,null,Q(),Object(d.createElement)(j.FormFileUpload,{onChange:Y,accept:m,multiple:k,render:function(t){var n=t.openFileDialog,r=Object(d.createElement)(d.Fragment,null,Object(d.createElement)(j.Button,{isPrimary:!0,className:f()("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button")},Object(h.__)("Upload")),e,J(),Z());return X(r,n)}}));if(D){var t=Object(d.createElement)(d.Fragment,null,Q(),Object(d.createElement)(j.FormFileUpload,{isPrimary:!0,className:f()("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button"),onChange:Y,accept:m,multiple:k},Object(h.__)("Upload")),e,J(),Z());return X(t)}return X(e)}())})),Zd=Object(d.forwardRef)((function(e,t){return Object(d.createElement)(Tu,Object(s.a)({ref:t},e,{__unstableDisableFormats:!0,preserveWhiteSpace:!0}))}));Zd.Content=function(e){var t=e.value,n=void 0===t?"":t,r=e.tagName,o=void 0===r?"div":r,c=Object(pe.a)(e,["value","tagName"]);return Object(d.createElement)(o,c,n)};var Jd=Zd,eb=Object(d.forwardRef)((function(e,t){var n=e.__experimentalVersion,r=Object(pe.a)(e,["__experimentalVersion"]);if(2===n)return Object(d.createElement)(Jd,Object(s.a)({ref:t},r));var o=r.className,c=r.onChange,i=Object(pe.a)(r,["className","onChange"]);return Object(d.createElement)(zr.a,Object(s.a)({ref:t,className:f()("block-editor-plain-text",o),onChange:function(e){return c(e.target.value)}},i))}));function tb(e){var t=e.property,n=e.viewport,r=e.desc,o=Object(m.useInstanceId)(tb),c=r||Object(h.sprintf)(
|
69 |
/* translators: 1: property name. 2: viewport name. */
|
70 |
Object(h._x)("Controls the %1$s property for %2$s viewports.","Text labelling a interface as controlling a given layout property (eg: margin) for a given screen size."),t,n.label);return Object(d.createElement)(d.Fragment,null,Object(d.createElement)("span",{"aria-describedby":"rbc-desc-".concat(o)},n.label),Object(d.createElement)(j.VisuallyHidden,{as:"span",id:"rbc-desc-".concat(o)},c))}var nb=function(e){var t=e.title,n=e.property,r=e.toggleLabel,o=e.onIsResponsiveChange,c=e.renderDefaultControl,i=e.renderResponsiveControls,a=e.isResponsive,l=void 0!==a&&a,s=e.defaultLabel,u=void 0===s?{id:"all",
|
71 |
/* translators: 'Label. Used to signify a layout property (eg: margin, padding) will apply uniformly to all screensizes.' */
|
65 |
/* translators: %s: search term. */
|
66 |
Object(h.__)("New page: <mark>%s</mark>"),t),{mark:Object(d.createElement)("mark",null)})))):null},jd=Object(d.createElement)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},Object(d.createElement)(k.Path,{d:"M9 0C4.03 0 0 4.03 0 9s4.03 9 9 9 9-4.03 9-9-4.03-9-9-9zM1.11 9.68h2.51c.04.91.167 1.814.38 2.7H1.84c-.403-.85-.65-1.764-.73-2.7zm8.57-5.4V1.19c.964.366 1.756 1.08 2.22 2 .205.347.386.708.54 1.08l-2.76.01zm3.22 1.35c.232.883.37 1.788.41 2.7H9.68v-2.7h3.22zM8.32 1.19v3.09H5.56c.154-.372.335-.733.54-1.08.462-.924 1.255-1.64 2.22-2.01zm0 4.44v2.7H4.7c.04-.912.178-1.817.41-2.7h3.21zm-4.7 2.69H1.11c.08-.936.327-1.85.73-2.7H4c-.213.886-.34 1.79-.38 2.7zM4.7 9.68h3.62v2.7H5.11c-.232-.883-.37-1.788-.41-2.7zm3.63 4v3.09c-.964-.366-1.756-1.08-2.22-2-.205-.347-.386-.708-.54-1.08l2.76-.01zm1.35 3.09v-3.04h2.76c-.154.372-.335.733-.54 1.08-.464.92-1.256 1.634-2.22 2v-.04zm0-4.44v-2.7h3.62c-.04.912-.178 1.817-.41 2.7H9.68zm4.71-2.7h2.51c-.08.936-.327 1.85-.73 2.7H14c.21-.87.337-1.757.38-2.65l.01-.05zm0-1.35c-.046-.894-.176-1.78-.39-2.65h2.16c.403.85.65 1.764.73 2.7l-2.5-.05zm1-4H13.6c-.324-.91-.793-1.76-1.39-2.52 1.244.56 2.325 1.426 3.14 2.52h.04zm-9.6-2.52c-.597.76-1.066 1.61-1.39 2.52H2.65c.815-1.094 1.896-1.96 3.14-2.52zm-3.15 12H4.4c.324.91.793 1.76 1.39 2.52-1.248-.567-2.33-1.445-3.14-2.55l-.01.03zm9.56 2.52c.597-.76 1.066-1.61 1.39-2.52h1.76c-.82 1.08-1.9 1.933-3.14 2.48l-.01.04z"})),kd=function(e){var t=e.itemProps,n=e.suggestion,r=e.isSelected,o=void 0!==r&&r,c=e.onClick,i=e.isURL,a=void 0!==i&&i,l=e.searchTerm,u=void 0===l?"":l;return Object(d.createElement)(j.Button,Object(s.a)({},t,{onClick:c,className:f()("block-editor-link-control__search-item",{"is-selected":o,"is-url":a,"is-entity":!a})}),a&&Object(d.createElement)(Qr.a,{className:"block-editor-link-control__search-item-icon",icon:jd}),Object(d.createElement)("span",{className:"block-editor-link-control__search-item-header"},Object(d.createElement)("span",{className:"block-editor-link-control__search-item-title"},Object(d.createElement)(j.TextHighlight,{text:n.title,highlight:u})),Object(d.createElement)("span",{"aria-hidden":!a,className:"block-editor-link-control__search-item-info"},!a&&(Object(sl.filterURLForDisplay)(Object(sl.safeDecodeURI)(n.url))||""),a&&Object(h.__)("Press ENTER to add this link"))),n.type&&Object(d.createElement)("span",{className:"block-editor-link-control__search-item-type"},n.type))};function yd(e){var t=e.instanceId,n=e.withCreateSuggestion,r=e.currentInputValue,o=e.handleSuggestionClick,c=e.suggestionsListProps,i=e.buildSuggestionItemProps,a=e.suggestions,l=e.selectedSuggestion,u=e.isLoading,b=e.isInitialSuggestions,p=f()("block-editor-link-control__search-results",{"is-loading":u}),m=["url","mailto","tel","internal"],v=1===a.length&&m.includes(a[0].type.toLowerCase()),O=n&&!v&&!b,g="block-editor-link-control-search-results-label-".concat(t),k=b?Object(h.__)("Recently updated"):Object(h.sprintf)(
|
67 |
/* translators: %s: search term. */
|
68 |
+
Object(h.__)('Search results for "%s"'),r),y=Object(d.createElement)(b?d.Fragment:j.VisuallyHidden,{},Object(d.createElement)("span",{className:"block-editor-link-control__search-results-label",id:g},k));return Object(d.createElement)("div",{className:"block-editor-link-control__search-results-wrapper"},y,Object(d.createElement)("div",Object(s.a)({},c,{className:p,"aria-labelledby":g}),a.map((function(e,t){return O&&"__CREATE__"===e.type?Object(d.createElement)(hd,{searchTerm:r,onClick:function(){return o(e)},key:e.type,itemProps:i(e,t),isSelected:t===l}):"__CREATE__"===e.type?null:Object(d.createElement)(kd,{key:"".concat(e.id,"-").concat(e.type),itemProps:i(e,t),suggestion:e,index:t,onClick:function(){o(e)},isSelected:t===l,isURL:m.includes(e.type.toLowerCase()),searchTerm:r})}))))}function _d(e){var t=Object(p.startsWith)(e,"#");return Object(sl.isURL)(e)||e&&e.includes("www.")||t}function Ed(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Cd(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ed(Object(n),!0).forEach((function(t){Object(u.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ed(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var wd=function(){return Promise.resolve([])},Sd=function(e){var t="URL",n=Object(sl.getProtocol)(e)||"";return n.includes("mailto")&&(t="mailto"),n.includes("tel")&&(t="tel"),Object(p.startsWith)(e,"#")&&(t="internal"),Promise.resolve([{id:e,title:e,url:"URL"===t?Object(sl.prependHTTP)(e):e,type:t}])},Id=function(){var e=Object(lr.a)(ar.a.mark((function e(t,n,r,o,c){var i,a;return ar.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([r(t,Cd({},n.isInitialSuggestions?{perPage:3}:{})),o(t)]);case 2:if(i=e.sent,a=!t.includes(" "),i=a&&!n.isInitialSuggestions?i[0].concat(i[1]):i[0],!n.isInitialSuggestions){e.next=7;break}return e.abrupt("return",i);case 7:return e.abrupt("return",_d(t)||!c?i:i.concat({title:t,url:t,type:"__CREATE__"}));case 8:case"end":return e.stop()}}),e)})));return function(t,n,r,o,c){return e.apply(this,arguments)}}();function xd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Bd(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?xd(Object(n),!0).forEach((function(t){Object(u.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xd(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Pd=Promise.resolve([]),Td=Object(d.forwardRef)((function(e,t){var n=e.value,r=e.children,o=e.currentLink,c=void 0===o?{}:o,i=e.className,a=void 0===i?null:i,l=e.placeholder,s=void 0===l?null:l,u=e.withCreateSuggestion,b=void 0!==u&&u,f=e.onCreateSuggestion,v=void 0===f?p.noop:f,g=e.onChange,j=void 0===g?p.noop:g,k=e.onSelect,y=void 0===k?p.noop:k,_=e.showSuggestions,E=void 0===_||_,C=e.renderSuggestions,w=void 0===C?function(e){return Object(d.createElement)(yd,e)}:C,S=e.fetchSuggestions,I=void 0===S?null:S,x=e.allowDirectEntry,B=void 0===x||x,P=e.showInitialSuggestions,T=void 0!==P&&P,N=function(e,t){var n=Object(O.useSelect)((function(e){return{fetchSearchSuggestions:(0,e("core/block-editor").getSettings)().__experimentalFetchLinkSuggestions}}),[]).fetchSearchSuggestions,r=e?Sd:wd;return Object(d.useCallback)((function(e,o){return _d(e)?r(e,o):Id(e,o,n,r,t)}),[r,n,t])}(B,b),R=E?I||N:Pd,D=Object(m.useInstanceId)(Td),M=Object(d.useState)(),A=Object(te.a)(M,2),L=A[0],F=A[1],V=function(){var e=Object(lr.a)(ar.a.mark((function e(t){var n,r;return ar.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t,"__CREATE__"!==t.type){e.next=12;break}return e.prev=2,e.next=5,v(t.title);case 5:n=e.sent,(null===(r=n)||void 0===r?void 0:r.url)&&y(n),e.next=11;break;case 9:e.prev=9,e.t0=e.catch(2);case 11:return e.abrupt("return");case 12:(B||n&&Object.keys(n).length>=1)&&y(Bd({},Object(p.omit)(c,"id","url"),{},n),n);case 13:case"end":return e.stop()}}),e,null,[[2,9]])})));return function(t){return e.apply(this,arguments)}}();return Object(d.createElement)("form",{onSubmit:function(e){e.preventDefault(),V(L||{url:n})}},Object(d.createElement)(gd,{className:a,value:n,onChange:function(e,t){j(e),F(t)},placeholder:null!=s?s:Object(h.__)("Search or type url"),__experimentalRenderSuggestions:E?function(e){return w(Bd({},e,{instanceId:D,withCreateSuggestion:b,currentInputValue:n,handleSuggestionClick:function(t){e.handleSuggestionClick&&e.handleSuggestionClick(t),V(t)}}))}:null,__experimentalFetchLinkSuggestions:R,__experimentalHandleURLSuggestions:!0,__experimentalShowInitialSuggestions:T,ref:t}),r)})),Nd=Td,Rd=Object(j.createSlotFill)("BlockEditorLinkControlViewer"),Dd=Rd.Slot,Md=Rd.Fill;function Ad(e){var t=e.value,n=e.onEditClick,r=t&&Object(sl.filterURLForDisplay)(Object(sl.safeDecodeURI)(t.url))||"";return Object(d.createElement)("div",{"aria-label":Object(h.__)("Currently selected"),"aria-selected":"true",className:f()("block-editor-link-control__search-item",{"is-current":!0})},Object(d.createElement)("span",{className:"block-editor-link-control__search-item-header"},Object(d.createElement)(j.ExternalLink,{className:"block-editor-link-control__search-item-title",href:t.url},t&&t.title||r),t&&t.title&&Object(d.createElement)("span",{className:"block-editor-link-control__search-item-info"},r)),Object(d.createElement)(j.Button,{isSecondary:!0,onClick:function(){return n()},className:"block-editor-link-control__search-item-action"},Object(h.__)("Edit")),Object(d.createElement)(Dd,{fillProps:t}))}var Ld=function(e){var t=!1;return{promise:new Promise((function(n,r){e.then((function(e){return t?r({isCanceled:!0}):n(e)}),(function(e){return r(t?{isCanceled:!0}:e)}))})),cancel:function(){t=!0}}};function Fd(e){var t=e.searchInputPlaceholder,n=e.value,r=e.settings,o=e.onChange,c=void 0===o?p.noop:o,i=e.noDirectEntry,a=void 0!==i&&i,l=e.showSuggestions,s=void 0===l||l,u=e.showInitialSuggestions,b=e.forceIsEditingLink,f=e.createSuggestion,m=e.withCreateSuggestion,v=e.inputValue,O=void 0===v?"":v;void 0===m&&f&&(m=!0);var g=Object(d.useRef)(),k=Object(d.useState)(n&&n.url||""),y=Object(te.a)(k,2),_=y[0],E=y[1],C=O||_,w=Object(d.useState)(void 0!==b?b:!n||!n.url),S=Object(te.a)(w,2),I=S[0],x=S[1],B=Object(d.useRef)(!1);Object(d.useEffect)((function(){void 0!==b&&b!==I&&x(b)}),[b]),Object(d.useEffect)((function(){B.current&&g.current&&!g.current.contains(document.activeElement)&&(dr.focus.focusable.find(g.current)[0]||g.current).focus();B.current=!1}),[I]);var P=function(e){var t=Object(d.useRef)(),n=Object(d.useState)(!1),r=Object(te.a)(n,2),o=r[0],c=r[1],i=Object(d.useState)(null),a=Object(te.a)(i,2),l=a[0],s=a[1],u=function(){var n=Object(lr.a)(ar.a.mark((function n(r){return ar.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return c(!0),s(null),n.prev=2,t.current=Ld(Promise.resolve(e(r))),n.next=6,t.current.promise;case 6:return n.abrupt("return",n.sent);case 9:if(n.prev=9,n.t0=n.catch(2),!n.t0||!n.t0.isCanceled){n.next=13;break}return n.abrupt("return");case 13:throw s(n.t0.message||Object(h.__)("An unknown error occurred during creation. Please try again.")),n.t0;case 15:return n.prev=15,c(!1),n.finish(15);case 18:case"end":return n.stop()}}),n,null,[[2,9,15,18]])})));return function(e){return n.apply(this,arguments)}}();return Object(d.useEffect)((function(){return function(){t.current&&t.current.cancel()}}),[]),{createPage:u,isCreatingPage:o,errorMessage:l}}(f),T=P.createPage,N=P.isCreatingPage,R=P.errorMessage;return Object(d.createElement)("div",{tabIndex:-1,ref:g,className:"block-editor-link-control"},N&&Object(d.createElement)("div",{className:"block-editor-link-control__loading"},Object(d.createElement)(j.Spinner,null)," ",Object(h.__)("Creating"),"…"),(I||!n)&&!N&&Object(d.createElement)(d.Fragment,null,Object(d.createElement)("div",{className:"block-editor-link-control__search-input-wrapper"},Object(d.createElement)(Nd,{currentLink:n,className:"block-editor-link-control__search-input",placeholder:t,value:C,withCreateSuggestion:m,onCreateSuggestion:T,onChange:E,onSelect:function(e){var t;c(e),B.current=!!(null===(t=g.current)||void 0===t?void 0:t.contains(document.activeElement)),x(!1)},showInitialSuggestions:u,allowDirectEntry:!a,showSuggestions:s},Object(d.createElement)("div",{className:"block-editor-link-control__search-actions"},Object(d.createElement)(j.Button,{type:"submit",label:Object(h.__)("Submit"),icon:sd.a,className:"block-editor-link-control__search-submit"})))),R&&Object(d.createElement)(j.Notice,{className:"block-editor-link-control__search-error",status:"error",isDismissible:!1},R)),n&&!I&&!N&&Object(d.createElement)(Ad,{value:n,onEditClick:function(){return x(!0)}}),Object(d.createElement)(bd,{value:n,settings:r,onChange:c}))}Fd.ViewerFill=Md;var Vd=Fd,Hd=Object(d.createElement)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},Object(d.createElement)(k.Path,{d:"M13 11V4c0-.55-.45-1-1-1h-1.67L9 1H5L3.67 3H2c-.55 0-1 .45-1 1v7c0 .55.45 1 1 1h10c.55 0 1-.45 1-1zM7 4.5c1.38 0 2.5 1.12 2.5 2.5S8.38 9.5 7 9.5 4.5 8.38 4.5 7 5.62 4.5 7 4.5zM14 6h5v10.5c0 1.38-1.12 2.5-2.5 2.5S14 17.88 14 16.5s1.12-2.5 2.5-2.5c.17 0 .34.02.5.05V9h-3V6zm-4 8.05V13h2v3.5c0 1.38-1.12 2.5-2.5 2.5S7 17.88 7 16.5 8.12 14 9.5 14c.17 0 .34.02.5.05z"})),zd=n(209),Ud=Object(j.withFilters)("editor.MediaUpload")((function(){return null}));var Gd=function(e){var t=e.fallback,n=void 0===t?null:t,r=e.children;return Object(O.useSelect)((function(e){return!!(0,e("core/block-editor").getSettings)().mediaUpload}),[])?r:n},Kd=Object(m.compose)([Object(O.withDispatch)((function(e){var t=e("core/notices");return{createNotice:t.createNotice,removeNotice:t.removeNotice}})),Object(j.withFilters)("editor.MediaReplaceFlow")])((function(e){var t=e.mediaURL,n=e.mediaId,r=e.allowedTypes,o=e.accept,c=e.onSelect,i=e.onSelectURL,a=e.onFilesUpload,l=void 0===a?p.noop:a,s=e.name,u=void 0===s?Object(h.__)("Replace"):s,b=e.createNotice,f=e.removeNotice,m=Object(d.useState)(t),v=Object(te.a)(m,2),g=v[0],k=v[1],y=Object(O.useSelect)((function(e){return e("core/block-editor").getSettings().mediaUpload}),[]),_=Object(d.createRef)(),E=Object(p.uniqueId)("block-editor/media-replace-flow/error-notice/"),C=function(e){var t=document.createElement("div");t.innerHTML=Object(d.renderToString)(e);var n=t.textContent||t.innerText||"";setTimeout((function(){b("error",n,{speak:!0,id:E,isDismissible:!0})}),1e3)},w=function(e){c(e),k(e.url),Object(Te.speak)(Object(h.__)("The media file has been replaced")),f(E)},S=function(e){e.keyCode===et.DOWN&&(e.preventDefault(),e.stopPropagation(),e.target.click())};return Object(d.createElement)(j.Dropdown,{popoverProps:{isAlternate:!0},contentClassName:"block-editor-media-replace-flow__options",renderToggle:function(e){var t=e.isOpen,n=e.onToggle;return Object(d.createElement)(j.ToolbarGroup,{className:"media-replace-flow"},Object(d.createElement)(j.ToolbarButton,{ref:_,"aria-expanded":t,onClick:n,onKeyDown:S},u))},renderContent:function(e){e.onClose;return Object(d.createElement)(d.Fragment,null,Object(d.createElement)(j.NavigableMenu,{className:"block-editor-media-replace-flow__media-upload-menu"},Object(d.createElement)(Ud,{value:n,onSelect:function(e){return w(e)},allowedTypes:r,render:function(e){var t=e.open;return Object(d.createElement)(j.MenuItem,{icon:Hd,onClick:t},Object(h.__)("Open Media Library"))}}),Object(d.createElement)(Gd,null,Object(d.createElement)(j.FormFileUpload,{onChange:function(e){!function(e){var t=e.target.files;l(t);y({allowedTypes:r,filesList:t,onFileChange:function(e){var t=Object(te.a)(e,1)[0];w(t)},onError:C})}(e)},accept:o,render:function(e){var t=e.openFileDialog;return Object(d.createElement)(j.MenuItem,{icon:zd.a,onClick:function(){t()}},Object(h.__)("Upload"))}}))),i&&Object(d.createElement)("form",{className:"block-editor-media-flow__url-input",onKeyDown:function(e){e.stopPropagation()},onKeyPress:function(e){e.stopPropagation()}},Object(d.createElement)("span",{className:"block-editor-media-replace-flow__image-url-label"},Object(h.__)("Current media URL:")),Object(d.createElement)(Vd,{value:{url:g},settings:[],showSuggestions:!1,onChange:function(e){var t=e.url;k(t),i(t),_.current.focus()}})))}})})),Wd=n(210);function qd(e){var t=e.url,n=e.urlLabel,r=e.className,o=f()(r,"block-editor-url-popover__link-viewer-url");return t?Object(d.createElement)(j.ExternalLink,{className:o,href:t},n||Object(sl.filterURLForDisplay)(Object(sl.safeDecodeURI)(t))):Object(d.createElement)("span",{className:o})}function $d(e){var t=e.additionalControls,n=e.children,r=e.renderSettings,o=e.position,c=void 0===o?"bottom center":o,i=e.focusOnMount,a=void 0===i?"firstElement":i,l=Object(pe.a)(e,["additionalControls","children","renderSettings","position","focusOnMount"]),u=Object(d.useState)(!1),b=Object(te.a)(u,2),f=b[0],p=b[1],m=!!r&&f;return Object(d.createElement)(j.Popover,Object(s.a)({className:"block-editor-url-popover",focusOnMount:a,position:c},l),Object(d.createElement)("div",{className:"block-editor-url-popover__input-container"},Object(d.createElement)("div",{className:"block-editor-url-popover__row"},n,!!r&&Object(d.createElement)(j.Button,{className:"block-editor-url-popover__settings-toggle",icon:jr.a,label:Object(h.__)("Link settings"),onClick:function(){p(!f)},"aria-expanded":f})),m&&Object(d.createElement)("div",{className:"block-editor-url-popover__row block-editor-url-popover__settings"},r())),t&&!m&&Object(d.createElement)("div",{className:"block-editor-url-popover__additional-controls"},t))}$d.LinkEditor=function(e){var t=e.autocompleteRef,n=e.className,r=e.onChangeInputValue,o=e.value,c=Object(pe.a)(e,["autocompleteRef","className","onChangeInputValue","value"]);return Object(d.createElement)("form",Object(s.a)({className:f()("block-editor-url-popover__link-editor",n)},c),Object(d.createElement)(gd,{value:o,onChange:r,autocompleteRef:t}),Object(d.createElement)(j.Button,{icon:sd.a,label:Object(h.__)("Apply"),type:"submit"}))},$d.LinkViewer=function(e){var t=e.className,n=e.linkClassName,r=e.onEditLinkClick,o=e.url,c=e.urlLabel,i=Object(pe.a)(e,["className","linkClassName","onEditLinkClick","url","urlLabel"]);return Object(d.createElement)("div",Object(s.a)({className:f()("block-editor-url-popover__link-viewer",t)},i),Object(d.createElement)(qd,{url:o,urlLabel:c,className:n}),r&&Object(d.createElement)(j.Button,{icon:Wd.a,label:Object(h.__)("Edit"),onClick:r}))};var Yd=$d,Xd=function(e){var t=e.src,n=e.onChange,r=e.onSubmit,o=e.onClose;return Object(d.createElement)(Yd,{onClose:o},Object(d.createElement)("form",{className:"block-editor-media-placeholder__url-input-form",onSubmit:r},Object(d.createElement)("input",{className:"block-editor-media-placeholder__url-input-field",type:"url","aria-label":Object(h.__)("URL"),placeholder:Object(h.__)("Paste or type URL"),onChange:n,value:t}),Object(d.createElement)(j.Button,{className:"block-editor-media-placeholder__url-input-submit-button",icon:sd.a,label:Object(h.__)("Apply"),type:"submit"})))};var Qd=Object(j.withFilters)("editor.MediaPlaceholder")((function(e){var t=e.value,n=void 0===t?{}:t,r=e.allowedTypes,o=e.className,c=e.icon,i=e.labels,a=void 0===i?{}:i,l=e.mediaPreview,s=e.notices,u=e.isAppender,b=e.accept,m=e.addToGallery,v=e.multiple,g=void 0!==v&&v,k=e.dropZoneUIOnly,y=e.disableDropZone,_=e.disableMediaButtons,E=e.onError,C=e.onSelect,w=e.onCancel,S=e.onSelectURL,I=e.onDoubleClick,x=e.onFilesPreUpload,B=void 0===x?p.noop:x,P=e.onHTMLDrop,T=void 0===P?p.noop:P,N=e.children,R=Object(O.useSelect)((function(e){return(0,e("core/block-editor").getSettings)().mediaUpload}),[]),D=Object(d.useState)(""),M=Object(te.a)(D,2),A=M[0],L=M[1],F=Object(d.useState)(!1),V=Object(te.a)(F,2),H=V[0],z=V[1];Object(d.useEffect)((function(){var e;L(null!==(e=null==n?void 0:n.src)&&void 0!==e?e:"")}),[n]);var U=function(e){L(e.target.value)},G=function(){z(!0)},K=function(){z(!1)},W=function(e){e.preventDefault(),A&&S&&(S(A),K())},q=function(e){var t;if(B(e),g)if(m){var o=[];t=function(e){var t=(null!=n?n:[]).filter((function(e){return e.id?!o.some((function(t){var n=t.id;return Number(n)===Number(e.id)})):!o.some((function(t){var n=t.urlSlug;return e.url.includes(n)}))}));C(t.concat(e)),o=e.map((function(e){var t=e.url.lastIndexOf("."),n=e.url.slice(0,t);return{id:e.id,urlSlug:n}}))}}else t=C;else t=function(e){var t=Object(te.a)(e,1)[0];return C(t)};R({allowedTypes:r,filesList:e,onFileChange:t,onError:E})},$=function(e){q(e.target.files)},Y=function(e,t){var n=a.instructions,i=a.title;if(R||S||(n=Object(h.__)("To edit this block, you need permission to upload media.")),void 0===n||void 0===i){var b=null!=r?r:[],p=Object(te.a)(b,1)[0],m=1===b.length,v=m&&"audio"===p,O=m&&"image"===p,g=m&&"video"===p;void 0===n&&R&&(n=Object(h.__)("Upload a media file or pick one from your media library."),v?n=Object(h.__)("Upload an audio file, pick one from your media library, or add one with a URL."):O?n=Object(h.__)("Upload an image file, pick one from your media library, or add one with a URL."):g&&(n=Object(h.__)("Upload a video file, pick one from your media library, or add one with a URL."))),void 0===i&&(i=Object(h.__)("Media"),v?i=Object(h.__)("Audio"):O?i=Object(h.__)("Image"):g&&(i=Object(h.__)("Video")))}var k=f()("block-editor-media-placeholder",o,{"is-appender":u});return Object(d.createElement)(j.Placeholder,{icon:c,label:i,instructions:n,className:k,notices:s,onClick:t,onDoubleClick:I,preview:l},e,N)},X=function(){return y?null:Object(d.createElement)(j.DropZone,{onFilesDrop:q,onHTMLDrop:T})},Q=function(){return w&&Object(d.createElement)(j.Button,{className:"block-editor-media-placeholder__cancel-button",title:Object(h.__)("Cancel"),isLink:!0,onClick:w},Object(h.__)("Cancel"))},Z=function(){return S&&Object(d.createElement)("div",{className:"block-editor-media-placeholder__url-input-container"},Object(d.createElement)(j.Button,{className:"block-editor-media-placeholder__button",onClick:G,isPressed:H,isTertiary:!0},Object(h.__)("Insert from URL")),H&&Object(d.createElement)(Xd,{src:A,onChange:U,onSubmit:W,onClose:K}))};return k||_?(k&&hu()("wp.blockEditor.MediaPlaceholder dropZoneUIOnly prop",{alternative:"disableMediaButtons"}),Object(d.createElement)(Gd,null,X())):Object(d.createElement)(Gd,{fallback:Y(Z())},function(){var e=Object(d.createElement)(Ud,{addToGallery:m,gallery:g&&!(!r||0===r.length)&&r.every((function(e){return"image"===e||e.startsWith("image/")})),multiple:g,onSelect:C,allowedTypes:r,value:Array.isArray(n)?n.map((function(e){return e.id})):n.id,render:function(e){var t=e.open;return Object(d.createElement)(j.Button,{isTertiary:!0,onClick:function(e){e.stopPropagation(),t()}},Object(h.__)("Media Library"))}});if(R&&u)return Object(d.createElement)(d.Fragment,null,X(),Object(d.createElement)(j.FormFileUpload,{onChange:$,accept:b,multiple:g,render:function(t){var n=t.openFileDialog,r=Object(d.createElement)(d.Fragment,null,Object(d.createElement)(j.Button,{isPrimary:!0,className:f()("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button")},Object(h.__)("Upload")),e,Z(),Q());return Y(r,n)}}));if(R){var t=Object(d.createElement)(d.Fragment,null,X(),Object(d.createElement)(j.FormFileUpload,{isPrimary:!0,className:f()("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button"),onChange:$,accept:b,multiple:g},Object(h.__)("Upload")),e,Z(),Q());return Y(t)}return Y(e)}())})),Zd=Object(d.forwardRef)((function(e,t){return Object(d.createElement)(Tu,Object(s.a)({ref:t},e,{__unstableDisableFormats:!0,preserveWhiteSpace:!0}))}));Zd.Content=function(e){var t=e.value,n=void 0===t?"":t,r=e.tagName,o=void 0===r?"div":r,c=Object(pe.a)(e,["value","tagName"]);return Object(d.createElement)(o,c,n)};var Jd=Zd,eb=Object(d.forwardRef)((function(e,t){var n=e.__experimentalVersion,r=Object(pe.a)(e,["__experimentalVersion"]);if(2===n)return Object(d.createElement)(Jd,Object(s.a)({ref:t},r));var o=r.className,c=r.onChange,i=Object(pe.a)(r,["className","onChange"]);return Object(d.createElement)(zr.a,Object(s.a)({ref:t,className:f()("block-editor-plain-text",o),onChange:function(e){return c(e.target.value)}},i))}));function tb(e){var t=e.property,n=e.viewport,r=e.desc,o=Object(m.useInstanceId)(tb),c=r||Object(h.sprintf)(
|
69 |
/* translators: 1: property name. 2: viewport name. */
|
70 |
Object(h._x)("Controls the %1$s property for %2$s viewports.","Text labelling a interface as controlling a given layout property (eg: margin) for a given screen size."),t,n.label);return Object(d.createElement)(d.Fragment,null,Object(d.createElement)("span",{"aria-describedby":"rbc-desc-".concat(o)},n.label),Object(d.createElement)(j.VisuallyHidden,{as:"span",id:"rbc-desc-".concat(o)},c))}var nb=function(e){var t=e.title,n=e.property,r=e.toggleLabel,o=e.onIsResponsiveChange,c=e.renderDefaultControl,i=e.renderResponsiveControls,a=e.isResponsive,l=void 0!==a&&a,s=e.defaultLabel,u=void 0===s?{id:"all",
|
71 |
/* translators: 'Label. Used to signify a layout property (eg: margin, padding) will apply uniformly to all screensizes.' */
|
changelog.txt
CHANGED
@@ -1,5 +1,13 @@
|
|
1 |
== Changelog ==
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
= 8.7.0 =
|
4 |
|
5 |
### Enhancements
|
1 |
== Changelog ==
|
2 |
|
3 |
+
= 8.7.1 =
|
4 |
+
|
5 |
+
### Bug Fixes
|
6 |
+
|
7 |
+
- Block Supports: Add missing UTF-8 conversion.
|
8 |
+
- File block: Fix upload pdf file using Upload button but can using Media Library link.
|
9 |
+
|
10 |
+
|
11 |
= 8.7.0 =
|
12 |
|
13 |
### Enhancements
|
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.3
|
7 |
* Requires PHP: 5.6
|
8 |
-
* Version: 8.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', '8.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.3
|
7 |
* Requires PHP: 5.6
|
8 |
+
* Version: 8.7.1
|
9 |
* Author: Gutenberg Team
|
10 |
* Text Domain: gutenberg
|
11 |
*
|
13 |
*/
|
14 |
|
15 |
### BEGIN AUTO-GENERATED DEFINES
|
16 |
+
define( 'GUTENBERG_VERSION', '8.7.1' );
|
17 |
+
define( 'GUTENBERG_GIT_COMMIT', '1c30d0885a02ecedd9790d226a47519a52c8dc19' );
|
18 |
### END AUTO-GENERATED DEFINES
|
19 |
|
20 |
gutenberg_pre_init();
|
lib/blocks.php
CHANGED
@@ -254,7 +254,7 @@ function gutenberg_experimental_apply_classnames_and_styles( $block_content, $bl
|
|
254 |
|
255 |
// Suppress warnings from this method from polluting the front-end.
|
256 |
// @codingStandardsIgnoreStart
|
257 |
-
if ( ! @$dom->loadHTML( $block_content, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD | LIBXML_COMPACT ) ) {
|
258 |
// @codingStandardsIgnoreEnd
|
259 |
return $block_content;
|
260 |
}
|
@@ -287,7 +287,7 @@ function gutenberg_experimental_apply_classnames_and_styles( $block_content, $bl
|
|
287 |
$block_root->setAttribute( 'style', $new_styles );
|
288 |
}
|
289 |
|
290 |
-
return $dom->saveHtml();
|
291 |
}
|
292 |
add_filter( 'render_block', 'gutenberg_experimental_apply_classnames_and_styles', 10, 2 );
|
293 |
|
254 |
|
255 |
// Suppress warnings from this method from polluting the front-end.
|
256 |
// @codingStandardsIgnoreStart
|
257 |
+
if ( ! @$dom->loadHTML( mb_convert_encoding( $block_content, 'HTML-ENTITIES', 'UTF-8' ), LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD | LIBXML_COMPACT ) ) {
|
258 |
// @codingStandardsIgnoreEnd
|
259 |
return $block_content;
|
260 |
}
|
287 |
$block_root->setAttribute( 'style', $new_styles );
|
288 |
}
|
289 |
|
290 |
+
return mb_convert_encoding( $dom->saveHtml(), 'UTF-8', 'HTML-ENTITIES' );
|
291 |
}
|
292 |
add_filter( 'render_block', 'gutenberg_experimental_apply_classnames_and_styles', 10, 2 );
|
293 |
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: matveb, joen, karmatosed
|
|
3 |
Requires at least: 5.3.0
|
4 |
Tested up to: 5.4
|
5 |
Requires PHP: 5.6
|
6 |
-
Stable tag: 8.
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
@@ -57,4 +57,4 @@ View <a href="https://developer.wordpress.org/block-editor/principles/versions-i
|
|
57 |
|
58 |
== Changelog ==
|
59 |
|
60 |
-
To read the changelog for Gutenberg 8.7.
|
3 |
Requires at least: 5.3.0
|
4 |
Tested up to: 5.4
|
5 |
Requires PHP: 5.6
|
6 |
+
Stable tag: 8.7.0
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
57 |
|
58 |
== Changelog ==
|
59 |
|
60 |
+
To read the changelog for Gutenberg 8.7.1, please navigate to the <a href="https://github.com/WordPress/gutenberg/releases/tag/v8.7.1">release page</a>.
|