Plugin Directory

Changeset 1938060


Ignore:
Timestamp:
09/08/2018 11:07:44 PM (8 years ago)
Author:
davidsword
Message:

version 1.0.6 release

Location:
sword-layouts
Files:
5 edited
7 copied

Legend:

Unmodified
Added
Removed
  • sword-layouts/tags/1.0.6/dist/blocks.build.js

    r1902899 r1938060  
    1 !function(e){function t(a){if(n[a])return n[a].exports;var l=n[a]={i:a,l:!1,exports:{}};return e[a].call(l.exports,l,l.exports,t),l.l=!0,l.exports}var n={};t.m=e,t.c=n,t.d=function(e,n,a){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:a})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=0)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});n(1)},function(e,t,n){"use strict";var a=n(2),l=(n.n(a),n(3)),r=(n.n(l),wp.i18n.__),i=wp.editor,o=i.InspectorControls,m=i.MediaUpload,c=i.BlockControls,s=i.AlignmentToolbar,u=i.RichText,g=wp.blocks.registerBlockType,d=wp.components,p=d.Button,b=d.Dashicon,f=d.PanelBody,v=d.PanelRow,w=d.FormToggle;g("swrdlyts/tile",{title:r("Tile Layout"),description:r("Creates two columns, half image, half padded text. Use multiple, invert to tile."),icon:"shield",category:"layout",keywords:[r("tile"),r("stagger"),r("image")],attributes:{imgURL:{type:"string",source:"attribute",selector:".imageBox",attribute:"data-imgurl",default:""},imgID:{type:"number",default:""},content:{type:"array",source:"children",selector:".textBoxContent",default:""},invert:{type:"boolean",default:!1},alignment:{type:"string"}},getEditWrapperProps:function(e){return{"data-align":"full","data-move-toolbar-right":e.invert?"false":"true"}},edit:function(e){var t=e.attributes,n=e.setAttributes,a=e.className,l=e.isSelected,i=function(e){n({content:e})},g=function(){n({invert:!t.invert})},d=function(e){n({imgID:e.id,imgURL:e.url})},y=function(e){n({alignment:e})},x=t.imgID?"Change Image":"Select Image",E=t.imgID?"edit":"add";return[!!l&&wp.element.createElement(o,{key:"inspector"},wp.element.createElement(f,null,wp.element.createElement(v,null,wp.element.createElement("label",{htmlFor:"invert-form-toggle",className:"blocks-base-control__label"},r("Invert Layout")),wp.element.createElement(w,{id:"invert-form-toggle",label:r("Invert Layout"),checked:!!t.invert,onChange:g})))),wp.element.createElement("div",{className:a,"data-invert":t.invert?"true":"false","data-align":"full"},wp.element.createElement("div",{className:"imageBox",style:{backgroundImage:"url("+t.imgURL+")"},"data-imgurl":t.imgURL,"data-imgid":t.imgID,"data-hasimg":t.imgID?"true":"false"},l?wp.element.createElement(m,{buttonProps:{className:"components-button button button-large"},onSelect:d,type:"image",value:t.imgID,render:function(e){var t=e.open;return wp.element.createElement(p,{isLarge:!0,onClick:t,className:"components-button components-icon-button button button-large wp-block-image__upload-button"},wp.element.createElement(b,{icon:E}),x)}}):null),wp.element.createElement("div",{className:"textBox"},!!l&&wp.element.createElement(c,{key:"controls"},wp.element.createElement(s,{value:t.alignment,onChange:y})),wp.element.createElement(u,{tagname:"div",multiline:"p",className:"textBoxContent",placeholder:"....",style:{textAlign:t.alignment},value:t.content,onChange:i,isSelected:l})))]},save:function(e){return wp.element.createElement("div",{className:e.className,"data-invert":e.attributes.invert},wp.element.createElement("div",{className:"imageBox","data-imgurl":e.attributes.imgURL,"data-imgid":e.attributes.imgID,style:{backgroundImage:"url("+e.attributes.imgURL+")"}}),wp.element.createElement("div",{className:"textBox"},wp.element.createElement("div",{className:"textBoxContent",style:{textAlign:e.attributes.alignment}},e.attributes.content)))}})},function(e,t){},function(e,t){}]);
     1!function(e){function t(a){if(n[a])return n[a].exports;var l=n[a]={i:a,l:!1,exports:{}};return e[a].call(l.exports,l,l.exports,t),l.l=!0,l.exports}var n={};t.m=e,t.c=n,t.d=function(e,n,a){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:a})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=0)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});n(1)},function(e,t,n){"use strict";var a=n(2),l=(n.n(a),n(3)),r=(n.n(l),n(4)),o=n(5),i=n.n(o),u=wp.i18n.__,c=wp.editor,d=c.AlignmentToolbar,m=c.BlockControls,s=c.InspectorControls,g=c.MediaUpload,p=c.MediaPlaceholder,f=c.RichText,w=c.ColorPalette,v=c.getColorClassName,b=wp.blocks.registerBlockType,x=wp.components,C=x.ToggleControl,h=x.RangeControl,y=x.IconButton,E=x.PanelBody,B=x.PanelColor,L=x.Toolbar;b("swrdlyts/tile",{title:u("Tile Layout"),description:u("Creates two columns, half image, half padded text. Use multiple, invert to tile."),icon:r.a,category:"layout",keywords:[u("tile"),u("stagger"),u("image")],attributes:{imgURL:{type:"string",source:"attribute",selector:".imageBox",attribute:"data-imgurl",default:""},imgID:{type:"number",default:""},content:{type:"array",source:"children",selector:".textBoxContent",default:""},invert:{type:"boolean",default:!1},backgroundColor:{type:"string",default:"rgba(0,0,0,0)"},textColor:{type:"string",default:""},paddingTB:{type:"string",default:"65"},width:{type:"string",default:"80"},alignment:{type:"string"}},getEditWrapperProps:function(e){return{"data-align":"full","data-move-toolbar-right":e.invert?"false":"true"}},edit:function(e){var t=e.attributes,n=e.setAttributes,a=e.className,l=e.isSelected,r=function(e){n({content:e})},o=function(){n({invert:!t.invert})},c=function(e){n({imgID:e.id,imgURL:e.url})},b=function(e){n({alignment:e})},x=t.imgID?"Change Image":"Select Image",k=t.imgID?"edit":"add",T=v("color",t.textColor);return[!!l&&wp.element.createElement(s,{key:"inspector"},wp.element.createElement(E,null,wp.element.createElement(C,{id:"invert-form-toggle",label:u("Invert Layout"),checked:!!t.invert,onChange:o}),wp.element.createElement(h,{label:u("Padding: Top Bottom"),value:t.paddingTB,onChange:function(e){return n({paddingTB:e})},min:20,max:150,step:5}),wp.element.createElement(h,{label:u("Width Text Content"),value:t.width,onChange:function(e){return n({width:e})},min:50,max:90,step:2}),wp.element.createElement(B,{title:u("Background Color"),colorValue:t.backgroundColor},wp.element.createElement(w,{label:u("Background Color"),value:t.backgroundColor,onChange:function(e){n({backgroundColor:e})}})),wp.element.createElement(B,{title:u("Text Color"),colorValue:t.textColor},wp.element.createElement(w,{label:u("Text Color"),value:t.textColor,onChange:function(e){n({textColor:e})}})))),wp.element.createElement("div",{className:i()("alignfull",a),"data-invert":t.invert?"true":"false","data-align":"full","data-paddingTB":t.paddingTB,"data-width":t.width,style:{backgroundColor:t.backgroundColor}},wp.element.createElement("div",{className:"imageBox",style:{backgroundImage:"url("+t.imgURL+")"},"data-imgurl":t.imgURL,"data-imgid":t.imgID,"data-hasimg":t.imgID?"true":"false"},!t.imgID&&wp.element.createElement(p,{icon:"format-gallery",className:a,labels:{title:u("Tile Image"),name:u("")},onSelect:c,accept:"image/*",type:"image"})),wp.element.createElement("div",{className:"textBox"},!!l&&wp.element.createElement(m,{key:"controls"},wp.element.createElement(d,{value:t.alignment,onChange:b}),wp.element.createElement(L,null,t.imgID&&wp.element.createElement(g,{onSelect:c,type:"image",value:t.imgID,render:function(e){var t=e.open;return wp.element.createElement(y,{label:x,icon:k,onClick:t})}}))),wp.element.createElement(f,{tagname:"div",multiline:"p",placeholder:"....",className:i()("textBoxContent",T),style:{textAlign:t.alignment,color:t.textColor,padding:t.paddingTB+"px 0",width:t.width+"%"},value:t.content,onChange:r,isSelected:l})))]},save:function(e){var t=v("color",e.attributes.textColor);return wp.element.createElement("div",{className:e.className,"data-invert":e.attributes.invert,"data-align":"full","data-paddingTB":e.attributes.paddingTB,"data-width":e.attributes.width,style:{backgroundColor:e.attributes.backgroundColor}},wp.element.createElement("div",{className:"imageBox","data-imgurl":e.attributes.imgURL,"data-imgid":e.attributes.imgID,style:{backgroundImage:"url("+e.attributes.imgURL+")"}}),wp.element.createElement("div",{className:"textBox"},wp.element.createElement("div",{className:i()("textBoxContent",t),style:{textAlign:e.attributes.alignment,color:e.attributes.textColor,padding:e.attributes.paddingTB+"px 0",width:e.attributes.width+"%"}},e.attributes.content)))}})},function(e,t){},function(e,t){},function(e,t,n){"use strict";var a=wp.element.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20px",height:"20px",viewBox:"0 0 512 512"}," ",wp.element.createElement("path",{fillRule:"evenodd",d:"M256.000,512.000 L256.000,256.000 L512.000,256.000 L512.000,512.000 L256.000,512.000 ZM0.000,0.000 L256.000,0.000 L256.000,256.000 L0.000,256.000 L0.000,0.000 ZM337.000,99.000 L502.000,99.000 L502.000,158.000 L337.000,158.000 L337.000,99.000 ZM175.000,414.000 L10.000,414.000 L10.000,355.000 L175.000,355.000 L175.000,414.000 Z"})," ");t.a=a},function(e,t,n){var a,l;!function(){"use strict";function n(){for(var e=[],t=0;t<arguments.length;t++){var a=arguments[t];if(a){var l=typeof a;if("string"===l||"number"===l)e.push(a);else if(Array.isArray(a)&&a.length){var o=n.apply(null,a);o&&e.push(o)}else if("object"===l)for(var i in a)r.call(a,i)&&a[i]&&e.push(i)}}return e.join(" ")}var r={}.hasOwnProperty;"undefined"!==typeof e&&e.exports?(n.default=n,e.exports=n):(a=[],void 0!==(l=function(){return n}.apply(t,a))&&(e.exports=l))}()}]);
  • sword-layouts/tags/1.0.6/dist/blocks.editor.build.css

    r1877134 r1938060  
    1 [data-move-toolbar-right=true] .editor-block-contextual-toolbar .editor-block-toolbar{left:auto;right:0}.wp-block-swrdlyts-tile>div.imageBox button{top:50%;margin-top:-17px;display:inline-block;opacity:1;-webkit-transition:1s all ease;-o-transition:1s all ease;transition:1s all ease}.wp-block-swrdlyts-tile>div.imageBox[data-hasimg=true] button{z-index:3;position:relative;opacity:0}.wp-block-swrdlyts-tile>div.imageBox[data-hasimg=true]:before{-webkit-transition:0.5s all ease;-o-transition:0.5s all ease;transition:0.5s all ease;content:"";display:block;position:absolute;width:100%;height:100%;left:0;top:0;z-index:1;background:rgba(0,0,0,0)}.is-selected .wp-block-swrdlyts-tile>div.imageBox[data-hasimg=true]:hover:before{background:rgba(111,111,111,0.7)}.is-selected .wp-block-swrdlyts-tile>div.imageBox[data-hasimg=true]:hover button{-webkit-filter:blur(0px);filter:blur(0px);opacity:1}
     1[data-move-toolbar-right=true] .editor-block-contextual-toolbar .editor-block-toolbar{border-left:none;-ms-flex-pack:end;justify-content:flex-end}.wp-block-swrdlyts-tile>div.imageBox:after,.wp-block-swrdlyts-tile>div.imageBox[data-hasimg=true]:after{background:rgba(0,0,0,0);content:"";display:block;height:100%;left:0;position:absolute;top:0;-webkit-transition:0.5s all ease;-o-transition:0.5s all ease;transition:0.5s all ease;width:100%;z-index:1}
  • sword-layouts/tags/1.0.6/dist/blocks.style.build.css

    r1877134 r1938060  
    1 .wp-block-swrdlyts-tile{display:-ms-flexbox;display:flex;max-width:100%}.wp-block-swrdlyts-tile>div{-ms-flex:1;flex:1}.wp-block-swrdlyts-tile>div.imageBox{max-width:100%;background-color:#eee;background-size:cover;background-repeat:no-repeat;background-position:center;text-align:center;position:relative;min-height:30vh}.wp-block-swrdlyts-tile>div.imageBox *{z-index:2}.wp-block-swrdlyts-tile>div.textBox{margin:15vh 0}.wp-block-swrdlyts-tile>div.textBox .textBoxContent{width:70%;max-width:400px;margin-left:auto;margin-right:auto}@media screen and (min-width: 800px){.wp-block-swrdlyts-tile[data-invert=true]{-ms-flex-direction:row-reverse;flex-direction:row-reverse}}@media screen and (max-width: 800px){.wp-block-swrdlyts-tile{-ms-flex-direction:column;flex-direction:column}.wp-block-swrdlyts-tile>div.imageBox{min-height:50vh}}@media screen and (max-width: 500px){.wp-block-swrdlyts-tile>div.imageBox{min-height:50vh}.wp-block-swrdlyts-tile>div.textBox{margin:10vh 0}.wp-block-swrdlyts-tile>div.textBox .textBoxContent{width:80%}}
     1.wp-block-swrdlyts-tile,.wp-block-swrdlyts-tile.alignfull{display:-ms-flexbox;display:flex;margin:0 auto !important;max-width:100% !important;width:100% !important}.wp-block-swrdlyts-tile>div,.wp-block-swrdlyts-tile.alignfull>div{-ms-flex:1;flex:1}.wp-block-swrdlyts-tile>.imageBox,.wp-block-swrdlyts-tile.alignfull>.imageBox{background-color:#eee;background-position:center;background-repeat:no-repeat;background-size:cover;position:relative;text-align:center}.wp-block-swrdlyts-tile>.imageBox *,.wp-block-swrdlyts-tile.alignfull>.imageBox *{z-index:2}.wp-block-swrdlyts-tile>.imageBox:before,.wp-block-swrdlyts-tile.alignfull>.imageBox:before{content:"";display:block;left:0;padding-bottom:100%;top:0;z-index:1}.wp-block-swrdlyts-tile>.textBox,.wp-block-swrdlyts-tile.alignfull>.textBox{-ms-flex-item-align:center;align-self:center;margin:0 auto}.wp-block-swrdlyts-tile>.textBox .textBoxContent,.wp-block-swrdlyts-tile.alignfull>.textBox .textBoxContent{margin-left:auto;margin-right:auto;width:70%}.wp-block-swrdlyts-tile>.textBox p,.wp-block-swrdlyts-tile.alignfull>.textBox p{color:inherit !important}@media screen and (min-width: 800px){.wp-block-swrdlyts-tile[data-invert=true]{-ms-flex-direction:row-reverse;flex-direction:row-reverse}}@media screen and (max-width: 800px){.wp-block-swrdlyts-tile{-ms-flex-direction:column;flex-direction:column}}@media screen and (max-width: 500px){.wp-block-swrdlyts-tile>div.textBox{margin:10vh 0}.wp-block-swrdlyts-tile>div.textBox .textBoxContent{width:80%}}
  • sword-layouts/tags/1.0.6/readme.txt

    r1902899 r1938060  
    1 === Sword Layouts ===
     1=== Gutenberg Tile Block ===
    22Contributors:      davidsword
    33Donate link:       https://davidsword.ca/🍺/
    44Tags:              Gutenberg, Blocks, Layouts, Modern, Page Builder, Design
    5 Requires at least: 4.9.4
    6 Tested up to:      4.9.4
    7 Stable tag:        1.0.4
     5Requires at least: 4.9.5
     6Tested up to:      4.9.8
     7Stable tag:        1.0.6
    88Requires PHP:      5.6.0
    99
    10 Layout blocks for Gutenberg that help create more interesting and modern WordPress pages.
     10Tile block for Gutenberg that help create more interesting and modern WordPress pages.
    1111
    1212== Description ==
     
    1414Layout blocks for **[Gutenberg](https://wordpress.org/plugins/gutenberg/)** that create more interesting and modern page designs.
    1515
    16 = Current Layouts =
    17 
    18  - **TILE** (see screenshots)
    19      * Stagger small blurbs of text along side beautiful images
    20      * Creates a "magazine" style to your webpage
    21      * Fully responsive
    22 
    23  - 🚧 _..more on the way - this project is in a work in progress!_
     16* Stagger small blurbs of text along side beautiful images
     17* Creates a "magazine" style to your webpage
     18* Fully responsive
    2419
    2520= Please Note =
    2621
    2722* 🚀 This is a beta plugin for the beta plugin [Gutenberg](https://wordpress.org/plugins/gutenberg/) - things will be rocky.
     23* 🚧 This is a WIP, more layouts will be added and the plugin name will change to "Sword Layouts"
    2824* ⚠️ Please [open a support request](https://wordpress.org/support/plugin/sword-layouts) [or add as an issue on Github](https://github.com/davidsword/sword-layouts/issues) before summiting a negative review, *I'm happy to help,* please provide as much information as possible (screen recordings, WordPress and PHP versions, able-to-replicate instructions).
    2925
     
    7066
    7167== Changelog ==
     68
     69= 1.0.6 =
     70* Sep 8, 2018
     71* Changed icon to a new custom one
     72* Added spacing padding settings
     73* fixed alignment of toolbar, above text regardless of invert
     74* changed use of button to buttonIcon
     75* changed custom upload button to Placeholder component
     76* added text and background colors
     77* added padding and width range controls
     78* removed dashicons
     79
     80= 1.0.5 =
     81* Aug 14, 2018
     82* Updated for Gutenberg 3.5
     83* Renamed plugin for easier search keywords
    7284
    7385= 1.0.4 =
  • sword-layouts/tags/1.0.6/sword-layouts.php

    r1902899 r1938060  
    11<?php
    22/**
    3 * Plugin Name: Gutenberg - Sword Layouts
    4 * Plugin URI: https://github.com/davidsword/sword-layouts
    5 * Description: Some Gutenberg blocks that add modern layouts
    6 * Author: davidsword
    7 * Author URI: https://davidsword.ca/
    8 * Version: 1.0.4
    9 * License: GPL3
    10 * License URI: https://raw.githubusercontent.com/davidsword/sword-layouts/master/LICENSE
    11 */
     3 * Plugin Name: Gutenberg Tile Block
     4 * Plugin URI: https://github.com/davidsword/sword-layouts
     5 * Description: Tile blocks for Gutenberg
     6 * Author: davidsword
     7 * Author URI: https://davidsword.ca/
     8 * Version: 1.0.6
     9 * License: GPL3
     10 * License URI: https://raw.githubusercontent.com/davidsword/sword-layouts/master/LICENSE
     11 *
     12 * @package sword-layouts
     13 */
    1214
    1315defined( 'ABSPATH' ) || exit;
    1416
    15 add_action( 'enqueue_block_assets', 'sword_layouts_block_assets' );
    16 add_action( 'enqueue_block_editor_assets', 'sword_layouts_editor_assets' );
    17 
     17/**
     18 * Load in the Editor assets for the FRONT and BACKEND
     19 */
    1820function sword_layouts_block_assets() {
    1921    wp_enqueue_style(
    2022        'swrdlyts-style-css',
    21         plugins_url( 'dist/blocks.style.build.css',  __FILE__ ),
     23        plugins_url( 'dist/blocks.style.build.css', __FILE__ ),
    2224        array( 'wp-blocks' ),
    23         filemtime( plugin_dir_path( __FILE__ ) . 'dist/blocks.style.build.css' )
     25        sword_layouts_version()
    2426    );
     27    return true;
    2528}
     29add_action( 'enqueue_block_assets', 'sword_layouts_block_assets' );
    2630
     31/**
     32 * Load in the Editor assets for the BACKEND only
     33 */
    2734function sword_layouts_editor_assets() {
    2835    wp_enqueue_script(
     
    3037        plugins_url( '/dist/blocks.build.js', __FILE__ ),
    3138        array( 'wp-blocks', 'wp-i18n', 'wp-element' ),
    32         filemtime( plugin_dir_path( __FILE__ ) . '/dist/blocks.build.js' )
     39        sword_layouts_version(),
     40        true
    3341    );
    3442    wp_enqueue_style(
    3543        'swrdlyts-block-editor-css',
    36         plugins_url( 'dist/blocks.editor.build.css',  __FILE__ ),
     44        plugins_url( 'dist/blocks.editor.build.css', __FILE__ ),
    3745        array( 'wp-edit-blocks' ),
    38         filemtime( dirname( __FILE__ ) . '/dist/blocks.editor.build.css' )
     46        sword_layouts_version()
    3947    );
     48    return true;
    4049}
     50add_action( 'enqueue_block_editor_assets', 'sword_layouts_editor_assets' );
     51
     52/**
     53 * Get the current version number, or use cache bust version
     54 *
     55 * @return string the version number
     56 */
     57function sword_layouts_version() {
     58    if ( WP_DEBUG || SCRIPT_DEBUG ) {
     59        return time(); // Bust that cache!
     60    } else {
     61        $plugin_data = get_plugin_data( __FILE__ );
     62        return $plugin_data['Version'];
     63    }
     64}
  • sword-layouts/trunk/dist/blocks.build.js

    r1902899 r1938060  
    1 !function(e){function t(a){if(n[a])return n[a].exports;var l=n[a]={i:a,l:!1,exports:{}};return e[a].call(l.exports,l,l.exports,t),l.l=!0,l.exports}var n={};t.m=e,t.c=n,t.d=function(e,n,a){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:a})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=0)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});n(1)},function(e,t,n){"use strict";var a=n(2),l=(n.n(a),n(3)),r=(n.n(l),wp.i18n.__),i=wp.editor,o=i.InspectorControls,m=i.MediaUpload,c=i.BlockControls,s=i.AlignmentToolbar,u=i.RichText,g=wp.blocks.registerBlockType,d=wp.components,p=d.Button,b=d.Dashicon,f=d.PanelBody,v=d.PanelRow,w=d.FormToggle;g("swrdlyts/tile",{title:r("Tile Layout"),description:r("Creates two columns, half image, half padded text. Use multiple, invert to tile."),icon:"shield",category:"layout",keywords:[r("tile"),r("stagger"),r("image")],attributes:{imgURL:{type:"string",source:"attribute",selector:".imageBox",attribute:"data-imgurl",default:""},imgID:{type:"number",default:""},content:{type:"array",source:"children",selector:".textBoxContent",default:""},invert:{type:"boolean",default:!1},alignment:{type:"string"}},getEditWrapperProps:function(e){return{"data-align":"full","data-move-toolbar-right":e.invert?"false":"true"}},edit:function(e){var t=e.attributes,n=e.setAttributes,a=e.className,l=e.isSelected,i=function(e){n({content:e})},g=function(){n({invert:!t.invert})},d=function(e){n({imgID:e.id,imgURL:e.url})},y=function(e){n({alignment:e})},x=t.imgID?"Change Image":"Select Image",E=t.imgID?"edit":"add";return[!!l&&wp.element.createElement(o,{key:"inspector"},wp.element.createElement(f,null,wp.element.createElement(v,null,wp.element.createElement("label",{htmlFor:"invert-form-toggle",className:"blocks-base-control__label"},r("Invert Layout")),wp.element.createElement(w,{id:"invert-form-toggle",label:r("Invert Layout"),checked:!!t.invert,onChange:g})))),wp.element.createElement("div",{className:a,"data-invert":t.invert?"true":"false","data-align":"full"},wp.element.createElement("div",{className:"imageBox",style:{backgroundImage:"url("+t.imgURL+")"},"data-imgurl":t.imgURL,"data-imgid":t.imgID,"data-hasimg":t.imgID?"true":"false"},l?wp.element.createElement(m,{buttonProps:{className:"components-button button button-large"},onSelect:d,type:"image",value:t.imgID,render:function(e){var t=e.open;return wp.element.createElement(p,{isLarge:!0,onClick:t,className:"components-button components-icon-button button button-large wp-block-image__upload-button"},wp.element.createElement(b,{icon:E}),x)}}):null),wp.element.createElement("div",{className:"textBox"},!!l&&wp.element.createElement(c,{key:"controls"},wp.element.createElement(s,{value:t.alignment,onChange:y})),wp.element.createElement(u,{tagname:"div",multiline:"p",className:"textBoxContent",placeholder:"....",style:{textAlign:t.alignment},value:t.content,onChange:i,isSelected:l})))]},save:function(e){return wp.element.createElement("div",{className:e.className,"data-invert":e.attributes.invert},wp.element.createElement("div",{className:"imageBox","data-imgurl":e.attributes.imgURL,"data-imgid":e.attributes.imgID,style:{backgroundImage:"url("+e.attributes.imgURL+")"}}),wp.element.createElement("div",{className:"textBox"},wp.element.createElement("div",{className:"textBoxContent",style:{textAlign:e.attributes.alignment}},e.attributes.content)))}})},function(e,t){},function(e,t){}]);
     1!function(e){function t(a){if(n[a])return n[a].exports;var l=n[a]={i:a,l:!1,exports:{}};return e[a].call(l.exports,l,l.exports,t),l.l=!0,l.exports}var n={};t.m=e,t.c=n,t.d=function(e,n,a){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:a})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=0)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});n(1)},function(e,t,n){"use strict";var a=n(2),l=(n.n(a),n(3)),r=(n.n(l),n(4)),o=n(5),i=n.n(o),u=wp.i18n.__,c=wp.editor,d=c.AlignmentToolbar,m=c.BlockControls,s=c.InspectorControls,g=c.MediaUpload,p=c.MediaPlaceholder,f=c.RichText,w=c.ColorPalette,v=c.getColorClassName,b=wp.blocks.registerBlockType,x=wp.components,C=x.ToggleControl,h=x.RangeControl,y=x.IconButton,E=x.PanelBody,B=x.PanelColor,L=x.Toolbar;b("swrdlyts/tile",{title:u("Tile Layout"),description:u("Creates two columns, half image, half padded text. Use multiple, invert to tile."),icon:r.a,category:"layout",keywords:[u("tile"),u("stagger"),u("image")],attributes:{imgURL:{type:"string",source:"attribute",selector:".imageBox",attribute:"data-imgurl",default:""},imgID:{type:"number",default:""},content:{type:"array",source:"children",selector:".textBoxContent",default:""},invert:{type:"boolean",default:!1},backgroundColor:{type:"string",default:"rgba(0,0,0,0)"},textColor:{type:"string",default:""},paddingTB:{type:"string",default:"65"},width:{type:"string",default:"80"},alignment:{type:"string"}},getEditWrapperProps:function(e){return{"data-align":"full","data-move-toolbar-right":e.invert?"false":"true"}},edit:function(e){var t=e.attributes,n=e.setAttributes,a=e.className,l=e.isSelected,r=function(e){n({content:e})},o=function(){n({invert:!t.invert})},c=function(e){n({imgID:e.id,imgURL:e.url})},b=function(e){n({alignment:e})},x=t.imgID?"Change Image":"Select Image",k=t.imgID?"edit":"add",T=v("color",t.textColor);return[!!l&&wp.element.createElement(s,{key:"inspector"},wp.element.createElement(E,null,wp.element.createElement(C,{id:"invert-form-toggle",label:u("Invert Layout"),checked:!!t.invert,onChange:o}),wp.element.createElement(h,{label:u("Padding: Top Bottom"),value:t.paddingTB,onChange:function(e){return n({paddingTB:e})},min:20,max:150,step:5}),wp.element.createElement(h,{label:u("Width Text Content"),value:t.width,onChange:function(e){return n({width:e})},min:50,max:90,step:2}),wp.element.createElement(B,{title:u("Background Color"),colorValue:t.backgroundColor},wp.element.createElement(w,{label:u("Background Color"),value:t.backgroundColor,onChange:function(e){n({backgroundColor:e})}})),wp.element.createElement(B,{title:u("Text Color"),colorValue:t.textColor},wp.element.createElement(w,{label:u("Text Color"),value:t.textColor,onChange:function(e){n({textColor:e})}})))),wp.element.createElement("div",{className:i()("alignfull",a),"data-invert":t.invert?"true":"false","data-align":"full","data-paddingTB":t.paddingTB,"data-width":t.width,style:{backgroundColor:t.backgroundColor}},wp.element.createElement("div",{className:"imageBox",style:{backgroundImage:"url("+t.imgURL+")"},"data-imgurl":t.imgURL,"data-imgid":t.imgID,"data-hasimg":t.imgID?"true":"false"},!t.imgID&&wp.element.createElement(p,{icon:"format-gallery",className:a,labels:{title:u("Tile Image"),name:u("")},onSelect:c,accept:"image/*",type:"image"})),wp.element.createElement("div",{className:"textBox"},!!l&&wp.element.createElement(m,{key:"controls"},wp.element.createElement(d,{value:t.alignment,onChange:b}),wp.element.createElement(L,null,t.imgID&&wp.element.createElement(g,{onSelect:c,type:"image",value:t.imgID,render:function(e){var t=e.open;return wp.element.createElement(y,{label:x,icon:k,onClick:t})}}))),wp.element.createElement(f,{tagname:"div",multiline:"p",placeholder:"....",className:i()("textBoxContent",T),style:{textAlign:t.alignment,color:t.textColor,padding:t.paddingTB+"px 0",width:t.width+"%"},value:t.content,onChange:r,isSelected:l})))]},save:function(e){var t=v("color",e.attributes.textColor);return wp.element.createElement("div",{className:e.className,"data-invert":e.attributes.invert,"data-align":"full","data-paddingTB":e.attributes.paddingTB,"data-width":e.attributes.width,style:{backgroundColor:e.attributes.backgroundColor}},wp.element.createElement("div",{className:"imageBox","data-imgurl":e.attributes.imgURL,"data-imgid":e.attributes.imgID,style:{backgroundImage:"url("+e.attributes.imgURL+")"}}),wp.element.createElement("div",{className:"textBox"},wp.element.createElement("div",{className:i()("textBoxContent",t),style:{textAlign:e.attributes.alignment,color:e.attributes.textColor,padding:e.attributes.paddingTB+"px 0",width:e.attributes.width+"%"}},e.attributes.content)))}})},function(e,t){},function(e,t){},function(e,t,n){"use strict";var a=wp.element.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20px",height:"20px",viewBox:"0 0 512 512"}," ",wp.element.createElement("path",{fillRule:"evenodd",d:"M256.000,512.000 L256.000,256.000 L512.000,256.000 L512.000,512.000 L256.000,512.000 ZM0.000,0.000 L256.000,0.000 L256.000,256.000 L0.000,256.000 L0.000,0.000 ZM337.000,99.000 L502.000,99.000 L502.000,158.000 L337.000,158.000 L337.000,99.000 ZM175.000,414.000 L10.000,414.000 L10.000,355.000 L175.000,355.000 L175.000,414.000 Z"})," ");t.a=a},function(e,t,n){var a,l;!function(){"use strict";function n(){for(var e=[],t=0;t<arguments.length;t++){var a=arguments[t];if(a){var l=typeof a;if("string"===l||"number"===l)e.push(a);else if(Array.isArray(a)&&a.length){var o=n.apply(null,a);o&&e.push(o)}else if("object"===l)for(var i in a)r.call(a,i)&&a[i]&&e.push(i)}}return e.join(" ")}var r={}.hasOwnProperty;"undefined"!==typeof e&&e.exports?(n.default=n,e.exports=n):(a=[],void 0!==(l=function(){return n}.apply(t,a))&&(e.exports=l))}()}]);
  • sword-layouts/trunk/dist/blocks.editor.build.css

    r1877134 r1938060  
    1 [data-move-toolbar-right=true] .editor-block-contextual-toolbar .editor-block-toolbar{left:auto;right:0}.wp-block-swrdlyts-tile>div.imageBox button{top:50%;margin-top:-17px;display:inline-block;opacity:1;-webkit-transition:1s all ease;-o-transition:1s all ease;transition:1s all ease}.wp-block-swrdlyts-tile>div.imageBox[data-hasimg=true] button{z-index:3;position:relative;opacity:0}.wp-block-swrdlyts-tile>div.imageBox[data-hasimg=true]:before{-webkit-transition:0.5s all ease;-o-transition:0.5s all ease;transition:0.5s all ease;content:"";display:block;position:absolute;width:100%;height:100%;left:0;top:0;z-index:1;background:rgba(0,0,0,0)}.is-selected .wp-block-swrdlyts-tile>div.imageBox[data-hasimg=true]:hover:before{background:rgba(111,111,111,0.7)}.is-selected .wp-block-swrdlyts-tile>div.imageBox[data-hasimg=true]:hover button{-webkit-filter:blur(0px);filter:blur(0px);opacity:1}
     1[data-move-toolbar-right=true] .editor-block-contextual-toolbar .editor-block-toolbar{border-left:none;-ms-flex-pack:end;justify-content:flex-end}.wp-block-swrdlyts-tile>div.imageBox:after,.wp-block-swrdlyts-tile>div.imageBox[data-hasimg=true]:after{background:rgba(0,0,0,0);content:"";display:block;height:100%;left:0;position:absolute;top:0;-webkit-transition:0.5s all ease;-o-transition:0.5s all ease;transition:0.5s all ease;width:100%;z-index:1}
  • sword-layouts/trunk/dist/blocks.style.build.css

    r1877134 r1938060  
    1 .wp-block-swrdlyts-tile{display:-ms-flexbox;display:flex;max-width:100%}.wp-block-swrdlyts-tile>div{-ms-flex:1;flex:1}.wp-block-swrdlyts-tile>div.imageBox{max-width:100%;background-color:#eee;background-size:cover;background-repeat:no-repeat;background-position:center;text-align:center;position:relative;min-height:30vh}.wp-block-swrdlyts-tile>div.imageBox *{z-index:2}.wp-block-swrdlyts-tile>div.textBox{margin:15vh 0}.wp-block-swrdlyts-tile>div.textBox .textBoxContent{width:70%;max-width:400px;margin-left:auto;margin-right:auto}@media screen and (min-width: 800px){.wp-block-swrdlyts-tile[data-invert=true]{-ms-flex-direction:row-reverse;flex-direction:row-reverse}}@media screen and (max-width: 800px){.wp-block-swrdlyts-tile{-ms-flex-direction:column;flex-direction:column}.wp-block-swrdlyts-tile>div.imageBox{min-height:50vh}}@media screen and (max-width: 500px){.wp-block-swrdlyts-tile>div.imageBox{min-height:50vh}.wp-block-swrdlyts-tile>div.textBox{margin:10vh 0}.wp-block-swrdlyts-tile>div.textBox .textBoxContent{width:80%}}
     1.wp-block-swrdlyts-tile,.wp-block-swrdlyts-tile.alignfull{display:-ms-flexbox;display:flex;margin:0 auto !important;max-width:100% !important;width:100% !important}.wp-block-swrdlyts-tile>div,.wp-block-swrdlyts-tile.alignfull>div{-ms-flex:1;flex:1}.wp-block-swrdlyts-tile>.imageBox,.wp-block-swrdlyts-tile.alignfull>.imageBox{background-color:#eee;background-position:center;background-repeat:no-repeat;background-size:cover;position:relative;text-align:center}.wp-block-swrdlyts-tile>.imageBox *,.wp-block-swrdlyts-tile.alignfull>.imageBox *{z-index:2}.wp-block-swrdlyts-tile>.imageBox:before,.wp-block-swrdlyts-tile.alignfull>.imageBox:before{content:"";display:block;left:0;padding-bottom:100%;top:0;z-index:1}.wp-block-swrdlyts-tile>.textBox,.wp-block-swrdlyts-tile.alignfull>.textBox{-ms-flex-item-align:center;align-self:center;margin:0 auto}.wp-block-swrdlyts-tile>.textBox .textBoxContent,.wp-block-swrdlyts-tile.alignfull>.textBox .textBoxContent{margin-left:auto;margin-right:auto;width:70%}.wp-block-swrdlyts-tile>.textBox p,.wp-block-swrdlyts-tile.alignfull>.textBox p{color:inherit !important}@media screen and (min-width: 800px){.wp-block-swrdlyts-tile[data-invert=true]{-ms-flex-direction:row-reverse;flex-direction:row-reverse}}@media screen and (max-width: 800px){.wp-block-swrdlyts-tile{-ms-flex-direction:column;flex-direction:column}}@media screen and (max-width: 500px){.wp-block-swrdlyts-tile>div.textBox{margin:10vh 0}.wp-block-swrdlyts-tile>div.textBox .textBoxContent{width:80%}}
  • sword-layouts/trunk/readme.txt

    r1902899 r1938060  
    1 === Sword Layouts ===
     1=== Gutenberg Tile Block ===
    22Contributors:      davidsword
    33Donate link:       https://davidsword.ca/🍺/
    44Tags:              Gutenberg, Blocks, Layouts, Modern, Page Builder, Design
    5 Requires at least: 4.9.4
    6 Tested up to:      4.9.4
    7 Stable tag:        1.0.4
     5Requires at least: 4.9.5
     6Tested up to:      4.9.8
     7Stable tag:        1.0.6
    88Requires PHP:      5.6.0
    99
    10 Layout blocks for Gutenberg that help create more interesting and modern WordPress pages.
     10Tile block for Gutenberg that help create more interesting and modern WordPress pages.
    1111
    1212== Description ==
     
    1414Layout blocks for **[Gutenberg](https://wordpress.org/plugins/gutenberg/)** that create more interesting and modern page designs.
    1515
    16 = Current Layouts =
    17 
    18  - **TILE** (see screenshots)
    19      * Stagger small blurbs of text along side beautiful images
    20      * Creates a "magazine" style to your webpage
    21      * Fully responsive
    22 
    23  - 🚧 _..more on the way - this project is in a work in progress!_
     16* Stagger small blurbs of text along side beautiful images
     17* Creates a "magazine" style to your webpage
     18* Fully responsive
    2419
    2520= Please Note =
    2621
    2722* 🚀 This is a beta plugin for the beta plugin [Gutenberg](https://wordpress.org/plugins/gutenberg/) - things will be rocky.
     23* 🚧 This is a WIP, more layouts will be added and the plugin name will change to "Sword Layouts"
    2824* ⚠️ Please [open a support request](https://wordpress.org/support/plugin/sword-layouts) [or add as an issue on Github](https://github.com/davidsword/sword-layouts/issues) before summiting a negative review, *I'm happy to help,* please provide as much information as possible (screen recordings, WordPress and PHP versions, able-to-replicate instructions).
    2925
     
    7066
    7167== Changelog ==
     68
     69= 1.0.6 =
     70* Sep 8, 2018
     71* Changed icon to a new custom one
     72* Added spacing padding settings
     73* fixed alignment of toolbar, above text regardless of invert
     74* changed use of button to buttonIcon
     75* changed custom upload button to Placeholder component
     76* added text and background colors
     77* added padding and width range controls
     78* removed dashicons
     79
     80= 1.0.5 =
     81* Aug 14, 2018
     82* Updated for Gutenberg 3.5
     83* Renamed plugin for easier search keywords
    7284
    7385= 1.0.4 =
  • sword-layouts/trunk/sword-layouts.php

    r1902899 r1938060  
    11<?php
    22/**
    3 * Plugin Name: Gutenberg - Sword Layouts
    4 * Plugin URI: https://github.com/davidsword/sword-layouts
    5 * Description: Some Gutenberg blocks that add modern layouts
    6 * Author: davidsword
    7 * Author URI: https://davidsword.ca/
    8 * Version: 1.0.4
    9 * License: GPL3
    10 * License URI: https://raw.githubusercontent.com/davidsword/sword-layouts/master/LICENSE
    11 */
     3 * Plugin Name: Gutenberg Tile Block
     4 * Plugin URI: https://github.com/davidsword/sword-layouts
     5 * Description: Tile blocks for Gutenberg
     6 * Author: davidsword
     7 * Author URI: https://davidsword.ca/
     8 * Version: 1.0.6
     9 * License: GPL3
     10 * License URI: https://raw.githubusercontent.com/davidsword/sword-layouts/master/LICENSE
     11 *
     12 * @package sword-layouts
     13 */
    1214
    1315defined( 'ABSPATH' ) || exit;
    1416
    15 add_action( 'enqueue_block_assets', 'sword_layouts_block_assets' );
    16 add_action( 'enqueue_block_editor_assets', 'sword_layouts_editor_assets' );
    17 
     17/**
     18 * Load in the Editor assets for the FRONT and BACKEND
     19 */
    1820function sword_layouts_block_assets() {
    1921    wp_enqueue_style(
    2022        'swrdlyts-style-css',
    21         plugins_url( 'dist/blocks.style.build.css',  __FILE__ ),
     23        plugins_url( 'dist/blocks.style.build.css', __FILE__ ),
    2224        array( 'wp-blocks' ),
    23         filemtime( plugin_dir_path( __FILE__ ) . 'dist/blocks.style.build.css' )
     25        sword_layouts_version()
    2426    );
     27    return true;
    2528}
     29add_action( 'enqueue_block_assets', 'sword_layouts_block_assets' );
    2630
     31/**
     32 * Load in the Editor assets for the BACKEND only
     33 */
    2734function sword_layouts_editor_assets() {
    2835    wp_enqueue_script(
     
    3037        plugins_url( '/dist/blocks.build.js', __FILE__ ),
    3138        array( 'wp-blocks', 'wp-i18n', 'wp-element' ),
    32         filemtime( plugin_dir_path( __FILE__ ) . '/dist/blocks.build.js' )
     39        sword_layouts_version(),
     40        true
    3341    );
    3442    wp_enqueue_style(
    3543        'swrdlyts-block-editor-css',
    36         plugins_url( 'dist/blocks.editor.build.css',  __FILE__ ),
     44        plugins_url( 'dist/blocks.editor.build.css', __FILE__ ),
    3745        array( 'wp-edit-blocks' ),
    38         filemtime( dirname( __FILE__ ) . '/dist/blocks.editor.build.css' )
     46        sword_layouts_version()
    3947    );
     48    return true;
    4049}
     50add_action( 'enqueue_block_editor_assets', 'sword_layouts_editor_assets' );
     51
     52/**
     53 * Get the current version number, or use cache bust version
     54 *
     55 * @return string the version number
     56 */
     57function sword_layouts_version() {
     58    if ( WP_DEBUG || SCRIPT_DEBUG ) {
     59        return time(); // Bust that cache!
     60    } else {
     61        $plugin_data = get_plugin_data( __FILE__ );
     62        return $plugin_data['Version'];
     63    }
     64}
Note: See TracChangeset for help on using the changeset viewer.