2 lines
23 KiB
JavaScript
2 lines
23 KiB
JavaScript
/*! This file is auto-generated */
|
|
this.wp=this.wp||{},this.wp.formatLibrary=function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=428)}({0:function(t,e){!function(){t.exports=this.wp.element}()},1:function(t,e){!function(){t.exports=this.wp.i18n}()},12:function(t,e,n){"use strict";function r(){return(r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}n.d(e,"a",(function(){return r}))},13:function(t,e,n){"use strict";function r(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function o(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),t}n.d(e,"a",(function(){return o}))},14:function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}n.d(e,"a",(function(){return r}))},15:function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var r=n(32),o=n(7);function c(t,e){return!e||"object"!==Object(r.a)(e)&&"function"!=typeof e?Object(o.a)(t):e}},153:function(t,e,n){"use strict";var r=n(0),o=n(9),c=Object(r.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},Object(r.createElement)(o.Path,{d:"M17.74 2.76c1.68 1.69 1.68 4.41 0 6.1l-1.53 1.52c-1.12 1.12-2.7 1.47-4.14 1.09l2.62-2.61.76-.77.76-.76c.84-.84.84-2.2 0-3.04-.84-.85-2.2-.85-3.04 0l-.77.76-3.38 3.38c-.37-1.44-.02-3.02 1.1-4.14l1.52-1.53c1.69-1.68 4.42-1.68 6.1 0zM8.59 13.43l5.34-5.34c.42-.42.42-1.1 0-1.52-.44-.43-1.13-.39-1.53 0l-5.33 5.34c-.42.42-.42 1.1 0 1.52.44.43 1.13.39 1.52 0zm-.76 2.29l4.14-4.15c.38 1.44.03 3.02-1.09 4.14l-1.52 1.53c-1.69 1.68-4.41 1.68-6.1 0-1.68-1.68-1.68-4.42 0-6.1l1.53-1.52c1.12-1.12 2.7-1.47 4.14-1.1l-4.14 4.15c-.85.84-.85 2.2 0 3.05.84.84 2.2.84 3.04 0z"}));e.a=c},16:function(t,e,n){"use strict";function r(t){return(r=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}n.d(e,"a",(function(){return r}))},17:function(t,e,n){"use strict";function r(t,e){return(r=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&r(t,e)}n.d(e,"a",(function(){return o}))},189:function(t,e,n){"use strict";var r=n(0),o=n(9),c=Object(r.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},Object(r.createElement)(o.Path,{d:"M16 4h2v9H7v3l-5-4 5-4v3h9V4z"}));e.a=c},19:function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(41);function o(t,e){if(null==t)return{};var n,o,c=Object(r.a)(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(o=0;o<i.length;o++)n=i[o],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(c[n]=t[n])}return c}},2:function(t,e){!function(){t.exports=this.lodash}()},21:function(t,e){!function(){t.exports=this.wp.keycodes}()},22:function(t,e,n){"use strict";var r=n(36);var o=n(37);function c(t,e){return Object(r.a)(t)||function(t,e){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t)){var n=[],r=!0,o=!1,c=void 0;try{for(var i,a=t[Symbol.iterator]();!(r=(i=a.next()).done)&&(n.push(i.value),!e||n.length!==e);r=!0);}catch(t){o=!0,c=t}finally{try{r||null==a.return||a.return()}finally{if(o)throw c}}return n}}(t,e)||Object(o.a)()}n.d(e,"a",(function(){return c}))},24:function(t,e){!function(){t.exports=this.wp.richText}()},27:function(t,e){!function(){t.exports=this.wp.dom}()},28:function(t,e){!function(){t.exports=this.wp.url}()},288:function(t,e,n){"use strict";var r=n(0),o=n(9),c=Object(r.createElement)(o.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(r.createElement)(o.Path,{d:"M9.4,16.6L4.8,12l4.6-4.6L8,6l-6,6l6,6L9.4,16.6z M14.6,16.6l4.6-4.6l-4.6-4.6L16,6l6,6l-6,6L14.6,16.6z"}));e.a=c},3:function(t,e){!function(){t.exports=this.wp.components}()},32:function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}n.d(e,"a",(function(){return r}))},36:function(t,e,n){"use strict";function r(t){if(Array.isArray(t))return t}n.d(e,"a",(function(){return r}))},37:function(t,e,n){"use strict";function r(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}n.d(e,"a",(function(){return r}))},4:function(t,e){!function(){t.exports=this.wp.data}()},41:function(t,e,n){"use strict";function r(t,e){if(null==t)return{};var n,r,o={},c=Object.keys(t);for(r=0;r<c.length;r++)n=c[r],e.indexOf(n)>=0||(o[n]=t[n]);return o}n.d(e,"a",(function(){return r}))},428:function(t,e,n){"use strict";n.r(e);var r=n(19),o=n(24),c=n(0),i=n(1),a=n(6),l=n(9),u=Object(c.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},Object(c.createElement)(l.Path,{d:"M6 4v13h4.54c1.37 0 2.46-.33 3.26-1 .8-.66 1.2-1.58 1.2-2.77 0-.84-.17-1.51-.51-2.01s-.9-.85-1.67-1.03v-.09c.57-.1 1.02-.4 1.36-.9s.51-1.13.51-1.91c0-1.14-.39-1.98-1.17-2.5C12.75 4.26 11.5 4 9.78 4H6zm2.57 5.15V6.26h1.36c.73 0 1.27.11 1.61.32.34.22.51.58.51 1.07 0 .54-.16.92-.47 1.15s-.82.35-1.51.35h-1.5zm0 2.19h1.6c1.44 0 2.16.53 2.16 1.61 0 .6-.17 1.05-.51 1.34s-.86.43-1.57.43H8.57v-3.38z"})),s="core/bold",b=Object(i.__)("Bold"),p={name:s,title:b,tagName:"strong",className:null,edit:function(t){var e=t.isActive,n=t.value,r=t.onChange,i=t.onFocus;function l(){r(Object(o.toggleFormat)(n,{type:s}))}return Object(c.createElement)(c.Fragment,null,Object(c.createElement)(a.RichTextShortcut,{type:"primary",character:"b",onUse:l}),Object(c.createElement)(a.RichTextToolbarButton,{name:"bold",icon:u,title:b,onClick:function(){l(),i()},isActive:e,shortcutType:"primary",shortcutCharacter:"b"}),Object(c.createElement)(a.__unstableRichTextInputEvent,{inputType:"formatBold",onInput:l}))}},f=n(288),m="core/code",O=Object(i.__)("Inline Code"),v={name:m,title:O,tagName:"code",className:null,__unstableInputRule:function(t){var e=t,n=e.start,r=e.text;if("`"!==r.slice(n-1,n))return t;var c=r.slice(0,n-1).lastIndexOf("`");if(-1===c)return t;var i=c,a=n-2;return i===a?t:(t=Object(o.remove)(t,i,i+1),t=Object(o.remove)(t,a,a+1),t=Object(o.applyFormat)(t,{type:m},i,a))},edit:function(t){var e=t.value,n=t.onChange,r=t.onFocus,i=t.isActive;return Object(c.createElement)(a.RichTextToolbarButton,{icon:f.a,title:O,onClick:function(){n(Object(o.toggleFormat)(e,{type:m})),r()},isActive:i})}},j=n(5),h=n(14),d=n(13),g=n(15),y=n(16),w=n(7),E=n(17),k=n(3),x=n(21),C=n(189);function _(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function S(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?_(Object(n),!0).forEach((function(e){Object(j.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):_(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var T=["image"],P=Object(i.__)("Inline image"),A=function(t){return t.stopPropagation()};var M={name:"core/image",title:P,keywords:[Object(i.__)("photo"),Object(i.__)("media")],object:!0,tagName:"img",className:null,attributes:{className:"class",style:"style",url:"src",alt:"alt"},edit:function(t){function e(){var t;return Object(h.a)(this,e),(t=Object(g.a)(this,Object(y.a)(e).apply(this,arguments))).onChange=t.onChange.bind(Object(w.a)(t)),t.onKeyDown=t.onKeyDown.bind(Object(w.a)(t)),t.openModal=t.openModal.bind(Object(w.a)(t)),t.closeModal=t.closeModal.bind(Object(w.a)(t)),t.state={modal:!1},t}return Object(E.a)(e,t),Object(d.a)(e,[{key:"onChange",value:function(t){this.setState({width:t})}},{key:"onKeyDown",value:function(t){[x.LEFT,x.DOWN,x.RIGHT,x.UP,x.BACKSPACE,x.ENTER].indexOf(t.keyCode)>-1&&t.stopPropagation()}},{key:"openModal",value:function(){this.setState({modal:!0})}},{key:"closeModal",value:function(){this.setState({modal:!1})}},{key:"render",value:function(){var t,e=this,n=this.props,r=n.value,l=n.onChange,u=n.onFocus,s=n.isObjectActive,b=n.activeObjectAttributes;return Object(c.createElement)(a.MediaUploadCheck,null,Object(c.createElement)(a.RichTextToolbarButton,{icon:Object(c.createElement)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(c.createElement)(k.Path,{d:"M4 16h10c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v9c0 1.1.9 2 2 2zM4 5h10v9H4V5zm14 9v2h4v-2h-4zM2 20h20v-2H2v2zm6.4-8.8L7 9.4 5 12h8l-2.6-3.4-2 2.6z"})),title:P,onClick:this.openModal,isActive:s}),this.state.modal&&Object(c.createElement)(a.MediaUpload,{allowedTypes:T,onSelect:function(t){var n=t.id,c=t.url,i=t.alt,a=t.width;e.closeModal(),l(Object(o.insertObject)(r,{type:"core/image",attributes:{className:"wp-image-".concat(n),style:"width: ".concat(Math.min(a,150),"px;"),url:c,alt:i}})),u()},onClose:this.closeModal,render:function(t){return(0,t.open)(),null}}),s&&Object(c.createElement)(k.Popover,{position:"bottom center",focusOnMount:!1,anchorRef:(t=window.getSelection(),t.rangeCount?t.getRangeAt(0):null)},Object(c.createElement)("form",{className:"block-editor-format-toolbar__image-container-content",onKeyPress:A,onKeyDown:this.onKeyDown,onSubmit:function(t){var n=r.replacements.slice();n[r.start]={type:"core/image",attributes:S({},b,{style:"width: ".concat(e.state.width,"px;")})},l(S({},r,{replacements:n})),t.preventDefault()}},Object(c.createElement)(k.TextControl,{className:"block-editor-format-toolbar__image-container-value",type:"number",label:Object(i.__)("Width"),value:this.state.width,min:1,onChange:this.onChange}),Object(c.createElement)(k.Button,{icon:C.a,label:Object(i.__)("Apply"),type:"submit"}))))}}],[{key:"getDerivedStateFromProps",value:function(t,e){var n=t.activeObjectAttributes.style;return n===e.previousStyle?null:n?{width:n.replace(/\D/g,""),previousStyle:n}:{width:void 0,previousStyle:n}}}]),e}(c.Component)},L=Object(c.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},Object(c.createElement)(l.Path,{d:"M14.78 6h-2.13l-2.8 9h2.12l-.62 2H4.6l.62-2h2.14l2.8-9H8.03l.62-2h6.75z"})),N="core/italic",F=Object(i.__)("Italic"),R={name:N,title:F,tagName:"em",className:null,edit:function(t){var e=t.isActive,n=t.value,r=t.onChange,i=t.onFocus;function l(){r(Object(o.toggleFormat)(n,{type:N}))}return Object(c.createElement)(c.Fragment,null,Object(c.createElement)(a.RichTextShortcut,{type:"primary",character:"i",onUse:l}),Object(c.createElement)(a.RichTextToolbarButton,{name:"italic",icon:L,title:F,onClick:function(){l(),i()},isActive:e,shortcutType:"primary",shortcutCharacter:"i"}),Object(c.createElement)(a.__unstableRichTextInputEvent,{inputType:"formatItalic",onInput:l}))}},z=n(28),B=n(56),H=Object(c.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},Object(c.createElement)(l.Path,{d:"M17.74 2.26c1.68 1.69 1.68 4.41 0 6.1l-1.53 1.52c-.32.33-.69.58-1.08.77L13 10l1.69-1.64.76-.77.76-.76c.84-.84.84-2.2 0-3.04-.84-.85-2.2-.85-3.04 0l-.77.76-.76.76L10 7l-.65-2.14c.19-.38.44-.75.77-1.07l1.52-1.53c1.69-1.68 4.42-1.68 6.1 0zM2 4l8 6-6-8zm4-2l4 8-2-8H6zM2 6l8 4-8-2V6zm7.36 7.69L10 13l.74 2.35-1.38 1.39c-1.69 1.68-4.41 1.68-6.1 0-1.68-1.68-1.68-4.42 0-6.1l1.39-1.38L7 10l-.69.64-1.52 1.53c-.85.84-.85 2.2 0 3.04.84.85 2.2.85 3.04 0zM18 16l-8-6 6 8zm-4 2l-4-8 2 8h2zm4-4l-8-4 8 2v2z"})),I=n(153),V=n(22),D=n(2);function U(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function G(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?U(Object(n),!0).forEach((function(e){Object(j.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):U(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var K=Object(k.withSpokenMessages)((function(t){var e=t.isActive,n=t.activeAttributes,r=t.addingLink,l=t.value,u=t.onChange,s=t.speak,b=t.stopAddingLink,p=Object(c.useMemo)(D.uniqueId,[r]),f=Object(c.useState)(),m=Object(V.a)(f,2),O=m[0],v=m[1],j=Object(c.useMemo)((function(){var t=window.getSelection();if(t.rangeCount){var n=t.getRangeAt(0);if(r&&!e)return n;var o=n.startContainer;for(o=o.nextElementSibling||o;o.nodeType!==window.Node.ELEMENT_NODE;)o=o.parentNode;return o.closest("a")}}),[r,l.start,l.end]),h=G({url:n.url,opensInNewTab:"_blank"===n.target},O);return Object(c.createElement)(k.Popover,{key:p,anchorRef:j,focusOnMount:!!r&&"firstElement",onClose:b,position:"bottom center"},Object(c.createElement)(a.__experimentalLinkControl,{value:h,onChange:function(t){t=G({},O,{},t);var n=h.opensInNewTab!==t.opensInNewTab&&h.url===t.url,r=n&&void 0===t.url;if(v(r?t:void 0),!r){var c=Object(z.prependHTTP)(t.url),a=Object(o.getTextContent)(Object(o.slice)(l)),p=function(t){var e=t.url,n=t.opensInNewWindow,r=t.text,o={type:"core/link",attributes:{url:e}};if(n){var c=Object(i.sprintf)(Object(i.__)("%s (opens in a new tab)"),r);o.attributes.target="_blank",o.attributes.rel="noreferrer noopener",o.attributes["aria-label"]=c}return o}({url:c,opensInNewWindow:t.opensInNewTab,text:a});if(Object(o.isCollapsed)(l)&&!e){var f=Object(o.applyFormat)(Object(o.create)({text:c}),p,0,c.length);u(Object(o.insert)(l,f))}else u(Object(o.applyFormat)(l,p));n||b(),!function(t){if(!t)return!1;var e=t.trim();if(!e)return!1;if(/^\S+:/.test(e)){var n=Object(z.getProtocol)(e);if(!Object(z.isValidProtocol)(n))return!1;if(Object(D.startsWith)(n,"http")&&!/^https?:\/\/[^\/\s]/i.test(e))return!1;var r=Object(z.getAuthority)(e);if(!Object(z.isValidAuthority)(r))return!1;var o=Object(z.getPath)(e);if(o&&!Object(z.isValidPath)(o))return!1;var c=Object(z.getQueryString)(e);if(c&&!Object(z.isValidQueryString)(c))return!1;var i=Object(z.getFragment)(e);if(i&&!Object(z.isValidFragment)(i))return!1}return!(Object(D.startsWith)(e,"#")&&!Object(z.isValidFragment)(e))}(c)?s(Object(i.__)("Warning: the link has been inserted but may have errors. Please test it."),"assertive"):s(e?Object(i.__)("Link edited."):Object(i.__)("Link inserted."),"assertive")}},forceIsEditingLink:r}))})),W=Object(i.__)("Link"),Q={name:"core/link",title:W,tagName:"a",className:null,attributes:{url:"href",target:"target"},__unstablePasteRule:function(t,e){var n=e.html,r=e.plainText;if(Object(o.isCollapsed)(t))return t;var c=(n||r).replace(/<[^>]+>/g,"").trim();return Object(z.isURL)(c)?(window.console.log("Created link:\n\n",c),Object(o.applyFormat)(t,{type:"core/link",attributes:{url:Object(B.decodeEntities)(c)}})):t},edit:Object(k.withSpokenMessages)(function(t){function e(){var t;return Object(h.a)(this,e),(t=Object(g.a)(this,Object(y.a)(e).apply(this,arguments))).addLink=t.addLink.bind(Object(w.a)(t)),t.stopAddingLink=t.stopAddingLink.bind(Object(w.a)(t)),t.onRemoveFormat=t.onRemoveFormat.bind(Object(w.a)(t)),t.state={addingLink:!1},t}return Object(E.a)(e,t),Object(d.a)(e,[{key:"addLink",value:function(){var t=this.props,e=t.value,n=t.onChange,r=Object(o.getTextContent)(Object(o.slice)(e));r&&Object(z.isURL)(r)?n(Object(o.applyFormat)(e,{type:"core/link",attributes:{url:r}})):r&&Object(z.isEmail)(r)?n(Object(o.applyFormat)(e,{type:"core/link",attributes:{url:"mailto:".concat(r)}})):this.setState({addingLink:!0})}},{key:"stopAddingLink",value:function(){this.setState({addingLink:!1}),this.props.onFocus()}},{key:"onRemoveFormat",value:function(){var t=this.props,e=t.value,n=t.onChange,r=t.speak;n(Object(o.removeFormat)(e,"core/link")),r(Object(i.__)("Link removed."),"assertive")}},{key:"render",value:function(){var t=this.props,e=t.isActive,n=t.activeAttributes,r=t.value,o=t.onChange;return Object(c.createElement)(c.Fragment,null,Object(c.createElement)(a.RichTextShortcut,{type:"primary",character:"k",onUse:this.addLink}),Object(c.createElement)(a.RichTextShortcut,{type:"primaryShift",character:"k",onUse:this.onRemoveFormat}),e&&Object(c.createElement)(a.RichTextToolbarButton,{name:"link",icon:H,title:Object(i.__)("Unlink"),onClick:this.onRemoveFormat,isActive:e,shortcutType:"primaryShift",shortcutCharacter:"k"}),!e&&Object(c.createElement)(a.RichTextToolbarButton,{name:"link",icon:I.a,title:W,onClick:this.addLink,isActive:e,shortcutType:"primary",shortcutCharacter:"k"}),(this.state.addingLink||e)&&Object(c.createElement)(K,{addingLink:this.state.addingLink,stopAddingLink:this.stopAddingLink,isActive:e,activeAttributes:n,value:r,onChange:o}))}}]),e}(c.Component))},q=Object(c.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},Object(c.createElement)(l.Path,{d:"M15.82 12.25c.26 0 .5-.02.74-.07.23-.05.48-.12.73-.2v.84c-.46.17-.99.26-1.58.26-.88 0-1.54-.26-2.01-.79-.39-.44-.62-1.04-.68-1.79h-.94c.12.21.18.48.18.79 0 .54-.18.95-.55 1.26-.38.3-.9.45-1.56.45H8v-2.5H6.59l.93 2.5H6.49l-.59-1.67H3.62L3.04 13H2l.93-2.5H2v-1h1.31l.93-2.49H5.3l.92 2.49H8V7h1.77c1 0 1.41.17 1.77.41.37.24.55.62.55 1.13 0 .35-.09.64-.27.87l-.08.09h1.29c.05-.4.15-.77.31-1.1.23-.46.55-.82.98-1.06.43-.25.93-.37 1.51-.37.61 0 1.17.12 1.69.38l-.35.81c-.2-.1-.42-.18-.64-.25s-.46-.11-.71-.11c-.55 0-.99.2-1.31.59-.23.29-.38.66-.44 1.11H17v1h-2.95c.06.5.2.9.44 1.19.3.37.75.56 1.33.56zM4.44 8.96l-.18.54H5.3l-.22-.61c-.04-.11-.09-.28-.17-.51-.07-.24-.12-.41-.14-.51-.08.33-.18.69-.33 1.09zm4.53-1.09V9.5h1.19c.28-.02.49-.09.64-.18.19-.13.28-.35.28-.66 0-.28-.1-.48-.3-.61-.2-.12-.53-.18-.97-.18h-.84zm-3.33 2.64v-.01H3.91v.01h1.73zm5.28.01l-.03-.02H8.97v1.68h1.04c.4 0 .71-.08.92-.23.21-.16.31-.4.31-.74 0-.31-.11-.54-.32-.69z"})),$="core/strikethrough",J=Object(i.__)("Strikethrough"),X={name:$,title:J,tagName:"s",className:null,edit:function(t){var e=t.isActive,n=t.value,r=t.onChange,i=t.onFocus;return Object(c.createElement)(a.RichTextToolbarButton,{icon:q,title:J,onClick:function(){r(Object(o.toggleFormat)(n,{type:$})),i()},isActive:e})}},Y={name:"core/underline",title:Object(i.__)("Underline"),tagName:"span",className:null,attributes:{style:"style"},edit:function(t){var e=t.value,n=t.onChange,r=function(){n(Object(o.toggleFormat)(e,{type:"core/underline",attributes:{style:"text-decoration: underline;"}}))};return Object(c.createElement)(c.Fragment,null,Object(c.createElement)(a.RichTextShortcut,{type:"primary",character:"u",onUse:r}),Object(c.createElement)(a.__unstableRichTextInputEvent,{inputType:"formatUnderline",onInput:r}))}},Z=n(4),tt=n(12),et=n(27);function nt(t,e,n){var r=Object(o.getActiveFormat)(e,t);if(r){var c=r.attributes.style;if(c)return c.replace(new RegExp("^color:\\s*"),"");var i=r.attributes.class;if(i){var l=i.replace(/.*has-(.*?)-color.*/,"$1");return Object(a.getColorObjectByAttributeValues)(n,l).color}}}var rt=function(t){var e=t.isActive,n=t.addingColor,o=t.value,i=Object(r.a)(t,["isActive","addingColor","value"]),l=Object(c.useMemo)((function(){var t=window.getSelection(),e=t.rangeCount>0?t.getRangeAt(0):null;if(e){if(n)return Object(et.getRectangleFromRange)(e);var r=e.startContainer;for(r=r.nextElementSibling||r;r.nodeType!==window.Node.ELEMENT_NODE;)r=r.parentNode;var o=r.closest("span");return o?o.getBoundingClientRect():void 0}}),[e,n,o.start,o.end]);return l?Object(c.createElement)(a.URLPopover,Object(tt.a)({anchorRect:l},i)):null},ot=function(t){var e=t.name,n=t.value,r=t.onChange,i=Object(Z.useSelect)((function(t){var e=t("core/block-editor").getSettings;return Object(D.get)(e(),["colors"],[])})),l=Object(c.useCallback)((function(t){if(t){var c=Object(a.getColorObjectByColorValue)(i,t);r(Object(o.applyFormat)(n,{type:e,attributes:c?{class:Object(a.getColorClassName)("color",c.slug)}:{style:"color:".concat(t)}}))}else r(Object(o.removeFormat)(n,e))}),[i,r]),u=Object(c.useMemo)((function(){return nt(e,n,i)}),[e,n,i]);return Object(c.createElement)(a.ColorPalette,{value:u,onChange:l})},ct=Object(k.withSpokenMessages)((function(t){var e=t.name,n=t.value,r=t.onChange,o=t.onClose,i=t.isActive,a=t.addingColor;return Object(c.createElement)(rt,{value:n,isActive:i,addingColor:a,onClose:o,className:"components-inline-color-popover"},Object(c.createElement)(ot,{name:e,value:n,onChange:r}))})),it="core/text-color",at=Object(i.__)("Text Color"),lt=[];[p,v,M,R,Q,X,Y,{name:it,title:at,tagName:"span",className:"has-inline-color",attributes:{style:"style",class:"class"},edit:function(t){var e=t.value,n=t.onChange,r=t.isActive,o=t.activeAttributes,i=Object(Z.useSelect)((function(t){var e=t("core/block-editor").getSettings;return e?Object(D.get)(e(),["colors"],lt):lt})),l=Object(c.useState)(!1),u=Object(V.a)(l,2),s=u[0],b=u[1],p=Object(c.useCallback)((function(){return b(!0)}),[b]),f=Object(c.useCallback)((function(){return b(!1)}),[b]),m=Object(c.useMemo)((function(){var t=nt(it,e,i);if(t)return{backgroundColor:t}}),[e,i]);return Object(c.createElement)(c.Fragment,null,Object(c.createElement)(a.RichTextToolbarButton,{key:r?"text-color":"text-color-not-active",className:"format-library-text-color-button",name:r?"text-color":void 0,icon:Object(c.createElement)(c.Fragment,null,Object(c.createElement)(k.Dashicon,{icon:"editor-textcolor"}),r&&Object(c.createElement)("span",{className:"format-library-text-color-button__indicator",style:m})),title:at,onClick:p}),s&&Object(c.createElement)(ct,{name:it,addingColor:s,onClose:f,isActive:r,activeAttributes:o,value:e,onChange:n}))}}].forEach((function(t){var e=t.name,n=Object(r.a)(t,["name"]);return Object(o.registerFormatType)(e,n)}))},5:function(t,e,n){"use strict";function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}n.d(e,"a",(function(){return r}))},56:function(t,e){!function(){t.exports=this.wp.htmlEntities}()},6:function(t,e){!function(){t.exports=this.wp.blockEditor}()},7:function(t,e,n){"use strict";function r(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}n.d(e,"a",(function(){return r}))},9:function(t,e){!function(){t.exports=this.wp.primitives}()}}); |