From c6316c15c7061ed752bc068c508eb2eca1e8941f Mon Sep 17 00:00:00 2001 From: Amit Raj Date: Mon, 17 Jun 2024 00:20:27 +0530 Subject: [PATCH 1/5] Fix issue of HTML entities rendering in command menu --- packages/commands/package.json | 1 + packages/commands/src/components/command-menu.js | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/commands/package.json b/packages/commands/package.json index 88c18afa09e6a..2e12fd80152eb 100644 --- a/packages/commands/package.json +++ b/packages/commands/package.json @@ -31,6 +31,7 @@ "@wordpress/components": "file:../components", "@wordpress/data": "file:../data", "@wordpress/element": "file:../element", + "@wordpress/html-entities": "file:../html-entities", "@wordpress/i18n": "file:../i18n", "@wordpress/icons": "file:../icons", "@wordpress/keyboard-shortcuts": "file:../keyboard-shortcuts", diff --git a/packages/commands/src/components/command-menu.js b/packages/commands/src/components/command-menu.js index 3a129823fedb3..a57588e6ab02f 100644 --- a/packages/commands/src/components/command-menu.js +++ b/packages/commands/src/components/command-menu.js @@ -26,6 +26,7 @@ import { useShortcut, } from '@wordpress/keyboard-shortcuts'; import { Icon, search as inputIcon } from '@wordpress/icons'; +import { decodeEntities } from '@wordpress/html-entities'; /** * Internal dependencies @@ -62,7 +63,7 @@ function CommandMenuLoader( { name, search, hook, setLoader, close } ) { { command.icon && } From 49c0d84261946a6255b709fc824811f66d43ff40 Mon Sep 17 00:00:00 2001 From: Amit Raj Date: Tue, 18 Jun 2024 10:57:54 +0530 Subject: [PATCH 2/5] Update link to API in block-editor README.md --- packages/block-editor/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/block-editor/README.md b/packages/block-editor/README.md index 7c70473430b31..322f0873c8304 100644 --- a/packages/block-editor/README.md +++ b/packages/block-editor/README.md @@ -45,7 +45,7 @@ In this example, we're instantiating a block editor. A block editor is composed Inside `BlockEditorProvider`, you can nest any of the available `@wordpress/block-editor` UI components to build the UI of your editor. -In the example above we're rendering the `BlockList` to show and edit the block list. For instance we could add a custom sidebar and use the `BlockInspector` component to be able to edit the advanced settings for the currently selected block. (See the [API](#API) for the list of all the available components). +In the example above we're rendering the `BlockList` to show and edit the block list. For instance we could add a custom sidebar and use the `BlockInspector` component to be able to edit the advanced settings for the currently selected block. (See the [API](#api) for the list of all the available components). The `BlockTools` component is used to render the toolbar for a selected block. From 303b8c8926428a59bf1d6074f06f8381be935479 Mon Sep 17 00:00:00 2001 From: Amit Raj Date: Thu, 20 Jun 2024 02:03:31 +0530 Subject: [PATCH 3/5] Undo previous changes --- packages/commands/package.json | 1 - packages/commands/src/components/command-menu.js | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/commands/package.json b/packages/commands/package.json index 2e12fd80152eb..88c18afa09e6a 100644 --- a/packages/commands/package.json +++ b/packages/commands/package.json @@ -31,7 +31,6 @@ "@wordpress/components": "file:../components", "@wordpress/data": "file:../data", "@wordpress/element": "file:../element", - "@wordpress/html-entities": "file:../html-entities", "@wordpress/i18n": "file:../i18n", "@wordpress/icons": "file:../icons", "@wordpress/keyboard-shortcuts": "file:../keyboard-shortcuts", diff --git a/packages/commands/src/components/command-menu.js b/packages/commands/src/components/command-menu.js index a57588e6ab02f..3a129823fedb3 100644 --- a/packages/commands/src/components/command-menu.js +++ b/packages/commands/src/components/command-menu.js @@ -26,7 +26,6 @@ import { useShortcut, } from '@wordpress/keyboard-shortcuts'; import { Icon, search as inputIcon } from '@wordpress/icons'; -import { decodeEntities } from '@wordpress/html-entities'; /** * Internal dependencies @@ -63,7 +62,7 @@ function CommandMenuLoader( { name, search, hook, setLoader, close } ) { { command.icon && } From 1e2ac816c22e98d0dac6f280ce752c2129917398 Mon Sep 17 00:00:00 2001 From: Amit Raj Date: Thu, 20 Jun 2024 02:12:32 +0530 Subject: [PATCH 4/5] Fix issue of HTML entities rendering in command menu --- packages/core-commands/package.json | 1 + packages/core-commands/src/site-editor-navigation-commands.js | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/core-commands/package.json b/packages/core-commands/package.json index 3ea0edbece9ad..0d28ff930e60f 100644 --- a/packages/core-commands/package.json +++ b/packages/core-commands/package.json @@ -34,6 +34,7 @@ "@wordpress/core-data": "file:../core-data", "@wordpress/data": "file:../data", "@wordpress/element": "file:../element", + "@wordpress/html-entities": "file:../html-entities", "@wordpress/i18n": "file:../i18n", "@wordpress/icons": "file:../icons", "@wordpress/private-apis": "file:../private-apis", diff --git a/packages/core-commands/src/site-editor-navigation-commands.js b/packages/core-commands/src/site-editor-navigation-commands.js index ba34fffd98824..b575fd433f6d0 100644 --- a/packages/core-commands/src/site-editor-navigation-commands.js +++ b/packages/core-commands/src/site-editor-navigation-commands.js @@ -18,6 +18,7 @@ import { import { privateApis as routerPrivateApis } from '@wordpress/router'; import { addQueryArgs, getPath } from '@wordpress/url'; import { useDebounce } from '@wordpress/compose'; +import { decodeEntities } from '@wordpress/html-entities'; /** * Internal dependencies @@ -93,7 +94,7 @@ const getNavigationCommandLoaderPerPostType = ( postType ) => name: postType + '-' + record.id, searchLabel: record.title?.rendered + ' ' + record.id, label: record.title?.rendered - ? record.title?.rendered + ? decodeEntities( record.title?.rendered ) : __( '(no title)' ), icon: icons[ postType ], }; From a8cb039e2d20378a715988850af3945c347adce3 Mon Sep 17 00:00:00 2001 From: Amit Raj Date: Thu, 20 Jun 2024 13:08:24 +0530 Subject: [PATCH 5/5] Add @wordpress/html-entities dependency in packages/core-commands --- package-lock.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/package-lock.json b/package-lock.json index b2abc2d220b52..b6c8b75bb0d74 100644 --- a/package-lock.json +++ b/package-lock.json @@ -53689,6 +53689,7 @@ "@wordpress/core-data": "file:../core-data", "@wordpress/data": "file:../data", "@wordpress/element": "file:../element", + "@wordpress/html-entities": "file:../html-entities", "@wordpress/i18n": "file:../i18n", "@wordpress/icons": "file:../icons", "@wordpress/private-apis": "file:../private-apis", @@ -69007,6 +69008,7 @@ "@wordpress/core-data": "file:../core-data", "@wordpress/data": "file:../data", "@wordpress/element": "file:../element", + "@wordpress/html-entities": "file:../html-entities", "@wordpress/i18n": "file:../i18n", "@wordpress/icons": "file:../icons", "@wordpress/private-apis": "file:../private-apis",