Plugin Directory

Changeset 2025157


Ignore:
Timestamp:
02/05/2019 11:55:27 AM (7 years ago)
Author:
frontkom
Message:

Release version 1.1.4

Location:
cloud-blocks
Files:
1 deleted
15 edited
43 copied

Legend:

Unmodified
Added
Removed
  • cloud-blocks/tags/1.1.4/assets/js/script.js

    r2011877 r2025157  
    116116                theBlock.version = block.version
    117117                theBlock.packageName = block.name
     118 
     119                if (res.version && b.block_version < res.version) {
     120                  this.updateAvailable = true
     121                  theBlock.availVersion = block.version
     122                }
     123
    118124                this.fromCloud = theBlock
    119               }
    120               if (res && res.version && b.block_version < res.version) {
    121                 this.updateAvailable = true
     125               
     126                if (this.updateAvailable) {
     127                  this.setAvalVersion()
     128                }
    122129              }
    123130            })
     
    204211          this.installing = false
    205212          console.log('There is some issues updating block: ', error)
     213        })
     214    },
     215    setAvalVersion() {
     216      let postData = this.fromCloud
     217      jQuery.ajax({
     218        type: 'POST',
     219        url: fgcData.ajaxUrl,
     220        data: {
     221          action: "fgc_update_version",
     222          data: postData
     223        }
     224      })
     225        .done(res => {
     226          console.log('Available new version ', res.data) 
     227        })
     228        .fail(error => {
     229          console.log('There is some issues: ', error)
    206230        })
    207231    },
  • cloud-blocks/tags/1.1.4/assets/js/script.min.js

    r2011877 r2025157  
    1 "use strict";function _typeof(a){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Vue.component("admin-notice",{data:function a(){return{activeTimeout:-1}},template:"\n    <div\n      :class=\"['fgc-notification', notification.class]\"\n      v-cloak>\n      <p v-html=\"notification.text\"></p>\n    </div>\n  ",watch:{isActive:function a(){this.showingTimeout()}},mounted:function a(){this.showingTimeout()},methods:{showingTimeout:function b(){var a=this;window.clearTimeout(this.activeTimeout),this.activeTimeout=window.setTimeout(function(){window.store.state.notification.class="",a.isShowing=!1},4e3)}},computed:{isActive:function a(){return window.store.state.notification.text},notification:function a(){return window.store.state.notification}}}),Vue.component("block-card",{props:["block"],data:function a(){return{installing:!1,alreadyInstaleld:!1,updateAvailable:!1,currentVersion:null,fromCloud:null}},template:"\n    <div class=\"theme\">\n      <div class=\"theme-screenshot\" @click=\"openMoreDetails\">\n        <img :src=\"block.imageUrl || fgcData.defaultThumbnail\" :alt=\"block.name\">\n        <div class=\"spinner installing-block\" v-if=\"installing\"></div>\n      </div>\n\n      <div v-if=\"currentBrowseState != 'installed' && alreadyInstaleld\" class=\"notice inline notice-success notice-alt\"><p>{{fgcData.strings.installed}}</p></div>\n\n      <div v-if=\"currentBrowseState == 'installed' && isLocalBlock\" class=\"notice inline notice-info notice-alt\"><p>{{fgcData.strings.local_block}}</p></div>\n\n      <div v-if=\"updateAvailable\" class=\"update-message notice inline notice-warning notice-alt\">\n        <p>{{fgcData.strings.update_available}} <button class=\"button-link\" type=\"button\" @click=\"updateBlock\">{{fgcData.strings.update_now}}</button></p>\n      </div>\n\n      <span class=\"more-details\" @click=\"openMoreDetails\">{{fgcData.strings.show_more_details}}</span>\n\n      <div class=\"theme-id-container\">\n        <h3 class=\"theme-name\">{{ block.name }}</h3>\n        <span v-if=\"blockManifest && blockManifest.author\" class=\"block-author\">{{fgcData.strings.by}}: \n          <span v-if=\"typeof blockManifest.author == 'object'\">\n            {{ blockManifest.author.name }}\n          </span>\n          <span v-if=\"typeof blockManifest.author == 'string'\">\n            {{ blockManifest.author }}\n          </span>\n        </span>\n        <span v-else class=\"block-version\">{{fgcData.strings.version}}: {{ currentVersion }}</span>\n\n        <div class=\"theme-actions\">\n          <button class=\"button button-primary theme-install install-block-btn\"\n              v-if=\"currentBrowseState != 'installed' && !alreadyInstaleld\"\n              @click.prevent=\"installBlock\">\n              {{fgcData.strings.install}}\n          </button>\n          <button class=\"button theme-install install-block-btn\"\n              v-else\n              @click.prevent=\"uninstallBlock\">\n              {{fgcData.strings.uninstall}}\n          </button>\n          <a class=\"button button-primary\" :href=\"blockUrl\" target=\"_blank\">{{fgcData.strings.homepage}}</a>\n        </div>\n      </div>\n\n    </div>\n  ",mounted:function b(){var a=this;this.currentVersion=this.block.version,!window.store.state.installedBlocks.filter(function(c){return c.package_name==a.block.packageName}).length||(this.alreadyInstaleld="installed"!=this.currentBrowseState,"installed"==this.currentBrowseState&&(window.store.state.installedBlocks.map(function(c){c.package_name!=a.block.packageName||a.isLocalBlock||jQuery.get("https://api.gutenbergcloud.org/blocks/".concat(c.package_name),function(b){if(b){var d=b,e={};e.jsUrl="https://unpkg.com/".concat(d.name,"@").concat(d.version,"/").concat(d.config.js),e.cssUrl="https://unpkg.com/".concat(d.name,"@").concat(d.version,"/").concat(d.config.css),e.editorCss=d.config.editor?"https://unpkg.com/".concat(d.name,"@").concat(d.version,"/").concat(d.config.editor):null,e.infoUrl="https://www.npmjs.com/package/".concat(d.name),e.imageUrl="https://unpkg.com/".concat(d.name,"@").concat(d.version,"/").concat(d.config.screenshot),e.name=d.config.name,e.blockManifest=JSON.stringify(d.package),e.version=d.version,e.packageName=d.name,a.fromCloud=e}b&&b.version&&c.block_version<b.version&&(a.updateAvailable=!0)})}),this.currentVersion=window.store.state.installedBlocks.filter(function(c){return c.package_name==a.block.packageName})[0].block_version))},methods:{installBlock:function c(){var a=this;this.installing=!0;var b=this.block;console.log("Install block",b),jQuery.ajax({type:"POST",url:fgcData.ajaxUrl,data:{action:"fgc_install_block",data:b}}).done(function(b){a.installing=!1,a.alreadyInstaleld=!0,a.isLocalBlock||a.incrementInstalls(a.block.packageName),window.store.dispatch("getInstalledBlocks"),window.store.commit("setNotification",{text:"".concat(fgcData.strings.the_block," <b>").concat(a.block.name,"</b> ").concat(fgcData.strings.block_installed),class:"show success"}),console.log("Block installed ",b.data)}).fail(function(b){a.installing=!1,console.log("There is some issues installing block: ",b)})},uninstallBlock:function c(){var a=this;this.installing=!0;var b=this.block;jQuery.ajax({type:"POST",url:fgcData.ajaxUrl,data:{action:"fgc_uninstall_block",data:b}}).done(function(b){a.installing=!1,a.alreadyInstaleld=!1,a.isLocalBlock||a.decrementInstalls(a.block.packageName),window.store.dispatch("getInstalledBlocks"),window.store.commit("setNotification",{text:"".concat(fgcData.strings.block," <b>").concat(a.block.name,"</b> ").concat(fgcData.strings.block_uninstalled),class:"show success"}),console.log("Block uninstalled ",b.data)}).fail(function(b){a.installing=!1,console.log("There is some issues uninstalling block: ",b)})},updateBlock:function c(){var a=this;this.installing=!0;var b=this.fromCloud;jQuery.ajax({type:"POST",url:fgcData.ajaxUrl,data:{action:"fgc_update_block",data:b}}).done(function(b){a.installing=!1,a.updateAvailable=!1,a.currentVersion=a.block.version,window.store.dispatch("getInstalledBlocks"),window.store.commit("setNotification",{text:"".concat(fgcData.strings.block," <b>").concat(a.block.name,"</b> ").concat(fgcData.strings.block_updated),class:"show success"}),console.log("Block Updated ",b.data)}).fail(function(b){a.installing=!1,console.log("There is some issues updating block: ",b)})},incrementInstalls:function b(a){jQuery.ajax({type:"POST",data:{increment:1},url:"https://api.gutenbergcloud.org/blocks/".concat(a)}).done(function(){console.log("Installation counter increased ")}).fail(function(a){console.log("Some errors occured white increasing number of installs: ",a)})},decrementInstalls:function b(a){jQuery.ajax({type:"POST",data:{increment:-1},url:"https://api.gutenbergcloud.org/blocks/".concat(a)}).done(function(){console.log("Installation counter decreased ")}).fail(function(a){console.log("Some errors occured white increasing number of installs: ",a)})},openMoreDetails:function a(){window.store.commit("openOverlay",this.block)}},computed:{currentBrowseState:function a(){return window.store.state.browseState},blockManifest:function b(){var a=JSON.parse(this.block.blockManifest);return"string"==typeof a&&""!=a?JSON.parse(a):a},isLocalBlock:function a(){return this.blockManifest&&this.blockManifest.isLocal||!1},blockUrl:function a(){return this.blockManifest.homepage?this.blockManifest.homepage:this.blockManifest.author&&"object"==_typeof(this.blockManifest.author)&&this.blockManifest.author.url?this.blockManifest.author.url:"https://www.npmjs.com/package/".concat(this.block.packageName)}}}),Vue.component("block-details",{props:["block"],data:function a(){return{alreadyInstaleld:!1,spinnerLoaded:!1}},template:"\n    <div class=\"theme-overlay\" tabindex=\"0\" role=\"dialog\"><div class=\"theme-overlay\">\n      <div class=\"theme-backdrop\"></div>\n      <div class=\"theme-wrap wp-clearfix\" role=\"document\">\n        <div class=\"theme-header\">\n          <button class=\"close dashicons dashicons-no\" @click=\"closeOverlay\"></button>\n        </div>\n\n        <div class=\"theme-about wp-clearfix\">\n          <div class=\"theme-screenshots\">\n            <div class=\"screenshot\">\n              <img :src=\"block.imageUrl || fgcData.defaultThumbnail\" :alt=\"block.name\">\n              <div class=\"spinner installing-block\" v-if=\"spinnerLoaded\"></div>\n            </div>\n          </div>\n\n          <div class=\"theme-info\">\n            <h2 class=\"theme-name\">\n              {{ block.name }}\n                <span class=\"theme-version\">{{fgcData.strings.version}}: {{ block.version }}</span>\n            </h2>\n            <p v-if=\"blockAuthor && authorUrl\" class=\"theme-author\">{{fgcData.strings.by}} <a :href=\"authorUrl\" target=\"_blank\">{{ blockAuthor }} </a></p>\n            <p v-else-if=\"blockAuthor\" class=\"theme-author\">{{fgcData.strings.by}} {{ blockAuthor }}</p>\n\n            \n            <p class=\"theme-description\">\n              {{ blockManifest.description }}\n            </p>\n\n            <p class=\"theme-tags\">\n              <span>{{fgcData.strings.tags}}:</span>{{ blockTags }}\n            </p>\n            \n          </div>\n        </div>\n\n        <div class=\"theme-actions\">\n          <div class=\"inactive-theme\">\n            <a v-if=\"alreadyInstaleld\" @click.prevent=\"uninstallBlock\" class=\"button activate\">{{fgcData.strings.uninstall}}</a>\n            <a v-else @click.prevent=\"installBlock\" class=\"button activate\">{{fgcData.strings.install}}</a>\n            <a :href=\"blockUrl\" target=\"_blank\" class=\"button button-primary load-customize hide-if-no-customize\">{{fgcData.strings.visit_homepage}}</a>\n            <a v-if=\"isLocalBlock\" class=\"button install-block-btn button-delete load-customize hide-if-no-customize\" @click.prevent=\"deleteBlock\">{{fgcData.strings.delete_block}}</a>\n          </div>\n        </div>\n      </div>\n    </div>\n  </div>",mounted:function b(){var a=this;window.addEventListener("keyup",this.keypressEvent),!window.store.state.installedBlocks.filter(function(c){return c.package_name==a.block.packageName}).length||(this.alreadyInstaleld=!0)},computed:{blockManifest:function b(){var a=JSON.parse(this.block.blockManifest);return"string"==typeof a&&""!=a?JSON.parse(a):a},isLocalBlock:function a(){return this.blockManifest&&this.blockManifest.isLocal||!1},blockUrl:function a(){return this.blockManifest.homepage?this.blockManifest.homepage:this.blockManifest.author&&"object"==_typeof(this.blockManifest.author)&&this.blockManifest.author.url?this.blockManifest.author.url:"https://www.npmjs.com/package/".concat(this.block.packageName)},authorUrl:function a(){return this.blockManifest.author&&"object"==_typeof(this.blockManifest.author)&&this.blockManifest.author.url?this.blockManifest.author.url:this.blockManifest.homepage?this.blockManifest.homepage:"https://www.npmjs.com/package/".concat(this.block.packageName)},blockAuthor:function a(){return this.blockManifest.author&&"object"==_typeof(this.blockManifest.author)&&this.blockManifest.author.name?this.blockManifest.author.name:this.blockManifest.author&&"string"==typeof this.blockManifest.author?this.blockManifest.author:null},blockTags:function a(){return this.blockManifest?this.blockManifest.keywords.join(", "):""}},methods:{keypressEvent:function b(a){27===a.keyCode&&this.closeOverlay()},closeOverlay:function a(){window.store.commit("openOverlay",null)},installBlock:function c(){var a=this;this.spinnerLoaded=!0;var b=this.block;console.log("Install block",b),jQuery.ajax({type:"POST",url:fgcData.ajaxUrl,data:{action:"fgc_install_block",data:b}}).done(function(b){a.alreadyInstaleld=!0,a.spinnerLoaded=!1,a.isLocalBlock||a.incrementInstalls(a.block.packageName),window.store.dispatch("getInstalledBlocks"),window.store.commit("setNotification",{text:"".concat(fgcData.strings.the_block," <b>").concat(a.block.name,"</b> ").concat(fgcData.strings.block_installed),class:"show success"}),console.log("Block installed ",b.data)}).fail(function(b){a.installing=!1,console.log("There is some issues installing block: ",b)})},deleteBlock:function c(){var a=this;this.spinnerLoaded=!0,this.alreadyInstaleld&&this.uninstallBlock();var b={block:this.block,nonce:fgcData.ajaxNonce};jQuery.ajax({type:"POST",url:fgcData.ajaxUrl,data:{action:"fgc_delete_block",data:b}}).done(function(b){window.store.commit("setNotification",{text:"".concat(fgcData.strings.the_block," <b>").concat(a.block.name,"</b> ").concat(fgcData.strings.block_deleted),class:"show success"}),window.store.commit("setRefetchBlocks",!0),a.closeOverlay(),a.spinnerLoaded=!1,window.store.dispatch("getInstalledBlocks"),console.log("Block removed ",b.data)}).fail(function(b){a.installing=!1,console.log("There is some issues installing block: ",b)})},uninstallBlock:function c(){var a=this,b=this.block;jQuery.ajax({type:"POST",url:fgcData.ajaxUrl,data:{action:"fgc_uninstall_block",data:b}}).done(function(b){a.alreadyInstaleld=!1,a.isLocalBlock||a.decrementInstalls(a.block.packageName),window.store.dispatch("getInstalledBlocks"),window.store.commit("setNotification",{text:"".concat(fgcData.strings.block," <b>").concat(a.block.name,"</b> ").concat(fgcData.strings.block_uninstalled),class:"show success"}),console.log("Block uninstalled ",b.data)}).fail(function(b){a.installing=!1,console.log("There is some issues uninstalling block: ",b)})},incrementInstalls:function b(a){jQuery.ajax({type:"PUT",url:"https://api.gutenbergcloud.org/blocks/".concat(a)}).done(function(){console.log("Installation counter increased ")}).fail(function(a){console.log("Some errors occured white increasing number of installs: ",a)})},decrementInstalls:function b(a){jQuery.ajax({type:"DELETE",url:"https://api.gutenbergcloud.org/blocks/".concat(a)}).done(function(){console.log("Installation counter decreased ")}).fail(function(a){console.log("Some errors occured white increasing number of installs: ",a)})}}}),Vue.component("explorer-filter",{componenets:["filter-drawer"],data:function a(){return{drawerFilterOpen:!1,searchQuery:null,filterLinks:[{name:fgcData.strings.installed,slug:"installed"},{name:fgcData.strings.popular,slug:"popular"},{name:fgcData.strings.latest,slug:"latest"},{name:fgcData.strings.local,slug:"local"}]}},template:"\n    <div class=\"wp-filter g-blocks-filter hide-if-no-js\">\n      <div class=\"filter-count\">\n        <span class=\"count theme-count\">{{ blocksCount }}</span>\n      </div>\n\n      <ul class=\"filter-links\">\n        <li><a v-for=\"filter in filterLinks\" :key=\"filter.slug\" @click=\"filterLink(filter.slug)\" :class=\"currentFilter(filter.slug)\">{{ filter.name }}</a></li>\n      </ul>\n\n      <button type=\"button\" v-if=\"false\" id=\"searchFilter\" class=\"button drawer-toggle\" :aria-expanded=\"drawerFilterOpen\" @click=\"drawerFilterOpen = !drawerFilterOpen\">{{fgcData.strings.filter}}</button>\n\n      <form class=\"search-form\" @submit.prevent=\"searchForBlock\"><label class=\"screen-reader-text\" for=\"wp-filter-search-input\">{{fgcData.strings.search_for_blocks}}</label><input :placeholder=\"fgcData.strings.search_blocks\" v-model=\"searchQuery\" type=\"search\" id=\"wp-filter-search-input\" class=\"wp-filter-search\"></form>\n\n      <filter-drawer :style=\"{display: drawerFilterOpen ? 'block' : 'none'}\"></filter-drawer>\n    </div>\n  ",mounted:function a(){window.store.state.installedBlocks.length||"local"==window.store.state.browseState||this.filterLink("popular")},methods:{filterLink:function c(a){var b=window.location.search.replace(/\&browse[=a-z]*/,"");history.pushState({state:a},null,"".concat(b,"&browse=").concat(a)),window.store.commit("setBrowseState",a)},currentFilter:function b(a){return window.store.state.browseState==a?"current":""},searchForBlock:function c(){var a=window.location.search.replace(/\&q[=a-z\-]*/,""),b=this.searchQuery.replace(/\s+/g,"-").toLowerCase();history.pushState({state:b},null,"".concat(a,"&q=").concat(b)),window.store.commit("setSearchQuery",b)}},computed:{blocksCount:function a(){return"installed"===window.store.state.browseState?window.store.state.installedBlocks.length:window.store.state.blocksCount}}}),Vue.component("filter-drawer",{template:"\n    <div class=\"filter-drawer\">\n      <div class=\"buttons\">\n        <button type=\"button\" class=\"apply-filters button\">Apply Filters<span></span></button>\n        <button type=\"button\" class=\"clear-filters button\" aria-label=\"Clear all filters\">Clear</button>\n      </div>\n      <fieldset class=\"filter-group\">\n        <legend>Subject</legend>\n        <div class=\"filter-group-feature\">\n          <input type=\"checkbox\" id=\"filter-id-blog\" value=\"blog\">\n          <label for=\"filter-id-blog\">Blog</label>\n          <input type=\"checkbox\" id=\"filter-id-e-commerce\" value=\"e-commerce\">\n          <label for=\"filter-id-e-commerce\">E-Commerce</label>\n          <input type=\"checkbox\" id=\"filter-id-education\" value=\"education\">\n          <label for=\"filter-id-education\">Education</label>\n          <input type=\"checkbox\" id=\"filter-id-entertainment\" value=\"entertainment\">\n          <label for=\"filter-id-entertainment\">News</label>\n        </div>\n      </fieldset>\n      <fieldset class=\"filter-group\">\n        <legend>Features</legend>\n        <div class=\"filter-group-feature\">\n          <input type=\"checkbox\" id=\"filter-id-accessibility-ready\" value=\"accessibility-ready\">\n          <label for=\"filter-id-accessibility-ready\">Custom Colors</label>\n          <input type=\"checkbox\" id=\"filter-id-custom-background\" value=\"custom-background\">\n          <label for=\"filter-id-custom-background\">Editor style</label>\n          <input type=\"checkbox\" id=\"filter-id-custom-colors\" value=\"custom-colors\">\n          <label for=\"filter-id-custom-colors\">Full Width Template</label>\n        </div>  \n      </fieldset>\n      <fieldset class=\"filter-group\">\n        <legend>Layout</legend>\n        <div class=\"filter-group-feature\">\n          <input type=\"checkbox\" id=\"filter-id-grid-layout\" value=\"grid-layout\">\n          <label for=\"filter-id-grid-layout\">Grid-layout</label>\n          <input type=\"checkbox\" id=\"filter-id-one-column\" value=\"one-column\">\n          <label for=\"filter-id-one-column\">One Column</label>\n          <input type=\"checkbox\" id=\"filter-id-two-columns\" value=\"two-columns\">\n          <label for=\"filter-id-two-columns\">Two Column</label>\n          <input type=\"checkbox\" id=\"filter-id-three-columns\" value=\"three-columns\">\n          <label for=\"filter-id-three-columns\">Responsive</label>\n        </div>\n      </fieldset>\n      <div class=\"buttons\">\n        <button type=\"button\" class=\"apply-filters button\">Apply Filters<span></span></button>\n        <button type=\"button\" class=\"clear-filters button\" aria-label=\"Clear all filters\">Clear</button>\n      </div>\n\n    </div>\n  "});var store=new Vuex.Store({state:{notification:{},browseState:null,installedBlocks:fgcData.installedBlocks,searchQuery:null,opendOverlay:null,blocksCount:0,refetchBlocks:!1},mutations:{setNotification:function c(a,b){a.notification=b},setBrowseState:function c(a,b){a.browseState=b},setInstalledBlocks:function c(a,b){a.installedBlocks=b},setSearchQuery:function c(a,b){a.searchQuery=b},openOverlay:function c(a,b){a.opendOverlay=b},setBlocksCount:function c(a,b){a.blocksCount=b},setRefetchBlocks:function c(a,b){a.refetchBlocks=b}},actions:{getInstalledBlocks:function b(a){jQuery.ajax({type:"GET",url:fgcData.ajaxUrl,data:{action:"fgc_get_all_blocks"}}).done(function(b){a.commit("setInstalledBlocks",b.data)}).fail(function(a){console.log("There is some issues installing block: ",a)})}}}),app=new Vue({el:"#blockExplorer",data:function a(){return{blocks:[]}},created:function c(){window.store.dispatch("getInstalledBlocks");var a=this.getUrlParams("browse")?this.getUrlParams("browse"):"installed",b=this.getUrlParams("q")?this.getUrlParams("q"):"";this.getBlocks({state:a,q:b}),window.store.commit("setBrowseState",a)},mounted:function a(){window.addEventListener("popstate",this.fetchBlocks)},watch:{currentBrowseFilter:function c(a){var b=this.getUrlParams("q")?this.getUrlParams("q"):"";window.store.dispatch("getInstalledBlocks");this.getBlocks({state:a,q:b})},currentSearchQuery:function c(a){var b=this.getUrlParams("browse")?this.getUrlParams("browse"):"installed";window.store.dispatch("getInstalledBlocks");this.getBlocks({state:b,q:a})},installedBlocks:function d(a,b){var c=this.getUrlParams("browse")?this.getUrlParams("browse"):"installed";a.length!=b.length&&"installed"==c&&(this.blocks=this.blocks.filter(function(b){return a.some(function(a){return a.package_name==b.packageName})}))},refetchBlocks:function b(){var a=this.getUrlParams("browse")?this.getUrlParams("browse"):"installed";this.getBlocks({state:a})}},methods:{fetchBlocks:function c(a){var b=null;a.state&&(b=a.state.state),this.getBlocks(b)},getBlocks:function l(a){var b=this,c=[],d="";if(a.q&&null!==a.q&&(d="q=".concat(a.q)),null!==a.state&&(d+="&order=".concat(a.state)),null!=a.state&&"installed"!=a.state)"local"==a.state?this.localBlocks(a):jQuery.get("https://api.gutenbergcloud.org/blocks?".concat(d),function(d){d.count&&window.store.commit("setBlocksCount",d.count);var e=!0,f=!1,g=void 0;try{for(var h,i=function(){var d=h.value,e={};e.jsUrl="https://unpkg.com/".concat(d.name,"@").concat(d.version,"/").concat(d.config.js),e.cssUrl="https://unpkg.com/".concat(d.name,"@").concat(d.version,"/").concat(d.config.css),e.editorCss=d.config.editor?"https://unpkg.com/".concat(d.name,"@").concat(d.version,"/").concat(d.config.editor):null,e.infoUrl="https://www.npmjs.com/package/".concat(d.name),e.imageUrl="https://unpkg.com/".concat(d.name,"@").concat(d.version,"/").concat(d.config.screenshot),e.name=d.config.name,e.blockManifest=JSON.stringify(d.package),e.version=d.version,e.packageName=d.name,null==a.state||"installed"==a.state?b.installedBlocks.length&&b.installedBlocks.filter(function(a){return a.package_name==e.packageName}).length&&c.push(e):c.push(e)},j=d.rows[Symbol.iterator]();!(e=(h=j.next()).done);e=!0)i()}catch(a){f=!0,g=a}finally{try{e||null==j.return||j.return()}finally{if(f)throw g}}});else if(this.installedBlocks.length){var e=!0,f=!1,g=void 0;try{for(var h,i=this.installedBlocks[Symbol.iterator]();!(e=(h=i.next()).done);e=!0){var j=h.value,k={};k.jsUrl=j.js_url,k.cssUrl=j.css_url,k.editorCss=j.editor_css,k.infoUrl=j.info_url,k.imageUrl=j.thumbnail,k.name=j.block_name,k.blockManifest="\""+j.block_manifest+"\"",k.version=j.block_version,k.packageName=j.package_name,(a.q&&null!==a.q&&(-1<k.name.toLowerCase().indexOf(a.q.toLowerCase())||-1<k.packageName.toLowerCase().indexOf(a.q.toLowerCase()))||!a.q)&&c.push(k)}}catch(a){f=!0,g=a}finally{try{e||null==i.return||i.return()}finally{if(f)throw g}}}this.blocks=c},getUrlParams:function e(a,b){b||(b=window.location.href),a=a.replace(/[\[\]]/g,"\\$&");var c=new RegExp("[?&]"+a+"(=([^&#]*)|&|#|$)"),d=c.exec(b);return d?d[2]?decodeURIComponent(d[2].replace(/\+/g," ")):"":null},showUploader:function a(){document.body.classList.toggle("show-upload-view")},localBlocks:function c(a){var b=this;jQuery.ajax({type:"POST",url:fgcData.ajaxUrl,data:{action:"fgc_local_blocks"}}).done(function(c){c.data.length?(window.store.commit("setBlocksCount",c.data.length),window.store.commit("setRefetchBlocks",!1)):window.store.commit("setBlocksCount",0),b.blocks=a.q&&null!==a.q?c.data.filter(function(b){return-1<b.name.toLowerCase().indexOf(a.q.toLowerCase())||-1<b.packageName.toLowerCase().indexOf(a.q.toLowerCase())}):c.data}).fail(function(a){console.log("There is some issues getting local blocks: ",a)})}},computed:{currentBrowseFilter:function a(){return window.store.state.browseState},currentSearchQuery:function a(){return window.store.state.searchQuery},installedBlocks:function a(){return window.store.state.installedBlocks},openOverlay:function a(){return window.store.state.opendOverlay},refetchBlocks:function a(){return window.store.state.refetchBlocks}}});
     1"use strict";function _typeof(a){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Vue.component("admin-notice",{data:function a(){return{activeTimeout:-1}},template:"\n    <div\n      :class=\"['fgc-notification', notification.class]\"\n      v-cloak>\n      <p v-html=\"notification.text\"></p>\n    </div>\n  ",watch:{isActive:function a(){this.showingTimeout()}},mounted:function a(){this.showingTimeout()},methods:{showingTimeout:function b(){var a=this;window.clearTimeout(this.activeTimeout),this.activeTimeout=window.setTimeout(function(){window.store.state.notification.class="",a.isShowing=!1},4e3)}},computed:{isActive:function a(){return window.store.state.notification.text},notification:function a(){return window.store.state.notification}}}),Vue.component("block-card",{props:["block"],data:function a(){return{installing:!1,alreadyInstaleld:!1,updateAvailable:!1,currentVersion:null,fromCloud:null}},template:"\n    <div class=\"theme\">\n      <div class=\"theme-screenshot\" @click=\"openMoreDetails\">\n        <img :src=\"block.imageUrl || fgcData.defaultThumbnail\" :alt=\"block.name\">\n        <div class=\"spinner installing-block\" v-if=\"installing\"></div>\n      </div>\n\n      <div v-if=\"currentBrowseState != 'installed' && alreadyInstaleld\" class=\"notice inline notice-success notice-alt\"><p>{{fgcData.strings.installed}}</p></div>\n\n      <div v-if=\"currentBrowseState == 'installed' && isLocalBlock\" class=\"notice inline notice-info notice-alt\"><p>{{fgcData.strings.local_block}}</p></div>\n\n      <div v-if=\"updateAvailable\" class=\"update-message notice inline notice-warning notice-alt\">\n        <p>{{fgcData.strings.update_available}} <button class=\"button-link\" type=\"button\" @click=\"updateBlock\">{{fgcData.strings.update_now}}</button></p>\n      </div>\n\n      <span class=\"more-details\" @click=\"openMoreDetails\">{{fgcData.strings.show_more_details}}</span>\n\n      <div class=\"theme-id-container\">\n        <h3 class=\"theme-name\">{{ block.name }}</h3>\n        <span v-if=\"blockManifest && blockManifest.author\" class=\"block-author\">{{fgcData.strings.by}}: \n          <span v-if=\"typeof blockManifest.author == 'object'\">\n            {{ blockManifest.author.name }}\n          </span>\n          <span v-if=\"typeof blockManifest.author == 'string'\">\n            {{ blockManifest.author }}\n          </span>\n        </span>\n        <span v-else class=\"block-version\">{{fgcData.strings.version}}: {{ currentVersion }}</span>\n\n        <div class=\"theme-actions\">\n          <button class=\"button button-primary theme-install install-block-btn\"\n              v-if=\"currentBrowseState != 'installed' && !alreadyInstaleld\"\n              @click.prevent=\"installBlock\">\n              {{fgcData.strings.install}}\n          </button>\n          <button class=\"button theme-install install-block-btn\"\n              v-else\n              @click.prevent=\"uninstallBlock\">\n              {{fgcData.strings.uninstall}}\n          </button>\n          <a class=\"button button-primary\" :href=\"blockUrl\" target=\"_blank\">{{fgcData.strings.homepage}}</a>\n        </div>\n      </div>\n\n    </div>\n  ",mounted:function b(){var a=this;this.currentVersion=this.block.version,!window.store.state.installedBlocks.filter(function(c){return c.package_name==a.block.packageName}).length||(this.alreadyInstaleld="installed"!=this.currentBrowseState,"installed"==this.currentBrowseState&&(window.store.state.installedBlocks.map(function(c){c.package_name!=a.block.packageName||a.isLocalBlock||jQuery.get("https://api.gutenbergcloud.org/blocks/".concat(c.package_name),function(b){if(b){var d=b,e={};e.jsUrl="https://unpkg.com/".concat(d.name,"@").concat(d.version,"/").concat(d.config.js),e.cssUrl="https://unpkg.com/".concat(d.name,"@").concat(d.version,"/").concat(d.config.css),e.editorCss=d.config.editor?"https://unpkg.com/".concat(d.name,"@").concat(d.version,"/").concat(d.config.editor):null,e.infoUrl="https://www.npmjs.com/package/".concat(d.name),e.imageUrl="https://unpkg.com/".concat(d.name,"@").concat(d.version,"/").concat(d.config.screenshot),e.name=d.config.name,e.blockManifest=JSON.stringify(d.package),e.version=d.version,e.packageName=d.name,b.version&&c.block_version<b.version&&(a.updateAvailable=!0,e.availVersion=d.version),a.fromCloud=e,a.updateAvailable&&a.setAvalVersion()}})}),this.currentVersion=window.store.state.installedBlocks.filter(function(c){return c.package_name==a.block.packageName})[0].block_version))},methods:{installBlock:function c(){var a=this;this.installing=!0;var b=this.block;console.log("Install block",b),jQuery.ajax({type:"POST",url:fgcData.ajaxUrl,data:{action:"fgc_install_block",data:b}}).done(function(b){a.installing=!1,a.alreadyInstaleld=!0,a.isLocalBlock||a.incrementInstalls(a.block.packageName),window.store.dispatch("getInstalledBlocks"),window.store.commit("setNotification",{text:"".concat(fgcData.strings.the_block," <b>").concat(a.block.name,"</b> ").concat(fgcData.strings.block_installed),class:"show success"}),console.log("Block installed ",b.data)}).fail(function(b){a.installing=!1,console.log("There is some issues installing block: ",b)})},uninstallBlock:function c(){var a=this;this.installing=!0;var b=this.block;jQuery.ajax({type:"POST",url:fgcData.ajaxUrl,data:{action:"fgc_uninstall_block",data:b}}).done(function(b){a.installing=!1,a.alreadyInstaleld=!1,a.isLocalBlock||a.decrementInstalls(a.block.packageName),window.store.dispatch("getInstalledBlocks"),window.store.commit("setNotification",{text:"".concat(fgcData.strings.block," <b>").concat(a.block.name,"</b> ").concat(fgcData.strings.block_uninstalled),class:"show success"}),console.log("Block uninstalled ",b.data)}).fail(function(b){a.installing=!1,console.log("There is some issues uninstalling block: ",b)})},updateBlock:function c(){var a=this;this.installing=!0;var b=this.fromCloud;jQuery.ajax({type:"POST",url:fgcData.ajaxUrl,data:{action:"fgc_update_block",data:b}}).done(function(b){a.installing=!1,a.updateAvailable=!1,a.currentVersion=a.block.version,window.store.dispatch("getInstalledBlocks"),window.store.commit("setNotification",{text:"".concat(fgcData.strings.block," <b>").concat(a.block.name,"</b> ").concat(fgcData.strings.block_updated),class:"show success"}),console.log("Block Updated ",b.data)}).fail(function(b){a.installing=!1,console.log("There is some issues updating block: ",b)})},setAvalVersion:function b(){var a=this.fromCloud;jQuery.ajax({type:"POST",url:fgcData.ajaxUrl,data:{action:"fgc_update_version",data:a}}).done(function(a){console.log("Available new version ",a.data)}).fail(function(a){console.log("There is some issues: ",a)})},incrementInstalls:function b(a){jQuery.ajax({type:"POST",data:{increment:1},url:"https://api.gutenbergcloud.org/blocks/".concat(a)}).done(function(){console.log("Installation counter increased ")}).fail(function(a){console.log("Some errors occured white increasing number of installs: ",a)})},decrementInstalls:function b(a){jQuery.ajax({type:"POST",data:{increment:-1},url:"https://api.gutenbergcloud.org/blocks/".concat(a)}).done(function(){console.log("Installation counter decreased ")}).fail(function(a){console.log("Some errors occured white increasing number of installs: ",a)})},openMoreDetails:function a(){window.store.commit("openOverlay",this.block)}},computed:{currentBrowseState:function a(){return window.store.state.browseState},blockManifest:function b(){var a=JSON.parse(this.block.blockManifest);return"string"==typeof a&&""!=a?JSON.parse(a):a},isLocalBlock:function a(){return this.blockManifest&&this.blockManifest.isLocal||!1},blockUrl:function a(){return this.blockManifest.homepage?this.blockManifest.homepage:this.blockManifest.author&&"object"==_typeof(this.blockManifest.author)&&this.blockManifest.author.url?this.blockManifest.author.url:"https://www.npmjs.com/package/".concat(this.block.packageName)}}}),Vue.component("block-details",{props:["block"],data:function a(){return{alreadyInstaleld:!1,spinnerLoaded:!1}},template:"\n    <div class=\"theme-overlay\" tabindex=\"0\" role=\"dialog\"><div class=\"theme-overlay\">\n      <div class=\"theme-backdrop\"></div>\n      <div class=\"theme-wrap wp-clearfix\" role=\"document\">\n        <div class=\"theme-header\">\n          <button class=\"close dashicons dashicons-no\" @click=\"closeOverlay\"></button>\n        </div>\n\n        <div class=\"theme-about wp-clearfix\">\n          <div class=\"theme-screenshots\">\n            <div class=\"screenshot\">\n              <img :src=\"block.imageUrl || fgcData.defaultThumbnail\" :alt=\"block.name\">\n              <div class=\"spinner installing-block\" v-if=\"spinnerLoaded\"></div>\n            </div>\n          </div>\n\n          <div class=\"theme-info\">\n            <h2 class=\"theme-name\">\n              {{ block.name }}\n                <span class=\"theme-version\">{{fgcData.strings.version}}: {{ block.version }}</span>\n            </h2>\n            <p v-if=\"blockAuthor && authorUrl\" class=\"theme-author\">{{fgcData.strings.by}} <a :href=\"authorUrl\" target=\"_blank\">{{ blockAuthor }} </a></p>\n            <p v-else-if=\"blockAuthor\" class=\"theme-author\">{{fgcData.strings.by}} {{ blockAuthor }}</p>\n\n            \n            <p class=\"theme-description\">\n              {{ blockManifest.description }}\n            </p>\n\n            <p class=\"theme-tags\">\n              <span>{{fgcData.strings.tags}}:</span>{{ blockTags }}\n            </p>\n            \n          </div>\n        </div>\n\n        <div class=\"theme-actions\">\n          <div class=\"inactive-theme\">\n            <a v-if=\"alreadyInstaleld\" @click.prevent=\"uninstallBlock\" class=\"button activate\">{{fgcData.strings.uninstall}}</a>\n            <a v-else @click.prevent=\"installBlock\" class=\"button activate\">{{fgcData.strings.install}}</a>\n            <a :href=\"blockUrl\" target=\"_blank\" class=\"button button-primary load-customize hide-if-no-customize\">{{fgcData.strings.visit_homepage}}</a>\n            <a v-if=\"isLocalBlock\" class=\"button install-block-btn button-delete load-customize hide-if-no-customize\" @click.prevent=\"deleteBlock\">{{fgcData.strings.delete_block}}</a>\n          </div>\n        </div>\n      </div>\n    </div>\n  </div>",mounted:function b(){var a=this;window.addEventListener("keyup",this.keypressEvent),!window.store.state.installedBlocks.filter(function(c){return c.package_name==a.block.packageName}).length||(this.alreadyInstaleld=!0)},computed:{blockManifest:function b(){var a=JSON.parse(this.block.blockManifest);return"string"==typeof a&&""!=a?JSON.parse(a):a},isLocalBlock:function a(){return this.blockManifest&&this.blockManifest.isLocal||!1},blockUrl:function a(){return this.blockManifest.homepage?this.blockManifest.homepage:this.blockManifest.author&&"object"==_typeof(this.blockManifest.author)&&this.blockManifest.author.url?this.blockManifest.author.url:"https://www.npmjs.com/package/".concat(this.block.packageName)},authorUrl:function a(){return this.blockManifest.author&&"object"==_typeof(this.blockManifest.author)&&this.blockManifest.author.url?this.blockManifest.author.url:this.blockManifest.homepage?this.blockManifest.homepage:"https://www.npmjs.com/package/".concat(this.block.packageName)},blockAuthor:function a(){return this.blockManifest.author&&"object"==_typeof(this.blockManifest.author)&&this.blockManifest.author.name?this.blockManifest.author.name:this.blockManifest.author&&"string"==typeof this.blockManifest.author?this.blockManifest.author:null},blockTags:function a(){return this.blockManifest?this.blockManifest.keywords.join(", "):""}},methods:{keypressEvent:function b(a){27===a.keyCode&&this.closeOverlay()},closeOverlay:function a(){window.store.commit("openOverlay",null)},installBlock:function c(){var a=this;this.spinnerLoaded=!0;var b=this.block;console.log("Install block",b),jQuery.ajax({type:"POST",url:fgcData.ajaxUrl,data:{action:"fgc_install_block",data:b}}).done(function(b){a.alreadyInstaleld=!0,a.spinnerLoaded=!1,a.isLocalBlock||a.incrementInstalls(a.block.packageName),window.store.dispatch("getInstalledBlocks"),window.store.commit("setNotification",{text:"".concat(fgcData.strings.the_block," <b>").concat(a.block.name,"</b> ").concat(fgcData.strings.block_installed),class:"show success"}),console.log("Block installed ",b.data)}).fail(function(b){a.installing=!1,console.log("There is some issues installing block: ",b)})},deleteBlock:function c(){var a=this;this.spinnerLoaded=!0,this.alreadyInstaleld&&this.uninstallBlock();var b={block:this.block,nonce:fgcData.ajaxNonce};jQuery.ajax({type:"POST",url:fgcData.ajaxUrl,data:{action:"fgc_delete_block",data:b}}).done(function(b){window.store.commit("setNotification",{text:"".concat(fgcData.strings.the_block," <b>").concat(a.block.name,"</b> ").concat(fgcData.strings.block_deleted),class:"show success"}),window.store.commit("setRefetchBlocks",!0),a.closeOverlay(),a.spinnerLoaded=!1,window.store.dispatch("getInstalledBlocks"),console.log("Block removed ",b.data)}).fail(function(b){a.installing=!1,console.log("There is some issues installing block: ",b)})},uninstallBlock:function c(){var a=this,b=this.block;jQuery.ajax({type:"POST",url:fgcData.ajaxUrl,data:{action:"fgc_uninstall_block",data:b}}).done(function(b){a.alreadyInstaleld=!1,a.isLocalBlock||a.decrementInstalls(a.block.packageName),window.store.dispatch("getInstalledBlocks"),window.store.commit("setNotification",{text:"".concat(fgcData.strings.block," <b>").concat(a.block.name,"</b> ").concat(fgcData.strings.block_uninstalled),class:"show success"}),console.log("Block uninstalled ",b.data)}).fail(function(b){a.installing=!1,console.log("There is some issues uninstalling block: ",b)})},incrementInstalls:function b(a){jQuery.ajax({type:"PUT",url:"https://api.gutenbergcloud.org/blocks/".concat(a)}).done(function(){console.log("Installation counter increased ")}).fail(function(a){console.log("Some errors occured white increasing number of installs: ",a)})},decrementInstalls:function b(a){jQuery.ajax({type:"DELETE",url:"https://api.gutenbergcloud.org/blocks/".concat(a)}).done(function(){console.log("Installation counter decreased ")}).fail(function(a){console.log("Some errors occured white increasing number of installs: ",a)})}}}),Vue.component("explorer-filter",{componenets:["filter-drawer"],data:function a(){return{drawerFilterOpen:!1,searchQuery:null,filterLinks:[{name:fgcData.strings.installed,slug:"installed"},{name:fgcData.strings.popular,slug:"popular"},{name:fgcData.strings.latest,slug:"latest"},{name:fgcData.strings.local,slug:"local"}]}},template:"\n    <div class=\"wp-filter g-blocks-filter hide-if-no-js\">\n      <div class=\"filter-count\">\n        <span class=\"count theme-count\">{{ blocksCount }}</span>\n      </div>\n\n      <ul class=\"filter-links\">\n        <li><a v-for=\"filter in filterLinks\" :key=\"filter.slug\" @click=\"filterLink(filter.slug)\" :class=\"currentFilter(filter.slug)\">{{ filter.name }}</a></li>\n      </ul>\n\n      <button type=\"button\" v-if=\"false\" id=\"searchFilter\" class=\"button drawer-toggle\" :aria-expanded=\"drawerFilterOpen\" @click=\"drawerFilterOpen = !drawerFilterOpen\">{{fgcData.strings.filter}}</button>\n\n      <form class=\"search-form\" @submit.prevent=\"searchForBlock\"><label class=\"screen-reader-text\" for=\"wp-filter-search-input\">{{fgcData.strings.search_for_blocks}}</label><input :placeholder=\"fgcData.strings.search_blocks\" v-model=\"searchQuery\" type=\"search\" id=\"wp-filter-search-input\" class=\"wp-filter-search\"></form>\n\n      <filter-drawer :style=\"{display: drawerFilterOpen ? 'block' : 'none'}\"></filter-drawer>\n    </div>\n  ",mounted:function a(){window.store.state.installedBlocks.length||"local"==window.store.state.browseState||this.filterLink("popular")},methods:{filterLink:function c(a){var b=window.location.search.replace(/\&browse[=a-z]*/,"");history.pushState({state:a},null,"".concat(b,"&browse=").concat(a)),window.store.commit("setBrowseState",a)},currentFilter:function b(a){return window.store.state.browseState==a?"current":""},searchForBlock:function c(){var a=window.location.search.replace(/\&q[=a-z\-]*/,""),b=this.searchQuery.replace(/\s+/g,"-").toLowerCase();history.pushState({state:b},null,"".concat(a,"&q=").concat(b)),window.store.commit("setSearchQuery",b)}},computed:{blocksCount:function a(){return"installed"===window.store.state.browseState?window.store.state.installedBlocks.length:window.store.state.blocksCount}}}),Vue.component("filter-drawer",{template:"\n    <div class=\"filter-drawer\">\n      <div class=\"buttons\">\n        <button type=\"button\" class=\"apply-filters button\">Apply Filters<span></span></button>\n        <button type=\"button\" class=\"clear-filters button\" aria-label=\"Clear all filters\">Clear</button>\n      </div>\n      <fieldset class=\"filter-group\">\n        <legend>Subject</legend>\n        <div class=\"filter-group-feature\">\n          <input type=\"checkbox\" id=\"filter-id-blog\" value=\"blog\">\n          <label for=\"filter-id-blog\">Blog</label>\n          <input type=\"checkbox\" id=\"filter-id-e-commerce\" value=\"e-commerce\">\n          <label for=\"filter-id-e-commerce\">E-Commerce</label>\n          <input type=\"checkbox\" id=\"filter-id-education\" value=\"education\">\n          <label for=\"filter-id-education\">Education</label>\n          <input type=\"checkbox\" id=\"filter-id-entertainment\" value=\"entertainment\">\n          <label for=\"filter-id-entertainment\">News</label>\n        </div>\n      </fieldset>\n      <fieldset class=\"filter-group\">\n        <legend>Features</legend>\n        <div class=\"filter-group-feature\">\n          <input type=\"checkbox\" id=\"filter-id-accessibility-ready\" value=\"accessibility-ready\">\n          <label for=\"filter-id-accessibility-ready\">Custom Colors</label>\n          <input type=\"checkbox\" id=\"filter-id-custom-background\" value=\"custom-background\">\n          <label for=\"filter-id-custom-background\">Editor style</label>\n          <input type=\"checkbox\" id=\"filter-id-custom-colors\" value=\"custom-colors\">\n          <label for=\"filter-id-custom-colors\">Full Width Template</label>\n        </div>  \n      </fieldset>\n      <fieldset class=\"filter-group\">\n        <legend>Layout</legend>\n        <div class=\"filter-group-feature\">\n          <input type=\"checkbox\" id=\"filter-id-grid-layout\" value=\"grid-layout\">\n          <label for=\"filter-id-grid-layout\">Grid-layout</label>\n          <input type=\"checkbox\" id=\"filter-id-one-column\" value=\"one-column\">\n          <label for=\"filter-id-one-column\">One Column</label>\n          <input type=\"checkbox\" id=\"filter-id-two-columns\" value=\"two-columns\">\n          <label for=\"filter-id-two-columns\">Two Column</label>\n          <input type=\"checkbox\" id=\"filter-id-three-columns\" value=\"three-columns\">\n          <label for=\"filter-id-three-columns\">Responsive</label>\n        </div>\n      </fieldset>\n      <div class=\"buttons\">\n        <button type=\"button\" class=\"apply-filters button\">Apply Filters<span></span></button>\n        <button type=\"button\" class=\"clear-filters button\" aria-label=\"Clear all filters\">Clear</button>\n      </div>\n\n    </div>\n  "});var store=new Vuex.Store({state:{notification:{},browseState:null,installedBlocks:fgcData.installedBlocks,searchQuery:null,opendOverlay:null,blocksCount:0,refetchBlocks:!1},mutations:{setNotification:function c(a,b){a.notification=b},setBrowseState:function c(a,b){a.browseState=b},setInstalledBlocks:function c(a,b){a.installedBlocks=b},setSearchQuery:function c(a,b){a.searchQuery=b},openOverlay:function c(a,b){a.opendOverlay=b},setBlocksCount:function c(a,b){a.blocksCount=b},setRefetchBlocks:function c(a,b){a.refetchBlocks=b}},actions:{getInstalledBlocks:function b(a){jQuery.ajax({type:"GET",url:fgcData.ajaxUrl,data:{action:"fgc_get_all_blocks"}}).done(function(b){a.commit("setInstalledBlocks",b.data)}).fail(function(a){console.log("There is some issues installing block: ",a)})}}}),app=new Vue({el:"#blockExplorer",data:function a(){return{blocks:[]}},created:function c(){window.store.dispatch("getInstalledBlocks");var a=this.getUrlParams("browse")?this.getUrlParams("browse"):"installed",b=this.getUrlParams("q")?this.getUrlParams("q"):"";this.getBlocks({state:a,q:b}),window.store.commit("setBrowseState",a)},mounted:function a(){window.addEventListener("popstate",this.fetchBlocks)},watch:{currentBrowseFilter:function c(a){var b=this.getUrlParams("q")?this.getUrlParams("q"):"";window.store.dispatch("getInstalledBlocks");this.getBlocks({state:a,q:b})},currentSearchQuery:function c(a){var b=this.getUrlParams("browse")?this.getUrlParams("browse"):"installed";window.store.dispatch("getInstalledBlocks");this.getBlocks({state:b,q:a})},installedBlocks:function d(a,b){var c=this.getUrlParams("browse")?this.getUrlParams("browse"):"installed";a.length!=b.length&&"installed"==c&&(this.blocks=this.blocks.filter(function(b){return a.some(function(a){return a.package_name==b.packageName})}))},refetchBlocks:function b(){var a=this.getUrlParams("browse")?this.getUrlParams("browse"):"installed";this.getBlocks({state:a})}},methods:{fetchBlocks:function c(a){var b=null;a.state&&(b=a.state.state),this.getBlocks(b)},getBlocks:function l(a){var b=this,c=[],d="";if(a.q&&null!==a.q&&(d="q=".concat(a.q)),null!==a.state&&(d+="&order=".concat(a.state)),null!=a.state&&"installed"!=a.state)"local"==a.state?this.localBlocks(a):jQuery.get("https://api.gutenbergcloud.org/blocks?".concat(d),function(d){d.count&&window.store.commit("setBlocksCount",d.count);var e=!0,f=!1,g=void 0;try{for(var h,i=function(){var d=h.value,e={};e.jsUrl="https://unpkg.com/".concat(d.name,"@").concat(d.version,"/").concat(d.config.js),e.cssUrl="https://unpkg.com/".concat(d.name,"@").concat(d.version,"/").concat(d.config.css),e.editorCss=d.config.editor?"https://unpkg.com/".concat(d.name,"@").concat(d.version,"/").concat(d.config.editor):null,e.infoUrl="https://www.npmjs.com/package/".concat(d.name),e.imageUrl="https://unpkg.com/".concat(d.name,"@").concat(d.version,"/").concat(d.config.screenshot),e.name=d.config.name,e.blockManifest=JSON.stringify(d.package),e.version=d.version,e.packageName=d.name,null==a.state||"installed"==a.state?b.installedBlocks.length&&b.installedBlocks.filter(function(a){return a.package_name==e.packageName}).length&&c.push(e):c.push(e)},j=d.rows[Symbol.iterator]();!(e=(h=j.next()).done);e=!0)i()}catch(a){f=!0,g=a}finally{try{e||null==j.return||j.return()}finally{if(f)throw g}}});else if(this.installedBlocks.length){var e=!0,f=!1,g=void 0;try{for(var h,i=this.installedBlocks[Symbol.iterator]();!(e=(h=i.next()).done);e=!0){var j=h.value,k={};k.jsUrl=j.js_url,k.cssUrl=j.css_url,k.editorCss=j.editor_css,k.infoUrl=j.info_url,k.imageUrl=j.thumbnail,k.name=j.block_name,k.blockManifest="\""+j.block_manifest+"\"",k.version=j.block_version,k.packageName=j.package_name,(a.q&&null!==a.q&&(-1<k.name.toLowerCase().indexOf(a.q.toLowerCase())||-1<k.packageName.toLowerCase().indexOf(a.q.toLowerCase()))||!a.q)&&c.push(k)}}catch(a){f=!0,g=a}finally{try{e||null==i.return||i.return()}finally{if(f)throw g}}}this.blocks=c},getUrlParams:function e(a,b){b||(b=window.location.href),a=a.replace(/[\[\]]/g,"\\$&");var c=new RegExp("[?&]"+a+"(=([^&#]*)|&|#|$)"),d=c.exec(b);return d?d[2]?decodeURIComponent(d[2].replace(/\+/g," ")):"":null},showUploader:function a(){document.body.classList.toggle("show-upload-view")},localBlocks:function c(a){var b=this;jQuery.ajax({type:"POST",url:fgcData.ajaxUrl,data:{action:"fgc_local_blocks"}}).done(function(c){c.data.length?(window.store.commit("setBlocksCount",c.data.length),window.store.commit("setRefetchBlocks",!1)):window.store.commit("setBlocksCount",0),b.blocks=a.q&&null!==a.q?c.data.filter(function(b){return-1<b.name.toLowerCase().indexOf(a.q.toLowerCase())||-1<b.packageName.toLowerCase().indexOf(a.q.toLowerCase())}):c.data}).fail(function(a){console.log("There is some issues getting local blocks: ",a)})}},computed:{currentBrowseFilter:function a(){return window.store.state.browseState},currentSearchQuery:function a(){return window.store.state.searchQuery},installedBlocks:function a(){return window.store.state.installedBlocks},openOverlay:function a(){return window.store.state.opendOverlay},refetchBlocks:function a(){return window.store.state.refetchBlocks}}});
  • cloud-blocks/tags/1.1.4/assets/source/js/block-component.js

    r2007547 r2025157  
    7676                theBlock.version = block.version
    7777                theBlock.packageName = block.name
     78 
     79                if (res.version && b.block_version < res.version) {
     80                  this.updateAvailable = true
     81                  theBlock.availVersion = block.version
     82                }
     83
    7884                this.fromCloud = theBlock
    79               }
    80               if (res && res.version && b.block_version < res.version) {
    81                 this.updateAvailable = true
     85               
     86                if (this.updateAvailable) {
     87                  this.setAvalVersion()
     88                }
    8289              }
    8390            })
     
    166173        })
    167174    },
     175    setAvalVersion() {
     176      let postData = this.fromCloud
     177      jQuery.ajax({
     178        type: 'POST',
     179        url: fgcData.ajaxUrl,
     180        data: {
     181          action: "fgc_update_version",
     182          data: postData
     183        }
     184      })
     185        .done(res => {
     186          console.log('Available new version ', res.data) 
     187        })
     188        .fail(error => {
     189          console.log('There is some issues: ', error)
     190        })
     191    },
    168192    incrementInstalls(packageName) {
    169193      jQuery.ajax({
  • cloud-blocks/tags/1.1.4/cloud-blocks.php

    r2020434 r2025157  
    22/*
    33Plugin Name: Cloud Blocks
    4 Version: 1.1.3
     4Version: 1.1.4
    55Description: Your library of Gutenberg blocks in the cloud
    66Author: Frontkom
     
    3030// Plugin version .
    3131if ( ! defined( 'FGC_VERSION' ) ) {
    32     define( 'FGC_VERSION', '1.1.3' );
     32    define( 'FGC_VERSION', '1.1.4' );
    3333}
    3434
     
    3737
    3838// Register text-domain for translations
    39 add_action( 'plugins_loaded', 'fgc_register_textdomain' );
    40 function fgc_register_textdomain() {
     39add_action( 'plugins_loaded', 'fgc_register_translations' );
     40function fgc_register_translations() {
    4141    load_plugin_textdomain( 'cloud-blocks', false, basename( dirname( __FILE__ ) ) . '/languages' );
    4242}
     
    4545register_activation_hook( __FILE__, array( 'CloudBlocks\Activator', 'init' ) );
    4646
     47// Register CRON hooks
     48register_activation_hook( __FILE__, array( 'CloudBlocks\Blocks\Explore', 'cron_schedule' ) );
     49register_deactivation_hook( __FILE__, array( 'CloudBlocks\Blocks\Explore', 'cron_unschedule' ) );
     50
     51
    4752// Initiate plugin
    4853new CloudBlocks\CloudBlocks;
  • cloud-blocks/tags/1.1.4/core/Activator.php

    r2005063 r2025157  
    1 <?php 
     1<?php
    22
    33namespace CloudBlocks;
     4
     5use CloudBlocks\Blocks\Explore;
    46
    57/**
     
    1012 */
    1113class Activator {
    12  
     14
    1315    /**
    1416   * Current version of custom db table
    1517     * @param object
    1618     */
    17   public static $current_db_version = '1.2';
    18  
     19  public static $current_db_version = '1.3';
     20
    1921  /**
    2022  * activate, runs at plugin activation.
     
    2527  public static function init() {
    2628    self::create_db();
     29
    2730  }
    2831
     
    3740    $charset_collate = $wpdb->get_charset_collate();
    3841    $table_name = $wpdb->prefix . str_replace( '-', '_', FGC_NAME );
    39  
     42
    4043    $sql = "CREATE TABLE $table_name (
    4144      id mediumint(9) NOT NULL AUTO_INCREMENT,
     
    5154      block_installed datetime DEFAULT CURRENT_TIMESTAMP,
    5255      block_updated datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
     56      available_version varchar(10) DEFAULT '' NOT NULL,
    5357      PRIMARY KEY  (id)
    5458    ) $charset_collate;";
    55  
     59
    5660    require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
    5761    dbDelta( $sql );
     
    5963    update_option( 'gutenberg_cloud_db_version', '1.0' );
    6064  }
    61  
     65
    6266
    6367  /**
     
    8892        block_installed datetime DEFAULT CURRENT_TIMESTAMP,
    8993        block_updated datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
     94        available_version varchar(10) DEFAULT '' NOT NULL,
    9095        PRIMARY KEY  (id)
    9196      ) $charset_collate;";
     
    98103
    99104  }
    100  
     105
    101106}
  • cloud-blocks/tags/1.1.4/core/Blocks/Blocks.php

    r2020451 r2025157  
    2525    add_action( 'wp_ajax_fgc_update_block', array( $this, 'update' ) );
    2626    add_action( 'wp_ajax_nopriv_fgc_update_block', array( $this, 'update' ) );
     27
     28    add_action( 'wp_ajax_fgc_update_version', array( $this, 'update_version' ) );
     29    add_action( 'wp_ajax_nopriv_fgc_update_version', array( $this, 'update_version' ) );
    2730
    2831    add_action( 'wp_ajax_fgc_local_blocks', array( $this, 'local_blocks' ) );
     
    6265        'thumbnail'       => isset( $block['imageUrl'] ) ? $block['imageUrl'] : '',
    6366        'block_version'   => isset( $block['version'] ) ? $block['version'] : '',
    64         'block_manifest'  => isset( $block['blockManifest'] ) ? $block['blockManifest'] : ''
     67        'block_manifest'  => isset( $block['blockManifest'] ) ? $block['blockManifest'] : '',
     68        'available_version'   => isset( $block['availVersion'] ) ? $block['availVersion'] : ''
    6569      );
    6670      Options::add( $new_block, true );
     
    126130        'thumbnail'       => isset( $block['imageUrl'] ) ? $block['imageUrl'] : '',
    127131        'block_version'   => isset( $block['version'] ) ? $block['version'] : '',
    128         'block_manifest'  => isset( $block['blockManifest'] ) ? $block['blockManifest'] : ''
     132        'block_manifest'  => isset( $block['blockManifest'] ) ? $block['blockManifest'] : '',
     133        'available_version'   => isset( $block['availVersion'] ) ? $block['availVersion'] : ''
    129134      );
    130135
     
    151156    );
    152157    wp_send_json_success( $response );
     158  }
     159
     160  /**
     161   * Update available block version.
     162   *
     163   * @since 1.1.4
     164   * @param
     165   * @return
     166   */
     167  public static function update_version( $block = false ) {
     168      if( !$block ) {
     169          $block = $_REQUEST['data'];
     170      }
     171
     172      if ( isset( $block ) ) {
     173          $the_block = array(
     174            'package_name'    => isset( $block['packageName'] ) ? $block['packageName'] : $block['package']['name'],
     175            'available_version'   => isset( $block['availVersion'] ) ? $block['availVersion'] : $block['version']
     176          );
     177
     178          $existing_block = Options::get( $the_block['package_name'] );
     179          $block_id = Options::update_version( $existing_block->id, $the_block );
     180
     181          if ( isset( $block_id ) ) {
     182            $response = array(
     183              'code'      => 200,
     184              'message'   => 'Succesfully updated.'
     185            );
     186          } else {
     187            $response = array(
     188              'code'      => 400,
     189              'message'   => 'Version could not be updated!'
     190            );
     191          }
     192          wp_send_json_success( $response );
     193      }
     194      $response = array(
     195          'code'      => 400,
     196          'message'   => 'Version could not be updated!'
     197      );
     198      wp_send_json_success( $response );
    153199  }
    154200
     
    191237      $block_script = null;
    192238      $block_thumbnail = null;
    193      
     239
    194240      // Extract block js and css files
    195241      foreach ($block_files as $file) {
     
    204250        }
    205251      }
    206       // Extract block screenshot 
     252      // Extract block screenshot
    207253      foreach ($screenshot as $img) {
    208254        if ( preg_match('/thumbnail|screenshot/i', $img) ) {
     
    245291      );
    246292
    247      
     293
    248294    }
    249295
     
    269315      $block = str_replace( $destination['baseurl'] . '/gutenberg-blocks/', '', $block );
    270316      preg_match( '/[a-zA-Z0-9-_]*(?!:\/)/i', $block, $block_dir );
    271      
     317
    272318      $filesystem = new \WP_Filesystem_Direct(array());
    273319      $removed = $filesystem->delete( $destination_path . $block_dir[0], true );
     
    307353      foreach ($blocks as $block) {
    308354        /**
    309          * Use this filter in your functions.php or custom plugin 
     355         * Use this filter in your functions.php or custom plugin
    310356         * to enable/disable styling per individual block or for all of them.
    311357         */
     
    314360          wp_register_style( str_replace( ' ', '-', $block->block_name ) , $block->css_url, array(), $block->block_version);
    315361          wp_enqueue_style( str_replace( ' ', '-', $block->block_name ) );
    316          
     362
    317363          if (is_admin() && isset( $block->editor_css ) && !empty( $block->editor_css ) ) {
    318364            wp_register_style( str_replace( ' ', '-', $block->block_name ) . '-editor' , $block->editor_css, array(), $block->block_version);
  • cloud-blocks/tags/1.1.4/core/Blocks/Explore.php

    r2011877 r2025157  
    33namespace CloudBlocks\Blocks;
    44
     5use CloudBlocks\Blocks\Options;
     6use CloudBlocks\Blocks\Blocks;
     7
    58class Explore {
    6  
     9
    710    /**
    811     * @param object $page_title
     
    2528    self::$page_title = ucwords( str_replace( '-', ' ', FGC_NAME ) );
    2629    self::$menu_slug = FGC_NAME;
    27     // Add menu
    28     add_action( 'admin_menu', array( __class__, 'add_menu') );
     30
     31    // Add menu
     32    add_action( 'admin_menu', array( __CLASS__, 'add_menu') );
    2933    // Handle uploading custom blocks as zip files
    3034    add_action( 'init', array( __CLASS__, 'upload_block' ) );
     35    // Schedule cron with check updates
     36    add_action( 'admin_init', array( __CLASS__, 'cron_schedule' ) );
     37    add_action( 'fgc_cron_check_updates', array( __CLASS__, 'check_updates' ) );
    3138  }
    3239
     
    5158          $okay = true;
    5259          break;
    53         } 
    54       }
    55      
     60        }
     61      }
     62
    5663      $continue = strtolower( $name[1] ) == 'zip' ? true : false;
    5764      if ( !$continue ) {
     
    6370        $destination_path = $destination['basedir'] . '/gutenberg-blocks/';
    6471        $create_folder = wp_mkdir_p( $destination_path );
    65        
     72
    6673        // Here the magic happens.
    6774        if ( move_uploaded_file( $source, $destination_path . $filename ) ) {
     
    101108    );
    102109  }
    103  
     110
    104111  /**
    105112   * Settings page output.
     
    135142        </div>
    136143      </div>
    137        
     144
    138145      <admin-notice></admin-notice>
    139146      <explorer-filter></explorer-filter>
    140      
     147
    141148          <div class="theme-browser content-filterable rendered">
    142149        <div class="themes wp-clearfix">
     
    157164   * @return $counter
    158165   */
    159 
    160166  public static function count_updates() {
    161167    $counter = 0;
    162 
    163168    $installed_blocks = Options::get_all();
     169
    164170    foreach ($installed_blocks as $block) {
    165       // We must check if block is not local block, then we check for new versino availability
     171      // We must check if block is not local block, then we check for new version availability
    166172      $manifest = json_decode( stripslashes( $block->block_manifest ), true );
    167       if ( empty($manifest['isLocal']) ) {
    168         $args = array(
    169           'method' => 'GET'
    170         );
    171         $response = wp_remote_request( 'https://api.gutenbergcloud.org/blocks/' . $block->package_name, $args );
    172         $body = wp_remote_retrieve_body( $response );
    173         $json = json_decode($body, true);
    174 
    175         if( !empty($json['version']) && $json['version'] !== $block->block_version) {
    176           $counter++;
     173
     174      if( empty($manifest['isLocal']) && !empty($block->available_version) && version_compare($block->available_version, $block->block_version, '>')) {
     175        $counter++;
     176      }
     177    }
     178
     179    return $counter;
     180  }
     181
     182  /**
     183  * CRON schedule.
     184  *
     185  * @since 1.1.4
     186  * @param
     187  * @return
     188  */
     189  public static function cron_schedule() {
     190    if ( !wp_next_scheduled( 'fgc_cron_check_updates' ) ) {
     191        wp_schedule_event(time(), 'daily', 'fgc_cron_check_updates');
     192    }
     193  }
     194
     195  /**
     196  * CRON unschedule.
     197  *
     198  * @since 1.1.4
     199  * @param
     200  * @return
     201  */
     202  public static function cron_unschedule() {
     203    wp_clear_scheduled_hook('fgc_cron_check_updates');
     204  }
     205
     206  /**
     207  * CRON schedule.
     208  *
     209  * @since 1.1.4
     210  * @param
     211  * @return
     212  */
     213  public static function check_updates() {
     214    $installed_blocks = Options::get_all();
     215
     216      foreach ( $installed_blocks as $block ) {
     217        // We must check if block is not local block, then we check for new version availability
     218        $manifest = json_decode( stripslashes( $block->block_manifest ), true );
     219        if ( empty( $manifest['isLocal'] ) ) {
     220          $args     = array(
     221            'method' => 'GET'
     222          );
     223          $response = wp_remote_request( 'https://api.gutenbergcloud.org/blocks/' . $block->package_name, $args );
     224          $body     = wp_remote_retrieve_body( $response );
     225          $the_block  = json_decode( $body, true );
     226
     227          if( !empty($the_block['version']) && $the_block['version'] !== $block->block_version) {
     228              $_REQUEST['data'] = $the_block;
     229              Blocks::update_version($the_block);
     230          }
    177231        }
    178232      }
    179     }
    180 
    181     return $counter;
     233
    182234  }
    183235
  • cloud-blocks/tags/1.1.4/core/Blocks/Options.php

    r1962907 r2025157  
    153153        'thumbnail'       => $thumbnail,
    154154        'block_version'   => $block_version,
    155         'block_manifest'   => $block_manifest
     155        'block_manifest'   => $block_manifest,
     156        'available_version' => ''
    156157      ),
    157158      array(
     
    163164  }
    164165
     166    /**
     167     * Update existing value in database.
     168     * @since 1.1.4
     169     * @param array $options   The options need to be stored into database
     170     * @return int $id         Inserted records id
     171     */
     172    public static function update_version( $id, $options ) {
     173        global $wpdb;
     174
     175        $available_version = $options['available_version'];
     176
     177        $table_name = $wpdb->prefix . str_replace( '-', '_', FGC_NAME );
     178
     179        $id = $wpdb->update(
     180            $table_name,
     181            array(
     182                'available_version' => $available_version
     183            ),
     184            array(
     185                'id'      => $id
     186            )
     187        );
     188
     189        return $id;
     190    }
     191
    165192  /**
    166193  * Get all installed blocks.
     
    209236
    210237  /**
    211   * Increate number of installs on api.gutenbergcloud.org
     238  * Increase number of installs on api.gutenbergcloud.org
    212239  * @since 1.0.0
    213240  * @param string|null $package_name    npm package name
    214241  * @return object|null $body           Request response
    215242  */
    216   public static function increate_installs( $package_name = null ) {
     243  public static function increase_installs( $package_name = null ) {
    217244    if ( empty( $package_name )  ) {
    218245      return;
  • cloud-blocks/tags/1.1.4/core/CloudBlocks.php

    r2020434 r2025157  
    2020  public function __construct() {
    2121    global $wp_version;
    22    
     22
    2323    include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
    2424    if ( \is_plugin_active( 'gutenberg/gutenberg.php' ) || (int) $wp_version >= 5 ) {
     
    8080  */
    8181  public function enqueue_scripts() {
    82     wp_enqueue_script( 'vuejs', 'https://unpkg.com/vue@2.5.17/dist/vue.min.js', array( 'jquery' ), FGC_VERSION, true );
    83     wp_enqueue_script( 'vuex', 'https://unpkg.com/vuex@3.0.1/dist/vuex.min.js', array('vuejs'), FGC_VERSION, TRUE );
     82    wp_enqueue_script( 'vuejs', 'https://cdn.jsdelivr.net/npm/vue@2.5.17/dist/vue.min.js', array( 'jquery' ), FGC_VERSION, true );
     83    wp_enqueue_script( 'vuex', 'https://cdn.jsdelivr.net/npm/vuex@3.1.0/dist/vuex.min.js', array( 'vuejs' ), FGC_VERSION, true );
    8484    wp_enqueue_script( 'gutenberg_cloud_admin_js', FGC_URL . 'assets/js/script.js', array( 'jquery', 'vuejs', 'vuex' ), FGC_VERSION, true );
    8585    $localized_data = array(
  • cloud-blocks/tags/1.1.4/core/Settings/Tools.php

    r1961288 r2025157  
    106106              self::add_notice( sprintf(__('Block <b>%s</b> already installed.', 'gutenberg-cloug'), $imported->block_name ), 'error' );
    107107            } else {
    108               Options::increate_installs( $block['package_name'] );
     108              Options::increase_installs( $block['package_name'] );
    109109              self::add_notice( sprintf(__('Block <b>%s</b> installed successfully.', 'gutenberg-cloug'), $block['block_name'] ), 'success' );
    110110            }
  • cloud-blocks/tags/1.1.4/docs/changelog.md

    r2020451 r2025157  
    11## Changelog
     2
     3#### 1.1.4
     4* **Change**: Update counter as a WP CRON (Thanks to [ajotka](https://github.com/front/cloud-blocks/pull/14))
     5* **Change**: Update some docs
     6* **Fix**: Fix polish translations
    27
    38#### 1.1.3
  • cloud-blocks/tags/1.1.4/docs/create-block.md

    r1965688 r2025157  
    8989Custom blocks generated by create-cloud-block tool come with all configuration needed to be distributed by Cloud Blocks. Also they have a deploy script which complies the build files and publish the package to NPM, so all we have to do is run `$ npm run deploy`.
    9090
    91 After about 15 minutes, your custom block is available to the world through [api.gutenbergcloud.org/blocks](https://api.gutenbergcloud.org/blocks). Congrats!
     91After our review, your custom block is available to the world through [api.gutenbergcloud.org/blocks](https://api.gutenbergcloud.org/blocks). Congrats!
    9292
    9393## Documentation
  • cloud-blocks/tags/1.1.4/docs/migrate-block.md

    r1965688 r2025157  
    147147or just `$ npm run deploy` if you used create-cloud-block tool.
    148148
    149 That’s it! Your block will be available to Gutenberg Cloud in a few minutes. Bravo!
     149That’s it! Your block will be available to Gutenberg Cloud after our review. Bravo!
  • cloud-blocks/tags/1.1.4/languages/cloud-blocks-pl_PL.po

    r2011879 r2025157  
    3030"again."
    3131msgstr ""
    32 "Plik, który próbujesz załadować zawiera niepoprawne rozszerzenie . Spróbuj "
     32"Plik, który próbujesz załadować zawiera niepoprawne rozszerzenie. Spróbuj "
    3333"ponownie."
    3434
     
    125125msgstr ""
    126126"Eksport wszystkich zainstalowanych bloków z Chmury Gutenberga jako plik JSON."
    127 " Uwaga: Treść bloków nie będzie wyeksportowana."
     127" Uwaga: Treść bloków nie będzie eksportowana."
    128128
    129129#: core/Settings/Tools.php:224
     
    229229#: core/Settings/Translations.php:38
    230230msgid "have been installed successfully."
    231 msgstr "zostało pomyślnie zainstalowane."
     231msgstr "został pomyślnie zainstalowany."
    232232
    233233#: core/Settings/Translations.php:39
    234234msgid "have been uninstalled successfully."
    235 msgstr "zostało pomyślnie odinstalowane."
     235msgstr "został pomyślnie odinstalowany."
    236236
    237237#: core/Settings/Translations.php:40
    238238msgid "have been deleted successfully."
    239 msgstr "zostało pomyślnie usunięte."
     239msgstr "został pomyślnie usunięty."
    240240
    241241#: core/Settings/Translations.php:41
    242242msgid "have been updated successfully."
    243 msgstr "zostało pomyślnie zaktualizowane."
     243msgstr "został pomyślnie zaktualizowany."
    244244
    245245#: core/Settings/Translations.php:42
     
    253253#: core/Settings/Translations.php:44
    254254msgid "Visit homepage"
    255 msgstr "Odwiedź stronę główną"
     255msgstr "Odwiedź stronę bloku"
    256256
    257257#: core/Settings/Translations.php:45
    258258msgid "Homepage"
    259 msgstr "Strona Główna"
     259msgstr "Strona Bloku"
    260260
    261261#: vendor/foadyousefi/seven-fields/src/Container/Container.php:196
  • cloud-blocks/tags/1.1.4/readme.txt

    r2020451 r2025157  
    66Tested up to: 5.0
    77Requires PHP: 5.4
    8 Stable tag: 1.1.3
     8Stable tag: 1.1.4
    99License: GPLv3
    1010License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    7575
    7676== Changelog ==
     77
     78= 1.1.4 =
     79* Change: Update counter as a WP CRON (Thanks to [ajotka](https://github.com/front/cloud-blocks/pull/14))
     80* Change: Update some docs
     81* Fix: Fix polish translations
    7782
    7883= 1.1.3 =
  • cloud-blocks/trunk/assets/js/script.js

    r2011877 r2025157  
    116116                theBlock.version = block.version
    117117                theBlock.packageName = block.name
     118 
     119                if (res.version && b.block_version < res.version) {
     120                  this.updateAvailable = true
     121                  theBlock.availVersion = block.version
     122                }
     123
    118124                this.fromCloud = theBlock
    119               }
    120               if (res && res.version && b.block_version < res.version) {
    121                 this.updateAvailable = true
     125               
     126                if (this.updateAvailable) {
     127                  this.setAvalVersion()
     128                }
    122129              }
    123130            })
     
    204211          this.installing = false
    205212          console.log('There is some issues updating block: ', error)
     213        })
     214    },
     215    setAvalVersion() {
     216      let postData = this.fromCloud
     217      jQuery.ajax({
     218        type: 'POST',
     219        url: fgcData.ajaxUrl,
     220        data: {
     221          action: "fgc_update_version",
     222          data: postData
     223        }
     224      })
     225        .done(res => {
     226          console.log('Available new version ', res.data) 
     227        })
     228        .fail(error => {
     229          console.log('There is some issues: ', error)
    206230        })
    207231    },
  • cloud-blocks/trunk/assets/js/script.min.js

    r2011877 r2025157  
    1 "use strict";function _typeof(a){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Vue.component("admin-notice",{data:function a(){return{activeTimeout:-1}},template:"\n    <div\n      :class=\"['fgc-notification', notification.class]\"\n      v-cloak>\n      <p v-html=\"notification.text\"></p>\n    </div>\n  ",watch:{isActive:function a(){this.showingTimeout()}},mounted:function a(){this.showingTimeout()},methods:{showingTimeout:function b(){var a=this;window.clearTimeout(this.activeTimeout),this.activeTimeout=window.setTimeout(function(){window.store.state.notification.class="",a.isShowing=!1},4e3)}},computed:{isActive:function a(){return window.store.state.notification.text},notification:function a(){return window.store.state.notification}}}),Vue.component("block-card",{props:["block"],data:function a(){return{installing:!1,alreadyInstaleld:!1,updateAvailable:!1,currentVersion:null,fromCloud:null}},template:"\n    <div class=\"theme\">\n      <div class=\"theme-screenshot\" @click=\"openMoreDetails\">\n        <img :src=\"block.imageUrl || fgcData.defaultThumbnail\" :alt=\"block.name\">\n        <div class=\"spinner installing-block\" v-if=\"installing\"></div>\n      </div>\n\n      <div v-if=\"currentBrowseState != 'installed' && alreadyInstaleld\" class=\"notice inline notice-success notice-alt\"><p>{{fgcData.strings.installed}}</p></div>\n\n      <div v-if=\"currentBrowseState == 'installed' && isLocalBlock\" class=\"notice inline notice-info notice-alt\"><p>{{fgcData.strings.local_block}}</p></div>\n\n      <div v-if=\"updateAvailable\" class=\"update-message notice inline notice-warning notice-alt\">\n        <p>{{fgcData.strings.update_available}} <button class=\"button-link\" type=\"button\" @click=\"updateBlock\">{{fgcData.strings.update_now}}</button></p>\n      </div>\n\n      <span class=\"more-details\" @click=\"openMoreDetails\">{{fgcData.strings.show_more_details}}</span>\n\n      <div class=\"theme-id-container\">\n        <h3 class=\"theme-name\">{{ block.name }}</h3>\n        <span v-if=\"blockManifest && blockManifest.author\" class=\"block-author\">{{fgcData.strings.by}}: \n          <span v-if=\"typeof blockManifest.author == 'object'\">\n            {{ blockManifest.author.name }}\n          </span>\n          <span v-if=\"typeof blockManifest.author == 'string'\">\n            {{ blockManifest.author }}\n          </span>\n        </span>\n        <span v-else class=\"block-version\">{{fgcData.strings.version}}: {{ currentVersion }}</span>\n\n        <div class=\"theme-actions\">\n          <button class=\"button button-primary theme-install install-block-btn\"\n              v-if=\"currentBrowseState != 'installed' && !alreadyInstaleld\"\n              @click.prevent=\"installBlock\">\n              {{fgcData.strings.install}}\n          </button>\n          <button class=\"button theme-install install-block-btn\"\n              v-else\n              @click.prevent=\"uninstallBlock\">\n              {{fgcData.strings.uninstall}}\n          </button>\n          <a class=\"button button-primary\" :href=\"blockUrl\" target=\"_blank\">{{fgcData.strings.homepage}}</a>\n        </div>\n      </div>\n\n    </div>\n  ",mounted:function b(){var a=this;this.currentVersion=this.block.version,!window.store.state.installedBlocks.filter(function(c){return c.package_name==a.block.packageName}).length||(this.alreadyInstaleld="installed"!=this.currentBrowseState,"installed"==this.currentBrowseState&&(window.store.state.installedBlocks.map(function(c){c.package_name!=a.block.packageName||a.isLocalBlock||jQuery.get("https://api.gutenbergcloud.org/blocks/".concat(c.package_name),function(b){if(b){var d=b,e={};e.jsUrl="https://unpkg.com/".concat(d.name,"@").concat(d.version,"/").concat(d.config.js),e.cssUrl="https://unpkg.com/".concat(d.name,"@").concat(d.version,"/").concat(d.config.css),e.editorCss=d.config.editor?"https://unpkg.com/".concat(d.name,"@").concat(d.version,"/").concat(d.config.editor):null,e.infoUrl="https://www.npmjs.com/package/".concat(d.name),e.imageUrl="https://unpkg.com/".concat(d.name,"@").concat(d.version,"/").concat(d.config.screenshot),e.name=d.config.name,e.blockManifest=JSON.stringify(d.package),e.version=d.version,e.packageName=d.name,a.fromCloud=e}b&&b.version&&c.block_version<b.version&&(a.updateAvailable=!0)})}),this.currentVersion=window.store.state.installedBlocks.filter(function(c){return c.package_name==a.block.packageName})[0].block_version))},methods:{installBlock:function c(){var a=this;this.installing=!0;var b=this.block;console.log("Install block",b),jQuery.ajax({type:"POST",url:fgcData.ajaxUrl,data:{action:"fgc_install_block",data:b}}).done(function(b){a.installing=!1,a.alreadyInstaleld=!0,a.isLocalBlock||a.incrementInstalls(a.block.packageName),window.store.dispatch("getInstalledBlocks"),window.store.commit("setNotification",{text:"".concat(fgcData.strings.the_block," <b>").concat(a.block.name,"</b> ").concat(fgcData.strings.block_installed),class:"show success"}),console.log("Block installed ",b.data)}).fail(function(b){a.installing=!1,console.log("There is some issues installing block: ",b)})},uninstallBlock:function c(){var a=this;this.installing=!0;var b=this.block;jQuery.ajax({type:"POST",url:fgcData.ajaxUrl,data:{action:"fgc_uninstall_block",data:b}}).done(function(b){a.installing=!1,a.alreadyInstaleld=!1,a.isLocalBlock||a.decrementInstalls(a.block.packageName),window.store.dispatch("getInstalledBlocks"),window.store.commit("setNotification",{text:"".concat(fgcData.strings.block," <b>").concat(a.block.name,"</b> ").concat(fgcData.strings.block_uninstalled),class:"show success"}),console.log("Block uninstalled ",b.data)}).fail(function(b){a.installing=!1,console.log("There is some issues uninstalling block: ",b)})},updateBlock:function c(){var a=this;this.installing=!0;var b=this.fromCloud;jQuery.ajax({type:"POST",url:fgcData.ajaxUrl,data:{action:"fgc_update_block",data:b}}).done(function(b){a.installing=!1,a.updateAvailable=!1,a.currentVersion=a.block.version,window.store.dispatch("getInstalledBlocks"),window.store.commit("setNotification",{text:"".concat(fgcData.strings.block," <b>").concat(a.block.name,"</b> ").concat(fgcData.strings.block_updated),class:"show success"}),console.log("Block Updated ",b.data)}).fail(function(b){a.installing=!1,console.log("There is some issues updating block: ",b)})},incrementInstalls:function b(a){jQuery.ajax({type:"POST",data:{increment:1},url:"https://api.gutenbergcloud.org/blocks/".concat(a)}).done(function(){console.log("Installation counter increased ")}).fail(function(a){console.log("Some errors occured white increasing number of installs: ",a)})},decrementInstalls:function b(a){jQuery.ajax({type:"POST",data:{increment:-1},url:"https://api.gutenbergcloud.org/blocks/".concat(a)}).done(function(){console.log("Installation counter decreased ")}).fail(function(a){console.log("Some errors occured white increasing number of installs: ",a)})},openMoreDetails:function a(){window.store.commit("openOverlay",this.block)}},computed:{currentBrowseState:function a(){return window.store.state.browseState},blockManifest:function b(){var a=JSON.parse(this.block.blockManifest);return"string"==typeof a&&""!=a?JSON.parse(a):a},isLocalBlock:function a(){return this.blockManifest&&this.blockManifest.isLocal||!1},blockUrl:function a(){return this.blockManifest.homepage?this.blockManifest.homepage:this.blockManifest.author&&"object"==_typeof(this.blockManifest.author)&&this.blockManifest.author.url?this.blockManifest.author.url:"https://www.npmjs.com/package/".concat(this.block.packageName)}}}),Vue.component("block-details",{props:["block"],data:function a(){return{alreadyInstaleld:!1,spinnerLoaded:!1}},template:"\n    <div class=\"theme-overlay\" tabindex=\"0\" role=\"dialog\"><div class=\"theme-overlay\">\n      <div class=\"theme-backdrop\"></div>\n      <div class=\"theme-wrap wp-clearfix\" role=\"document\">\n        <div class=\"theme-header\">\n          <button class=\"close dashicons dashicons-no\" @click=\"closeOverlay\"></button>\n        </div>\n\n        <div class=\"theme-about wp-clearfix\">\n          <div class=\"theme-screenshots\">\n            <div class=\"screenshot\">\n              <img :src=\"block.imageUrl || fgcData.defaultThumbnail\" :alt=\"block.name\">\n              <div class=\"spinner installing-block\" v-if=\"spinnerLoaded\"></div>\n            </div>\n          </div>\n\n          <div class=\"theme-info\">\n            <h2 class=\"theme-name\">\n              {{ block.name }}\n                <span class=\"theme-version\">{{fgcData.strings.version}}: {{ block.version }}</span>\n            </h2>\n            <p v-if=\"blockAuthor && authorUrl\" class=\"theme-author\">{{fgcData.strings.by}} <a :href=\"authorUrl\" target=\"_blank\">{{ blockAuthor }} </a></p>\n            <p v-else-if=\"blockAuthor\" class=\"theme-author\">{{fgcData.strings.by}} {{ blockAuthor }}</p>\n\n            \n            <p class=\"theme-description\">\n              {{ blockManifest.description }}\n            </p>\n\n            <p class=\"theme-tags\">\n              <span>{{fgcData.strings.tags}}:</span>{{ blockTags }}\n            </p>\n            \n          </div>\n        </div>\n\n        <div class=\"theme-actions\">\n          <div class=\"inactive-theme\">\n            <a v-if=\"alreadyInstaleld\" @click.prevent=\"uninstallBlock\" class=\"button activate\">{{fgcData.strings.uninstall}}</a>\n            <a v-else @click.prevent=\"installBlock\" class=\"button activate\">{{fgcData.strings.install}}</a>\n            <a :href=\"blockUrl\" target=\"_blank\" class=\"button button-primary load-customize hide-if-no-customize\">{{fgcData.strings.visit_homepage}}</a>\n            <a v-if=\"isLocalBlock\" class=\"button install-block-btn button-delete load-customize hide-if-no-customize\" @click.prevent=\"deleteBlock\">{{fgcData.strings.delete_block}}</a>\n          </div>\n        </div>\n      </div>\n    </div>\n  </div>",mounted:function b(){var a=this;window.addEventListener("keyup",this.keypressEvent),!window.store.state.installedBlocks.filter(function(c){return c.package_name==a.block.packageName}).length||(this.alreadyInstaleld=!0)},computed:{blockManifest:function b(){var a=JSON.parse(this.block.blockManifest);return"string"==typeof a&&""!=a?JSON.parse(a):a},isLocalBlock:function a(){return this.blockManifest&&this.blockManifest.isLocal||!1},blockUrl:function a(){return this.blockManifest.homepage?this.blockManifest.homepage:this.blockManifest.author&&"object"==_typeof(this.blockManifest.author)&&this.blockManifest.author.url?this.blockManifest.author.url:"https://www.npmjs.com/package/".concat(this.block.packageName)},authorUrl:function a(){return this.blockManifest.author&&"object"==_typeof(this.blockManifest.author)&&this.blockManifest.author.url?this.blockManifest.author.url:this.blockManifest.homepage?this.blockManifest.homepage:"https://www.npmjs.com/package/".concat(this.block.packageName)},blockAuthor:function a(){return this.blockManifest.author&&"object"==_typeof(this.blockManifest.author)&&this.blockManifest.author.name?this.blockManifest.author.name:this.blockManifest.author&&"string"==typeof this.blockManifest.author?this.blockManifest.author:null},blockTags:function a(){return this.blockManifest?this.blockManifest.keywords.join(", "):""}},methods:{keypressEvent:function b(a){27===a.keyCode&&this.closeOverlay()},closeOverlay:function a(){window.store.commit("openOverlay",null)},installBlock:function c(){var a=this;this.spinnerLoaded=!0;var b=this.block;console.log("Install block",b),jQuery.ajax({type:"POST",url:fgcData.ajaxUrl,data:{action:"fgc_install_block",data:b}}).done(function(b){a.alreadyInstaleld=!0,a.spinnerLoaded=!1,a.isLocalBlock||a.incrementInstalls(a.block.packageName),window.store.dispatch("getInstalledBlocks"),window.store.commit("setNotification",{text:"".concat(fgcData.strings.the_block," <b>").concat(a.block.name,"</b> ").concat(fgcData.strings.block_installed),class:"show success"}),console.log("Block installed ",b.data)}).fail(function(b){a.installing=!1,console.log("There is some issues installing block: ",b)})},deleteBlock:function c(){var a=this;this.spinnerLoaded=!0,this.alreadyInstaleld&&this.uninstallBlock();var b={block:this.block,nonce:fgcData.ajaxNonce};jQuery.ajax({type:"POST",url:fgcData.ajaxUrl,data:{action:"fgc_delete_block",data:b}}).done(function(b){window.store.commit("setNotification",{text:"".concat(fgcData.strings.the_block," <b>").concat(a.block.name,"</b> ").concat(fgcData.strings.block_deleted),class:"show success"}),window.store.commit("setRefetchBlocks",!0),a.closeOverlay(),a.spinnerLoaded=!1,window.store.dispatch("getInstalledBlocks"),console.log("Block removed ",b.data)}).fail(function(b){a.installing=!1,console.log("There is some issues installing block: ",b)})},uninstallBlock:function c(){var a=this,b=this.block;jQuery.ajax({type:"POST",url:fgcData.ajaxUrl,data:{action:"fgc_uninstall_block",data:b}}).done(function(b){a.alreadyInstaleld=!1,a.isLocalBlock||a.decrementInstalls(a.block.packageName),window.store.dispatch("getInstalledBlocks"),window.store.commit("setNotification",{text:"".concat(fgcData.strings.block," <b>").concat(a.block.name,"</b> ").concat(fgcData.strings.block_uninstalled),class:"show success"}),console.log("Block uninstalled ",b.data)}).fail(function(b){a.installing=!1,console.log("There is some issues uninstalling block: ",b)})},incrementInstalls:function b(a){jQuery.ajax({type:"PUT",url:"https://api.gutenbergcloud.org/blocks/".concat(a)}).done(function(){console.log("Installation counter increased ")}).fail(function(a){console.log("Some errors occured white increasing number of installs: ",a)})},decrementInstalls:function b(a){jQuery.ajax({type:"DELETE",url:"https://api.gutenbergcloud.org/blocks/".concat(a)}).done(function(){console.log("Installation counter decreased ")}).fail(function(a){console.log("Some errors occured white increasing number of installs: ",a)})}}}),Vue.component("explorer-filter",{componenets:["filter-drawer"],data:function a(){return{drawerFilterOpen:!1,searchQuery:null,filterLinks:[{name:fgcData.strings.installed,slug:"installed"},{name:fgcData.strings.popular,slug:"popular"},{name:fgcData.strings.latest,slug:"latest"},{name:fgcData.strings.local,slug:"local"}]}},template:"\n    <div class=\"wp-filter g-blocks-filter hide-if-no-js\">\n      <div class=\"filter-count\">\n        <span class=\"count theme-count\">{{ blocksCount }}</span>\n      </div>\n\n      <ul class=\"filter-links\">\n        <li><a v-for=\"filter in filterLinks\" :key=\"filter.slug\" @click=\"filterLink(filter.slug)\" :class=\"currentFilter(filter.slug)\">{{ filter.name }}</a></li>\n      </ul>\n\n      <button type=\"button\" v-if=\"false\" id=\"searchFilter\" class=\"button drawer-toggle\" :aria-expanded=\"drawerFilterOpen\" @click=\"drawerFilterOpen = !drawerFilterOpen\">{{fgcData.strings.filter}}</button>\n\n      <form class=\"search-form\" @submit.prevent=\"searchForBlock\"><label class=\"screen-reader-text\" for=\"wp-filter-search-input\">{{fgcData.strings.search_for_blocks}}</label><input :placeholder=\"fgcData.strings.search_blocks\" v-model=\"searchQuery\" type=\"search\" id=\"wp-filter-search-input\" class=\"wp-filter-search\"></form>\n\n      <filter-drawer :style=\"{display: drawerFilterOpen ? 'block' : 'none'}\"></filter-drawer>\n    </div>\n  ",mounted:function a(){window.store.state.installedBlocks.length||"local"==window.store.state.browseState||this.filterLink("popular")},methods:{filterLink:function c(a){var b=window.location.search.replace(/\&browse[=a-z]*/,"");history.pushState({state:a},null,"".concat(b,"&browse=").concat(a)),window.store.commit("setBrowseState",a)},currentFilter:function b(a){return window.store.state.browseState==a?"current":""},searchForBlock:function c(){var a=window.location.search.replace(/\&q[=a-z\-]*/,""),b=this.searchQuery.replace(/\s+/g,"-").toLowerCase();history.pushState({state:b},null,"".concat(a,"&q=").concat(b)),window.store.commit("setSearchQuery",b)}},computed:{blocksCount:function a(){return"installed"===window.store.state.browseState?window.store.state.installedBlocks.length:window.store.state.blocksCount}}}),Vue.component("filter-drawer",{template:"\n    <div class=\"filter-drawer\">\n      <div class=\"buttons\">\n        <button type=\"button\" class=\"apply-filters button\">Apply Filters<span></span></button>\n        <button type=\"button\" class=\"clear-filters button\" aria-label=\"Clear all filters\">Clear</button>\n      </div>\n      <fieldset class=\"filter-group\">\n        <legend>Subject</legend>\n        <div class=\"filter-group-feature\">\n          <input type=\"checkbox\" id=\"filter-id-blog\" value=\"blog\">\n          <label for=\"filter-id-blog\">Blog</label>\n          <input type=\"checkbox\" id=\"filter-id-e-commerce\" value=\"e-commerce\">\n          <label for=\"filter-id-e-commerce\">E-Commerce</label>\n          <input type=\"checkbox\" id=\"filter-id-education\" value=\"education\">\n          <label for=\"filter-id-education\">Education</label>\n          <input type=\"checkbox\" id=\"filter-id-entertainment\" value=\"entertainment\">\n          <label for=\"filter-id-entertainment\">News</label>\n        </div>\n      </fieldset>\n      <fieldset class=\"filter-group\">\n        <legend>Features</legend>\n        <div class=\"filter-group-feature\">\n          <input type=\"checkbox\" id=\"filter-id-accessibility-ready\" value=\"accessibility-ready\">\n          <label for=\"filter-id-accessibility-ready\">Custom Colors</label>\n          <input type=\"checkbox\" id=\"filter-id-custom-background\" value=\"custom-background\">\n          <label for=\"filter-id-custom-background\">Editor style</label>\n          <input type=\"checkbox\" id=\"filter-id-custom-colors\" value=\"custom-colors\">\n          <label for=\"filter-id-custom-colors\">Full Width Template</label>\n        </div>  \n      </fieldset>\n      <fieldset class=\"filter-group\">\n        <legend>Layout</legend>\n        <div class=\"filter-group-feature\">\n          <input type=\"checkbox\" id=\"filter-id-grid-layout\" value=\"grid-layout\">\n          <label for=\"filter-id-grid-layout\">Grid-layout</label>\n          <input type=\"checkbox\" id=\"filter-id-one-column\" value=\"one-column\">\n          <label for=\"filter-id-one-column\">One Column</label>\n          <input type=\"checkbox\" id=\"filter-id-two-columns\" value=\"two-columns\">\n          <label for=\"filter-id-two-columns\">Two Column</label>\n          <input type=\"checkbox\" id=\"filter-id-three-columns\" value=\"three-columns\">\n          <label for=\"filter-id-three-columns\">Responsive</label>\n        </div>\n      </fieldset>\n      <div class=\"buttons\">\n        <button type=\"button\" class=\"apply-filters button\">Apply Filters<span></span></button>\n        <button type=\"button\" class=\"clear-filters button\" aria-label=\"Clear all filters\">Clear</button>\n      </div>\n\n    </div>\n  "});var store=new Vuex.Store({state:{notification:{},browseState:null,installedBlocks:fgcData.installedBlocks,searchQuery:null,opendOverlay:null,blocksCount:0,refetchBlocks:!1},mutations:{setNotification:function c(a,b){a.notification=b},setBrowseState:function c(a,b){a.browseState=b},setInstalledBlocks:function c(a,b){a.installedBlocks=b},setSearchQuery:function c(a,b){a.searchQuery=b},openOverlay:function c(a,b){a.opendOverlay=b},setBlocksCount:function c(a,b){a.blocksCount=b},setRefetchBlocks:function c(a,b){a.refetchBlocks=b}},actions:{getInstalledBlocks:function b(a){jQuery.ajax({type:"GET",url:fgcData.ajaxUrl,data:{action:"fgc_get_all_blocks"}}).done(function(b){a.commit("setInstalledBlocks",b.data)}).fail(function(a){console.log("There is some issues installing block: ",a)})}}}),app=new Vue({el:"#blockExplorer",data:function a(){return{blocks:[]}},created:function c(){window.store.dispatch("getInstalledBlocks");var a=this.getUrlParams("browse")?this.getUrlParams("browse"):"installed",b=this.getUrlParams("q")?this.getUrlParams("q"):"";this.getBlocks({state:a,q:b}),window.store.commit("setBrowseState",a)},mounted:function a(){window.addEventListener("popstate",this.fetchBlocks)},watch:{currentBrowseFilter:function c(a){var b=this.getUrlParams("q")?this.getUrlParams("q"):"";window.store.dispatch("getInstalledBlocks");this.getBlocks({state:a,q:b})},currentSearchQuery:function c(a){var b=this.getUrlParams("browse")?this.getUrlParams("browse"):"installed";window.store.dispatch("getInstalledBlocks");this.getBlocks({state:b,q:a})},installedBlocks:function d(a,b){var c=this.getUrlParams("browse")?this.getUrlParams("browse"):"installed";a.length!=b.length&&"installed"==c&&(this.blocks=this.blocks.filter(function(b){return a.some(function(a){return a.package_name==b.packageName})}))},refetchBlocks:function b(){var a=this.getUrlParams("browse")?this.getUrlParams("browse"):"installed";this.getBlocks({state:a})}},methods:{fetchBlocks:function c(a){var b=null;a.state&&(b=a.state.state),this.getBlocks(b)},getBlocks:function l(a){var b=this,c=[],d="";if(a.q&&null!==a.q&&(d="q=".concat(a.q)),null!==a.state&&(d+="&order=".concat(a.state)),null!=a.state&&"installed"!=a.state)"local"==a.state?this.localBlocks(a):jQuery.get("https://api.gutenbergcloud.org/blocks?".concat(d),function(d){d.count&&window.store.commit("setBlocksCount",d.count);var e=!0,f=!1,g=void 0;try{for(var h,i=function(){var d=h.value,e={};e.jsUrl="https://unpkg.com/".concat(d.name,"@").concat(d.version,"/").concat(d.config.js),e.cssUrl="https://unpkg.com/".concat(d.name,"@").concat(d.version,"/").concat(d.config.css),e.editorCss=d.config.editor?"https://unpkg.com/".concat(d.name,"@").concat(d.version,"/").concat(d.config.editor):null,e.infoUrl="https://www.npmjs.com/package/".concat(d.name),e.imageUrl="https://unpkg.com/".concat(d.name,"@").concat(d.version,"/").concat(d.config.screenshot),e.name=d.config.name,e.blockManifest=JSON.stringify(d.package),e.version=d.version,e.packageName=d.name,null==a.state||"installed"==a.state?b.installedBlocks.length&&b.installedBlocks.filter(function(a){return a.package_name==e.packageName}).length&&c.push(e):c.push(e)},j=d.rows[Symbol.iterator]();!(e=(h=j.next()).done);e=!0)i()}catch(a){f=!0,g=a}finally{try{e||null==j.return||j.return()}finally{if(f)throw g}}});else if(this.installedBlocks.length){var e=!0,f=!1,g=void 0;try{for(var h,i=this.installedBlocks[Symbol.iterator]();!(e=(h=i.next()).done);e=!0){var j=h.value,k={};k.jsUrl=j.js_url,k.cssUrl=j.css_url,k.editorCss=j.editor_css,k.infoUrl=j.info_url,k.imageUrl=j.thumbnail,k.name=j.block_name,k.blockManifest="\""+j.block_manifest+"\"",k.version=j.block_version,k.packageName=j.package_name,(a.q&&null!==a.q&&(-1<k.name.toLowerCase().indexOf(a.q.toLowerCase())||-1<k.packageName.toLowerCase().indexOf(a.q.toLowerCase()))||!a.q)&&c.push(k)}}catch(a){f=!0,g=a}finally{try{e||null==i.return||i.return()}finally{if(f)throw g}}}this.blocks=c},getUrlParams:function e(a,b){b||(b=window.location.href),a=a.replace(/[\[\]]/g,"\\$&");var c=new RegExp("[?&]"+a+"(=([^&#]*)|&|#|$)"),d=c.exec(b);return d?d[2]?decodeURIComponent(d[2].replace(/\+/g," ")):"":null},showUploader:function a(){document.body.classList.toggle("show-upload-view")},localBlocks:function c(a){var b=this;jQuery.ajax({type:"POST",url:fgcData.ajaxUrl,data:{action:"fgc_local_blocks"}}).done(function(c){c.data.length?(window.store.commit("setBlocksCount",c.data.length),window.store.commit("setRefetchBlocks",!1)):window.store.commit("setBlocksCount",0),b.blocks=a.q&&null!==a.q?c.data.filter(function(b){return-1<b.name.toLowerCase().indexOf(a.q.toLowerCase())||-1<b.packageName.toLowerCase().indexOf(a.q.toLowerCase())}):c.data}).fail(function(a){console.log("There is some issues getting local blocks: ",a)})}},computed:{currentBrowseFilter:function a(){return window.store.state.browseState},currentSearchQuery:function a(){return window.store.state.searchQuery},installedBlocks:function a(){return window.store.state.installedBlocks},openOverlay:function a(){return window.store.state.opendOverlay},refetchBlocks:function a(){return window.store.state.refetchBlocks}}});
     1"use strict";function _typeof(a){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Vue.component("admin-notice",{data:function a(){return{activeTimeout:-1}},template:"\n    <div\n      :class=\"['fgc-notification', notification.class]\"\n      v-cloak>\n      <p v-html=\"notification.text\"></p>\n    </div>\n  ",watch:{isActive:function a(){this.showingTimeout()}},mounted:function a(){this.showingTimeout()},methods:{showingTimeout:function b(){var a=this;window.clearTimeout(this.activeTimeout),this.activeTimeout=window.setTimeout(function(){window.store.state.notification.class="",a.isShowing=!1},4e3)}},computed:{isActive:function a(){return window.store.state.notification.text},notification:function a(){return window.store.state.notification}}}),Vue.component("block-card",{props:["block"],data:function a(){return{installing:!1,alreadyInstaleld:!1,updateAvailable:!1,currentVersion:null,fromCloud:null}},template:"\n    <div class=\"theme\">\n      <div class=\"theme-screenshot\" @click=\"openMoreDetails\">\n        <img :src=\"block.imageUrl || fgcData.defaultThumbnail\" :alt=\"block.name\">\n        <div class=\"spinner installing-block\" v-if=\"installing\"></div>\n      </div>\n\n      <div v-if=\"currentBrowseState != 'installed' && alreadyInstaleld\" class=\"notice inline notice-success notice-alt\"><p>{{fgcData.strings.installed}}</p></div>\n\n      <div v-if=\"currentBrowseState == 'installed' && isLocalBlock\" class=\"notice inline notice-info notice-alt\"><p>{{fgcData.strings.local_block}}</p></div>\n\n      <div v-if=\"updateAvailable\" class=\"update-message notice inline notice-warning notice-alt\">\n        <p>{{fgcData.strings.update_available}} <button class=\"button-link\" type=\"button\" @click=\"updateBlock\">{{fgcData.strings.update_now}}</button></p>\n      </div>\n\n      <span class=\"more-details\" @click=\"openMoreDetails\">{{fgcData.strings.show_more_details}}</span>\n\n      <div class=\"theme-id-container\">\n        <h3 class=\"theme-name\">{{ block.name }}</h3>\n        <span v-if=\"blockManifest && blockManifest.author\" class=\"block-author\">{{fgcData.strings.by}}: \n          <span v-if=\"typeof blockManifest.author == 'object'\">\n            {{ blockManifest.author.name }}\n          </span>\n          <span v-if=\"typeof blockManifest.author == 'string'\">\n            {{ blockManifest.author }}\n          </span>\n        </span>\n        <span v-else class=\"block-version\">{{fgcData.strings.version}}: {{ currentVersion }}</span>\n\n        <div class=\"theme-actions\">\n          <button class=\"button button-primary theme-install install-block-btn\"\n              v-if=\"currentBrowseState != 'installed' && !alreadyInstaleld\"\n              @click.prevent=\"installBlock\">\n              {{fgcData.strings.install}}\n          </button>\n          <button class=\"button theme-install install-block-btn\"\n              v-else\n              @click.prevent=\"uninstallBlock\">\n              {{fgcData.strings.uninstall}}\n          </button>\n          <a class=\"button button-primary\" :href=\"blockUrl\" target=\"_blank\">{{fgcData.strings.homepage}}</a>\n        </div>\n      </div>\n\n    </div>\n  ",mounted:function b(){var a=this;this.currentVersion=this.block.version,!window.store.state.installedBlocks.filter(function(c){return c.package_name==a.block.packageName}).length||(this.alreadyInstaleld="installed"!=this.currentBrowseState,"installed"==this.currentBrowseState&&(window.store.state.installedBlocks.map(function(c){c.package_name!=a.block.packageName||a.isLocalBlock||jQuery.get("https://api.gutenbergcloud.org/blocks/".concat(c.package_name),function(b){if(b){var d=b,e={};e.jsUrl="https://unpkg.com/".concat(d.name,"@").concat(d.version,"/").concat(d.config.js),e.cssUrl="https://unpkg.com/".concat(d.name,"@").concat(d.version,"/").concat(d.config.css),e.editorCss=d.config.editor?"https://unpkg.com/".concat(d.name,"@").concat(d.version,"/").concat(d.config.editor):null,e.infoUrl="https://www.npmjs.com/package/".concat(d.name),e.imageUrl="https://unpkg.com/".concat(d.name,"@").concat(d.version,"/").concat(d.config.screenshot),e.name=d.config.name,e.blockManifest=JSON.stringify(d.package),e.version=d.version,e.packageName=d.name,b.version&&c.block_version<b.version&&(a.updateAvailable=!0,e.availVersion=d.version),a.fromCloud=e,a.updateAvailable&&a.setAvalVersion()}})}),this.currentVersion=window.store.state.installedBlocks.filter(function(c){return c.package_name==a.block.packageName})[0].block_version))},methods:{installBlock:function c(){var a=this;this.installing=!0;var b=this.block;console.log("Install block",b),jQuery.ajax({type:"POST",url:fgcData.ajaxUrl,data:{action:"fgc_install_block",data:b}}).done(function(b){a.installing=!1,a.alreadyInstaleld=!0,a.isLocalBlock||a.incrementInstalls(a.block.packageName),window.store.dispatch("getInstalledBlocks"),window.store.commit("setNotification",{text:"".concat(fgcData.strings.the_block," <b>").concat(a.block.name,"</b> ").concat(fgcData.strings.block_installed),class:"show success"}),console.log("Block installed ",b.data)}).fail(function(b){a.installing=!1,console.log("There is some issues installing block: ",b)})},uninstallBlock:function c(){var a=this;this.installing=!0;var b=this.block;jQuery.ajax({type:"POST",url:fgcData.ajaxUrl,data:{action:"fgc_uninstall_block",data:b}}).done(function(b){a.installing=!1,a.alreadyInstaleld=!1,a.isLocalBlock||a.decrementInstalls(a.block.packageName),window.store.dispatch("getInstalledBlocks"),window.store.commit("setNotification",{text:"".concat(fgcData.strings.block," <b>").concat(a.block.name,"</b> ").concat(fgcData.strings.block_uninstalled),class:"show success"}),console.log("Block uninstalled ",b.data)}).fail(function(b){a.installing=!1,console.log("There is some issues uninstalling block: ",b)})},updateBlock:function c(){var a=this;this.installing=!0;var b=this.fromCloud;jQuery.ajax({type:"POST",url:fgcData.ajaxUrl,data:{action:"fgc_update_block",data:b}}).done(function(b){a.installing=!1,a.updateAvailable=!1,a.currentVersion=a.block.version,window.store.dispatch("getInstalledBlocks"),window.store.commit("setNotification",{text:"".concat(fgcData.strings.block," <b>").concat(a.block.name,"</b> ").concat(fgcData.strings.block_updated),class:"show success"}),console.log("Block Updated ",b.data)}).fail(function(b){a.installing=!1,console.log("There is some issues updating block: ",b)})},setAvalVersion:function b(){var a=this.fromCloud;jQuery.ajax({type:"POST",url:fgcData.ajaxUrl,data:{action:"fgc_update_version",data:a}}).done(function(a){console.log("Available new version ",a.data)}).fail(function(a){console.log("There is some issues: ",a)})},incrementInstalls:function b(a){jQuery.ajax({type:"POST",data:{increment:1},url:"https://api.gutenbergcloud.org/blocks/".concat(a)}).done(function(){console.log("Installation counter increased ")}).fail(function(a){console.log("Some errors occured white increasing number of installs: ",a)})},decrementInstalls:function b(a){jQuery.ajax({type:"POST",data:{increment:-1},url:"https://api.gutenbergcloud.org/blocks/".concat(a)}).done(function(){console.log("Installation counter decreased ")}).fail(function(a){console.log("Some errors occured white increasing number of installs: ",a)})},openMoreDetails:function a(){window.store.commit("openOverlay",this.block)}},computed:{currentBrowseState:function a(){return window.store.state.browseState},blockManifest:function b(){var a=JSON.parse(this.block.blockManifest);return"string"==typeof a&&""!=a?JSON.parse(a):a},isLocalBlock:function a(){return this.blockManifest&&this.blockManifest.isLocal||!1},blockUrl:function a(){return this.blockManifest.homepage?this.blockManifest.homepage:this.blockManifest.author&&"object"==_typeof(this.blockManifest.author)&&this.blockManifest.author.url?this.blockManifest.author.url:"https://www.npmjs.com/package/".concat(this.block.packageName)}}}),Vue.component("block-details",{props:["block"],data:function a(){return{alreadyInstaleld:!1,spinnerLoaded:!1}},template:"\n    <div class=\"theme-overlay\" tabindex=\"0\" role=\"dialog\"><div class=\"theme-overlay\">\n      <div class=\"theme-backdrop\"></div>\n      <div class=\"theme-wrap wp-clearfix\" role=\"document\">\n        <div class=\"theme-header\">\n          <button class=\"close dashicons dashicons-no\" @click=\"closeOverlay\"></button>\n        </div>\n\n        <div class=\"theme-about wp-clearfix\">\n          <div class=\"theme-screenshots\">\n            <div class=\"screenshot\">\n              <img :src=\"block.imageUrl || fgcData.defaultThumbnail\" :alt=\"block.name\">\n              <div class=\"spinner installing-block\" v-if=\"spinnerLoaded\"></div>\n            </div>\n          </div>\n\n          <div class=\"theme-info\">\n            <h2 class=\"theme-name\">\n              {{ block.name }}\n                <span class=\"theme-version\">{{fgcData.strings.version}}: {{ block.version }}</span>\n            </h2>\n            <p v-if=\"blockAuthor && authorUrl\" class=\"theme-author\">{{fgcData.strings.by}} <a :href=\"authorUrl\" target=\"_blank\">{{ blockAuthor }} </a></p>\n            <p v-else-if=\"blockAuthor\" class=\"theme-author\">{{fgcData.strings.by}} {{ blockAuthor }}</p>\n\n            \n            <p class=\"theme-description\">\n              {{ blockManifest.description }}\n            </p>\n\n            <p class=\"theme-tags\">\n              <span>{{fgcData.strings.tags}}:</span>{{ blockTags }}\n            </p>\n            \n          </div>\n        </div>\n\n        <div class=\"theme-actions\">\n          <div class=\"inactive-theme\">\n            <a v-if=\"alreadyInstaleld\" @click.prevent=\"uninstallBlock\" class=\"button activate\">{{fgcData.strings.uninstall}}</a>\n            <a v-else @click.prevent=\"installBlock\" class=\"button activate\">{{fgcData.strings.install}}</a>\n            <a :href=\"blockUrl\" target=\"_blank\" class=\"button button-primary load-customize hide-if-no-customize\">{{fgcData.strings.visit_homepage}}</a>\n            <a v-if=\"isLocalBlock\" class=\"button install-block-btn button-delete load-customize hide-if-no-customize\" @click.prevent=\"deleteBlock\">{{fgcData.strings.delete_block}}</a>\n          </div>\n        </div>\n      </div>\n    </div>\n  </div>",mounted:function b(){var a=this;window.addEventListener("keyup",this.keypressEvent),!window.store.state.installedBlocks.filter(function(c){return c.package_name==a.block.packageName}).length||(this.alreadyInstaleld=!0)},computed:{blockManifest:function b(){var a=JSON.parse(this.block.blockManifest);return"string"==typeof a&&""!=a?JSON.parse(a):a},isLocalBlock:function a(){return this.blockManifest&&this.blockManifest.isLocal||!1},blockUrl:function a(){return this.blockManifest.homepage?this.blockManifest.homepage:this.blockManifest.author&&"object"==_typeof(this.blockManifest.author)&&this.blockManifest.author.url?this.blockManifest.author.url:"https://www.npmjs.com/package/".concat(this.block.packageName)},authorUrl:function a(){return this.blockManifest.author&&"object"==_typeof(this.blockManifest.author)&&this.blockManifest.author.url?this.blockManifest.author.url:this.blockManifest.homepage?this.blockManifest.homepage:"https://www.npmjs.com/package/".concat(this.block.packageName)},blockAuthor:function a(){return this.blockManifest.author&&"object"==_typeof(this.blockManifest.author)&&this.blockManifest.author.name?this.blockManifest.author.name:this.blockManifest.author&&"string"==typeof this.blockManifest.author?this.blockManifest.author:null},blockTags:function a(){return this.blockManifest?this.blockManifest.keywords.join(", "):""}},methods:{keypressEvent:function b(a){27===a.keyCode&&this.closeOverlay()},closeOverlay:function a(){window.store.commit("openOverlay",null)},installBlock:function c(){var a=this;this.spinnerLoaded=!0;var b=this.block;console.log("Install block",b),jQuery.ajax({type:"POST",url:fgcData.ajaxUrl,data:{action:"fgc_install_block",data:b}}).done(function(b){a.alreadyInstaleld=!0,a.spinnerLoaded=!1,a.isLocalBlock||a.incrementInstalls(a.block.packageName),window.store.dispatch("getInstalledBlocks"),window.store.commit("setNotification",{text:"".concat(fgcData.strings.the_block," <b>").concat(a.block.name,"</b> ").concat(fgcData.strings.block_installed),class:"show success"}),console.log("Block installed ",b.data)}).fail(function(b){a.installing=!1,console.log("There is some issues installing block: ",b)})},deleteBlock:function c(){var a=this;this.spinnerLoaded=!0,this.alreadyInstaleld&&this.uninstallBlock();var b={block:this.block,nonce:fgcData.ajaxNonce};jQuery.ajax({type:"POST",url:fgcData.ajaxUrl,data:{action:"fgc_delete_block",data:b}}).done(function(b){window.store.commit("setNotification",{text:"".concat(fgcData.strings.the_block," <b>").concat(a.block.name,"</b> ").concat(fgcData.strings.block_deleted),class:"show success"}),window.store.commit("setRefetchBlocks",!0),a.closeOverlay(),a.spinnerLoaded=!1,window.store.dispatch("getInstalledBlocks"),console.log("Block removed ",b.data)}).fail(function(b){a.installing=!1,console.log("There is some issues installing block: ",b)})},uninstallBlock:function c(){var a=this,b=this.block;jQuery.ajax({type:"POST",url:fgcData.ajaxUrl,data:{action:"fgc_uninstall_block",data:b}}).done(function(b){a.alreadyInstaleld=!1,a.isLocalBlock||a.decrementInstalls(a.block.packageName),window.store.dispatch("getInstalledBlocks"),window.store.commit("setNotification",{text:"".concat(fgcData.strings.block," <b>").concat(a.block.name,"</b> ").concat(fgcData.strings.block_uninstalled),class:"show success"}),console.log("Block uninstalled ",b.data)}).fail(function(b){a.installing=!1,console.log("There is some issues uninstalling block: ",b)})},incrementInstalls:function b(a){jQuery.ajax({type:"PUT",url:"https://api.gutenbergcloud.org/blocks/".concat(a)}).done(function(){console.log("Installation counter increased ")}).fail(function(a){console.log("Some errors occured white increasing number of installs: ",a)})},decrementInstalls:function b(a){jQuery.ajax({type:"DELETE",url:"https://api.gutenbergcloud.org/blocks/".concat(a)}).done(function(){console.log("Installation counter decreased ")}).fail(function(a){console.log("Some errors occured white increasing number of installs: ",a)})}}}),Vue.component("explorer-filter",{componenets:["filter-drawer"],data:function a(){return{drawerFilterOpen:!1,searchQuery:null,filterLinks:[{name:fgcData.strings.installed,slug:"installed"},{name:fgcData.strings.popular,slug:"popular"},{name:fgcData.strings.latest,slug:"latest"},{name:fgcData.strings.local,slug:"local"}]}},template:"\n    <div class=\"wp-filter g-blocks-filter hide-if-no-js\">\n      <div class=\"filter-count\">\n        <span class=\"count theme-count\">{{ blocksCount }}</span>\n      </div>\n\n      <ul class=\"filter-links\">\n        <li><a v-for=\"filter in filterLinks\" :key=\"filter.slug\" @click=\"filterLink(filter.slug)\" :class=\"currentFilter(filter.slug)\">{{ filter.name }}</a></li>\n      </ul>\n\n      <button type=\"button\" v-if=\"false\" id=\"searchFilter\" class=\"button drawer-toggle\" :aria-expanded=\"drawerFilterOpen\" @click=\"drawerFilterOpen = !drawerFilterOpen\">{{fgcData.strings.filter}}</button>\n\n      <form class=\"search-form\" @submit.prevent=\"searchForBlock\"><label class=\"screen-reader-text\" for=\"wp-filter-search-input\">{{fgcData.strings.search_for_blocks}}</label><input :placeholder=\"fgcData.strings.search_blocks\" v-model=\"searchQuery\" type=\"search\" id=\"wp-filter-search-input\" class=\"wp-filter-search\"></form>\n\n      <filter-drawer :style=\"{display: drawerFilterOpen ? 'block' : 'none'}\"></filter-drawer>\n    </div>\n  ",mounted:function a(){window.store.state.installedBlocks.length||"local"==window.store.state.browseState||this.filterLink("popular")},methods:{filterLink:function c(a){var b=window.location.search.replace(/\&browse[=a-z]*/,"");history.pushState({state:a},null,"".concat(b,"&browse=").concat(a)),window.store.commit("setBrowseState",a)},currentFilter:function b(a){return window.store.state.browseState==a?"current":""},searchForBlock:function c(){var a=window.location.search.replace(/\&q[=a-z\-]*/,""),b=this.searchQuery.replace(/\s+/g,"-").toLowerCase();history.pushState({state:b},null,"".concat(a,"&q=").concat(b)),window.store.commit("setSearchQuery",b)}},computed:{blocksCount:function a(){return"installed"===window.store.state.browseState?window.store.state.installedBlocks.length:window.store.state.blocksCount}}}),Vue.component("filter-drawer",{template:"\n    <div class=\"filter-drawer\">\n      <div class=\"buttons\">\n        <button type=\"button\" class=\"apply-filters button\">Apply Filters<span></span></button>\n        <button type=\"button\" class=\"clear-filters button\" aria-label=\"Clear all filters\">Clear</button>\n      </div>\n      <fieldset class=\"filter-group\">\n        <legend>Subject</legend>\n        <div class=\"filter-group-feature\">\n          <input type=\"checkbox\" id=\"filter-id-blog\" value=\"blog\">\n          <label for=\"filter-id-blog\">Blog</label>\n          <input type=\"checkbox\" id=\"filter-id-e-commerce\" value=\"e-commerce\">\n          <label for=\"filter-id-e-commerce\">E-Commerce</label>\n          <input type=\"checkbox\" id=\"filter-id-education\" value=\"education\">\n          <label for=\"filter-id-education\">Education</label>\n          <input type=\"checkbox\" id=\"filter-id-entertainment\" value=\"entertainment\">\n          <label for=\"filter-id-entertainment\">News</label>\n        </div>\n      </fieldset>\n      <fieldset class=\"filter-group\">\n        <legend>Features</legend>\n        <div class=\"filter-group-feature\">\n          <input type=\"checkbox\" id=\"filter-id-accessibility-ready\" value=\"accessibility-ready\">\n          <label for=\"filter-id-accessibility-ready\">Custom Colors</label>\n          <input type=\"checkbox\" id=\"filter-id-custom-background\" value=\"custom-background\">\n          <label for=\"filter-id-custom-background\">Editor style</label>\n          <input type=\"checkbox\" id=\"filter-id-custom-colors\" value=\"custom-colors\">\n          <label for=\"filter-id-custom-colors\">Full Width Template</label>\n        </div>  \n      </fieldset>\n      <fieldset class=\"filter-group\">\n        <legend>Layout</legend>\n        <div class=\"filter-group-feature\">\n          <input type=\"checkbox\" id=\"filter-id-grid-layout\" value=\"grid-layout\">\n          <label for=\"filter-id-grid-layout\">Grid-layout</label>\n          <input type=\"checkbox\" id=\"filter-id-one-column\" value=\"one-column\">\n          <label for=\"filter-id-one-column\">One Column</label>\n          <input type=\"checkbox\" id=\"filter-id-two-columns\" value=\"two-columns\">\n          <label for=\"filter-id-two-columns\">Two Column</label>\n          <input type=\"checkbox\" id=\"filter-id-three-columns\" value=\"three-columns\">\n          <label for=\"filter-id-three-columns\">Responsive</label>\n        </div>\n      </fieldset>\n      <div class=\"buttons\">\n        <button type=\"button\" class=\"apply-filters button\">Apply Filters<span></span></button>\n        <button type=\"button\" class=\"clear-filters button\" aria-label=\"Clear all filters\">Clear</button>\n      </div>\n\n    </div>\n  "});var store=new Vuex.Store({state:{notification:{},browseState:null,installedBlocks:fgcData.installedBlocks,searchQuery:null,opendOverlay:null,blocksCount:0,refetchBlocks:!1},mutations:{setNotification:function c(a,b){a.notification=b},setBrowseState:function c(a,b){a.browseState=b},setInstalledBlocks:function c(a,b){a.installedBlocks=b},setSearchQuery:function c(a,b){a.searchQuery=b},openOverlay:function c(a,b){a.opendOverlay=b},setBlocksCount:function c(a,b){a.blocksCount=b},setRefetchBlocks:function c(a,b){a.refetchBlocks=b}},actions:{getInstalledBlocks:function b(a){jQuery.ajax({type:"GET",url:fgcData.ajaxUrl,data:{action:"fgc_get_all_blocks"}}).done(function(b){a.commit("setInstalledBlocks",b.data)}).fail(function(a){console.log("There is some issues installing block: ",a)})}}}),app=new Vue({el:"#blockExplorer",data:function a(){return{blocks:[]}},created:function c(){window.store.dispatch("getInstalledBlocks");var a=this.getUrlParams("browse")?this.getUrlParams("browse"):"installed",b=this.getUrlParams("q")?this.getUrlParams("q"):"";this.getBlocks({state:a,q:b}),window.store.commit("setBrowseState",a)},mounted:function a(){window.addEventListener("popstate",this.fetchBlocks)},watch:{currentBrowseFilter:function c(a){var b=this.getUrlParams("q")?this.getUrlParams("q"):"";window.store.dispatch("getInstalledBlocks");this.getBlocks({state:a,q:b})},currentSearchQuery:function c(a){var b=this.getUrlParams("browse")?this.getUrlParams("browse"):"installed";window.store.dispatch("getInstalledBlocks");this.getBlocks({state:b,q:a})},installedBlocks:function d(a,b){var c=this.getUrlParams("browse")?this.getUrlParams("browse"):"installed";a.length!=b.length&&"installed"==c&&(this.blocks=this.blocks.filter(function(b){return a.some(function(a){return a.package_name==b.packageName})}))},refetchBlocks:function b(){var a=this.getUrlParams("browse")?this.getUrlParams("browse"):"installed";this.getBlocks({state:a})}},methods:{fetchBlocks:function c(a){var b=null;a.state&&(b=a.state.state),this.getBlocks(b)},getBlocks:function l(a){var b=this,c=[],d="";if(a.q&&null!==a.q&&(d="q=".concat(a.q)),null!==a.state&&(d+="&order=".concat(a.state)),null!=a.state&&"installed"!=a.state)"local"==a.state?this.localBlocks(a):jQuery.get("https://api.gutenbergcloud.org/blocks?".concat(d),function(d){d.count&&window.store.commit("setBlocksCount",d.count);var e=!0,f=!1,g=void 0;try{for(var h,i=function(){var d=h.value,e={};e.jsUrl="https://unpkg.com/".concat(d.name,"@").concat(d.version,"/").concat(d.config.js),e.cssUrl="https://unpkg.com/".concat(d.name,"@").concat(d.version,"/").concat(d.config.css),e.editorCss=d.config.editor?"https://unpkg.com/".concat(d.name,"@").concat(d.version,"/").concat(d.config.editor):null,e.infoUrl="https://www.npmjs.com/package/".concat(d.name),e.imageUrl="https://unpkg.com/".concat(d.name,"@").concat(d.version,"/").concat(d.config.screenshot),e.name=d.config.name,e.blockManifest=JSON.stringify(d.package),e.version=d.version,e.packageName=d.name,null==a.state||"installed"==a.state?b.installedBlocks.length&&b.installedBlocks.filter(function(a){return a.package_name==e.packageName}).length&&c.push(e):c.push(e)},j=d.rows[Symbol.iterator]();!(e=(h=j.next()).done);e=!0)i()}catch(a){f=!0,g=a}finally{try{e||null==j.return||j.return()}finally{if(f)throw g}}});else if(this.installedBlocks.length){var e=!0,f=!1,g=void 0;try{for(var h,i=this.installedBlocks[Symbol.iterator]();!(e=(h=i.next()).done);e=!0){var j=h.value,k={};k.jsUrl=j.js_url,k.cssUrl=j.css_url,k.editorCss=j.editor_css,k.infoUrl=j.info_url,k.imageUrl=j.thumbnail,k.name=j.block_name,k.blockManifest="\""+j.block_manifest+"\"",k.version=j.block_version,k.packageName=j.package_name,(a.q&&null!==a.q&&(-1<k.name.toLowerCase().indexOf(a.q.toLowerCase())||-1<k.packageName.toLowerCase().indexOf(a.q.toLowerCase()))||!a.q)&&c.push(k)}}catch(a){f=!0,g=a}finally{try{e||null==i.return||i.return()}finally{if(f)throw g}}}this.blocks=c},getUrlParams:function e(a,b){b||(b=window.location.href),a=a.replace(/[\[\]]/g,"\\$&");var c=new RegExp("[?&]"+a+"(=([^&#]*)|&|#|$)"),d=c.exec(b);return d?d[2]?decodeURIComponent(d[2].replace(/\+/g," ")):"":null},showUploader:function a(){document.body.classList.toggle("show-upload-view")},localBlocks:function c(a){var b=this;jQuery.ajax({type:"POST",url:fgcData.ajaxUrl,data:{action:"fgc_local_blocks"}}).done(function(c){c.data.length?(window.store.commit("setBlocksCount",c.data.length),window.store.commit("setRefetchBlocks",!1)):window.store.commit("setBlocksCount",0),b.blocks=a.q&&null!==a.q?c.data.filter(function(b){return-1<b.name.toLowerCase().indexOf(a.q.toLowerCase())||-1<b.packageName.toLowerCase().indexOf(a.q.toLowerCase())}):c.data}).fail(function(a){console.log("There is some issues getting local blocks: ",a)})}},computed:{currentBrowseFilter:function a(){return window.store.state.browseState},currentSearchQuery:function a(){return window.store.state.searchQuery},installedBlocks:function a(){return window.store.state.installedBlocks},openOverlay:function a(){return window.store.state.opendOverlay},refetchBlocks:function a(){return window.store.state.refetchBlocks}}});
  • cloud-blocks/trunk/assets/source/js/block-component.js

    r2007547 r2025157  
    7676                theBlock.version = block.version
    7777                theBlock.packageName = block.name
     78 
     79                if (res.version && b.block_version < res.version) {
     80                  this.updateAvailable = true
     81                  theBlock.availVersion = block.version
     82                }
     83
    7884                this.fromCloud = theBlock
    79               }
    80               if (res && res.version && b.block_version < res.version) {
    81                 this.updateAvailable = true
     85               
     86                if (this.updateAvailable) {
     87                  this.setAvalVersion()
     88                }
    8289              }
    8390            })
     
    166173        })
    167174    },
     175    setAvalVersion() {
     176      let postData = this.fromCloud
     177      jQuery.ajax({
     178        type: 'POST',
     179        url: fgcData.ajaxUrl,
     180        data: {
     181          action: "fgc_update_version",
     182          data: postData
     183        }
     184      })
     185        .done(res => {
     186          console.log('Available new version ', res.data) 
     187        })
     188        .fail(error => {
     189          console.log('There is some issues: ', error)
     190        })
     191    },
    168192    incrementInstalls(packageName) {
    169193      jQuery.ajax({
  • cloud-blocks/trunk/cloud-blocks.php

    r2020434 r2025157  
    22/*
    33Plugin Name: Cloud Blocks
    4 Version: 1.1.3
     4Version: 1.1.4
    55Description: Your library of Gutenberg blocks in the cloud
    66Author: Frontkom
     
    3030// Plugin version .
    3131if ( ! defined( 'FGC_VERSION' ) ) {
    32     define( 'FGC_VERSION', '1.1.3' );
     32    define( 'FGC_VERSION', '1.1.4' );
    3333}
    3434
     
    3737
    3838// Register text-domain for translations
    39 add_action( 'plugins_loaded', 'fgc_register_textdomain' );
    40 function fgc_register_textdomain() {
     39add_action( 'plugins_loaded', 'fgc_register_translations' );
     40function fgc_register_translations() {
    4141    load_plugin_textdomain( 'cloud-blocks', false, basename( dirname( __FILE__ ) ) . '/languages' );
    4242}
     
    4545register_activation_hook( __FILE__, array( 'CloudBlocks\Activator', 'init' ) );
    4646
     47// Register CRON hooks
     48register_activation_hook( __FILE__, array( 'CloudBlocks\Blocks\Explore', 'cron_schedule' ) );
     49register_deactivation_hook( __FILE__, array( 'CloudBlocks\Blocks\Explore', 'cron_unschedule' ) );
     50
     51
    4752// Initiate plugin
    4853new CloudBlocks\CloudBlocks;
  • cloud-blocks/trunk/core/Activator.php

    r2005063 r2025157  
    1 <?php 
     1<?php
    22
    33namespace CloudBlocks;
     4
     5use CloudBlocks\Blocks\Explore;
    46
    57/**
     
    1012 */
    1113class Activator {
    12  
     14
    1315    /**
    1416   * Current version of custom db table
    1517     * @param object
    1618     */
    17   public static $current_db_version = '1.2';
    18  
     19  public static $current_db_version = '1.3';
     20
    1921  /**
    2022  * activate, runs at plugin activation.
     
    2527  public static function init() {
    2628    self::create_db();
     29
    2730  }
    2831
     
    3740    $charset_collate = $wpdb->get_charset_collate();
    3841    $table_name = $wpdb->prefix . str_replace( '-', '_', FGC_NAME );
    39  
     42
    4043    $sql = "CREATE TABLE $table_name (
    4144      id mediumint(9) NOT NULL AUTO_INCREMENT,
     
    5154      block_installed datetime DEFAULT CURRENT_TIMESTAMP,
    5255      block_updated datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
     56      available_version varchar(10) DEFAULT '' NOT NULL,
    5357      PRIMARY KEY  (id)
    5458    ) $charset_collate;";
    55  
     59
    5660    require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
    5761    dbDelta( $sql );
     
    5963    update_option( 'gutenberg_cloud_db_version', '1.0' );
    6064  }
    61  
     65
    6266
    6367  /**
     
    8892        block_installed datetime DEFAULT CURRENT_TIMESTAMP,
    8993        block_updated datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
     94        available_version varchar(10) DEFAULT '' NOT NULL,
    9095        PRIMARY KEY  (id)
    9196      ) $charset_collate;";
     
    98103
    99104  }
    100  
     105
    101106}
  • cloud-blocks/trunk/core/Blocks/Blocks.php

    r2020451 r2025157  
    2525    add_action( 'wp_ajax_fgc_update_block', array( $this, 'update' ) );
    2626    add_action( 'wp_ajax_nopriv_fgc_update_block', array( $this, 'update' ) );
     27
     28    add_action( 'wp_ajax_fgc_update_version', array( $this, 'update_version' ) );
     29    add_action( 'wp_ajax_nopriv_fgc_update_version', array( $this, 'update_version' ) );
    2730
    2831    add_action( 'wp_ajax_fgc_local_blocks', array( $this, 'local_blocks' ) );
     
    6265        'thumbnail'       => isset( $block['imageUrl'] ) ? $block['imageUrl'] : '',
    6366        'block_version'   => isset( $block['version'] ) ? $block['version'] : '',
    64         'block_manifest'  => isset( $block['blockManifest'] ) ? $block['blockManifest'] : ''
     67        'block_manifest'  => isset( $block['blockManifest'] ) ? $block['blockManifest'] : '',
     68        'available_version'   => isset( $block['availVersion'] ) ? $block['availVersion'] : ''
    6569      );
    6670      Options::add( $new_block, true );
     
    126130        'thumbnail'       => isset( $block['imageUrl'] ) ? $block['imageUrl'] : '',
    127131        'block_version'   => isset( $block['version'] ) ? $block['version'] : '',
    128         'block_manifest'  => isset( $block['blockManifest'] ) ? $block['blockManifest'] : ''
     132        'block_manifest'  => isset( $block['blockManifest'] ) ? $block['blockManifest'] : '',
     133        'available_version'   => isset( $block['availVersion'] ) ? $block['availVersion'] : ''
    129134      );
    130135
     
    151156    );
    152157    wp_send_json_success( $response );
     158  }
     159
     160  /**
     161   * Update available block version.
     162   *
     163   * @since 1.1.4
     164   * @param
     165   * @return
     166   */
     167  public static function update_version( $block = false ) {
     168      if( !$block ) {
     169          $block = $_REQUEST['data'];
     170      }
     171
     172      if ( isset( $block ) ) {
     173          $the_block = array(
     174            'package_name'    => isset( $block['packageName'] ) ? $block['packageName'] : $block['package']['name'],
     175            'available_version'   => isset( $block['availVersion'] ) ? $block['availVersion'] : $block['version']
     176          );
     177
     178          $existing_block = Options::get( $the_block['package_name'] );
     179          $block_id = Options::update_version( $existing_block->id, $the_block );
     180
     181          if ( isset( $block_id ) ) {
     182            $response = array(
     183              'code'      => 200,
     184              'message'   => 'Succesfully updated.'
     185            );
     186          } else {
     187            $response = array(
     188              'code'      => 400,
     189              'message'   => 'Version could not be updated!'
     190            );
     191          }
     192          wp_send_json_success( $response );
     193      }
     194      $response = array(
     195          'code'      => 400,
     196          'message'   => 'Version could not be updated!'
     197      );
     198      wp_send_json_success( $response );
    153199  }
    154200
     
    191237      $block_script = null;
    192238      $block_thumbnail = null;
    193      
     239
    194240      // Extract block js and css files
    195241      foreach ($block_files as $file) {
     
    204250        }
    205251      }
    206       // Extract block screenshot 
     252      // Extract block screenshot
    207253      foreach ($screenshot as $img) {
    208254        if ( preg_match('/thumbnail|screenshot/i', $img) ) {
     
    245291      );
    246292
    247      
     293
    248294    }
    249295
     
    269315      $block = str_replace( $destination['baseurl'] . '/gutenberg-blocks/', '', $block );
    270316      preg_match( '/[a-zA-Z0-9-_]*(?!:\/)/i', $block, $block_dir );
    271      
     317
    272318      $filesystem = new \WP_Filesystem_Direct(array());
    273319      $removed = $filesystem->delete( $destination_path . $block_dir[0], true );
     
    307353      foreach ($blocks as $block) {
    308354        /**
    309          * Use this filter in your functions.php or custom plugin 
     355         * Use this filter in your functions.php or custom plugin
    310356         * to enable/disable styling per individual block or for all of them.
    311357         */
     
    314360          wp_register_style( str_replace( ' ', '-', $block->block_name ) , $block->css_url, array(), $block->block_version);
    315361          wp_enqueue_style( str_replace( ' ', '-', $block->block_name ) );
    316          
     362
    317363          if (is_admin() && isset( $block->editor_css ) && !empty( $block->editor_css ) ) {
    318364            wp_register_style( str_replace( ' ', '-', $block->block_name ) . '-editor' , $block->editor_css, array(), $block->block_version);
  • cloud-blocks/trunk/core/Blocks/Explore.php

    r2011877 r2025157  
    33namespace CloudBlocks\Blocks;
    44
     5use CloudBlocks\Blocks\Options;
     6use CloudBlocks\Blocks\Blocks;
     7
    58class Explore {
    6  
     9
    710    /**
    811     * @param object $page_title
     
    2528    self::$page_title = ucwords( str_replace( '-', ' ', FGC_NAME ) );
    2629    self::$menu_slug = FGC_NAME;
    27     // Add menu
    28     add_action( 'admin_menu', array( __class__, 'add_menu') );
     30
     31    // Add menu
     32    add_action( 'admin_menu', array( __CLASS__, 'add_menu') );
    2933    // Handle uploading custom blocks as zip files
    3034    add_action( 'init', array( __CLASS__, 'upload_block' ) );
     35    // Schedule cron with check updates
     36    add_action( 'admin_init', array( __CLASS__, 'cron_schedule' ) );
     37    add_action( 'fgc_cron_check_updates', array( __CLASS__, 'check_updates' ) );
    3138  }
    3239
     
    5158          $okay = true;
    5259          break;
    53         } 
    54       }
    55      
     60        }
     61      }
     62
    5663      $continue = strtolower( $name[1] ) == 'zip' ? true : false;
    5764      if ( !$continue ) {
     
    6370        $destination_path = $destination['basedir'] . '/gutenberg-blocks/';
    6471        $create_folder = wp_mkdir_p( $destination_path );
    65        
     72
    6673        // Here the magic happens.
    6774        if ( move_uploaded_file( $source, $destination_path . $filename ) ) {
     
    101108    );
    102109  }
    103  
     110
    104111  /**
    105112   * Settings page output.
     
    135142        </div>
    136143      </div>
    137        
     144
    138145      <admin-notice></admin-notice>
    139146      <explorer-filter></explorer-filter>
    140      
     147
    141148          <div class="theme-browser content-filterable rendered">
    142149        <div class="themes wp-clearfix">
     
    157164   * @return $counter
    158165   */
    159 
    160166  public static function count_updates() {
    161167    $counter = 0;
    162 
    163168    $installed_blocks = Options::get_all();
     169
    164170    foreach ($installed_blocks as $block) {
    165       // We must check if block is not local block, then we check for new versino availability
     171      // We must check if block is not local block, then we check for new version availability
    166172      $manifest = json_decode( stripslashes( $block->block_manifest ), true );
    167       if ( empty($manifest['isLocal']) ) {
    168         $args = array(
    169           'method' => 'GET'
    170         );
    171         $response = wp_remote_request( 'https://api.gutenbergcloud.org/blocks/' . $block->package_name, $args );
    172         $body = wp_remote_retrieve_body( $response );
    173         $json = json_decode($body, true);
    174 
    175         if( !empty($json['version']) && $json['version'] !== $block->block_version) {
    176           $counter++;
     173
     174      if( empty($manifest['isLocal']) && !empty($block->available_version) && version_compare($block->available_version, $block->block_version, '>')) {
     175        $counter++;
     176      }
     177    }
     178
     179    return $counter;
     180  }
     181
     182  /**
     183  * CRON schedule.
     184  *
     185  * @since 1.1.4
     186  * @param
     187  * @return
     188  */
     189  public static function cron_schedule() {
     190    if ( !wp_next_scheduled( 'fgc_cron_check_updates' ) ) {
     191        wp_schedule_event(time(), 'daily', 'fgc_cron_check_updates');
     192    }
     193  }
     194
     195  /**
     196  * CRON unschedule.
     197  *
     198  * @since 1.1.4
     199  * @param
     200  * @return
     201  */
     202  public static function cron_unschedule() {
     203    wp_clear_scheduled_hook('fgc_cron_check_updates');
     204  }
     205
     206  /**
     207  * CRON schedule.
     208  *
     209  * @since 1.1.4
     210  * @param
     211  * @return
     212  */
     213  public static function check_updates() {
     214    $installed_blocks = Options::get_all();
     215
     216      foreach ( $installed_blocks as $block ) {
     217        // We must check if block is not local block, then we check for new version availability
     218        $manifest = json_decode( stripslashes( $block->block_manifest ), true );
     219        if ( empty( $manifest['isLocal'] ) ) {
     220          $args     = array(
     221            'method' => 'GET'
     222          );
     223          $response = wp_remote_request( 'https://api.gutenbergcloud.org/blocks/' . $block->package_name, $args );
     224          $body     = wp_remote_retrieve_body( $response );
     225          $the_block  = json_decode( $body, true );
     226
     227          if( !empty($the_block['version']) && $the_block['version'] !== $block->block_version) {
     228              $_REQUEST['data'] = $the_block;
     229              Blocks::update_version($the_block);
     230          }
    177231        }
    178232      }
    179     }
    180 
    181     return $counter;
     233
    182234  }
    183235
  • cloud-blocks/trunk/core/Blocks/Options.php

    r1962907 r2025157  
    153153        'thumbnail'       => $thumbnail,
    154154        'block_version'   => $block_version,
    155         'block_manifest'   => $block_manifest
     155        'block_manifest'   => $block_manifest,
     156        'available_version' => ''
    156157      ),
    157158      array(
     
    163164  }
    164165
     166    /**
     167     * Update existing value in database.
     168     * @since 1.1.4
     169     * @param array $options   The options need to be stored into database
     170     * @return int $id         Inserted records id
     171     */
     172    public static function update_version( $id, $options ) {
     173        global $wpdb;
     174
     175        $available_version = $options['available_version'];
     176
     177        $table_name = $wpdb->prefix . str_replace( '-', '_', FGC_NAME );
     178
     179        $id = $wpdb->update(
     180            $table_name,
     181            array(
     182                'available_version' => $available_version
     183            ),
     184            array(
     185                'id'      => $id
     186            )
     187        );
     188
     189        return $id;
     190    }
     191
    165192  /**
    166193  * Get all installed blocks.
     
    209236
    210237  /**
    211   * Increate number of installs on api.gutenbergcloud.org
     238  * Increase number of installs on api.gutenbergcloud.org
    212239  * @since 1.0.0
    213240  * @param string|null $package_name    npm package name
    214241  * @return object|null $body           Request response
    215242  */
    216   public static function increate_installs( $package_name = null ) {
     243  public static function increase_installs( $package_name = null ) {
    217244    if ( empty( $package_name )  ) {
    218245      return;
  • cloud-blocks/trunk/core/CloudBlocks.php

    r2020434 r2025157  
    2020  public function __construct() {
    2121    global $wp_version;
    22    
     22
    2323    include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
    2424    if ( \is_plugin_active( 'gutenberg/gutenberg.php' ) || (int) $wp_version >= 5 ) {
     
    8080  */
    8181  public function enqueue_scripts() {
    82     wp_enqueue_script( 'vuejs', 'https://unpkg.com/vue@2.5.17/dist/vue.min.js', array( 'jquery' ), FGC_VERSION, true );
    83     wp_enqueue_script( 'vuex', 'https://unpkg.com/vuex@3.0.1/dist/vuex.min.js', array('vuejs'), FGC_VERSION, TRUE );
     82    wp_enqueue_script( 'vuejs', 'https://cdn.jsdelivr.net/npm/vue@2.5.17/dist/vue.min.js', array( 'jquery' ), FGC_VERSION, true );
     83    wp_enqueue_script( 'vuex', 'https://cdn.jsdelivr.net/npm/vuex@3.1.0/dist/vuex.min.js', array( 'vuejs' ), FGC_VERSION, true );
    8484    wp_enqueue_script( 'gutenberg_cloud_admin_js', FGC_URL . 'assets/js/script.js', array( 'jquery', 'vuejs', 'vuex' ), FGC_VERSION, true );
    8585    $localized_data = array(
  • cloud-blocks/trunk/core/Settings/Tools.php

    r1961288 r2025157  
    106106              self::add_notice( sprintf(__('Block <b>%s</b> already installed.', 'gutenberg-cloug'), $imported->block_name ), 'error' );
    107107            } else {
    108               Options::increate_installs( $block['package_name'] );
     108              Options::increase_installs( $block['package_name'] );
    109109              self::add_notice( sprintf(__('Block <b>%s</b> installed successfully.', 'gutenberg-cloug'), $block['block_name'] ), 'success' );
    110110            }
  • cloud-blocks/trunk/docs/changelog.md

    r2020451 r2025157  
    11## Changelog
     2
     3#### 1.1.4
     4* **Change**: Update counter as a WP CRON (Thanks to [ajotka](https://github.com/front/cloud-blocks/pull/14))
     5* **Change**: Update some docs
     6* **Fix**: Fix polish translations
    27
    38#### 1.1.3
  • cloud-blocks/trunk/docs/create-block.md

    r1965688 r2025157  
    8989Custom blocks generated by create-cloud-block tool come with all configuration needed to be distributed by Cloud Blocks. Also they have a deploy script which complies the build files and publish the package to NPM, so all we have to do is run `$ npm run deploy`.
    9090
    91 After about 15 minutes, your custom block is available to the world through [api.gutenbergcloud.org/blocks](https://api.gutenbergcloud.org/blocks). Congrats!
     91After our review, your custom block is available to the world through [api.gutenbergcloud.org/blocks](https://api.gutenbergcloud.org/blocks). Congrats!
    9292
    9393## Documentation
  • cloud-blocks/trunk/docs/migrate-block.md

    r1965688 r2025157  
    147147or just `$ npm run deploy` if you used create-cloud-block tool.
    148148
    149 That’s it! Your block will be available to Gutenberg Cloud in a few minutes. Bravo!
     149That’s it! Your block will be available to Gutenberg Cloud after our review. Bravo!
  • cloud-blocks/trunk/languages/cloud-blocks-pl_PL.po

    r2011879 r2025157  
    3030"again."
    3131msgstr ""
    32 "Plik, który próbujesz załadować zawiera niepoprawne rozszerzenie . Spróbuj "
     32"Plik, który próbujesz załadować zawiera niepoprawne rozszerzenie. Spróbuj "
    3333"ponownie."
    3434
     
    125125msgstr ""
    126126"Eksport wszystkich zainstalowanych bloków z Chmury Gutenberga jako plik JSON."
    127 " Uwaga: Treść bloków nie będzie wyeksportowana."
     127" Uwaga: Treść bloków nie będzie eksportowana."
    128128
    129129#: core/Settings/Tools.php:224
     
    229229#: core/Settings/Translations.php:38
    230230msgid "have been installed successfully."
    231 msgstr "zostało pomyślnie zainstalowane."
     231msgstr "został pomyślnie zainstalowany."
    232232
    233233#: core/Settings/Translations.php:39
    234234msgid "have been uninstalled successfully."
    235 msgstr "zostało pomyślnie odinstalowane."
     235msgstr "został pomyślnie odinstalowany."
    236236
    237237#: core/Settings/Translations.php:40
    238238msgid "have been deleted successfully."
    239 msgstr "zostało pomyślnie usunięte."
     239msgstr "został pomyślnie usunięty."
    240240
    241241#: core/Settings/Translations.php:41
    242242msgid "have been updated successfully."
    243 msgstr "zostało pomyślnie zaktualizowane."
     243msgstr "został pomyślnie zaktualizowany."
    244244
    245245#: core/Settings/Translations.php:42
     
    253253#: core/Settings/Translations.php:44
    254254msgid "Visit homepage"
    255 msgstr "Odwiedź stronę główną"
     255msgstr "Odwiedź stronę bloku"
    256256
    257257#: core/Settings/Translations.php:45
    258258msgid "Homepage"
    259 msgstr "Strona Główna"
     259msgstr "Strona Bloku"
    260260
    261261#: vendor/foadyousefi/seven-fields/src/Container/Container.php:196
  • cloud-blocks/trunk/readme.txt

    r2020451 r2025157  
    66Tested up to: 5.0
    77Requires PHP: 5.4
    8 Stable tag: 1.1.3
     8Stable tag: 1.1.4
    99License: GPLv3
    1010License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    7575
    7676== Changelog ==
     77
     78= 1.1.4 =
     79* Change: Update counter as a WP CRON (Thanks to [ajotka](https://github.com/front/cloud-blocks/pull/14))
     80* Change: Update some docs
     81* Fix: Fix polish translations
    7782
    7883= 1.1.3 =
Note: See TracChangeset for help on using the changeset viewer.