Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Dynamic global extension manifest map #2249

Merged
merged 71 commits into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
32cb68e
declare global UmbManifestTypes
nielslyngsoe Aug 30, 2024
140d733
move block editor custom view into its own module
nielslyngsoe Aug 30, 2024
bd57135
JS Docs
nielslyngsoe Aug 30, 2024
eada5a5
Merge branch 'main' into v14/feature/POC-dynamic-global-manifest-types
nielslyngsoe Sep 2, 2024
73b8ba9
Merge branch 'main' into v14/feature/POC-dynamic-global-manifest-types
nielslyngsoe Sep 12, 2024
d0d3cb3
JSON Schema corrections
nielslyngsoe Sep 12, 2024
7f1fd0a
Merge branch 'v15/dev' into v14/feature/POC-dynamic-global-manifest-t…
nielslyngsoe Sep 12, 2024
3c4de3d
use UmbManifestTypes in extension registry
nielslyngsoe Sep 12, 2024
3a7c850
JSDocs
nielslyngsoe Sep 12, 2024
8cc1452
Adds new method to extensionRegistry for appendCondition
warrenbuckley Aug 22, 2024
64e80ce
Adds appendConditions to allow adding multiple in one go
warrenbuckley Aug 23, 2024
b6db373
Adds prependCondition and prependConditions so you can make sure your…
warrenbuckley Aug 29, 2024
2c08963
Adds _whenExtensionAliasIsRegistered as a promise so that we basicall…
warrenbuckley Aug 29, 2024
e215399
simplify _whenExtensionAliasIsRegistered
madsrasmussen Aug 30, 2024
8c40133
split some tests
madsrasmussen Aug 30, 2024
3ee3cab
Rework of tests to pass and minor fix to _whenExtensionAliasIsRegiste…
warrenbuckley Aug 30, 2024
ac415ca
Trying to add a test to show that a late registered extension works -…
warrenbuckley Aug 30, 2024
d3f7e28
Remove the prepend conditions and rename append to addCondition and a…
warrenbuckley Sep 2, 2024
18ce99a
Update tests
warrenbuckley Sep 2, 2024
a6faa59
Fix up code so test passes & my rough entrypoint demo of usage works
warrenbuckley Sep 3, 2024
eb19772
import type
nielslyngsoe Sep 12, 2024
8fd2cd0
remove test code
nielslyngsoe Sep 12, 2024
95031c9
refactor for a more direct appending implementation
nielslyngsoe Sep 12, 2024
8946912
register user sidebar menu
madsrasmussen Sep 9, 2024
26666fd
register root workspace
madsrasmussen Sep 9, 2024
52385ee
register user group menu item
madsrasmussen Sep 10, 2024
d86e4e7
update import path
madsrasmussen Sep 10, 2024
dc0cd54
pass entity type from manifest
madsrasmussen Sep 10, 2024
4a09c9f
add path helper to root
madsrasmussen Sep 10, 2024
a8da784
back button to root
madsrasmussen Sep 10, 2024
1aab5df
wip create + invite entity actions
madsrasmussen Sep 10, 2024
fdb51a3
update back path
madsrasmussen Sep 10, 2024
85bfc1e
add to folder
madsrasmussen Sep 11, 2024
4a31f36
rename folder
madsrasmussen Sep 11, 2024
025bc5b
move into workspace folder
madsrasmussen Sep 11, 2024
b40d0cf
add missing type
madsrasmussen Sep 11, 2024
5f843ca
fix path
madsrasmussen Sep 11, 2024
db4ec14
delete unused code
madsrasmussen Sep 11, 2024
a75f84e
set up entity context
madsrasmussen Sep 11, 2024
f4d3420
add invite entity action + clean up
madsrasmussen Sep 11, 2024
63ff3ef
update user group create path
madsrasmussen Sep 11, 2024
1799a95
revert merge mistake
madsrasmussen Sep 12, 2024
befea81
move into folder
madsrasmussen Sep 12, 2024
7b54c75
rename folder
madsrasmussen Sep 12, 2024
cf470a9
move folder into workspace
madsrasmussen Sep 12, 2024
e287af8
localize headline
madsrasmussen Sep 12, 2024
ea60185
localize header
madsrasmussen Sep 12, 2024
05f3f6f
remove lorem ipsum
madsrasmussen Sep 12, 2024
bbacb93
scaffold help package + header app
madsrasmussen Sep 9, 2024
7779ec4
render button with icon
madsrasmussen Sep 9, 2024
f935bf3
split into header app and menu + register two menu items
madsrasmussen Sep 9, 2024
02b990e
add link menu item kind
madsrasmussen Sep 10, 2024
1434777
move target logic to link element
madsrasmussen Sep 10, 2024
b72cf68
add condition to check if the current user is admin
madsrasmussen Sep 10, 2024
9e306d3
export condition alias
madsrasmussen Sep 10, 2024
83da676
add conditions to links
madsrasmussen Sep 10, 2024
1a79437
update links
madsrasmussen Sep 10, 2024
d50ea87
add help module
madsrasmussen Sep 11, 2024
4641854
export alias
madsrasmussen Sep 11, 2024
724cb03
Update tsconfig.json
madsrasmussen Sep 11, 2024
462b2f1
only render header app if menu has items
madsrasmussen Sep 11, 2024
a63c5f3
update package build
madsrasmussen Sep 11, 2024
165ae6f
Update package-lock.json
madsrasmussen Sep 11, 2024
6379bdd
add pattern validation
madsrasmussen Sep 11, 2024
32fc34b
Merge remote-tracking branch 'origin/v15/dev' into v14/feature/POC-dy…
nielslyngsoe Sep 13, 2024
706410d
extension api interface
nielslyngsoe Sep 13, 2024
6b19f2a
refactor block packages
nielslyngsoe Sep 13, 2024
3bf04f6
tsc corrections
nielslyngsoe Sep 13, 2024
9b0c8b1
rename test umbraco package
nielslyngsoe Sep 13, 2024
820fafa
rename global manifest type
nielslyngsoe Sep 13, 2024
7c62d8a
rename map
nielslyngsoe Sep 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion examples/block-custom-view/block-custom-view.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { UmbTextStyles } from '@umbraco-cms/backoffice/style';
import { html, customElement, LitElement, property, css } from '@umbraco-cms/backoffice/external/lit';
import { UmbElementMixin } from '@umbraco-cms/backoffice/element-api';
import type { UmbBlockDataType, UmbBlockEditorCustomViewElement } from '@umbraco-cms/backoffice/extension-registry';
import type { UmbBlockDataType } from '@umbraco-cms/backoffice/block';
import type { UmbBlockEditorCustomViewElement } from '@umbraco-cms/backoffice/block-custom-view';

// eslint-disable-next-line local-rules/enforce-umb-prefix-on-element-name
@customElement('example-block-custom-view')
Expand Down
4 changes: 1 addition & 3 deletions examples/block-custom-view/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import type { ManifestBlockEditorCustomView } from '@umbraco-cms/backoffice/extension-registry';

export const manifests: Array<ManifestBlockEditorCustomView> = [
export const manifests: Array<UmbExtensionManifest> = [
{
type: 'blockEditorCustomView',
alias: 'Umb.blockEditorCustomView.TestView',
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"./action": "./dist-cms/packages/core/action/index.js",
"./audit-log": "./dist-cms/packages/core/audit-log/index.js",
"./auth": "./dist-cms/packages/core/auth/index.js",
"./block-custom-view": "./dist-cms/packages/block/block-custom-view/index.js",
"./block-grid": "./dist-cms/packages/block/block-grid/index.js",
"./block-list": "./dist-cms/packages/block/block-list/index.js",
"./block-rte": "./dist-cms/packages/block/block-rte/index.js",
Expand Down
9 changes: 9 additions & 0 deletions src/libs/extension-api/models/extension-api.interface.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import type { ManifestBase } from '../types/index.js';
import type { UmbApi } from './api.interface.js';

/**
* Interface for APIs of a Extension.
*/
export interface UmbExtensionApi<ManifestType extends ManifestBase = ManifestBase> extends UmbApi {
manifest?: ManifestType;
}
1 change: 1 addition & 0 deletions src/libs/extension-api/models/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export * from './entry-point.interface.js';
export * from './api.interface.js';
export * from './extension-api.interface.js';
20 changes: 12 additions & 8 deletions src/libs/extension-api/registry/extension.registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ import { map, distinctUntilChanged, combineLatest, of, switchMap } from '@umbrac

/**
*
* @param previousValue
* @param currentValue
* @param previousValue {Array<ManifestBase>} - previous value
* @param currentValue {Array<ManifestBase>} - current value
* @returns {boolean} - true if value is assumed to be the same as previous value.
*/
function extensionArrayMemoization<T extends Pick<ManifestBase, 'alias'>>(
previousValue: Array<T>,
Expand All @@ -31,8 +32,9 @@ function extensionArrayMemoization<T extends Pick<ManifestBase, 'alias'>>(

/**
*
* @param previousValue
* @param currentValue
* @param previousValue {Array<ManifestBase>} - previous value
* @param currentValue {Array<ManifestBase>} - current value
* @returns {boolean} - true if value is assumed to be the same as previous value.
*/
function extensionAndKindMatchArrayMemoization<
T extends Pick<ManifestBase, 'alias'> & { __isMatchedWithKind?: boolean },
Expand Down Expand Up @@ -62,8 +64,9 @@ function extensionAndKindMatchArrayMemoization<

/**
*
* @param previousValue
* @param currentValue
* @param previousValue {Array<ManifestBase>} - previous value
* @param currentValue {Array<ManifestBase>} - current value
* @returns {boolean} - true if value is assumed to be the same as previous value.
*/
function extensionSingleMemoization<T extends Pick<ManifestBase, 'alias'>>(
previousValue: T | undefined,
Expand All @@ -77,8 +80,9 @@ function extensionSingleMemoization<T extends Pick<ManifestBase, 'alias'>>(

/**
*
* @param previousValue
* @param currentValue
* @param previousValue {Array<ManifestBase>} - previous value
* @param currentValue {Array<ManifestBase>} - current value
* @returns {boolean} - true if value is assumed to be the same as previous value.
*/
function extensionAndKindMatchSingleMemoization<
T extends Pick<ManifestBase, 'alias'> & { __isMatchedWithKind?: boolean },
Expand Down
4 changes: 2 additions & 2 deletions src/libs/extension-api/types/manifest-bundle.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type { ManifestBase } from './manifest-base.interface.js';
/**
* This type of extension takes a JS module and registers all exported manifests from the pointed JS file.
*/
export interface ManifestBundle<UmbManifestTypes extends ManifestBase = ManifestBase>
extends ManifestPlainJs<{ [key: string]: Array<UmbManifestTypes> }> {
export interface ManifestBundle<ManifestTypes extends ManifestBase = ManifestBase>
extends ManifestPlainJs<{ [key: string]: Array<ManifestTypes> }> {
type: 'bundle';
}
Original file line number Diff line number Diff line change
@@ -1,20 +1,26 @@
import type { UmbBlockEditorCustomViewElement } from '../interfaces/index.js';
import type { UmbBlockEditorCustomViewElement } from './types.js';
import type { ManifestElement } from '@umbraco-cms/backoffice/extension-api';

export interface ManifestBlockEditorCustomView extends ManifestElement<UmbBlockEditorCustomViewElement> {
type: 'blockEditorCustomView';
/**
* @property {string | Array<string> } - Declare if this Custom View only must appear at specific Content Types by Alias.
* @property {string | Array<string> } forContentTypeAlias - Declare if this Custom View only must appear at specific Content Types by Alias.
* @description Optional condition if you like this custom view to only appear at for one or more specific Content Types.
* @example 'my-element-type-alias'
* @example ['my-element-type-alias-A', 'my-element-type-alias-B']
*/
forContentTypeAlias?: string | Array<string>;
/**
* @property {string | Array<string> } - Declare if this Custom View only must appear at specific Block Editors.
* @property {string | Array<string> } forBlockEditor - Declare if this Custom View only must appear at specific Block Editors.
* @description Optional condition if you like this custom view to only appear at a specific type of Block Editor.
* @example 'block-list'
* @example ['block-list', 'block-grid']
*/
forBlockEditor?: string | Array<string>;
}

declare global {
interface UmbExtensionManifestMap {
blockEditorCustomView: ManifestBlockEditorCustomView;
}
}
1 change: 1 addition & 0 deletions src/packages/block/block-custom-view/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export type * from './types.js';
Original file line number Diff line number Diff line change
@@ -1,29 +1,8 @@
import type { ManifestBlockEditorCustomView } from '../index.js';
import type { UUIModalSidebarSize } from '@umbraco-cms/backoffice/external/uui';
// Shared with the Property Editor
export interface UmbBlockTypeBaseModel {
contentElementTypeKey: string;
settingsElementTypeKey?: string;
label?: string;
thumbnail?: string;
iconColor?: string;
backgroundColor?: string;
editorSize?: UUIModalSidebarSize;
forceHideContentEditorInOverlay: boolean;
}
import type { ManifestBlockEditorCustomView } from './block-editor-custom-view.extension.js';
import type { UmbBlockLayoutBaseModel, UmbBlockDataType } from '@umbraco-cms/backoffice/block';
import type { UmbBlockTypeBaseModel } from '@umbraco-cms/backoffice/block-type';

// Shared with the Property Editor
export interface UmbBlockLayoutBaseModel {
contentUdi: string;
settingsUdi?: string | null;
}

// Shared with the Property Editor
export interface UmbBlockDataType {
udi: string;
contentTypeKey: string;
[key: string]: unknown;
}
export type * from './block-editor-custom-view.extension.js';

export interface UmbBlockEditorCustomViewConfiguration {
editContentPath?: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import { UmbBlockGridInlinePropertyDatasetContext } from './block-grid-inline-pr
import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element';
import { css, customElement, html, property, state } from '@umbraco-cms/backoffice/external/lit';
import type { UmbPropertyTypeModel } from '@umbraco-cms/backoffice/content-type';
import type { UmbBlockEditorCustomViewConfiguration } from '@umbraco-cms/backoffice/extension-registry';
import '../block-grid-areas-container/index.js';
import '../ref-grid-block/index.js';
import type { UmbBlockEditorCustomViewConfiguration } from '@umbraco-cms/backoffice/block-custom-view';

/**
* @element umb-block-grid-block-inline
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { UMB_BLOCK_GRID_ENTRY_CONTEXT } from '../../context/block-grid-entry.context-token.js';
import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element';
import { css, customElement, html, property, state } from '@umbraco-cms/backoffice/external/lit';
import type { UmbBlockEditorCustomViewConfiguration } from '@umbraco-cms/backoffice/extension-registry';
import type { UmbBlockDataType } from '@umbraco-cms/backoffice/block';
import type { UmbBlockEditorCustomViewConfiguration } from '@umbraco-cms/backoffice/block-custom-view';

import '@umbraco-cms/backoffice/ufm';
import '../block-grid-areas-container/index.js';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@ import { UmbBlockGridEntryContext } from '../../context/block-grid-entry.context
import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element';
import { html, css, customElement, property, state, nothing } from '@umbraco-cms/backoffice/external/lit';
import type { PropertyValueMap } from '@umbraco-cms/backoffice/external/lit';
import type {
ManifestBlockEditorCustomView,
UmbBlockEditorCustomViewProperties,
UmbPropertyEditorUiElement,
} from '@umbraco-cms/backoffice/extension-registry';
import type { UmbPropertyEditorUiElement } from '@umbraco-cms/backoffice/extension-registry';
import { stringOrStringArrayContains } from '@umbraco-cms/backoffice/utils';
import { UMB_BLOCK_GRID, type UmbBlockGridLayoutModel } from '@umbraco-cms/backoffice/block-grid';

Expand All @@ -15,6 +11,10 @@ import '../block-grid-block/index.js';
import '../block-scale-handler/index.js';
import { UmbObserveValidationStateController } from '@umbraco-cms/backoffice/validation';
import { UmbDataPathBlockElementDataQuery } from '@umbraco-cms/backoffice/block';
import type {
ManifestBlockEditorCustomView,
UmbBlockEditorCustomViewProperties,
} from '@umbraco-cms/backoffice/block-custom-view';
import { UUIBlinkAnimationValue, UUIBlinkKeyframes } from '@umbraco-cms/backoffice/external/uui';
import type { UmbExtensionElementInitializer } from '@umbraco-cms/backoffice/extension-api';
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ import { UmbBlockListEntryContext } from '../../context/block-list-entry.context
import { UMB_BLOCK_LIST, type UmbBlockListLayoutModel } from '../../types.js';
import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element';
import { html, css, customElement, property, state, nothing } from '@umbraco-cms/backoffice/external/lit';
import type {
ManifestBlockEditorCustomView,
UmbBlockEditorCustomViewProperties,
UmbPropertyEditorUiElement,
} from '@umbraco-cms/backoffice/extension-registry';
import type { UmbPropertyEditorUiElement } from '@umbraco-cms/backoffice/extension-registry';
import '../ref-list-block/index.js';
import '../inline-list-block/index.js';
import { stringOrStringArrayContains } from '@umbraco-cms/backoffice/utils';
import { UmbObserveValidationStateController } from '@umbraco-cms/backoffice/validation';
import { UmbDataPathBlockElementDataQuery } from '@umbraco-cms/backoffice/block';
import type {
ManifestBlockEditorCustomView,
UmbBlockEditorCustomViewProperties,
} from '@umbraco-cms/backoffice/block-custom-view';

/**
* @element umb-block-list-entry
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { UMB_BLOCK_LIST_PROPERTY_EDITOR_ALIAS } from './manifests.js';
import { UmbLitElement, umbDestroyOnDisconnect } from '@umbraco-cms/backoffice/lit-element';
import { html, customElement, property, state, repeat, css, nothing } from '@umbraco-cms/backoffice/external/lit';
import { UmbTextStyles } from '@umbraco-cms/backoffice/style';
import type { UmbPropertyEditorUiElement, UmbBlockTypeBaseModel } from '@umbraco-cms/backoffice/extension-registry';
import type { UmbPropertyEditorUiElement } from '@umbraco-cms/backoffice/extension-registry';
import {
UmbPropertyValueChangeEvent,
type UmbPropertyEditorConfigCollection,
Expand All @@ -19,6 +19,7 @@ import {
UmbBlockElementDataValidationPathTranslator,
type UmbBlockLayoutBaseModel,
} from '@umbraco-cms/backoffice/block';
import type { UmbBlockTypeBaseModel } from '@umbraco-cms/backoffice/block-type';

import '../../components/block-list-entry/index.js';
import { UMB_PROPERTY_CONTEXT } from '@umbraco-cms/backoffice/property';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import '../../../block-type/components/input-block-type/index.js';
import type { UmbInputBlockTypeElement } from '../../../block-type/index.js';
import { UMB_BLOCK_LIST_TYPE } from '../../types.js';
import type { UmbBlockTypeBaseModel, UmbPropertyEditorUiElement } from '@umbraco-cms/backoffice/extension-registry';
import type { UmbBlockTypeBaseModel, UmbInputBlockTypeElement } from '@umbraco-cms/backoffice/block-type';
import type { UmbPropertyEditorUiElement } from '@umbraco-cms/backoffice/extension-registry';
import { html, customElement, property, state } from '@umbraco-cms/backoffice/external/lit';
import {
UmbPropertyValueChangeEvent,
Expand Down
2 changes: 1 addition & 1 deletion src/packages/block/block-list/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { UmbBlockTypeBaseModel } from '@umbraco-cms/backoffice/extension-registry';
import type { UmbBlockLayoutBaseModel, UmbBlockValueType } from '@umbraco-cms/backoffice/block';
import type { UmbBlockTypeBaseModel } from '@umbraco-cms/backoffice/block-type';

export const UMB_BLOCK_LIST_TYPE = 'block-list-type';
export const UMB_BLOCK_LIST = 'block-list';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@ import type { UmbBlockRteLayoutModel } from '../../types.js';
import { UmbBlockRteEntryContext } from '../../context/block-rte-entry.context.js';
import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element';
import { html, css, property, state, customElement } from '@umbraco-cms/backoffice/external/lit';
import type {
UmbBlockEditorCustomViewProperties,
UmbPropertyEditorUiElement,
} from '@umbraco-cms/backoffice/extension-registry';
import type { UmbPropertyEditorUiElement } from '@umbraco-cms/backoffice/extension-registry';
import { UmbTextStyles } from '@umbraco-cms/backoffice/style';
import type { UmbBlockEditorCustomViewProperties } from '@umbraco-cms/backoffice/block-custom-view';

import '../ref-rte-block/index.js';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { UMB_BLOCK_RTE_MANAGER_CONTEXT } from '../context/block-rte-manager.cont
import { UMB_BLOCK_RTE_ENTRIES_CONTEXT } from '../context/block-rte-entries.context-token.js';
import { type TinyMcePluginArguments, UmbTinyMcePluginBase } from '@umbraco-cms/backoffice/tiny-mce';
import { UmbLocalizationController } from '@umbraco-cms/backoffice/localization-api';
import type { UmbBlockTypeBaseModel } from '@umbraco-cms/backoffice/extension-registry';
import type { UmbBlockTypeBaseModel } from '@umbraco-cms/backoffice/block-type';

export default class UmbTinyMceMultiUrlPickerPlugin extends UmbTinyMcePluginBase {
#localize = new UmbLocalizationController(this._host);
Expand Down
2 changes: 1 addition & 1 deletion src/packages/block/block-rte/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { UmbBlockTypeBaseModel } from '@umbraco-cms/backoffice/extension-registry';
import type { UmbBlockTypeBaseModel } from '@umbraco-cms/backoffice/block-type';
import type { UmbBlockLayoutBaseModel, UmbBlockValueType } from '@umbraco-cms/backoffice/block';

export const UMB_BLOCK_RTE_TYPE = 'block-rte-type';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ import { UMB_MANIFEST_VIEWER_MODAL } from '../../../modals/manifest-viewer/index
import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element';
import { html, customElement, state, property, css } from '@umbraco-cms/backoffice/external/lit';
import { UMB_PROPERTY_DATASET_CONTEXT } from '@umbraco-cms/backoffice/property';
import { umbExtensionsRegistry, type ManifestBlockEditorCustomView } from '@umbraco-cms/backoffice/extension-registry';
import { umbExtensionsRegistry } from '@umbraco-cms/backoffice/extension-registry';
import { stringOrStringArrayContains } from '@umbraco-cms/backoffice/utils';
import { UmbExtensionsManifestInitializer } from '@umbraco-cms/backoffice/extension-api';
import { UmbDocumentTypeDetailRepository } from '@umbraco-cms/backoffice/document-type';
import { UMB_MODAL_MANAGER_CONTEXT } from '@umbraco-cms/backoffice/modal';
import type { ManifestBlockEditorCustomView } from '@umbraco-cms/backoffice/block-custom-view';

@customElement('umb-block-type-custom-view-guide')
export class UmbBlockTypeCustomViewGuideElement extends UmbLitElement {
Expand Down Expand Up @@ -88,7 +89,7 @@ export class UmbBlockTypeCustomViewGuideElement extends UmbLitElement {
async #generateManifest() {
const modalManager = await this.getContext(UMB_MODAL_MANAGER_CONTEXT);

const manifest = {
const manifest: UmbExtensionManifest = {
type: 'blockEditorCustomView',
alias: 'Local.blockEditorCustomView.' + this.#contentTypeAlias,
name: 'Block Editor Custom View for ' + this.#contentTypeName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
UMB_DOCUMENT_TYPE_PICKER_MODAL,
} from '@umbraco-cms/backoffice/document-type';
import { UmbSorterController } from '@umbraco-cms/backoffice/sorter';
import type { UmbBlockTypeBaseModel } from '@umbraco-cms/backoffice/extension-registry';
import type { UmbBlockTypeBaseModel } from '@umbraco-cms/backoffice/block-type';

import '../block-type-card/index.js';

Expand Down
14 changes: 12 additions & 2 deletions src/packages/block/block-type/types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
import type { UmbBlockTypeBaseModel } from '@umbraco-cms/backoffice/extension-registry';
export type { UmbBlockTypeBaseModel } from '@umbraco-cms/backoffice/extension-registry';
import type { UUIModalSidebarSize } from '@umbraco-cms/backoffice/external/uui';

// Shared with the Property Editor
export interface UmbBlockTypeBaseModel {
contentElementTypeKey: string;
settingsElementTypeKey?: string;
label?: string;
thumbnail?: string;
iconColor?: string;
backgroundColor?: string;
editorSize?: UUIModalSidebarSize;
forceHideContentEditorInOverlay: boolean;
}
export interface UmbBlockTypeGroup {
name?: string;
key: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { UmbBlockTypeWithGroupKey } from '../types.js';
import type { UmbBlockTypeBaseModel, UmbBlockTypeWithGroupKey } from '../types.js';
import { UmbBlockTypeWorkspaceEditorElement } from './block-type-workspace-editor.element.js';
import type { UmbPropertyDatasetContext } from '@umbraco-cms/backoffice/property';
import { UMB_PROPERTY_CONTEXT } from '@umbraco-cms/backoffice/property';
Expand All @@ -13,7 +13,7 @@ import {
} from '@umbraco-cms/backoffice/workspace';
import { UmbObjectState, appendToFrozenArray } from '@umbraco-cms/backoffice/observable-api';
import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api';
import type { ManifestWorkspace, UmbBlockTypeBaseModel } from '@umbraco-cms/backoffice/extension-registry';
import type { ManifestWorkspace } from '@umbraco-cms/backoffice/extension-registry';

export class UmbBlockTypeWorkspaceContext<BlockTypeData extends UmbBlockTypeWithGroupKey = UmbBlockTypeWithGroupKey>
extends UmbSubmittableWorkspaceContextBase<BlockTypeData>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { UmbBlockWorkspaceOriginData } from '../workspace/block-workspace.m
import type { UmbBlockEntriesContext } from './block-entries.context.js';
import type { UMB_BLOCK_MANAGER_CONTEXT } from './block-manager.context-token.js';
import { UmbContextToken } from '@umbraco-cms/backoffice/context-api';
import type { UmbBlockTypeBaseModel } from '@umbraco-cms/backoffice/extension-registry';
import type { UmbBlockTypeBaseModel } from '@umbraco-cms/backoffice/block-type';

export const UMB_BLOCK_ENTRIES_CONTEXT = new UmbContextToken<
UmbBlockEntriesContext<
Expand Down
2 changes: 1 addition & 1 deletion src/packages/block/block/context/block-entries.context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import type { UmbBlockDataObjectModel, UmbBlockManagerContext } from './block-ma
import { UMB_BLOCK_ENTRIES_CONTEXT } from './block-entries.context-token.js';
import { type Observable, UmbArrayState, UmbBasicState, UmbStringState } from '@umbraco-cms/backoffice/observable-api';
import { UmbContextBase } from '@umbraco-cms/backoffice/class-api';
import type { UmbBlockTypeBaseModel } from '@umbraco-cms/backoffice/extension-registry';
import type { UmbContextToken } from '@umbraco-cms/backoffice/context-api';
import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api';
import type { UmbModalRouteBuilder } from '@umbraco-cms/backoffice/router';
import type { UmbBlockTypeBaseModel } from '@umbraco-cms/backoffice/block-type';

export abstract class UmbBlockEntriesContext<
BlockManagerContextTokenType extends UmbContextToken<BlockManagerContextType, BlockManagerContextType>,
Expand Down
Loading
Loading