frontend-plugin-api: remove defineParams from PluginHeaderActionBlueprint
Replace the defineParams + createExtensionBlueprintParams pattern with inline param types on the factory, matching PageBlueprint, SubPageBlueprint, and other blueprints. Update the app-visualizer usage accordingly. Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com> Made-with: Cursor
This commit is contained in:
@@ -1951,11 +1951,9 @@ export type PendingOAuthRequest = {
|
||||
// @public
|
||||
export const PluginHeaderActionBlueprint: ExtensionBlueprint_2<{
|
||||
kind: 'plugin-header-action';
|
||||
params: (params: {
|
||||
params: {
|
||||
loader: () => Promise<JSX.Element>;
|
||||
}) => ExtensionBlueprintParams_2<{
|
||||
loader: () => Promise<JSX.Element>;
|
||||
}>;
|
||||
};
|
||||
output: ExtensionDataRef_2<JSX_2, 'core.reactElement', {}>;
|
||||
inputs: {};
|
||||
config: {};
|
||||
|
||||
@@ -16,11 +16,7 @@
|
||||
|
||||
import { lazy as reactLazy } from 'react';
|
||||
import { ExtensionBoundary } from '../components';
|
||||
import {
|
||||
coreExtensionData,
|
||||
createExtensionBlueprint,
|
||||
createExtensionBlueprintParams,
|
||||
} from '../wiring';
|
||||
import { coreExtensionData, createExtensionBlueprint } from '../wiring';
|
||||
|
||||
/**
|
||||
* Creates extensions that provide plugin-scoped header actions.
|
||||
@@ -36,10 +32,7 @@ export const PluginHeaderActionBlueprint = createExtensionBlueprint({
|
||||
kind: 'plugin-header-action',
|
||||
attachTo: { id: 'api:app/plugin-header-actions', input: 'actions' },
|
||||
output: [coreExtensionData.reactElement],
|
||||
defineParams(params: { loader: () => Promise<JSX.Element> }) {
|
||||
return createExtensionBlueprintParams(params);
|
||||
},
|
||||
*factory(params, { node }) {
|
||||
*factory(params: { loader: () => Promise<JSX.Element> }, { node }) {
|
||||
const LazyAction = reactLazy(() =>
|
||||
params.loader().then(element => ({ default: () => element })),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user