From 0f550e8c45530cac4e81fcb3ec66329ee777fa04 Mon Sep 17 00:00:00 2001 From: Davis Shaver Date: Mon, 15 Jan 2024 08:19:39 -0500 Subject: [PATCH 1/4] fix: add editor-style entrypoint --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 9fecc62..63cf65a 100644 --- a/package.json +++ b/package.json @@ -65,7 +65,8 @@ "shared-style": "./assets/css/shared/shared-style.css", "style": "./assets/css/frontend/style.css", "tabs-block": "./includes/blocks/block-editor/tabs/register.js", - "tabs-item-block": "./includes/blocks/block-editor/tabs-item/register.js" + "tabs-item-block": "./includes/blocks/block-editor/tabs-item/register.js", + "editor-style": "./assets/css/frontend/editor-style.css" } } } From 600b89278b7a45f9f2c0af52bdd936656bc22fab Mon Sep 17 00:00:00 2001 From: Davis Shaver Date: Mon, 15 Jan 2024 08:27:29 -0500 Subject: [PATCH 2/4] fix: update paths, remove min from filename --- includes/core.php | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/core.php b/includes/core.php index a5d097d..cca3a6c 100755 --- a/includes/core.php +++ b/includes/core.php @@ -349,7 +349,7 @@ function mce_css( $stylesheets ) { return $stylesheets . PUBLISHER_MEDIA_KIT_URL . ( ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? 'assets/css/frontend/editor-style.css' : - 'dist/css/editor-style.min.css' ); + 'dist/css/editor-style.css' ); } /** diff --git a/package.json b/package.json index 63cf65a..daa5809 100644 --- a/package.json +++ b/package.json @@ -66,7 +66,7 @@ "style": "./assets/css/frontend/style.css", "tabs-block": "./includes/blocks/block-editor/tabs/register.js", "tabs-item-block": "./includes/blocks/block-editor/tabs-item/register.js", - "editor-style": "./assets/css/frontend/editor-style.css" + "editor-style": "./assets/css/admin/editor-style.css" } } } From 3da7c703e4eff2c9d002282839c372163938fc00 Mon Sep 17 00:00:00 2001 From: Davis Shaver Date: Mon, 15 Jan 2024 08:29:36 -0500 Subject: [PATCH 3/4] fix: path for script debug is wrong too --- includes/core.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/core.php b/includes/core.php index cca3a6c..333f565 100755 --- a/includes/core.php +++ b/includes/core.php @@ -348,7 +348,7 @@ function mce_css( $stylesheets ) { } return $stylesheets . PUBLISHER_MEDIA_KIT_URL . ( ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? - 'assets/css/frontend/editor-style.css' : + 'assets/css/admin/editor-style.css' : 'dist/css/editor-style.css' ); } From 478d0441851cb3da733d537218918cf1b8bad7fd Mon Sep 17 00:00:00 2001 From: Davis Shaver Date: Wed, 17 Jan 2024 09:20:58 -0500 Subject: [PATCH 4/4] fix: remove mce_css function entirely --- includes/core.php | 19 ------------------- package.json | 3 +-- 2 files changed, 1 insertion(+), 21 deletions(-) diff --git a/includes/core.php b/includes/core.php index 333f565..ae41f6e 100755 --- a/includes/core.php +++ b/includes/core.php @@ -26,8 +26,6 @@ function setup() { add_action( 'admin_enqueue_scripts', $n( 'admin_scripts' ) ); add_action( 'admin_enqueue_scripts', $n( 'admin_styles' ) ); - // Editor styles. add_editor_style() doesn't work outside of a theme. - add_filter( 'mce_css', $n( 'mce_css' ) ); // Hook to allow async or defer on asset loading. add_filter( 'script_loader_tag', $n( 'script_loader_tag' ), 10, 2 ); @@ -335,23 +333,6 @@ function admin_styles() { } -/** - * Enqueue editor styles. Filters the comma-delimited list of stylesheets to load in TinyMCE. - * - * @param string $stylesheets Comma-delimited list of stylesheets. - * - * @return string - */ -function mce_css( $stylesheets ) { - if ( ! empty( $stylesheets ) ) { - $stylesheets .= ','; - } - - return $stylesheets . PUBLISHER_MEDIA_KIT_URL . ( ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? - 'assets/css/admin/editor-style.css' : - 'dist/css/editor-style.css' ); -} - /** * Add async/defer attributes to enqueued scripts that have the specified script_execution flag. * diff --git a/package.json b/package.json index daa5809..9fecc62 100644 --- a/package.json +++ b/package.json @@ -65,8 +65,7 @@ "shared-style": "./assets/css/shared/shared-style.css", "style": "./assets/css/frontend/style.css", "tabs-block": "./includes/blocks/block-editor/tabs/register.js", - "tabs-item-block": "./includes/blocks/block-editor/tabs-item/register.js", - "editor-style": "./assets/css/admin/editor-style.css" + "tabs-item-block": "./includes/blocks/block-editor/tabs-item/register.js" } } }