Browse Source

Merge branch 'master' into dev

# Conflicts:
#	package-lock.json
#	package.json
wordpress-build
Roman Axelrod 2 years ago
parent
commit
977ec0003c
  1. 2
      helpers.js
  2. 4
      package-lock.json
  3. 2
      package.json
  4. 4
      platforms/php/build.php
  5. 10
      platforms/wordpress/templates/Template_Component.php

2
helpers.js

@ -115,7 +115,7 @@ export function capitalize(str) {
return str
.toLowerCase()
.split(/[ -_]/g)
.split(/[-_ ]/g)
.filter((word) => !!word)
.map((word) => {
return word.charAt(0).toUpperCase() + word.slice(1);

4
package-lock.json

@ -1,12 +1,12 @@
{
"name": "@axe-web/block-dev-tool",
"version": "1.0.30",
"version": "1.0.31",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@axe-web/block-dev-tool",
"version": "1.0.30",
"version": "1.0.31",
"license": "ISC",
"dependencies": {
"@axe-web/create-block": "^1.1.30",

2
package.json

@ -1,6 +1,6 @@
{
"name": "@axe-web/block-dev-tool",
"version": "1.0.30",
"version": "1.0.31",
"author": {
"name": "AXE-WEB",
"email": "office@axe-web.com",

4
platforms/php/build.php

@ -71,8 +71,8 @@ class Component_Builder {
$this->register_default_handlebar_helpers();
$this->add_handlebar( 'base_url', function ( $context ) {
$path = join( '/', [ 'blocks', $this->block_project, $this->block_name, 'templates' ] );
return plugins_url( $path . '/', 'axeweb-blocks-library/axeweb-blocks-library.php' );
$path = join( '/', [ $this->block_project, $this->block_name, 'templates' ] );
return join( '/', [ get_site_url(),'wp-content', 'axe-web-blocks', $path, '' ] );
} );
}

10
platforms/wordpress/templates/Template_Component.php

@ -22,8 +22,8 @@ class <%= blockClassModel %>_Component extends \Core\Component {
// $version = \Core\Global_Functions::get_current_version_number(); // In Theme
// $base_path = get_template_directory_uri() . '/components/partials/<%= blockFilename %>/';
wp_enqueue_style( 'block-<%= blockFilename %>', plugins_url( 'templates/styles/<%= blockFilename %>.min.css', __FILE__ ), ['assets-style'], self::VERSION );<% if (include_script) { %>
wp_enqueue_script( 'block-<%= blockFilename %>', plugins_url( 'templates/scripts/<%= blockFilename %>.min.js', __FILE__ ), ['assets-script'], self::VERSION, true );<% } %>
wp_enqueue_style( 'block-<%= blockFilename %>', $this->get_assets_path_url( 'templates/styles/<%= blockFilename %>.min.css' ), ['assets-style'], self::VERSION );<% if (include_script) { %>
wp_enqueue_script( 'block-<%= blockFilename %>', $this->get_assets_path_url( 'templates/scripts/<%= blockFilename %>.min.js' ), ['assets-script'], self::VERSION, true );<% } %>
wp_enqueue_script( 'script-block-<%= blockFilename %>' );
}<% } %>
@ -32,13 +32,13 @@ class <%= blockClassModel %>_Component extends \Core\Component {
'style_assets' => [
[
'name' => '<%= blockFilename %>',
'url' => plugins_url( 'templates/styles/<%= blockFilename %>.min.css', __FILE__ ),
'url' => $this->get_assets_path_url( 'templates/styles/<%= blockFilename %>.min.css' ),
]
],
'script_assets' => [
[
'name' => '<%= blockFilename %>',
'url' => plugins_url( 'templates/scripts/<%= blockFilename %>.min.js', __FILE__ ),
'url' => $this->get_assets_path_url( 'templates/scripts/<%= blockFilename %>.min.js' ),
]
]
] );
@ -50,7 +50,7 @@ class <%= blockClassModel %>_Component extends \Core\Component {
$asset_file_front = include( plugin_dir_path( __FILE__ ) . '/templates/gutenberg-block/build/front.asset.php' );
wp_enqueue_script(
'gutenberg-<%= blockFilename %>-scripts-front',
plugins_url( 'templates/gutenberg-block/build/front.js', __FILE__ ),
$this->get_assets_path_url( 'templates/gutenberg-block/build/front.js' ),
$asset_file_front['dependencies'],
$asset_file_front['version'],
true

Loading…
Cancel
Save