WordPress/wp-includes/js/dist/format-library.min.js
gziolo c3ea09ebb8 Editor: Update WordPress packages published for Gutenberg 10.6
It contains several changes in addition to regular update to WordPress packages:
- All newly exposed blocks are now registered on the server.
- Dutone block support was added.
- Border block support was updated.
- New shared function `construct_wp_query_args` was added for the family of Query blocks - it might need some further work.

Props youknowriad.
See #52991.



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


git-svn-id: http://core.svn.wordpress.org/trunk@50538 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-19 15:09:27 +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=565)}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.wp.i18n},123:function(e,t,c){"use strict";var n=c(0),o=c(3);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},14:function(e,t){e.exports=window.wp.richText},141:function(e,t,c){"use strict";var n=c(0),o=c(3);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},144:function(e,t,c){"use strict";var n=c(0),o=c(3);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},163:function(e,t,c){"use strict";var n=c(0),o=c(3);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},175:function(e,t,c){"use strict";var n=c(0),o=c(3);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},176:function(e,t,c){"use strict";var n=c(0),o=c(3);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},184:function(e,t,c){"use strict";var n=c(0),o=c(3);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},2:function(e,t){e.exports=window.lodash},20:function(e,t){e.exports=window.wp.url},3:function(e,t){e.exports=window.wp.primitives},30:function(e,t){e.exports=window.wp.a11y},320:function(e,t,c){"use strict";var n=c(0),o=c(3);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:"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"}));t.a=r},321:function(e,t,c){"use strict";var n=c(0),o=c(3);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.5 5L10 19h1.9l2.5-14z"}));t.a=r},324:function(e,t,c){"use strict";var n=c(0),o=c(3);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:"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"}));t.a=r},325:function(e,t,c){"use strict";var n=c(0),o=c(3);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:"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"}));t.a=r},4:function(e,t){e.exports=window.wp.components},41:function(e,t){e.exports=window.wp.htmlEntities},5:function(e,t){e.exports=window.wp.data},565:function(e,t,c){"use strict";c.r(t);var n=c(14),o=c(0),r=c(1),a=c(6),i=c(320);const l=Object(r.__)("Bold"),s={name:"core/bold",title:l,tagName:"strong",className:null,edit({isActive:e,value:t,onChange:c,onFocus:r}){function s(){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:s}),Object(o.createElement)(a.RichTextToolbarButton,{name:"bold",icon:i.a,title:l,onClick:function(){s(),r()},isActive:e,shortcutType:"primary",shortcutCharacter:"b"}),Object(o.createElement)(a.__unstableRichTextInputEvent,{inputType:"formatBold",onInput:s}))}};var u=c(176);const b=Object(r.__)("Inline code"),m={name:"core/code",title:b,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:u.a,title:b,onClick:function(){t(Object(n.toggleFormat)(e,{type:"core/code"})),c()},isActive:r})};var p=c(4),h=c(141);const O=["image"],j=Object(r.__)("Inline image"),v={name:"core/image",title:j,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)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)(p.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:j,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)(d,{value:e,onChange:t,activeObjectAttributes:i,contentRef:l}))}};function d({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:v});return Object(o.createElement)(p.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)(p.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)(p.Button,{icon:h.a,label:Object(r.__)("Apply"),type:"submit"})))}var g=c(321);const f=Object(r.__)("Italic"),w={name:"core/italic",title:f,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:g.a,title:f,onClick:function(){i(),r()},isActive:e,shortcutType:"primary",shortcutCharacter:"i"}),Object(o.createElement)(a.__unstableRichTextInputEvent,{inputType:"formatItalic",onInput:i}))}};var y=c(20),x=c(41),E=c(144),_=c(123),C=c(30),k=c(2);var T=Object(p.withSpokenMessages)((function({isActive:e,activeAttributes:t,addingLink:c,value:i,onChange:l,speak:s,stopAddingLink:u,contentRef:b}){const[m,h]=Object(o.useState)(),O={url:t.url,type:t.type,id:t.id,opensInNewTab:"_blank"===t.target,...m},j=Object(n.useAnchorRef)({ref:b,value:i,settings:R}),v=Object(o.useRef)(!!c&&"firstElement");return Object(o.createElement)(p.Popover,{anchorRef:j,focusOnMount:v.current,onClose:u,position:"bottom center"},Object(o.createElement)(a.__experimentalLinkControl,{value:O,onChange:function(t){t={...m,...t};const c=O.opensInNewTab!==t.opensInNewTab&&O.url===t.url,o=c&&void 0===t.url;if(h(o?t:void 0),o)return;const a=Object(y.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(y.getProtocol)(t);if(!Object(y.isValidProtocol)(e))return!1;if(Object(k.startsWith)(e,"http")&&!/^https?:\/\/[^\/\s]/i.test(t))return!1;const c=Object(y.getAuthority)(t);if(!Object(y.isValidAuthority)(c))return!1;const n=Object(y.getPath)(t);if(n&&!Object(y.isValidPath)(n))return!1;const o=Object(y.getQueryString)(t);if(o&&!Object(y.isValidQueryString)(o))return!1;const r=Object(y.getFragment)(t);if(r&&!Object(y.isValidFragment)(r))return!1}return!(Object(k.startsWith)(t,"#")&&!Object(y.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 F=Object(r.__)("Link");const R={name:"core/link",title:F,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(y.isURL)(o)?(window.console.log("Created link:\n\n",o),Object(n.applyFormat)(e,{type:"core/link",attributes:{url:Object(x.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(y.isURL)(e)?i(Object(n.applyFormat)(c,{type:"core/link",attributes:{url:e}})):e&&Object(y.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(C.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:E.a,title:Object(r.__)("Unlink"),onClick:p,isActive:e,shortcutType:"primaryShift",shortcutCharacter:"k"}),!e&&Object(o.createElement)(a.RichTextToolbarButton,{name:"link",icon:_.a,title:F,onClick:m,isActive:e,shortcutType:"primary",shortcutCharacter:"k"}),(u||e)&&Object(o.createElement)(T,{addingLink:u,stopAddingLink:function(){b(!1),l()},isActive:e,activeAttributes:t,value:c,onChange:i,contentRef:s}))}};var S=c(163);const A=Object(r.__)("Strikethrough"),N={name:"core/strikethrough",title:A,tagName:"s",className:null,edit:({isActive:e,value:t,onChange:c,onFocus:r})=>Object(o.createElement)(a.RichTextToolbarButton,{icon:S.a,title:A,onClick:function(){c(Object(n.toggleFormat)(t,{type:"core/strikethrough"})),r()},isActive:e})},M={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 V=c(97),z=c(184),B=c(5);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(B.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 L({name:e,value:t,onChange:c,onClose:r,contentRef:i}){const l=Object(n.useAnchorRef)({ref:i,value:t,settings:G});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 I=Object(r.__)("Text color"),U=[];const G={name:"core/text-color",title:I,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.__experimentalUseEditorFeature)("color.custom"),s=Object(a.__experimentalUseEditorFeature)("color.palette")||U,[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]),O=!Object(k.isEmpty)(s)||!l;return O||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)(V.a,{icon:z.a}),c&&Object(o.createElement)("span",{className:"format-library-text-color-button__indicator",style:h})),title:I,onClick:O?m:()=>t(Object(n.removeFormat)(e,"core/text-color"))}),u&&Object(o.createElement)(L,{name:"core/text-color",onClose:p,activeAttributes:r,value:e,onChange:(...e)=>{t(...e),p()},contentRef:i})):null}};var W=c(324);const $=Object(r.__)("Subscript"),D={name:"core/subscript",title:$,tagName:"sub",className:null,edit:({isActive:e,value:t,onChange:c,onFocus:r})=>Object(o.createElement)(a.RichTextToolbarButton,{icon:W.a,title:$,onClick:function(){c(Object(n.toggleFormat)(t,{type:"core/subscript"})),r()},isActive:e})};var Q=c(325);const K=Object(r.__)("Superscript"),q={name:"core/superscript",title:K,tagName:"sup",className:null,edit:({isActive:e,value:t,onChange:c,onFocus:r})=>Object(o.createElement)(a.RichTextToolbarButton,{icon:Q.a,title:K,onClick:function(){c(Object(n.toggleFormat)(t,{type:"core/superscript"})),r()},isActive:e})};var J=c(175);const X=Object(r.__)("Keyboard input");[s,m,v,w,R,N,M,G,D,q,{name:"core/keyboard",title:X,tagName:"kbd",className:null,edit:({isActive:e,value:t,onChange:c,onFocus:r})=>Object(o.createElement)(a.RichTextToolbarButton,{icon:J.a,title:X,onClick:function(){c(Object(n.toggleFormat)(t,{type:"core/keyboard"})),r()},isActive:e})}].forEach(({name:e,...t})=>Object(n.registerFormatType)(e,t))},6:function(e,t){e.exports=window.wp.blockEditor},97:function(e,t,c){"use strict";var n=c(0);t.a=function({icon:e,size:t=24,...c}){return Object(n.cloneElement)(e,{width:t,height:t,...c})}}});