mirror of
https://github.com/WordPress/WordPress.git
synced 2024-10-30 07:20:01 +01:00
935058d178
Update packages to include these bug fixes from Gutenberg: - Image block: Set image display to grid when no alignment sent to properly align caption on resize - Update and align template descriptions - Site Editor - prevent loading state from showing the admin menu. - Add client side routing for Site Editor - Navigation: Add clearance for appender in submenus. - Fix CSS Custom Properties for presets in the site editor - Add/navigation blocks post processing after migration from menu items - Allow selector ordering to ensure theme.json root selector margin takes precedence - Do not remove theme presets if defaults are hidden - Format library: fix unsetting highlight color - FSE: Fix template resolution to give precedence to child theme PHP templates over parent theme block templates with equal specificity - ColorPalette: Improving accessibility and visibility - Update: Make the color popover on the gradient picker appear as expected - Site Editor: Display a notice if export fails - Fix docs and function naming for gallery block registration in PHP - Switch to addEventListener for load event in the navigation block view script - Fix mistake in _remove_theme_attribute_in_block_template_content - Better synchronisation between Gutenberg and Core code - Move the block page templates hook into compat/5.9 folder - Moves to the template loader hooks and functions into lib/compat folder - Refactor the gutenberg_is_fse_theme function to use wp_is_block_theme - Site Editor: Update support doc URL in Welcome Guide - Global Styles: Add Welcome Guide toggle - Hide remove control point when removing would break gradient control - Don't request the deprecated navigation areas endpoint outside of the Gutenberg plugin - Image: Fix resizer controls being hidden in Safari when switching between alignments - Remove Navigation Menus from WP Admin sidebar - Site Editor: Hide the block appender in the Template Part editor - Site Editor: Use server definition for the Template Areas - Synchronize wp_is_block_theme and block-templates block support with Core - E2E: Retry login again after a bad nonce request to prevent intermittent test failures - Fix theme requirement validation with WP 5.8 - Fix WP 5.9 check for conditionally running code - Fix post comment form input width - Border Style Control: Update styling for consistency with border width control - Fix form-submit styles by adding button classes to the submit-button in post-comments block - Site Editor: Fix edit template part link in header dropdown - Move duotone palette to the bottom of global styles gradients - Fix how appearanceTools works - Move WP 5.9 wp-admin menus compatibility code to lib/compat folder - Revert "Site Editor: Set the <title> on the list page to be same as the CPT name" - Site Editor: Document Actions: add SR text to heading 1 - Do not register global styles CPT in WordPress 5.9 - Global Styles: Move the 'Edit colors' button to a standard menu item - Fix styles for previews and patterns - Site Editor: Fix failing E2E test - Templates: Search for old template names in the parent theme too - Remove 4 instances of 'gutenberg' text domain from WordPress core - Fix content loss when ungrouping template parts or reusable blocks - Simplify the RESET_BLOCK action to fix template part focus mode content loss - [Global Styles]: Make Blocks section more distinguishable - Only use block markup for comment form button when using a block theme - Navigation: Fix vertical alignment of page list in modal. - Fix: ToggleGroupControl active state - Remove gutenberg_ prefix from @wordpress/block-library Props ocean90, oandregal, hellofromtonya, youknowriad. See #54487. Built from https://develop.svn.wordpress.org/trunk@52364 git-svn-id: http://core.svn.wordpress.org/trunk@51956 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2 lines
21 KiB
JavaScript
2 lines
21 KiB
JavaScript
/*! This file is auto-generated */
|
|
this.wp=this.wp||{},this.wp.formatLibrary=function(e){var t={};function n(c){if(t[c])return t[c].exports;var r=t[c]={i:c,l:!1,exports:{}};return e[c].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,c){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:c})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var c=Object.create(null);if(n.r(c),Object.defineProperty(c,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(c,r,function(t){return e[t]}.bind(null,r));return c},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s="t1DA")}({"1Yn1":function(e,t,n){"use strict";var c=n("GRId"),r=n("Tqx9");const o=Object(c.createElement)(r.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(c.createElement)(r.Path,{d:"M20.8 10.7l-4.3-4.3-1.1 1.1 4.3 4.3c.1.1.1.3 0 .4l-4.3 4.3 1.1 1.1 4.3-4.3c.7-.8.7-1.9 0-2.6zM4.2 11.8l4.3-4.3-1-1-4.3 4.3c-.7.7-.7 1.8 0 2.5l4.3 4.3 1.1-1.1-4.3-4.3c-.2-.1-.2-.3-.1-.4z"}));t.a=o},"1ZqX":function(e,t){e.exports=window.wp.data},Bpkj:function(e,t,n){"use strict";var c=n("GRId"),r=n("Tqx9");const o=Object(c.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(c.createElement)(r.Path,{d:"M15.6 7.2H14v1.5h1.6c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.8 0 5.2-2.3 5.2-5.2 0-2.9-2.3-5.2-5.2-5.2zM4.7 12.4c0-2 1.7-3.7 3.7-3.7H10V7.2H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H10v-1.5H8.4c-2 0-3.7-1.7-3.7-3.7zm4.6.9h5.3v-1.5H9.3v1.5z"}));t.a=o},Crq9:function(e,t,n){"use strict";var c=n("GRId"),r=n("Tqx9");const o=Object(c.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(c.createElement)(r.Path,{d:"M9.1 9v-.5c0-.6.2-1.1.7-1.4.5-.3 1.2-.5 2-.5.7 0 1.4.1 2.1.3.7.2 1.4.5 2.1.9l.2-1.9c-.6-.3-1.2-.5-1.9-.7-.8-.1-1.6-.2-2.4-.2-1.5 0-2.7.3-3.6 1-.8.7-1.2 1.5-1.2 2.6V9h2zM20 12H4v1h8.3c.3.1.6.2.8.3.5.2.9.5 1.1.8.3.3.4.7.4 1.2 0 .7-.2 1.1-.8 1.5-.5.3-1.2.5-2.1.5-.8 0-1.6-.1-2.4-.3-.8-.2-1.5-.5-2.2-.8L7 18.1c.5.2 1.2.4 2 .6.8.2 1.6.3 2.4.3 1.7 0 3-.3 3.9-1 .9-.7 1.3-1.6 1.3-2.8 0-.9-.2-1.7-.7-2.2H20v-1z"}));t.a=o},GRId:function(e,t){e.exports=window.wp.element},Mmq9:function(e,t){e.exports=window.wp.url},Mp0b:function(e,t,n){"use strict";var c=n("GRId"),r=n("Tqx9");const o=Object(c.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(c.createElement)(r.Path,{d:"M15.6 7.3h-.7l1.6-3.5-.9-.4-3.9 8.5H9v1.5h2l-1.3 2.8H8.4c-2 0-3.7-1.7-3.7-3.7s1.7-3.7 3.7-3.7H10V7.3H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H9l-1.4 3.2.9.4 5.7-12.5h1.4c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.9 0 5.2-2.3 5.2-5.2 0-2.9-2.4-5.2-5.2-5.2z"}));t.a=o},Tqx9:function(e,t){e.exports=window.wp.primitives},YLtl:function(e,t){e.exports=window.lodash},axFQ:function(e,t){e.exports=window.wp.blockEditor},btIw:function(e,t,n){"use strict";var c=n("GRId"),r=n("Tqx9");const o=Object(c.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},Object(c.createElement)(r.Path,{d:"M6.734 16.106l2.176-2.38-1.093-1.028-3.846 4.158 3.846 4.157 1.093-1.027-2.176-2.38h2.811c1.125 0 2.25.03 3.374 0 1.428-.001 3.362-.25 4.963-1.277 1.66-1.065 2.868-2.906 2.868-5.859 0-2.479-1.327-4.896-3.65-5.93-1.82-.813-3.044-.8-4.806-.788l-.567.002v1.5c.184 0 .368 0 .553-.002 1.82-.007 2.704-.014 4.21.657 1.854.827 2.76 2.657 2.76 4.561 0 2.472-.973 3.824-2.178 4.596-1.258.807-2.864 1.04-4.163 1.04h-.02c-1.115.03-2.229 0-3.344 0H6.734z"}));t.a=o},gdqT:function(e,t){e.exports=window.wp.a11y},iClF:function(e,t,n){"use strict";var c=n("GRId");t.a=function(e){let{icon:t,size:n=24,...r}=e;return Object(c.cloneElement)(t,{width:n,height:n,...r})}},l3Sj:function(e,t){e.exports=window.wp.i18n},oMoS:function(e,t,n){"use strict";var c=n("GRId"),r=n("Tqx9");const o=Object(c.createElement)(r.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(c.createElement)(r.Path,{d:"M19 6.5H5c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-7c0-1.1-.9-2-2-2zm.5 9c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-7c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v7zM8 12.8h8v-1.5H8v1.5z"}));t.a=o},qRz9:function(e,t){e.exports=window.wp.richText},rmEH:function(e,t){e.exports=window.wp.htmlEntities},t1DA:function(e,t,n){"use strict";n.r(t);var c=n("qRz9"),r=n("GRId"),o=n("l3Sj"),a=n("axFQ"),l=n("Tqx9");var i=Object(r.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(l.Path,{d:"M14.7 11.3c1-.6 1.5-1.6 1.5-3 0-2.3-1.3-3.4-4-3.4H7v14h5.8c1.4 0 2.5-.3 3.3-1 .8-.7 1.2-1.7 1.2-2.9.1-1.9-.8-3.1-2.6-3.7zm-5.1-4h2.3c.6 0 1.1.1 1.4.4.3.3.5.7.5 1.2s-.2 1-.5 1.2c-.3.3-.8.4-1.4.4H9.6V7.3zm4.6 9c-.4.3-1 .4-1.7.4H9.6v-3.9h2.9c.7 0 1.3.2 1.7.5.4.3.6.8.6 1.5s-.2 1.2-.6 1.5z"}));const s=Object(o.__)("Bold"),u={name:"core/bold",title:s,tagName:"strong",className:null,edit(e){let{isActive:t,value:n,onChange:o,onFocus:l}=e;function u(){o(Object(c.toggleFormat)(n,{type:"core/bold",title:s}))}return Object(r.createElement)(r.Fragment,null,Object(r.createElement)(a.RichTextShortcut,{type:"primary",character:"b",onUse:u}),Object(r.createElement)(a.RichTextToolbarButton,{name:"bold",icon:i,title:s,onClick:function(){o(Object(c.toggleFormat)(n,{type:"core/bold"})),l()},isActive:t,shortcutType:"primary",shortcutCharacter:"b"}),Object(r.createElement)(a.__unstableRichTextInputEvent,{inputType:"formatBold",onInput:u}))}};var b=n("1Yn1");const m=Object(o.__)("Inline code"),p={name:"core/code",title:m,tagName:"code",className:null,__unstableInputRule(e){const{start:t,text:n}=e;if("`"!==n.slice(t-1,t))return e;const r=n.slice(0,t-1).lastIndexOf("`");if(-1===r)return e;const o=r,a=t-2;return o===a?e:(e=Object(c.remove)(e,o,o+1),e=Object(c.remove)(e,a,a+1),e=Object(c.applyFormat)(e,{type:"core/code"},o,a))},edit(e){let{value:t,onChange:n,onFocus:o,isActive:l}=e;return Object(r.createElement)(a.RichTextToolbarButton,{icon:b.a,title:m,onClick:function(){n(Object(c.toggleFormat)(t,{type:"core/code",title:m})),o()},isActive:l,role:"menuitemcheckbox"})}};var h=n("tI+e"),j=n("btIw");const d=["image"],O=Object(o.__)("Inline image"),g={name:"core/image",title:O,keywords:[Object(o.__)("photo"),Object(o.__)("media")],object:!0,tagName:"img",className:null,attributes:{className:"class",style:"style",url:"src",alt:"alt"},edit:function(e){let{value:t,onChange:n,onFocus:o,isObjectActive:l,activeObjectAttributes:i,contentRef:s}=e;const[u,b]=Object(r.useState)(!1);function m(){b(!1)}return Object(r.createElement)(a.MediaUploadCheck,null,Object(r.createElement)(a.RichTextToolbarButton,{icon:Object(r.createElement)(h.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(h.Path,{d:"M4 18.5h16V17H4v1.5zM16 13v1.5h4V13h-4zM5.1 15h7.8c.6 0 1.1-.5 1.1-1.1V6.1c0-.6-.5-1.1-1.1-1.1H5.1C4.5 5 4 5.5 4 6.1v7.8c0 .6.5 1.1 1.1 1.1zm.4-8.5h7V10l-1-1c-.3-.3-.8-.3-1 0l-1.6 1.5-1.2-.7c-.3-.2-.6-.2-.9 0l-1.3 1V6.5zm0 6.1l1.8-1.3 1.3.8c.3.2.7.2.9-.1l1.5-1.4 1.5 1.4v1.5h-7v-.9z"})),title:O,onClick:function(){b(!0)},isActive:l}),u&&Object(r.createElement)(a.MediaUpload,{allowedTypes:d,onSelect:e=>{let{id:r,url:a,alt:l,width:i}=e;m(),n(Object(c.insertObject)(t,{type:"core/image",attributes:{className:"wp-image-"+r,style:`width: ${Math.min(i,150)}px;`,url:a,alt:l}})),o()},onClose:m,render:e=>{let{open:t}=e;return t(),null}}),l&&Object(r.createElement)(v,{value:t,onChange:n,activeObjectAttributes:i,contentRef:s}))}};function v(e){let{value:t,onChange:n,activeObjectAttributes:a,contentRef:l}=e;const{style:i}=a,[s,u]=Object(r.useState)(null==i?void 0:i.replace(/\D/g,"")),b=Object(c.useAnchorRef)({ref:l,value:t,settings:g});return Object(r.createElement)(h.Popover,{position:"bottom center",focusOnMount:!1,anchorRef:b,className:"block-editor-format-toolbar__image-popover"},Object(r.createElement)("form",{className:"block-editor-format-toolbar__image-container-content",onSubmit:e=>{const c=t.replacements.slice();c[t.start]={type:"core/image",attributes:{...a,style:s?`width: ${s}px;`:""}},n({...t,replacements:c}),e.preventDefault()}},Object(r.createElement)(h.TextControl,{className:"block-editor-format-toolbar__image-container-value",type:"number",label:Object(o.__)("Width"),value:s,min:1,onChange:e=>u(e)}),Object(r.createElement)(h.Button,{icon:j.a,label:Object(o.__)("Apply"),type:"submit"})))}var f=Object(r.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(l.Path,{d:"M12.5 5L10 19h1.9l2.5-14z"}));const w=Object(o.__)("Italic"),y={name:"core/italic",title:w,tagName:"em",className:null,edit(e){let{isActive:t,value:n,onChange:o,onFocus:l}=e;function i(){o(Object(c.toggleFormat)(n,{type:"core/italic",title:w}))}return Object(r.createElement)(r.Fragment,null,Object(r.createElement)(a.RichTextShortcut,{type:"primary",character:"i",onUse:i}),Object(r.createElement)(a.RichTextToolbarButton,{name:"italic",icon:f,title:w,onClick:function(){o(Object(c.toggleFormat)(n,{type:"core/italic"})),l()},isActive:t,shortcutType:"primary",shortcutCharacter:"i"}),Object(r.createElement)(a.__unstableRichTextInputEvent,{inputType:"formatItalic",onInput:i}))}};var x=n("Mmq9"),k=n("rmEH"),E=n("Mp0b"),C=n("Bpkj"),_=n("gdqT"),T=n("1ZqX"),R=n("YLtl");function S(e){if(!e)return!1;const t=e.trim();if(!t)return!1;if(/^\S+:/.test(t)){const e=Object(x.getProtocol)(t);if(!Object(x.isValidProtocol)(e))return!1;if(Object(R.startsWith)(e,"http")&&!/^https?:\/\/[^\/\s]/i.test(t))return!1;const n=Object(x.getAuthority)(t);if(!Object(x.isValidAuthority)(n))return!1;const c=Object(x.getPath)(t);if(c&&!Object(x.isValidPath)(c))return!1;const r=Object(x.getQueryString)(t);if(r&&!Object(x.isValidQueryString)(r))return!1;const o=Object(x.getFragment)(t);if(o&&!Object(x.isValidFragment)(o))return!1}return!(Object(R.startsWith)(t,"#")&&!Object(x.isValidFragment)(t))}function F(e,t,n,c,r){let o=t;const a={forwards:1,backwards:-1}[r]||1,l=-1*a;for(;e[o]&&e[o][c]===n;)o+=a;return o+=l,o}const A=Object(R.partialRight)(F,"backwards"),M=Object(R.partialRight)(F,"forwards"),P=new WeakMap;let N=-1;function I(e){return"link-control-instance-"+e}var B=function(e){if(e)return P.has(e)?I(P.get(e)):(N+=1,P.set(e,N),I(N))};var V=Object(h.withSpokenMessages)((function(e){let{isActive:t,activeAttributes:n,addingLink:l,value:i,onChange:s,speak:u,stopAddingLink:b,contentRef:m}=e;const p=function(e,t){let n=e.start,r=e.end;if(t){const t=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.start,c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e.end;const r={start:null,end:null},{formats:o}=e;let a,l;if(null==o||!o.length)return r;const i=o.slice(),s=Object(R.find)(i[n],{type:t.type}),u=Object(R.find)(i[c],{type:t.type}),b=Object(R.find)(i[c-1],{type:t.type});if(s)a=s,l=n;else if(u)a=u,l=c;else{if(!b)return r;a=b,l=c-1}const m=i[l].indexOf(a),p=[i,l,a,m];return n=A(...p),c=M(...p),n=n<0?0:n,{start:n,end:c}}(e,{type:"core/link"});n=t.start,r=t.end+1}return Object(c.slice)(e,n,r)}(i,t).text,[j,d]=Object(r.useState)(),{createPageEntity:O,userCanCreatePages:g}=Object(T.useSelect)(e=>{const{getSettings:t}=e(a.store),n=t();return{createPageEntity:n.__experimentalCreatePageEntity,userCanCreatePages:n.__experimentalUserCanCreatePages}},[]),v={url:n.url,type:n.type,id:n.id,opensInNewTab:"_blank"===n.target,title:p,...j},f=Object(c.useAnchorRef)({ref:m,value:i,settings:H}),w=B(f),y=Object(r.useRef)(!!l&&"firstElement");return Object(r.createElement)(h.Popover,{anchorRef:f,focusOnMount:y.current,onClose:b,position:"bottom center"},Object(r.createElement)(a.__experimentalLinkControl,{key:w,value:v,onChange:function(e){e={...j,...e};const n=v.opensInNewTab!==e.opensInNewTab&&v.url===e.url,r=n&&void 0===e.url;if(d(r?e:void 0),r)return;const a=Object(x.prependHTTP)(e.url),l=function(e){let{url:t,type:n,id:c,opensInNewWindow:r}=e;const o={type:"core/link",attributes:{url:t}};return n&&(o.attributes.type=n),c&&(o.attributes.id=c),r&&(o.attributes.target="_blank",o.attributes.rel="noreferrer noopener"),o}({url:a,type:e.type,id:void 0!==e.id&&null!==e.id?String(e.id):void 0,opensInNewWindow:e.opensInNewTab}),m=e.title||a;if(Object(c.isCollapsed)(i)&&!t){const e=Object(c.applyFormat)(Object(c.create)({text:m}),l,0,m.length);s(Object(c.insert)(i,e))}else{let e;m===p?e=Object(c.applyFormat)(i,l):(e=Object(c.create)({text:m}),e=Object(c.applyFormat)(e,l,0,m.length),e=Object(c.replace)(i,p,e)),e.start=e.end,e.activeFormats=[],s(e)}n||b(),S(a)?u(t?Object(o.__)("Link edited."):Object(o.__)("Link inserted."),"assertive"):u(Object(o.__)("Warning: the link has been inserted but may have errors. Please test it."),"assertive")},onRemove:function(){const e=Object(c.removeFormat)(i,"core/link");s(e),b(),u(Object(o.__)("Link removed."),"assertive")},forceIsEditingLink:l,hasRichPreviews:!0,createSuggestion:O&&async function(e){const t=await O({title:e,status:"draft"});return{id:t.id,type:t.type,title:t.title.rendered,url:t.link,kind:"post-type"}},withCreateSuggestion:g,createSuggestionButtonText:function(e){return Object(r.createInterpolateElement)(Object(o.sprintf)(Object(o.__)("Create Page: <mark>%s</mark>"),e),{mark:Object(r.createElement)("mark",null)})},hasTextControl:!0}))}));const z=Object(o.__)("Link");const H={name:"core/link",title:z,tagName:"a",className:null,attributes:{url:"href",type:"data-type",id:"data-id",target:"target"},__unstablePasteRule(e,t){let{html:n,plainText:r}=t;if(Object(c.isCollapsed)(e))return e;const o=(n||r).replace(/<[^>]+>/g,"").trim();return Object(x.isURL)(o)?(window.console.log("Created link:\n\n",o),Object(c.applyFormat)(e,{type:"core/link",attributes:{url:Object(k.decodeEntities)(o)}})):e},edit:function(e){let{isActive:t,activeAttributes:n,value:l,onChange:i,onFocus:s,contentRef:u}=e;const[b,m]=Object(r.useState)(!1);function p(){const e=Object(c.getTextContent)(Object(c.slice)(l));e&&Object(x.isURL)(e)&&S(e)?i(Object(c.applyFormat)(l,{type:"core/link",attributes:{url:e}})):e&&Object(x.isEmail)(e)?i(Object(c.applyFormat)(l,{type:"core/link",attributes:{url:"mailto:"+e}})):m(!0)}function h(){i(Object(c.removeFormat)(l,"core/link")),Object(_.speak)(Object(o.__)("Link removed."),"assertive")}return Object(r.createElement)(r.Fragment,null,Object(r.createElement)(a.RichTextShortcut,{type:"primary",character:"k",onUse:p}),Object(r.createElement)(a.RichTextShortcut,{type:"primaryShift",character:"k",onUse:h}),t&&Object(r.createElement)(a.RichTextToolbarButton,{name:"link",icon:E.a,title:Object(o.__)("Unlink"),onClick:h,isActive:t,shortcutType:"primaryShift",shortcutCharacter:"k"}),!t&&Object(r.createElement)(a.RichTextToolbarButton,{name:"link",icon:C.a,title:z,onClick:p,isActive:t,shortcutType:"primary",shortcutCharacter:"k"}),(b||t)&&Object(r.createElement)(V,{addingLink:b,stopAddingLink:function(){m(!1),s()},isActive:t,activeAttributes:n,value:l,onChange:i,contentRef:u}))}};var L=n("Crq9");const G=Object(o.__)("Strikethrough"),q={name:"core/strikethrough",title:G,tagName:"s",className:null,edit(e){let{isActive:t,value:n,onChange:o,onFocus:l}=e;return Object(r.createElement)(a.RichTextToolbarButton,{icon:L.a,title:G,onClick:function(){o(Object(c.toggleFormat)(n,{type:"core/strikethrough",title:G})),l()},isActive:t,role:"menuitemcheckbox"})}},U=Object(o.__)("Underline"),W={name:"core/underline",title:U,tagName:"span",className:null,attributes:{style:"style"},edit(e){let{value:t,onChange:n}=e;const o=()=>{n(Object(c.toggleFormat)(t,{type:"core/underline",attributes:{style:"text-decoration: underline;"},title:U}))};return Object(r.createElement)(r.Fragment,null,Object(r.createElement)(a.RichTextShortcut,{type:"primary",character:"u",onUse:o}),Object(r.createElement)(a.__unstableRichTextInputEvent,{inputType:"formatUnderline",onInput:o}))}};var D=n("iClF");var Q=Object(r.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(l.Path,{d:"M12.9 6h-2l-4 11h1.9l1.1-3h4.2l1.1 3h1.9L12.9 6zm-2.5 6.5l1.5-4.9 1.7 4.9h-3.2z"}));function Y(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e.split(";").reduce((e,t)=>{if(t){const[n,c]=t.split(":");"color"===n&&(e.color=c),"background-color"===n&&c!==J&&(e.backgroundColor=c)}return e},{})}function $(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;return e.split(" ").reduce((e,n)=>{if(n.startsWith("has-")&&n.endsWith("-color")){const c=n.replace(/^has-/,"").replace(/-color$/,""),r=Object(a.getColorObjectByAttributeValues)(t,c);e.color=r.color}return e},{})}function X(e,t,n){const r=Object(c.getActiveFormat)(e,t);return r?{...Y(r.attributes.style),...$(r.attributes.class,n)}:{}}function Z(e){let{name:t,property:n,value:o,onChange:l}=e;const i=Object(T.useSelect)(e=>{const{getSettings:t}=e(a.store);return Object(R.get)(t(),["colors"],[])},[]),s=Object(r.useCallback)(e=>{l(function(e,t,n,r){const{color:o,backgroundColor:l}={...X(e,t,n),...r};if(!o&&!l)return Object(c.removeFormat)(e,t);const i=[],s=[],u={};if(l?i.push(["background-color",l].join(":")):i.push(["background-color",J].join(":")),o){const e=Object(a.getColorObjectByColorValue)(n,o);e?s.push(Object(a.getColorClassName)("color",e.slug)):i.push(["color",o].join(":"))}return i.length&&(u.style=i.join(";")),s.length&&(u.class=s.join(" ")),Object(c.applyFormat)(e,{type:t,attributes:u})}(o,t,i,{[n]:e}))},[i,l,n]),u=Object(r.useMemo)(()=>X(o,t,i),[t,o,i]);return Object(r.createElement)(a.ColorPalette,{value:u[n],onChange:s})}function K(e){let{name:t,value:n,onChange:l,onClose:i,contentRef:s}=e;const u=Object(a.useCachedTruthy)(Object(c.useAnchorRef)({ref:s,value:n,settings:ce}));return Object(r.createElement)(h.Popover,{onClose:i,className:"components-inline-color-popover",anchorRef:u},Object(r.createElement)(h.TabPanel,{tabs:[{name:"color",title:Object(o.__)("Text")},{name:"backgroundColor",title:Object(o.__)("Background")}]},e=>Object(r.createElement)(Z,{name:t,property:e.name,value:n,onChange:l})))}const J="rgba(0, 0, 0, 0)",ee=Object(o.__)("Highlight"),te=[];function ne(e,t){const{ownerDocument:n}=e,{defaultView:c}=n,r=c.getComputedStyle(e).getPropertyValue(t);return"background-color"===t&&r===J&&e.parentElement?ne(e.parentElement,t):r}const ce={name:"core/text-color",title:ee,tagName:"mark",className:"has-inline-color",attributes:{style:"style",class:"class"},__unstableFilterAttributeValue(e,t){if("style"!==e)return t;if(t&&t.includes("background-color"))return t;const n=["background-color",J].join(":");return t?[n,t].join(";"):n},edit:function(e){let{value:t,onChange:n,isActive:o,activeAttributes:l,contentRef:i}=e;const s=Object(a.useSetting)("color.custom"),u=Object(a.useSetting)("color.palette")||te,[b,m]=Object(r.useState)(!1),p=Object(r.useCallback)(()=>m(!0),[m]),h=Object(r.useCallback)(()=>m(!1),[m]),j=Object(r.useMemo)(()=>function(e,t){let{color:n,backgroundColor:c}=t;if(n||c)return{color:n||ne(e,"color"),backgroundColor:c===J?ne(e,"background-color"):c}}(i.current,X(t,"core/text-color",u)),[t,u]),d=!Object(R.isEmpty)(u)||!s;return d||o?Object(r.createElement)(r.Fragment,null,Object(r.createElement)(a.RichTextToolbarButton,{className:"format-library-text-color-button",isActive:o,icon:Object(r.createElement)(D.a,{icon:Q,style:j}),title:ee,onClick:d?p:()=>n(Object(c.removeFormat)(t,"core/text-color")),role:"menuitemcheckbox"}),b&&Object(r.createElement)(K,{name:"core/text-color",onClose:h,activeAttributes:l,value:t,onChange:n,contentRef:i})):null}};var re=Object(r.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(l.Path,{d:"M16.9 18.3l.8-1.2c.4-.6.7-1.2.9-1.6.2-.4.3-.8.3-1.2 0-.3-.1-.7-.2-1-.1-.3-.4-.5-.6-.7-.3-.2-.6-.3-1-.3s-.8.1-1.1.2c-.3.1-.7.3-1 .6l.2 1.3c.3-.3.5-.5.8-.6s.6-.2.9-.2c.3 0 .5.1.7.2.2.2.2.4.2.7 0 .3-.1.5-.2.8-.1.3-.4.7-.8 1.3L15 19.4h4.3v-1.2h-2.4zM14.1 7.2h-2L9.5 11 6.9 7.2h-2l3.6 5.3L4.7 18h2l2.7-4 2.7 4h2l-3.8-5.5 3.8-5.3z"}));const oe=Object(o.__)("Subscript"),ae={name:"core/subscript",title:oe,tagName:"sub",className:null,edit(e){let{isActive:t,value:n,onChange:o,onFocus:l}=e;return Object(r.createElement)(a.RichTextToolbarButton,{icon:re,title:oe,onClick:function(){o(Object(c.toggleFormat)(n,{type:"core/subscript",title:oe})),l()},isActive:t,role:"menuitemcheckbox"})}};var le=Object(r.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(l.Path,{d:"M16.9 10.3l.8-1.3c.4-.6.7-1.2.9-1.6.2-.4.3-.8.3-1.2 0-.3-.1-.7-.2-1-.2-.2-.4-.4-.7-.6-.3-.2-.6-.3-1-.3s-.8.1-1.1.2c-.3.1-.7.3-1 .6l.1 1.3c.3-.3.5-.5.8-.6s.6-.2.9-.2c.3 0 .5.1.7.2.2.2.2.4.2.7 0 .3-.1.5-.2.8-.1.3-.4.7-.8 1.3l-1.8 2.8h4.3v-1.2h-2.2zm-2.8-3.1h-2L9.5 11 6.9 7.2h-2l3.6 5.3L4.7 18h2l2.7-4 2.7 4h2l-3.8-5.5 3.8-5.3z"}));const ie=Object(o.__)("Superscript"),se={name:"core/superscript",title:ie,tagName:"sup",className:null,edit(e){let{isActive:t,value:n,onChange:o,onFocus:l}=e;return Object(r.createElement)(a.RichTextToolbarButton,{icon:le,title:ie,onClick:function(){o(Object(c.toggleFormat)(n,{type:"core/superscript",title:ie})),l()},isActive:t,role:"menuitemcheckbox"})}};var ue=n("oMoS");const be=Object(o.__)("Keyboard input");[u,p,g,y,H,q,W,ce,ae,se,{name:"core/keyboard",title:be,tagName:"kbd",className:null,edit(e){let{isActive:t,value:n,onChange:o,onFocus:l}=e;return Object(r.createElement)(a.RichTextToolbarButton,{icon:ue.a,title:be,onClick:function(){o(Object(c.toggleFormat)(n,{type:"core/keyboard",title:be})),l()},isActive:t,role:"menuitemcheckbox"})}}].forEach(e=>{let{name:t,...n}=e;return Object(c.registerFormatType)(t,n)})},"tI+e":function(e,t){e.exports=window.wp.components}}); |