5 lines
29 KiB
JavaScript
5 lines
29 KiB
JavaScript
/*! This file is auto-generated */
|
|||
|
|
var wp;(wp||={}).formatLibrary=(()=>{var Ur=Object.create;var ra=Object.defineProperty;var zr=Object.getOwnPropertyDescriptor;var Dr=Object.getOwnPropertyNames;var Or=Object.getPrototypeOf,Wr=Object.prototype.hasOwnProperty;var Gr=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,a)=>(typeof require<"u"?require:e)[a]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var I=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Zr=(t,e,a,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of Dr(e))!Wr.call(t,s)&&s!==a&&ra(t,s,{get:()=>e[s],enumerable:!(o=zr(e,s))||o.enumerable});return t};var r=(t,e,a)=>(a=t!=null?Ur(Or(t)):{},Zr(e||!t||!t.__esModule?ra(a,"default",{value:t,enumerable:!0}):a,t));var x=I((yo,oa)=>{oa.exports=window.wp.richText});var b=I((ko,sa)=>{sa.exports=window.wp.i18n});var y=I((vo,la)=>{la.exports=window.wp.blockEditor});var F=I((Co,fa)=>{fa.exports=window.wp.element});var L=I((So,ia)=>{ia.exports=window.wp.primitives});var n=I((To,ma)=>{ma.exports=window.ReactJSXRuntime});var J=I((fs,ca)=>{ca.exports=window.wp.components});var Ft=I((ns,ba)=>{ba.exports=window.wp.url});var ya=I((ds,wa)=>{wa.exports=window.wp.htmlEntities});var Et=I((ps,ka)=>{ka.exports=window.wp.a11y});var We=I((cs,va)=>{va.exports=window.wp.data});var La=I((gs,Ta)=>{Ta.exports=window.wp.compose});var qa=I((Bs,Ka)=>{Ka.exports=window.wp.privateApis});var Pr=r(x(),1);var ua=r(b(),1),Ee=r(x(),1),lt=r(y(),1);var bt=r(F(),1),le=(0,bt.forwardRef)(({icon:t,size:e=24,...a},o)=>(0,bt.cloneElement)(t,{width:e,height:e,...a,ref:o}));var wt=r(L(),1),fe=r(n(),1),ie=(0,fe.jsx)(wt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,fe.jsx)(wt.Path,{d:"M8 12.5h8V11H8v1.5Z M19 6.5H5a2 2 0 0 0-2 2V15a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V8.5a2 2 0 0 0-2-2ZM5 8h14a.5.5 0 0 1 .5.5V15a.5.5 0 0 1-.5.5H5a.5.5 0 0 1-.5-.5V8.5A.5.5 0 0 1 5 8Z"})});var yt=r(L(),1),me=r(n(),1),ue=(0,me.jsx)(yt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,me.jsx)(yt.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"})});var kt=r(L(),1),ne=r(n(),1),de=(0,ne.jsx)(kt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,ne.jsx)(kt.Path,{d:"M17.2 10.9c-.5-1-1.2-2.1-2.1-3.2-.6-.9-1.3-1.7-2.1-2.6L12 4l-1 1.1c-.6.9-1.3 1.7-2 2.6-.8 1.2-1.5 2.3-2 3.2-.6 1.2-1 2.2-1 3 0 3.4 2.7 6.1 6.1 6.1s6.1-2.7 6.1-6.1c0-.8-.3-1.8-1-3zm-5.1 7.6c-2.5 0-4.6-2.1-4.6-4.6 0-.3.1-1 .8-2.3.5-.9 1.1-1.9 2-3.1.7-.9 1.3-1.7 1.8-2.3.7.8 1.3 1.6 1.8 2.3.8 1.1 1.5 2.2 2 3.1.7 1.3.8 2 .8 2.3 0 2.5-2.1 4.6-4.6 4.6z"})});var vt=r(L(),1),pe=r(n(),1),ce=(0,pe.jsx)(vt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,pe.jsx)(vt.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"})});var Ct=r(L(),1),he=r(n(),1),ge=(0,he.jsx)(Ct.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,he.jsx)(Ct.Path,{d:"M12.5 5L10 19h1.9l2.5-14z"})});var _t=r(L(),1),xe=r(n(),1),be=(0,xe.jsx)(_t.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,xe.jsx)(_t.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"})});var St=r(L(),1),we=r(n(),1),ye=(0,we.jsx)(St.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,we.jsx)(St.Path,{d:"M12 4a8 8 0 1 1 .001 16.0
|
||
|
|
|
||
|
|
`,o);let s={type:ut,attributes:{url:(0,Ea.decodeEntities)(o)}};return(0,w.isCollapsed)(t)?(0,w.insert)(t,(0,w.applyFormat)((0,w.create)({text:a}),s,0,a.length)):(0,w.applyFormat)(t,s)},edit:ao};var Aa=r(b(),1),Ua=r(x(),1),Dt=r(y(),1);var et=r(n(),1),Ha="core/strikethrough",Ze=(0,Aa.__)("Strikethrough"),za={name:Ha,title:Ze,tagName:"s",className:null,edit({isActive:t,value:e,onChange:a,onFocus:o}){function s(){a((0,Ua.toggleFormat)(e,{type:Ha,title:Ze})),o()}return(0,et.jsxs)(et.Fragment,{children:[(0,et.jsx)(Dt.RichTextShortcut,{type:"access",character:"d",onUse:s}),(0,et.jsx)(Dt.RichTextToolbarButton,{icon:be,title:Ze,onClick:s,isActive:t,role:"menuitemcheckbox"})]})}};var Wa=r(b(),1),Ga=r(x(),1),Ot=r(y(),1),at=r(n(),1),Da="core/underline",Oa=(0,Wa.__)("Underline"),Za={name:Da,title:Oa,tagName:"span",className:null,attributes:{style:"style"},edit({value:t,onChange:e}){let a=()=>{e((0,Ga.toggleFormat)(t,{type:Da,attributes:{style:"text-decoration: underline;"},title:Oa}))};return(0,at.jsxs)(at.Fragment,{children:[(0,at.jsx)(Ot.RichTextShortcut,{type:"primary",character:"u",onUse:a}),(0,at.jsx)(Ot.__unstableRichTextInputEvent,{inputType:"formatUnderline",onInput:a})]})}};var tr=r(b(),1),Yt=r(F(),1),Qt=r(y(),1);var er=r(x(),1);var Qa=r(F(),1),Ja=r(We(),1),G=r(x(),1),P=r(y(),1),Zt=r(J(),1),Ke=r(b(),1);var $a=r(qa(),1),{lock:Ns,unlock:Wt}=(0,$a.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/format-library");var A=r(n(),1),{Tabs:Gt}=Wt(Zt.privateApis),Ya=[{name:"color",title:(0,Ke.__)("Text")},{name:"backgroundColor",title:(0,Ke.__)("Background")}];function ro(t=""){return t.split(";").reduce((e,a)=>{if(a){let[o,s]=a.split(":");o==="color"&&(e.color=s),o==="background-color"&&s!==xt&&(e.backgroundColor=s)}return e},{})}function oo(t="",e){return t.split(" ").reduce((a,o)=>{if(o.startsWith("has-")&&o.endsWith("-color")){let s=o.replace(/^has-/,"").replace(/-color$/,""),l=(0,P.getColorObjectByAttributeValues)(e,s);a.color=l.color}return a},{})}function Kt(t,e,a){let o=(0,G.getActiveFormat)(t,e);return o?{...ro(o.attributes.style),...oo(o.attributes.class,a)}:{}}function so(t,e,a,o){let{color:s,backgroundColor:l}={...Kt(t,e,a),...o};if(!s&&!l)return(0,G.removeFormat)(t,e);let f=[],i=[],m={};if(l?f.push(["background-color",l].join(":")):f.push(["background-color",xt].join(":")),s){let u=(0,P.getColorObjectByColorValue)(a,s);u?i.push((0,P.getColorClassName)("color",u.slug)):f.push(["color",s].join(":"))}return f.length&&(m.style=f.join(";")),i.length&&(m.class=i.join(" ")),(0,G.applyFormat)(t,{type:e,attributes:m})}function lo({name:t,property:e,value:a,onChange:o}){let s=(0,Ja.useSelect)(f=>{let{getSettings:i}=f(P.store);return i().colors??[]},[]),l=(0,Qa.useMemo)(()=>Kt(a,t,s),[t,a,s]);return(0,A.jsx)(P.ColorPalette,{value:l[e],onChange:f=>{o(so(a,t,s,{[e]:f}))},enableAlpha:!0,__experimentalIsRenderedInSidebar:!0})}function Xa({name:t,value:e,onChange:a,onClose:o,contentRef:s,isActive:l}){let f=(0,G.useAnchor)({editableContentElement:s.current,settings:{...qt,isActive:l}});return(0,A.jsx)(Zt.Popover,{onClose:o,className:"format-library__inline-color-popover",anchor:f,children:(0,A.jsxs)(Gt,{children:[(0,A.jsx)(Gt.TabList,{children:Ya.map(i=>(0,A.jsx)(Gt.Tab,{tabId:i.name,children:i.title},i.name))}),Ya.map(i=>(0,A.jsx)(Gt.TabPanel,{tabId:i.name,focusable:!1,children:(0,A.jsx)(lo,{name:t,property:i.name,value:e,onChange:a})},i.name))]})})}var Z=r(n(),1),xt="rgba(0, 0, 0, 0)",$t="core/text-color",ar=(0,tr.__)("Highlight"),fo=[];function qe(t,e){let{ownerDocument:a}=t,{defaultView:o}=a,l=o.getComputedStyle(t).getPropertyValue(e);return e==="background-color"&&l===xt&&t.parentElement?qe(t.parentElement,e):l}function io(t,{color:e,backgroundColor:a}){if(!(!e&&!a))return{color:e||qe(t,"color"),backgroundColor:a===xt?qe(t,"background-color"):a}}function mo({value:t,onChange:e,isActive:a,activeAttributes:o,contentRef:s}){let[l,f=fo]=(0,Qt.useSettings)("color.custom","color.palette"),[i,m]=(0,Yt.
|