From 8a2bd458e4bf22d0916a5152be1747f3d68548ce Mon Sep 17 00:00:00 2001 From: cahdeemer Date: Wed, 5 Jun 2024 17:15:46 -0400 Subject: [PATCH 01/15] wip --- block-filters/heading/index.php | 36 ++++++++++++++++++++ block-filters/heading/index.tsx | 58 +++++++++++++++++++++++++++++++++ plugin.php | 2 +- webpack.config.js | 1 + 4 files changed, 96 insertions(+), 1 deletion(-) create mode 100644 block-filters/heading/index.php create mode 100644 block-filters/heading/index.tsx diff --git a/block-filters/heading/index.php b/block-filters/heading/index.php new file mode 100644 index 00000000..23c822ef --- /dev/null +++ b/block-filters/heading/index.php @@ -0,0 +1,36 @@ + ({ }, { // All other custom entry points can be included here. 'wp-newsletter-builder-separator/index': './block-filters/separator', + 'wp-newsletter-builder-heading/index': './block-filters/heading', 'wp-newsletter-builder-from-post/index': './plugins/newsletter-from-post', 'newsletter-status/index': './plugins/newsletter-status', }), From db59c1cd8ed1b2fbec9b700a5dc0334b0e2ebe4f Mon Sep 17 00:00:00 2001 From: cahdeemer Date: Thu, 6 Jun 2024 14:08:38 -0400 Subject: [PATCH 02/15] refine settings for core heading block --- block-filters/heading/index.tsx | 43 +++++++++++++++------------------ 1 file changed, 19 insertions(+), 24 deletions(-) diff --git a/block-filters/heading/index.tsx b/block-filters/heading/index.tsx index 7b8adc10..20bd4030 100644 --- a/block-filters/heading/index.tsx +++ b/block-filters/heading/index.tsx @@ -1,10 +1,8 @@ -/** - * WordPress dependencies - */ import { addFilter } from '@wordpress/hooks'; /** - * Adds border support to Column, Heading, and Paragraph blocks. + * Modifies supports for Heading block. + * https://nickdiego.com/how-to-modify-block-supports-using-client-side-filters/ * * @param {Object} settings - The original block settings. * @param {string} name - The name of the block. @@ -12,38 +10,35 @@ import { addFilter } from '@wordpress/hooks'; * @returns {Object} The modified block settings with added border support. */ // @ts-ignore -function addBorderSupport(settings, name) { +function modifyHeadingSupports(settings, name) { // Bail early if the block does not have supports. if (!settings?.supports) { - console.log('here'); return settings; } - - // Only apply to Column, Heading, and Paragraph blocks. + // Only apply to Heading blocks. if ( name === 'core/heading' - || name === 'core/paragraph' ) { - console.log('what about here'); return { ...settings, supports: Object.assign(settings.supports, { - __experimentalBorder: { - color: true, - style: true, - width: true, - radius: true, - __experimentalDefaultControls: { - color: false, - style: false, - width: false, - radius: false, - }, - }, + align: [], + anchor: false, color: { background: false, text: false, }, + customClassName: false, + spacing: false, + typography: { + __experimentalFontSize: false, + __experimentalLineHeight: false, + __experimentalLetterSpacing: true, + __experimentalFontFamily: false, + __experimentalFontWeight: false, + __experimentalFontStyle: false, + __experimentalTextTransform: true, + }, }), }; } @@ -53,6 +48,6 @@ function addBorderSupport(settings, name) { addFilter( 'blocks.registerBlockType', - 'modify-block-supports/add-border-support', - addBorderSupport, + 'wp-newsletter-builder/heading', + modifyHeadingSupports, ); From 5f674e6558d1158a74d3cf333dd765bc62ada548 Mon Sep 17 00:00:00 2001 From: cahdeemer Date: Thu, 6 Jun 2024 17:08:27 -0400 Subject: [PATCH 03/15] add custom supports for core paragraph block --- block-filters/heading/index.php | 6 ++-- block-filters/paragraph/index.php | 36 +++++++++++++++++++++ block-filters/paragraph/index.tsx | 54 +++++++++++++++++++++++++++++++ plugin.php | 1 + webpack.config.js | 1 + 5 files changed, 95 insertions(+), 3 deletions(-) create mode 100644 block-filters/paragraph/index.php create mode 100644 block-filters/paragraph/index.tsx diff --git a/block-filters/heading/index.php b/block-filters/heading/index.php index 23c822ef..1ae3d3fc 100644 --- a/block-filters/heading/index.php +++ b/block-filters/heading/index.php @@ -1,6 +1,6 @@ ({ // All other custom entry points can be included here. 'wp-newsletter-builder-separator/index': './block-filters/separator', 'wp-newsletter-builder-heading/index': './block-filters/heading', + 'wp-newsletter-builder-paragraph/index': './block-filters/paragraph', 'wp-newsletter-builder-from-post/index': './plugins/newsletter-from-post', 'newsletter-status/index': './plugins/newsletter-status', }), From af3b85a62befe364bf4218fffa9dd69f6841ba98 Mon Sep 17 00:00:00 2001 From: cahdeemer Date: Fri, 7 Jun 2024 09:54:07 -0400 Subject: [PATCH 04/15] add custom block supports for list block --- block-filters/list/index.php | 36 +++++++++++++++++++++ block-filters/list/index.tsx | 54 +++++++++++++++++++++++++++++++ block-filters/paragraph/index.tsx | 1 - plugin.php | 1 + webpack.config.js | 1 + 5 files changed, 92 insertions(+), 1 deletion(-) create mode 100644 block-filters/list/index.php create mode 100644 block-filters/list/index.tsx diff --git a/block-filters/list/index.php b/block-filters/list/index.php new file mode 100644 index 00000000..77235903 --- /dev/null +++ b/block-filters/list/index.php @@ -0,0 +1,36 @@ + ({ 'wp-newsletter-builder-separator/index': './block-filters/separator', 'wp-newsletter-builder-heading/index': './block-filters/heading', 'wp-newsletter-builder-paragraph/index': './block-filters/paragraph', + 'wp-newsletter-builder-list/index': './block-filters/list', 'wp-newsletter-builder-from-post/index': './plugins/newsletter-from-post', 'newsletter-status/index': './plugins/newsletter-status', }), From 8360af3063a67c35d44f3168491a64218c3b638f Mon Sep 17 00:00:00 2001 From: cahdeemer Date: Fri, 7 Jun 2024 09:54:40 -0400 Subject: [PATCH 05/15] version bump --- plugin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin.php b/plugin.php index 24cf2e94..347915dc 100644 --- a/plugin.php +++ b/plugin.php @@ -3,7 +3,7 @@ * Plugin Name: Newsletter Builder * Plugin URI: https://github.com/alleyinteractive/wp-newsletter-builder * Description: Interface to manage email newsletters - * Version: 0.3.18 + * Version: 0.3.19 * Author: Alley Interactive * Author URI: https://github.com/alleyinteractive/wp-newsletter-builder * Requires at least: 6.2 From c4b6eeed75fa7bd3f7cd56092d93b2b6a8299332 Mon Sep 17 00:00:00 2001 From: cahdeemer Date: Fri, 7 Jun 2024 11:19:15 -0400 Subject: [PATCH 06/15] tidy up --- block-filters/heading/index.tsx | 3 +-- block-filters/list/index.tsx | 3 +-- block-filters/paragraph/index.tsx | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/block-filters/heading/index.tsx b/block-filters/heading/index.tsx index 20bd4030..4db90608 100644 --- a/block-filters/heading/index.tsx +++ b/block-filters/heading/index.tsx @@ -2,12 +2,11 @@ import { addFilter } from '@wordpress/hooks'; /** * Modifies supports for Heading block. - * https://nickdiego.com/how-to-modify-block-supports-using-client-side-filters/ * * @param {Object} settings - The original block settings. * @param {string} name - The name of the block. * - * @returns {Object} The modified block settings with added border support. + * @returns {Object} The modified block settings. */ // @ts-ignore function modifyHeadingSupports(settings, name) { diff --git a/block-filters/list/index.tsx b/block-filters/list/index.tsx index 5579c198..5dc17a1f 100644 --- a/block-filters/list/index.tsx +++ b/block-filters/list/index.tsx @@ -2,12 +2,11 @@ import { addFilter } from '@wordpress/hooks'; /** * Modifies supports for List block. - * https://nickdiego.com/how-to-modify-block-supports-using-client-side-filters/ * * @param {Object} settings - The original block settings. * @param {string} name - The name of the block. * - * @returns {Object} The modified block settings with added border support. + * @returns {Object} The modified block settings. */ // @ts-ignore function modifyListSupports(settings, name) { diff --git a/block-filters/paragraph/index.tsx b/block-filters/paragraph/index.tsx index dda0edf1..7394041a 100644 --- a/block-filters/paragraph/index.tsx +++ b/block-filters/paragraph/index.tsx @@ -2,12 +2,11 @@ import { addFilter } from '@wordpress/hooks'; /** * Modifies supports for Paragraph block. - * https://nickdiego.com/how-to-modify-block-supports-using-client-side-filters/ * * @param {Object} settings - The original block settings. * @param {string} name - The name of the block. * - * @returns {Object} The modified block settings with added border support. + * @returns {Object} The modified block settings. */ // @ts-ignore function modifyParagraphSupports(settings, name) { From f37846af03811e3c451e92541ef2b44df3272f52 Mon Sep 17 00:00:00 2001 From: cahdeemer Date: Mon, 10 Jun 2024 17:47:43 -0400 Subject: [PATCH 07/15] remove heading, list, and paragraph from inserter --- block-filters/heading/index.tsx | 3 ++- block-filters/list/index.tsx | 1 + block-filters/paragraph/index.tsx | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/block-filters/heading/index.tsx b/block-filters/heading/index.tsx index 4db90608..1b2c5284 100644 --- a/block-filters/heading/index.tsx +++ b/block-filters/heading/index.tsx @@ -1,4 +1,5 @@ import { addFilter } from '@wordpress/hooks'; +// import { createHigherOrderComponent } from '@wordpress/compose'; /** * Modifies supports for Heading block. @@ -28,6 +29,7 @@ function modifyHeadingSupports(settings, name) { text: false, }, customClassName: false, + inserter: false, spacing: false, typography: { __experimentalFontSize: false, @@ -41,7 +43,6 @@ function modifyHeadingSupports(settings, name) { }), }; } - return settings; } diff --git a/block-filters/list/index.tsx b/block-filters/list/index.tsx index 5dc17a1f..7727cab6 100644 --- a/block-filters/list/index.tsx +++ b/block-filters/list/index.tsx @@ -29,6 +29,7 @@ function modifyListSupports(settings, name) { text: false, }, customClassName: false, + inserter: false, spacing: false, typography: { __experimentalFontSize: false, diff --git a/block-filters/paragraph/index.tsx b/block-filters/paragraph/index.tsx index 7394041a..2855c8ac 100644 --- a/block-filters/paragraph/index.tsx +++ b/block-filters/paragraph/index.tsx @@ -28,6 +28,7 @@ function modifyParagraphSupports(settings, name) { text: false, }, customClassName: false, + inserter: false, spacing: false, typography: { __experimentalFontSize: false, From 610933461482fd56c059c315052922766e89e6a2 Mon Sep 17 00:00:00 2001 From: cahdeemer Date: Mon, 10 Jun 2024 17:48:06 -0400 Subject: [PATCH 08/15] add newsletter heading block --- blocks/heading/block.json | 23 ++++++++++++ blocks/heading/edit.tsx | 73 +++++++++++++++++++++++++++++++++++++++ blocks/heading/index.php | 22 ++++++++++++ blocks/heading/index.tsx | 47 +++++++++++++++++++++++++ blocks/heading/render.php | 16 +++++++++ 5 files changed, 181 insertions(+) create mode 100644 blocks/heading/block.json create mode 100644 blocks/heading/edit.tsx create mode 100644 blocks/heading/index.php create mode 100644 blocks/heading/index.tsx create mode 100644 blocks/heading/render.php diff --git a/blocks/heading/block.json b/blocks/heading/block.json new file mode 100644 index 00000000..442f5f75 --- /dev/null +++ b/blocks/heading/block.json @@ -0,0 +1,23 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "wp-newsletter-builder/heading", + "version": "0.1.0", + "title": "Newsletter Heading", + "category": "text", + "icon": "heading", + "description": "Heading wrapper that provides email-friendly enhancements", + "textdomain": "heading", + "editorScript": "file:index.ts", + "editorStyle": "file:index.css", + "style": [ + "file:style-index.css" + ], + "render": "file:render.php", + "attributes": { + "elColor": { + "type": "string", + "default": "#000" + } + } +} \ No newline at end of file diff --git a/blocks/heading/edit.tsx b/blocks/heading/edit.tsx new file mode 100644 index 00000000..9768b65d --- /dev/null +++ b/blocks/heading/edit.tsx @@ -0,0 +1,73 @@ +/** + * Retrieves the translation of text. + * + * @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-i18n/ + */ +import { __ } from '@wordpress/i18n'; + +/** + * React hook that is used to mark the block wrapper element. + * It provides all the necessary props like the class name. + * + * @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-block-editor/#useblockprops + */ +import { useBlockProps, InspectorControls, InnerBlocks } from '@wordpress/block-editor'; +import { ColorPicker, PanelBody } from '@wordpress/components'; + +/** + * 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 + */ +// Uncomment this line if you want to import a CSS file for this block. +// import './index.scss'; + +/** + * The edit function describes the structure of your block in the context of the + * editor. This represents what the editor will render when the block is used. + * + * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-edit-save/#edit + * + * @return {WPElement} Element to render. + */ +interface EditProps { + attributes: { + elColor?: string; + }; + setAttributes: (attributes: {}) => void; +} + +export default function Edit({ + attributes: { + elColor = '#000', + }, + setAttributes, +}: EditProps) { + const TEMPLATE = [['core/heading']]; + const headingStyles = { + color: elColor, + }; + + return ( + <> + + +

{__('Text color', 'wp-newsletter-builder')}

+ {/* Using ColorPicker instead of ColorPalette to ensure email-friendly values. */} + setAttributes({ elColor: color })} + /> +
+
+
+ +
+ + ); +} diff --git a/blocks/heading/index.php b/blocks/heading/index.php new file mode 100644 index 00000000..5d61f9d9 --- /dev/null +++ b/blocks/heading/index.php @@ -0,0 +1,22 @@ + { + const blockProps = useBlockProps.save(); + return ( +
+ {/* @ts-ignore */} + +
+ ); + }, + title: metadata.title, + }, +); diff --git a/blocks/heading/render.php b/blocks/heading/render.php new file mode 100644 index 00000000..2937d2ba --- /dev/null +++ b/blocks/heading/render.php @@ -0,0 +1,16 @@ +. + * @param WP_Block $block_instance The instance of the WP_Block class that represents the block being rendered. + * + * @package wp-newsletter-builder + */ + +$wp_newsletter_builder_heading_color = $attributes['elColor'] ?? null; +?> +
+ +
\ No newline at end of file From d9930144cbc4049e7bd51f9e260be5e5fe59f2fc Mon Sep 17 00:00:00 2001 From: cahdeemer Date: Mon, 10 Jun 2024 17:48:23 -0400 Subject: [PATCH 09/15] add newsletter list block --- blocks/list/block.json | 23 +++++++++++++ blocks/list/edit.tsx | 73 ++++++++++++++++++++++++++++++++++++++++++ blocks/list/index.php | 22 +++++++++++++ blocks/list/index.tsx | 47 +++++++++++++++++++++++++++ blocks/list/render.php | 15 +++++++++ 5 files changed, 180 insertions(+) create mode 100644 blocks/list/block.json create mode 100644 blocks/list/edit.tsx create mode 100644 blocks/list/index.php create mode 100644 blocks/list/index.tsx create mode 100644 blocks/list/render.php diff --git a/blocks/list/block.json b/blocks/list/block.json new file mode 100644 index 00000000..58f50262 --- /dev/null +++ b/blocks/list/block.json @@ -0,0 +1,23 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "wp-newsletter-builder/list", + "version": "0.1.0", + "title": "Newsletter List", + "category": "text", + "icon": "editor-ul", + "description": "List wrapper that provides email-friendly enhancements", + "textdomain": "list", + "editorScript": "file:index.ts", + "editorStyle": "file:index.css", + "style": [ + "file:style-index.css" + ], + "render": "file:render.php", + "attributes": { + "elColor": { + "type": "string", + "default": "#000" + } + } +} \ No newline at end of file diff --git a/blocks/list/edit.tsx b/blocks/list/edit.tsx new file mode 100644 index 00000000..6268c885 --- /dev/null +++ b/blocks/list/edit.tsx @@ -0,0 +1,73 @@ +/** + * Retrieves the translation of text. + * + * @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-i18n/ + */ +import { __ } from '@wordpress/i18n'; + +/** + * React hook that is used to mark the block wrapper element. + * It provides all the necessary props like the class name. + * + * @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-block-editor/#useblockprops + */ +import { useBlockProps, InspectorControls, InnerBlocks } from '@wordpress/block-editor'; +import { ColorPicker, PanelBody } from '@wordpress/components'; + +/** + * 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 + */ +// Uncomment this line if you want to import a CSS file for this block. +// import './index.scss'; + +/** + * The edit function describes the structure of your block in the context of the + * editor. This represents what the editor will render when the block is used. + * + * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-edit-save/#edit + * + * @return {WPElement} Element to render. + */ +interface EditProps { + attributes: { + elColor?: string; + }; + setAttributes: (attributes: {}) => void; +} + +export default function Edit({ + attributes: { + elColor = '#000', + }, + setAttributes, +}: EditProps) { + const TEMPLATE = [['core/list']]; + const listStyles = { + color: elColor, + }; + + return ( + <> + + +

{__('Text color', 'wp-newsletter-builder')}

+ {/* Using ColorPicker instead of ColorPalette to ensure email-friendly values. */} + setAttributes({ elColor: color })} + /> +
+
+
+ +
+ + ); +} diff --git a/blocks/list/index.php b/blocks/list/index.php new file mode 100644 index 00000000..78b38dd6 --- /dev/null +++ b/blocks/list/index.php @@ -0,0 +1,22 @@ + { + const blockProps = useBlockProps.save(); + return ( +
+ {/* @ts-ignore */} + +
+ ); + }, + title: metadata.title, + }, +); diff --git a/blocks/list/render.php b/blocks/list/render.php new file mode 100644 index 00000000..9c9f1a06 --- /dev/null +++ b/blocks/list/render.php @@ -0,0 +1,15 @@ +. + * @param WP_Block $block_instance The instance of the WP_Block class that represents the block being rendered. + * + * @package wp-newsletter-builder + */ +$wp_newsletter_builder_list_color = $attributes['elColor'] ?? null; +?> +
+ +
From 02418a1aa4843ede25b6ae0d85ab0ce3db2f43c0 Mon Sep 17 00:00:00 2001 From: cahdeemer Date: Mon, 10 Jun 2024 17:48:35 -0400 Subject: [PATCH 10/15] add newsletter paragraph block --- blocks/paragraph/block.json | 23 ++++++++++++ blocks/paragraph/edit.tsx | 73 +++++++++++++++++++++++++++++++++++++ blocks/paragraph/index.php | 22 +++++++++++ blocks/paragraph/index.tsx | 47 ++++++++++++++++++++++++ blocks/paragraph/render.php | 15 ++++++++ 5 files changed, 180 insertions(+) create mode 100644 blocks/paragraph/block.json create mode 100644 blocks/paragraph/edit.tsx create mode 100644 blocks/paragraph/index.php create mode 100644 blocks/paragraph/index.tsx create mode 100644 blocks/paragraph/render.php diff --git a/blocks/paragraph/block.json b/blocks/paragraph/block.json new file mode 100644 index 00000000..c7aa278e --- /dev/null +++ b/blocks/paragraph/block.json @@ -0,0 +1,23 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "wp-newsletter-builder/paragraph", + "version": "0.1.0", + "title": "Newsletter Paragraph", + "category": "text", + "icon": "editor-paragraph", + "description": "Paragraph wrapper that provides email-friendly enhancements", + "textdomain": "paragraph", + "editorScript": "file:index.ts", + "editorStyle": "file:index.css", + "style": [ + "file:style-index.css" + ], + "render": "file:render.php", + "attributes": { + "elColor": { + "type": "string", + "default": "#000" + } + } +} \ No newline at end of file diff --git a/blocks/paragraph/edit.tsx b/blocks/paragraph/edit.tsx new file mode 100644 index 00000000..faea1815 --- /dev/null +++ b/blocks/paragraph/edit.tsx @@ -0,0 +1,73 @@ +/** + * Retrieves the translation of text. + * + * @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-i18n/ + */ +import { __ } from '@wordpress/i18n'; + +/** + * React hook that is used to mark the block wrapper element. + * It provides all the necessary props like the class name. + * + * @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-block-editor/#useblockprops + */ +import { useBlockProps, InspectorControls, InnerBlocks } from '@wordpress/block-editor'; +import { ColorPicker, PanelBody } from '@wordpress/components'; + +/** + * 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 + */ +// Uncomment this line if you want to import a CSS file for this block. +// import './index.scss'; + +/** + * The edit function describes the structure of your block in the context of the + * editor. This represents what the editor will render when the block is used. + * + * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-edit-save/#edit + * + * @return {WPElement} Element to render. + */ +interface EditProps { + attributes: { + elColor?: string; + }; + setAttributes: (attributes: {}) => void; +} + +export default function Edit({ + attributes: { + elColor = '#000', + }, + setAttributes, +}: EditProps) { + const TEMPLATE = [['core/paragraph']]; + const paragraphStyles = { + color: elColor, + }; + + return ( + <> + + +

{__('Text color', 'wp-newsletter-builder')}

+ {/* Using ColorPicker instead of ColorPalette to ensure email-friendly values. */} + setAttributes({ elColor: color })} + /> +
+
+
+ +
+ + ); +} diff --git a/blocks/paragraph/index.php b/blocks/paragraph/index.php new file mode 100644 index 00000000..ad509248 --- /dev/null +++ b/blocks/paragraph/index.php @@ -0,0 +1,22 @@ + { + const blockProps = useBlockProps.save(); + return ( +
+ {/* @ts-ignore */} + +
+ ); + }, + title: metadata.title, + }, +); diff --git a/blocks/paragraph/render.php b/blocks/paragraph/render.php new file mode 100644 index 00000000..cbc497cb --- /dev/null +++ b/blocks/paragraph/render.php @@ -0,0 +1,15 @@ +. + * @param WP_Block $block_instance The instance of the WP_Block class that represents the block being rendered. + * + * @package wp-newsletter-builder + */ +$wp_newsletter_builder_paragraph_color = $attributes['elColor'] ?? null; +?> +
+ +
From e5339e8f78257388884acd46d289d2e898775558 Mon Sep 17 00:00:00 2001 From: cahdeemer Date: Mon, 10 Jun 2024 18:00:49 -0400 Subject: [PATCH 11/15] lint --- blocks/divider/render.php | 1 + blocks/heading/index.php | 5 ++--- blocks/heading/render.php | 2 +- blocks/list/index.php | 4 ++-- blocks/list/render.php | 2 +- blocks/paragraph/index.php | 4 ++-- blocks/paragraph/render.php | 3 ++- 7 files changed, 11 insertions(+), 10 deletions(-) diff --git a/blocks/divider/render.php b/blocks/divider/render.php index 21c20995..4bb308bf 100644 --- a/blocks/divider/render.php +++ b/blocks/divider/render.php @@ -12,4 +12,5 @@ $wp_newsletter_builder_divider_height = $attributes['elHeight'] ?? null; $wp_newsletter_builder_divider_color = $attributes['elColor'] ?? null; ?> +
diff --git a/blocks/heading/index.php b/blocks/heading/index.php index 5d61f9d9..62c586cd 100644 --- a/blocks/heading/index.php +++ b/blocks/heading/index.php @@ -12,11 +12,10 @@ * * @see https://developer.wordpress.org/reference/functions/register_block_type/ */ -function heading_heading_block_init() { +function wp_newsletter_builder_heading_block_init() { // Register the block by passing the location of block.json. register_block_type( __DIR__ ); - } -add_action( 'init', 'heading_heading_block_init' ); +add_action( 'init', 'wp_newsletter_builder_heading_block_init' ); diff --git a/blocks/heading/render.php b/blocks/heading/render.php index 2937d2ba..d4d3da52 100644 --- a/blocks/heading/render.php +++ b/blocks/heading/render.php @@ -9,7 +9,7 @@ * @package wp-newsletter-builder */ -$wp_newsletter_builder_heading_color = $attributes['elColor'] ?? null; +$wp_newsletter_builder_heading_color = $attributes['elColor'] ?? null; ?>
diff --git a/blocks/list/index.php b/blocks/list/index.php index 78b38dd6..4d2ea0e6 100644 --- a/blocks/list/index.php +++ b/blocks/list/index.php @@ -12,11 +12,11 @@ * * @see https://developer.wordpress.org/reference/functions/register_block_type/ */ -function list_list_block_init() { +function wp_newsletter_builder_list_block_init() { // Register the block by passing the location of block.json. register_block_type( __DIR__ ); } -add_action( 'init', 'list_list_block_init' ); +add_action( 'init', 'wp_newsletter_builder_list_block_init' ); diff --git a/blocks/list/render.php b/blocks/list/render.php index 9c9f1a06..c4bc39cd 100644 --- a/blocks/list/render.php +++ b/blocks/list/render.php @@ -8,7 +8,7 @@ * * @package wp-newsletter-builder */ -$wp_newsletter_builder_list_color = $attributes['elColor'] ?? null; +$wp_newsletter_builder_list_color = $attributes['elColor'] ?? null; ?>
diff --git a/blocks/paragraph/index.php b/blocks/paragraph/index.php index ad509248..9b2cfd54 100644 --- a/blocks/paragraph/index.php +++ b/blocks/paragraph/index.php @@ -12,11 +12,11 @@ * * @see https://developer.wordpress.org/reference/functions/register_block_type/ */ -function paragraph_paragraph_block_init() { +function wp_newsletter_builder_paragraph_block_init() { // Register the block by passing the location of block.json. register_block_type( __DIR__ ); } -add_action( 'init', 'paragraph_paragraph_block_init' ); +add_action( 'init', 'wp_newsletter_builder_paragraph_block_init' ); diff --git a/blocks/paragraph/render.php b/blocks/paragraph/render.php index cbc497cb..ddeb6daa 100644 --- a/blocks/paragraph/render.php +++ b/blocks/paragraph/render.php @@ -8,7 +8,8 @@ * * @package wp-newsletter-builder */ -$wp_newsletter_builder_paragraph_color = $attributes['elColor'] ?? null; + +$wp_newsletter_builder_paragraph_color = $attributes['elColor'] ?? null; ?>
From f4744b80b9a7f38a5df170af66b29d9b7eb7f333 Mon Sep 17 00:00:00 2001 From: cahdeemer Date: Mon, 10 Jun 2024 18:05:56 -0400 Subject: [PATCH 12/15] lint --- blocks/list/index.php | 1 - blocks/list/render.php | 1 + blocks/paragraph/index.php | 1 - blocks/paragraph/render.php | 1 + 4 files changed, 2 insertions(+), 2 deletions(-) diff --git a/blocks/list/index.php b/blocks/list/index.php index 4d2ea0e6..6f484f99 100644 --- a/blocks/list/index.php +++ b/blocks/list/index.php @@ -17,6 +17,5 @@ function wp_newsletter_builder_list_block_init() { register_block_type( __DIR__ ); - } add_action( 'init', 'wp_newsletter_builder_list_block_init' ); diff --git a/blocks/list/render.php b/blocks/list/render.php index c4bc39cd..2c73866a 100644 --- a/blocks/list/render.php +++ b/blocks/list/render.php @@ -10,6 +10,7 @@ */ $wp_newsletter_builder_list_color = $attributes['elColor'] ?? null; ?> +
diff --git a/blocks/paragraph/index.php b/blocks/paragraph/index.php index 9b2cfd54..d312b20a 100644 --- a/blocks/paragraph/index.php +++ b/blocks/paragraph/index.php @@ -17,6 +17,5 @@ function wp_newsletter_builder_paragraph_block_init() { register_block_type( __DIR__ ); - } add_action( 'init', 'wp_newsletter_builder_paragraph_block_init' ); diff --git a/blocks/paragraph/render.php b/blocks/paragraph/render.php index ddeb6daa..3039a367 100644 --- a/blocks/paragraph/render.php +++ b/blocks/paragraph/render.php @@ -11,6 +11,7 @@ $wp_newsletter_builder_paragraph_color = $attributes['elColor'] ?? null; ?> +
From 3c010701968db5ed304165c2efdc1b39e6958a7e Mon Sep 17 00:00:00 2001 From: cahdeemer Date: Mon, 10 Jun 2024 18:07:24 -0400 Subject: [PATCH 13/15] lint --- blocks/list/render.php | 1 + 1 file changed, 1 insertion(+) diff --git a/blocks/list/render.php b/blocks/list/render.php index 2c73866a..051c02da 100644 --- a/blocks/list/render.php +++ b/blocks/list/render.php @@ -8,6 +8,7 @@ * * @package wp-newsletter-builder */ + $wp_newsletter_builder_list_color = $attributes['elColor'] ?? null; ?> From b8a721e1ef0f31e9929e6732965c060cb9348c68 Mon Sep 17 00:00:00 2001 From: cahdeemer Date: Tue, 11 Jun 2024 11:41:35 -0400 Subject: [PATCH 14/15] fix vulnerability in node modules --- package-lock.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/package-lock.json b/package-lock.json index 023b11c1..c16daaa9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13116,11 +13116,11 @@ } }, "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dependencies": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" }, "engines": { "node": ">=8" @@ -17050,9 +17050,9 @@ } }, "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dependencies": { "to-regex-range": "^5.0.1" }, From 0f3e617f3096e84d1372b7239f01a9ff9a280a25 Mon Sep 17 00:00:00 2001 From: cahdeemer Date: Tue, 11 Jun 2024 15:52:51 -0400 Subject: [PATCH 15/15] suggestions per CR --- block-filters/heading/index.tsx | 1 - blocks/heading/render.php | 2 +- blocks/list/render.php | 2 +- blocks/paragraph/render.php | 2 +- 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/block-filters/heading/index.tsx b/block-filters/heading/index.tsx index 1b2c5284..6439a32a 100644 --- a/block-filters/heading/index.tsx +++ b/block-filters/heading/index.tsx @@ -1,5 +1,4 @@ import { addFilter } from '@wordpress/hooks'; -// import { createHigherOrderComponent } from '@wordpress/compose'; /** * Modifies supports for Heading block. diff --git a/blocks/heading/render.php b/blocks/heading/render.php index d4d3da52..84e246f0 100644 --- a/blocks/heading/render.php +++ b/blocks/heading/render.php @@ -9,7 +9,7 @@ * @package wp-newsletter-builder */ -$wp_newsletter_builder_heading_color = $attributes['elColor'] ?? null; +$wp_newsletter_builder_heading_color = $attributes['elColor'] ?? ''; ?>
diff --git a/blocks/list/render.php b/blocks/list/render.php index 051c02da..bd3d75c0 100644 --- a/blocks/list/render.php +++ b/blocks/list/render.php @@ -9,7 +9,7 @@ * @package wp-newsletter-builder */ -$wp_newsletter_builder_list_color = $attributes['elColor'] ?? null; +$wp_newsletter_builder_list_color = $attributes['elColor'] ?? ''; ?>
diff --git a/blocks/paragraph/render.php b/blocks/paragraph/render.php index 3039a367..a1bc44a0 100644 --- a/blocks/paragraph/render.php +++ b/blocks/paragraph/render.php @@ -9,7 +9,7 @@ * @package wp-newsletter-builder */ -$wp_newsletter_builder_paragraph_color = $attributes['elColor'] ?? null; +$wp_newsletter_builder_paragraph_color = $attributes['elColor'] ?? ''; ?>