WordPress/wp-includes/js/dist/format-library.min.js
youknowriad e335b68afc Block Editor: Update packages and backport the latest Gutenberg fixes.
This includes the following fixes:

- Generate babel polyfill dynamically https://github.com/WordPress/gutenberg/pull/31279
- Improve the List View component https://github.com/WordPress/gutenberg/pull/31290 https://github.com/WordPress/gutenberg/pull/32063
- Template mode:
    - Fix embed dimensions https://github.com/WordPress/gutenberg/pull/32057
    - Update the welcome guide https://github.com/WordPress/gutenberg/pull/32055 https://github.com/WordPress/gutenberg/pull/32026
    - Don’t display the notice at the same time as the welcome guide https://github.com/WordPress/gutenberg/pull/32076
    - Remove MetaBoxes https://github.com/WordPress/gutenberg/pull/32315
    - Update the title area https://github.com/WordPress/gutenberg/pull/32037 
- Widgets Screen:
    - Fix unsaved changes https://github.com/WordPress/gutenberg/pull/31757
    - Fix toolbar alignment https://github.com/WordPress/gutenberg/pull/31991
    - Fix block toolbar position after scroll https://github.com/WordPress/gutenberg/pull/32212
    - Fix the visible widget area header https://github.com/WordPress/gutenberg/pull/32262
    - Fix legacy widgets preview https://github.com/WordPress/gutenberg/pull/32260
    - 
- Block Widgets in the customizer: 
    - Fix customizer title overlapping block toolbar https://github.com/WordPress/gutenberg/pull/32140
    - Fix styling issues https://github.com/WordPress/gutenberg/pull/32072
    - Fix escape key events https://github.com/WordPress/gutenberg/pull/32175
    - Add preferences menu group label https://github.com/WordPress/gutenberg/pull/32259
    - Fix creating and replacing legacy widgets https://github.com/WordPress/gutenberg/pull/32005
    - Fix the welcome guide’s image https://github.com/WordPress/gutenberg/pull/32264 https://github.com/WordPress/gutenberg/pull/32302 
- Fix Cover to Image transform duotone error https://github.com/WordPress/gutenberg/pull/32006
- Remove filter_var usage from blocks https://github.com/WordPress/gutenberg/pull/32046 
- Fix image width for aligned Post Featured Image block https://github.com/WordPress/gutenberg/pull/32070
- Prevent excessive Image block re-rendering https://github.com/WordPress/gutenberg/pull/32102
- Remove gutenberg domain from core blocks https://github.com/WordPress/gutenberg/pull/32152
- Use the block editor context class for the the different settings filters https://github.com/WordPress/gutenberg/pull/32159
- Fix Latest Posts block grid view https://github.com/WordPress/gutenberg/pull/32160
- Fix preset classes generation per block https://github.com/WordPress/gutenberg/pull/32190
- Fix logic to enable custom colors and gradients https://github.com/WordPress/gutenberg/pull/32200
- Update the Site Logo logic to use a dedicated site option https://github.com/WordPress/gutenberg/pull/32229
- Limit the Latest Posts block’s featured image width https://github.com/WordPress/gutenberg/pull/32245
- Remove opacity animation in the canvas. https://github.com/WordPress/gutenberg/pull/32266
- Make the focus style valid CSS https://github.com/WordPress/gutenberg/pull/32305
- Fix theme.json styles for the core/list block https://github.com/WordPress/gutenberg/pull/32343
- Fix PHP notice when calling render_block https://github.com/WordPress/gutenberg/pull/32135

Props nosolosw, noisysocks.
See #52991.

Built from https://develop.svn.wordpress.org/trunk@51051


git-svn-id: http://core.svn.wordpress.org/trunk@50660 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-01 08:10:04 +00:00

2 lines
18 KiB
JavaScript

/*! This file is auto-generated */
this.wp=this.wp||{},this.wp.formatLibrary=function(e){var t={};function c(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,c),o.l=!0,o.exports}return c.m=e,c.c=t,c.d=function(e,t,n){c.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},c.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},c.t=function(e,t){if(1&t&&(e=c(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(c.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)c.d(n,o,function(t){return e[t]}.bind(null,o));return n},c.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return c.d(t,"a",t),t},c.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},c.p="",c(c.s="t1DA")}({"1Yn1":function(e,t,c){"use strict";var n=c("GRId"),o=c("Tqx9");const r=Object(n.createElement)(o.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(n.createElement)(o.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=r},"1ZqX":function(e,t){e.exports=window.wp.data},Bpkj:function(e,t,c){"use strict";var n=c("GRId"),o=c("Tqx9");const r=Object(n.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)(o.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=r},Crq9:function(e,t,c){"use strict";var n=c("GRId"),o=c("Tqx9");const r=Object(n.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)(o.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=r},GRId:function(e,t){e.exports=window.wp.element},Mmq9:function(e,t){e.exports=window.wp.url},Mp0b:function(e,t,c){"use strict";var n=c("GRId"),o=c("Tqx9");const r=Object(n.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)(o.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=r},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,c){"use strict";var n=c("GRId"),o=c("Tqx9");const r=Object(n.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},Object(n.createElement)(o.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=r},gdqT:function(e,t){e.exports=window.wp.a11y},iClF:function(e,t,c){"use strict";var n=c("GRId");t.a=function({icon:e,size:t=24,...c}){return Object(n.cloneElement)(e,{width:t,height:t,...c})}},l3Sj:function(e,t){e.exports=window.wp.i18n},oMoS:function(e,t,c){"use strict";var n=c("GRId"),o=c("Tqx9");const r=Object(n.createElement)(o.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(n.createElement)(o.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=r},qRz9:function(e,t){e.exports=window.wp.richText},rmEH:function(e,t){e.exports=window.wp.htmlEntities},t1DA:function(e,t,c){"use strict";c.r(t);var n=c("qRz9"),o=c("GRId"),r=c("l3Sj"),a=c("axFQ"),i=c("Tqx9");var l=Object(o.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)(i.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(r.__)("Bold"),u={name:"core/bold",title:s,tagName:"strong",className:null,edit({isActive:e,value:t,onChange:c,onFocus:r}){function i(){c(Object(n.toggleFormat)(t,{type:"core/bold"}))}return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(a.RichTextShortcut,{type:"primary",character:"b",onUse:i}),Object(o.createElement)(a.RichTextToolbarButton,{name:"bold",icon:l,title:s,onClick:function(){i(),r()},isActive:e,shortcutType:"primary",shortcutCharacter:"b"}),Object(o.createElement)(a.__unstableRichTextInputEvent,{inputType:"formatBold",onInput:i}))}};var b=c("1Yn1");const m=Object(r.__)("Inline code"),p={name:"core/code",title:m,tagName:"code",className:null,__unstableInputRule(e){const{start:t,text:c}=e;if("`"!==c.slice(t-1,t))return e;const o=c.slice(0,t-1).lastIndexOf("`");if(-1===o)return e;const r=o,a=t-2;return r===a?e:(e=Object(n.remove)(e,r,r+1),e=Object(n.remove)(e,a,a+1),e=Object(n.applyFormat)(e,{type:"core/code"},r,a))},edit:({value:e,onChange:t,onFocus:c,isActive:r})=>Object(o.createElement)(a.RichTextToolbarButton,{icon:b.a,title:m,onClick:function(){t(Object(n.toggleFormat)(e,{type:"core/code"})),c()},isActive:r})};var h=c("tI+e"),j=c("btIw");const O=["image"],v=Object(r.__)("Inline image"),d={name:"core/image",title:v,keywords:[Object(r.__)("photo"),Object(r.__)("media")],object:!0,tagName:"img",className:null,attributes:{className:"class",style:"style",url:"src",alt:"alt"},edit:function({value:e,onChange:t,onFocus:c,isObjectActive:r,activeObjectAttributes:i,contentRef:l}){const[s,u]=Object(o.useState)(!1);function b(){u(!1)}return Object(o.createElement)(a.MediaUploadCheck,null,Object(o.createElement)(a.RichTextToolbarButton,{icon:Object(o.createElement)(h.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.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:v,onClick:function(){u(!0)},isActive:r}),s&&Object(o.createElement)(a.MediaUpload,{allowedTypes:O,onSelect:({id:o,url:r,alt:a,width:i})=>{b(),t(Object(n.insertObject)(e,{type:"core/image",attributes:{className:"wp-image-"+o,style:`width: ${Math.min(i,150)}px;`,url:r,alt:a}})),c()},onClose:b,render:({open:e})=>(e(),null)}),r&&Object(o.createElement)(g,{value:e,onChange:t,activeObjectAttributes:i,contentRef:l}))}};function g({value:e,onChange:t,activeObjectAttributes:c,contentRef:a}){const{style:i}=c,[l,s]=Object(o.useState)(null==i?void 0:i.replace(/\D/g,"")),u=Object(n.useAnchorRef)({ref:a,value:e,settings:d});return Object(o.createElement)(h.Popover,{position:"bottom center",focusOnMount:!1,anchorRef:u,className:"block-editor-format-toolbar__image-popover"},Object(o.createElement)("form",{className:"block-editor-format-toolbar__image-container-content",onSubmit:n=>{const o=e.replacements.slice();o[e.start]={type:"core/image",attributes:{...c,style:`width: ${l}px;`}},t({...e,replacements:o}),n.preventDefault()}},Object(o.createElement)(h.TextControl,{className:"block-editor-format-toolbar__image-container-value",type:"number",label:Object(r.__)("Width"),value:l,min:1,onChange:e=>s(e)}),Object(o.createElement)(h.Button,{icon:j.a,label:Object(r.__)("Apply"),type:"submit"})))}var f=Object(o.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)(i.Path,{d:"M12.5 5L10 19h1.9l2.5-14z"}));const w=Object(r.__)("Italic"),y={name:"core/italic",title:w,tagName:"em",className:null,edit({isActive:e,value:t,onChange:c,onFocus:r}){function i(){c(Object(n.toggleFormat)(t,{type:"core/italic"}))}return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(a.RichTextShortcut,{type:"primary",character:"i",onUse:i}),Object(o.createElement)(a.RichTextToolbarButton,{name:"italic",icon:f,title:w,onClick:function(){i(),r()},isActive:e,shortcutType:"primary",shortcutCharacter:"i"}),Object(o.createElement)(a.__unstableRichTextInputEvent,{inputType:"formatItalic",onInput:i}))}};var x=c("Mmq9"),E=c("rmEH"),_=c("Mp0b"),C=c("Bpkj"),T=c("gdqT"),k=c("YLtl");var R=Object(h.withSpokenMessages)((function({isActive:e,activeAttributes:t,addingLink:c,value:i,onChange:l,speak:s,stopAddingLink:u,contentRef:b}){const[m,p]=Object(o.useState)(),j={url:t.url,type:t.type,id:t.id,opensInNewTab:"_blank"===t.target,...m},O=Object(n.useAnchorRef)({ref:b,value:i,settings:F}),v=Object(o.useRef)(!!c&&"firstElement");return Object(o.createElement)(h.Popover,{anchorRef:O,focusOnMount:v.current,onClose:u,position:"bottom center"},Object(o.createElement)(a.__experimentalLinkControl,{value:j,onChange:function(t){t={...m,...t};const c=j.opensInNewTab!==t.opensInNewTab&&j.url===t.url,o=c&&void 0===t.url;if(p(o?t:void 0),o)return;const a=Object(x.prependHTTP)(t.url),b=function({url:e,type:t,id:c,opensInNewWindow:n}){const o={type:"core/link",attributes:{url:e}};return t&&(o.attributes.type=t),c&&(o.attributes.id=c),n&&(o.attributes.target="_blank",o.attributes.rel="noreferrer noopener"),o}({url:a,type:t.type,id:void 0!==t.id&&null!==t.id?String(t.id):void 0,opensInNewWindow:t.opensInNewTab});if(Object(n.isCollapsed)(i)&&!e){const e=t.title||a,c=Object(n.applyFormat)(Object(n.create)({text:e}),b,0,e.length);l(Object(n.insert)(i,c))}else{const e=Object(n.applyFormat)(i,b);e.start=e.end,e.activeFormats=[],l(e)}c||u(),!function(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(k.startsWith)(e,"http")&&!/^https?:\/\/[^\/\s]/i.test(t))return!1;const c=Object(x.getAuthority)(t);if(!Object(x.isValidAuthority)(c))return!1;const n=Object(x.getPath)(t);if(n&&!Object(x.isValidPath)(n))return!1;const o=Object(x.getQueryString)(t);if(o&&!Object(x.isValidQueryString)(o))return!1;const r=Object(x.getFragment)(t);if(r&&!Object(x.isValidFragment)(r))return!1}return!(Object(k.startsWith)(t,"#")&&!Object(x.isValidFragment)(t))}(a)?s(Object(r.__)("Warning: the link has been inserted but may have errors. Please test it."),"assertive"):s(e?Object(r.__)("Link edited."):Object(r.__)("Link inserted."),"assertive")},forceIsEditingLink:c}))}));const S=Object(r.__)("Link");const F={name:"core/link",title:S,tagName:"a",className:null,attributes:{url:"href",type:"data-type",id:"data-id",target:"target"},__unstablePasteRule(e,{html:t,plainText:c}){if(Object(n.isCollapsed)(e))return e;const o=(t||c).replace(/<[^>]+>/g,"").trim();return Object(x.isURL)(o)?(window.console.log("Created link:\n\n",o),Object(n.applyFormat)(e,{type:"core/link",attributes:{url:Object(E.decodeEntities)(o)}})):e},edit:function({isActive:e,activeAttributes:t,value:c,onChange:i,onFocus:l,contentRef:s}){const[u,b]=Object(o.useState)(!1);function m(){const e=Object(n.getTextContent)(Object(n.slice)(c));e&&Object(x.isURL)(e)?i(Object(n.applyFormat)(c,{type:"core/link",attributes:{url:e}})):e&&Object(x.isEmail)(e)?i(Object(n.applyFormat)(c,{type:"core/link",attributes:{url:"mailto:"+e}})):b(!0)}function p(){i(Object(n.removeFormat)(c,"core/link")),Object(T.speak)(Object(r.__)("Link removed."),"assertive")}return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(a.RichTextShortcut,{type:"primary",character:"k",onUse:m}),Object(o.createElement)(a.RichTextShortcut,{type:"primaryShift",character:"k",onUse:p}),e&&Object(o.createElement)(a.RichTextToolbarButton,{name:"link",icon:_.a,title:Object(r.__)("Unlink"),onClick:p,isActive:e,shortcutType:"primaryShift",shortcutCharacter:"k"}),!e&&Object(o.createElement)(a.RichTextToolbarButton,{name:"link",icon:C.a,title:S,onClick:m,isActive:e,shortcutType:"primary",shortcutCharacter:"k"}),(u||e)&&Object(o.createElement)(R,{addingLink:u,stopAddingLink:function(){b(!1),l()},isActive:e,activeAttributes:t,value:c,onChange:i,contentRef:s}))}};var A=c("Crq9");const M=Object(r.__)("Strikethrough"),N={name:"core/strikethrough",title:M,tagName:"s",className:null,edit:({isActive:e,value:t,onChange:c,onFocus:r})=>Object(o.createElement)(a.RichTextToolbarButton,{icon:A.a,title:M,onClick:function(){c(Object(n.toggleFormat)(t,{type:"core/strikethrough"})),r()},isActive:e})},I={name:"core/underline",title:Object(r.__)("Underline"),tagName:"span",className:null,attributes:{style:"style"},edit({value:e,onChange:t}){const c=()=>{t(Object(n.toggleFormat)(e,{type:"core/underline",attributes:{style:"text-decoration: underline;"}}))};return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(a.RichTextShortcut,{type:"primary",character:"u",onUse:c}),Object(o.createElement)(a.__unstableRichTextInputEvent,{inputType:"formatUnderline",onInput:c}))}};var z=c("iClF"),B=c("uGfJ"),V=c("1ZqX");function P(e,t,c){const o=Object(n.getActiveFormat)(t,e);if(!o)return;const r=o.attributes.style;if(r)return r.replace(new RegExp("^color:\\s*"),"");const i=o.attributes.class;if(i){const e=i.replace(/.*has-([^\s]*)-color.*/,"$1");return Object(a.getColorObjectByAttributeValues)(c,e).color}}const H=({name:e,value:t,onChange:c})=>{const r=Object(V.useSelect)(e=>{const{getSettings:t}=e(a.store);return Object(k.get)(t(),["colors"],[])}),i=Object(o.useCallback)(o=>{if(o){const i=Object(a.getColorObjectByColorValue)(r,o);c(Object(n.applyFormat)(t,{type:e,attributes:i?{class:Object(a.getColorClassName)("color",i.slug)}:{style:"color:"+o}}))}else c(Object(n.removeFormat)(t,e))},[r,c]),l=Object(o.useMemo)(()=>P(e,t,r),[e,t,r]);return Object(o.createElement)(a.ColorPalette,{value:l,onChange:i})};function G({name:e,value:t,onChange:c,onClose:r,contentRef:i}){const l=Object(n.useAnchorRef)({ref:i,value:t,settings:U});return Object(o.createElement)(a.URLPopover,{value:t,onClose:r,className:"components-inline-color-popover",anchorRef:l},Object(o.createElement)(H,{name:e,value:t,onChange:c}))}const L=Object(r.__)("Text color"),q=[];const U={name:"core/text-color",title:L,tagName:"span",className:"has-inline-color",attributes:{style:"style",class:"class"},edit:function({value:e,onChange:t,isActive:c,activeAttributes:r,contentRef:i}){const l=Object(a.useSetting)("color.custom"),s=Object(a.useSetting)("color.palette")||q,[u,b]=Object(o.useState)(!1),m=Object(o.useCallback)(()=>b(!0),[b]),p=Object(o.useCallback)(()=>b(!1),[b]),h=Object(o.useMemo)(()=>{const t=P("core/text-color",e,s);if(t)return{backgroundColor:t}},[e,s]),j=!Object(k.isEmpty)(s)||!l;return j||c?Object(o.createElement)(o.Fragment,null,Object(o.createElement)(a.RichTextToolbarButton,{key:c?"text-color":"text-color-not-active",className:"format-library-text-color-button",name:c?"text-color":void 0,icon:Object(o.createElement)(o.Fragment,null,Object(o.createElement)(z.a,{icon:B.a}),c&&Object(o.createElement)("span",{className:"format-library-text-color-button__indicator",style:h})),title:L,onClick:j?m:()=>t(Object(n.removeFormat)(e,"core/text-color"))}),u&&Object(o.createElement)(G,{name:"core/text-color",onClose:p,activeAttributes:r,value:e,onChange:t,contentRef:i})):null}};var W=Object(o.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)(i.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 D=Object(r.__)("Subscript"),Q={name:"core/subscript",title:D,tagName:"sub",className:null,edit:({isActive:e,value:t,onChange:c,onFocus:r})=>Object(o.createElement)(a.RichTextToolbarButton,{icon:W,title:D,onClick:function(){c(Object(n.toggleFormat)(t,{type:"core/subscript"})),r()},isActive:e})};var Y=Object(o.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)(i.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 $=Object(r.__)("Superscript"),J={name:"core/superscript",title:$,tagName:"sup",className:null,edit:({isActive:e,value:t,onChange:c,onFocus:r})=>Object(o.createElement)(a.RichTextToolbarButton,{icon:Y,title:$,onClick:function(){c(Object(n.toggleFormat)(t,{type:"core/superscript"})),r()},isActive:e})};var X=c("oMoS");const Z=Object(r.__)("Keyboard input");[u,p,d,y,F,N,I,U,Q,J,{name:"core/keyboard",title:Z,tagName:"kbd",className:null,edit:({isActive:e,value:t,onChange:c,onFocus:r})=>Object(o.createElement)(a.RichTextToolbarButton,{icon:X.a,title:Z,onClick:function(){c(Object(n.toggleFormat)(t,{type:"core/keyboard"})),r()},isActive:e})}].forEach(({name:e,...t})=>Object(n.registerFormatType)(e,t))},"tI+e":function(e,t){e.exports=window.wp.components},uGfJ:function(e,t,c){"use strict";var n=c("GRId"),o=c("Tqx9");const r=Object(n.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)(o.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"}));t.a=r}});