diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/picker/index.ts b/src/Umbraco.Web.UI.Client/src/packages/core/picker/index.ts index a5fa9b02d4..9b7375365b 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/picker/index.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/picker/index.ts @@ -1 +1,3 @@ export * from './search/index.js'; +export * from './picker-modal.context.js'; +export * from './picker-modal.context.token.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/picker/picker-modal.context.token.ts b/src/Umbraco.Web.UI.Client/src/packages/core/picker/picker-modal.context.token.ts new file mode 100644 index 0000000000..84381897af --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/core/picker/picker-modal.context.token.ts @@ -0,0 +1,4 @@ +import type { UmbPickerModalContext } from './picker-modal.context.js'; +import { UmbContextToken } from '@umbraco-cms/backoffice/context-api'; + +export const UMB_PICKER_MODAL_CONTEXT = new UmbContextToken('UmbPickerModalContext'); diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/picker/picker-modal.context.ts b/src/Umbraco.Web.UI.Client/src/packages/core/picker/picker-modal.context.ts new file mode 100644 index 0000000000..a4777834b9 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/core/picker/picker-modal.context.ts @@ -0,0 +1,12 @@ +import { UMB_PICKER_MODAL_CONTEXT } from './picker-modal.context.token.js'; +import { UmbContextBase } from '@umbraco-cms/backoffice/class-api'; +import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api'; +import { UmbSelectionManager } from '@umbraco-cms/backoffice/utils'; + +export class UmbPickerModalContext extends UmbContextBase { + public readonly selection = new UmbSelectionManager(this); + + constructor(host: UmbControllerHost) { + super(host, UMB_PICKER_MODAL_CONTEXT); + } +}