Changeset 3468063
- Timestamp:
- 02/23/2026 10:00:16 PM (2 weeks ago)
- Location:
- three-importer/trunk
- Files:
-
- 6 edited
-
build/blocks-manifest.php (modified) (1 diff)
-
build/three-importer/block.json (modified) (1 diff)
-
build/three-importer/index.asset.php (modified) (1 diff)
-
build/three-importer/index.js (modified) (1 diff)
-
readme.txt (modified) (1 diff)
-
three-importer.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
three-importer/trunk/build/blocks-manifest.php
r3468054 r3468063 6 6 'apiVersion' => 3, 7 7 'name' => 'ti-blocks/three-importer', 8 'version' => '1.0. 4',8 'version' => '1.0.5', 9 9 'title' => 'Three Importer', 10 10 'category' => 'widgets', -
three-importer/trunk/build/three-importer/block.json
r3468054 r3468063 3 3 "apiVersion": 3, 4 4 "name": "ti-blocks/three-importer", 5 "version": "1.0. 4",5 "version": "1.0.5", 6 6 "title": "Three Importer", 7 7 "category": "widgets", -
three-importer/trunk/build/three-importer/index.asset.php
r3468054 r3468063 1 <?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-i18n'), 'version' => ' 7f50d9dfcd28a20234d7');1 <?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-i18n'), 'version' => '699275fc2db5cfc0842a'); -
three-importer/trunk/build/three-importer/index.js
r3468054 r3468063 1 (()=>{"use strict";var e,t={780:()=>{const e=window.wp.blocks,t=window.wp.i18n,l=window.wp.blockEditor,o=window.wp.components,n=window.ReactJSXRuntime,a=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"ti-blocks/three-importer","version":"1.0. 4","title":"Three Importer","category":"widgets","icon":"smiley","description":"Example block scaffolded with Create Block tool.","example":{},"attributes":{"attributes":{"inner_alignment":{"type":"string","default":"left"},"inner_vertical_alignment":{"type":"string","default":"top"}},"block_height":{"type":"string","default":"400px"},"geometry":{"type":"string","default":"box"},"geometry_color":{"type":"string","default":"#000000"},"geometry_size":{"type":"integer","default":1},"geometry_material":{"type":"string","default":"phong"},"geometry_xrotation":{"type":"string","default":"0"},"geometry_yrotation":{"type":"string","default":"0"},"geometry_zrotation":{"type":"string","default":"0"},"geometry_instancing":{"type":"boolean","default":false},"geometry_instancingnum":{"type":"string","default":"50"},"geometry_instancingspacing":{"type":"string","default":"1"},"gltf_url":{"type":"string","default":""},"trid_text":{"type":"string","default":"TI"},"trid_color":{"type":"string","default":"#FFFFFF"},"trid_size":{"type":"string","default":"1"},"light":{"type":"string","default":"ambient"},"light_color":{"type":"string","default":"#FFFFFF"},"light_intensity":{"type":"string","default":"1"},"light_xpos":{"type":"string","default":"0"},"light_ypos":{"type":"string","default":"0"},"light_zpos":{"type":"string","default":"0"},"light_helper":{"type":"boolean","default":false},"camera_xpos":{"type":"string","default":"5"},"camera_ypos":{"type":"string","default":"0"},"camera_zpos":{"type":"string","default":"0"},"camera_xtarget":{"type":"string","default":"0"},"camera_ytarget":{"type":"string","default":"0"},"camera_ztarget":{"type":"string","default":"0"},"camera_followmouse":{"type":"boolean","default":false},"scene_background":{"type":"string","default":"none"},"particle_amount":{"type":"string","default":"1000"},"particle_size":{"type":"string","default":"1"},"particle_speed":{"type":"string","default":"5"},"particle_direction":{"type":"string","default":"right"},"particle_color":{"type":"string","default":"#000000"},"particle_stretch":{"type":"string","default":"5"},"cubegrid_stretch":{"type":"string","default":"120"},"cubegrid_spacing":{"type":"integer","default":"1"},"cubegrid_material":{"type":"string","default":"phong"},"cubegrid_color":{"type":"string","default":"#FFFFFF"}},"supports":{"html":false,"innerBlocks":true,"align":["wide","full"],"spacing":{"padding":true,"margin":true},"color":{"background":true,"gradients":true},"typography":{"textAlign":true,"lineHeight":true,"fontSize":true},"layout":{"allowJustification":true,"allowOrientation":false}},"textdomain":"three-importer","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","render":"file:./render.php"}'),r=(0,n.jsx)("svg",{viewBox:"0 0 226.77 226.77",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,n.jsxs)("g",{transform:"translate(8.964 4.2527)",fillRule:"evenodd",stroke:"#000",strokeLinecap:"butt",strokeLinejoin:"round",strokeWidth:"4",children:[(0,n.jsx)("path",{d:"M63.02 200.61L19.807 25.67l173.23 49.874z"}),(0,n.jsx)("path",{d:"M106.39 50.612l21.591 87.496-86.567-24.945z"}),(0,n.jsx)("path",{d:"M84.91 125.03l-10.724-43.465 43.008 12.346z"}),(0,n.jsx)("path",{d:"M63.458 38.153l10.724 43.465-43.008-12.346z"}),(0,n.jsx)("path",{d:"M149.47 62.93l10.724 43.465-43.008-12.346z"}),(0,n.jsx)("path",{d:"M84.915 125.06l10.724 43.465-43.008-12.346z"})]})});(0,e.registerBlockType)(a.name,{...a,icon:r,edit:function({attributes:e,setAttributes:a}){const{inner_alignment:r,inner_vertical_alignment:i,block_height:s}=e,c=parseInt(e.block_height,10)||400,_=(0,l.useBlockProps)();return(0,n.jsxs)("div",{..._,children:[(0,n.jsxs)(l.BlockControls,{group:"block",children:[(0,n.jsx)(l.JustifyContentControl,{value:r,onChange:e=>a({inner_alignment:e})}),(0,n.jsx)(l.BlockVerticalAlignmentControl,{value:i,onChange:e=>a({inner_vertical_alignment:e})})]}),(0,n.jsx)(l.InspectorControls,{children:(0,n.jsxs)(o.Panel,{children:[(0,n.jsxs)(o.PanelBody,{title:(0,t.__)("Geometry Settings","ti_blocks"),children:[(0,n.jsx)(o.SelectControl,{label:(0,t.__)("Type","ti_blocks"),value:e.geometry,options:[{label:(0,t.__)("Box","ti_blocks"),value:"box"},{label:(0,t.__)("Capsule","ti_blocks"),value:"capsule"},{label:(0,t.__)("Circle","ti_blocks"),value:"circle"},{label:(0,t.__)("Cone","ti_blocks"),value:"cone"},{label:(0,t.__)("Cylinder","ti_blocks"),value:"cylinder"},{label:(0,t.__)("Dodecahedron","ti_blocks"),value:"dodecahedron"},{label:(0,t.__)("Icosahedron","ti_blocks"),value:"icosahedron"},{label:(0,t.__)("Octahedron","ti_blocks"),value:"octahedron"},{label:(0,t.__)("Plane","ti_blocks"),value:"plane"},{label:(0,t.__)("Ring","ti_blocks"),value:"ring"},{label:(0,t.__)("Sphere","ti_blocks"),value:"sphere"},{label:(0,t.__)("Tetrahedron","ti_blocks"),value:"tetrahedron"},{label:(0,t.__)("Torus","ti_blocks"),value:"torus"},{label:(0,t.__)("Torus Knot","ti_blocks"),value:"torusknot"},{label:(0,t.__)("GLTF Model","ti_blocks"),value:"gltf"},{label:(0,t.__)("3D Text","ti_blocks"),value:"3dtext"}],onChange:e=>a({geometry:e})}),"gltf"===e.geometry?(0,n.jsx)(o.TextControl,{label:(0,t.__)("GLTF Model URL","ti_blocks"),value:e.gltf_url,onChange:e=>a({gltf_url:e})}):"3dtext"===e.geometry?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(o.TextControl,{label:(0,t.__)("Text to show","ti_blocks"),value:e.trid_text,onChange:e=>a({trid_text:e})}),(0,n.jsxs)("fieldset",{children:[(0,n.jsx)("legend",{children:(0,t.__)("Color","ti_blocks")}),(0,n.jsx)(o.ColorPalette,{value:e.trid_color,colors:[{name:"Black",color:"#000000"},{name:"White",color:"#ffffff"},{name:"Red",color:"#ff0000"},{name:"Orange",color:"#ffa500"},{name:"Yellow",color:"#ffff00"},{name:"Green",color:"#00ff00"},{name:"Blue",color:"#0000ff"},{name:"Indigo",color:"#4b0082"},{name:"Violet",color:"#ee82ee"}],onChange:e=>a({trid_color:e})})]}),(0,n.jsx)(o.TextControl,{label:(0,t.__)("Size","ti_blocks"),value:e.trid_size,type:"number",onChange:e=>a({trid_size:e})})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(o.SelectControl,{label:(0,t.__)("Material","ti_blocks"),value:e.geometry_material,options:[{label:(0,t.__)("Basic","ti_blocks"),value:"basic"},{label:(0,t.__)("Lambert","ti_blocks"),value:"lambert"},{label:(0,t.__)("Phong","ti_blocks"),value:"phong"},{label:(0,t.__)("Standard","ti_blocks"),value:"standard"},{label:(0,t.__)("Physical","ti_blocks"),value:"physical"}],onChange:e=>a({geometry_material:e})}),(0,n.jsxs)("fieldset",{children:[(0,n.jsx)("legend",{children:(0,t.__)("Color","ti_blocks")}),(0,n.jsx)(o.ColorPalette,{value:e.geometry_color,colors:[{name:"Black",color:"#000000"},{name:"White",color:"#ffffff"},{name:"Red",color:"#ff0000"},{name:"Orange",color:"#ffa500"},{name:"Yellow",color:"#ffff00"},{name:"Green",color:"#00ff00"},{name:"Blue",color:"#0000ff"},{name:"Indigo",color:"#4b0082"},{name:"Violet",color:"#ee82ee"}],onChange:e=>a({geometry_color:e})})]})]}),"3dtext"!==e.geometry&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(o.TextControl,{label:(0,t.__)("X Rotation Speed","ti_blocks"),value:e.geometry_xrotation,type:"number",onChange:e=>a({geometry_xrotation:e})}),(0,n.jsx)(o.TextControl,{label:(0,t.__)("Y Rotation Speed","ti_blocks"),value:e.geometry_yrotation,type:"number",onChange:e=>a({geometry_yrotation:e})}),(0,n.jsx)(o.TextControl,{label:(0,t.__)("Z Rotation Speed","ti_blocks"),value:e.geometry_zrotation,type:"number",onChange:e=>a({geometry_zrotation:e})})]})]}),(0,n.jsxs)(o.PanelBody,{title:(0,t.__)("Light Settings","ti_blocks"),children:[(0,n.jsx)(o.SelectControl,{label:(0,t.__)("Type","ti_blocks"),value:e.light,options:[{label:(0,t.__)("directional","ti_blocks"),value:"directional"},{label:(0,t.__)("hemisphere","ti_blocks"),value:"hemisphere"},{label:(0,t.__)("point","ti_blocks"),value:"point"},{label:(0,t.__)("spotlight","ti_blocks"),value:"spotlight"},{label:(0,t.__)("ambient","ti_blocks"),value:"ambient"}],onChange:e=>a({light:e})}),(0,n.jsx)(o.TextControl,{label:(0,t.__)("Intensity","ti_blocks"),value:e.light_intensity,type:"number",onChange:e=>a({light_intensity:e})}),(0,n.jsxs)("fieldset",{children:[(0,n.jsx)("legend",{children:(0,t.__)("Color","ti_blocks")}),(0,n.jsx)(o.ColorPalette,{value:e.light_color,colors:[{name:"Black",color:"#000000"},{name:"White",color:"#ffffff"},{name:"Red",color:"#ff0000"},{name:"Orange",color:"#ffa500"},{name:"Yellow",color:"#ffff00"},{name:"Green",color:"#00ff00"},{name:"Blue",color:"#0000ff"},{name:"Indigo",color:"#4b0082"},{name:"Violet",color:"#ee82ee"}],onChange:e=>a({light_color:e})})]}),"spotlight"!==e.light&&"ambient"!==e.light&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(o.TextControl,{label:(0,t.__)("X Position","ti_blocks"),value:e.light_xpos,type:"number",onChange:e=>a({light_xpos:e})}),(0,n.jsx)(o.TextControl,{label:(0,t.__)("Y Position","ti_blocks"),value:e.light_ypos,type:"number",onChange:e=>a({light_ypos:e})}),(0,n.jsx)(o.TextControl,{label:(0,t.__)("Z Position","ti_blocks"),value:e.light_zpos,type:"number",onChange:e=>a({light_zpos:e})})]}),(0,n.jsx)(o.ToggleControl,{label:(0,t.__)("Light Helper","ti_blocks"),checked:e.light_helper,onChange:e=>a({light_helper:e})})]}),(0,n.jsxs)(o.PanelBody,{title:(0,t.__)("Camera Settings","ti_blocks"),children:[(0,n.jsx)(o.ToggleControl,{label:(0,t.__)("Mouse Follow","ti_blocks"),checked:e.camera_followmouse,onChange:e=>a({camera_followmouse:e})}),!0!==e.camera_followmouse&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(o.TextControl,{label:(0,t.__)("X Position","ti_blocks"),value:e.camera_xpos,type:"number",onChange:e=>a({camera_xpos:e})}),(0,n.jsx)(o.TextControl,{label:(0,t.__)("Y Position","ti_blocks"),value:e.camera_ypos,type:"number",onChange:e=>a({camera_ypos:e})}),(0,n.jsx)(o.TextControl,{label:(0,t.__)("Z Position","ti_blocks"),value:e.camera_zpos,type:"number",onChange:e=>a({camera_zpos:e})}),(0,n.jsx)(o.TextControl,{label:(0,t.__)("Target X","ti_blocks"),value:e.camera_xtarget,type:"number",onChange:e=>a({camera_xtarget:e})}),(0,n.jsx)(o.TextControl,{label:(0,t.__)("Target Y","ti_blocks"),value:e.camera_ytarget,type:"number",onChange:e=>a({camera_ytarget:e})}),(0,n.jsx)(o.TextControl,{label:(0,t.__)("Target Z","ti_blocks"),value:e.camera_ztarget,type:"number",onChange:e=>a({camera_ztarget:e})})]})]}),(0,n.jsx)(o.PanelBody,{title:(0,t.__)("Instancing Settings","ti_blocks"),children:"gltf"!==e.geometry?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(o.ToggleControl,{label:(0,t.__)("Instancing","ti_blocks"),checked:e.geometry_instancing,onChange:e=>a({geometry_instancing:e})}),e.geometry_instancing&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(o.TextControl,{label:(0,t.__)("Number of Instances","ti_blocks"),value:e.geometry_instancingnum,type:"number",onChange:e=>a({geometry_instancingnum:e})}),(0,n.jsx)(o.TextControl,{label:(0,t.__)("Instance Spacing","ti_blocks"),value:e.geometry_instancingspacing,type:"number",onChange:e=>a({geometry_instancingspacing:e})})]})]}):(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(o.Notice,{status:"warning",isDismissible:!1,children:(0,t.__)("Instancing is not supported for URL-based models.","ti_blocks")})})}),(0,n.jsxs)(o.PanelBody,{title:(0,t.__)("Backgrounds","ti_blocks"),children:[(0,n.jsx)(o.SelectControl,{label:(0,t.__)("Type","ti_blocks"),value:e.scene_background,options:[{label:(0,t.__)("None","ti_blocks"),value:"none"},{label:(0,t.__)("Particles","ti_blocks"),value:"particles"},{label:(0,t.__)("CubeGrid","ti_blocks"),value:"cubegrid"}],onChange:e=>a({scene_background:e})}),"particles"===e.scene_background&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(o.TextControl,{label:(0,t.__)("Amount","ti_blocks"),value:e.particle_amount,type:"number",onChange:e=>a({particle_amount:e})}),(0,n.jsx)(o.TextControl,{label:(0,t.__)("Size","ti_blocks"),value:e.particle_size,type:"number",onChange:e=>a({particle_size:e})}),(0,n.jsx)(o.TextControl,{label:(0,t.__)("Speed","ti_blocks"),value:e.particle_speed,type:"number",onChange:e=>a({particle_speed:e})}),e.particle_speed<0&&(0,n.jsx)(o.Notice,{status:"warning",isDismissible:!1,children:(0,t.__)("A negative value for particle speed will affect its animation.","ti_blocks")}),(0,n.jsx)(o.SelectControl,{label:(0,t.__)("Direction","ti_blocks"),value:e.particle_direction,options:[{label:(0,t.__)("Up","ti_blocks"),value:"up"},{label:(0,t.__)("Down","ti_blocks"),value:"down"},{label:(0,t.__)("Right","ti_blocks"),value:"right"},{label:(0,t.__)("Left","ti_blocks"),value:"left"}],onChange:e=>a({particle_direction:e})}),(0,n.jsx)(o.TextControl,{label:(0,t.__)("Stretch","ti_blocks"),value:e.particle_stretch,type:"number",onChange:e=>a({particle_stretch:e})}),(0,n.jsxs)("fieldset",{children:[(0,n.jsx)("legend",{children:(0,t.__)("Color","ti_blocks")}),(0,n.jsx)(o.ColorPalette,{value:e.particle_color,colors:[{name:"Black",color:"#000000"},{name:"White",color:"#ffffff"},{name:"Red",color:"#ff0000"},{name:"Orange",color:"#ffa500"},{name:"Yellow",color:"#ffff00"},{name:"Green",color:"#00ff00"},{name:"Blue",color:"#0000ff"},{name:"Indigo",color:"#4b0082"},{name:"Violet",color:"#ee82ee"}],onChange:e=>a({particle_color:e})})]})]}),"cubegrid"===e.scene_background&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(o.TextControl,{label:(0,t.__)("Stretch","ti_blocks"),value:e.cubegrid_stretch,type:"number",onChange:e=>a({cubegrid_stretch:e})}),(0,n.jsx)(o.TextControl,{label:(0,t.__)("Spacing","ti_blocks"),value:e.cubegrid_spacing,type:"number",onChange:e=>a({cubegrid_spacing:e})}),(0,n.jsx)(o.SelectControl,{label:(0,t.__)("Material","ti_blocks"),value:e.cubegrid_material,options:[{label:(0,t.__)("Phong","ti_blocks"),value:"phong"},{label:(0,t.__)("Basic","ti_blocks"),value:"basic"},{label:(0,t.__)("Lambert","ti_blocks"),value:"lambert"},{label:(0,t.__)("Standard","ti_blocks"),value:"standard"},{label:(0,t.__)("Physical","ti_blocks"),value:"physical"}],onChange:e=>a({cubegrid_material:e})}),(0,n.jsxs)("fieldset",{children:[(0,n.jsx)("legend",{children:(0,t.__)("Color","ti_blocks")}),(0,n.jsx)(o.ColorPalette,{value:e.cubegrid_color,colors:[{name:"Black",color:"#000000"},{name:"White",color:"#ffffff"},{name:"Red",color:"#ff0000"},{name:"Orange",color:"#ffa500"},{name:"Yellow",color:"#ffff00"},{name:"Green",color:"#00ff00"},{name:"Blue",color:"#0000ff"},{name:"Indigo",color:"#4b0082"},{name:"Violet",color:"#ee82ee"}],onChange:e=>a({cubegrid_color:e})})]}),e.cubegrid_stretch<0&&(0,n.jsx)(o.Notice,{status:"warning",isDismissible:!1,children:(0,t.__)("Using a negative numeric value will affect the CubeGrid's layout. Your negative input will be converted to positive.","ti_blocks")})]})]})]})}),(0,n.jsx)(o.ResizableBox,{size:{height:c,width:"100%"},minHeight:400,enable:{bottom:!0},onResizeStop:(e,t,l,o)=>{const n=c+o.height;a({block_height:`${n}px`})},className:"ti-block-resizable-box",children:(0,n.jsxs)("div",{style:{minHeight:s||"400px",height:"100%",width:"100%",display:"flex",flexDirection:"column",position:"relative",overflow:"hidden",paddingBottom:"40px"},children:[(0,n.jsxs)("div",{className:"ti-block-heading",style:{width:"100%",flexShrink:0},children:[(0,n.jsx)("h2",{children:(0,t.__)("Your three.js scene will render on the front end.","three-importer")}),(0,n.jsx)("p",{children:(0,t.__)("Scene Settings can be found in the Block settings.","three-importer")})]}),(0,n.jsx)("div",{className:"ti-inner-wrapper",style:{width:"100%",flexGrow:1,display:"flex",flexDirection:"column",pointerEvents:"none",justifyContent:"bottom"===i?"flex-end":"center"===i?"center":"flex-start",alignItems:"right"===r?"flex-end":"center"===r?"center":"stretch"},children:(0,n.jsx)("div",{style:{pointerEvents:"auto",width:"100%",maxWidth:"100%"},children:(0,n.jsx)(l.InnerBlocks,{renderAppender:l.InnerBlocks.ButtonBlockAppender})})})]})})]})},save:function({attributes:e}){const{inner_alignment:t,inner_vertical_alignment:o,block_height:a}=e,r=l.useBlockProps.save({className:"three-importer-block-wrapper"});return(0,n.jsx)("div",{...r,children:(0,n.jsx)("div",{className:"ti-content",style:{minHeight:a||"400px",display:"flex",flexDirection:"column",justifyContent:"bottom"===o?"flex-end":"center"===o?"center":"flex-start",alignItems:"right"===t?"flex-end":"center"===t?"center":"stretch"},children:(0,n.jsx)("div",{style:{pointerEvents:"auto",width:"100%"},children:(0,n.jsx)(l.InnerBlocks.Content,{})})})})}})}},l={};function o(e){var n=l[e];if(void 0!==n)return n.exports;var a=l[e]={exports:{}};return t[e](a,a.exports,o),a.exports}o.m=t,e=[],o.O=(t,l,n,a)=>{if(!l){var r=1/0;for(_=0;_<e.length;_++){for(var[l,n,a]=e[_],i=!0,s=0;s<l.length;s++)(!1&a||r>=a)&&Object.keys(o.O).every((e=>o.O[e](l[s])))?l.splice(s--,1):(i=!1,a<r&&(r=a));if(i){e.splice(_--,1);var c=n();void 0!==c&&(t=c)}}return t}a=a||0;for(var _=e.length;_>0&&e[_-1][2]>a;_--)e[_]=e[_-1];e[_]=[l,n,a]},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={57:0,350:0};o.O.j=t=>0===e[t];var t=(t,l)=>{var n,a,[r,i,s]=l,c=0;if(r.some((t=>0!==e[t]))){for(n in i)o.o(i,n)&&(o.m[n]=i[n]);if(s)var _=s(o)}for(t&&t(l);c<r.length;c++)a=r[c],o.o(e,a)&&e[a]&&e[a][0](),e[a]=0;return o.O(_)},l=globalThis.webpackChunkthree_importer=globalThis.webpackChunkthree_importer||[];l.forEach(t.bind(null,0)),l.push=t.bind(null,l.push.bind(l))})();var n=o.O(void 0,[350],(()=>o(780)));n=o.O(n)})();1 (()=>{"use strict";var e,t={780:()=>{const e=window.wp.blocks,t=window.wp.i18n,l=window.wp.blockEditor,o=window.wp.components,n=window.ReactJSXRuntime,a=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"ti-blocks/three-importer","version":"1.0.5","title":"Three Importer","category":"widgets","icon":"smiley","description":"Example block scaffolded with Create Block tool.","example":{},"attributes":{"attributes":{"inner_alignment":{"type":"string","default":"left"},"inner_vertical_alignment":{"type":"string","default":"top"}},"block_height":{"type":"string","default":"400px"},"geometry":{"type":"string","default":"box"},"geometry_color":{"type":"string","default":"#000000"},"geometry_size":{"type":"integer","default":1},"geometry_material":{"type":"string","default":"phong"},"geometry_xrotation":{"type":"string","default":"0"},"geometry_yrotation":{"type":"string","default":"0"},"geometry_zrotation":{"type":"string","default":"0"},"geometry_instancing":{"type":"boolean","default":false},"geometry_instancingnum":{"type":"string","default":"50"},"geometry_instancingspacing":{"type":"string","default":"1"},"gltf_url":{"type":"string","default":""},"trid_text":{"type":"string","default":"TI"},"trid_color":{"type":"string","default":"#FFFFFF"},"trid_size":{"type":"string","default":"1"},"light":{"type":"string","default":"ambient"},"light_color":{"type":"string","default":"#FFFFFF"},"light_intensity":{"type":"string","default":"1"},"light_xpos":{"type":"string","default":"0"},"light_ypos":{"type":"string","default":"0"},"light_zpos":{"type":"string","default":"0"},"light_helper":{"type":"boolean","default":false},"camera_xpos":{"type":"string","default":"5"},"camera_ypos":{"type":"string","default":"0"},"camera_zpos":{"type":"string","default":"0"},"camera_xtarget":{"type":"string","default":"0"},"camera_ytarget":{"type":"string","default":"0"},"camera_ztarget":{"type":"string","default":"0"},"camera_followmouse":{"type":"boolean","default":false},"scene_background":{"type":"string","default":"none"},"particle_amount":{"type":"string","default":"1000"},"particle_size":{"type":"string","default":"1"},"particle_speed":{"type":"string","default":"5"},"particle_direction":{"type":"string","default":"right"},"particle_color":{"type":"string","default":"#000000"},"particle_stretch":{"type":"string","default":"5"},"cubegrid_stretch":{"type":"string","default":"120"},"cubegrid_spacing":{"type":"integer","default":"1"},"cubegrid_material":{"type":"string","default":"phong"},"cubegrid_color":{"type":"string","default":"#FFFFFF"}},"supports":{"html":false,"innerBlocks":true,"align":["wide","full"],"spacing":{"padding":true,"margin":true},"color":{"background":true,"gradients":true},"typography":{"textAlign":true,"lineHeight":true,"fontSize":true},"layout":{"allowJustification":true,"allowOrientation":false}},"textdomain":"three-importer","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","render":"file:./render.php"}'),r=(0,n.jsx)("svg",{viewBox:"0 0 226.77 226.77",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,n.jsxs)("g",{transform:"translate(8.964 4.2527)",fillRule:"evenodd",stroke:"#000",strokeLinecap:"butt",strokeLinejoin:"round",strokeWidth:"4",children:[(0,n.jsx)("path",{d:"M63.02 200.61L19.807 25.67l173.23 49.874z"}),(0,n.jsx)("path",{d:"M106.39 50.612l21.591 87.496-86.567-24.945z"}),(0,n.jsx)("path",{d:"M84.91 125.03l-10.724-43.465 43.008 12.346z"}),(0,n.jsx)("path",{d:"M63.458 38.153l10.724 43.465-43.008-12.346z"}),(0,n.jsx)("path",{d:"M149.47 62.93l10.724 43.465-43.008-12.346z"}),(0,n.jsx)("path",{d:"M84.915 125.06l10.724 43.465-43.008-12.346z"})]})});(0,e.registerBlockType)(a.name,{...a,icon:r,edit:function({attributes:e,setAttributes:a}){const{inner_alignment:r,inner_vertical_alignment:i,block_height:s}=e,c=parseInt(e.block_height,10)||400,_=(0,l.useBlockProps)();return(0,n.jsxs)("div",{..._,children:[(0,n.jsxs)(l.BlockControls,{group:"block",children:[(0,n.jsx)(l.JustifyContentControl,{value:r,onChange:e=>a({inner_alignment:e})}),(0,n.jsx)(l.BlockVerticalAlignmentControl,{value:i,onChange:e=>a({inner_vertical_alignment:e})})]}),(0,n.jsx)(l.InspectorControls,{children:(0,n.jsxs)(o.Panel,{children:[(0,n.jsxs)(o.PanelBody,{title:(0,t.__)("Geometry Settings","ti_blocks"),children:[(0,n.jsx)(o.SelectControl,{label:(0,t.__)("Type","ti_blocks"),value:e.geometry,options:[{label:(0,t.__)("Box","ti_blocks"),value:"box"},{label:(0,t.__)("Capsule","ti_blocks"),value:"capsule"},{label:(0,t.__)("Circle","ti_blocks"),value:"circle"},{label:(0,t.__)("Cone","ti_blocks"),value:"cone"},{label:(0,t.__)("Cylinder","ti_blocks"),value:"cylinder"},{label:(0,t.__)("Dodecahedron","ti_blocks"),value:"dodecahedron"},{label:(0,t.__)("Icosahedron","ti_blocks"),value:"icosahedron"},{label:(0,t.__)("Octahedron","ti_blocks"),value:"octahedron"},{label:(0,t.__)("Plane","ti_blocks"),value:"plane"},{label:(0,t.__)("Ring","ti_blocks"),value:"ring"},{label:(0,t.__)("Sphere","ti_blocks"),value:"sphere"},{label:(0,t.__)("Tetrahedron","ti_blocks"),value:"tetrahedron"},{label:(0,t.__)("Torus","ti_blocks"),value:"torus"},{label:(0,t.__)("Torus Knot","ti_blocks"),value:"torusknot"},{label:(0,t.__)("GLTF Model","ti_blocks"),value:"gltf"},{label:(0,t.__)("3D Text","ti_blocks"),value:"3dtext"}],onChange:e=>a({geometry:e})}),"gltf"===e.geometry?(0,n.jsx)(o.TextControl,{label:(0,t.__)("GLTF Model URL","ti_blocks"),value:e.gltf_url,onChange:e=>a({gltf_url:e})}):"3dtext"===e.geometry?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(o.TextControl,{label:(0,t.__)("Text to show","ti_blocks"),value:e.trid_text,onChange:e=>a({trid_text:e})}),(0,n.jsxs)("fieldset",{children:[(0,n.jsx)("legend",{children:(0,t.__)("Color","ti_blocks")}),(0,n.jsx)(o.ColorPalette,{value:e.trid_color,colors:[{name:"Black",color:"#000000"},{name:"White",color:"#ffffff"},{name:"Red",color:"#ff0000"},{name:"Orange",color:"#ffa500"},{name:"Yellow",color:"#ffff00"},{name:"Green",color:"#00ff00"},{name:"Blue",color:"#0000ff"},{name:"Indigo",color:"#4b0082"},{name:"Violet",color:"#ee82ee"}],onChange:e=>a({trid_color:e})})]}),(0,n.jsx)(o.TextControl,{label:(0,t.__)("Size","ti_blocks"),value:e.trid_size,type:"number",onChange:e=>a({trid_size:e})})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(o.SelectControl,{label:(0,t.__)("Material","ti_blocks"),value:e.geometry_material,options:[{label:(0,t.__)("Basic","ti_blocks"),value:"basic"},{label:(0,t.__)("Lambert","ti_blocks"),value:"lambert"},{label:(0,t.__)("Phong","ti_blocks"),value:"phong"},{label:(0,t.__)("Standard","ti_blocks"),value:"standard"},{label:(0,t.__)("Physical","ti_blocks"),value:"physical"}],onChange:e=>a({geometry_material:e})}),(0,n.jsxs)("fieldset",{children:[(0,n.jsx)("legend",{children:(0,t.__)("Color","ti_blocks")}),(0,n.jsx)(o.ColorPalette,{value:e.geometry_color,colors:[{name:"Black",color:"#000000"},{name:"White",color:"#ffffff"},{name:"Red",color:"#ff0000"},{name:"Orange",color:"#ffa500"},{name:"Yellow",color:"#ffff00"},{name:"Green",color:"#00ff00"},{name:"Blue",color:"#0000ff"},{name:"Indigo",color:"#4b0082"},{name:"Violet",color:"#ee82ee"}],onChange:e=>a({geometry_color:e})})]})]}),"3dtext"!==e.geometry&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(o.TextControl,{label:(0,t.__)("X Rotation Speed","ti_blocks"),value:e.geometry_xrotation,type:"number",onChange:e=>a({geometry_xrotation:e})}),(0,n.jsx)(o.TextControl,{label:(0,t.__)("Y Rotation Speed","ti_blocks"),value:e.geometry_yrotation,type:"number",onChange:e=>a({geometry_yrotation:e})}),(0,n.jsx)(o.TextControl,{label:(0,t.__)("Z Rotation Speed","ti_blocks"),value:e.geometry_zrotation,type:"number",onChange:e=>a({geometry_zrotation:e})})]})]}),(0,n.jsxs)(o.PanelBody,{title:(0,t.__)("Light Settings","ti_blocks"),children:[(0,n.jsx)(o.SelectControl,{label:(0,t.__)("Type","ti_blocks"),value:e.light,options:[{label:(0,t.__)("directional","ti_blocks"),value:"directional"},{label:(0,t.__)("hemisphere","ti_blocks"),value:"hemisphere"},{label:(0,t.__)("point","ti_blocks"),value:"point"},{label:(0,t.__)("spotlight","ti_blocks"),value:"spotlight"},{label:(0,t.__)("ambient","ti_blocks"),value:"ambient"}],onChange:e=>a({light:e})}),(0,n.jsx)(o.TextControl,{label:(0,t.__)("Intensity","ti_blocks"),value:e.light_intensity,type:"number",onChange:e=>a({light_intensity:e})}),(0,n.jsxs)("fieldset",{children:[(0,n.jsx)("legend",{children:(0,t.__)("Color","ti_blocks")}),(0,n.jsx)(o.ColorPalette,{value:e.light_color,colors:[{name:"Black",color:"#000000"},{name:"White",color:"#ffffff"},{name:"Red",color:"#ff0000"},{name:"Orange",color:"#ffa500"},{name:"Yellow",color:"#ffff00"},{name:"Green",color:"#00ff00"},{name:"Blue",color:"#0000ff"},{name:"Indigo",color:"#4b0082"},{name:"Violet",color:"#ee82ee"}],onChange:e=>a({light_color:e})})]}),"spotlight"!==e.light&&"ambient"!==e.light&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(o.TextControl,{label:(0,t.__)("X Position","ti_blocks"),value:e.light_xpos,type:"number",onChange:e=>a({light_xpos:e})}),(0,n.jsx)(o.TextControl,{label:(0,t.__)("Y Position","ti_blocks"),value:e.light_ypos,type:"number",onChange:e=>a({light_ypos:e})}),(0,n.jsx)(o.TextControl,{label:(0,t.__)("Z Position","ti_blocks"),value:e.light_zpos,type:"number",onChange:e=>a({light_zpos:e})})]}),(0,n.jsx)(o.ToggleControl,{label:(0,t.__)("Light Helper","ti_blocks"),checked:e.light_helper,onChange:e=>a({light_helper:e})})]}),(0,n.jsxs)(o.PanelBody,{title:(0,t.__)("Camera Settings","ti_blocks"),children:[(0,n.jsx)(o.ToggleControl,{label:(0,t.__)("Mouse Follow","ti_blocks"),checked:e.camera_followmouse,onChange:e=>a({camera_followmouse:e})}),!0!==e.camera_followmouse&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(o.TextControl,{label:(0,t.__)("X Position","ti_blocks"),value:e.camera_xpos,type:"number",onChange:e=>a({camera_xpos:e})}),(0,n.jsx)(o.TextControl,{label:(0,t.__)("Y Position","ti_blocks"),value:e.camera_ypos,type:"number",onChange:e=>a({camera_ypos:e})}),(0,n.jsx)(o.TextControl,{label:(0,t.__)("Z Position","ti_blocks"),value:e.camera_zpos,type:"number",onChange:e=>a({camera_zpos:e})}),(0,n.jsx)(o.TextControl,{label:(0,t.__)("Target X","ti_blocks"),value:e.camera_xtarget,type:"number",onChange:e=>a({camera_xtarget:e})}),(0,n.jsx)(o.TextControl,{label:(0,t.__)("Target Y","ti_blocks"),value:e.camera_ytarget,type:"number",onChange:e=>a({camera_ytarget:e})}),(0,n.jsx)(o.TextControl,{label:(0,t.__)("Target Z","ti_blocks"),value:e.camera_ztarget,type:"number",onChange:e=>a({camera_ztarget:e})})]})]}),(0,n.jsx)(o.PanelBody,{title:(0,t.__)("Instancing Settings","ti_blocks"),children:"gltf"!==e.geometry?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(o.ToggleControl,{label:(0,t.__)("Instancing","ti_blocks"),checked:e.geometry_instancing,onChange:e=>a({geometry_instancing:e})}),e.geometry_instancing&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(o.TextControl,{label:(0,t.__)("Number of Instances","ti_blocks"),value:e.geometry_instancingnum,type:"number",onChange:e=>a({geometry_instancingnum:e})}),(0,n.jsx)(o.TextControl,{label:(0,t.__)("Instance Spacing","ti_blocks"),value:e.geometry_instancingspacing,type:"number",onChange:e=>a({geometry_instancingspacing:e})})]})]}):(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(o.Notice,{status:"warning",isDismissible:!1,children:(0,t.__)("Instancing is not supported for URL-based models.","ti_blocks")})})}),(0,n.jsxs)(o.PanelBody,{title:(0,t.__)("Backgrounds","ti_blocks"),children:[(0,n.jsx)(o.SelectControl,{label:(0,t.__)("Type","ti_blocks"),value:e.scene_background,options:[{label:(0,t.__)("None","ti_blocks"),value:"none"},{label:(0,t.__)("Particles","ti_blocks"),value:"particles"},{label:(0,t.__)("CubeGrid","ti_blocks"),value:"cubegrid"}],onChange:e=>a({scene_background:e})}),"particles"===e.scene_background&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(o.TextControl,{label:(0,t.__)("Amount","ti_blocks"),value:e.particle_amount,type:"number",onChange:e=>a({particle_amount:e})}),(0,n.jsx)(o.TextControl,{label:(0,t.__)("Size","ti_blocks"),value:e.particle_size,type:"number",onChange:e=>a({particle_size:e})}),(0,n.jsx)(o.TextControl,{label:(0,t.__)("Speed","ti_blocks"),value:e.particle_speed,type:"number",onChange:e=>a({particle_speed:e})}),e.particle_speed<0&&(0,n.jsx)(o.Notice,{status:"warning",isDismissible:!1,children:(0,t.__)("A negative value for particle speed will affect its animation.","ti_blocks")}),(0,n.jsx)(o.SelectControl,{label:(0,t.__)("Direction","ti_blocks"),value:e.particle_direction,options:[{label:(0,t.__)("Up","ti_blocks"),value:"up"},{label:(0,t.__)("Down","ti_blocks"),value:"down"},{label:(0,t.__)("Right","ti_blocks"),value:"right"},{label:(0,t.__)("Left","ti_blocks"),value:"left"}],onChange:e=>a({particle_direction:e})}),(0,n.jsx)(o.TextControl,{label:(0,t.__)("Stretch","ti_blocks"),value:e.particle_stretch,type:"number",onChange:e=>a({particle_stretch:e})}),(0,n.jsxs)("fieldset",{children:[(0,n.jsx)("legend",{children:(0,t.__)("Color","ti_blocks")}),(0,n.jsx)(o.ColorPalette,{value:e.particle_color,colors:[{name:"Black",color:"#000000"},{name:"White",color:"#ffffff"},{name:"Red",color:"#ff0000"},{name:"Orange",color:"#ffa500"},{name:"Yellow",color:"#ffff00"},{name:"Green",color:"#00ff00"},{name:"Blue",color:"#0000ff"},{name:"Indigo",color:"#4b0082"},{name:"Violet",color:"#ee82ee"}],onChange:e=>a({particle_color:e})})]})]}),"cubegrid"===e.scene_background&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(o.TextControl,{label:(0,t.__)("Stretch","ti_blocks"),value:e.cubegrid_stretch,type:"number",onChange:e=>a({cubegrid_stretch:e})}),(0,n.jsx)(o.TextControl,{label:(0,t.__)("Spacing","ti_blocks"),value:e.cubegrid_spacing,type:"number",onChange:e=>a({cubegrid_spacing:e})}),(0,n.jsx)(o.SelectControl,{label:(0,t.__)("Material","ti_blocks"),value:e.cubegrid_material,options:[{label:(0,t.__)("Phong","ti_blocks"),value:"phong"},{label:(0,t.__)("Basic","ti_blocks"),value:"basic"},{label:(0,t.__)("Lambert","ti_blocks"),value:"lambert"},{label:(0,t.__)("Standard","ti_blocks"),value:"standard"},{label:(0,t.__)("Physical","ti_blocks"),value:"physical"}],onChange:e=>a({cubegrid_material:e})}),(0,n.jsxs)("fieldset",{children:[(0,n.jsx)("legend",{children:(0,t.__)("Color","ti_blocks")}),(0,n.jsx)(o.ColorPalette,{value:e.cubegrid_color,colors:[{name:"Black",color:"#000000"},{name:"White",color:"#ffffff"},{name:"Red",color:"#ff0000"},{name:"Orange",color:"#ffa500"},{name:"Yellow",color:"#ffff00"},{name:"Green",color:"#00ff00"},{name:"Blue",color:"#0000ff"},{name:"Indigo",color:"#4b0082"},{name:"Violet",color:"#ee82ee"}],onChange:e=>a({cubegrid_color:e})})]}),e.cubegrid_stretch<0&&(0,n.jsx)(o.Notice,{status:"warning",isDismissible:!1,children:(0,t.__)("Using a negative numeric value will affect the CubeGrid's layout. Your negative input will be converted to positive.","ti_blocks")})]})]})]})}),(0,n.jsx)(o.ResizableBox,{size:{height:c,width:"100%"},minHeight:400,enable:{bottom:!0},onResizeStop:(e,t,l,o)=>{const n=c+o.height;a({block_height:`${n}px`})},className:"ti-block-resizable-box",children:(0,n.jsxs)("div",{style:{minHeight:s||"400px",height:"100%",width:"100%",display:"flex",flexDirection:"column",position:"relative",overflow:"hidden",paddingBottom:"40px"},children:[(0,n.jsxs)("div",{className:"ti-block-heading",style:{width:"100%",flexShrink:0},children:[(0,n.jsx)("h2",{children:(0,t.__)("Your three.js scene will render on the front end.","three-importer")}),(0,n.jsx)("p",{children:(0,t.__)("Scene Settings can be found in the Block settings.","three-importer")})]}),(0,n.jsx)("div",{className:"ti-inner-wrapper",style:{width:"100%",flexGrow:1,display:"flex",flexDirection:"column",pointerEvents:"none",justifyContent:"bottom"===i?"flex-end":"center"===i?"center":"flex-start",alignItems:"right"===r?"flex-end":"center"===r?"center":"stretch"},children:(0,n.jsx)("div",{style:{pointerEvents:"auto",width:"100%",maxWidth:"100%"},children:(0,n.jsx)(l.InnerBlocks,{renderAppender:l.InnerBlocks.ButtonBlockAppender})})})]})})]})},save:function({attributes:e}){const{inner_alignment:t,inner_vertical_alignment:o,block_height:a}=e,r=l.useBlockProps.save({className:"three-importer-block-wrapper"});return(0,n.jsx)("div",{...r,children:(0,n.jsx)("div",{className:"ti-content",style:{minHeight:a||"400px",display:"flex",flexDirection:"column",justifyContent:"bottom"===o?"flex-end":"center"===o?"center":"flex-start",alignItems:"right"===t?"flex-end":"center"===t?"center":"stretch"},children:(0,n.jsx)("div",{style:{pointerEvents:"auto",width:"100%"},children:(0,n.jsx)(l.InnerBlocks.Content,{})})})})}})}},l={};function o(e){var n=l[e];if(void 0!==n)return n.exports;var a=l[e]={exports:{}};return t[e](a,a.exports,o),a.exports}o.m=t,e=[],o.O=(t,l,n,a)=>{if(!l){var r=1/0;for(_=0;_<e.length;_++){for(var[l,n,a]=e[_],i=!0,s=0;s<l.length;s++)(!1&a||r>=a)&&Object.keys(o.O).every((e=>o.O[e](l[s])))?l.splice(s--,1):(i=!1,a<r&&(r=a));if(i){e.splice(_--,1);var c=n();void 0!==c&&(t=c)}}return t}a=a||0;for(var _=e.length;_>0&&e[_-1][2]>a;_--)e[_]=e[_-1];e[_]=[l,n,a]},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={57:0,350:0};o.O.j=t=>0===e[t];var t=(t,l)=>{var n,a,[r,i,s]=l,c=0;if(r.some((t=>0!==e[t]))){for(n in i)o.o(i,n)&&(o.m[n]=i[n]);if(s)var _=s(o)}for(t&&t(l);c<r.length;c++)a=r[c],o.o(e,a)&&e[a]&&e[a][0](),e[a]=0;return o.O(_)},l=globalThis.webpackChunkthree_importer=globalThis.webpackChunkthree_importer||[];l.forEach(t.bind(null,0)),l.push=t.bind(null,l.push.bind(l))})();var n=o.O(void 0,[350],(()=>o(780)));n=o.O(n)})(); -
three-importer/trunk/readme.txt
r3468054 r3468063 3 3 Tags: threejs, 3d, webgl, graphics, animation 4 4 Requires PHP: 7.4 5 Requires at least: 5.05 Requires at least: 6.7 6 6 Tested up to: 6.9 7 Stable tag: 1.0. 47 Stable tag: 1.0.5 8 8 License: GPL-2.0-or-later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html -
three-importer/trunk/three-importer.php
r3468054 r3468063 3 3 * Plugin Name: Three Importer 4 4 * Description: Create custom Three.js scenes via Block, Shortcode, or your own script. 5 * Version: 1.0. 45 * Version: 1.0.5 6 6 * Requires at least: 6.7 7 7 * Requires PHP: 7.4
Note: See TracChangeset
for help on using the changeset viewer.