Refactor: Unify command menu item execution (#18908)
- Makes engineComponentKey non-nullable on CommandMenuItem. Adds two new engine component keys: TRIGGER_WORKFLOW_VERSION and FRONT_COMPONENT_RENDERER to cover the former standalone cases. - Unifies the previously separated engine, front component and workflow runners into a single `CommandRunner` component with a unified `useMountCommand` hook that handles all command types.
This commit is contained in:
+3
-3
@@ -1,4 +1,4 @@
|
||||
import { mountedEngineCommandsState } from '@/command-menu-item/engine-command/states/mountedEngineCommandsState';
|
||||
import { headlessCommandContextApisState } from '@/command-menu-item/engine-command/states/headlessCommandContextApisState';
|
||||
import { createAtomFamilySelector } from '@/ui/utilities/state/jotai/utils/createAtomFamilySelector';
|
||||
|
||||
export const isEngineCommandMountedFamilySelector = createAtomFamilySelector<
|
||||
@@ -9,8 +9,8 @@ export const isEngineCommandMountedFamilySelector = createAtomFamilySelector<
|
||||
get:
|
||||
(engineCommandId: string) =>
|
||||
({ get }) => {
|
||||
const mountedMap = get(mountedEngineCommandsState);
|
||||
const headlessCommandContextApis = get(headlessCommandContextApisState);
|
||||
|
||||
return mountedMap.has(engineCommandId);
|
||||
return headlessCommandContextApis.has(engineCommandId);
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user