Skip to content

Commit 2f18e01

Browse files
authored
Merge pull request #2294 from umbraco/v15/emm-tree
Feature: Extension Manifest Map: Tree
2 parents 1023eb6 + 7c4f4e0 commit 2f18e01

File tree

25 files changed

+488
-706
lines changed

25 files changed

+488
-706
lines changed

src/packages/core/extension-registry/models/index.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@ import type { ManifestSectionView } from './section-view.model.js';
3939
import type { ManifestStore, ManifestTreeStore, ManifestItemStore } from './store.model.js';
4040
import type { ManifestTheme } from './theme.model.js';
4141
import type { ManifestTinyMcePlugin } from './tinymce-plugin.model.js';
42-
import type { ManifestTree } from './tree.model.js';
43-
import type { ManifestTreeItem } from './tree-item.model.js';
4442
import type { ManifestUfmComponent } from './ufm-component.model.js';
4543
import type { ManifestUfmFilter } from './ufm-filter.model.js';
4644
import type { ManifestUserProfileApp } from './user-profile-app.model.js';
@@ -101,8 +99,6 @@ export type * from './section.model.js';
10199
export type * from './store.model.js';
102100
export type * from './theme.model.js';
103101
export type * from './tinymce-plugin.model.js';
104-
export type * from './tree-item.model.js';
105-
export type * from './tree.model.js';
106102
export type * from './ufm-component.model.js';
107103
export type * from './ufm-filter.model.js';
108104
export type * from './user-granular-permission.model.js';
@@ -188,8 +184,6 @@ export type ManifestTypes =
188184
| ManifestStore
189185
| ManifestTheme
190186
| ManifestTinyMcePlugin
191-
| ManifestTree
192-
| ManifestTreeItem
193187
| ManifestTreeStore
194188
| ManifestUfmComponent
195189
| ManifestUfmFilter

src/packages/core/tree/default/default-tree.context.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,10 @@ import type { UmbTreeItemModel, UmbTreeRootModel, UmbTreeStartNode } from '../ty
22
import type { UmbTreeRepository } from '../data/tree-repository.interface.js';
33
import type { UmbTreeContext } from '../tree-context.interface.js';
44
import type { UmbTreeRootItemsRequestArgs } from '../data/types.js';
5+
import type { ManifestTree } from '../extensions/index.js';
56
import { UMB_TREE_CONTEXT } from './default-tree.context-token.js';
67
import { type UmbActionEventContext, UMB_ACTION_EVENT_CONTEXT } from '@umbraco-cms/backoffice/action';
7-
import {
8-
type ManifestRepository,
9-
type ManifestTree,
10-
umbExtensionsRegistry,
11-
} from '@umbraco-cms/backoffice/extension-registry';
8+
import { type ManifestRepository, umbExtensionsRegistry } from '@umbraco-cms/backoffice/extension-registry';
129
import { UmbContextBase } from '@umbraco-cms/backoffice/class-api';
1310
import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api';
1411
import { UmbExtensionApiInitializer } from '@umbraco-cms/backoffice/extension-api';
Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
import type { ManifestTypes, UmbExtensionManifestKind } from '@umbraco-cms/backoffice/extension-registry';
1+
import type { UmbExtensionManifestKind } from '@umbraco-cms/backoffice/extension-registry';
22

3-
const defaultTreeKind: UmbExtensionManifestKind = {
4-
type: 'kind',
5-
alias: 'Umb.Kind.Tree.Default',
6-
matchKind: 'default',
7-
matchType: 'tree',
8-
manifest: {
9-
type: 'tree',
10-
api: () => import('./default-tree.context.js'),
11-
element: () => import('./default-tree.element.js'),
3+
export const manifests: Array<UmbExtensionManifestKind> = [
4+
{
5+
type: 'kind',
6+
alias: 'Umb.Kind.Tree.Default',
7+
matchKind: 'default',
8+
matchType: 'tree',
9+
manifest: {
10+
type: 'tree',
11+
api: () => import('./default-tree.context.js'),
12+
element: () => import('./default-tree.element.js'),
13+
},
1214
},
13-
};
14-
15-
export const manifests: Array<ManifestTypes | UmbExtensionManifestKind> = [defaultTreeKind];
15+
];
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export * from './tree-item.extension.js';
2+
export * from './tree.extension.js';
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import type { UmbTreeItemModel } from '../../tree/types.js';
2-
import type { UmbTreeItemContext } from '../../tree/tree-item/index.js';
1+
import type { UmbTreeItemModel } from '../types.js';
2+
import type { UmbTreeItemContext } from '../tree-item/index.js';
33
import type { UmbControllerHostElement } from '@umbraco-cms/backoffice/controller-api';
44
import type { ManifestElementAndApi } from '@umbraco-cms/backoffice/extension-api';
55

@@ -8,3 +8,9 @@ export interface ManifestTreeItem
88
type: 'treeItem';
99
forEntityTypes: Array<string>;
1010
}
11+
12+
declare global {
13+
interface UmbExtensionManifestMap {
14+
umbTreeItem: ManifestTreeItem;
15+
}
16+
}

src/packages/core/extension-registry/models/tree.model.ts renamed to src/packages/core/tree/extensions/tree.extension.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,9 @@ export interface ManifestTree extends ManifestElementAndApi, ManifestWithDynamic
88
export interface MetaTree {
99
repositoryAlias: string;
1010
}
11+
12+
declare global {
13+
interface UmbExtensionManifestMap {
14+
umbTree: ManifestTree;
15+
}
16+
}

src/packages/core/tree/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ export * from './data/index.js';
44
export * from './tree-menu-item-default/index.js';
55
export * from './folder/index.js';
66
export * from './tree.element.js';
7+
export * from './extensions/index.js';
78

89
export * from './entity-actions/sort-children-of/index.js';
910
export * from './entity-actions/reload-tree-item-children/index.js';

src/packages/core/tree/tree-item/tree-item-base/tree-item-context-base.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ import type { UmbTreeItemContext } from '../tree-item-context.interface.js';
22
import { UMB_TREE_CONTEXT, type UmbDefaultTreeContext } from '../../default/index.js';
33
import type { UmbTreeItemModel, UmbTreeRootModel } from '../../types.js';
44
import { UmbRequestReloadTreeItemChildrenEvent } from '../../entity-actions/reload-tree-item-children/index.js';
5+
import type { ManifestTreeItem } from '../../extensions/index.js';
56
import { map } from '@umbraco-cms/backoffice/external/rxjs';
67
import { UmbArrayState, UmbBooleanState, UmbObjectState, UmbStringState } from '@umbraco-cms/backoffice/observable-api';
78
import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api';
89
import { UmbContextBase } from '@umbraco-cms/backoffice/class-api';
910
import { UmbContextToken } from '@umbraco-cms/backoffice/context-api';
1011
import { UMB_SECTION_CONTEXT, UMB_SECTION_SIDEBAR_CONTEXT } from '@umbraco-cms/backoffice/section';
11-
import type { ManifestTreeItem } from '@umbraco-cms/backoffice/extension-registry';
1212
import { umbExtensionsRegistry } from '@umbraco-cms/backoffice/extension-registry';
1313
import { UMB_ACTION_EVENT_CONTEXT } from '@umbraco-cms/backoffice/action';
1414
import {

src/packages/core/tree/tree-item/tree-item.element.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
import type { ManifestTreeItem } from '../extensions/index.js';
12
import { customElement, property } from '@umbraco-cms/backoffice/external/lit';
2-
import type { ManifestTreeItem } from '@umbraco-cms/backoffice/extension-registry';
33
import {
44
UmbExtensionElementAndApiSlotElementBase,
55
umbExtensionsRegistry,

src/packages/core/tree/tree.element.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
import type { ManifestTree } from './extensions/index.js';
12
import { customElement } from '@umbraco-cms/backoffice/external/lit';
2-
import type { ManifestTree } from '@umbraco-cms/backoffice/extension-registry';
33
import { UmbExtensionElementAndApiSlotElementBase } from '@umbraco-cms/backoffice/extension-registry';
44

55
@customElement('umb-tree')

0 commit comments

Comments
 (0)