Skip to content

Commit 142f259

Browse files
committed
Merge branch 'develop' into feat/getting-started-onboarding
# Conflicts: # src/components/design-library-list/design-library-list-item.js # src/components/design-library-list/util.js # src/components/modal-design-library/modal.js
2 parents ccdbb58 + fb2381e commit 142f259

File tree

25 files changed

+1191
-1329
lines changed

25 files changed

+1191
-1329
lines changed

.config/externals.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ const wpExternals = [
4242
'keyboard-shortcuts',
4343
'token-list',
4444
'keycodes',
45-
'escape-html'
45+
'escape-html',
46+
'dom'
4647
].reduce( ( externals, name ) => ( {
4748
...externals,
4849
[ `@wordpress/${ name }` ]: `wp.${ camelCaseDash( name ) }`,

composer.json

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,6 @@
44
"license": "GPL-3.0-or-later",
55
"type": "wordpress-plugin",
66
"require-dev": {
7-
"phpunit/phpunit": "^6",
8-
"wp-phpunit/wp-phpunit": "5.7",
9-
"roots/wordpress": "5.7",
107
"wp-cli/i18n-command": "^2.2"
11-
},
12-
"scripts": {
13-
"test": [
14-
"phpunit tests"
15-
]
16-
},
17-
"config": {
18-
"allow-plugins": {
19-
"roots/wordpress-core-installer": true
20-
}
21-
}
8+
}
229
}

gulpfile.js

Lines changed: 1 addition & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -411,81 +411,6 @@ ${ blockDesignSystem });
411411
cb()
412412
} )
413413

414-
gulp.task( 'generate-design-library-default-placeholders-php', function( cb ) {
415-
const fs = require( 'fs' )
416-
417-
let defaultPlaceholders = 'array()'
418-
419-
const toAssocArray = ( key, value, cb, indent ) => {
420-
if ( typeof value === 'object' ) {
421-
const parsed = cb( value, indent + 1 )
422-
return `"${ key }" => ${ parsed }`
423-
}
424-
425-
return `"${ key }" => "${ value }"`
426-
}
427-
428-
const parsePlaceholders = ( obj, indent ) => {
429-
let content = ''
430-
const tab = '\t'.repeat( indent )
431-
432-
if ( typeof obj === 'object' ) {
433-
content += 'array(\n'
434-
435-
Object.entries( obj ).forEach( ( [ key, value ], index, bds ) => {
436-
content += tab + toAssocArray( key, value, parsePlaceholders, indent )
437-
438-
if ( index !== bds.length - 1 ) {
439-
content += ',\n'
440-
} else {
441-
content += '\n'
442-
}
443-
} )
444-
content += `\t`.repeat( indent - 1 ) + ')'
445-
}
446-
return content
447-
}
448-
449-
const jsonPath = path.resolve( __dirname, `src/components/design-library-list/default.json` )
450-
if ( fs.existsSync( jsonPath ) ) {
451-
const fileContent = fs.readFileSync( jsonPath, 'utf-8' )
452-
const raw = JSON.parse( fileContent )
453-
defaultPlaceholders = parsePlaceholders( raw, 4 )
454-
}
455-
456-
// Generate PHP variable string
457-
const script = `<?php
458-
// This is a generated file by gulp generate-design-library-default-placeholders-php
459-
// Use src/components/design-library-list/default.json if you want to edit this file.
460-
461-
// Exit if accessed directly.
462-
if ( ! defined( 'ABSPATH' ) ) {
463-
exit;
464-
}
465-
466-
if ( ! class_exists( 'Stackable_Design_Library_Placeholders' ) ) {
467-
class Stackable_Design_Library_Placeholders {
468-
469-
function __construct() {
470-
}
471-
472-
public static function get_default() {
473-
$default_placeholders = ${ defaultPlaceholders };
474-
475-
return $default_placeholders;
476-
}
477-
}
478-
479-
new Stackable_Design_Library_Placeholders();
480-
}
481-
?>
482-
`
483-
// Write PHP variable to file
484-
fs.writeFileSync( path.resolve( __dirname, 'src/design-library/default-placeholders.php' ), script )
485-
486-
cb()
487-
} )
488-
489414
gulp.task( 'generate-translations-js', gulp.series(
490415
// The collect function has an issue where it will not continue if the
491416
// folder will it writes to doesn't exist, create it to prevent an error.
@@ -778,7 +703,7 @@ gulp.task( 'style-deprecated', gulp.parallel(
778703
* END deprecated build styles, we still build these
779704
********************************************************************/
780705

781-
gulp.task( 'build-process', gulp.parallel( 'style', 'style-editor', 'welcome-styles', 'style-deprecated', 'generate-translations-js', 'generate-stk-block-typesphp', 'generate-design-library-default-placeholders-php' ) )
706+
gulp.task( 'build-process', gulp.parallel( 'style', 'style-editor', 'welcome-styles', 'style-deprecated', 'generate-translations-js', 'generate-stk-block-typesphp' ) )
782707

783708
gulp.task( 'build-block-design-system', gulp.parallel( 'generate-block-design-system-php', 'generate-block-design-system-scss' ) )
784709

@@ -815,11 +740,6 @@ const watchFuncs = ( basePath = '.' ) => {
815740
[ `${ basePath }/src/block/**/block.json` ],
816741
gulp.parallel( [ 'generate-stk-block-typesphp' ] )
817742
)
818-
819-
gulp.watch(
820-
[ `${ basePath }/src/components/design-library-list/default.json` ],
821-
gulp.parallel( [ 'generate-design-library-default-placeholders-php' ] )
822-
)
823743
}
824744

825745
gulp.task( 'watch', gulp.series( 'build-block-design-system', 'build-process', function watch( done ) {

phpunit.xml.dist

Lines changed: 0 additions & 20 deletions
This file was deleted.

plugin.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,6 @@ function is_frontend() {
276276
require_once( plugin_dir_path( __FILE__ ) . 'src/kses.php' );
277277
require_once( plugin_dir_path( __FILE__ ) . 'src/dynamic-breakpoints.php' );
278278
require_once( plugin_dir_path( __FILE__ ) . 'src/design-library/init.php' );
279-
require_once( plugin_dir_path( __FILE__ ) . 'src/design-library/default-placeholders.php' );
280279
require_once( plugin_dir_path( __FILE__ ) . 'src/styles/block-design-system.php' );
281280
require_once( plugin_dir_path( __FILE__ ) . 'src/plugins/theme-block-style-inheritance/index.php' );
282281
require_once( plugin_dir_path( __FILE__ ) . 'src/global-settings.php' );

0 commit comments

Comments
 (0)