block context
This commit is contained in:
@@ -38,7 +38,7 @@ export class UmbBlockManagerContext<
|
||||
}
|
||||
|
||||
constructor(host: UmbControllerHost) {
|
||||
super(host, UMB_BLOCK_MANAGER_CONTEXT_TOKEN);
|
||||
super(host, UMB_BLOCK_MANAGER_CONTEXT);
|
||||
}
|
||||
|
||||
blockTypeOf(contentElementTypeKey: string) {
|
||||
@@ -57,6 +57,6 @@ export class UmbBlockManagerContext<
|
||||
}
|
||||
}
|
||||
|
||||
export const UMB_BLOCK_MANAGER_CONTEXT_TOKEN = new UmbContextToken<UmbBlockManagerContext, UmbBlockManagerContext>(
|
||||
export const UMB_BLOCK_MANAGER_CONTEXT = new UmbContextToken<UmbBlockManagerContext, UmbBlockManagerContext>(
|
||||
'UmbBlockManagerContext',
|
||||
);
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
import type { UmbBlockTypeBase } from '../block-type/types.js';
|
||||
import type { UmbBlockLayoutBaseModel, UmbBlockDataType } from './types.js';
|
||||
import { UmbContextToken } from '@umbraco-cms/backoffice/context-api';
|
||||
import { UmbContextBase } from '@umbraco-cms/backoffice/class-api';
|
||||
import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api';
|
||||
import { UmbObjectState } from '@umbraco-cms/backoffice/observable-api';
|
||||
|
||||
export class UmbBlockContext<
|
||||
BlockType extends UmbBlockTypeBase = UmbBlockTypeBase,
|
||||
BlockLayoutType extends UmbBlockLayoutBaseModel = UmbBlockLayoutBaseModel,
|
||||
> extends UmbContextBase<UmbBlockContext> {
|
||||
//
|
||||
#config = new UmbObjectState<BlockType | undefined>(undefined);
|
||||
public readonly config = this.#config.asObservable();
|
||||
|
||||
#layout = new UmbObjectState<BlockLayoutType | undefined>(undefined);
|
||||
public readonly layout = this.#layout.asObservable();
|
||||
|
||||
#content = new UmbObjectState<UmbBlockDataType | undefined>(undefined);
|
||||
public readonly content = this.#content.asObservable();
|
||||
|
||||
#setting = new UmbObjectState<UmbBlockDataType | undefined>(undefined);
|
||||
public readonly setting = this.#setting.asObservable();
|
||||
|
||||
constructor(host: UmbControllerHost) {
|
||||
super(host, UMB_BLOCK_CONTEXT);
|
||||
}
|
||||
}
|
||||
|
||||
export const UMB_BLOCK_CONTEXT = new UmbContextToken<UmbBlockContext, UmbBlockContext>('UmbBlockContext');
|
||||
Reference in New Issue
Block a user