Plugin Directory

Changeset 3032475

Timestamp:
02/07/2024 02:36:08 AM (6 months ago)
Author:
inc2734
Message:

Version up. v6.3.0

Location:
snow-monkey-forms/trunk
Files:
39 edited

Legend:

Unmodified
Added
Removed
  • snow-monkey-forms/trunk/App/Contract/Control.php

    r2928041 r3032475  
    9393     */
    9494    abstract public function invalid( $message = '' );
    95 
    96     /**
    97      * Filtering attributes.
    98      */
    99     public function filtering_attributes() {
    100         $this->set_property(
    101             'attributes',
    102             apply_filters( 'snow_monkey_forms/control/attributes', $this->get_property( 'attributes' ) )
    103         );
    104     }
    10595
    10696    /**
  • snow-monkey-forms/trunk/App/Control/Checkboxes.php

    r3022129 r3032475  
    9393
    9494        $children = array();
    95         foreach ( $this->get_property( 'options' ) as $option ) {
    96             $value = array_keys( $option )[0];
    97             $label = array_values( $option )[0];
    98 
     95        foreach ( $this->get_property( 'options' ) as $value => $label ) {
    9996            $children[] = Helper::control(
    10097                'checkbox',
     
    104101                        'value'        => $value,
    105102                        'disabled'     => $this->get_property( 'disabled' ),
    106                         'checked'      => (string) $this->get_property( 'value' ) === (string) $value,
     103                        'checked'      => ,
    107104                        'data-invalid' => $this->get_attribute( 'data-invalid' ),
    108105                    ),
  • snow-monkey-forms/trunk/App/Control/RadioButtons.php

    r3022129 r3032475  
    9595    protected function _init() {
    9696        $children = array();
    97         foreach ( $this->get_property( 'options' ) as $option ) {
    98             $value = array_keys( $option )[0];
    99             $label = array_values( $option )[0];
    100 
     97        foreach ( $this->get_property( 'options' ) as $value => $label ) {
    10198            $children[] = Helper::control(
    10299                'radio-button',
  • snow-monkey-forms/trunk/App/Control/Select.php

    r2928041 r3032475  
    6666    protected function _init() {
    6767        $children = array();
    68         foreach ( $this->get_property( 'options' ) as $option ) {
    69             $value = array_keys( $option )[0];
    70             $label = array_values( $option )[0];
    71 
     68        foreach ( $this->get_property( 'options' ) as $value => $label ) {
    7269            $children[] = Helper::control(
    7370                'option',
  • snow-monkey-forms/trunk/App/Controller/Back.php

    r2938545 r3032475  
    2525        foreach ( $setting_controls as $name => $control ) {
    2626            $value = $this->responser->get( $name );
    27             $control->filtering_attributes();
    2827            $control->save( $value );
    2928            $controls[ $name ] = $control->input();
  • snow-monkey-forms/trunk/App/Controller/Confirm.php

    r2938545 r3032475  
    2525        foreach ( $setting_controls as $name => $control ) {
    2626            $value = $this->responser->get( $name );
    27             $control->filtering_attributes();
    2827            $control->save( $value );
    2928            $controls[ $name ] = $control->confirm();
  • snow-monkey-forms/trunk/App/Controller/Input.php

    r2445354 r3032475  
    2020     */
    2121    protected function set_controls() {
    22         return $this->controls;
     22        $controls         = array();
     23        $setting_controls = $this->setting->get( 'controls' );
     24
     25        foreach ( $setting_controls as $name => $control ) {
     26            $controls[ $name ] = $control->input();
     27        }
     28
     29        return $controls;
    2330    }
    2431
  • snow-monkey-forms/trunk/App/Controller/Invalid.php

    r2938545 r3032475  
    2525        foreach ( $setting_controls as $name => $control ) {
    2626            $value = $this->responser->get( $name );
    27             $control->filtering_attributes();
    2827            $control->save( $value );
    2928            $error_messages    = $this->validator->get_error_messages( $name );
  • snow-monkey-forms/trunk/App/Helper.php

    r2909241 r3032475  
    5858    public static function the_control( $type, $properties ) {
    5959        $control = static::control( $type, $properties );
    60         $control->filtering_attributes();
    6160        echo $control->input(); // xss ok.
    6261    }
     
    8786                    $decoded                    = is_array( $decoded ) ? $decoded : array( $value => $value );
    8887                    $decoded                    = is_array( $decoded ) && ! $decoded ? array( '' => '' ) : $decoded;
    89                     $options[ key( $decoded ) ] = $decoded;
     88                    $options[ key( $decoded ) ] = ;
    9089                }
    9190            }
  • snow-monkey-forms/trunk/App/Model/Setting.php

    r2939666 r3032475  
    298298                $type       = $matches[1];
    299299                $attributes = json_decode( $matches[2], true );
    300                 $name       = ! empty( $attributes['name'] ) ? $attributes['name'] : null;
    301                 $control    = Helper::control( $type, Helper::block_meta_normalization( $attributes ) );
     300                $attributes = apply_filters( 'snow_monkey_forms/control/attributes', Helper::block_meta_normalization( $attributes ), $this );
     301
     302                if ( isset( $attributes['options'] ) && isset( $attributes['name'] ) ) {
     303                    $hook_name = false;
     304
     305                    if ( 'checkboxes' === $type ) {
     306                        $hook_name = 'snow_monkey_forms/checkboxes/options';
     307                    } elseif ( 'select' === $type ) {
     308                        $hook_name = 'snow_monkey_forms/select/options';
     309                    } elseif ( 'radio-buttons' === $type ) {
     310                        $hook_name = 'snow_monkey_forms/radio_buttons/options';
     311                    }
     312
     313                    if ( $hook_name ) {
     314                        $attributes['options'] = apply_filters(
     315                            $hook_name,
     316                            $attributes['options'],
     317                            $attributes['name'],
     318                            $this
     319                        );
     320                    }
     321                }
     322
     323                $name    = ! empty( $attributes['name'] ) ? $attributes['name'] : null;
     324                $control = Helper::control( $type, $attributes );
    302325
    303326                if ( $control && $name ) {
  • snow-monkey-forms/trunk/dist/blocks/checkboxes/index.asset.php

    r3022129 r3032475  
    1 <?php return array('dependencies' => array('lodash', 'react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-element', 'wp-i18n'), 'version' => 'e82508bcc07917f8f569');
     1<?php return array('dependencies' => array('lodash', 'react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-element', 'wp-i18n'), 'version' => '');
  • snow-monkey-forms/trunk/dist/blocks/checkboxes/index.js

    r3022129 r3032475  
    33(0,m.__)("Optional. Initial value. Enter in the following format: value%1$s","snow-monkey-forms"),"↵"),value:e,onChange:n}),p=({value:e,onChange:n})=>{const t={};return""===e&&(t.borderColor="#d94f4f"),(0,o.createElement)(s.TextareaControl,{label:(0,m.__)("options","snow-monkey-forms"),value:e,help:(0,m.sprintf)(
    44// translators: %1$s: line-break-char
    5 (0,m.__)('Required. Enter in the following format: "value" : "label"%1$s or value%1$s',"snow-monkey-forms"),"↵"),onChange:n,required:!0,style:t})},f=window.lodash;function h(e){const n=e.replace(/\r?\n/g,"\n").split("\n");return(0,f.uniqBy)(n.map((e=>{const n=(()=>{try{return JSON.parse(`{ ${e} }`)}catch(n){return{[e]:e}}})();return{value:Object.keys(n)[0],label:Object.values(n)[0]}})),"value").map((e=>{const n={};return n[e.value]=e.label,n}))}const g=(0,c.createHigherOrderComponent)((e=>n=>{const{attributes:t,setAttributes:r}=n,{validations:l}=t;if(void 0===l)return(0,o.createElement)(e,{...n});const c=JSON.parse(l);return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(a.InspectorControls,null,(0,o.createElement)(s.PanelBody,{title:(0,m.__)("Validation","snow-monkey-forms")},(0,o.createElement)(s.ToggleControl,{label:(0,m.__)("Required","snow-monkey-forms"),checked:!!c.required,onChange:e=>{r({validations:JSON.stringify((0,f.merge)(c,{required:e}))})}}))),(0,o.createElement)(e,{...n}))}),"withValidations"),v=(0,c.compose)(g)((({attributes:e,setAttributes:n})=>{const{name:t,grouping:r,legend:c,legendInvisible:f,options:g,values:v,delimiter:b,direction:w,description:y,isDisplayDescriptionConfirm:_}=e;(0,i.useEffect)((()=>{""===t&&n({name:`checkboxes-${((new Date).getTime()+Math.floor(8999*Math.random()+1e3)).toString(32)}`}),""===g&&n({options:'value1\n"value2" : "label2"\n"value3" : "label3"'})}));const k=h(g),E=h(v).map((e=>Object.keys(e)[0])),C=l()("smf-checkboxes-control",{[`smf-checkboxes-control--${w}`]:!!w}),x=(0,a.useBlockProps)({className:"smf-placeholder"}),O=()=>(0,o.createElement)("div",{className:"smf-checkboxes-control__control"},k.map((e=>{const n=Object.keys(e)[0],r=Object.values(e)[0];return(0,o.createElement)("div",{className:"smf-label",key:n},(0,o.createElement)("label",{htmlFor:`${t}-${n}`},(0,o.createElement)("span",{className:"smf-checkbox-control"},(0,o.createElement)("input",{type:"checkbox",name:`${t}[]`,value:n,checked:E.includes(n),disabled:"disabled",className:"smf-checkbox-control__control",id:`${t}-${n}`}),(0,o.createElement)("span",{className:"smf-checkbox-control__label"},r))))})));return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(a.InspectorControls,null,(0,o.createElement)(s.PanelBody,{title:(0,m.__)("Attributes","snow-monkey-forms")},(0,o.createElement)(u,{value:t,onChange:e=>n({name:e})}),(0,o.createElement)(s.ToggleControl,{label:(0,m.__)("Grouping","snow-monkey-forms"),help:(0,m.__)("Enable if you want to group by fieldset and label by legend.","snow-monkey-forms"),checked:r,onChange:e=>{n({grouping:e})}}),r&&(0,o.createElement)(s.ToggleControl,{label:(0,m.__)("Make legend invisible","snow-monkey-forms"),help:(0,m.__)("When activated, the legend will not appear on the screen, but will be read by screen readers.","snow-monkey-forms"),checked:f,onChange:e=>{n({legendInvisible:e})}}),(0,o.createElement)(p,{value:g,onChange:e=>n({options:e})}),(0,o.createElement)(d,{value:v,onChange:e=>n({values:e})}),(0,o.createElement)(s.TextControl,{label:(0,m.__)("Delimiter","snow-monkey-forms"),help:(0,m.__)("Optional. Character that separates each item.","snow-monkey-forms"),value:b,onChange:e=>n({delimiter:e})})),(0,o.createElement)(s.PanelBody,{title:(0,m.__)("Block settings","snow-monkey-forms")},(0,o.createElement)(s.SelectControl,{label:(0,m.__)("Direction","snow-monkey-forms"),value:w,options:[{value:"",label:(0,m.__)("Default","snow-monkey-forms")},{value:"horizontal",label:(0,m.__)("Horizontal","snow-monkey-forms")},{value:"vertical",label:(0,m.__)("Vertical","snow-monkey-forms")}],onChange:e=>n({direction:e})}),(0,o.createElement)(s.TextControl,{label:(0,m.__)("Description","snow-monkey-forms"),value:y,onChange:e=>n({description:e})}),(0,o.createElement)(s.ToggleControl,{label:(0,m.__)("Description is also displayed on the confirmation screen","snow-monkey-forms"),checked:_,onChange:e=>{n({isDisplayDescriptionConfirm:e})}}))),(0,o.createElement)("div",{...x,"data-name":t},(0,o.createElement)("div",{className:C},r?(0,o.createElement)("fieldset",{className:"smf-control-fieldset"},(0,o.createElement)(a.RichText,{tagName:"legend",value:c,onChange:e=>n({legend:e}),placeholder:(0,m.__)("Label","snow-monkey-forms"),className:l()("smf-control-legend",{"screen-reader-text":f})}),(0,o.createElement)(O,null)):(0,o.createElement)(O,null)),y&&(0,o.createElement)("div",{className:"smf-control-description"},y)))}));(0,e.registerBlockType)(n.u2,{icon:{src:function(){return(0,o.createElement)("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",style:{color:"#cd162c"}},(0,o.createElement)("rect",{fill:"none",x:"3.75",y:"3.75",width:"16.5",height:"16.5",rx:"1.53571",stroke:"currentColor",strokeWidth:"1.5"}),(0,o.createElement)("path",{fill:"none",d:"M16.6232 7.99994L10.6895 15.9801L7.24875 13.4218",stroke:"currentColor",strokeWidth:"1.5"}))}},edit:v,save:()=>null})})()})();
     5(0,m.__)('Required. Enter in the following format: "value" : "label"%1$s or value%1$s',"snow-monkey-forms"),"↵"),onChange:n,required:!0,style:t})},f=window.lodash;function h(e){const n=e.replace(/\r?\n/g,"\n").split("\n");return(0,f.uniqBy)(n.map((e=>{const n=(()=>{try{return JSON.parse(`{ ${e} }`)}catch(n){return{[e]:e}}})();return{value:Object.keys(n)[0],label:Object.values(n)[0]}})),"value").map((e=>{,save:()=>null})})()})();
  • snow-monkey-forms/trunk/dist/blocks/checkboxes/render.php

    r2809253 r3032475  
    55 * @license GPL-2.0+
    66 */
    7 
    8 use Snow_Monkey\Plugin\Forms\App\Helper;
    97?>
    108
    11 <div class="smf-placeholder" data-name="<?php echo esc_attr( $attributes['name'] ); ?>">
    12     <?php Helper::the_control( 'checkboxes', Helper::block_meta_normalization( $attributes ) ); ?>
    13 </div>
     9<div class="smf-placeholder" data-name="<?php echo esc_attr( $attributes['name'] ); ?>"></div>
  • snow-monkey-forms/trunk/dist/blocks/email/render.php

    r2809253 r3032475  
    99?>
    1010
    11 <div class="smf-placeholder" data-name="<?php echo esc_attr( $attributes['name'] ); ?>">
    12     <?php Helper::the_control( 'email', Helper::block_meta_normalization( $attributes ) ); ?>
    13 </div>
     11<div class="smf-placeholder" data-name="<?php echo esc_attr( $attributes['name'] ); ?>"></div>
  • snow-monkey-forms/trunk/dist/blocks/file/render.php

    r2809253 r3032475  
    99?>
    1010
    11 <div class="smf-placeholder" data-name="<?php echo esc_attr( $attributes['name'] ); ?>">
    12     <?php Helper::the_control( 'file', Helper::block_meta_normalization( $attributes ) ); ?>
    13 </div>
     11<div class="smf-placeholder" data-name="<?php echo esc_attr( $attributes['name'] ); ?>"></div>
  • snow-monkey-forms/trunk/dist/blocks/radio-buttons/index.asset.php

    r3022129 r3032475  
    1 <?php return array('dependencies' => array('lodash', 'react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-element', 'wp-i18n'), 'version' => '3ac557dae7b7c0975aa7');
     1<?php return array('dependencies' => array('lodash', 'react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-element', 'wp-i18n'), 'version' => '');
  • snow-monkey-forms/trunk/dist/blocks/radio-buttons/index.js

    r3022129 r3032475  
    11(()=>{var e={184:(e,n)=>{var t;!function(){"use strict";var o={}.hasOwnProperty;function r(){for(var e=[],n=0;n<arguments.length;n++){var t=arguments[n];if(t){var l=typeof t;if("string"===l||"number"===l)e.push(t);else if(Array.isArray(t)){if(t.length){var a=r.apply(null,t);a&&e.push(a)}}else if("object"===l){if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes("[native code]")){e.push(t.toString());continue}for(var s in t)o.call(t,s)&&t[s]&&e.push(s)}}}return e.join(" ")}e.exports?(r.default=r,e.exports=r):void 0===(t=function(){return r}.apply(n,[]))||(e.exports=t)}()}},n={};function t(o){var r=n[o];if(void 0!==r)return r.exports;var l=n[o]={exports:{}};return e[o](l,l.exports,t),l.exports}t.n=e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return t.d(n,{a:n}),n},t.d=(e,n)=>{for(var o in n)t.o(n,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:n[o]})},t.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n),(()=>{"use strict";const e=window.wp.blocks,n=JSON.parse('{"u2":"snow-monkey-forms/control-radio-buttons"}'),o=window.React;var r=t(184),l=t.n(r);const a=window.wp.blockEditor,s=window.wp.components,i=window.wp.compose,c=window.wp.element,m=window.wp.i18n,u=({value:e,onChange:n})=>{const t={};return""===e&&(t.borderColor="#d94f4f"),(0,o.createElement)(s.TextControl,{label:(0,m.__)("name","snow-monkey-forms"),help:(0,m.__)("Required. Input a unique machine-readable name.","snow-monkey-forms"),value:e,onChange:n,required:!0,style:t})},d=({value:e,onChange:n,multiple:t=!1})=>{const r=t?s.TextareaControl:s.TextControl;return(0,o.createElement)(r,{label:(0,m.__)("value","snow-monkey-forms"),help:(0,m.__)("Optional. Initial value.","snow-monkey-forms"),value:e,onChange:n})},p=({value:e,onChange:n})=>{const t={};return""===e&&(t.borderColor="#d94f4f"),(0,o.createElement)(s.TextareaControl,{label:(0,m.__)("options","snow-monkey-forms"),value:e,help:(0,m.sprintf)(
    22// translators: %1$s: line-break-char
    3 (0,m.__)('Required. Enter in the following format: "value" : "label"%1$s or value%1$s',"snow-monkey-forms"),"↵"),onChange:n,required:!0,style:t})},f=window.lodash;const g=(0,i.createHigherOrderComponent)((e=>n=>{const{attributes:t,setAttributes:r}=n,{validations:l}=t;if(void 0===l)return(0,o.createElement)(e,{...n});const i=JSON.parse(l);return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(a.InspectorControls,null,(0,o.createElement)(s.PanelBody,{title:(0,m.__)("Validation","snow-monkey-forms")},(0,o.createElement)(s.ToggleControl,{label:(0,m.__)("Required","snow-monkey-forms"),checked:!!i.required,onChange:e=>{r({validations:JSON.stringify((0,f.merge)(i,{required:e}))})}}))),(0,o.createElement)(e,{...n}))}),"withValidations"),v=(0,i.compose)(g)((({attributes:e,setAttributes:n})=>{const{name:t,grouping:r,legend:i,legendInvisible:g,value:v,options:b,direction:w,description:y,isDisplayDescriptionConfirm:h}=e;(0,c.useEffect)((()=>{""===t&&n({name:`radio-buttons-${((new Date).getTime()+Math.floor(8999*Math.random()+1e3)).toString(32)}`}),""===b&&n({options:'value1\n"value2" : "label2"\n"value3" : "label3"'})}));const _=function(e){const n=e.replace(/\r?\n/g,"\n").split("\n");return(0,f.uniqBy)(n.map((e=>{const n=(()=>{try{return JSON.parse(`{ ${e} }`)}catch(n){return{[e]:e}}})();return{value:Object.keys(n)[0],label:Object.values(n)[0]}})),"value").map((e=>{const n={};return n[e.value]=e.label,n}))}(b),E=l()("smf-radio-buttons-control",{[`smf-radio-buttons-control--${w}`]:!!w}),k=(0,a.useBlockProps)({className:"smf-placeholder"}),C=()=>(0,o.createElement)("div",{className:"smf-radio-buttons-control__control"},_.map((e=>{const n=Object.keys(e)[0],r=Object.values(e)[0];return(0,o.createElement)("div",{className:"smf-label",key:n},(0,o.createElement)("label",{htmlFor:`${t}-${n}`},(0,o.createElement)("span",{className:"smf-radio-button-control"},(0,o.createElement)("input",{type:"radio",name:t,value:n,checked:n===v,disabled:"disabled",className:"smf-radio-button-control__control",id:`${t}-${n}`}),(0,o.createElement)("span",{className:"smf-radio-button-control__label"},r))))})));return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(a.InspectorControls,null,(0,o.createElement)(s.PanelBody,{title:(0,m.__)("Attributes","snow-monkey-forms")},(0,o.createElement)(u,{value:t,onChange:e=>n({name:e})}),(0,o.createElement)(s.ToggleControl,{label:(0,m.__)("Grouping","snow-monkey-forms"),help:(0,m.__)("Enable if you want to group by fieldset and label by legend.","snow-monkey-forms"),checked:r,onChange:e=>{n({grouping:e})}}),r&&(0,o.createElement)(s.ToggleControl,{label:(0,m.__)("Make legend invisible","snow-monkey-forms"),help:(0,m.__)("When activated, the legend will not appear on the screen, but will be read by screen readers.","snow-monkey-forms"),checked:g,onChange:e=>{n({legendInvisible:e})}}),(0,o.createElement)(p,{value:b,onChange:e=>n({options:e})}),(0,o.createElement)(d,{value:v,onChange:e=>n({value:e})})),(0,o.createElement)(s.PanelBody,{title:(0,m.__)("Block settings","snow-monkey-forms")},(0,o.createElement)(s.SelectControl,{label:(0,m.__)("Direction","snow-monkey-forms"),value:w,options:[{value:"",label:(0,m.__)("Default","snow-monkey-forms")},{value:"horizontal",label:(0,m.__)("Horizontal","snow-monkey-forms")},{value:"vertical",label:(0,m.__)("Vertical","snow-monkey-forms")}],onChange:e=>n({direction:e})}),(0,o.createElement)(s.TextControl,{label:(0,m.__)("Description","snow-monkey-forms"),value:y,onChange:e=>n({description:e})}),(0,o.createElement)(s.ToggleControl,{label:(0,m.__)("Description is also displayed on the confirmation screen","snow-monkey-forms"),checked:h,onChange:e=>{n({isDisplayDescriptionConfirm:e})}}))),(0,o.createElement)("div",{...k,"data-name":t},(0,o.createElement)("div",{className:E},r?(0,o.createElement)("fieldset",{className:"smf-control-fieldset"},(0,o.createElement)(a.RichText,{tagName:"legend",value:i,onChange:e=>n({legend:e}),placeholder:(0,m.__)("Label","snow-monkey-forms"),className:l()("smf-control-legend",{"screen-reader-text":g})}),(0,o.createElement)(C,null)):(0,o.createElement)(C,null)),y&&(0,o.createElement)("div",{className:"smf-control-description"},y)))}));(0,e.registerBlockType)(n.u2,{icon:{src:function(){return(0,o.createElement)("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{color:"#cd162c"}},(0,o.createElement)("circle",{cx:"12",cy:"12",r:"3",fill:"currentColor"}),(0,o.createElement)("circle",{cx:"12",cy:"12",r:"8",fill:"none",stroke:"currentColor",strokeWidth:"1.5"}))}},edit:v,save:()=>null})})()})();
     3(0,m.__)('Required. Enter in the following format: "value" : "label"%1$s or value%1$s',"snow-monkey-forms"),"↵"),onChange:n,required:!0,style:t})},f=window.lodash;const ,save:()=>null})})()})();
  • snow-monkey-forms/trunk/dist/blocks/radio-buttons/render.php

    r2809253 r3032475  
    55 * @license GPL-2.0+
    66 */
    7 
    8 use Snow_Monkey\Plugin\Forms\App\Helper;
    97?>
    108
    11 <div class="smf-placeholder" data-name="<?php echo esc_attr( $attributes['name'] ); ?>">
    12     <?php Helper::the_control( 'radio-buttons', Helper::block_meta_normalization( $attributes ) ); ?>
    13 </div>
     9<div class="smf-placeholder" data-name="<?php echo esc_attr( $attributes['name'] ); ?>"></div>
  • snow-monkey-forms/trunk/dist/blocks/select/index.asset.php

    r2991425 r3032475  
    1 <?php return array('dependencies' => array('lodash', 'react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-element', 'wp-i18n'), 'version' => '1906d9d22ce3a178e0e6');
     1<?php return array('dependencies' => array('lodash', 'react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-element', 'wp-i18n'), 'version' => '');
  • snow-monkey-forms/trunk/dist/blocks/select/index.js

    r2991425 r3032475  
    11(()=>{"use strict";const e=window.wp.blocks,n=JSON.parse('{"u2":"snow-monkey-forms/control-select"}'),t=window.React,o=window.wp.blockEditor,a=window.wp.components,l=window.wp.compose,r=window.wp.element,s=window.wp.i18n,c=({value:e,onChange:n})=>{const o={};return""===e&&(o.borderColor="#d94f4f"),(0,t.createElement)(a.TextControl,{label:(0,s.__)("name","snow-monkey-forms"),help:(0,s.__)("Required. Input a unique machine-readable name.","snow-monkey-forms"),value:e,onChange:n,required:!0,style:o})},i=({value:e,onChange:n,multiple:o=!1})=>{const l=o?a.TextareaControl:a.TextControl;return(0,t.createElement)(l,{label:(0,s.__)("value","snow-monkey-forms"),help:(0,s.__)("Optional. Initial value.","snow-monkey-forms"),value:e,onChange:n})},m=({value:e,onChange:n,options:o=[]})=>{const l=1>o.length?["","name","honorific-prefix","given-name","additional-name","family-name","honorific-suffix","nickname","email","username","new-password","current-password","one-time-code","organization-title","organization","street-address","address-line1","address-line2","address-line3","address-level4","address-level3","address-level2","address-level1","country","country-name","postal-code","cc-name","cc-given-name","cc-additional-name","cc-family-name","cc-number","cc-exp","cc-exp-month","cc-exp-year","cc-csc","cc-type","transaction-currency","transaction-amount","language","bday","bday-day","bday-month","bday-year","sex","tel","tel-country-code","tel-national","tel-area-code","tel-local","tel-extension","impp","url","photo"].map((e=>({value:e,label:e}))):o;return(0,t.createElement)(a.SelectControl,{label:(0,s.__)("autocomplete","snow-monkey-forms"),value:e,options:l,onChange:n})},u=({value:e,onChange:n})=>(0,t.createElement)(a.TextControl,{label:(0,s.__)("id","snow-monkey-forms"),value:e,onChange:n}),d=({value:e,onChange:n})=>(0,t.createElement)(a.TextControl,{label:(0,s.__)("class","snow-monkey-forms"),help:(0,s.__)("Separate multiple classes with spaces.","snow-monkey-forms"),value:e,onChange:n}),p=({value:e,onChange:n})=>{const o={};return""===e&&(o.borderColor="#d94f4f"),(0,t.createElement)(a.TextareaControl,{label:(0,s.__)("options","snow-monkey-forms"),value:e,help:(0,s.sprintf)(
    22// translators: %1$s: line-break-char
    3 (0,s.__)('Required. Enter in the following format: "value" : "label"%1$s or value%1$s',"snow-monkey-forms"),"↵"),onChange:n,required:!0,style:o})},v=window.lodash;const w=(0,l.createHigherOrderComponent)((e=>n=>{const{attributes:l,setAttributes:r}=n,{validations:c}=l;if(void 0===c)return(0,t.createElement)(e,{...n});const i=JSON.parse(c);return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(o.InspectorControls,null,(0,t.createElement)(a.PanelBody,{title:(0,s.__)("Validation","snow-monkey-forms")},(0,t.createElement)(a.ToggleControl,{label:(0,s.__)("Required","snow-monkey-forms"),checked:!!i.required,onChange:e=>{r({validations:JSON.stringify((0,v.merge)(i,{required:e}))})}}))),(0,t.createElement)(e,{...n}))}),"withValidations"),f=(0,l.compose)(w)((({attributes:e,setAttributes:n})=>{const{name:l,value:w,options:f,id:h,controlClass:g,description:y,isDisplayDescriptionConfirm:C,autocomplete:b}=e;(0,r.useEffect)((()=>{""===l&&n({name:`select-${((new Date).getTime()+Math.floor(8999*Math.random()+1e3)).toString(32)}`}),""===f&&n({options:'value1\n"value2" : "label2"\n"value3" : "label3"'})}));const E=function(e){const n=e.replace(/\r?\n/g,"\n").split("\n");return(0,v.uniqBy)(n.map((e=>{const n=(()=>{try{return JSON.parse(`{ ${e} }`)}catch(n){return{[e]:e}}})();return{value:Object.keys(n)[0],label:Object.values(n)[0]}})),"value").map((e=>{const n={};return n[e.value]=e.label,n}))}(f),_=(0,o.useBlockProps)({className:"smf-placeholder"});return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(o.InspectorControls,null,(0,t.createElement)(a.PanelBody,{title:(0,s.__)("Attributes","snow-monkey-forms")},(0,t.createElement)(c,{value:l,onChange:e=>n({name:e})}),(0,t.createElement)(p,{value:f,onChange:e=>n({options:e})}),(0,t.createElement)(i,{value:w,onChange:e=>n({value:e})}),(0,t.createElement)(m,{value:b,onChange:e=>n({autocomplete:e})}),(0,t.createElement)(u,{value:h,onChange:e=>n({id:e})}),(0,t.createElement)(d,{value:g,onChange:e=>n({controlClass:e})})),(0,t.createElement)(a.PanelBody,{title:(0,s.__)("Block settings","snow-monkey-forms")},(0,t.createElement)(a.TextControl,{label:(0,s.__)("Description","snow-monkey-forms"),value:y,onChange:e=>n({description:e})}),(0,t.createElement)(a.ToggleControl,{label:(0,s.__)("Description is also displayed on the confirmation screen","snow-monkey-forms"),checked:C,onChange:e=>{n({isDisplayDescriptionConfirm:e})}}))),(0,t.createElement)("div",{..._,"data-name":l},(0,t.createElement)("div",{className:"smf-select-control"},(0,t.createElement)("select",{name:l,value:w,disabled:"disabled",id:h||void 0,className:`smf-select-control__control ${g}`},E.map((e=>{const n=Object.keys(e)[0],o=Object.values(e)[0];return(0,t.createElement)("option",{value:n,key:n},o)}))),(0,t.createElement)("span",{className:"smf-select-control__toggle"})),y&&(0,t.createElement)("div",{className:"smf-control-description"},y)))}));(0,e.registerBlockType)(n.u2,{icon:{src:function(){return(0,t.createElement)("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{color:"#cd162c"}},(0,t.createElement)("path",{d:"M7.5 8.5L12 4.5L16.5 8.5",fill:"none",stroke:"currentColor",strokeWidth:"1.5"}),(0,t.createElement)("path",{d:"M16.5 15.5L12 19.5L7.5 15.5",fill:"none",stroke:"currentColor",strokeWidth:"1.5"}))}},edit:f,save:()=>null})})();
     3(0,s.__)('Required. Enter in the following format: "value" : "label"%1$s or value%1$s',"snow-monkey-forms"),"↵"),onChange:n,required:!0,style:o})},v=window.lodash;const w=(0,l.createHigherOrderComponent)((e=>n=>{const{attributes:l,setAttributes:r}=n,{validations:c}=l;if(void 0===c)return(0,t.createElement)(e,{...n});const i=JSON.parse(c);return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(o.InspectorControls,null,(0,t.createElement)(a.PanelBody,{title:(0,s.__)("Validation","snow-monkey-forms")},(0,t.createElement)(a.ToggleControl,{label:(0,s.__)("Required","snow-monkey-forms"),checked:!!i.required,onChange:e=>{r({validations:JSON.stringify((0,v.merge)(i,{required:e}))})}}))),(0,t.createElement)(e,{...n}))}),"withValidations"),f=(0,l.compose)(w)((({attributes:e,setAttributes:n})=>{const{name:l,value:w,options:f,id:h,controlClass:g,description:y,isDisplayDescriptionConfirm:C,autocomplete:b}=e;(0,r.useEffect)((()=>{""===l&&n({name:`select-${((new Date).getTime()+Math.floor(8999*Math.random()+1e3)).toString(32)}`}),""===f&&n({options:'value1\n"value2" : "label2"\n"value3" : "label3"'})}));const E=function(e){const n=e.replace(/\r?\n/g,"\n").split("\n");return(0,v.uniqBy)(n.map((e=>{const n=(()=>{try{return JSON.parse(`{ ${e} }`)}catch(n){return{[e]:e}}})();return{value:Object.keys(n)[0],label:Object.values(n)[0]}})),"value").map((e=>{}))}(f),_=(0,o.useBlockProps)({className:"smf-placeholder"});return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(o.InspectorControls,null,(0,t.createElement)(a.PanelBody,{title:(0,s.__)("Attributes","snow-monkey-forms")},(0,t.createElement)(c,{value:l,onChange:e=>n({name:e})}),(0,t.createElement)(p,{value:f,onChange:e=>n({options:e})}),(0,t.createElement)(i,{value:w,onChange:e=>n({value:e})}),(0,t.createElement)(m,{value:b,onChange:e=>n({autocomplete:e})}),(0,t.createElement)(u,{value:h,onChange:e=>n({id:e})}),(0,t.createElement)(d,{value:g,onChange:e=>n({controlClass:e})})),(0,t.createElement)(a.PanelBody,{title:(0,s.__)("Block settings","snow-monkey-forms")},(0,t.createElement)(a.TextControl,{label:(0,s.__)("Description","snow-monkey-forms"),value:y,onChange:e=>n({description:e})}),(0,t.createElement)(a.ToggleControl,{label:(0,s.__)("Description is also displayed on the confirmation screen","snow-monkey-forms"),checked:C,onChange:e=>{n({isDisplayDescriptionConfirm:e})}}))),(0,t.createElement)("div",{..._,"data-name":l},(0,t.createElement)("div",{className:"smf-select-control"},(0,t.createElement)("select",{name:l,value:w,disabled:"disabled",id:h||void 0,className:`smf-select-control__control ${g}`},E.map((e=>{const n=Object.keys(e)[0],o=Object.values(e)[0];return(0,t.createElement)("option",{value:n,key:n},o)}))),(0,t.createElement)("span",{className:"smf-select-control__toggle"})),y&&(0,t.createElement)("div",{className:"smf-control-description"},y)))}));(0,e.registerBlockType)(n.u2,{icon:{src:function(){return(0,t.createElement)("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{color:"#cd162c"}},(0,t.createElement)("path",{d:"M7.5 8.5L12 4.5L16.5 8.5",fill:"none",stroke:"currentColor",strokeWidth:"1.5"}),(0,t.createElement)("path",{d:"M16.5 15.5L12 19.5L7.5 15.5",fill:"none",stroke:"currentColor",strokeWidth:"1.5"}))}},edit:f,save:()=>null})})();
  • snow-monkey-forms/trunk/dist/blocks/select/render.php

    r2809253 r3032475  
    55 * @license GPL-2.0+
    66 */
    7 
    8 use Snow_Monkey\Plugin\Forms\App\Helper;
    97?>
    108
    11 <div class="smf-placeholder" data-name="<?php echo esc_attr( $attributes['name'] ); ?>">
    12     <?php Helper::the_control( 'select', Helper::block_meta_normalization( $attributes ) ); ?>
    13 </div>
     9<div class="smf-placeholder" data-name="<?php echo esc_attr( $attributes['name'] ); ?>"></div>
  • snow-monkey-forms/trunk/dist/blocks/snow-monkey-form/render.php

    r2938545 r3032475  
    3434$response = json_decode( $controller->send() );
    3535// phpcs:enable
     36
     37
     38
     39
     40
     41
     42
     43
     44
    3645?>
    3746
     
    7685    <?php endif; ?>
    7786
    78     <?php echo apply_filters( 'the_content', $setting->get( 'input_content' ) ); // xss ok. ?>
     87    <?php echo ; // xss ok. ?>
    7988
    8089    <div class="smf-action">
  • snow-monkey-forms/trunk/dist/blocks/tel/render.php

    r2809253 r3032475  
    99?>
    1010
    11 <div class="smf-placeholder" data-name="<?php echo esc_attr( $attributes['name'] ); ?>">
    12     <?php Helper::the_control( 'tel', Helper::block_meta_normalization( $attributes ) ); ?>
    13 </div>
     11<div class="smf-placeholder" data-name="<?php echo esc_attr( $attributes['name'] ); ?>"></div>
  • snow-monkey-forms/trunk/dist/blocks/text/render.php

    r2809253 r3032475  
    99?>
    1010
    11 <div class="smf-placeholder" data-name="<?php echo esc_attr( $attributes['name'] ); ?>">
    12     <?php Helper::the_control( 'text', Helper::block_meta_normalization( $attributes ) ); ?>
    13 </div>
     11<div class="smf-placeholder" data-name="<?php echo esc_attr( $attributes['name'] ); ?>"></div>
  • snow-monkey-forms/trunk/dist/blocks/textarea/render.php

    r2809253 r3032475  
    99?>
    1010
    11 <div class="smf-placeholder" data-name="<?php echo esc_attr( $attributes['name'] ); ?>">
    12     <?php Helper::the_control( 'textarea', Helper::block_meta_normalization( $attributes ) ); ?>
    13 </div>
     11<div class="smf-placeholder" data-name="<?php echo esc_attr( $attributes['name'] ); ?>"></div>
  • snow-monkey-forms/trunk/dist/blocks/url/render.php

    r2809253 r3032475  
    99?>
    1010
    11 <div class="smf-placeholder" data-name="<?php echo esc_attr( $attributes['name'] ); ?>">
    12     <?php Helper::the_control( 'url', Helper::block_meta_normalization( $attributes ) ); ?>
    13 </div>
     11<div class="smf-placeholder" data-name="<?php echo esc_attr( $attributes['name'] ); ?>"></div>
  • snow-monkey-forms/trunk/readme.txt

    r3023845 r3032475  
    11=== Snow Monkey Forms ===
    2 Contributors: inc2734, mimitips, imawc
     2Contributors: inc2734, mimitips, imawc
    33Donate link: https://www.amazon.co.jp/registry/wishlist/39ANKRNSTNW40
    44Tags: gutenberg, block, blocks, editor, gutenberg blocks, page builder, form, forms, mail, email, contact
    5 Stable tag: 6.2.0
     5Stable tag: 6..0
    66Requires at least: 6.3
    77Tested up to: 6.4
     
    5252== Changelog ==
    5353
     54
     55
     56
     57
     58
     59
    5460= 6.2.0 =
    5561* Added a release button to the file field.
  • snow-monkey-forms/trunk/snow-monkey-forms.php

    r3023845 r3032475  
    22/**
    33 * Plugin name: Snow Monkey Forms
    4  * Version: 6.2.0
     4 * Version: 6..0
    55 * Description: The Snow Monkey Forms is a mail form plugin for the block editor.
    66 * Author: inc2734
  • snow-monkey-forms/trunk/src/blocks/checkboxes/render.php

    r2809253 r3032475  
    55 * @license GPL-2.0+
    66 */
    7 
    8 use Snow_Monkey\Plugin\Forms\App\Helper;
    97?>
    108
    11 <div class="smf-placeholder" data-name="<?php echo esc_attr( $attributes['name'] ); ?>">
    12     <?php Helper::the_control( 'checkboxes', Helper::block_meta_normalization( $attributes ) ); ?>
    13 </div>
     9<div class="smf-placeholder" data-name="<?php echo esc_attr( $attributes['name'] ); ?>"></div>
  • snow-monkey-forms/trunk/src/blocks/email/render.php

    r2809253 r3032475  
    99?>
    1010
    11 <div class="smf-placeholder" data-name="<?php echo esc_attr( $attributes['name'] ); ?>">
    12     <?php Helper::the_control( 'email', Helper::block_meta_normalization( $attributes ) ); ?>
    13 </div>
     11<div class="smf-placeholder" data-name="<?php echo esc_attr( $attributes['name'] ); ?>"></div>
  • snow-monkey-forms/trunk/src/blocks/file/render.php

    r2809253 r3032475  
    99?>
    1010
    11 <div class="smf-placeholder" data-name="<?php echo esc_attr( $attributes['name'] ); ?>">
    12     <?php Helper::the_control( 'file', Helper::block_meta_normalization( $attributes ) ); ?>
    13 </div>
     11<div class="smf-placeholder" data-name="<?php echo esc_attr( $attributes['name'] ); ?>"></div>
  • snow-monkey-forms/trunk/src/blocks/helper.js

    r2809253 r3032475  
    4141    return optionsMapArray.map( ( element ) => {
    4242        const o = {};
    43         o[ element.value ] = element.label;
     43        o[ element.value ] = element.label;
    4444        return o;
    4545    } );
     
    5050
    5151    return preValuesArray.map( ( element ) => {
    52         return Object.keys( element )[ 0 ];
     52        const value = Object.keys( element )[ 0 ];
     53        return 'undefined' !== value ? value : '';
    5354    } );
    5455}
  • snow-monkey-forms/trunk/src/blocks/radio-buttons/render.php

    r2809253 r3032475  
    55 * @license GPL-2.0+
    66 */
    7 
    8 use Snow_Monkey\Plugin\Forms\App\Helper;
    97?>
    108
    11 <div class="smf-placeholder" data-name="<?php echo esc_attr( $attributes['name'] ); ?>">
    12     <?php Helper::the_control( 'radio-buttons', Helper::block_meta_normalization( $attributes ) ); ?>
    13 </div>
     9<div class="smf-placeholder" data-name="<?php echo esc_attr( $attributes['name'] ); ?>"></div>
  • snow-monkey-forms/trunk/src/blocks/select/render.php

    r2809253 r3032475  
    55 * @license GPL-2.0+
    66 */
    7 
    8 use Snow_Monkey\Plugin\Forms\App\Helper;
    97?>
    108
    11 <div class="smf-placeholder" data-name="<?php echo esc_attr( $attributes['name'] ); ?>">
    12     <?php Helper::the_control( 'select', Helper::block_meta_normalization( $attributes ) ); ?>
    13 </div>
     9<div class="smf-placeholder" data-name="<?php echo esc_attr( $attributes['name'] ); ?>"></div>
  • snow-monkey-forms/trunk/src/blocks/snow-monkey-form/render.php

    r2938545 r3032475  
    3434$response = json_decode( $controller->send() );
    3535// phpcs:enable
     36
     37
     38
     39
     40
     41
     42
     43
     44
    3645?>
    3746
     
    7685    <?php endif; ?>
    7786
    78     <?php echo apply_filters( 'the_content', $setting->get( 'input_content' ) ); // xss ok. ?>
     87    <?php echo ; // xss ok. ?>
    7988
    8089    <div class="smf-action">
  • snow-monkey-forms/trunk/src/blocks/tel/render.php

    r2809253 r3032475  
    99?>
    1010
    11 <div class="smf-placeholder" data-name="<?php echo esc_attr( $attributes['name'] ); ?>">
    12     <?php Helper::the_control( 'tel', Helper::block_meta_normalization( $attributes ) ); ?>
    13 </div>
     11<div class="smf-placeholder" data-name="<?php echo esc_attr( $attributes['name'] ); ?>"></div>
  • snow-monkey-forms/trunk/src/blocks/text/render.php

    r2809253 r3032475  
    99?>
    1010
    11 <div class="smf-placeholder" data-name="<?php echo esc_attr( $attributes['name'] ); ?>">
    12     <?php Helper::the_control( 'text', Helper::block_meta_normalization( $attributes ) ); ?>
    13 </div>
     11<div class="smf-placeholder" data-name="<?php echo esc_attr( $attributes['name'] ); ?>"></div>
  • snow-monkey-forms/trunk/src/blocks/textarea/render.php

    r2809253 r3032475  
    99?>
    1010
    11 <div class="smf-placeholder" data-name="<?php echo esc_attr( $attributes['name'] ); ?>">
    12     <?php Helper::the_control( 'textarea', Helper::block_meta_normalization( $attributes ) ); ?>
    13 </div>
     11<div class="smf-placeholder" data-name="<?php echo esc_attr( $attributes['name'] ); ?>"></div>
  • snow-monkey-forms/trunk/src/blocks/url/render.php

    r2809253 r3032475  
    99?>
    1010
    11 <div class="smf-placeholder" data-name="<?php echo esc_attr( $attributes['name'] ); ?>">
    12     <?php Helper::the_control( 'url', Helper::block_meta_normalization( $attributes ) ); ?>
    13 </div>
     11<div class="smf-placeholder" data-name="<?php echo esc_attr( $attributes['name'] ); ?>"></div>
Note: See TracChangeset for help on using the changeset viewer.