From 43e0b21452e596dfee279581e281aa552c303b06 Mon Sep 17 00:00:00 2001 From: Grzegorz Ziolkowski Date: Sat, 6 Jun 2020 19:07:42 +0200 Subject: [PATCH 1/2] Create Block: Revert changes to the list of categories in the prompt Related issue: https://github.com/WordPress/gutenberg/issues/22848 It ensures that blocks will continue to work with WordPress 5.4.x. We should be able to use the new set of categories once WordPress 5.5 is out. --- packages/create-block/lib/prompts.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/create-block/lib/prompts.js b/packages/create-block/lib/prompts.js index 5c6d47ea46aa13..5624f984f8292a 100644 --- a/packages/create-block/lib/prompts.js +++ b/packages/create-block/lib/prompts.js @@ -70,7 +70,7 @@ const category = { type: 'list', name: 'category', message: 'The category name to help users browse and discover your block:', - choices: [ 'text', 'embed', 'media', 'design', 'widgets' ], + choices: [ 'common', 'embed', 'formatting', 'layout', 'widgets' ], }; const author = { From f578a98876be90be393ca702925749ef38759430 Mon Sep 17 00:00:00 2001 From: Grzegorz Ziolkowski Date: Sat, 6 Jun 2020 19:28:07 +0200 Subject: [PATCH 2/2] Create Block: Add inline comments explaining how CSS imports in JS work --- .../lib/templates/esnext/src/edit.js.mustache | 5 ++++- .../lib/templates/esnext/src/index.js.mustache | 10 +++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/packages/create-block/lib/templates/esnext/src/edit.js.mustache b/packages/create-block/lib/templates/esnext/src/edit.js.mustache index 71eea7e1928292..4a34d7ce232de9 100644 --- a/packages/create-block/lib/templates/esnext/src/edit.js.mustache +++ b/packages/create-block/lib/templates/esnext/src/edit.js.mustache @@ -6,7 +6,10 @@ import { __ } from '@wordpress/i18n'; /** - * Internal dependencies + * Lets webpack process CSS, SASS or SCSS files referenced in JavaScript files. + * Those files can contain any CSS code that gets applied to the editor. + * + * @see https://www.npmjs.com/package/@wordpress/scripts#using-css */ import './editor.scss'; diff --git a/packages/create-block/lib/templates/esnext/src/index.js.mustache b/packages/create-block/lib/templates/esnext/src/index.js.mustache index 72fa02b82a751b..ef9236403bbf21 100644 --- a/packages/create-block/lib/templates/esnext/src/index.js.mustache +++ b/packages/create-block/lib/templates/esnext/src/index.js.mustache @@ -13,9 +13,17 @@ import { registerBlockType } from '@wordpress/blocks'; import { __ } from '@wordpress/i18n'; /** - * Internal dependencies + * Lets webpack process CSS, SASS or SCSS files referenced in JavaScript files. + * All files containing `style` keyword are bundled together. The code used + * gets applied both to the front of your site and to the editor. + * + * @see https://www.npmjs.com/package/@wordpress/scripts#using-css */ import './style.scss'; + +/** + * Internal dependencies + */ import Edit from './edit'; import save from './save';