diff --git a/ACTIONS_AND_FILTERS.md b/ACTIONS_AND_FILTERS.md index b518ebd..7919f60 100644 --- a/ACTIONS_AND_FILTERS.md +++ b/ACTIONS_AND_FILTERS.md @@ -14,8 +14,13 @@ ## JavaScript Actions -- `wpgraphqlide_destroyed` -- `wpgraphqlide_rendered` ([graphiql_rendered](https://www.wpgraphql.com/docs/customizing-wpgraphiql#graphiql_rendered)) +- `wpgraphql-ide.init` +- `wpgraphql-ide.rendered` ([graphiql_rendered](https://www.wpgraphql.com/docs/customizing-wpgraphiql#graphiql_rendered)) +- `wpgraphql-ide.destroyed` +- `wpgraphql-ide.afterRegisterToolbarButton` +- `wpgraphql-ide.registerToolbarButtonError` +- `wpgraphql-ide.afterRegisterActivityBarPanel` +- `wpgraphql-ide.registerActivityBarPanelError` ## JavaScript Filters diff --git a/src/access-functions.js b/src/access-functions.js index c2dda84..a0512ce 100644 --- a/src/access-functions.js +++ b/src/access-functions.js @@ -21,11 +21,11 @@ export function registerDocumentEditorToolbarButton( config, priority ); - hooks.doAction( 'afterRegisterToolbarButton', name, config, priority ); + hooks.doAction( 'wpgraphql-ide.afterRegisterToolbarButton', name, config, priority ); } catch ( error ) { console.error( `Failed to register button: ${ name }`, error ); hooks.doAction( - 'registerToolbarButtonError', + 'wpgraphql-ide.registerToolbarButtonError', name, config, priority, @@ -42,7 +42,7 @@ export function registerActivityBarPanel( name, config, priority = 10 ) { priority ); hooks.doAction( - 'afterRegisterActivityBarPanel', + 'wpgraphql-ide.afterRegisterActivityBarPanel', name, config, priority @@ -53,7 +53,7 @@ export function registerActivityBarPanel( name, config, priority = 10 ) { error ); hooks.doAction( - 'registerActivityBarPanelError', + 'wpgraphql-ide.registerActivityBarPanelError', name, config, priority, @@ -74,7 +74,7 @@ export function registerActivityBarPanel( name, config, priority = 10 ) { // priority // ); // hooks.doAction( -// 'afterRegisterActivityBarUtilityButton', +// 'wpgraphql-ide.afterRegisterActivityBarUtilityButton', // name, // config, // priority @@ -82,7 +82,7 @@ export function registerActivityBarPanel( name, config, priority = 10 ) { // } catch ( error ) { // console.error( `Failed to register button: ${ name }`, error ); // hooks.doAction( -// 'registerActivityBarUtilityButtonError', +// 'wpgraphql-ide.registerActivityBarUtilityButtonError', // name, // config, // priority, diff --git a/src/components/AppWrapper.jsx b/src/components/AppWrapper.jsx index 9d51660..89fdb40 100644 --- a/src/components/AppWrapper.jsx +++ b/src/components/AppWrapper.jsx @@ -88,22 +88,22 @@ export function AppWrapper() { /** * Perform actions on component mount. * - * Triggers a custom action 'wpgraphqlide_rendered' when the App component mounts, + * Triggers a custom action 'wpgraphql-ide.rendered' when the App component mounts, * allowing plugins or themes to hook into this event. The action passes * the current state of `drawerOpen` to any listeners, providing context * about the application's UI state. */ - doAction( 'wpgraphqlide_rendered' ); + doAction( 'wpgraphql-ide.rendered' ); /** * Cleanup action on component unmount. * - * Returns a cleanup function that triggers the 'wpgraphqlide_destroyed' action, + * Returns a cleanup function that triggers the 'wpgraphql-ide.destroyed' action, * signaling that the App component is about to unmount. This allows for * any necessary cleanup or teardown operations in response to the App * component's lifecycle. */ - return () => doAction( 'wpgraphqlide_destroyed' ); + return () => doAction( 'wpgraphql-ide.destroyed' ); }, [] ); return ;