PluginProbe
Getwid – Gutenberg Blocks / 3.0.1
Getwid – Gutenberg Blocks v3.0.1
3.0.2 3.0.1 3.0.0 2.1.0 2.1.1 2.1.2 2.1.3 2.2.0 trunk 1.8.7 1.9.1 2.0.10 2.0.11 2.0.12 2.0.13 2.0.14 2.0.5 2.0.6 2.0.7 2.0.8 2.0.9
getwid / assets / blocks / anchor / index.js

index.js in Getwid – Gutenberg Blocks 3.0.1, at assets/blocks/anchor/index.js

1 lines 2.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 (()=>{"use strict";const e=window.wp.blocks,t=window.wp.i18n,s=window.GetwidComponents,n=window.wp.blockEditor,o=window.wp.components,r=window.ReactJSXRuntime;function i({size:e=24}){return(0,r.jsx)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 24 24",children:(0,r.jsx)(o.Path,{d:"M20.68,16.6c-0.42,0.95-1.13,1.84-2.11,2.62c-1.75,1.4-3.95,2.15-5.58,2.54V13h6v-2h-6V7.6c1.65-0.44,2.88-1.94,2.88-3.73 C15.88,1.74,14.14,0,12,0S8.13,1.74,8.13,3.88c0,1.79,1.22,3.28,2.88,3.73V11H5v2h6v8.76c-1.63-0.4-3.83-1.15-5.58-2.54 c-0.98-0.78-1.69-1.67-2.11-2.62l-1.83,0.8c0.55,1.25,1.46,2.39,2.69,3.38c2.43,1.95,5.5,2.82,7.65,3.2L12,24.02l0.18-0.03 c2.15-0.39,5.22-1.26,7.65-3.2c1.24-0.99,2.14-2.13,2.69-3.38L20.68,16.6z M10.13,3.88C10.13,2.84,10.97,2,12,2 c1.03,0,1.88,0.84,1.88,1.88S13.03,5.75,12,5.75C10.97,5.75,10.13,4.91,10.13,3.88z"})})}function c({attributes:e,setAttributes:s}){const{anchor:i}=e;return(0,r.jsx)(n.InspectorControls,{children:(0,r.jsxs)(o.PanelBody,{title:(0,t.__)("Settings","getwid"),children:[(0,r.jsx)(o.TextControl,{label:(0,t.__)("HTML Anchor","getwid"),value:i,onChange:e=>s({anchor:e})}),(0,r.jsx)(o.BaseControl,{children:(0,r.jsx)(o.ExternalLink,{href:"https://wordpress.org/support/article/page-jumps/",children:(0,t.__)("Learn more about anchors","getwid")})})]})})}const a=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"textdomain":"getwid","name":"getwid/anchor","description":"Creates a link target within a page.","category":"getwid-blocks","title":"Anchor","supports":{"anchor":true},"attributes":{"anchor":{"type":"string"}},"editorScript":"file:./index.js","editorStyle":"file:./index.css"}'),l={to:[{type:"block",blocks:["core/spacer"],transform:()=>(0,e.createBlock)("core/spacer")}]};(0,e.registerBlockType)(a,{title:(0,t.__)("Anchor","getwid"),icon:(0,r.jsx)(i,{}),transforms:l,edit:(0,s.MaybeBlockIsDisabled)("getwid/anchor")||function(e){const t=(0,n.useBlockProps)();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c,{...e}),(0,r.jsxs)("div",{...t,children:[(0,r.jsx)("span",{}),(0,r.jsx)(i,{size:16}),(0,r.jsx)("span",{})]})]})},save:function(){const e=n.useBlockProps.save();return(0,r.jsx)("div",{...e})}})})();