feat(customization): new customization service api (#4688)

This commit is contained in:
Alireza authored and GitHub committed 2025-01-23 14:24:13 -05:00
1 parent fab52808cb
commit 55ad8efbab
124 files changed
+4261 -2517

No files matched your search

@@ -1,34 +0,0 @@
const defaultContextMenu = {
id: 'measurementsContextMenu',
customizationType: 'ohif.contextMenu',
menus: [
// Get the items from the UI Customization for the menu name (and have a custom name)
{
id: 'forExistingMeasurement',
selector: ({ nearbyToolData }) => !!nearbyToolData,
items: [
{
label: 'Delete measurement',
commands: [
{
commandName: 'deleteMeasurement',
// we only have support for cornerstoneTools context menu since
// they are svg based
context: 'CORNERSTONE',
},
],
},
{
label: 'Add Label',
commands: [
{
commandName: 'setMeasurementLabel',
},
],
},
],
},
],
};
export default defaultContextMenu;
@@ -1,11 +1,5 @@
import ContextMenuController from './ContextMenuController';
import * as ContextMenuItemsBuilder from './ContextMenuItemsBuilder';
import defaultContextMenu from './defaultContextMenu';
import * as CustomizableContextMenuTypes from './types';
export {
ContextMenuController,
CustomizableContextMenuTypes,
ContextMenuItemsBuilder,
defaultContextMenu,
};
export { ContextMenuController, CustomizableContextMenuTypes, ContextMenuItemsBuilder };
@@ -45,10 +45,11 @@ export type UIMenuItem = {
*/
export interface MenuItem {
id?: string;
/** The customization type is used to apply preset values to this item
/**
* The customization type is used to apply preset values to this item
* when registered with the customization service.
*/
customizationType?: string;
inheritsFrom?: string;
// The label is the value to show in the menu for this item
label?: string;
@@ -91,7 +92,7 @@ export interface Menu {
/** The customization type is used to apply preset values to this item
* when registered with the customization service.
*/
customizationType?: string;
inheritsFrom?: string;
// Choose whether this menu applies.
selector?: Types.Predicate;