Plugin Directory

Changeset 2999435


Ignore:
Timestamp:
11/21/2023 09:13:55 AM (2 years ago)
Author:
Tarosky
Message:

Update to version 1.2.0 from GitHub

Location:
taro-taxonomy-blocks
Files:
39 edited
1 copied

Legend:

Unmodified
Added
Removed
  • taro-taxonomy-blocks/assets/icon.svg

    • Property svn:mime-type set to image/svg+xml
  • taro-taxonomy-blocks/tags/1.2.0/assets/js/block-posts-terms-query.js

    r2657652 r2999435  
    4747                            help={ __( 'Enter post types in csv format. "any" is also available. If empty, current post type will be used.', 'taro-taxonomy-blocks' ) }
    4848                        />
    49                         <TaxonomySelector value={ attributes.taxonomy } onChange={ taxonomy => setAttributes( { taxonomy } ) } />
     49                        <TaxonomySelector value={ attributes.taxonomy } onChange={ ( taxonomy ) => setAttributes( { taxonomy } ) } />
    5050                        <TextControl value={ attributes.terms } label={ __( 'Term Slugs', 'label' ) }
    5151                            help={ __( 'Enter term slugs in CSV format. Default value is post\'s terms', 'taro-taxonomy-blocks' ) }
    5252                            placeholder={ __( 'Post\'s terms.', 'taro-taxonomy-blocks' ) }
    53                             onChange={ ( terms ) => setAttributes( { terms } ) }/>
     53                            onChange={ ( terms ) => setAttributes( { terms } ) } />
    5454                        <TextControl label={ __( 'Number of Posts', 'taro-taxonomy-blocks' ) } type="number" min={ -1 }
    5555                            value={ attributes.limit }
     
    6363
    6464                { ( ! attributes.taxonomy ) ? (
    65                     <div style={ { margin: "40px 0" } }>
     65                    <div style={ { margin: '40px 0' } }>
    6666                        <p>{ __( 'No taxonomy set. Please choose one.', 'taro-taxonomy-' ) }</p>
    67                         <TaxonomySelector value={ attributes.taxonomy } onChange={ taxonomy => setAttributes( { taxonomy } ) } />
     67                        <TaxonomySelector value={ attributes.taxonomy } onChange={ ( taxonomy ) => setAttributes( { taxonomy } ) } />
    6868                    </div>
    6969                ) : (
  • taro-taxonomy-blocks/tags/1.2.0/assets/js/block-posts-terms.js

    r2605922 r2999435  
    3939                <InspectorControls>
    4040                    <PanelBody defaultOpen={ true } title={ __( 'Taxonomy Setting', 'taro-taxonomy-blocks' ) } >
    41                         <TaxonomySelector value={ attributes.taxonomy } onChange={ taxonomy => setAttributes( { taxonomy } ) } />
     41                        <TaxonomySelector value={ attributes.taxonomy } onChange={ ( taxonomy ) => setAttributes( { taxonomy } ) } />
    4242                    </PanelBody>
    4343                </InspectorControls>
    4444
    4545                { ( ! attributes.taxonomy ) ? (
    46                     <div style={ { margin: "40px 0" } }>
     46                    <div style={ { margin: '40px 0' } }>
    4747                        <p>{ __( 'No taxonomy set. Please choose one.', 'taro-taxonomy-' ) }</p>
    48                         <TaxonomySelector value={ attributes.taxonomy } onChange={ taxonomy => setAttributes( { taxonomy } ) } />
     48                        <TaxonomySelector value={ attributes.taxonomy } onChange={ ( taxonomy ) => setAttributes( { taxonomy } ) } />
    4949                    </div>
    5050                ) : (
  • taro-taxonomy-blocks/tags/1.2.0/assets/js/block-terms.js

    r2605922 r2999435  
    3737                <InspectorControls>
    3838                    <PanelBody defaultOpen={ true } title={ __( 'Taxonomy Setting', 'taro-taxonomy-blocks' ) } >
    39                         <TaxonomySelector value={ attributes.taxonomy } onChange={ taxonomy => setAttributes( { taxonomy } ) } />
     39                        <TaxonomySelector value={ attributes.taxonomy } onChange={ ( taxonomy ) => setAttributes( { taxonomy } ) } />
    4040                        <ToggleControl checked={ attributes.hide_empty } label={ __( 'Hide Empty', 'taro-taxonomy-blocks' ) } onChange={ ( hideEmpty ) => setAttributes( { hide_empty: hideEmpty } ) } />
    4141                        <hr />
    4242                        <OrderBySelector value={ attributes.orderby } onChange={ ( orderby ) => setAttributes( { orderby } ) } />
    43                         <TextControl label={ __( 'Custom Field(optional)', 'taro-taxonomy-blocks' ) } value={ attributes.meta } onChange={ meta => setAttributes( { meta } ) } />
     43                        <TextControl label={ __( 'Custom Field(optional)', 'taro-taxonomy-blocks' ) } value={ attributes.meta } onChange={ ( meta ) => setAttributes( { meta } ) } />
    4444                        <OrderSelector value={ attributes.order } onChange={ ( order ) => setAttributes( { order } ) } />
    4545                    </PanelBody>
    4646                </InspectorControls>
    4747
    48                     { ( ! attributes.taxonomy ) ? (
    49                         <div style={ { margin: "40px 0" } }>
    50                             <p>{ __( 'No taxonomy set. Please choose one.', 'taro-taxonomy-' ) }</p>
    51                             <TaxonomySelector value={ attributes.taxonomy } onChange={ taxonomy => setAttributes( { taxonomy } ) } />
    52                         </div>
    53                     ) : (
    54                         <div className="taro-taxonomy-blocks-editor">
    55                             <ServerSideRender block="taro/terms" attributes={ attributes } />
    56                         </div>
    57                     ) }
     48                { ( ! attributes.taxonomy ) ? (
     49                    <div style={ { margin: '40px 0' } }>
     50                        <p>{ __( 'No taxonomy set. Please choose one.', 'taro-taxonomy-' ) }</p>
     51                        <TaxonomySelector value={ attributes.taxonomy } onChange={ ( taxonomy ) => setAttributes( { taxonomy } ) } />
     52                    </div>
     53                ) : (
     54                    <div className="taro-taxonomy-blocks-editor">
     55                        <ServerSideRender block="taro/terms" attributes={ attributes } />
     56                    </div>
     57                ) }
    5858            </>
    5959        );
  • taro-taxonomy-blocks/tags/1.2.0/assets/js/taxonomy-selector.js

    r2605922 r2999435  
    1212        label: __( 'Please Select', 'taro-taxonomy-blocks' ),
    1313        value: '',
    14     }
     14    },
    1515];
    1616
     
    2424const TaxonomySelector = ( { value, onChange } ) => {
    2525    return (
    26         <SelectControl label={ __( 'Taxonomy', 'taro-taxonomy-blocks' ) } options={ taxonomyOptions } value={ value } onChange={ taxonomy => onChange( taxonomy ) } />
     26        <SelectControl label={ __( 'Taxonomy', 'taro-taxonomy-blocks' ) } options={ taxonomyOptions } value={ value } onChange={ ( taxonomy ) => onChange( taxonomy ) } />
    2727    );
    2828};
     
    3030const OrderSelector = ( { value, onChange } ) => {
    3131    return (
    32         <SelectControl label={ __( 'Order', 'taro-taxonomy-blocks' ) } onChange={ order => onChange( order ) }
     32        <SelectControl label={ __( 'Order', 'taro-taxonomy-blocks' ) } onChange={ ( order ) => onChange( order ) }
    3333            value={ value }
    3434            options={ [
     
    4141                    value: 'DESC',
    4242                },
    43             ] }/>
     43            ] } />
    4444    );
    4545};
     
    4747const OrderBySelector = ( { value, onChange } ) => {
    4848    return (
    49         <SelectControl label={ __( 'Order By', 'taro-taxonomy-blocks' ) } onChange={ orderby => onChange( orderby ) }
     49        <SelectControl label={ __( 'Order By', 'taro-taxonomy-blocks' ) } onChange={ ( orderby ) => onChange( orderby ) }
    5050            value={ value }
    5151            options={ [
     
    7070const PostsOrderBySelector = ( { value, onChange } ) => {
    7171    return (
    72         <SelectControl label={ __( 'Order By', 'taro-taxonomy-blocks' ) } onChange={ orderby => onChange( orderby ) }
     72        <SelectControl label={ __( 'Order By', 'taro-taxonomy-blocks' ) } onChange={ ( orderby ) => onChange( orderby ) }
    7373            value={ value }
    7474            options={ [
  • taro-taxonomy-blocks/tags/1.2.0/composer.json

    r2605922 r2999435  
    55    "license": "GPL-3.0-or-later",
    66    "scripts": {
    7         "test": [
    8             "phpcs --config-set installed_paths $(pwd)/vendor/wp-coding-standards/wpcs",
     7        "lint": [
    98            "phpcs --standard=phpcs.ruleset.xml $(find ./ -name '*.php')"
    109        ],
    1110        "fix": [
    12             "phpcs --config-set installed_paths $(pwd)/vendor/wp-coding-standards/wpcs",
    1311            "phpcbf --standard=phpcs.ruleset.xml $(find ./ -name '*.php')"
    1412        ]
     
    2119    ],
    2220    "require": {
    23         "php": "^5.6|^7.0"
     21        "php": ">=7.2"
    2422    },
    2523    "require-dev": {
    2624        "squizlabs/php_codesniffer": "^3.0",
    27         "wp-coding-standards/wpcs": "^2.0"
     25        "wp-coding-standards/wpcs": "^2.0",
     26        "phpcompatibility/php-compatibility": "^9.3",
     27        "dealerdirect/phpcodesniffer-composer-installer": "^1.0"
     28    },
     29    "config": {
     30        "allow-plugins": {
     31            "dealerdirect/phpcodesniffer-composer-installer": true
     32        }
    2833    }
    2934}
  • taro-taxonomy-blocks/tags/1.2.0/dist/css/editor-block-terms.css

    r2605922 r2999435  
    11.taro-taxonomy-blocks-editor{position:relative}.taro-taxonomy-blocks-editor::after{content:"";display:block;position:absolute;top:0;left:0;right:0;bottom:0;z-index:10}
    2 
    32/*# sourceMappingURL=map/editor-block-terms.css.map */
  • taro-taxonomy-blocks/tags/1.2.0/dist/css/map/editor-block-terms.css.map

    r2605922 r2999435  
    1 {"version":3,"sources":["editor-block-terms.scss"],"names":[],"mappings":"AAAA,6BAEC,iBAAkB,CAFnB,oCAKE,UAAW,CACX,aAAc,CACd,iBAAkB,CAClB,KAAM,CACN,MAAO,CACP,OAAQ,CACR,QAAS,CACT,UAAW","file":"../editor-block-terms.css","sourcesContent":[".taro-taxonomy-blocks-editor {\n\n\tposition: relative;\n\n\t&::after {\n\t\tcontent: \"\";\n\t\tdisplay: block;\n\t\tposition: absolute;\n\t\ttop: 0;\n\t\tleft: 0;\n\t\tright: 0;\n\t\tbottom: 0;\n\t\tz-index: 10;\n\t}\n}\n"]}
     1{"version":3,"sources":["editor-block-terms.scss"],"names":[],"mappings":"AAAA,6BAEC,iBAAA,CAEA,oCACC,UAAA,CACA,aAAA,CACA,iBAAA,CACA,KAAA,CACA,MAAA,CACA,OAAA,CACA,QAAA,CACA,UAAA","file":"../editor-block-terms.css","sourcesContent":[".taro-taxonomy-blocks-editor {\n\n\tposition: relative;\n\n\t&::after {\n\t\tcontent: \"\";\n\t\tdisplay: block;\n\t\tposition: absolute;\n\t\ttop: 0;\n\t\tleft: 0;\n\t\tright: 0;\n\t\tbottom: 0;\n\t\tz-index: 10;\n\t}\n}\n"]}
  • taro-taxonomy-blocks/tags/1.2.0/dist/css/map/style-block-terms.css.map

    r2605922 r2999435  
    1 {"version":3,"sources":["style-block-terms.scss"],"names":[],"mappings":"AAEC,oBACC,SAAU,CACV,aAAc,CAEd,0BACC,aAAc,CADd,oDAIC,QAAS,CACT,oBAAqB,CALtB,mEAQE,eAAgB,CAChB,oBAMH,eAAgB,CAChB,oBAAqB,CACrB,kBAAmB,CAEnB,2BACC,aAAc,CACd,YAAa,CACb,yBAGA,eAAgB,CAChB,oBAAqB,CACrB,oBAAqB,CACrB,6BAA8B,CAC9B,iBAAkB,CAClB,+BAAgC,CANhC,+DAUC,sCAAyC,CACzC,2BAQF,SAAU,CACV,iBAAkB,CAClB,YAAa,CACb,cAAe,CACf,0BAGA,eAAgB,CAChB,YAAa,CACb,YAAa,CAEb,0CALD,0BAME,YAAa,CAKd,CAHA,0CARD,0BASE,aAAc,CAEf,CAED,0BACC,aAAc,CACd,sCAAyC,CACzC,YAAa,CACb,+BAAgC,CAJhC,iEAQC,sCAAyC,CACzC,2BAID,aAAc,CACd,eAAgB,CAChB,0BAGA,aAAc,CACd,eAAgB","file":"../style-block-terms.css","sourcesContent":[".taro-taxonomy {\n\n\t&-list {\n\t\tpadding: 0;\n\t\tmargin: 40px 0;\n\n\t\t&-child {\n\t\t\tmargin: 20px 0;\n\n\t\t\t& & {\n\t\t\t\tmargin: 0;\n\t\t\t\tdisplay: inline-block;\n\n\t\t\t\tli:first-child {\n\t\t\t\t\tmargin-left: 1em;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t&-item {\n\t\tlist-style: none;\n\t\tdisplay: inline-block;\n\t\tmargin: 0 1em 1em 0;\n\n\t\t&-parent {\n\t\t\tdisplay: block;\n\t\t\tmargin: 1em 0;\n\t\t}\n\n\t\t&-link {\n\t\t\tfont-size: .85em;\n\t\t\tdisplay: inline-block;\n\t\t\tpadding: 0.25em 0.5em;\n\t\t\tborder: 1px solid currentColor;\n\t\t\tborder-radius: 1em;\n\t\t\ttext-decoration: none !important;\n\n\t\t\t&:hover,\n\t\t\t&:active {\n\t\t\t\tbackground-color: rgba(255, 255, 255, .2);\n\t\t\t}\n\t\t}\n\t}\n}\n\n.taro-taxonomy-query {\n\n\t&-block {\n\t\tpadding: 0;\n\t\tmargin: 40px -10px;\n\t\tdisplay: flex;\n\t\tflex-wrap: wrap;\n\t}\n\n\t&-item {\n\t\tlist-style: none;\n\t\tflex: 0 1 33%;\n\t\tpadding: 10px;\n\n\t\t@media only screen and ( max-width: 767px ) {\n\t\t\tflex: 0 1 50%;\n\t\t}\n\t\t@media only screen and ( max-width: 420px ) {\n\t\t\tflex: 0 1 100%;\n\t\t}\n\t}\n\n\t&-link {\n\t\tdisplay: block;\n\t\tbackground-color: rgba(255, 255, 255, .4);\n\t\tpadding: 10px;\n\t\ttext-decoration: none !important;\n\n\t\t&:hover,\n\t\t&:active {\n\t\t\tbackground-color: rgba(255, 255, 255, .8);\n\t\t}\n\t}\n\n\t&-title {\n\t\tdisplay: block;\n\t\tfont-weight: 700;\n\t}\n\n\t&-date {\n\t\tdisplay: block;\n\t\tfont-size: 0.8em;\n\t}\n}\n"]}
     1{"version":3,"sources":["style-block-terms.scss"],"names":[],"mappings":"AAEC,oBACC,SAAA,CACA,aAAA,CAEA,0BACC,aAAA,CAEA,oDACC,QAAA,CACA,oBAAA,CAEA,mEACC,eAAA,CAMJ,oBACC,eAAA,CACA,oBAAA,CACA,kBAAA,CAEA,2BACC,aAAA,CACA,YAAA,CAGD,yBACC,eAAA,CACA,oBAAA,CACA,kBAAA,CACA,6BAAA,CACA,iBAAA,CACA,+BAAA,CAEA,+DAEC,qCAAA,CAQH,2BACC,SAAA,CACA,iBAAA,CACA,YAAA,CACA,cAAA,CAGD,0BACC,eAAA,CACA,YAAA,CACA,YAAA,CAEA,0CALD,0BAME,YAAA,CAAA,CAED,0CARD,0BASE,aAAA,CAAA,CAIF,0BACC,aAAA,CACA,qCAAA,CACA,YAAA,CACA,+BAAA,CAEA,iEAEC,qCAAA,CAIF,2BACC,aAAA,CACA,eAAA,CAGD,0BACC,aAAA,CACA,cAAA","file":"../style-block-terms.css","sourcesContent":[".taro-taxonomy {\n\n\t&-list {\n\t\tpadding: 0;\n\t\tmargin: 40px 0;\n\n\t\t&-child {\n\t\t\tmargin: 20px 0;\n\n\t\t\t& & {\n\t\t\t\tmargin: 0;\n\t\t\t\tdisplay: inline-block;\n\n\t\t\t\tli:first-child {\n\t\t\t\t\tmargin-left: 1em;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t&-item {\n\t\tlist-style: none;\n\t\tdisplay: inline-block;\n\t\tmargin: 0 1em 1em 0;\n\n\t\t&-parent {\n\t\t\tdisplay: block;\n\t\t\tmargin: 1em 0;\n\t\t}\n\n\t\t&-link {\n\t\t\tfont-size: .85em;\n\t\t\tdisplay: inline-block;\n\t\t\tpadding: 0.25em 0.5em;\n\t\t\tborder: 1px solid currentColor;\n\t\t\tborder-radius: 1em;\n\t\t\ttext-decoration: none !important;\n\n\t\t\t&:hover,\n\t\t\t&:active {\n\t\t\t\tbackground-color: rgba(255, 255, 255, .2);\n\t\t\t}\n\t\t}\n\t}\n}\n\n.taro-taxonomy-query {\n\n\t&-block {\n\t\tpadding: 0;\n\t\tmargin: 40px -10px;\n\t\tdisplay: flex;\n\t\tflex-wrap: wrap;\n\t}\n\n\t&-item {\n\t\tlist-style: none;\n\t\tflex: 0 1 33%;\n\t\tpadding: 10px;\n\n\t\t@media only screen and ( max-width: 767px ) {\n\t\t\tflex: 0 1 50%;\n\t\t}\n\t\t@media only screen and ( max-width: 420px ) {\n\t\t\tflex: 0 1 100%;\n\t\t}\n\t}\n\n\t&-link {\n\t\tdisplay: block;\n\t\tbackground-color: rgba(255, 255, 255, .4);\n\t\tpadding: 10px;\n\t\ttext-decoration: none !important;\n\n\t\t&:hover,\n\t\t&:active {\n\t\t\tbackground-color: rgba(255, 255, 255, .8);\n\t\t}\n\t}\n\n\t&-title {\n\t\tdisplay: block;\n\t\tfont-weight: 700;\n\t}\n\n\t&-date {\n\t\tdisplay: block;\n\t\tfont-size: 0.8em;\n\t}\n}\n"]}
  • taro-taxonomy-blocks/tags/1.2.0/dist/css/style-block-terms.css

    r2605922 r2999435  
    1 .taro-taxonomy-list{padding:0;margin:40px 0}.taro-taxonomy-list-child{margin:20px 0}.taro-taxonomy-list-child .taro-taxonomy-list-child{margin:0;display:inline-block}.taro-taxonomy-list-child .taro-taxonomy-list-child li:first-child{margin-left:1em}.taro-taxonomy-item{list-style:none;display:inline-block;margin:0 1em 1em 0}.taro-taxonomy-item-parent{display:block;margin:1em 0}.taro-taxonomy-item-link{font-size:.85em;display:inline-block;padding:0.25em 0.5em;border:1px solid currentColor;border-radius:1em;text-decoration:none !important}.taro-taxonomy-item-link:hover,.taro-taxonomy-item-link:active{background-color:rgba(255,255,255,0.2)}.taro-taxonomy-query-block{padding:0;margin:40px -10px;display:flex;flex-wrap:wrap}.taro-taxonomy-query-item{list-style:none;flex:0 1 33%;padding:10px}@media only screen and (max-width: 767px){.taro-taxonomy-query-item{flex:0 1 50%}}@media only screen and (max-width: 420px){.taro-taxonomy-query-item{flex:0 1 100%}}.taro-taxonomy-query-link{display:block;background-color:rgba(255,255,255,0.4);padding:10px;text-decoration:none !important}.taro-taxonomy-query-link:hover,.taro-taxonomy-query-link:active{background-color:rgba(255,255,255,0.8)}.taro-taxonomy-query-title{display:block;font-weight:700}.taro-taxonomy-query-date{display:block;font-size:0.8em}
    2 
     1.taro-taxonomy-list{padding:0;margin:40px 0}.taro-taxonomy-list-child{margin:20px 0}.taro-taxonomy-list-child .taro-taxonomy-list-child{margin:0;display:inline-block}.taro-taxonomy-list-child .taro-taxonomy-list-child li:first-child{margin-left:1em}.taro-taxonomy-item{list-style:none;display:inline-block;margin:0 1em 1em 0}.taro-taxonomy-item-parent{display:block;margin:1em 0}.taro-taxonomy-item-link{font-size:.85em;display:inline-block;padding:.25em .5em;border:1px solid currentColor;border-radius:1em;text-decoration:none !important}.taro-taxonomy-item-link:hover,.taro-taxonomy-item-link:active{background-color:rgba(255,255,255,.2)}.taro-taxonomy-query-block{padding:0;margin:40px -10px;display:flex;flex-wrap:wrap}.taro-taxonomy-query-item{list-style:none;flex:0 1 33%;padding:10px}@media only screen and (max-width: 767px){.taro-taxonomy-query-item{flex:0 1 50%}}@media only screen and (max-width: 420px){.taro-taxonomy-query-item{flex:0 1 100%}}.taro-taxonomy-query-link{display:block;background-color:rgba(255,255,255,.4);padding:10px;text-decoration:none !important}.taro-taxonomy-query-link:hover,.taro-taxonomy-query-link:active{background-color:rgba(255,255,255,.8)}.taro-taxonomy-query-title{display:block;font-weight:700}.taro-taxonomy-query-date{display:block;font-size:.8em}
    32/*# sourceMappingURL=map/style-block-terms.css.map */
  • taro-taxonomy-blocks/tags/1.2.0/dist/js/block-posts-terms-query.js

    r2657652 r2999435  
    11/*! License information can be found in block-posts-terms-query.js.LICENSE.txt */
    2 !function(){var e=wp.blocks.registerBlockType,t=wp.i18n,__=t.__,sprintf=t.sprintf,o=wp.data.select,a=wp.blockEditor.InspectorControls,r=wp.components,n=r.PanelBody,l=r.TextControl,s=wp.serverSideRender,c=wp.taro,m=c.TaxonomySelector,i=c.OrderSelector,u=c.PostsOrderBySelector;e("taro/post-terms-query",{title:__("Post Terms Query","taro-taxonomy-blocks"),icon:"tag",category:"widgets",example:{taxonomy:"category"},keywords:["term"],attributes:TaroPostTermsQueryBlockEditor.attributes,description:__("Display posts with same terms of this post in specified taxonomy.","taro-taxonomy-blocks"),edit:function(e){var t=e.attributes,r=e.setAttributes,c=sprintf(__("Default: %s","taro-taxonomy-blocks"),o("core/editor").getCurrentPostType());
     2!function(){const{registerBlockType:e}=wp.blocks,{__:__,sprintf:sprintf}=wp.i18n,{select:t}=wp.data,{InspectorControls:o}=wp.blockEditor,{PanelBody:a,TextControl:r}=wp.components,{serverSideRender:l}=wp,{TaxonomySelector:n,OrderSelector:s,PostsOrderBySelector:c}=wp.taro;e("taro/post-terms-query",{title:__("Post Terms Query","taro-taxonomy-blocks"),icon:"tag",category:"widgets",example:{taxonomy:"category"},keywords:["term"],attributes:TaroPostTermsQueryBlockEditor.attributes,description:__("Display posts with same terms of this post in specified taxonomy.","taro-taxonomy-blocks"),edit(e){let{attributes:m,setAttributes:y}=e;
    33// translators: %s is post type.
    4 return React.createElement(React.Fragment,null,React.createElement(a,null,React.createElement(n,{defaultOpen:!0,title:__("Taxonomy Setting","taro-taxonomy-blocks")},React.createElement(l,{label:__("Post Type","taro-taxonomy-blocks"),value:t.post_type,placeholder:c,onChange:function(e){return r({post_type:e})},help:__('Enter post types in csv format. "any" is also available. If empty, current post type will be used.',"taro-taxonomy-blocks")}),React.createElement(m,{value:t.taxonomy,onChange:function(e){return r({taxonomy:e})}}),React.createElement(l,{value:t.terms,label:__("Term Slugs","label"),help:__("Enter term slugs in CSV format. Default value is post's terms","taro-taxonomy-blocks"),placeholder:__("Post's terms.","taro-taxonomy-blocks"),onChange:function(e){return r({terms:e})}}),React.createElement(l,{label:__("Number of Posts","taro-taxonomy-blocks"),type:"number",min:-1,value:t.limit,placeholder:10,onChange:function(e){return r({limit:parseInt(e)})}}),React.createElement(u,{valu:t.orderby,onChange:function(e){return r({orderby:e})}}),React.createElement(i,{value:t.order,onChange:function(e){return r({order:e})}}))),t.taxonomy?React.createElement("div",{className:"taro-taxonomy-blocks-editor"},React.createElement(s,{block:"taro/post-terms-query",attributes:t})):React.createElement("div",{style:{margin:"40px 0"}},React.createElement("p",null,__("No taxonomy set. Please choose one.","taro-taxonomy-")),React.createElement(m,{value:t.taxonomy,onChange:function(e){return r({taxonomy:e})}})))},save:function(){return null}})}();
     4const i=sprintf(__("Default: %s","taro-taxonomy-blocks"),t("core/editor").getCurrentPostType());return React.createElement(React.Fragment,null,React.createElement(o,null,React.createElement(a,{defaultOpen:!0,title:__("Taxonomy Setting","taro-taxonomy-blocks")},React.createElement(r,{label:__("Post Type","taro-taxonomy-blocks"),value:m.post_type,placeholder:i,onChange:e=>y({post_type:e}),help:__('Enter post types in csv format. "any" is also available. If empty, current post type will be used.',"taro-taxonomy-blocks")}),React.createElement(n,{value:m.taxonomy,onChange:e=>y({taxonomy:e})}),React.createElement(r,{value:m.terms,label:__("Term Slugs","label"),help:__("Enter term slugs in CSV format. Default value is post's terms","taro-taxonomy-blocks"),placeholder:__("Post's terms.","taro-taxonomy-blocks"),onChange:e=>y({terms:e})}),React.createElement(r,{label:__("Number of Posts","taro-taxonomy-blocks"),type:"number",min:-1,value:m.limit,placeholder:10,onChange:e=>y({limit:parseInt(e)})}),React.createElement(c,{valu:m.orderby,onChange:e=>y({orderby:e})}),React.createElement(s,{value:m.order,onChange:e=>y({order:e})}))),m.taxonomy?React.createElement("div",{className:"taro-taxonomy-blocks-editor"},React.createElement(l,{block:"taro/post-terms-query",attributes:m})):React.createElement("div",{style:{margin:"40px 0"}},React.createElement("p",null,__("No taxonomy set. Please choose one.","taro-taxonomy-")),React.createElement(n,{value:m.taxonomy,onChange:e=>y({taxonomy:e})})))},save(){return null}})}();
  • taro-taxonomy-blocks/tags/1.2.0/dist/js/block-posts-terms.js

    r2627101 r2999435  
    11/*! License information can be found in block-posts-terms.js.LICENSE.txt */
    2 !function(){var t=wp.blocks.registerBlockType,__=wp.i18n.__,e=wp.blockEditor.InspectorControls,o=wp.components.PanelBody,a=wp.serverSideRender,n=wp.taro.TaxonomySelector;t("taro/post-terms",{title:__("Post Terms","taro-taxonomy-blocks"),icon:"tag",category:"widgets",example:{taxonomy:"category"},keywords:["term"],attributes:TaroPostTermsBlockEditor.attributes,description:__("Display the list of terms assigned to this post in specified taxonomy.","taro-taxonomy-blocks"),edit:function(t){var r=t.attributes,c=t.setAttributes;return React.createElement(React.Fragment,null,React.createElement(e,null,React.createElement(o,{defaultOpen:!0,title:__("Taxonomy Setting","taro-taxonomy-blocks")},React.createElement(n,{value:r.taxonomy,onChange:function(t){return c({taxonomy:t})}}))),r.taxonomy?React.createElement("div",{className:"taro-taxonomy-blocks-editor"},React.createElement(a,{block:"taro/post-terms",attributes:r})):React.createElement("div",{style:{margin:"40px 0"}},React.createElement("p",null,__("No taxonomy set. Please choose one.","taro-taxonomy-")),React.createElement(n,{value:r.taxonomy,onChange:function(t){return c({taxonomy:t})}})))},save:function(){return null}})}();
     2!function(){const{registerBlockType:t}=wp.blocks,{__:__}=wp.i18n,{InspectorControls:e}=wp.blockEditor,{PanelBody:o}=wp.components,{serverSideRender:a}=wp,{TaxonomySelector:n}=wp.taro;t("taro/post-terms",{title:__("Post Terms","taro-taxonomy-blocks"),icon:"tag",category:"widgets",example:{taxonomy:"category"},keywords:["term"],attributes:TaroPostTermsBlockEditor.attributes,description:__("Display the list of terms assigned to this post in specified taxonomy.","taro-taxonomy-blocks"),edit(t){let{attributes:r,setAttributes:s}=t;return React.createElement(React.Fragment,null,React.createElement(e,null,React.createElement(o,{defaultOpen:!0,title:__("Taxonomy Setting","taro-taxonomy-blocks")},React.createElement(n,{value:r.taxonomy,onChange:t=>s({taxonomy:t})}))),r.taxonomy?React.createElement("div",{className:"taro-taxonomy-blocks-editor"},React.createElement(a,{block:"taro/post-terms",attributes:r})):React.createElement("div",{style:{margin:"40px 0"}},React.createElement("p",null,__("No taxonomy set. Please choose one.","taro-taxonomy-")),React.createElement(n,{value:r.taxonomy,onChange:t=>s({taxonomy:t})})))},save(){return null}})}();
  • taro-taxonomy-blocks/tags/1.2.0/dist/js/block-terms.js

    r2627101 r2999435  
    11/*! License information can be found in block-terms.js.LICENSE.txt */
    2 !function(){var e=wp.blocks.registerBlockType,__=wp.i18n.__,t=wp.blockEditor.InspectorControls,o=wp.components,a=o.PanelBody,n=o.ToggleControl,r=o.TextControl,c=wp.serverSideRender,l=wp.taro,m=l.TaxonomySelector,i=l.OrderSelector,s=l.OrderBySelector;e("taro/terms",{title:__("Terms","taro-taxonomy-blocks"),icon:"tag",category:"widgets",example:{taxonomy:"category"},keywords:["term"],attributes:TaroTermsBlockEditor.attributes,description:__("Display terms list in specified taxonomy.","taro-taxonomy-blocks"),edit:function(e){var o=e.attributes,l=e.setAttributes;return React.createElement(React.Fragment,null,React.createElement(t,null,React.createElement(a,{defaultOpen:!0,title:__("Taxonomy Setting","taro-taxonomy-blocks")},React.createElement(m,{value:o.taxonomy,onChange:function(e){return l({taxonomy:e})}}),React.createElement(n,{checked:o.hide_empty,label:__("Hide Empty","taro-taxonomy-blocks"),onChange:function(e){return l({hide_empty:e})}}),React.createElement("hr",null),React.createElement(s,{value:o.orderby,onChange:function(e){return l({orderby:e})}}),React.createElement(r,{label:__("Custom Field(optional)","taro-taxonomy-blocks"),value:o.meta,onChange:function(e){return l({meta:e})}}),React.createElement(i,{value:o.order,onChange:function(e){return l({order:e})}}))),o.taxonomy?React.createElement("div",{className:"taro-taxonomy-blocks-editor"},React.createElement(c,{block:"taro/terms",attributes:o})):React.createElement("div",{style:{margin:"40px 0"}},React.createElement("p",null,__("No taxonomy set. Please choose one.","taro-taxonomy-")),React.createElement(m,{value:o.taxonomy,onChange:function(e){return l({taxonomy:e})}})))},save:function(){return null}})}();
     2!function(){const{registerBlockType:e}=wp.blocks,{__:__}=wp.i18n,{InspectorControls:t}=wp.blockEditor,{PanelBody:o,ToggleControl:a,TextControl:r}=wp.components,{serverSideRender:n}=wp,{TaxonomySelector:l,OrderSelector:c,OrderBySelector:m}=wp.taro;e("taro/terms",{title:__("Terms","taro-taxonomy-blocks"),icon:"tag",category:"widgets",example:{taxonomy:"category"},keywords:["term"],attributes:TaroTermsBlockEditor.attributes,description:__("Display terms list in specified taxonomy.","taro-taxonomy-blocks"),edit(e){let{attributes:s,setAttributes:i}=e;return React.createElement(React.Fragment,null,React.createElement(t,null,React.createElement(o,{defaultOpen:!0,title:__("Taxonomy Setting","taro-taxonomy-blocks")},React.createElement(l,{value:s.taxonomy,onChange:e=>i({taxonomy:e})}),React.createElement(a,{checked:s.hide_empty,label:__("Hide Empty","taro-taxonomy-blocks"),onChange:e=>i({hide_empty:e})}),React.createElement("hr",null),React.createElement(m,{value:s.orderby,onChange:e=>i({orderby:e})}),React.createElement(r,{label:__("Custom Field(optional)","taro-taxonomy-blocks"),value:s.meta,onChange:e=>i({meta:e})}),React.createElement(c,{value:s.order,onChange:e=>i({order:e})}))),s.taxonomy?React.createElement("div",{className:"taro-taxonomy-blocks-editor"},React.createElement(n,{block:"taro/terms",attributes:s})):React.createElement("div",{style:{margin:"40px 0"}},React.createElement("p",null,__("No taxonomy set. Please choose one.","taro-taxonomy-")),React.createElement(l,{value:s.taxonomy,onChange:e=>i({taxonomy:e})})))},save(){return null}})}();
  • taro-taxonomy-blocks/tags/1.2.0/dist/js/taxonomy-selector.js

    r2627101 r2999435  
    11/*! License information can be found in taxonomy-selector.js.LICENSE.txt */
    2 !function(){var __=wp.i18n.__,o=wp.components.SelectControl,e=[{label:__("Please Select","taro-taxonomy-blocks"),value:""}];TaroTaxonomySelector.taxonomies.forEach((function(o){e.push({label:o.label,value:o.name})}));wp.taro||(wp.taro={}),wp.taro.TaxonomySelector=function(a){var t=a.value,n=a.onChange;return React.createElement(o,{label:__("Taxonomy","taro-taxonomy-blocks"),options:e,value:t,onChange:function(o){return n(o)}})},wp.taro.OrderSelector=function(e){var a=e.value,t=e.onChange;return React.createElement(o,{label:__("Order","taro-taxonomy-blocks"),onChange:function(o){return t(o)},value:a,options:[{label:__("Ascending","taro-taxonomy-blocks"),value:"ASC"},{label:__("Descending","taro-taxonomy-blocks"),value:"DESC"}]})},wp.taro.OrderBySelector=function(e){var a=e.value,t=e.onChange;return React.createElement(o,{label:__("Order By","taro-taxonomy-blocks"),onChange:function(o){return t(o)},value:a,options:[{label:__("Name","taro-taxonomy-blocks"),value:"name"},{label:__("Slug","taro-taxonomy-blocks"),value:"slug"},{label:__("Count","taro-taxonomy-blocks"),value:"count"}],help:__("To use custom fields for sort, enter the field name above.","taro-taxonomy-blocks")})},wp.taro.PostsOrderBySelector=function(e){var a=e.value,t=e.onChange;return React.createElement(o,{label:__("Order By","taro-taxonomy-blocks"),onChange:function(o){return t(o)},value:a,options:[{label:__("Date","taro-taxonomy-blocks"),value:"date"},{label:__("Random","taro-taxonomy-blocks"),value:"rand"},{label:__("Menu Order","taro-taxonomy-blocks"),value:"menu_order"}],help:__("To use custom fields for sort, enter the field name above.","taro-taxonomy-blocks")})}}();
     2!function(){const{__:__}=wp.i18n,{SelectControl:e}=wp.components,o=[{label:__("Please Select","taro-taxonomy-blocks"),value:""}];TaroTaxonomySelector.taxonomies.forEach((e=>{o.push({label:e.label,value:e.name})}));wp.taro||(wp.taro={}),wp.taro.TaxonomySelector=a=>{let{value:l,onChange:t}=a;return React.createElement(e,{label:__("Taxonomy","taro-taxonomy-blocks"),options:o,value:l,onChange:e=>t(e)})},wp.taro.OrderSelector=o=>{let{value:a,onChange:l}=o;return React.createElement(e,{label:__("Order","taro-taxonomy-blocks"),onChange:e=>l(e),value:a,options:[{label:__("Ascending","taro-taxonomy-blocks"),value:"ASC"},{label:__("Descending","taro-taxonomy-blocks"),value:"DESC"}]})},wp.taro.OrderBySelector=o=>{let{value:a,onChange:l}=o;return React.createElement(e,{label:__("Order By","taro-taxonomy-blocks"),onChange:e=>l(e),value:a,options:[{label:__("Name","taro-taxonomy-blocks"),value:"name"},{label:__("Slug","taro-taxonomy-blocks"),value:"slug"},{label:__("Count","taro-taxonomy-blocks"),value:"count"}],help:__("To use custom fields for sort, enter the field name above.","taro-taxonomy-blocks")})},wp.taro.PostsOrderBySelector=o=>{let{value:a,onChange:l}=o;return React.createElement(e,{label:__("Order By","taro-taxonomy-blocks"),onChange:e=>l(e),value:a,options:[{label:__("Date","taro-taxonomy-blocks"),value:"date"},{label:__("Random","taro-taxonomy-blocks"),value:"rand"},{label:__("Menu Order","taro-taxonomy-blocks"),value:"menu_order"}],help:__("To use custom fields for sort, enter the field name above.","taro-taxonomy-blocks")})}}();
  • taro-taxonomy-blocks/tags/1.2.0/gulpfile.js

    r2605922 r2999435  
    11const gulp = require( 'gulp' );
    2 const fs = require( 'fs' );
    32const $ = require( 'gulp-load-plugins' )();
    43const webpack = require( 'webpack-stream' );
    54const webpackBundle = require( 'webpack' );
    65const named = require( 'vinyl-named' );
     6const sass = require( 'gulp-sass' )( require( 'sass' ) );
     7
    78
    89let plumber = true;
     
    1011// Sassのタスク
    1112gulp.task( 'sass', function () {
    12 
    1313    return gulp.src( [ './assets/scss/**/*.scss' ] )
    1414        .pipe( $.plumber( {
    1515            errorHandler: $.notify.onError( '<%= error.message %>' )
    1616        } ) )
    17         .pipe( $.sassGlob() )
    1817        .pipe( $.sourcemaps.init() )
    19         .pipe( $.sass( {
     18        .pipe( sass( {
    2019            errLogToConsole: true,
    2120            outputStyle: 'compressed',
     
    2423            includePaths: [
    2524                './assets/sass',
    26                 './vendor',
    27                 './node_modules/bootstrap-sass/assets/stylesheets',
    28                 './vendor/hametuha'
    29             ]
     25            ],
    3026        } ) )
    3127        .pipe( $.autoprefixer() )
  • taro-taxonomy-blocks/tags/1.2.0/package.json

    r2605922 r2999435  
    1818    "author": "Hametuha inc.",
    1919    "license": "LGPL-3.0-or-later",
     20    "engines": {
     21        "node": ">=16.0.0"
     22    },
    2023    "devDependencies": {
    2124        "@babel/core": "^7.1.0",
     25        "@babel/eslint-parser": "^7.23.3",
    2226        "@babel/plugin-transform-react-jsx": "^7.0.0",
    2327        "@babel/preset-env": "^7.1.0",
    24         "@wordpress/env": "^4.0",
    25         "@wordpress/eslint-plugin": "^9.0",
    26         "babel-eslint": "^10.0.1",
    27         "babel-loader": "^8.0.5",
    28         "eslint": "^7.13",
     28        "@wordpress/env": "^8.0",
     29        "@wordpress/eslint-plugin": "^17.0",
     30        "babel-loader": "^9.1.3",
     31        "eslint": "^8.53",
    2932        "gulp": "^4.0.0",
    30         "gulp-autoprefixer": "^7.0.0",
     33        "gulp-autoprefixer": "^8.0.0",
    3134        "gulp-eslint": "^6.0.0",
    3235        "gulp-load-plugins": "^2.0",
    33         "gulp-notify": "^3.2.0",
     36        "gulp-notify": "^4.0.0",
    3437        "gulp-plumber": "^1.2.0",
    35         "gulp-rename": "^1.4.0",
    36         "gulp-sass": "^4.0.2",
    37         "gulp-sass-glob": "^1.0.9",
     38        "gulp-rename": "^2.0.0",
     39        "gulp-sass": "^5.1.0",
    3840        "gulp-sourcemaps": "^3.0",
    3941        "gulp-stylelint": "^13.0.0",
     42        "sass": "1.69.5",
    4043        "stylelint": "^13.13.1",
    4144        "stylelint-config-wordpress": "^17.0.0",
    4245        "vinyl-named": "^1.1.0",
    4346        "webpack": "^5.3",
    44         "webpack-stream": "^6.1"
    45     },
    46     "dependencies": {}
     47        "webpack-stream": "^7.0"
     48    }
    4749}
  • taro-taxonomy-blocks/tags/1.2.0/readme.txt

    r2667262 r2999435  
    33Tags: gutenberg, block editor, iframe 
    44Contributors: tarosky, Takahashi_Fumiki 
    5 Tested up to: 5.8 
    6 Requires at least: 5.4 
    7 Requires PHP: 5.6 
    8 Stable Tag: 1.1.2
     5Tested up to: 6.4 
     6Requires at least: 5.9 
     7Requires PHP: 7.2 
     8Stable Tag: 1.2.0
    99License: GPLv3 or later 
    1010License URI: http://www.gnu.org/licenses/gpl-3.0.txt
     
    7171== Changelog ==
    7272
     73= 1.2.0 =
     74
     75* Drop support under PHP 7.2
     76* Add support for advanced class setting in the editor.
     77
    7378= 1.1.2 =
    7479
  • taro-taxonomy-blocks/tags/1.2.0/taro-taxonomy-blocks.php

    r2667262 r2999435  
    55Description: Add 3 taxonomy blockshh for block editor.
    66Author: Tarosky INC.
    7 Version: 1.1.2
     7Version: 1.2.0
    88Author URI: https://tarosky.co.jp/
    99License: GPL3 or later
     
    9090function taro_taxonomy_terms_blocks_option( $target = '' ) {
    9191    $args = [
    92         'taxonomy' => [
     92        'taxonomy'  => [
     93            'type'    => 'string',
     94            'default' => '',
     95        ],
     96        'className' => [
    9397            'type'    => 'string',
    9498            'default' => '',
     
    223227    if ( $taxonomy->hierarchical ) {
    224228        taro_taxonomy_blocks_get_template_part( 'template-parts/taxonomy-blocks/term-list-hierarchical', $taxonomy->name, [
    225             'terms'  => $terms,
    226             'parent' => 0,
     229            'terms'     => $terms,
     230            'parent'    => 0,
     231            'className' => $attributes['className'],
    227232        ] );
    228233    } else {
    229234        taro_taxonomy_blocks_get_template_part( 'template-parts/taxonomy-blocks/term-list', $taxonomy->name, [
    230             'terms' => $terms,
     235            'terms'     => $terms,
     236            'className' => $attributes['className'],
    231237        ] );
    232238    }
  • taro-taxonomy-blocks/tags/1.2.0/template-parts/taxonomy-blocks/term-list-hierarchical.php

    r2605922 r2999435  
    44 *
    55 * @package taro-taxonomy-blocks
    6  * @var array{ parent: int, terms: WP_Term[] } $args
     6 * @var array{ parent: int, terms: WP_Term[], className: string } $args
    77 */
    88
     
    1818$list_classes   = [ 'taro-taxonomy-list', 'taro-taxonomy-list-hierarchical' ];
    1919$list_classes[] = $parent ? 'taro-taxonomy-list-child' : 'taro-taxonomy-list-parent';
     20if ( $args['className'] ) {
     21    $list_classes[] = $args['className'];
     22}
    2023?>
    2124
  • taro-taxonomy-blocks/tags/1.2.0/template-parts/taxonomy-blocks/term-list.php

    r2605922 r2999435  
    44 *
    55 * @package taro-taxonomy-blocks
    6  * @var array{ terms: WP_Term[] } $args
     6 * @var array{ terms: WP_Term[], className: string } $args
    77 */
    88
    99?>
    1010
    11 <ul class="taro-taxonomy-list">
     11<ul class="taro-taxonomy-list<?php echo $args['className'] ? esc_attr( ' ' . $args['className'] ) : ''; ?>">
    1212    <?php foreach ( $args['terms'] as $term ) : ?>
    1313    <li class="taro-taxonomy-item taro-taxonomy-item" data-taxonomy="<?php echo esc_attr( $term->taxonomy ); ?>">
  • taro-taxonomy-blocks/trunk/assets/js/block-posts-terms-query.js

    r2657652 r2999435  
    4747                            help={ __( 'Enter post types in csv format. "any" is also available. If empty, current post type will be used.', 'taro-taxonomy-blocks' ) }
    4848                        />
    49                         <TaxonomySelector value={ attributes.taxonomy } onChange={ taxonomy => setAttributes( { taxonomy } ) } />
     49                        <TaxonomySelector value={ attributes.taxonomy } onChange={ ( taxonomy ) => setAttributes( { taxonomy } ) } />
    5050                        <TextControl value={ attributes.terms } label={ __( 'Term Slugs', 'label' ) }
    5151                            help={ __( 'Enter term slugs in CSV format. Default value is post\'s terms', 'taro-taxonomy-blocks' ) }
    5252                            placeholder={ __( 'Post\'s terms.', 'taro-taxonomy-blocks' ) }
    53                             onChange={ ( terms ) => setAttributes( { terms } ) }/>
     53                            onChange={ ( terms ) => setAttributes( { terms } ) } />
    5454                        <TextControl label={ __( 'Number of Posts', 'taro-taxonomy-blocks' ) } type="number" min={ -1 }
    5555                            value={ attributes.limit }
     
    6363
    6464                { ( ! attributes.taxonomy ) ? (
    65                     <div style={ { margin: "40px 0" } }>
     65                    <div style={ { margin: '40px 0' } }>
    6666                        <p>{ __( 'No taxonomy set. Please choose one.', 'taro-taxonomy-' ) }</p>
    67                         <TaxonomySelector value={ attributes.taxonomy } onChange={ taxonomy => setAttributes( { taxonomy } ) } />
     67                        <TaxonomySelector value={ attributes.taxonomy } onChange={ ( taxonomy ) => setAttributes( { taxonomy } ) } />
    6868                    </div>
    6969                ) : (
  • taro-taxonomy-blocks/trunk/assets/js/block-posts-terms.js

    r2605922 r2999435  
    3939                <InspectorControls>
    4040                    <PanelBody defaultOpen={ true } title={ __( 'Taxonomy Setting', 'taro-taxonomy-blocks' ) } >
    41                         <TaxonomySelector value={ attributes.taxonomy } onChange={ taxonomy => setAttributes( { taxonomy } ) } />
     41                        <TaxonomySelector value={ attributes.taxonomy } onChange={ ( taxonomy ) => setAttributes( { taxonomy } ) } />
    4242                    </PanelBody>
    4343                </InspectorControls>
    4444
    4545                { ( ! attributes.taxonomy ) ? (
    46                     <div style={ { margin: "40px 0" } }>
     46                    <div style={ { margin: '40px 0' } }>
    4747                        <p>{ __( 'No taxonomy set. Please choose one.', 'taro-taxonomy-' ) }</p>
    48                         <TaxonomySelector value={ attributes.taxonomy } onChange={ taxonomy => setAttributes( { taxonomy } ) } />
     48                        <TaxonomySelector value={ attributes.taxonomy } onChange={ ( taxonomy ) => setAttributes( { taxonomy } ) } />
    4949                    </div>
    5050                ) : (
  • taro-taxonomy-blocks/trunk/assets/js/block-terms.js

    r2605922 r2999435  
    3737                <InspectorControls>
    3838                    <PanelBody defaultOpen={ true } title={ __( 'Taxonomy Setting', 'taro-taxonomy-blocks' ) } >
    39                         <TaxonomySelector value={ attributes.taxonomy } onChange={ taxonomy => setAttributes( { taxonomy } ) } />
     39                        <TaxonomySelector value={ attributes.taxonomy } onChange={ ( taxonomy ) => setAttributes( { taxonomy } ) } />
    4040                        <ToggleControl checked={ attributes.hide_empty } label={ __( 'Hide Empty', 'taro-taxonomy-blocks' ) } onChange={ ( hideEmpty ) => setAttributes( { hide_empty: hideEmpty } ) } />
    4141                        <hr />
    4242                        <OrderBySelector value={ attributes.orderby } onChange={ ( orderby ) => setAttributes( { orderby } ) } />
    43                         <TextControl label={ __( 'Custom Field(optional)', 'taro-taxonomy-blocks' ) } value={ attributes.meta } onChange={ meta => setAttributes( { meta } ) } />
     43                        <TextControl label={ __( 'Custom Field(optional)', 'taro-taxonomy-blocks' ) } value={ attributes.meta } onChange={ ( meta ) => setAttributes( { meta } ) } />
    4444                        <OrderSelector value={ attributes.order } onChange={ ( order ) => setAttributes( { order } ) } />
    4545                    </PanelBody>
    4646                </InspectorControls>
    4747
    48                     { ( ! attributes.taxonomy ) ? (
    49                         <div style={ { margin: "40px 0" } }>
    50                             <p>{ __( 'No taxonomy set. Please choose one.', 'taro-taxonomy-' ) }</p>
    51                             <TaxonomySelector value={ attributes.taxonomy } onChange={ taxonomy => setAttributes( { taxonomy } ) } />
    52                         </div>
    53                     ) : (
    54                         <div className="taro-taxonomy-blocks-editor">
    55                             <ServerSideRender block="taro/terms" attributes={ attributes } />
    56                         </div>
    57                     ) }
     48                { ( ! attributes.taxonomy ) ? (
     49                    <div style={ { margin: '40px 0' } }>
     50                        <p>{ __( 'No taxonomy set. Please choose one.', 'taro-taxonomy-' ) }</p>
     51                        <TaxonomySelector value={ attributes.taxonomy } onChange={ ( taxonomy ) => setAttributes( { taxonomy } ) } />
     52                    </div>
     53                ) : (
     54                    <div className="taro-taxonomy-blocks-editor">
     55                        <ServerSideRender block="taro/terms" attributes={ attributes } />
     56                    </div>
     57                ) }
    5858            </>
    5959        );
  • taro-taxonomy-blocks/trunk/assets/js/taxonomy-selector.js

    r2605922 r2999435  
    1212        label: __( 'Please Select', 'taro-taxonomy-blocks' ),
    1313        value: '',
    14     }
     14    },
    1515];
    1616
     
    2424const TaxonomySelector = ( { value, onChange } ) => {
    2525    return (
    26         <SelectControl label={ __( 'Taxonomy', 'taro-taxonomy-blocks' ) } options={ taxonomyOptions } value={ value } onChange={ taxonomy => onChange( taxonomy ) } />
     26        <SelectControl label={ __( 'Taxonomy', 'taro-taxonomy-blocks' ) } options={ taxonomyOptions } value={ value } onChange={ ( taxonomy ) => onChange( taxonomy ) } />
    2727    );
    2828};
     
    3030const OrderSelector = ( { value, onChange } ) => {
    3131    return (
    32         <SelectControl label={ __( 'Order', 'taro-taxonomy-blocks' ) } onChange={ order => onChange( order ) }
     32        <SelectControl label={ __( 'Order', 'taro-taxonomy-blocks' ) } onChange={ ( order ) => onChange( order ) }
    3333            value={ value }
    3434            options={ [
     
    4141                    value: 'DESC',
    4242                },
    43             ] }/>
     43            ] } />
    4444    );
    4545};
     
    4747const OrderBySelector = ( { value, onChange } ) => {
    4848    return (
    49         <SelectControl label={ __( 'Order By', 'taro-taxonomy-blocks' ) } onChange={ orderby => onChange( orderby ) }
     49        <SelectControl label={ __( 'Order By', 'taro-taxonomy-blocks' ) } onChange={ ( orderby ) => onChange( orderby ) }
    5050            value={ value }
    5151            options={ [
     
    7070const PostsOrderBySelector = ( { value, onChange } ) => {
    7171    return (
    72         <SelectControl label={ __( 'Order By', 'taro-taxonomy-blocks' ) } onChange={ orderby => onChange( orderby ) }
     72        <SelectControl label={ __( 'Order By', 'taro-taxonomy-blocks' ) } onChange={ ( orderby ) => onChange( orderby ) }
    7373            value={ value }
    7474            options={ [
  • taro-taxonomy-blocks/trunk/composer.json

    r2605922 r2999435  
    55    "license": "GPL-3.0-or-later",
    66    "scripts": {
    7         "test": [
    8             "phpcs --config-set installed_paths $(pwd)/vendor/wp-coding-standards/wpcs",
     7        "lint": [
    98            "phpcs --standard=phpcs.ruleset.xml $(find ./ -name '*.php')"
    109        ],
    1110        "fix": [
    12             "phpcs --config-set installed_paths $(pwd)/vendor/wp-coding-standards/wpcs",
    1311            "phpcbf --standard=phpcs.ruleset.xml $(find ./ -name '*.php')"
    1412        ]
     
    2119    ],
    2220    "require": {
    23         "php": "^5.6|^7.0"
     21        "php": ">=7.2"
    2422    },
    2523    "require-dev": {
    2624        "squizlabs/php_codesniffer": "^3.0",
    27         "wp-coding-standards/wpcs": "^2.0"
     25        "wp-coding-standards/wpcs": "^2.0",
     26        "phpcompatibility/php-compatibility": "^9.3",
     27        "dealerdirect/phpcodesniffer-composer-installer": "^1.0"
     28    },
     29    "config": {
     30        "allow-plugins": {
     31            "dealerdirect/phpcodesniffer-composer-installer": true
     32        }
    2833    }
    2934}
  • taro-taxonomy-blocks/trunk/dist/css/editor-block-terms.css

    r2605922 r2999435  
    11.taro-taxonomy-blocks-editor{position:relative}.taro-taxonomy-blocks-editor::after{content:"";display:block;position:absolute;top:0;left:0;right:0;bottom:0;z-index:10}
    2 
    32/*# sourceMappingURL=map/editor-block-terms.css.map */
  • taro-taxonomy-blocks/trunk/dist/css/map/editor-block-terms.css.map

    r2605922 r2999435  
    1 {"version":3,"sources":["editor-block-terms.scss"],"names":[],"mappings":"AAAA,6BAEC,iBAAkB,CAFnB,oCAKE,UAAW,CACX,aAAc,CACd,iBAAkB,CAClB,KAAM,CACN,MAAO,CACP,OAAQ,CACR,QAAS,CACT,UAAW","file":"../editor-block-terms.css","sourcesContent":[".taro-taxonomy-blocks-editor {\n\n\tposition: relative;\n\n\t&::after {\n\t\tcontent: \"\";\n\t\tdisplay: block;\n\t\tposition: absolute;\n\t\ttop: 0;\n\t\tleft: 0;\n\t\tright: 0;\n\t\tbottom: 0;\n\t\tz-index: 10;\n\t}\n}\n"]}
     1{"version":3,"sources":["editor-block-terms.scss"],"names":[],"mappings":"AAAA,6BAEC,iBAAA,CAEA,oCACC,UAAA,CACA,aAAA,CACA,iBAAA,CACA,KAAA,CACA,MAAA,CACA,OAAA,CACA,QAAA,CACA,UAAA","file":"../editor-block-terms.css","sourcesContent":[".taro-taxonomy-blocks-editor {\n\n\tposition: relative;\n\n\t&::after {\n\t\tcontent: \"\";\n\t\tdisplay: block;\n\t\tposition: absolute;\n\t\ttop: 0;\n\t\tleft: 0;\n\t\tright: 0;\n\t\tbottom: 0;\n\t\tz-index: 10;\n\t}\n}\n"]}
  • taro-taxonomy-blocks/trunk/dist/css/map/style-block-terms.css.map

    r2605922 r2999435  
    1 {"version":3,"sources":["style-block-terms.scss"],"names":[],"mappings":"AAEC,oBACC,SAAU,CACV,aAAc,CAEd,0BACC,aAAc,CADd,oDAIC,QAAS,CACT,oBAAqB,CALtB,mEAQE,eAAgB,CAChB,oBAMH,eAAgB,CAChB,oBAAqB,CACrB,kBAAmB,CAEnB,2BACC,aAAc,CACd,YAAa,CACb,yBAGA,eAAgB,CAChB,oBAAqB,CACrB,oBAAqB,CACrB,6BAA8B,CAC9B,iBAAkB,CAClB,+BAAgC,CANhC,+DAUC,sCAAyC,CACzC,2BAQF,SAAU,CACV,iBAAkB,CAClB,YAAa,CACb,cAAe,CACf,0BAGA,eAAgB,CAChB,YAAa,CACb,YAAa,CAEb,0CALD,0BAME,YAAa,CAKd,CAHA,0CARD,0BASE,aAAc,CAEf,CAED,0BACC,aAAc,CACd,sCAAyC,CACzC,YAAa,CACb,+BAAgC,CAJhC,iEAQC,sCAAyC,CACzC,2BAID,aAAc,CACd,eAAgB,CAChB,0BAGA,aAAc,CACd,eAAgB","file":"../style-block-terms.css","sourcesContent":[".taro-taxonomy {\n\n\t&-list {\n\t\tpadding: 0;\n\t\tmargin: 40px 0;\n\n\t\t&-child {\n\t\t\tmargin: 20px 0;\n\n\t\t\t& & {\n\t\t\t\tmargin: 0;\n\t\t\t\tdisplay: inline-block;\n\n\t\t\t\tli:first-child {\n\t\t\t\t\tmargin-left: 1em;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t&-item {\n\t\tlist-style: none;\n\t\tdisplay: inline-block;\n\t\tmargin: 0 1em 1em 0;\n\n\t\t&-parent {\n\t\t\tdisplay: block;\n\t\t\tmargin: 1em 0;\n\t\t}\n\n\t\t&-link {\n\t\t\tfont-size: .85em;\n\t\t\tdisplay: inline-block;\n\t\t\tpadding: 0.25em 0.5em;\n\t\t\tborder: 1px solid currentColor;\n\t\t\tborder-radius: 1em;\n\t\t\ttext-decoration: none !important;\n\n\t\t\t&:hover,\n\t\t\t&:active {\n\t\t\t\tbackground-color: rgba(255, 255, 255, .2);\n\t\t\t}\n\t\t}\n\t}\n}\n\n.taro-taxonomy-query {\n\n\t&-block {\n\t\tpadding: 0;\n\t\tmargin: 40px -10px;\n\t\tdisplay: flex;\n\t\tflex-wrap: wrap;\n\t}\n\n\t&-item {\n\t\tlist-style: none;\n\t\tflex: 0 1 33%;\n\t\tpadding: 10px;\n\n\t\t@media only screen and ( max-width: 767px ) {\n\t\t\tflex: 0 1 50%;\n\t\t}\n\t\t@media only screen and ( max-width: 420px ) {\n\t\t\tflex: 0 1 100%;\n\t\t}\n\t}\n\n\t&-link {\n\t\tdisplay: block;\n\t\tbackground-color: rgba(255, 255, 255, .4);\n\t\tpadding: 10px;\n\t\ttext-decoration: none !important;\n\n\t\t&:hover,\n\t\t&:active {\n\t\t\tbackground-color: rgba(255, 255, 255, .8);\n\t\t}\n\t}\n\n\t&-title {\n\t\tdisplay: block;\n\t\tfont-weight: 700;\n\t}\n\n\t&-date {\n\t\tdisplay: block;\n\t\tfont-size: 0.8em;\n\t}\n}\n"]}
     1{"version":3,"sources":["style-block-terms.scss"],"names":[],"mappings":"AAEC,oBACC,SAAA,CACA,aAAA,CAEA,0BACC,aAAA,CAEA,oDACC,QAAA,CACA,oBAAA,CAEA,mEACC,eAAA,CAMJ,oBACC,eAAA,CACA,oBAAA,CACA,kBAAA,CAEA,2BACC,aAAA,CACA,YAAA,CAGD,yBACC,eAAA,CACA,oBAAA,CACA,kBAAA,CACA,6BAAA,CACA,iBAAA,CACA,+BAAA,CAEA,+DAEC,qCAAA,CAQH,2BACC,SAAA,CACA,iBAAA,CACA,YAAA,CACA,cAAA,CAGD,0BACC,eAAA,CACA,YAAA,CACA,YAAA,CAEA,0CALD,0BAME,YAAA,CAAA,CAED,0CARD,0BASE,aAAA,CAAA,CAIF,0BACC,aAAA,CACA,qCAAA,CACA,YAAA,CACA,+BAAA,CAEA,iEAEC,qCAAA,CAIF,2BACC,aAAA,CACA,eAAA,CAGD,0BACC,aAAA,CACA,cAAA","file":"../style-block-terms.css","sourcesContent":[".taro-taxonomy {\n\n\t&-list {\n\t\tpadding: 0;\n\t\tmargin: 40px 0;\n\n\t\t&-child {\n\t\t\tmargin: 20px 0;\n\n\t\t\t& & {\n\t\t\t\tmargin: 0;\n\t\t\t\tdisplay: inline-block;\n\n\t\t\t\tli:first-child {\n\t\t\t\t\tmargin-left: 1em;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t&-item {\n\t\tlist-style: none;\n\t\tdisplay: inline-block;\n\t\tmargin: 0 1em 1em 0;\n\n\t\t&-parent {\n\t\t\tdisplay: block;\n\t\t\tmargin: 1em 0;\n\t\t}\n\n\t\t&-link {\n\t\t\tfont-size: .85em;\n\t\t\tdisplay: inline-block;\n\t\t\tpadding: 0.25em 0.5em;\n\t\t\tborder: 1px solid currentColor;\n\t\t\tborder-radius: 1em;\n\t\t\ttext-decoration: none !important;\n\n\t\t\t&:hover,\n\t\t\t&:active {\n\t\t\t\tbackground-color: rgba(255, 255, 255, .2);\n\t\t\t}\n\t\t}\n\t}\n}\n\n.taro-taxonomy-query {\n\n\t&-block {\n\t\tpadding: 0;\n\t\tmargin: 40px -10px;\n\t\tdisplay: flex;\n\t\tflex-wrap: wrap;\n\t}\n\n\t&-item {\n\t\tlist-style: none;\n\t\tflex: 0 1 33%;\n\t\tpadding: 10px;\n\n\t\t@media only screen and ( max-width: 767px ) {\n\t\t\tflex: 0 1 50%;\n\t\t}\n\t\t@media only screen and ( max-width: 420px ) {\n\t\t\tflex: 0 1 100%;\n\t\t}\n\t}\n\n\t&-link {\n\t\tdisplay: block;\n\t\tbackground-color: rgba(255, 255, 255, .4);\n\t\tpadding: 10px;\n\t\ttext-decoration: none !important;\n\n\t\t&:hover,\n\t\t&:active {\n\t\t\tbackground-color: rgba(255, 255, 255, .8);\n\t\t}\n\t}\n\n\t&-title {\n\t\tdisplay: block;\n\t\tfont-weight: 700;\n\t}\n\n\t&-date {\n\t\tdisplay: block;\n\t\tfont-size: 0.8em;\n\t}\n}\n"]}
  • taro-taxonomy-blocks/trunk/dist/css/style-block-terms.css

    r2605922 r2999435  
    1 .taro-taxonomy-list{padding:0;margin:40px 0}.taro-taxonomy-list-child{margin:20px 0}.taro-taxonomy-list-child .taro-taxonomy-list-child{margin:0;display:inline-block}.taro-taxonomy-list-child .taro-taxonomy-list-child li:first-child{margin-left:1em}.taro-taxonomy-item{list-style:none;display:inline-block;margin:0 1em 1em 0}.taro-taxonomy-item-parent{display:block;margin:1em 0}.taro-taxonomy-item-link{font-size:.85em;display:inline-block;padding:0.25em 0.5em;border:1px solid currentColor;border-radius:1em;text-decoration:none !important}.taro-taxonomy-item-link:hover,.taro-taxonomy-item-link:active{background-color:rgba(255,255,255,0.2)}.taro-taxonomy-query-block{padding:0;margin:40px -10px;display:flex;flex-wrap:wrap}.taro-taxonomy-query-item{list-style:none;flex:0 1 33%;padding:10px}@media only screen and (max-width: 767px){.taro-taxonomy-query-item{flex:0 1 50%}}@media only screen and (max-width: 420px){.taro-taxonomy-query-item{flex:0 1 100%}}.taro-taxonomy-query-link{display:block;background-color:rgba(255,255,255,0.4);padding:10px;text-decoration:none !important}.taro-taxonomy-query-link:hover,.taro-taxonomy-query-link:active{background-color:rgba(255,255,255,0.8)}.taro-taxonomy-query-title{display:block;font-weight:700}.taro-taxonomy-query-date{display:block;font-size:0.8em}
    2 
     1.taro-taxonomy-list{padding:0;margin:40px 0}.taro-taxonomy-list-child{margin:20px 0}.taro-taxonomy-list-child .taro-taxonomy-list-child{margin:0;display:inline-block}.taro-taxonomy-list-child .taro-taxonomy-list-child li:first-child{margin-left:1em}.taro-taxonomy-item{list-style:none;display:inline-block;margin:0 1em 1em 0}.taro-taxonomy-item-parent{display:block;margin:1em 0}.taro-taxonomy-item-link{font-size:.85em;display:inline-block;padding:.25em .5em;border:1px solid currentColor;border-radius:1em;text-decoration:none !important}.taro-taxonomy-item-link:hover,.taro-taxonomy-item-link:active{background-color:rgba(255,255,255,.2)}.taro-taxonomy-query-block{padding:0;margin:40px -10px;display:flex;flex-wrap:wrap}.taro-taxonomy-query-item{list-style:none;flex:0 1 33%;padding:10px}@media only screen and (max-width: 767px){.taro-taxonomy-query-item{flex:0 1 50%}}@media only screen and (max-width: 420px){.taro-taxonomy-query-item{flex:0 1 100%}}.taro-taxonomy-query-link{display:block;background-color:rgba(255,255,255,.4);padding:10px;text-decoration:none !important}.taro-taxonomy-query-link:hover,.taro-taxonomy-query-link:active{background-color:rgba(255,255,255,.8)}.taro-taxonomy-query-title{display:block;font-weight:700}.taro-taxonomy-query-date{display:block;font-size:.8em}
    32/*# sourceMappingURL=map/style-block-terms.css.map */
  • taro-taxonomy-blocks/trunk/dist/js/block-posts-terms-query.js

    r2657652 r2999435  
    11/*! License information can be found in block-posts-terms-query.js.LICENSE.txt */
    2 !function(){var e=wp.blocks.registerBlockType,t=wp.i18n,__=t.__,sprintf=t.sprintf,o=wp.data.select,a=wp.blockEditor.InspectorControls,r=wp.components,n=r.PanelBody,l=r.TextControl,s=wp.serverSideRender,c=wp.taro,m=c.TaxonomySelector,i=c.OrderSelector,u=c.PostsOrderBySelector;e("taro/post-terms-query",{title:__("Post Terms Query","taro-taxonomy-blocks"),icon:"tag",category:"widgets",example:{taxonomy:"category"},keywords:["term"],attributes:TaroPostTermsQueryBlockEditor.attributes,description:__("Display posts with same terms of this post in specified taxonomy.","taro-taxonomy-blocks"),edit:function(e){var t=e.attributes,r=e.setAttributes,c=sprintf(__("Default: %s","taro-taxonomy-blocks"),o("core/editor").getCurrentPostType());
     2!function(){const{registerBlockType:e}=wp.blocks,{__:__,sprintf:sprintf}=wp.i18n,{select:t}=wp.data,{InspectorControls:o}=wp.blockEditor,{PanelBody:a,TextControl:r}=wp.components,{serverSideRender:l}=wp,{TaxonomySelector:n,OrderSelector:s,PostsOrderBySelector:c}=wp.taro;e("taro/post-terms-query",{title:__("Post Terms Query","taro-taxonomy-blocks"),icon:"tag",category:"widgets",example:{taxonomy:"category"},keywords:["term"],attributes:TaroPostTermsQueryBlockEditor.attributes,description:__("Display posts with same terms of this post in specified taxonomy.","taro-taxonomy-blocks"),edit(e){let{attributes:m,setAttributes:y}=e;
    33// translators: %s is post type.
    4 return React.createElement(React.Fragment,null,React.createElement(a,null,React.createElement(n,{defaultOpen:!0,title:__("Taxonomy Setting","taro-taxonomy-blocks")},React.createElement(l,{label:__("Post Type","taro-taxonomy-blocks"),value:t.post_type,placeholder:c,onChange:function(e){return r({post_type:e})},help:__('Enter post types in csv format. "any" is also available. If empty, current post type will be used.',"taro-taxonomy-blocks")}),React.createElement(m,{value:t.taxonomy,onChange:function(e){return r({taxonomy:e})}}),React.createElement(l,{value:t.terms,label:__("Term Slugs","label"),help:__("Enter term slugs in CSV format. Default value is post's terms","taro-taxonomy-blocks"),placeholder:__("Post's terms.","taro-taxonomy-blocks"),onChange:function(e){return r({terms:e})}}),React.createElement(l,{label:__("Number of Posts","taro-taxonomy-blocks"),type:"number",min:-1,value:t.limit,placeholder:10,onChange:function(e){return r({limit:parseInt(e)})}}),React.createElement(u,{valu:t.orderby,onChange:function(e){return r({orderby:e})}}),React.createElement(i,{value:t.order,onChange:function(e){return r({order:e})}}))),t.taxonomy?React.createElement("div",{className:"taro-taxonomy-blocks-editor"},React.createElement(s,{block:"taro/post-terms-query",attributes:t})):React.createElement("div",{style:{margin:"40px 0"}},React.createElement("p",null,__("No taxonomy set. Please choose one.","taro-taxonomy-")),React.createElement(m,{value:t.taxonomy,onChange:function(e){return r({taxonomy:e})}})))},save:function(){return null}})}();
     4const i=sprintf(__("Default: %s","taro-taxonomy-blocks"),t("core/editor").getCurrentPostType());return React.createElement(React.Fragment,null,React.createElement(o,null,React.createElement(a,{defaultOpen:!0,title:__("Taxonomy Setting","taro-taxonomy-blocks")},React.createElement(r,{label:__("Post Type","taro-taxonomy-blocks"),value:m.post_type,placeholder:i,onChange:e=>y({post_type:e}),help:__('Enter post types in csv format. "any" is also available. If empty, current post type will be used.',"taro-taxonomy-blocks")}),React.createElement(n,{value:m.taxonomy,onChange:e=>y({taxonomy:e})}),React.createElement(r,{value:m.terms,label:__("Term Slugs","label"),help:__("Enter term slugs in CSV format. Default value is post's terms","taro-taxonomy-blocks"),placeholder:__("Post's terms.","taro-taxonomy-blocks"),onChange:e=>y({terms:e})}),React.createElement(r,{label:__("Number of Posts","taro-taxonomy-blocks"),type:"number",min:-1,value:m.limit,placeholder:10,onChange:e=>y({limit:parseInt(e)})}),React.createElement(c,{valu:m.orderby,onChange:e=>y({orderby:e})}),React.createElement(s,{value:m.order,onChange:e=>y({order:e})}))),m.taxonomy?React.createElement("div",{className:"taro-taxonomy-blocks-editor"},React.createElement(l,{block:"taro/post-terms-query",attributes:m})):React.createElement("div",{style:{margin:"40px 0"}},React.createElement("p",null,__("No taxonomy set. Please choose one.","taro-taxonomy-")),React.createElement(n,{value:m.taxonomy,onChange:e=>y({taxonomy:e})})))},save(){return null}})}();
  • taro-taxonomy-blocks/trunk/dist/js/block-posts-terms.js

    r2627101 r2999435  
    11/*! License information can be found in block-posts-terms.js.LICENSE.txt */
    2 !function(){var t=wp.blocks.registerBlockType,__=wp.i18n.__,e=wp.blockEditor.InspectorControls,o=wp.components.PanelBody,a=wp.serverSideRender,n=wp.taro.TaxonomySelector;t("taro/post-terms",{title:__("Post Terms","taro-taxonomy-blocks"),icon:"tag",category:"widgets",example:{taxonomy:"category"},keywords:["term"],attributes:TaroPostTermsBlockEditor.attributes,description:__("Display the list of terms assigned to this post in specified taxonomy.","taro-taxonomy-blocks"),edit:function(t){var r=t.attributes,c=t.setAttributes;return React.createElement(React.Fragment,null,React.createElement(e,null,React.createElement(o,{defaultOpen:!0,title:__("Taxonomy Setting","taro-taxonomy-blocks")},React.createElement(n,{value:r.taxonomy,onChange:function(t){return c({taxonomy:t})}}))),r.taxonomy?React.createElement("div",{className:"taro-taxonomy-blocks-editor"},React.createElement(a,{block:"taro/post-terms",attributes:r})):React.createElement("div",{style:{margin:"40px 0"}},React.createElement("p",null,__("No taxonomy set. Please choose one.","taro-taxonomy-")),React.createElement(n,{value:r.taxonomy,onChange:function(t){return c({taxonomy:t})}})))},save:function(){return null}})}();
     2!function(){const{registerBlockType:t}=wp.blocks,{__:__}=wp.i18n,{InspectorControls:e}=wp.blockEditor,{PanelBody:o}=wp.components,{serverSideRender:a}=wp,{TaxonomySelector:n}=wp.taro;t("taro/post-terms",{title:__("Post Terms","taro-taxonomy-blocks"),icon:"tag",category:"widgets",example:{taxonomy:"category"},keywords:["term"],attributes:TaroPostTermsBlockEditor.attributes,description:__("Display the list of terms assigned to this post in specified taxonomy.","taro-taxonomy-blocks"),edit(t){let{attributes:r,setAttributes:s}=t;return React.createElement(React.Fragment,null,React.createElement(e,null,React.createElement(o,{defaultOpen:!0,title:__("Taxonomy Setting","taro-taxonomy-blocks")},React.createElement(n,{value:r.taxonomy,onChange:t=>s({taxonomy:t})}))),r.taxonomy?React.createElement("div",{className:"taro-taxonomy-blocks-editor"},React.createElement(a,{block:"taro/post-terms",attributes:r})):React.createElement("div",{style:{margin:"40px 0"}},React.createElement("p",null,__("No taxonomy set. Please choose one.","taro-taxonomy-")),React.createElement(n,{value:r.taxonomy,onChange:t=>s({taxonomy:t})})))},save(){return null}})}();
  • taro-taxonomy-blocks/trunk/dist/js/block-terms.js

    r2627101 r2999435  
    11/*! License information can be found in block-terms.js.LICENSE.txt */
    2 !function(){var e=wp.blocks.registerBlockType,__=wp.i18n.__,t=wp.blockEditor.InspectorControls,o=wp.components,a=o.PanelBody,n=o.ToggleControl,r=o.TextControl,c=wp.serverSideRender,l=wp.taro,m=l.TaxonomySelector,i=l.OrderSelector,s=l.OrderBySelector;e("taro/terms",{title:__("Terms","taro-taxonomy-blocks"),icon:"tag",category:"widgets",example:{taxonomy:"category"},keywords:["term"],attributes:TaroTermsBlockEditor.attributes,description:__("Display terms list in specified taxonomy.","taro-taxonomy-blocks"),edit:function(e){var o=e.attributes,l=e.setAttributes;return React.createElement(React.Fragment,null,React.createElement(t,null,React.createElement(a,{defaultOpen:!0,title:__("Taxonomy Setting","taro-taxonomy-blocks")},React.createElement(m,{value:o.taxonomy,onChange:function(e){return l({taxonomy:e})}}),React.createElement(n,{checked:o.hide_empty,label:__("Hide Empty","taro-taxonomy-blocks"),onChange:function(e){return l({hide_empty:e})}}),React.createElement("hr",null),React.createElement(s,{value:o.orderby,onChange:function(e){return l({orderby:e})}}),React.createElement(r,{label:__("Custom Field(optional)","taro-taxonomy-blocks"),value:o.meta,onChange:function(e){return l({meta:e})}}),React.createElement(i,{value:o.order,onChange:function(e){return l({order:e})}}))),o.taxonomy?React.createElement("div",{className:"taro-taxonomy-blocks-editor"},React.createElement(c,{block:"taro/terms",attributes:o})):React.createElement("div",{style:{margin:"40px 0"}},React.createElement("p",null,__("No taxonomy set. Please choose one.","taro-taxonomy-")),React.createElement(m,{value:o.taxonomy,onChange:function(e){return l({taxonomy:e})}})))},save:function(){return null}})}();
     2!function(){const{registerBlockType:e}=wp.blocks,{__:__}=wp.i18n,{InspectorControls:t}=wp.blockEditor,{PanelBody:o,ToggleControl:a,TextControl:r}=wp.components,{serverSideRender:n}=wp,{TaxonomySelector:l,OrderSelector:c,OrderBySelector:m}=wp.taro;e("taro/terms",{title:__("Terms","taro-taxonomy-blocks"),icon:"tag",category:"widgets",example:{taxonomy:"category"},keywords:["term"],attributes:TaroTermsBlockEditor.attributes,description:__("Display terms list in specified taxonomy.","taro-taxonomy-blocks"),edit(e){let{attributes:s,setAttributes:i}=e;return React.createElement(React.Fragment,null,React.createElement(t,null,React.createElement(o,{defaultOpen:!0,title:__("Taxonomy Setting","taro-taxonomy-blocks")},React.createElement(l,{value:s.taxonomy,onChange:e=>i({taxonomy:e})}),React.createElement(a,{checked:s.hide_empty,label:__("Hide Empty","taro-taxonomy-blocks"),onChange:e=>i({hide_empty:e})}),React.createElement("hr",null),React.createElement(m,{value:s.orderby,onChange:e=>i({orderby:e})}),React.createElement(r,{label:__("Custom Field(optional)","taro-taxonomy-blocks"),value:s.meta,onChange:e=>i({meta:e})}),React.createElement(c,{value:s.order,onChange:e=>i({order:e})}))),s.taxonomy?React.createElement("div",{className:"taro-taxonomy-blocks-editor"},React.createElement(n,{block:"taro/terms",attributes:s})):React.createElement("div",{style:{margin:"40px 0"}},React.createElement("p",null,__("No taxonomy set. Please choose one.","taro-taxonomy-")),React.createElement(l,{value:s.taxonomy,onChange:e=>i({taxonomy:e})})))},save(){return null}})}();
  • taro-taxonomy-blocks/trunk/dist/js/taxonomy-selector.js

    r2627101 r2999435  
    11/*! License information can be found in taxonomy-selector.js.LICENSE.txt */
    2 !function(){var __=wp.i18n.__,o=wp.components.SelectControl,e=[{label:__("Please Select","taro-taxonomy-blocks"),value:""}];TaroTaxonomySelector.taxonomies.forEach((function(o){e.push({label:o.label,value:o.name})}));wp.taro||(wp.taro={}),wp.taro.TaxonomySelector=function(a){var t=a.value,n=a.onChange;return React.createElement(o,{label:__("Taxonomy","taro-taxonomy-blocks"),options:e,value:t,onChange:function(o){return n(o)}})},wp.taro.OrderSelector=function(e){var a=e.value,t=e.onChange;return React.createElement(o,{label:__("Order","taro-taxonomy-blocks"),onChange:function(o){return t(o)},value:a,options:[{label:__("Ascending","taro-taxonomy-blocks"),value:"ASC"},{label:__("Descending","taro-taxonomy-blocks"),value:"DESC"}]})},wp.taro.OrderBySelector=function(e){var a=e.value,t=e.onChange;return React.createElement(o,{label:__("Order By","taro-taxonomy-blocks"),onChange:function(o){return t(o)},value:a,options:[{label:__("Name","taro-taxonomy-blocks"),value:"name"},{label:__("Slug","taro-taxonomy-blocks"),value:"slug"},{label:__("Count","taro-taxonomy-blocks"),value:"count"}],help:__("To use custom fields for sort, enter the field name above.","taro-taxonomy-blocks")})},wp.taro.PostsOrderBySelector=function(e){var a=e.value,t=e.onChange;return React.createElement(o,{label:__("Order By","taro-taxonomy-blocks"),onChange:function(o){return t(o)},value:a,options:[{label:__("Date","taro-taxonomy-blocks"),value:"date"},{label:__("Random","taro-taxonomy-blocks"),value:"rand"},{label:__("Menu Order","taro-taxonomy-blocks"),value:"menu_order"}],help:__("To use custom fields for sort, enter the field name above.","taro-taxonomy-blocks")})}}();
     2!function(){const{__:__}=wp.i18n,{SelectControl:e}=wp.components,o=[{label:__("Please Select","taro-taxonomy-blocks"),value:""}];TaroTaxonomySelector.taxonomies.forEach((e=>{o.push({label:e.label,value:e.name})}));wp.taro||(wp.taro={}),wp.taro.TaxonomySelector=a=>{let{value:l,onChange:t}=a;return React.createElement(e,{label:__("Taxonomy","taro-taxonomy-blocks"),options:o,value:l,onChange:e=>t(e)})},wp.taro.OrderSelector=o=>{let{value:a,onChange:l}=o;return React.createElement(e,{label:__("Order","taro-taxonomy-blocks"),onChange:e=>l(e),value:a,options:[{label:__("Ascending","taro-taxonomy-blocks"),value:"ASC"},{label:__("Descending","taro-taxonomy-blocks"),value:"DESC"}]})},wp.taro.OrderBySelector=o=>{let{value:a,onChange:l}=o;return React.createElement(e,{label:__("Order By","taro-taxonomy-blocks"),onChange:e=>l(e),value:a,options:[{label:__("Name","taro-taxonomy-blocks"),value:"name"},{label:__("Slug","taro-taxonomy-blocks"),value:"slug"},{label:__("Count","taro-taxonomy-blocks"),value:"count"}],help:__("To use custom fields for sort, enter the field name above.","taro-taxonomy-blocks")})},wp.taro.PostsOrderBySelector=o=>{let{value:a,onChange:l}=o;return React.createElement(e,{label:__("Order By","taro-taxonomy-blocks"),onChange:e=>l(e),value:a,options:[{label:__("Date","taro-taxonomy-blocks"),value:"date"},{label:__("Random","taro-taxonomy-blocks"),value:"rand"},{label:__("Menu Order","taro-taxonomy-blocks"),value:"menu_order"}],help:__("To use custom fields for sort, enter the field name above.","taro-taxonomy-blocks")})}}();
  • taro-taxonomy-blocks/trunk/gulpfile.js

    r2605922 r2999435  
    11const gulp = require( 'gulp' );
    2 const fs = require( 'fs' );
    32const $ = require( 'gulp-load-plugins' )();
    43const webpack = require( 'webpack-stream' );
    54const webpackBundle = require( 'webpack' );
    65const named = require( 'vinyl-named' );
     6const sass = require( 'gulp-sass' )( require( 'sass' ) );
     7
    78
    89let plumber = true;
     
    1011// Sassのタスク
    1112gulp.task( 'sass', function () {
    12 
    1313    return gulp.src( [ './assets/scss/**/*.scss' ] )
    1414        .pipe( $.plumber( {
    1515            errorHandler: $.notify.onError( '<%= error.message %>' )
    1616        } ) )
    17         .pipe( $.sassGlob() )
    1817        .pipe( $.sourcemaps.init() )
    19         .pipe( $.sass( {
     18        .pipe( sass( {
    2019            errLogToConsole: true,
    2120            outputStyle: 'compressed',
     
    2423            includePaths: [
    2524                './assets/sass',
    26                 './vendor',
    27                 './node_modules/bootstrap-sass/assets/stylesheets',
    28                 './vendor/hametuha'
    29             ]
     25            ],
    3026        } ) )
    3127        .pipe( $.autoprefixer() )
  • taro-taxonomy-blocks/trunk/package.json

    r2605922 r2999435  
    1818    "author": "Hametuha inc.",
    1919    "license": "LGPL-3.0-or-later",
     20    "engines": {
     21        "node": ">=16.0.0"
     22    },
    2023    "devDependencies": {
    2124        "@babel/core": "^7.1.0",
     25        "@babel/eslint-parser": "^7.23.3",
    2226        "@babel/plugin-transform-react-jsx": "^7.0.0",
    2327        "@babel/preset-env": "^7.1.0",
    24         "@wordpress/env": "^4.0",
    25         "@wordpress/eslint-plugin": "^9.0",
    26         "babel-eslint": "^10.0.1",
    27         "babel-loader": "^8.0.5",
    28         "eslint": "^7.13",
     28        "@wordpress/env": "^8.0",
     29        "@wordpress/eslint-plugin": "^17.0",
     30        "babel-loader": "^9.1.3",
     31        "eslint": "^8.53",
    2932        "gulp": "^4.0.0",
    30         "gulp-autoprefixer": "^7.0.0",
     33        "gulp-autoprefixer": "^8.0.0",
    3134        "gulp-eslint": "^6.0.0",
    3235        "gulp-load-plugins": "^2.0",
    33         "gulp-notify": "^3.2.0",
     36        "gulp-notify": "^4.0.0",
    3437        "gulp-plumber": "^1.2.0",
    35         "gulp-rename": "^1.4.0",
    36         "gulp-sass": "^4.0.2",
    37         "gulp-sass-glob": "^1.0.9",
     38        "gulp-rename": "^2.0.0",
     39        "gulp-sass": "^5.1.0",
    3840        "gulp-sourcemaps": "^3.0",
    3941        "gulp-stylelint": "^13.0.0",
     42        "sass": "1.69.5",
    4043        "stylelint": "^13.13.1",
    4144        "stylelint-config-wordpress": "^17.0.0",
    4245        "vinyl-named": "^1.1.0",
    4346        "webpack": "^5.3",
    44         "webpack-stream": "^6.1"
    45     },
    46     "dependencies": {}
     47        "webpack-stream": "^7.0"
     48    }
    4749}
  • taro-taxonomy-blocks/trunk/readme.txt

    r2667262 r2999435  
    33Tags: gutenberg, block editor, iframe 
    44Contributors: tarosky, Takahashi_Fumiki 
    5 Tested up to: 5.8 
    6 Requires at least: 5.4 
    7 Requires PHP: 5.6 
    8 Stable Tag: 1.1.2
     5Tested up to: 6.4 
     6Requires at least: 5.9 
     7Requires PHP: 7.2 
     8Stable Tag: 1.2.0
    99License: GPLv3 or later 
    1010License URI: http://www.gnu.org/licenses/gpl-3.0.txt
     
    7171== Changelog ==
    7272
     73= 1.2.0 =
     74
     75* Drop support under PHP 7.2
     76* Add support for advanced class setting in the editor.
     77
    7378= 1.1.2 =
    7479
  • taro-taxonomy-blocks/trunk/taro-taxonomy-blocks.php

    r2667262 r2999435  
    55Description: Add 3 taxonomy blockshh for block editor.
    66Author: Tarosky INC.
    7 Version: 1.1.2
     7Version: 1.2.0
    88Author URI: https://tarosky.co.jp/
    99License: GPL3 or later
     
    9090function taro_taxonomy_terms_blocks_option( $target = '' ) {
    9191    $args = [
    92         'taxonomy' => [
     92        'taxonomy'  => [
     93            'type'    => 'string',
     94            'default' => '',
     95        ],
     96        'className' => [
    9397            'type'    => 'string',
    9498            'default' => '',
     
    223227    if ( $taxonomy->hierarchical ) {
    224228        taro_taxonomy_blocks_get_template_part( 'template-parts/taxonomy-blocks/term-list-hierarchical', $taxonomy->name, [
    225             'terms'  => $terms,
    226             'parent' => 0,
     229            'terms'     => $terms,
     230            'parent'    => 0,
     231            'className' => $attributes['className'],
    227232        ] );
    228233    } else {
    229234        taro_taxonomy_blocks_get_template_part( 'template-parts/taxonomy-blocks/term-list', $taxonomy->name, [
    230             'terms' => $terms,
     235            'terms'     => $terms,
     236            'className' => $attributes['className'],
    231237        ] );
    232238    }
  • taro-taxonomy-blocks/trunk/template-parts/taxonomy-blocks/term-list-hierarchical.php

    r2605922 r2999435  
    44 *
    55 * @package taro-taxonomy-blocks
    6  * @var array{ parent: int, terms: WP_Term[] } $args
     6 * @var array{ parent: int, terms: WP_Term[], className: string } $args
    77 */
    88
     
    1818$list_classes   = [ 'taro-taxonomy-list', 'taro-taxonomy-list-hierarchical' ];
    1919$list_classes[] = $parent ? 'taro-taxonomy-list-child' : 'taro-taxonomy-list-parent';
     20if ( $args['className'] ) {
     21    $list_classes[] = $args['className'];
     22}
    2023?>
    2124
  • taro-taxonomy-blocks/trunk/template-parts/taxonomy-blocks/term-list.php

    r2605922 r2999435  
    44 *
    55 * @package taro-taxonomy-blocks
    6  * @var array{ terms: WP_Term[] } $args
     6 * @var array{ terms: WP_Term[], className: string } $args
    77 */
    88
    99?>
    1010
    11 <ul class="taro-taxonomy-list">
     11<ul class="taro-taxonomy-list<?php echo $args['className'] ? esc_attr( ' ' . $args['className'] ) : ''; ?>">
    1212    <?php foreach ( $args['terms'] as $term ) : ?>
    1313    <li class="taro-taxonomy-item taro-taxonomy-item" data-taxonomy="<?php echo esc_attr( $term->taxonomy ); ?>">
Note: See TracChangeset for help on using the changeset viewer.