first round of moving types
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { UmbControllerInterface } from './controller.interface';
|
||||
import type { HTMLElementConstructor } from '@umbraco-cms/backoffice/models';
|
||||
import type { HTMLElementConstructor } from '@umbraco-cms/backoffice/extensions-api';
|
||||
|
||||
export declare class UmbControllerHostElement extends HTMLElement {
|
||||
hasController(controller: UmbControllerInterface): boolean;
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
import type { HTMLElementConstructor } from '@umbraco-cms/backoffice/models';
|
||||
|
||||
import type { HTMLElementConstructor } from '@umbraco-cms/backoffice/extensions-api';
|
||||
import { UmbControllerHostElement, UmbControllerHostMixin } from '@umbraco-cms/backoffice/controller';
|
||||
import {
|
||||
UmbContextToken,
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { hasDefaultExport } from './has-default-export.function';
|
||||
import { isManifestClassConstructorType } from './type-guards';
|
||||
import { loadExtension } from './load-extension.function';
|
||||
import type { ClassConstructor } from '@umbraco-cms/backoffice/models';
|
||||
import type { ManifestClass } from '@umbraco-cms/backoffice/extensions-registry';
|
||||
import type { ManifestClass, ClassConstructor } from './types';
|
||||
|
||||
//TODO: Write tests for this method:
|
||||
export async function createExtensionClass<T = unknown>(
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { hasDefaultExport } from './has-default-export.function';
|
||||
import { isManifestElementNameType } from './type-guards';
|
||||
import { loadExtension } from './load-extension.function';
|
||||
import type { HTMLElementConstructor } from '@umbraco-cms/backoffice/models';
|
||||
import type { ManifestElement } from '@umbraco-cms/backoffice/extensions-registry';
|
||||
import type { HTMLElementConstructor, ManifestElement } from './types';
|
||||
|
||||
export async function createExtensionElement<ElementType extends HTMLElement>(
|
||||
manifest: ManifestElement<ElementType>
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import type { ManifestEntrypoint } from '../extensions-registry/models';
|
||||
import { hasInitExport, loadExtension, UmbExtensionRegistry } from '@umbraco-cms/backoffice/extensions-api';
|
||||
import type { ManifestEntrypoint } from './types';
|
||||
import { hasInitExport } from './has-init-export.function';
|
||||
import { loadExtension } from './load-extension.function';
|
||||
import { UmbExtensionRegistry } from './registry/extension.registry';
|
||||
import { UmbControllerHostElement } from '@umbraco-cms/backoffice/controller';
|
||||
|
||||
export class UmbEntryPointExtensionInitializer {
|
||||
|
||||
@@ -8,3 +8,4 @@ export * from './create-extension-element-or-fallback.function';
|
||||
export * from './create-extension-class.function';
|
||||
export * from './umb-lifecycle.interface';
|
||||
export * from './entry-point-extension-initializer';
|
||||
export * from './types';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { isManifestJSType, isManifestLoaderType } from './type-guards';
|
||||
import type { ManifestWithLoader } from '@umbraco-cms/backoffice/extensions-registry';
|
||||
import type { ManifestWithLoader } from '@umbraco-cms/backoffice/extensions-api';
|
||||
|
||||
export async function loadExtension<T = unknown>(manifest: ManifestWithLoader<T>): Promise<T | null> {
|
||||
try {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { expect } from '@open-wc/testing';
|
||||
import type { ManifestKind } from '../types';
|
||||
import { UmbExtensionRegistry } from './extension.registry';
|
||||
import type { ManifestKind, ManifestTypes } from '@umbraco-cms/backoffice/extensions-registry';
|
||||
import type { ManifestTypes } from '@umbraco-cms/backoffice/extensions-registry';
|
||||
|
||||
describe('UmbExtensionRegistry', () => {
|
||||
let extensionRegistry: UmbExtensionRegistry;
|
||||
|
||||
@@ -1,11 +1,6 @@
|
||||
import { BehaviorSubject, map, Observable, distinctUntilChanged, combineLatest } from 'rxjs';
|
||||
import type {
|
||||
ManifestTypes,
|
||||
ManifestTypeMap,
|
||||
ManifestBase,
|
||||
SpecificManifestTypeOrManifestBase,
|
||||
ManifestKind,
|
||||
} from '@umbraco-cms/backoffice/extensions-registry';
|
||||
import type { ManifestTypeMap, ManifestBase, SpecificManifestTypeOrManifestBase, ManifestKind } from '../types';
|
||||
import type { ManifestTypes } from '@umbraco-cms/backoffice/extensions-registry';
|
||||
|
||||
function extensionArrayMemoization<T extends { alias: string }>(
|
||||
previousValue: Array<T>,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { ManifestClass, ManifestClassWithClassConstructor } from '@umbraco-cms/backoffice/extensions-registry';
|
||||
import type { ManifestClass, ManifestClassWithClassConstructor } from '../types';
|
||||
|
||||
export function isManifestClassConstructorType(manifest: unknown): manifest is ManifestClassWithClassConstructor {
|
||||
return typeof manifest === 'object' && manifest !== null && (manifest as ManifestClass).class !== undefined;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { ManifestBase, ManifestClass } from '../types';
|
||||
import { isManifestJSType } from './is-manifest-js-type.function';
|
||||
import { isManifestLoaderType } from './is-manifest-loader-type.function';
|
||||
import { isManifestClassConstructorType } from './is-manifest-class-instance-type.function';
|
||||
import type { ManifestBase, ManifestClass } from '@umbraco-cms/backoffice/extensions-registry';
|
||||
|
||||
export function isManifestClassableType(manifest: ManifestBase): manifest is ManifestClass {
|
||||
return (
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { ManifestElement, ManifestElementWithElementName } from '@umbraco-cms/backoffice/extensions-registry';
|
||||
import type { ManifestElement, ManifestElementWithElementName } from '../types';
|
||||
|
||||
export function isManifestElementNameType(manifest: unknown): manifest is ManifestElementWithElementName {
|
||||
return typeof manifest === 'object' && manifest !== null && (manifest as ManifestElement).elementName !== undefined;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { ManifestElement, ManifestBase } from '../types';
|
||||
import { isManifestElementNameType } from './is-manifest-element-name-type.function';
|
||||
import { isManifestJSType } from './is-manifest-js-type.function';
|
||||
import { isManifestLoaderType } from './is-manifest-loader-type.function';
|
||||
import type { ManifestElement, ManifestBase } from '@umbraco-cms/backoffice/extensions-registry';
|
||||
|
||||
export function isManifestElementableType<ElementType extends HTMLElement = HTMLElement>(
|
||||
manifest: ManifestBase
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { ManifestBase, ManifestWithLoader } from '@umbraco-cms/backoffice/extensions-registry';
|
||||
import type { ManifestBase, ManifestWithLoader } from '../types';
|
||||
|
||||
export type ManifestJSType<T> = ManifestWithLoader<T> & { js: string };
|
||||
export function isManifestJSType<T>(manifest: ManifestBase | unknown): manifest is ManifestJSType<T> {
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import type { ManifestBase, ManifestWithLoader } from '../types';
|
||||
|
||||
import type { ManifestBase, ManifestWithLoader } from '@umbraco-cms/backoffice/extensions-registry';
|
||||
export type ManifestLoaderType<T> = ManifestWithLoader<T> & {
|
||||
loader: () => Promise<T>;
|
||||
};
|
||||
|
||||
export function isManifestLoaderType<T>(manifest: ManifestBase): manifest is ManifestLoaderType<T> {
|
||||
return typeof (manifest as ManifestLoaderType<T>).loader === 'function';
|
||||
}
|
||||
|
||||
157
src/Umbraco.Web.UI.Client/libs/extensions-api/types.ts
Normal file
157
src/Umbraco.Web.UI.Client/libs/extensions-api/types.ts
Normal file
@@ -0,0 +1,157 @@
|
||||
import { ManifestTypes } from '@umbraco-cms/backoffice/extensions-registry';
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
export type HTMLElementConstructor<T = HTMLElement> = new (...args: any[]) => T;
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
export type ClassConstructor<T> = new (...args: any[]) => T;
|
||||
|
||||
export type ManifestTypeMap = {
|
||||
[Manifest in ManifestTypes as Manifest['type']]: Manifest;
|
||||
};
|
||||
|
||||
export type SpecificManifestTypeOrManifestBase<T extends keyof ManifestTypeMap | string> =
|
||||
T extends keyof ManifestTypeMap ? ManifestTypeMap[T] : ManifestBase;
|
||||
|
||||
export interface ManifestBase {
|
||||
/**
|
||||
* The type of extension such as dashboard etc...
|
||||
*/
|
||||
type: string;
|
||||
|
||||
/**
|
||||
* The alias of the extension, ensure it is unique
|
||||
*/
|
||||
alias: string;
|
||||
|
||||
/**
|
||||
* The kind of the extension, used to group extensions together
|
||||
*
|
||||
* @examples ["button"]
|
||||
*/
|
||||
kind?: unknown; // I had to add the optional kind property set to undefined. To make the ManifestTypes recognize the Manifest Kind types. Notice that Kinds has to Omit the kind property when extending.
|
||||
|
||||
/**
|
||||
* The friendly name of the extension
|
||||
*/
|
||||
name: string;
|
||||
|
||||
/**
|
||||
* Extensions such as dashboards are ordered by weight with lower numbers being first in the list
|
||||
*/
|
||||
weight?: number;
|
||||
}
|
||||
|
||||
export interface ManifestKind {
|
||||
type: 'kind';
|
||||
alias: string;
|
||||
matchType: string;
|
||||
matchKind: string;
|
||||
manifest: Partial<ManifestTypes>;
|
||||
}
|
||||
|
||||
export interface ManifestWithConditions<ConditionsType> {
|
||||
/**
|
||||
* Set the conditions for when the extension should be loaded
|
||||
*/
|
||||
conditions: ConditionsType;
|
||||
}
|
||||
|
||||
export interface ManifestWithLoader<LoaderReturnType> extends ManifestBase {
|
||||
/**
|
||||
* @TJS-ignore
|
||||
*/
|
||||
loader?: () => Promise<LoaderReturnType>;
|
||||
}
|
||||
|
||||
/**
|
||||
* The type of extension such as dashboard etc...
|
||||
*/
|
||||
export interface ManifestClass<ClassType = unknown>
|
||||
extends ManifestWithLoader<{ default: ClassConstructor<ClassType> }> {
|
||||
readonly CLASS_TYPE?: ClassType;
|
||||
|
||||
/**
|
||||
* The file location of the javascript file to load
|
||||
* @TJS-required
|
||||
*/
|
||||
js?: string;
|
||||
|
||||
/**
|
||||
* @TJS-ignore
|
||||
*/
|
||||
className?: string;
|
||||
|
||||
/**
|
||||
* @TJS-ignore
|
||||
*/
|
||||
class?: ClassConstructor<ClassType>;
|
||||
//loader?: () => Promise<object | HTMLElement>;
|
||||
}
|
||||
|
||||
export interface ManifestClassWithClassConstructor<T = unknown> extends ManifestClass<T> {
|
||||
class: ClassConstructor<T>;
|
||||
}
|
||||
|
||||
export interface ManifestElement<ElementType extends HTMLElement = HTMLElement>
|
||||
extends ManifestWithLoader<{ default: ClassConstructor<ElementType> } | Omit<object, 'default'>> {
|
||||
readonly ELEMENT_TYPE?: ElementType;
|
||||
|
||||
/**
|
||||
* The file location of the javascript file to load
|
||||
*
|
||||
* @TJS-require
|
||||
*/
|
||||
js?: string;
|
||||
|
||||
/**
|
||||
* The HTML web component name to use such as 'my-dashboard'
|
||||
* Note it is NOT <my-dashboard></my-dashboard> but just the name
|
||||
*/
|
||||
elementName?: string;
|
||||
|
||||
//loader?: () => Promise<object | HTMLElement>;
|
||||
|
||||
/**
|
||||
* This contains properties specific to the type of extension
|
||||
*/
|
||||
meta?: unknown;
|
||||
}
|
||||
|
||||
export interface ManifestWithView<ElementType extends HTMLElement = HTMLElement> extends ManifestElement<ElementType> {
|
||||
meta: MetaManifestWithView;
|
||||
}
|
||||
|
||||
export interface MetaManifestWithView {
|
||||
pathname: string;
|
||||
label: string;
|
||||
icon: string;
|
||||
}
|
||||
|
||||
export interface ManifestElementWithElementName extends ManifestElement {
|
||||
/**
|
||||
* The HTML web component name to use such as 'my-dashboard'
|
||||
* Note it is NOT <my-dashboard></my-dashboard> but just the name
|
||||
*/
|
||||
elementName: string;
|
||||
}
|
||||
|
||||
export interface ManifestWithMeta extends ManifestBase {
|
||||
/**
|
||||
* This contains properties specific to the type of extension
|
||||
*/
|
||||
meta: unknown;
|
||||
}
|
||||
|
||||
/**
|
||||
* This type of extension gives full control and will simply load the specified JS file
|
||||
* You could have custom logic to decide which extensions to load/register by using extensionRegistry
|
||||
*/
|
||||
export interface ManifestEntrypoint extends ManifestBase {
|
||||
type: 'entryPoint';
|
||||
|
||||
/**
|
||||
* The file location of the javascript file to load in the backoffice
|
||||
*/
|
||||
js: string;
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { ManifestElement, ManifestWithConditions } from '.';
|
||||
import type { ManifestElement, ManifestWithConditions } from '@umbraco-cms/backoffice/extensions-api';
|
||||
|
||||
export interface ManifestCollectionView extends ManifestElement, ManifestWithConditions<ConditionsCollectionView> {
|
||||
type: 'collectionView';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { ManifestBase } from '.';
|
||||
import type { ManifestBase } from '@umbraco-cms/backoffice/extensions-api';
|
||||
|
||||
export interface ManifestDashboardCollection extends ManifestBase {
|
||||
type: 'dashboardCollection';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { UmbDashboardExtensionElement } from '../interfaces';
|
||||
import type { ManifestElement, ManifestWithConditions } from '.';
|
||||
import type { ManifestElement, ManifestWithConditions } from '@umbraco-cms/backoffice/extensions-api';
|
||||
|
||||
export interface ManifestDashboard
|
||||
extends ManifestElement<UmbDashboardExtensionElement>,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { ManifestElement } from '.';
|
||||
import type { ManifestElement } from '@umbraco-cms/backoffice/extensions-api';
|
||||
|
||||
/**
|
||||
* An action to perform on an entity
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { ManifestElement, ManifestWithConditions } from '.';
|
||||
import type { ManifestElement, ManifestWithConditions } from '@umbraco-cms/backoffice/extensions-api';
|
||||
|
||||
/**
|
||||
* An action to perform on multiple entities
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { UmbExternalLoginProviderExtensionElement } from '../interfaces/external-login-provider-extension-element.interface';
|
||||
import type { ManifestElement } from '.';
|
||||
import type { ManifestElement } from '@umbraco-cms/backoffice/extensions-api';
|
||||
|
||||
export interface ManifestExternalLoginProvider extends ManifestElement<UmbExternalLoginProviderExtensionElement> {
|
||||
type: 'externalLoginProvider';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { ManifestElement } from '.';
|
||||
import type { ManifestElement } from '@umbraco-cms/backoffice/extensions-api';
|
||||
|
||||
/**
|
||||
* Header apps are displayed in the top right corner of the backoffice
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { ManifestElement } from '.';
|
||||
import type { ManifestElement } from '@umbraco-cms/backoffice/extensions-api';
|
||||
|
||||
export interface ManifestHealthCheck extends ManifestElement {
|
||||
type: 'healthCheck';
|
||||
|
||||
@@ -25,8 +25,7 @@ import type { ManifestWorkspace } from './workspace.model';
|
||||
import type { ManifestWorkspaceAction } from './workspace-action.model';
|
||||
import type { ManifestWorkspaceEditorView } from './workspace-editor-view.model';
|
||||
import type { ManifestWorkspaceViewCollection } from './workspace-view-collection.model';
|
||||
|
||||
import type { ClassConstructor } from '@umbraco-cms/backoffice/models';
|
||||
import type { ManifestBase, ManifestEntrypoint } from '@umbraco-cms/backoffice/extensions-api';
|
||||
|
||||
export * from './collection-view.model';
|
||||
export * from './dashboard-collection.model';
|
||||
@@ -92,157 +91,3 @@ export type ManifestTypes =
|
||||
| ManifestWorkspaceEditorView
|
||||
| ManifestWorkspaceViewCollection
|
||||
| ManifestBase;
|
||||
|
||||
export type ManifestStandardTypes = ManifestTypes['type'];
|
||||
|
||||
export type ManifestTypeMap = {
|
||||
[Manifest in ManifestTypes as Manifest['type']]: Manifest;
|
||||
};
|
||||
|
||||
export type SpecificManifestTypeOrManifestBase<T extends keyof ManifestTypeMap | string> =
|
||||
T extends keyof ManifestTypeMap ? ManifestTypeMap[T] : ManifestBase;
|
||||
|
||||
export interface ManifestBase {
|
||||
/**
|
||||
* The type of extension such as dashboard etc...
|
||||
*/
|
||||
type: string;
|
||||
|
||||
/**
|
||||
* The alias of the extension, ensure it is unique
|
||||
*/
|
||||
alias: string;
|
||||
|
||||
/**
|
||||
* The kind of the extension, used to group extensions together
|
||||
*
|
||||
* @examples ["button"]
|
||||
*/
|
||||
kind?: unknown; // I had to add the optional kind property set to undefined. To make the ManifestTypes recognize the Manifest Kind types. Notice that Kinds has to Omit the kind property when extending.
|
||||
|
||||
/**
|
||||
* The friendly name of the extension
|
||||
*/
|
||||
name: string;
|
||||
|
||||
/**
|
||||
* Extensions such as dashboards are ordered by weight with lower numbers being first in the list
|
||||
*/
|
||||
weight?: number;
|
||||
}
|
||||
|
||||
export interface ManifestKind {
|
||||
type: 'kind';
|
||||
alias: string;
|
||||
matchType: string;
|
||||
matchKind: string;
|
||||
manifest: Partial<ManifestTypes>;
|
||||
}
|
||||
|
||||
export interface ManifestWithConditions<ConditionsType> {
|
||||
/**
|
||||
* Set the conditions for when the extension should be loaded
|
||||
*/
|
||||
conditions: ConditionsType;
|
||||
}
|
||||
|
||||
export interface ManifestWithLoader<LoaderReturnType> extends ManifestBase {
|
||||
/**
|
||||
* @TJS-ignore
|
||||
*/
|
||||
loader?: () => Promise<LoaderReturnType>;
|
||||
}
|
||||
|
||||
/**
|
||||
* The type of extension such as dashboard etc...
|
||||
*/
|
||||
export interface ManifestClass<ClassType = unknown>
|
||||
extends ManifestWithLoader<{ default: ClassConstructor<ClassType> }> {
|
||||
//type: ManifestStandardTypes;
|
||||
readonly CLASS_TYPE?: ClassType;
|
||||
|
||||
/**
|
||||
* The file location of the javascript file to load
|
||||
* @TJS-required
|
||||
*/
|
||||
js?: string;
|
||||
|
||||
/**
|
||||
* @TJS-ignore
|
||||
*/
|
||||
className?: string;
|
||||
|
||||
/**
|
||||
* @TJS-ignore
|
||||
*/
|
||||
class?: ClassConstructor<ClassType>;
|
||||
//loader?: () => Promise<object | HTMLElement>;
|
||||
}
|
||||
|
||||
export interface ManifestClassWithClassConstructor<T = unknown> extends ManifestClass<T> {
|
||||
class: ClassConstructor<T>;
|
||||
}
|
||||
|
||||
export interface ManifestElement<ElementType extends HTMLElement = HTMLElement>
|
||||
extends ManifestWithLoader<{ default: ClassConstructor<ElementType> } | Omit<object, 'default'>> {
|
||||
//type: ManifestStandardTypes;
|
||||
readonly ELEMENT_TYPE?: ElementType;
|
||||
|
||||
/**
|
||||
* The file location of the javascript file to load
|
||||
*
|
||||
* @TJS-require
|
||||
*/
|
||||
js?: string;
|
||||
|
||||
/**
|
||||
* The HTML web component name to use such as 'my-dashboard'
|
||||
* Note it is NOT <my-dashboard></my-dashboard> but just the name
|
||||
*/
|
||||
elementName?: string;
|
||||
|
||||
//loader?: () => Promise<object | HTMLElement>;
|
||||
|
||||
/**
|
||||
* This contains properties specific to the type of extension
|
||||
*/
|
||||
meta?: unknown;
|
||||
}
|
||||
|
||||
export interface ManifestWithView<ElementType extends HTMLElement = HTMLElement> extends ManifestElement<ElementType> {
|
||||
meta: MetaManifestWithView;
|
||||
}
|
||||
|
||||
export interface MetaManifestWithView {
|
||||
pathname: string;
|
||||
label: string;
|
||||
icon: string;
|
||||
}
|
||||
|
||||
export interface ManifestElementWithElementName extends ManifestElement {
|
||||
/**
|
||||
* The HTML web component name to use such as 'my-dashboard'
|
||||
* Note it is NOT <my-dashboard></my-dashboard> but just the name
|
||||
*/
|
||||
elementName: string;
|
||||
}
|
||||
|
||||
export interface ManifestWithMeta extends ManifestBase {
|
||||
/**
|
||||
* This contains properties specific to the type of extension
|
||||
*/
|
||||
meta: unknown;
|
||||
}
|
||||
|
||||
/**
|
||||
* This type of extension gives full control and will simply load the specified JS file
|
||||
* You could have custom logic to decide which extensions to load/register by using extensionRegistry
|
||||
*/
|
||||
export interface ManifestEntrypoint extends ManifestBase {
|
||||
type: 'entryPoint';
|
||||
|
||||
/**
|
||||
* The file location of the javascript file to load in the backoffice
|
||||
*/
|
||||
js: string;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { UmbMenuItemExtensionElement } from '../interfaces/menu-item-extension-element.interface';
|
||||
import type { ManifestElement } from '.';
|
||||
import type { ManifestElement } from '@umbraco-cms/backoffice/extensions-api';
|
||||
|
||||
export interface ManifestMenuItem extends ManifestElement<UmbMenuItemExtensionElement> {
|
||||
type: 'menuItem';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { ManifestElement } from '.';
|
||||
import type { ManifestElement } from '@umbraco-cms/backoffice/extensions-api';
|
||||
|
||||
export interface ManifestMenu extends ManifestElement {
|
||||
type: 'menu';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { ManifestElement } from '.';
|
||||
import type { ManifestElement } from '@umbraco-cms/backoffice/extensions-api';
|
||||
|
||||
export interface ManifestModal extends ManifestElement {
|
||||
type: 'modal';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { ManifestElement } from '.';
|
||||
import type { ManifestElement } from '@umbraco-cms/backoffice/extensions-api';
|
||||
|
||||
export interface ManifestPackageView extends ManifestElement {
|
||||
type: 'packageView';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { ManifestElement, ManifestWithConditions } from '.';
|
||||
import type { ManifestElement, ManifestWithConditions } from '@umbraco-cms/backoffice/extensions-api';
|
||||
|
||||
export interface ManifestPropertyAction extends ManifestElement, ManifestWithConditions<ConditionsPropertyAction> {
|
||||
type: 'propertyAction';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { UmbPropertyEditorExtensionElement } from '../interfaces';
|
||||
import type { ManifestElement, ManifestBase } from '.';
|
||||
import type { ManifestElement, ManifestBase } from '@umbraco-cms/backoffice/extensions-api';
|
||||
|
||||
export interface ManifestPropertyEditorUI extends ManifestElement<UmbPropertyEditorExtensionElement> {
|
||||
type: 'propertyEditorUI';
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import type { ManifestClass } from '.';
|
||||
|
||||
import type { ManifestClass } from '@umbraco-cms/backoffice/extensions-api';
|
||||
// TODO: Consider adding a ClassType for this manifest. (Currently we cannot know the scope of a repository, therefor we are going with unknown for now.)
|
||||
export interface ManifestRepository extends ManifestClass<unknown> {
|
||||
type: 'repository';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { UmbSectionSidebarAppExtensionElement } from '../interfaces/section-sidebar-app-extension-element.interface';
|
||||
import type { ManifestElement } from '.';
|
||||
import type { ManifestElement } from '@umbraco-cms/backoffice/extensions-api';
|
||||
|
||||
export interface ManifestSectionSidebarApp extends ManifestElement<UmbSectionSidebarAppExtensionElement> {
|
||||
type: 'sectionSidebarApp';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { UmbSectionViewExtensionElement } from '../interfaces/section-view-extension-element.interface';
|
||||
import type { ManifestElement, ManifestWithConditions } from '.';
|
||||
import type { ManifestElement, ManifestWithConditions } from '@umbraco-cms/backoffice/extensions-api';
|
||||
|
||||
export interface ManifestSectionView
|
||||
extends ManifestElement<UmbSectionViewExtensionElement>,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { UmbSectionExtensionElement } from '../interfaces';
|
||||
import type { ManifestElement } from '.';
|
||||
import type { ManifestElement } from '@umbraco-cms/backoffice/extensions-api';
|
||||
|
||||
export interface ManifestSection extends ManifestElement<UmbSectionExtensionElement> {
|
||||
type: 'section';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { ManifestClass } from '.';
|
||||
import type { ManifestClass } from '@umbraco-cms/backoffice/extensions-api';
|
||||
import { UmbItemStore, UmbStoreBase, UmbTreeStore } from '@umbraco-cms/backoffice/store';
|
||||
|
||||
export interface ManifestStore extends ManifestClass<UmbStoreBase> {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { ManifestWithLoader } from '.';
|
||||
import type { ManifestWithLoader } from '@umbraco-cms/backoffice/extensions-api';
|
||||
|
||||
// TODO: make or find type for JS Module with default export: Would be nice to support css file directly.
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { UmbTreeItemExtensionElement } from '../interfaces';
|
||||
import type { ManifestElement } from '.';
|
||||
import type { ManifestElement } from '@umbraco-cms/backoffice/extensions-api';
|
||||
|
||||
export interface ManifestTreeItem extends ManifestElement<UmbTreeItemExtensionElement> {
|
||||
type: 'treeItem';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { ManifestBase } from '.';
|
||||
import type { ManifestBase } from '@umbraco-cms/backoffice/extensions-api';
|
||||
|
||||
export interface ManifestTree extends ManifestBase {
|
||||
type: 'tree';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { ManifestElement } from '.';
|
||||
import type { ManifestElement } from '@umbraco-cms/backoffice/extensions-api';
|
||||
|
||||
export interface ManifestUserProfileApp extends ManifestElement {
|
||||
type: 'userProfileApp';
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import type { InterfaceColor, InterfaceLook } from '@umbraco-ui/uui-base/lib/types/index';
|
||||
import type { ManifestElement } from '.';
|
||||
import type { ClassConstructor } from '@umbraco-cms/backoffice/models';
|
||||
import type { ManifestElement, ClassConstructor } from '@umbraco-cms/backoffice/extensions-api';
|
||||
import { UmbWorkspaceAction } from '@umbraco-cms/backoffice/workspace';
|
||||
|
||||
export interface ManifestWorkspaceAction extends ManifestElement {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { UmbWorkspaceEditorViewExtensionElement } from '../interfaces/workspace-editor-view-extension-element.interface';
|
||||
import type { ManifestWithView } from '.';
|
||||
import type { ManifestWithView } from '@umbraco-cms/backoffice/extensions-api';
|
||||
|
||||
export interface ManifestWorkspaceEditorView extends ManifestWithView<UmbWorkspaceEditorViewExtensionElement> {
|
||||
type: 'workspaceEditorView';
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
import type { ManifestWithConditions, ManifestWithView, MetaManifestWithView } from '.';
|
||||
import type {
|
||||
ManifestWithConditions,
|
||||
ManifestWithView,
|
||||
MetaManifestWithView,
|
||||
} from '@umbraco-cms/backoffice/extensions-api';
|
||||
|
||||
export interface ManifestWorkspaceViewCollection
|
||||
extends ManifestWithView,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { ManifestElement } from '.';
|
||||
import type { ManifestElement } from '@umbraco-cms/backoffice/extensions-api';
|
||||
|
||||
export interface ManifestWorkspace extends ManifestElement {
|
||||
type: 'workspace';
|
||||
|
||||
@@ -1,9 +1,3 @@
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
export type HTMLElementConstructor<T = HTMLElement> = new (...args: any[]) => T;
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
export type ClassConstructor<T> = new (...args: any[]) => T;
|
||||
|
||||
/** Tried to find a common base of our entities — used by Entity Workspace Context */
|
||||
export type UmbEntityBase = {
|
||||
id?: string;
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
import { Observable, map } from 'rxjs';
|
||||
import { UmbPagedData, UmbTreeRepository } from '@umbraco-cms/backoffice/repository';
|
||||
import type { ManifestTree } from '@umbraco-cms/backoffice/extensions-registry';
|
||||
import { ManifestTree, umbExtensionsRegistry } from '@umbraco-cms/backoffice/extensions-registry';
|
||||
import { UmbBooleanState, UmbObserverController } from '@umbraco-cms/backoffice/observable-api';
|
||||
import { UmbControllerHostElement } from '@umbraco-cms/backoffice/controller';
|
||||
import { createExtensionClass } from '@umbraco-cms/backoffice/extensions-api';
|
||||
import { umbExtensionsRegistry } from '@umbraco-cms/backoffice/extensions-registry';
|
||||
import { ProblemDetailsModel, TreeItemPresentationModel } from '@umbraco-cms/backoffice/backend-api';
|
||||
import { UmbContextProviderController } from '@umbraco-cms/backoffice/context-api';
|
||||
import { UmbSelectionManagerBase } from '@umbraco-cms/backoffice/utils';
|
||||
|
||||
@@ -2,11 +2,8 @@ import { UUITextStyles } from '@umbraco-ui/uui-css/lib';
|
||||
import { css, CSSResultGroup, html, LitElement } from 'lit';
|
||||
import { customElement } from 'lit/decorators.js';
|
||||
import { ifDefined } from 'lit/directives/if-defined.js';
|
||||
import {
|
||||
ManifestHeaderAppButtonKind,
|
||||
ManifestKind,
|
||||
umbExtensionsRegistry,
|
||||
} from '@umbraco-cms/backoffice/extensions-registry';
|
||||
import { ManifestHeaderAppButtonKind, umbExtensionsRegistry } from '@umbraco-cms/backoffice/extensions-registry';
|
||||
import { ManifestKind } from '@umbraco-cms/backoffice/extensions-api';
|
||||
|
||||
const manifest: ManifestKind = {
|
||||
type: 'kind',
|
||||
|
||||
@@ -2,11 +2,11 @@ import { UUITextStyles } from '@umbraco-ui/uui-css/lib';
|
||||
import { css, html } from 'lit';
|
||||
import { customElement, property } from 'lit/decorators.js';
|
||||
import {
|
||||
ManifestKind,
|
||||
ManifestMenu,
|
||||
ManifestSectionSidebarAppMenuKind,
|
||||
umbExtensionsRegistry,
|
||||
} from '@umbraco-cms/backoffice/extensions-registry';
|
||||
import { ManifestKind } from '@umbraco-cms/backoffice/extensions-api';
|
||||
import { UmbLitElement } from '@umbraco-cms/internal/lit-element';
|
||||
|
||||
import '../../menu/menu.element';
|
||||
|
||||
@@ -4,11 +4,8 @@ import { customElement, property } from 'lit/decorators.js';
|
||||
import { UmbEntityTreeItemContext } from './entity-tree-item.context';
|
||||
import { UmbLitElement } from '@umbraco-cms/internal/lit-element';
|
||||
import { EntityTreeItemResponseModel } from '@umbraco-cms/backoffice/backend-api';
|
||||
import {
|
||||
ManifestKind,
|
||||
UmbTreeItemExtensionElement,
|
||||
umbExtensionsRegistry,
|
||||
} from '@umbraco-cms/backoffice/extensions-registry';
|
||||
import { UmbTreeItemExtensionElement, umbExtensionsRegistry } from '@umbraco-cms/backoffice/extensions-registry';
|
||||
import { ManifestKind } from '@umbraco-cms/backoffice/extensions-api';
|
||||
|
||||
// TODO: Move to separate file:
|
||||
const manifest: ManifestKind = {
|
||||
|
||||
@@ -2,11 +2,11 @@ import { html, nothing } from 'lit';
|
||||
import { customElement, property } from 'lit/decorators.js';
|
||||
import { UmbLitElement } from '@umbraco-cms/internal/lit-element';
|
||||
import {
|
||||
ManifestKind,
|
||||
ManifestMenuItemTreeKind,
|
||||
UmbMenuItemExtensionElement,
|
||||
umbExtensionsRegistry,
|
||||
} from '@umbraco-cms/backoffice/extensions-registry';
|
||||
import { ManifestKind } from '@umbraco-cms/backoffice/extensions-api';
|
||||
|
||||
// TODO: Move to separate file:
|
||||
const manifest: ManifestKind = {
|
||||
|
||||
@@ -9,8 +9,8 @@ import { UmbBackofficeModalContainerElement } from './components/backoffice-fram
|
||||
import { UmbNotificationContext, UMB_NOTIFICATION_CONTEXT_TOKEN } from '@umbraco-cms/backoffice/notification';
|
||||
import { UmbModalContext, UMB_MODAL_CONTEXT_TOKEN } from '@umbraco-cms/backoffice/modal';
|
||||
import { UmbContextProviderController } from '@umbraco-cms/backoffice/context-api';
|
||||
import type { UmbEntryPointOnInit } from '@umbraco-cms/backoffice/extensions-api';
|
||||
import { ManifestKind, ManifestTypes } from '@umbraco-cms/backoffice/extensions-registry';
|
||||
import type { UmbEntryPointOnInit, ManifestKind } from '@umbraco-cms/backoffice/extensions-api';
|
||||
import { ManifestTypes } from '@umbraco-cms/backoffice/extensions-registry';
|
||||
|
||||
import './notification';
|
||||
|
||||
|
||||
@@ -4,10 +4,10 @@ import { customElement, property, query, state } from 'lit/decorators.js';
|
||||
import { UmbFolderModalData, UmbFolderModalResult, UmbModalHandler } from '@umbraco-cms/backoffice/modal';
|
||||
import { UmbLitElement } from '@umbraco-cms/internal/lit-element';
|
||||
import { UmbFolderRepository } from '@umbraco-cms/backoffice/repository';
|
||||
import { createExtensionClass } from '@umbraco-cms/backoffice/extensions-api';
|
||||
import { createExtensionClass, ManifestBase } from '@umbraco-cms/backoffice/extensions-api';
|
||||
import { FolderReponseModel, ProblemDetailsModel } from '@umbraco-cms/backoffice/backend-api';
|
||||
import { UmbObserverController } from '@umbraco-cms/backoffice/observable-api';
|
||||
import { ManifestBase, umbExtensionsRegistry } from '@umbraco-cms/backoffice/extensions-registry';
|
||||
import { umbExtensionsRegistry } from '@umbraco-cms/backoffice/extensions-registry';
|
||||
|
||||
@customElement('umb-folder-modal')
|
||||
export class UmbFolderModalElement extends UmbLitElement {
|
||||
|
||||
@@ -2,8 +2,7 @@ import { UmbPackageStore, UMB_PACKAGE_STORE_TOKEN } from './package.store';
|
||||
import { UmbPackageServerDataSource } from './sources/package.server.data';
|
||||
import type { UmbControllerHostElement } from '@umbraco-cms/backoffice/controller';
|
||||
import { UmbContextConsumerController } from '@umbraco-cms/backoffice/context-api';
|
||||
import type { ManifestBase } from '@umbraco-cms/backoffice/extensions-registry';
|
||||
import { isManifestJSType } from '@umbraco-cms/backoffice/extensions-api';
|
||||
import { isManifestJSType, ManifestBase } from '@umbraco-cms/backoffice/extensions-api';
|
||||
import { OpenAPI } from '@umbraco-cms/backoffice/backend-api';
|
||||
|
||||
// TODO: Figure out if we should base stores like this on something more generic for "collections" rather than trees.
|
||||
|
||||
@@ -4,7 +4,7 @@ import { UmbContextToken } from '@umbraco-cms/backoffice/context-api';
|
||||
import { UmbControllerHostElement } from '@umbraco-cms/backoffice/controller';
|
||||
import { UmbStoreBase } from '@umbraco-cms/backoffice/store';
|
||||
import type { PackageMigrationStatusResponseModel } from '@umbraco-cms/backoffice/backend-api';
|
||||
import type { ManifestBase } from '@umbraco-cms/backoffice/extensions-registry';
|
||||
import type { ManifestBase } from '@umbraco-cms/backoffice/extensions-api';
|
||||
import { UmbArrayState } from '@umbraco-cms/backoffice/observable-api';
|
||||
|
||||
export const UMB_PACKAGE_STORE_TOKEN = new UmbContextToken<UmbPackageStore>('UmbPackageStore');
|
||||
|
||||
@@ -4,7 +4,8 @@ import { customElement, property } from 'lit/decorators.js';
|
||||
import { UmbTreeItemElement } from '../../../core/components/tree/tree-item/tree-item.element';
|
||||
import { UmbFileSystemTreeItemContext } from './file-system-tree-item.context';
|
||||
import { UmbLitElement } from '@umbraco-cms/internal/lit-element';
|
||||
import { ManifestKind, umbExtensionsRegistry } from '@umbraco-cms/backoffice/extensions-registry';
|
||||
import { umbExtensionsRegistry } from '@umbraco-cms/backoffice/extensions-registry';
|
||||
import { ManifestKind } from '@umbraco-cms/backoffice/extensions-api';
|
||||
import { FileSystemTreeItemPresentationModel } from '@umbraco-cms/backoffice/backend-api';
|
||||
|
||||
// TODO: Move to separate file:
|
||||
|
||||
Reference in New Issue
Block a user