Changeset 3106603
- Timestamp:
- 06/24/2024 10:42:13 AM (2 weeks ago)
- Location:
- mortgage
- Files:
-
- 90 added
- 10 deleted
- 20 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
mortgage/tags/0.4.0/build/button/block.json
r2885133 r3106603 1 1 { 2 2 "$schema": "https://schemas.wp.org/trunk/block.json", 3 "apiVersion": 2,3 "apiVersion": , 4 4 "name": "mortgage/button", 5 5 "ancestor": [ … … 38 38 "html": false, 39 39 "lock": false, 40 "multiple": false,41 40 "reusable": false, 42 " className": false,41 "e, 43 42 "color": { 44 43 "background": true, … … 46 45 "gradients": true 47 46 }, 48 "__experimentalBorder": true, 47 "__experimentalBorder": { 48 "color": true, 49 "radius": true, 50 "style": true, 51 "width": true, 52 "__experimentalDefaultControls": { 53 "color": true, 54 "radius": true, 55 "style": true, 56 "width": true 57 } 58 }, 49 59 "spacing": { 50 60 "padding": true, … … 53 63 } 54 64 } 55 } 65 }, 66 "editorScript": "file:./index.js", 67 "render": "file:./render.php" 56 68 } -
mortgage/tags/0.4.0/build/index.asset.php
r3010719 r3106603 1 <?php return array('dependencies' => array(' wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n'), 'version' => '09e161e779800ff6b8a0');1 <?php return array('dependencies' => array(''); -
mortgage/tags/0.4.0/build/index.css
r2885133 r3106603 1 .wp-block-mortgage-form .wp-block-mortgage-input.hide,.wp-block-mortgage-form .wp-block-mortgage-select.hide{display:block!important} 1 .wp-block-mortgage-form .wp-block-mortgage-input.hide,.wp-block-mortgage-form .wp-block-mortgage-select.hide{display:block!important} -
mortgage/tags/0.4.0/build/index.js
r3010719 r3106603 1 (()=>{ var e,t={735:(e,t,l)=>{"use strict";const a=window.wp.blocks,r=window.wp.element,o=window.wp.i18n,n=window.wp.blockEditor,i=window.wp.components;function s(e){const{attributes:t,setAttributes:l}=e;return(0,r.createElement)(n.InspectorControls,null,(0,r.createElement)(i.PanelBody,{title:(0,o.__)("Form","mortgage"),initialOpen:!0},(0,r.createElement)(i.TextControl,{label:(0,o.__)("Currency symbol","mortgage"),value:t.currency,onChange:e=>l({currency:e})}),(0,r.createElement)(i.ToggleControl,{label:(0,o.__)("Show table","mortgage"),checked:t.showTable,onChange:e=>l({showTable:e})}),(0,r.createElement)(i.ToggleControl,{label:(0,o.__)("Show year summary","mortgage"),checked:t.yearSummary,onChange:e=>l({yearSummary:e})})))}function c(){return c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)Object.prototype.hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e},c.apply(this,arguments)}const u=[{name:"default",title:(0,o.__)("Mortgage calculator","mortgage"),icon:"calculator",innerBlocks:[["mortgage/input",{name:"amount",label:(0,o.__)("Amount","mortgage"),value:1e4,min:0,max:""}],["mortgage/input",{name:"rate",label:(0,o.__)("Rate","mortgage"),value:4,min:0,step:.01}],["mortgage/input",{name:"term",label:(0,o.__)("Term","mortgage"),value:10}],["mortgage/select",{name:"frequency",label:(0,o.__)("Frequency","mortgage"),values:[{value:52,label:(0,o.__)("Weekly","mortgage")},{value:26,label:(0,o.__)("Fortnightly","mortgage")},{value:12,label:(0,o.__)("Monthly","mortgage")},{value:6,label:(0,o.__)("Bi-Monthly","mortgage")},{value:4,label:(0,o.__)("Quarterly","mortgage")},{value:2,label:(0,o.__)("Half-yearly","mortgage")},{value:1,label:(0,o.__)("Yearly","mortgage")}]}],["mortgage/button",{text:(0,o.__)("Calculate","mortgage")}]],attributes:{type:"loan"},scope:["block","inserter"],isDefault:!0},{name:"rates",title:(0,o.__)("Rates Comparator","mortgage"),icon:"calculator",innerBlocks:[["mortgage/input",{name:"amount",label:(0,o.__)("Amount","mortgage"),value:1e4,min:0,max:""}],["mortgage/input",{name:"rate",label:(0,o.__)("Rate","mortgage"),value:4,min:0,step:.01}],["mortgage/input",{name:"term",label:(0,o.__)("Term","mortgage"),value:10}],["mortgage/select",{name:"increment",label:(0,o.__)("Increment","mortgage"),values:[{value:.125,label:"1/8%"},{value:.25,label:"1/4%"},{value:.375,label:"3/8%"},{value:.5,label:"1/2%"},{value:.625,label:"5/8%"},{value:.875,label:"7/8%"},{value:1,label:"1%"}]}],["mortgage/button",{text:(0,o.__)("Calculate","mortgage")}]],attributes:{type:"rates"},scope:["block","inserter"],isDefault:!0},{name:"duration",title:(0,o.__)("Duration Comparator","mortgage"),icon:"calculator",innerBlocks:[["mortgage/input",{name:"amount",label:(0,o.__)("Amount","mortgage"),value:1e4,min:0}],["mortgage/input",{name:"rate",label:(0,o.__)("Rate","mortgage"),value:4,min:0,step:.01}],["mortgage/button",{text:(0,o.__)("Calculate","mortgage")}]],attributes:{type:"duration"},scope:["block","inserter"],isDefault:!0}];u.forEach((e=>{e.isActive=(e,t)=>e.type===t.type}));const m=u,g=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"mortgage/form","title":"Mortgage","category":"widgets","icon":"calculator","description":"A block to generate a mortgage calculator form.","supports":{"html":true,"reusable":true,"className":true,"color":true},"attributes":{"currency":{"type":"string","default":"$"},"showTable":{"type":"boolean","default":false},"yearSummary":{"type":"boolean","default":false},"type":{"enum":["loan","rates","duration"]}},"styles":[{"name":"regular","label":"Default","isDefault":true},{"name":"bolded","label":"Bolded label"},{"name":"modern","label":"Modern"}],"textdomain":"mortgage","editorScript":"file:./build/index.js","editorStyle":"file:./build/index.css","viewScript":"file:./build/frontend.js","style":"file:./build/style-index.css"}');(0,a.registerBlockType)(g,{variations:m,edit:function(e){const t=(0,n.useBlockProps)(),{children:l}=(0,n.useInnerBlocksProps)(t,{template:[["mortgage/input",{name:"amount",label:(0,o.__)("Amount","mortgage"),value:1e4,min:0}],["mortgage/input",{name:"rate",label:(0,o.__)("Rate","mortgage"),value:4,min:0,step:.01}],["mortgage/input",{name:"term",label:(0,o.__)("Term","mortgage"),value:10,max:50}],["mortgage/select",{name:"frequency",label:(0,o.__)("Frequency","mortgage"),values:[{value:52,label:(0,o.__)("Weekly","mortgage")},{value:26,label:(0,o.__)("Fortnightly","mortgage")},{value:12,label:(0,o.__)("Monthly","mortgage")},{value:6,label:(0,o.__)("Bi-Monthly","mortgage")},{value:4,label:(0,o.__)("Quarterly","mortgage")},{value:2,label:(0,o.__)("Half-yearly","mortgage")},{value:1,label:(0,o.__)("Yearly","mortgage")}]}],["mortgage/button",{text:(0,o.__)("Calculate","mortgage")}]]});return(0,r.createElement)("div",t,(0,r.createElement)(s,e),l)},save:function(e){let{attributes:t}=e;const l=n.useBlockProps.save(),a=n.useInnerBlocksProps.save();return(0,r.createElement)("form",c({},l,{noValidate:!0,"data-currency":t.currency,"data-yearSummary":t.yearSummary,"data-showTable":t.showTable,"data-type":t.type},a))}});var p=l(184),h=l.n(p);(0,r.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(i.Rect,{x:"7",y:"10",width:"10",height:"4",rx:"1",fill:"currentColor"})),(0,r.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(i.Rect,{x:"4.75",y:"15.25",width:"6.5",height:"9.5",transform:"rotate(-90 4.75 15.25)",stroke:"currentColor",strokeWidth:"1.5",fill:"none"}),(0,r.createElement)(i.Rect,{x:"16",y:"10",width:"4",height:"4",rx:"1",fill:"currentColor"})),(0,r.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(i.Rect,{x:"4.75",y:"15.25",width:"6.5",height:"14.5",transform:"rotate(-90 4.75 15.25)",stroke:"currentColor",strokeWidth:"1.5",fill:"none"}),(0,r.createElement)(i.Rect,{x:"14",y:"10",width:"4",height:"4",rx:"1",fill:"currentColor"})),(0,r.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(i.Rect,{x:"4.75",y:"15.25",width:"6.5",height:"14.5",transform:"rotate(-90 4.75 15.25)",stroke:"currentColor",fill:"none",strokeWidth:"1.5"})),(0,r.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(i.Rect,{x:"4.75",y:"7.75",width:"14.5",height:"8.5",rx:"1.25",stroke:"currentColor",fill:"none",strokeWidth:"1.5"}),(0,r.createElement)(i.Rect,{x:"8",y:"11",width:"8",height:"2",fill:"currentColor"}));const b=(0,r.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(i.Rect,{x:"4.75",y:"17.25",width:"5.5",height:"14.5",transform:"rotate(-90 4.75 17.25)",stroke:"currentColor",fill:"none",strokeWidth:"1.5"}),(0,r.createElement)(i.Rect,{x:"4",y:"7",width:"10",height:"2",fill:"currentColor"})),d=["core/bold","core/italic","core/link"],v=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"mortgage/input","ancestor":["mortgage/form"],"title":"Number input","textdomain":"mortgage","attributes":{"lock":{"type":"object","default":{"move":false,"remove":true}},"type":{"type":"string","source":"attribute","selector":"input","attribute":"type","default":"text"},"id":{"type":"string","source":"attribute","selector":"input","attribute":"id","default":""},"name":{"type":"string","source":"attribute","selector":"input","attribute":"name"},"hideLabel":{"type":"boolean","selector":"label.hide","default":false},"label":{"type":"string","source":"html","selector":"label","default":"My input"},"placeholder":{"type":"string","source":"attribute","selector":"input","attribute":"placeholder"},"value":{"type":"string","source":"attribute","selector":"input","attribute":"value"},"readOnly":{"type":"boolean","source":"attribute","selector":"input","attribute":"readonly"},"min":{"type":"string","source":"attribute","selector":"input","attribute":"min"},"max":{"type":"string","source":"attribute","selector":"input","attribute":"max"},"step":{"type":"string","source":"attribute","selector":"input","attribute":"step"},"showHelp":{"type":"boolean","default":false},"help":{"type":"string","source":"html","selector":"small"}},"supports":{"multiple":true,"reusable":false,"className":true,"lock":false}}');(0,a.registerBlockType)(v,{icon:(0,r.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",width:"52px",height:"52px",viewBox:"0 0 52 52",enableBackground:"new 0 0 52 52"},(0,r.createElement)("path",{d:"M44.8,49.5H7.2c-2.6,0-4.7-2.1-4.7-4.7V7.2c0-2.6,2.1-4.7,4.7-4.7h37.6c2.6,0,4.7,2.1,4.7,4.7v37.6 C49.5,47.4,47.4,49.5,44.8,49.5z M8.8,10.3v31.3c0,0.9,0.7,1.6,1.6,1.6h31.3c0.9,0,1.6-0.7,1.6-1.6V10.3c0-0.9-0.7-1.6-1.6-1.6H10.4 C9.5,8.8,8.8,9.5,8.8,10.3z"}),(0,r.createElement)("path",{d:"M36.2,20.3h-2.9l1.2-4.8v-0.1c0-0.2-0.1-0.4-0.4-0.4h-2.3c-0.2,0-0.3,0.1-0.4,0.3l-1.2,4.9h-5.8l1.2-4.8 v-0.1c0-0.2-0.1-0.4-0.4-0.4h-2.3c-0.2,0-0.3,0.1-0.4,0.3l-1.3,4.9h-3.2c-0.2,0-0.3,0.1-0.4,0.3l-0.6,2.2v0.1c0,0.2,0.1,0.4,0.4,0.4 h3l-1.4,5.6h-3.1c-0.2,0-0.3,0.1-0.4,0.3l-0.6,2.2v0.1c0,0.2,0.1,0.4,0.4,0.4h2.9l-1.2,4.8v0.1c0,0.2,0.1,0.4,0.4,0.4h2.3 c0.2,0,0.3-0.1,0.4-0.3l1.3-5h5.7L26,36.4v0.1c0,0.2,0.1,0.4,0.4,0.4h2.3c0.2,0,0.3-0.1,0.4-0.3l1.3-5h3.2c0.2,0,0.3-0.1,0.4-0.3 l0.6-2.2V29c0-0.2-0.1-0.4-0.4-0.4h-3l1.4-5.6h3.1c0.2,0,0.3-0.1,0.4-0.3l0.6-2.2v-0.1C36.6,20.5,36.4,20.3,36.2,20.3L36.2,20.3z M28.1,28.8h-5.8l1.4-5.6h5.7L28.1,28.8z"})),edit:function(e){let{attributes:t,setAttributes:l}=e;const{hide:a,label:s,value:c,help:u,placeholder:m,showHelp:g,hideLabel:p,min:v,max:f,readOnly:y,step:_}=t,w=h()({hide:p}),x=h()({hide:a}),E=(0,n.useBlockProps)({className:x});return(0,r.createElement)("div",E,(0,r.createElement)(n.BlockControls,null,(0,r.createElement)(i.ToolbarGroup,null,(0,r.createElement)(i.ToolbarButton,{label:(0,o.__)("Toggle label","mortgage"),icon:b,isPressed:p,onClick:()=>{l({hideLabel:!p})}}),(0,r.createElement)(i.ToolbarButton,{label:(0,o.__)("Show help message","mortgage"),icon:"editor-help",isPressed:g,onClick:()=>{l({showHelp:!g})}}),(0,r.createElement)(i.ToolbarButton,{label:(0,o.__)("Hide field","mortgage"),icon:"hidden",isPressed:a,onClick:()=>{l({hide:!a})}}))),(0,r.createElement)(n.InspectorControls,null,(0,r.createElement)(i.PanelBody,{title:(0,o.__)("Options"),initialOpen:!0},(0,r.createElement)(i.TextControl,{label:(0,o.__)("Placeholder","mortgage"),value:m,onChange:e=>{l({placeholder:e})},type:"number"}),(0,r.createElement)(i.ToggleControl,{label:(0,o.__)("Read Only","mortgage"),checked:y,onChange:e=>{l({readOnly:e})}}),(0,r.createElement)(i.TextControl,{label:(0,o.__)("Min","mortgage"),value:v,help:(0,o.__)("Set minimum value","mortgage"),onChange:e=>{l({min:Number(e)})},type:"number",min:0}),(0,r.createElement)(i.TextControl,{label:(0,o.__)("Max","mortgage"),help:(0,o.__)("Set maximum value","mortgage"),value:f,onChange:e=>{l({max:Number(e)})},type:"number",max:100,min:0}),(0,r.createElement)(i.TextControl,{label:(0,o.__)("Step","mortgage"),help:(0,o.__)("Set step value","mortgage"),value:_,onChange:e=>{l({step:Number(e)})},type:"number",step:.01}))),(0,r.createElement)(n.RichText,{tagName:"label",value:s,onChange:e=>{l({label:e})},placeholder:(0,o.__)("Enter label…","mortgage"),allowedFormats:[],className:w}),(0,r.createElement)("input",{type:"number",placeholder:c,value:c,onChange:e=>{l({value:e.target.value})},min:v,max:f,step:_||void 0,required:!0,readOnly:y||void 0}),g&&(0,r.createElement)(n.RichText,{tagName:"small",value:u,onChange:e=>{l({help:e})},placeholder:(0,o.__)("Enter help message…","mortgage"),allowedFormats:d}))},save:function(e){let{attributes:t}=e;const{hide:l,label:a,hideLabel:o,name:i,min:s,max:c,value:u,placeholder:m,help:g,readOnly:p,step:b}=t,d=h()({hide:o}),v=h()({hide:l}),f=n.useBlockProps.save({className:v});return(0,r.createElement)("div",f,(0,r.createElement)(n.RichText.Content,{tagName:"label",value:a,className:d,for:i}),(0,r.createElement)("input",{type:"number",name:i,min:s,max:c,step:b||void 0,required:!0,value:u,placeholder:m,readOnly:p||void 0,id:i}),g&&(0,r.createElement)(n.RichText.Content,{tagName:"small",value:g}))}});const f=["core/bold","core/italic","core/link"],y=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"mortgage/select","ancestor":["mortgage/form"],"title":"Select","textdomain":"mortgage","attributes":{"lock":{"type":"object","default":{"move":false,"remove":true}},"hide":{"type":"boolean","selector":"div.hide","default":false},"hideLabel":{"type":"boolean","selector":"label.hide","default":false},"label":{"type":"string","default":"Calculate"},"name":{"type":"string","default":""},"values":{"type":"array"},"showHelp":{"type":"boolean","default":false},"help":{"type":"string","default":""},"defaultValue":{"type":"number","default":""}},"supports":{"multiple":false,"reusable":false,"className":true,"lock":false}}');(0,a.registerBlockType)(y,{icon:(0,r.createElement)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,r.createElement)("path",{fillRule:"evenodd",d:"M3.75 5.5a.75.75 0 000 1.5h10a.75.75 0 000-1.5h-10zm5 6a.75.75 0 000 1.5h11.5a.75.75 0 000-1.5H8.75zm0 6a.75.75 0 000 1.5h11.5a.75.75 0 000-1.5H8.75zM5 12a1 1 0 11-2 0 1 1 0 012 0zm-1 7a1 1 0 100-2 1 1 0 000 2z"}),(0,r.createElement)("path",{d:"M19.309 7.918l-2.245-2.501A.25.25 0 0117.25 5h4.49a.25.25 0 01.185.417l-2.244 2.5a.25.25 0 01-.372 0z"})),edit:function(e){let{attributes:t,setAttributes:l}=e;const{hide:a,label:s,hideLabel:c,values:u,showHelp:m,help:g,defaultValue:p}=t,d=h()({hide:c}),v=h()({hide:a}),y=(0,n.useBlockProps)({className:v});return(0,r.createElement)("div",y,(0,r.createElement)(n.BlockControls,null,(0,r.createElement)(i.ToolbarGroup,null,(0,r.createElement)(i.ToolbarButton,{label:(0,o.__)("Toggle label","mortgage"),icon:b,isPressed:c,onClick:()=>{l({hideLabel:!c})}}),(0,r.createElement)(i.ToolbarButton,{label:(0,o.__)("Show help message","mortgage"),icon:"editor-help",isPressed:m,onClick:()=>{l({showHelp:!m})}}),(0,r.createElement)(i.ToolbarButton,{label:(0,o.__)("Hide field","mortgage"),icon:"hidden",isPressed:a,onClick:()=>{l({hide:!a})}}))),(0,r.createElement)(n.InspectorControls,null,(0,r.createElement)(i.PanelBody,{title:(0,o.__)("Options"),initialOpen:!0},(0,r.createElement)(i.SelectControl,{label:(0,o.__)("Default value","mortgage"),onChange:e=>{l({defaultValue:Number(e)})},value:p,options:u}))),(0,r.createElement)(n.RichText,{tagName:"label",value:s,onChange:e=>{l({label:e})},placeholder:(0,o.__)("Increment","mortgage"),allowedFormats:[],className:d}),(0,r.createElement)("select",{name:"increment",value:p,onChange:e=>l({defaultValue:e})},u.map((e=>(0,r.createElement)("option",{key:e.label,value:e.value},e.label)))),m&&(0,r.createElement)(n.RichText,{tagName:"small",value:g,onChange:e=>{l({help:e})},placeholder:(0,o.__)("Enter help message…","mortgage"),allowedFormats:f}))},save:function(e){let{attributes:t}=e;const{hide:l,label:a,hideLabel:o,name:i,values:s,help:c,defaultValue:u}=t,m=h()({hide:o}),g=h()({hide:l}),p=n.useBlockProps.save({className:g});return(0,r.createElement)("div",p,(0,r.createElement)(n.RichText.Content,{tagName:"label",value:a,className:m}),(0,r.createElement)("select",{name:i},s.map((e=>(0,r.createElement)("option",{key:e.label,value:e.value,selected:u===e.value},e.label)))),(0,r.createElement)(n.RichText.Content,{tagName:"small",value:c}))}});const _=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"mortgage/button","ancestor":["mortgage/form"],"title":"Button","icon":"button","textdomain":"mortgage","attributes":{"lock":{"type":"object","default":{"move":true,"remove":true}},"text":{"type":"string","default":"Calculate"},"alignment":{"type":"string","default":"left"},"style":{"type":"object","default":{"color":{"background":"#000000","text":"#ffffff"}}}},"supports":{"html":false,"lock":false,"multiple":false,"reusable":false,"className":false,"color":{"background":true,"text":true,"gradients":true},"__experimentalBorder":true,"spacing":{"padding":true,"__experimentalDefaultControls":{"padding":true}}}}');(0,a.registerBlockType)(_,{edit:function(e){let{attributes:t,setAttributes:l}=e;const{text:a,alignment:s}=t,u=[{icon:"align-left",title:(0,o.__)("Align Left","formello"),align:"left"},{icon:"align-center",title:(0,o.__)("Align Center","formello"),align:"center"},{icon:"align-right",title:(0,o.__)("Align Right","formello"),align:"right"},{icon:"align-wide",title:(0,o.__)("Wide","formello"),align:"wide"}],m=h()(s),g=(0,n.useBlockProps)({className:m});return(0,r.createElement)(r.Fragment,null,(0,r.createElement)(n.BlockControls,null,(0,r.createElement)(i.ToolbarGroup,null,(0,r.createElement)(i.ToolbarDropdownMenu,{icon:"align-"+s,label:(0,o.__)("Align"),controls:u.map((e=>{const{align:t}=e,a=t===s;return{...e,isActive:a,onClick:()=>l({alignment:t})}}))}))),(0,r.createElement)(n.RichText,c({},g,{tagName:"button",allowedFormats:[],value:a,onChange:e=>l({text:e}),placeholder:(0,o.__)("Enter button text…","mortgage")})))},save:function(e){let{attributes:t}=e;const{text:l,alignment:a,style:o}=t,i=o?.border?.radius,s=(0,n.__experimentalGetBorderClassesAndStyles)(t);"number"==typeof i&&(s.style.borderRadius=`${i}px`);const c=(0,n.__experimentalGetColorClassesAndStyles)(t),u=h()(c.className,a,"mortgage-btn","wp-element-button"),m=n.useBlockProps.save({className:u,style:c.style});return(0,r.createElement)("button",m,l)}})},184:(e,t)=>{var l;!function(){"use strict";var a={}.hasOwnProperty;function r(){for(var e=[],t=0;t<arguments.length;t++){var l=arguments[t];if(l){var o=typeof l;if("string"===o||"number"===o)e.push(l);else if(Array.isArray(l)){if(l.length){var n=r.apply(null,l);n&&e.push(n)}}else if("object"===o){if(l.toString!==Object.prototype.toString&&!l.toString.toString().includes("[native code]")){e.push(l.toString());continue}for(var i in l)a.call(l,i)&&l[i]&&e.push(i)}}}return e.join(" ")}e.exports?(r.default=r,e.exports=r):void 0===(l=function(){return r}.apply(t,[]))||(e.exports=l)}()}},l={};function a(e){var r=l[e];if(void 0!==r)return r.exports;var o=l[e]={exports:{}};return t[e](o,o.exports,a),o.exports}a.m=t,e=[],a.O=(t,l,r,o)=>{if(!l){var n=1/0;for(u=0;u<e.length;u++){for(var[l,r,o]=e[u],i=!0,s=0;s<l.length;s++)(!1&o||n>=o)&&Object.keys(a.O).every((e=>a.O[e](l[s])))?l.splice(s--,1):(i=!1,o<n&&(n=o));if(i){e.splice(u--,1);var c=r();void 0!==c&&(t=c)}}return t}o=o||0;for(var u=e.length;u>0&&e[u-1][2]>o;u--)e[u]=e[u-1];e[u]=[l,r,o]},a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},a.d=(e,t)=>{for(var l in t)a.o(t,l)&&!a.o(e,l)&&Object.defineProperty(e,l,{enumerable:!0,get:t[l]})},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={826:0,431:0};a.O.j=t=>0===e[t];var t=(t,l)=>{var r,o,[n,i,s]=l,c=0;if(n.some((t=>0!==e[t]))){for(r in i)a.o(i,r)&&(a.m[r]=i[r]);if(s)var u=s(a)}for(t&&t(l);c<n.length;c++)o=n[c],a.o(e,o)&&e[o]&&e[o][0](),e[o]=0;return a.O(u)},l=globalThis.webpackChunkmortgage=globalThis.webpackChunkmortgage||[];l.forEach(t.bind(null,0)),l.push=t.bind(null,l.push.bind(l))})();var r=a.O(void 0,[431],(()=>a(735)));r=a.O(r)})();1 (()=>{.O(r)})(); -
mortgage/tags/0.4.0/build/input/block.json
r2885133 r3106603 53 53 "attribute": "placeholder" 54 54 }, 55 56 57 58 59 60 55 61 "value": { 56 62 "type": "string", … … 96 102 "multiple": true, 97 103 "reusable": false, 104 98 105 "className": true, 99 106 "lock": false 100 } 107 }, 108 "editorScript": "file:./index.js" 101 109 } -
mortgage/tags/0.4.0/build/result/block.json
r2885133 r3106603 1 1 { 2 2 "$schema": "https://schemas.wp.org/trunk/block.json", 3 "apiVersion": 2,3 "apiVersion": , 4 4 "name": "mortgage/result", 5 "title": "Result", 6 "icon": "button", 5 "ancestor": [ 6 "mortgage/form" 7 ], 8 "title": "Mortgage result", 9 "icon": "info", 7 10 "textdomain": "mortgage", 11 12 13 8 14 "attributes": { 9 15 "lock": { … … 18 24 "default": "Calculate" 19 25 }, 26 27 28 20 29 "style": { 21 30 "type": "object", … … 24 33 "background": "#dff0d8", 25 34 "text": "#3c763d" 26 },27 "border": {28 "style": "solid",29 "width": "1px",30 "color": "green"31 35 } 32 36 } … … 34 38 }, 35 39 "supports": { 36 "multiple": false, 40 "html": false, 41 "lock": false, 37 42 "reusable": false, 38 "className": true,39 "__experimentalBorder": true,40 43 "color": { 41 44 "background": true, … … 43 46 "gradients": true 44 47 }, 45 "lock": false, 48 "__experimentalBorder": { 49 "color": true, 50 "radius": true, 51 "style": true, 52 "width": true, 53 "__experimentalDefaultControls": { 54 "color": true, 55 "radius": true, 56 "style": true, 57 "width": true 58 } 59 }, 46 60 "spacing": { 47 61 "padding": true, … … 50 64 } 51 65 } 52 } 66 }, 67 "editorScript": "file:./index.js", 68 "render": "file:./render.php" 53 69 } -
mortgage/tags/0.4.0/build/select/block.json
r2885133 r3106603 51 51 }, 52 52 "supports": { 53 "multiple": false,54 53 "reusable": false, 55 54 "className": true, 56 55 "lock": false 57 } 56 }, 57 "editorScript": "file:./index.js" 58 58 } -
mortgage/tags/0.4.0/build/style-index.css
r2885133 r3106603 1 .wp-block-mortgage-form .wp-block-mortgage-input,.wp-block-mortgage-form .wp-block-mortgage-select{align-items:flex-start;display:flex;flex-direction:column;flex-wrap:wrap;margin-bottom:1em}.wp-block-mortgage-form .wp-block-mortgage-input.hide,.wp-block-mortgage-form .wp-block-mortgage-select.hide,.wp-block-mortgage-form label.hide{display:none}.wp-block-mortgage-form button,.wp-block-mortgage-form input,.wp-block-mortgage-form select{box-sizing:border-box;padding:.5em}.wp-block-mortgage-form input,.wp-block-mortgage-form select{max-width:100%;width:100%}.wp-block-mortgage-form small{width:100%}.wp-block-mortgage-form button{display:block;margin:0}.wp-block-mortgage-form button.left{margin-left:0;margin-right:auto}.wp-block-mortgage-form button.right{margin-left:auto;margin-right:0}.wp-block-mortgage-form button.center{margin:auto}.wp-block-mortgage-form button.wide{width:100%}.wp-block-mortgage-form.is-style-bolded label,.wp-block-mortgage-form.is-style-modern label{font-weight:700}.wp-block-mortgage-form.is-style-modern input,.wp-block-mortgage-form.is-style-modern select{border:none;border-bottom:1px solid;border-radius:0}.wp-block-mortgage-result,.wp-block-mortgage-summary{border:1px solid transparent;margin:1rem 0;order:3;padding:.75rem 1.25rem;width:100%}.wp-block-mortgage-result.success,.wp-block-mortgage-summary.success{background-color:#dff0d8;border-color:#d0e9c6;color:#3c763d}.wp-block-mortgage-result.error,.wp-block-mortgage-summary.error{background-color:#fcf8e3;border-color:#faf2cc;color:#8a6d3b}.wp-block-mortgage-result small,.wp-block-mortgage-summary small{margin:0 5px}.wp-block-mortgage-result p,.wp-block-mortgage-summary p{margin:0}.wp-block-mortgage-table{order:3;overflow-x:auto;width:100%}.wp-block-mortgage-table small{margin:0 5px}.wp-block-mortgage-table table{width:100%!important}.wp-block-mortgage-table table td,.wp-block-mortgage-table th{text-align:center}1 .wp-block-mortgage-form}.wp-block-mortgage-table small{margin:0 5px}.wp-block-mortgage-table table{width:100%!important}.wp-block-mortgage-table table td,.wp-block-mortgage-table th{text-align:center} -
mortgage/tags/0.4.0/mortgage.php
r3010719 r3106603 3 3 * Plugin Name: Mortgage 4 4 * Description: A simple responsive mortgage calculator block with a clean flat design. 5 * Version: 0. 3.15 * Version: 0. 6 6 * Author: Calcolo Rata Mutuo 7 7 * Author URI: https://www.calcoloratamutuo.net/ … … 13 13 */ 14 14 15 16 17 18 15 19 /** 16 * Registers all block assets so that they can be enqueued through the block editor 17 * in the corresponding context. 20 * Registers the block using the metadata loaded from the `block.json` file. 21 * Behind the scenes, it registers also all assets so they can be enqueued 22 * through the block editor in the corresponding context. 18 23 * 19 * @see https://developer.wordpress.org/ block-editor/tutorials/block-tutorial/applying-styles-with-stylesheets/24 * @see https://developer.wordpress.org// 20 25 */ 21 function mortgage_block_init() { 22 register_block_type_from_metadata( 23 __DIR__, 24 ); 26 function mortgage2_block_init() { 27 register_block_type_from_metadata( __DIR__ . '/build' ); 28 register_block_type_from_metadata( __DIR__ . '/build/input' ); 29 register_block_type_from_metadata( __DIR__ . '/build/select' ); 30 register_block_type_from_metadata( __DIR__ . '/build/button' ); 31 register_block_type_from_metadata( __DIR__ . '/build/result' ); 32 register_block_type_from_metadata( __DIR__ . '/build/table' ); 25 33 } 26 add_action( 'init', 'mortgage _block_init' );34 add_action( 'init', 'mortgage_block_init' ); -
mortgage/tags/0.4.0/readme.txt
r3010719 r3106603 4 4 Tags: mortgage, calculator, mortgage calculator, mortgage calculator block, block 5 5 Requires at least: 5.6.0 6 Tested up to: 6. 4.27 Stable tag: 0. 3.16 Tested up to: 6. 7 Stable tag: 0. 8 8 Requires PHP: 5.6 9 9 License: GPL-2.0-or-later … … 48 48 49 49 == Changelog == 50 51 52 53 50 54 51 55 = 0.3.1 = -
mortgage/trunk/build/button/block.json
r2885133 r3106603 1 1 { 2 2 "$schema": "https://schemas.wp.org/trunk/block.json", 3 "apiVersion": 2,3 "apiVersion": , 4 4 "name": "mortgage/button", 5 5 "ancestor": [ … … 38 38 "html": false, 39 39 "lock": false, 40 "multiple": false,41 40 "reusable": false, 42 " className": false,41 "e, 43 42 "color": { 44 43 "background": true, … … 46 45 "gradients": true 47 46 }, 48 "__experimentalBorder": true, 47 "__experimentalBorder": { 48 "color": true, 49 "radius": true, 50 "style": true, 51 "width": true, 52 "__experimentalDefaultControls": { 53 "color": true, 54 "radius": true, 55 "style": true, 56 "width": true 57 } 58 }, 49 59 "spacing": { 50 60 "padding": true, … … 53 63 } 54 64 } 55 } 65 }, 66 "editorScript": "file:./index.js", 67 "render": "file:./render.php" 56 68 } -
mortgage/trunk/build/index.asset.php
r3010719 r3106603 1 <?php return array('dependencies' => array(' wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n'), 'version' => '09e161e779800ff6b8a0');1 <?php return array('dependencies' => array(''); -
mortgage/trunk/build/index.css
r2885133 r3106603 1 .wp-block-mortgage-form .wp-block-mortgage-input.hide,.wp-block-mortgage-form .wp-block-mortgage-select.hide{display:block!important} 1 .wp-block-mortgage-form .wp-block-mortgage-input.hide,.wp-block-mortgage-form .wp-block-mortgage-select.hide{display:block!important} -
mortgage/trunk/build/index.js
r3010719 r3106603 1 (()=>{ var e,t={735:(e,t,l)=>{"use strict";const a=window.wp.blocks,r=window.wp.element,o=window.wp.i18n,n=window.wp.blockEditor,i=window.wp.components;function s(e){const{attributes:t,setAttributes:l}=e;return(0,r.createElement)(n.InspectorControls,null,(0,r.createElement)(i.PanelBody,{title:(0,o.__)("Form","mortgage"),initialOpen:!0},(0,r.createElement)(i.TextControl,{label:(0,o.__)("Currency symbol","mortgage"),value:t.currency,onChange:e=>l({currency:e})}),(0,r.createElement)(i.ToggleControl,{label:(0,o.__)("Show table","mortgage"),checked:t.showTable,onChange:e=>l({showTable:e})}),(0,r.createElement)(i.ToggleControl,{label:(0,o.__)("Show year summary","mortgage"),checked:t.yearSummary,onChange:e=>l({yearSummary:e})})))}function c(){return c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)Object.prototype.hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e},c.apply(this,arguments)}const u=[{name:"default",title:(0,o.__)("Mortgage calculator","mortgage"),icon:"calculator",innerBlocks:[["mortgage/input",{name:"amount",label:(0,o.__)("Amount","mortgage"),value:1e4,min:0,max:""}],["mortgage/input",{name:"rate",label:(0,o.__)("Rate","mortgage"),value:4,min:0,step:.01}],["mortgage/input",{name:"term",label:(0,o.__)("Term","mortgage"),value:10}],["mortgage/select",{name:"frequency",label:(0,o.__)("Frequency","mortgage"),values:[{value:52,label:(0,o.__)("Weekly","mortgage")},{value:26,label:(0,o.__)("Fortnightly","mortgage")},{value:12,label:(0,o.__)("Monthly","mortgage")},{value:6,label:(0,o.__)("Bi-Monthly","mortgage")},{value:4,label:(0,o.__)("Quarterly","mortgage")},{value:2,label:(0,o.__)("Half-yearly","mortgage")},{value:1,label:(0,o.__)("Yearly","mortgage")}]}],["mortgage/button",{text:(0,o.__)("Calculate","mortgage")}]],attributes:{type:"loan"},scope:["block","inserter"],isDefault:!0},{name:"rates",title:(0,o.__)("Rates Comparator","mortgage"),icon:"calculator",innerBlocks:[["mortgage/input",{name:"amount",label:(0,o.__)("Amount","mortgage"),value:1e4,min:0,max:""}],["mortgage/input",{name:"rate",label:(0,o.__)("Rate","mortgage"),value:4,min:0,step:.01}],["mortgage/input",{name:"term",label:(0,o.__)("Term","mortgage"),value:10}],["mortgage/select",{name:"increment",label:(0,o.__)("Increment","mortgage"),values:[{value:.125,label:"1/8%"},{value:.25,label:"1/4%"},{value:.375,label:"3/8%"},{value:.5,label:"1/2%"},{value:.625,label:"5/8%"},{value:.875,label:"7/8%"},{value:1,label:"1%"}]}],["mortgage/button",{text:(0,o.__)("Calculate","mortgage")}]],attributes:{type:"rates"},scope:["block","inserter"],isDefault:!0},{name:"duration",title:(0,o.__)("Duration Comparator","mortgage"),icon:"calculator",innerBlocks:[["mortgage/input",{name:"amount",label:(0,o.__)("Amount","mortgage"),value:1e4,min:0}],["mortgage/input",{name:"rate",label:(0,o.__)("Rate","mortgage"),value:4,min:0,step:.01}],["mortgage/button",{text:(0,o.__)("Calculate","mortgage")}]],attributes:{type:"duration"},scope:["block","inserter"],isDefault:!0}];u.forEach((e=>{e.isActive=(e,t)=>e.type===t.type}));const m=u,g=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"mortgage/form","title":"Mortgage","category":"widgets","icon":"calculator","description":"A block to generate a mortgage calculator form.","supports":{"html":true,"reusable":true,"className":true,"color":true},"attributes":{"currency":{"type":"string","default":"$"},"showTable":{"type":"boolean","default":false},"yearSummary":{"type":"boolean","default":false},"type":{"enum":["loan","rates","duration"]}},"styles":[{"name":"regular","label":"Default","isDefault":true},{"name":"bolded","label":"Bolded label"},{"name":"modern","label":"Modern"}],"textdomain":"mortgage","editorScript":"file:./build/index.js","editorStyle":"file:./build/index.css","viewScript":"file:./build/frontend.js","style":"file:./build/style-index.css"}');(0,a.registerBlockType)(g,{variations:m,edit:function(e){const t=(0,n.useBlockProps)(),{children:l}=(0,n.useInnerBlocksProps)(t,{template:[["mortgage/input",{name:"amount",label:(0,o.__)("Amount","mortgage"),value:1e4,min:0}],["mortgage/input",{name:"rate",label:(0,o.__)("Rate","mortgage"),value:4,min:0,step:.01}],["mortgage/input",{name:"term",label:(0,o.__)("Term","mortgage"),value:10,max:50}],["mortgage/select",{name:"frequency",label:(0,o.__)("Frequency","mortgage"),values:[{value:52,label:(0,o.__)("Weekly","mortgage")},{value:26,label:(0,o.__)("Fortnightly","mortgage")},{value:12,label:(0,o.__)("Monthly","mortgage")},{value:6,label:(0,o.__)("Bi-Monthly","mortgage")},{value:4,label:(0,o.__)("Quarterly","mortgage")},{value:2,label:(0,o.__)("Half-yearly","mortgage")},{value:1,label:(0,o.__)("Yearly","mortgage")}]}],["mortgage/button",{text:(0,o.__)("Calculate","mortgage")}]]});return(0,r.createElement)("div",t,(0,r.createElement)(s,e),l)},save:function(e){let{attributes:t}=e;const l=n.useBlockProps.save(),a=n.useInnerBlocksProps.save();return(0,r.createElement)("form",c({},l,{noValidate:!0,"data-currency":t.currency,"data-yearSummary":t.yearSummary,"data-showTable":t.showTable,"data-type":t.type},a))}});var p=l(184),h=l.n(p);(0,r.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(i.Rect,{x:"7",y:"10",width:"10",height:"4",rx:"1",fill:"currentColor"})),(0,r.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(i.Rect,{x:"4.75",y:"15.25",width:"6.5",height:"9.5",transform:"rotate(-90 4.75 15.25)",stroke:"currentColor",strokeWidth:"1.5",fill:"none"}),(0,r.createElement)(i.Rect,{x:"16",y:"10",width:"4",height:"4",rx:"1",fill:"currentColor"})),(0,r.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(i.Rect,{x:"4.75",y:"15.25",width:"6.5",height:"14.5",transform:"rotate(-90 4.75 15.25)",stroke:"currentColor",strokeWidth:"1.5",fill:"none"}),(0,r.createElement)(i.Rect,{x:"14",y:"10",width:"4",height:"4",rx:"1",fill:"currentColor"})),(0,r.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(i.Rect,{x:"4.75",y:"15.25",width:"6.5",height:"14.5",transform:"rotate(-90 4.75 15.25)",stroke:"currentColor",fill:"none",strokeWidth:"1.5"})),(0,r.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(i.Rect,{x:"4.75",y:"7.75",width:"14.5",height:"8.5",rx:"1.25",stroke:"currentColor",fill:"none",strokeWidth:"1.5"}),(0,r.createElement)(i.Rect,{x:"8",y:"11",width:"8",height:"2",fill:"currentColor"}));const b=(0,r.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(i.Rect,{x:"4.75",y:"17.25",width:"5.5",height:"14.5",transform:"rotate(-90 4.75 17.25)",stroke:"currentColor",fill:"none",strokeWidth:"1.5"}),(0,r.createElement)(i.Rect,{x:"4",y:"7",width:"10",height:"2",fill:"currentColor"})),d=["core/bold","core/italic","core/link"],v=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"mortgage/input","ancestor":["mortgage/form"],"title":"Number input","textdomain":"mortgage","attributes":{"lock":{"type":"object","default":{"move":false,"remove":true}},"type":{"type":"string","source":"attribute","selector":"input","attribute":"type","default":"text"},"id":{"type":"string","source":"attribute","selector":"input","attribute":"id","default":""},"name":{"type":"string","source":"attribute","selector":"input","attribute":"name"},"hideLabel":{"type":"boolean","selector":"label.hide","default":false},"label":{"type":"string","source":"html","selector":"label","default":"My input"},"placeholder":{"type":"string","source":"attribute","selector":"input","attribute":"placeholder"},"value":{"type":"string","source":"attribute","selector":"input","attribute":"value"},"readOnly":{"type":"boolean","source":"attribute","selector":"input","attribute":"readonly"},"min":{"type":"string","source":"attribute","selector":"input","attribute":"min"},"max":{"type":"string","source":"attribute","selector":"input","attribute":"max"},"step":{"type":"string","source":"attribute","selector":"input","attribute":"step"},"showHelp":{"type":"boolean","default":false},"help":{"type":"string","source":"html","selector":"small"}},"supports":{"multiple":true,"reusable":false,"className":true,"lock":false}}');(0,a.registerBlockType)(v,{icon:(0,r.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",width:"52px",height:"52px",viewBox:"0 0 52 52",enableBackground:"new 0 0 52 52"},(0,r.createElement)("path",{d:"M44.8,49.5H7.2c-2.6,0-4.7-2.1-4.7-4.7V7.2c0-2.6,2.1-4.7,4.7-4.7h37.6c2.6,0,4.7,2.1,4.7,4.7v37.6 C49.5,47.4,47.4,49.5,44.8,49.5z M8.8,10.3v31.3c0,0.9,0.7,1.6,1.6,1.6h31.3c0.9,0,1.6-0.7,1.6-1.6V10.3c0-0.9-0.7-1.6-1.6-1.6H10.4 C9.5,8.8,8.8,9.5,8.8,10.3z"}),(0,r.createElement)("path",{d:"M36.2,20.3h-2.9l1.2-4.8v-0.1c0-0.2-0.1-0.4-0.4-0.4h-2.3c-0.2,0-0.3,0.1-0.4,0.3l-1.2,4.9h-5.8l1.2-4.8 v-0.1c0-0.2-0.1-0.4-0.4-0.4h-2.3c-0.2,0-0.3,0.1-0.4,0.3l-1.3,4.9h-3.2c-0.2,0-0.3,0.1-0.4,0.3l-0.6,2.2v0.1c0,0.2,0.1,0.4,0.4,0.4 h3l-1.4,5.6h-3.1c-0.2,0-0.3,0.1-0.4,0.3l-0.6,2.2v0.1c0,0.2,0.1,0.4,0.4,0.4h2.9l-1.2,4.8v0.1c0,0.2,0.1,0.4,0.4,0.4h2.3 c0.2,0,0.3-0.1,0.4-0.3l1.3-5h5.7L26,36.4v0.1c0,0.2,0.1,0.4,0.4,0.4h2.3c0.2,0,0.3-0.1,0.4-0.3l1.3-5h3.2c0.2,0,0.3-0.1,0.4-0.3 l0.6-2.2V29c0-0.2-0.1-0.4-0.4-0.4h-3l1.4-5.6h3.1c0.2,0,0.3-0.1,0.4-0.3l0.6-2.2v-0.1C36.6,20.5,36.4,20.3,36.2,20.3L36.2,20.3z M28.1,28.8h-5.8l1.4-5.6h5.7L28.1,28.8z"})),edit:function(e){let{attributes:t,setAttributes:l}=e;const{hide:a,label:s,value:c,help:u,placeholder:m,showHelp:g,hideLabel:p,min:v,max:f,readOnly:y,step:_}=t,w=h()({hide:p}),x=h()({hide:a}),E=(0,n.useBlockProps)({className:x});return(0,r.createElement)("div",E,(0,r.createElement)(n.BlockControls,null,(0,r.createElement)(i.ToolbarGroup,null,(0,r.createElement)(i.ToolbarButton,{label:(0,o.__)("Toggle label","mortgage"),icon:b,isPressed:p,onClick:()=>{l({hideLabel:!p})}}),(0,r.createElement)(i.ToolbarButton,{label:(0,o.__)("Show help message","mortgage"),icon:"editor-help",isPressed:g,onClick:()=>{l({showHelp:!g})}}),(0,r.createElement)(i.ToolbarButton,{label:(0,o.__)("Hide field","mortgage"),icon:"hidden",isPressed:a,onClick:()=>{l({hide:!a})}}))),(0,r.createElement)(n.InspectorControls,null,(0,r.createElement)(i.PanelBody,{title:(0,o.__)("Options"),initialOpen:!0},(0,r.createElement)(i.TextControl,{label:(0,o.__)("Placeholder","mortgage"),value:m,onChange:e=>{l({placeholder:e})},type:"number"}),(0,r.createElement)(i.ToggleControl,{label:(0,o.__)("Read Only","mortgage"),checked:y,onChange:e=>{l({readOnly:e})}}),(0,r.createElement)(i.TextControl,{label:(0,o.__)("Min","mortgage"),value:v,help:(0,o.__)("Set minimum value","mortgage"),onChange:e=>{l({min:Number(e)})},type:"number",min:0}),(0,r.createElement)(i.TextControl,{label:(0,o.__)("Max","mortgage"),help:(0,o.__)("Set maximum value","mortgage"),value:f,onChange:e=>{l({max:Number(e)})},type:"number",max:100,min:0}),(0,r.createElement)(i.TextControl,{label:(0,o.__)("Step","mortgage"),help:(0,o.__)("Set step value","mortgage"),value:_,onChange:e=>{l({step:Number(e)})},type:"number",step:.01}))),(0,r.createElement)(n.RichText,{tagName:"label",value:s,onChange:e=>{l({label:e})},placeholder:(0,o.__)("Enter label…","mortgage"),allowedFormats:[],className:w}),(0,r.createElement)("input",{type:"number",placeholder:c,value:c,onChange:e=>{l({value:e.target.value})},min:v,max:f,step:_||void 0,required:!0,readOnly:y||void 0}),g&&(0,r.createElement)(n.RichText,{tagName:"small",value:u,onChange:e=>{l({help:e})},placeholder:(0,o.__)("Enter help message…","mortgage"),allowedFormats:d}))},save:function(e){let{attributes:t}=e;const{hide:l,label:a,hideLabel:o,name:i,min:s,max:c,value:u,placeholder:m,help:g,readOnly:p,step:b}=t,d=h()({hide:o}),v=h()({hide:l}),f=n.useBlockProps.save({className:v});return(0,r.createElement)("div",f,(0,r.createElement)(n.RichText.Content,{tagName:"label",value:a,className:d,for:i}),(0,r.createElement)("input",{type:"number",name:i,min:s,max:c,step:b||void 0,required:!0,value:u,placeholder:m,readOnly:p||void 0,id:i}),g&&(0,r.createElement)(n.RichText.Content,{tagName:"small",value:g}))}});const f=["core/bold","core/italic","core/link"],y=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"mortgage/select","ancestor":["mortgage/form"],"title":"Select","textdomain":"mortgage","attributes":{"lock":{"type":"object","default":{"move":false,"remove":true}},"hide":{"type":"boolean","selector":"div.hide","default":false},"hideLabel":{"type":"boolean","selector":"label.hide","default":false},"label":{"type":"string","default":"Calculate"},"name":{"type":"string","default":""},"values":{"type":"array"},"showHelp":{"type":"boolean","default":false},"help":{"type":"string","default":""},"defaultValue":{"type":"number","default":""}},"supports":{"multiple":false,"reusable":false,"className":true,"lock":false}}');(0,a.registerBlockType)(y,{icon:(0,r.createElement)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,r.createElement)("path",{fillRule:"evenodd",d:"M3.75 5.5a.75.75 0 000 1.5h10a.75.75 0 000-1.5h-10zm5 6a.75.75 0 000 1.5h11.5a.75.75 0 000-1.5H8.75zm0 6a.75.75 0 000 1.5h11.5a.75.75 0 000-1.5H8.75zM5 12a1 1 0 11-2 0 1 1 0 012 0zm-1 7a1 1 0 100-2 1 1 0 000 2z"}),(0,r.createElement)("path",{d:"M19.309 7.918l-2.245-2.501A.25.25 0 0117.25 5h4.49a.25.25 0 01.185.417l-2.244 2.5a.25.25 0 01-.372 0z"})),edit:function(e){let{attributes:t,setAttributes:l}=e;const{hide:a,label:s,hideLabel:c,values:u,showHelp:m,help:g,defaultValue:p}=t,d=h()({hide:c}),v=h()({hide:a}),y=(0,n.useBlockProps)({className:v});return(0,r.createElement)("div",y,(0,r.createElement)(n.BlockControls,null,(0,r.createElement)(i.ToolbarGroup,null,(0,r.createElement)(i.ToolbarButton,{label:(0,o.__)("Toggle label","mortgage"),icon:b,isPressed:c,onClick:()=>{l({hideLabel:!c})}}),(0,r.createElement)(i.ToolbarButton,{label:(0,o.__)("Show help message","mortgage"),icon:"editor-help",isPressed:m,onClick:()=>{l({showHelp:!m})}}),(0,r.createElement)(i.ToolbarButton,{label:(0,o.__)("Hide field","mortgage"),icon:"hidden",isPressed:a,onClick:()=>{l({hide:!a})}}))),(0,r.createElement)(n.InspectorControls,null,(0,r.createElement)(i.PanelBody,{title:(0,o.__)("Options"),initialOpen:!0},(0,r.createElement)(i.SelectControl,{label:(0,o.__)("Default value","mortgage"),onChange:e=>{l({defaultValue:Number(e)})},value:p,options:u}))),(0,r.createElement)(n.RichText,{tagName:"label",value:s,onChange:e=>{l({label:e})},placeholder:(0,o.__)("Increment","mortgage"),allowedFormats:[],className:d}),(0,r.createElement)("select",{name:"increment",value:p,onChange:e=>l({defaultValue:e})},u.map((e=>(0,r.createElement)("option",{key:e.label,value:e.value},e.label)))),m&&(0,r.createElement)(n.RichText,{tagName:"small",value:g,onChange:e=>{l({help:e})},placeholder:(0,o.__)("Enter help message…","mortgage"),allowedFormats:f}))},save:function(e){let{attributes:t}=e;const{hide:l,label:a,hideLabel:o,name:i,values:s,help:c,defaultValue:u}=t,m=h()({hide:o}),g=h()({hide:l}),p=n.useBlockProps.save({className:g});return(0,r.createElement)("div",p,(0,r.createElement)(n.RichText.Content,{tagName:"label",value:a,className:m}),(0,r.createElement)("select",{name:i},s.map((e=>(0,r.createElement)("option",{key:e.label,value:e.value,selected:u===e.value},e.label)))),(0,r.createElement)(n.RichText.Content,{tagName:"small",value:c}))}});const _=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"mortgage/button","ancestor":["mortgage/form"],"title":"Button","icon":"button","textdomain":"mortgage","attributes":{"lock":{"type":"object","default":{"move":true,"remove":true}},"text":{"type":"string","default":"Calculate"},"alignment":{"type":"string","default":"left"},"style":{"type":"object","default":{"color":{"background":"#000000","text":"#ffffff"}}}},"supports":{"html":false,"lock":false,"multiple":false,"reusable":false,"className":false,"color":{"background":true,"text":true,"gradients":true},"__experimentalBorder":true,"spacing":{"padding":true,"__experimentalDefaultControls":{"padding":true}}}}');(0,a.registerBlockType)(_,{edit:function(e){let{attributes:t,setAttributes:l}=e;const{text:a,alignment:s}=t,u=[{icon:"align-left",title:(0,o.__)("Align Left","formello"),align:"left"},{icon:"align-center",title:(0,o.__)("Align Center","formello"),align:"center"},{icon:"align-right",title:(0,o.__)("Align Right","formello"),align:"right"},{icon:"align-wide",title:(0,o.__)("Wide","formello"),align:"wide"}],m=h()(s),g=(0,n.useBlockProps)({className:m});return(0,r.createElement)(r.Fragment,null,(0,r.createElement)(n.BlockControls,null,(0,r.createElement)(i.ToolbarGroup,null,(0,r.createElement)(i.ToolbarDropdownMenu,{icon:"align-"+s,label:(0,o.__)("Align"),controls:u.map((e=>{const{align:t}=e,a=t===s;return{...e,isActive:a,onClick:()=>l({alignment:t})}}))}))),(0,r.createElement)(n.RichText,c({},g,{tagName:"button",allowedFormats:[],value:a,onChange:e=>l({text:e}),placeholder:(0,o.__)("Enter button text…","mortgage")})))},save:function(e){let{attributes:t}=e;const{text:l,alignment:a,style:o}=t,i=o?.border?.radius,s=(0,n.__experimentalGetBorderClassesAndStyles)(t);"number"==typeof i&&(s.style.borderRadius=`${i}px`);const c=(0,n.__experimentalGetColorClassesAndStyles)(t),u=h()(c.className,a,"mortgage-btn","wp-element-button"),m=n.useBlockProps.save({className:u,style:c.style});return(0,r.createElement)("button",m,l)}})},184:(e,t)=>{var l;!function(){"use strict";var a={}.hasOwnProperty;function r(){for(var e=[],t=0;t<arguments.length;t++){var l=arguments[t];if(l){var o=typeof l;if("string"===o||"number"===o)e.push(l);else if(Array.isArray(l)){if(l.length){var n=r.apply(null,l);n&&e.push(n)}}else if("object"===o){if(l.toString!==Object.prototype.toString&&!l.toString.toString().includes("[native code]")){e.push(l.toString());continue}for(var i in l)a.call(l,i)&&l[i]&&e.push(i)}}}return e.join(" ")}e.exports?(r.default=r,e.exports=r):void 0===(l=function(){return r}.apply(t,[]))||(e.exports=l)}()}},l={};function a(e){var r=l[e];if(void 0!==r)return r.exports;var o=l[e]={exports:{}};return t[e](o,o.exports,a),o.exports}a.m=t,e=[],a.O=(t,l,r,o)=>{if(!l){var n=1/0;for(u=0;u<e.length;u++){for(var[l,r,o]=e[u],i=!0,s=0;s<l.length;s++)(!1&o||n>=o)&&Object.keys(a.O).every((e=>a.O[e](l[s])))?l.splice(s--,1):(i=!1,o<n&&(n=o));if(i){e.splice(u--,1);var c=r();void 0!==c&&(t=c)}}return t}o=o||0;for(var u=e.length;u>0&&e[u-1][2]>o;u--)e[u]=e[u-1];e[u]=[l,r,o]},a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},a.d=(e,t)=>{for(var l in t)a.o(t,l)&&!a.o(e,l)&&Object.defineProperty(e,l,{enumerable:!0,get:t[l]})},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={826:0,431:0};a.O.j=t=>0===e[t];var t=(t,l)=>{var r,o,[n,i,s]=l,c=0;if(n.some((t=>0!==e[t]))){for(r in i)a.o(i,r)&&(a.m[r]=i[r]);if(s)var u=s(a)}for(t&&t(l);c<n.length;c++)o=n[c],a.o(e,o)&&e[o]&&e[o][0](),e[o]=0;return a.O(u)},l=globalThis.webpackChunkmortgage=globalThis.webpackChunkmortgage||[];l.forEach(t.bind(null,0)),l.push=t.bind(null,l.push.bind(l))})();var r=a.O(void 0,[431],(()=>a(735)));r=a.O(r)})();1 (()=>{.O(r)})(); -
mortgage/trunk/build/input/block.json
r2885133 r3106603 53 53 "attribute": "placeholder" 54 54 }, 55 56 57 58 59 60 55 61 "value": { 56 62 "type": "string", … … 96 102 "multiple": true, 97 103 "reusable": false, 104 98 105 "className": true, 99 106 "lock": false 100 } 107 }, 108 "editorScript": "file:./index.js" 101 109 } -
mortgage/trunk/build/result/block.json
r2885133 r3106603 1 1 { 2 2 "$schema": "https://schemas.wp.org/trunk/block.json", 3 "apiVersion": 2,3 "apiVersion": , 4 4 "name": "mortgage/result", 5 "title": "Result", 6 "icon": "button", 5 "ancestor": [ 6 "mortgage/form" 7 ], 8 "title": "Mortgage result", 9 "icon": "info", 7 10 "textdomain": "mortgage", 11 12 13 8 14 "attributes": { 9 15 "lock": { … … 18 24 "default": "Calculate" 19 25 }, 26 27 28 20 29 "style": { 21 30 "type": "object", … … 24 33 "background": "#dff0d8", 25 34 "text": "#3c763d" 26 },27 "border": {28 "style": "solid",29 "width": "1px",30 "color": "green"31 35 } 32 36 } … … 34 38 }, 35 39 "supports": { 36 "multiple": false, 40 "html": false, 41 "lock": false, 37 42 "reusable": false, 38 "className": true,39 "__experimentalBorder": true,40 43 "color": { 41 44 "background": true, … … 43 46 "gradients": true 44 47 }, 45 "lock": false, 48 "__experimentalBorder": { 49 "color": true, 50 "radius": true, 51 "style": true, 52 "width": true, 53 "__experimentalDefaultControls": { 54 "color": true, 55 "radius": true, 56 "style": true, 57 "width": true 58 } 59 }, 46 60 "spacing": { 47 61 "padding": true, … … 50 64 } 51 65 } 52 } 66 }, 67 "editorScript": "file:./index.js", 68 "render": "file:./render.php" 53 69 } -
mortgage/trunk/build/select/block.json
r2885133 r3106603 51 51 }, 52 52 "supports": { 53 "multiple": false,54 53 "reusable": false, 55 54 "className": true, 56 55 "lock": false 57 } 56 }, 57 "editorScript": "file:./index.js" 58 58 } -
mortgage/trunk/build/style-index.css
r2885133 r3106603 1 .wp-block-mortgage-form .wp-block-mortgage-input,.wp-block-mortgage-form .wp-block-mortgage-select{align-items:flex-start;display:flex;flex-direction:column;flex-wrap:wrap;margin-bottom:1em}.wp-block-mortgage-form .wp-block-mortgage-input.hide,.wp-block-mortgage-form .wp-block-mortgage-select.hide,.wp-block-mortgage-form label.hide{display:none}.wp-block-mortgage-form button,.wp-block-mortgage-form input,.wp-block-mortgage-form select{box-sizing:border-box;padding:.5em}.wp-block-mortgage-form input,.wp-block-mortgage-form select{max-width:100%;width:100%}.wp-block-mortgage-form small{width:100%}.wp-block-mortgage-form button{display:block;margin:0}.wp-block-mortgage-form button.left{margin-left:0;margin-right:auto}.wp-block-mortgage-form button.right{margin-left:auto;margin-right:0}.wp-block-mortgage-form button.center{margin:auto}.wp-block-mortgage-form button.wide{width:100%}.wp-block-mortgage-form.is-style-bolded label,.wp-block-mortgage-form.is-style-modern label{font-weight:700}.wp-block-mortgage-form.is-style-modern input,.wp-block-mortgage-form.is-style-modern select{border:none;border-bottom:1px solid;border-radius:0}.wp-block-mortgage-result,.wp-block-mortgage-summary{border:1px solid transparent;margin:1rem 0;order:3;padding:.75rem 1.25rem;width:100%}.wp-block-mortgage-result.success,.wp-block-mortgage-summary.success{background-color:#dff0d8;border-color:#d0e9c6;color:#3c763d}.wp-block-mortgage-result.error,.wp-block-mortgage-summary.error{background-color:#fcf8e3;border-color:#faf2cc;color:#8a6d3b}.wp-block-mortgage-result small,.wp-block-mortgage-summary small{margin:0 5px}.wp-block-mortgage-result p,.wp-block-mortgage-summary p{margin:0}.wp-block-mortgage-table{order:3;overflow-x:auto;width:100%}.wp-block-mortgage-table small{margin:0 5px}.wp-block-mortgage-table table{width:100%!important}.wp-block-mortgage-table table td,.wp-block-mortgage-table th{text-align:center}1 .wp-block-mortgage-form}.wp-block-mortgage-table small{margin:0 5px}.wp-block-mortgage-table table{width:100%!important}.wp-block-mortgage-table table td,.wp-block-mortgage-table th{text-align:center} -
mortgage/trunk/mortgage.php
r3010719 r3106603 3 3 * Plugin Name: Mortgage 4 4 * Description: A simple responsive mortgage calculator block with a clean flat design. 5 * Version: 0. 3.15 * Version: 0. 6 6 * Author: Calcolo Rata Mutuo 7 7 * Author URI: https://www.calcoloratamutuo.net/ … … 13 13 */ 14 14 15 16 17 18 15 19 /** 16 * Registers all block assets so that they can be enqueued through the block editor 17 * in the corresponding context. 20 * Registers the block using the metadata loaded from the `block.json` file. 21 * Behind the scenes, it registers also all assets so they can be enqueued 22 * through the block editor in the corresponding context. 18 23 * 19 * @see https://developer.wordpress.org/ block-editor/tutorials/block-tutorial/applying-styles-with-stylesheets/24 * @see https://developer.wordpress.org// 20 25 */ 21 function mortgage_block_init() { 22 register_block_type_from_metadata( 23 __DIR__, 24 ); 26 function mortgage2_block_init() { 27 register_block_type_from_metadata( __DIR__ . '/build' ); 28 register_block_type_from_metadata( __DIR__ . '/build/input' ); 29 register_block_type_from_metadata( __DIR__ . '/build/select' ); 30 register_block_type_from_metadata( __DIR__ . '/build/button' ); 31 register_block_type_from_metadata( __DIR__ . '/build/result' ); 32 register_block_type_from_metadata( __DIR__ . '/build/table' ); 25 33 } 26 add_action( 'init', 'mortgage _block_init' );34 add_action( 'init', 'mortgage_block_init' ); -
mortgage/trunk/readme.txt
r3010719 r3106603 4 4 Tags: mortgage, calculator, mortgage calculator, mortgage calculator block, block 5 5 Requires at least: 5.6.0 6 Tested up to: 6. 4.27 Stable tag: 0. 3.16 Tested up to: 6. 7 Stable tag: 0. 8 8 Requires PHP: 5.6 9 9 License: GPL-2.0-or-later … … 48 48 49 49 == Changelog == 50 51 52 53 50 54 51 55 = 0.3.1 =
Note: See TracChangeset
for help on using the changeset viewer.