← Back
Editing: blocks.js
(()=>{"use strict";const e=wp.i18n,t=wp.hooks,n=wp.components;function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function r(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=a(e)||!e)return e;var n;if("undefined"!=typeof Symbol&&void 0!==(n=e[Symbol.toPrimitive])){var r=n.call(e,t||"default");if("object"!=a(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==a(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e){return function(e){if(Array.isArray(e))return l(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return l(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=Array(t);n<t;n++)a[n]=e[n];return a}(0,t.addFilter)("rank_math_block_howto_data","rank-math-pro",function(t,a){var r=a.attributes,o=a.setAttributes;return wp.element.createElement(React.Fragment,null,r.hasOwnProperty("estimatedCost")&&wp.element.createElement("div",{className:"rank-math-howto-estimated-cost"},wp.element.createElement(n.TextControl,{label:(0,e.__)("Estimated Cost","rank-math-pro"),className:"rank-math-block-text",value:r.estimatedCostCurrency,placeholder:(0,e.__)("USD","rank-math-pro"),onChange:function(e){o({estimatedCostCurrency:e})},__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),wp.element.createElement(n.TextControl,{type:"number",className:"rank-math-block-text",value:r.estimatedCost,placeholder:(0,e.__)("Estimated Cost","rank-math-pro"),onChange:function(e){o({estimatedCost:e})},__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0})),r.hasOwnProperty("supply")&&wp.element.createElement(n.TextareaControl,{label:(0,e.__)("Supply","rank-math-pro"),className:"rank-math-block-textarea",help:(0,e.__)("Add one supply element per line.","rank-math-pro"),value:r.supply,onChange:function(e){o({supply:e})},__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),r.hasOwnProperty("tools")&&wp.element.createElement(n.TextareaControl,{label:(0,e.__)("Tools","rank-math-pro"),className:"rank-math-block-textarea",help:(0,e.__)("Add one tool per line.","rank-math-pro"),value:r.tools,onChange:function(e){o({tools:e})},__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),r.hasOwnProperty("material")&&wp.element.createElement(n.TextareaControl,{label:(0,e.__)("Material","rank-math-pro"),className:"rank-math-block-textarea",value:r.material,onChange:function(e){o({material:e})},__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}))});var m=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"questions";return function(){var a=t.setAttributes,l=t.index,m=o(t[n]);1===e&&l<m.length-1&&(m[l]=t[n][l+e],m[l+e]=t[n][l],a(r({},n,m))),-1===e&&l>0&&(m[l]=t[n][l+e],m[l+e]=t[n][l],a(r({},n,m)))}};(0,t.addFilter)("rank_math_block_faq_actions","rank-math-pro",function(t,a){var r=a.questions,o=a.index;if(!(r.length<2))return wp.element.createElement(React.Fragment,null,wp.element.createElement(n.Button,{icon:"arrow-up",className:0===o?"rank-math-item-move move-up rank-math-item-disabled":"rank-math-item-move move-up",title:(0,e.__)("Move up","rank-math-pro"),onClick:m(-1,a)}),wp.element.createElement(n.Button,{icon:"arrow-down",className:o===r.length-1?"rank-math-item-move move-down rank-math-item-disabled ":"rank-math-item-move move-down",onClick:m(1,a),title:(0,e.__)("Move down","rank-math-pro")}))}),(0,t.addFilter)("rank_math_block_howto_actions","rank-math-pro",function(t,a){var r=a.steps,o=a.index;if(!(r.length<2))return wp.element.createElement(React.Fragment,null,wp.element.createElement(n.Button,{icon:"arrow-up",className:0===o?"rank-math-item-move move-up rank-math-item-disabled":"rank-math-item-move move-up",title:(0,e.__)("Move up","rank-math-pro"),onClick:m(-1,a,"steps")}),wp.element.createElement(n.Button,{icon:"arrow-down",className:o===r.length-1?"rank-math-item-move move-down rank-math-item-disabled ":"rank-math-item-move move-down",onClick:m(1,a,"steps"),title:(0,e.__)("Move down","rank-math-pro")}))})})();
Save File
Cancel