-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy patheditor.js
More file actions
1 lines (1 loc) · 1.94 KB
/
editor.js
File metadata and controls
1 lines (1 loc) · 1.94 KB
1
(()=>{"use strict";const e=window.React,t=window.wp.blocks,l=window.wp.hooks,n=window.wp.element,o=window.wp.blockEditor,s=window.wp.components,i=window.wp.i18n;(0,t.registerBlockStyle)("core/image",{name:"custom-filter-blackwhite",label:(0,i.__)("Black & White with Fade","osi-et")}),(0,t.registerBlockStyle)("core/image",{name:"round-logo-border",label:(0,i.__)("Round Logo with Border","osi-et")}),(0,t.registerBlockStyle)("core/button",{name:"spin-white",label:(0,i.__)("Spin (White)","osi-et")}),(0,t.registerBlockStyle)("core/button",{name:"spin-green",label:(0,i.__)("Spin (Green)","osi-et")}),(0,l.addFilter)("editor.BlockEdit","custom/animation-panel",(t=>l=>{if("core/heading"!==l.name)return(0,e.createElement)(t,{...l});const{attributes:a,setAttributes:r}=l;return(0,e.createElement)(n.Fragment,null,(0,e.createElement)(t,{...l}),(0,e.createElement)(o.InspectorControls,null,(0,e.createElement)(s.PanelBody,{title:(0,i.__)("Animations","osi-et")},(0,e.createElement)(s.ToggleControl,{label:(0,i.__)("Slide Up","osi-et"),checked:a.className&&a.className.includes("slide-up"),onChange:e=>{const t=a.className?a.className.split(" "):[];if(e)t.includes("slide-up")||t.push("slide-up");else{const e=t.indexOf("slide-up");e>-1&&t.splice(e,1)}r({enableSlider:e,className:t.join(" ")})}}))))})),(0,l.addFilter)("editor.BlockEdit","custom/group-panel",(t=>l=>{if("core/group"!==l.name)return(0,e.createElement)(t,{...l});const{attributes:a,setAttributes:r}=l;return(0,e.createElement)(n.Fragment,null,(0,e.createElement)(t,{...l}),(0,e.createElement)(o.InspectorControls,null,(0,e.createElement)(s.PanelBody,{title:(0,i.__)("OSI Card","osi-et")},(0,e.createElement)(s.ToggleControl,{label:(0,i.__)("Show as Card","osi-et"),checked:a.className&&a.className.includes("osi-card"),onChange:e=>{const t=a.className?a.className.split(" "):[];if(e)t.includes("osi-card")||t.push("osi-card");else{const e=t.indexOf("osi-card");e>-1&&t.splice(e,1)}r({isCard:e,className:t.join(" ")})}}))))}))})();