WordPress/wp-includes/js/dist/format-library.min.js

2 lines
22 KiB
JavaScript
Raw Normal View History

/*! This file is auto-generated */
(()=>{"use strict";var t={r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e);const n=window.wp.richText,o=window.wp.i18n,r=window.wp.blockEditor,i=window.wp.primitives,a=window.ReactJSXRuntime,l=(0,a.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,a.jsx)(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"})}),s="core/bold",c=(0,o.__)("Bold"),u={name:s,title:c,tagName:"strong",className:null,edit({isActive:t,value:e,onChange:o,onFocus:i}){function u(){o((0,n.toggleFormat)(e,{type:s,title:c}))}return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(r.RichTextShortcut,{type:"primary",character:"b",onUse:u}),(0,a.jsx)(r.RichTextToolbarButton,{name:"bold",icon:l,title:c,onClick:function(){o((0,n.toggleFormat)(e,{type:s})),i()},isActive:t,shortcutType:"primary",shortcutCharacter:"b"}),(0,a.jsx)(r.__unstableRichTextInputEvent,{inputType:"formatBold",onInput:u})]})}},h=(0,a.jsx)(i.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,a.jsx)(i.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"})}),m="core/code",p=(0,o.__)("Inline code"),g={name:m,title:p,tagName:"code",className:null,__unstableInputRule(t){const{start:e,text:o}=t;if("`"!==o[e-1])return t;if(e-2<0)return t;const r=o.lastIndexOf("`",e-2);if(-1===r)return t;const i=r,a=e-2;return i===a?t:(t=(0,n.remove)(t,i,i+1),t=(0,n.remove)(t,a,a+1),t=(0,n.applyFormat)(t,{type:m},i,a))},edit({value:t,onChange:e,onFocus:o,isActive:i}){function l(){e((0,n.toggleFormat)(t,{type:m,title:p})),o()}return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(r.RichTextShortcut,{type:"access",character:"x",onUse:l}),(0,a.jsx)(r.RichTextToolbarButton,{icon:h,title:p,onClick:l,isActive:i,role:"menuitemcheckbox"})]})}},d=window.wp.components,x=window.wp.element,v=(0,a.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",children:(0,a.jsx)(i.Path,{d:"m6.734 16.106 2.176-2.38-1.093-1.028-3.846 4.158 3.846 4.158 1.093-1.028-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"})}),b=["image"],f="core/image",w=(0,o.__)("Inline image"),y={name:f,title:w,keywords:[(0,o.__)("photo"),(0,o.__)("media")],object:!0,tagName:"img",className:null,attributes:{className:"class",style:"style",url:"src",alt:"alt"},edit:function({value:t,onChange:e,onFocus:o,isObjectActive:i,activeObjectAttributes:l,contentRef:s}){return(0,a.jsxs)(r.MediaUploadCheck,{children:[(0,a.jsx)(r.MediaUpload,{allowedTypes:b,onSelect:({id:r,url:i,alt:a,width:l})=>{e((0,n.insertObject)(t,{type:f,attributes:{className:`wp-image-${r}`,style:`width: ${Math.min(l,150)}px;`,url:i,alt:a}})),o()},render:({open:t})=>(0,a.jsx)(r.RichTextToolbarButton,{icon:(0,a.jsx)(d.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,a.jsx)(d.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:w,onClick:t,isActive:i})}),i&&(0,a.jsx)(_,{value:t,onChange:e,activeObjectAttributes:l,contentRef:s})]})}};function _({value:t,onChange:e,activeObjectAttributes:r,contentRef:i}){const{style:l}=r,[s,c]=(0,x.useState)(l?.replace(/\D/g,"")),u=(0,n.useAnchor)({edit