mirror of
https://fast.feibisi.com/https://github.com/lubusIN/visual-blueprint-builder.git
synced 2026-07-30 23:13:36 +08:00
1 line
No EOL
1.5 KiB
JavaScript
1 line
No EOL
1.5 KiB
JavaScript
(()=>{"use strict";const e=window.wp.i18n,t=window.wp.blocks,n=window.wp.primitives,i=window.ReactJSXRuntime,r=(0,i.jsx)(n.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,i.jsx)(n.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"})}),o=window.wp.blockEditor,p=window.wp.components,s=JSON.parse('{"UU":"playground-step/run-php","DD":"Run PHP"}');(0,t.registerBlockType)(s.UU,{icon:r,edit:function({attributes:t,setAttributes:n,isSelected:l}){const{code:c}=t;return(0,i.jsx)("p",{...(0,o.useBlockProps)(),children:(0,i.jsx)(p.Placeholder,{preview:(0,i.jsxs)(p.__experimentalVStack,{style:{width:"100%"},children:[(0,i.jsxs)(p.__experimentalHStack,{justify:"left",align:"center",spacing:3,children:[(0,i.jsx)(p.Icon,{icon:r,size:28,className:"step-icon"}),(0,i.jsxs)(p.__experimentalVStack,{spacing:1,children:[(0,i.jsx)(p.__experimentalText,{upperCase:!0,size:12,weight:500,color:"#949494",children:s.DD}),!l&&(0,i.jsx)(p.__experimentalText,{weight:600,children:(0,e.__)("Code Snippet","wp-playground-blueprint-editor")})]})]}),l&&(0,i.jsx)(p.TextareaControl,{__nextHasNoMarginBottom:!0,help:(0,e.__)("When running WordPress functions, the code key must first load wp-load.php and start with \"<?php require_once 'wordpress/wp-load.php'; \"","wp-playground-blueprint-editor"),label:(0,e.__)("Code","wp-playground-blueprint-editor"),onChange:e=>n({code:e}),placeholder:"<?php ?>",value:c})]})})})}})})(); |