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

Extension Manifest Map: Ufm #2377

Merged
merged 10 commits into from
Sep 30, 2024
2 changes: 1 addition & 1 deletion examples/ufm-custom-component/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { ManifestUfmComponent } from '@umbraco-cms/backoffice/extension-registry';
import type { ManifestUfmComponent } from '@umbraco-cms/backoffice/ufm';

export const manifests: Array<ManifestUfmComponent> = [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { UmbExternalLoginProviderElement } from '../interfaces/external-login-provider-element.interface.js';
import type { UmbExternalLoginProviderElement } from './external-login-provider-element.interface.js';
import type { ManifestElement } from '@umbraco-cms/backoffice/extension-api';

export interface ManifestExternalLoginProvider extends ManifestElement<UmbExternalLoginProviderElement> {
Expand Down
1 change: 1 addition & 0 deletions src/packages/core/extension-registry/extensions/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ export type * from './backoffice-entry-point.extension.js';
export type * from './entity-action.extension.js';
export type * from './entity-bulk-action.extension.js';
export type * from './entry-point.extension.js';
export type * from './external-login-provider-element.interface.js';
export type * from './external-login-provider.extension.js';
export type * from './global-context.extension.js';
export type * from './header-app.extension.js';
Expand Down
1 change: 0 additions & 1 deletion src/packages/core/extension-registry/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ export * from './conditions/index.js';
export * from './initializers/index.js';
export * from './registry.js';
export * from './utils/index.js';
export type * from './interfaces/index.js';
export type * from './models/index.js';
export type * from './extensions/index.js';

Expand Down
2 changes: 0 additions & 2 deletions src/packages/core/extension-registry/interfaces/index.ts

This file was deleted.

19 changes: 1 addition & 18 deletions src/packages/core/extension-registry/models/index.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,6 @@
import type { ManifestDynamicRootOrigin, ManifestDynamicRootQueryStep } from './dynamic-root.model.js';
import type { ManifestFileUploadPreview } from './file-upload-preview.model.js';
import type { ManifestUfmComponent } from './ufm-component.model.js';
import type { ManifestUfmFilter } from './ufm-filter.model.js';
import type { ManifestBase, ManifestBundle, ManifestCondition } from '@umbraco-cms/backoffice/extension-api';

export type * from './dynamic-root.model.js';
export type * from './file-upload-preview.model.js';
export type * from './ufm-component.model.js';
export type * from './ufm-filter.model.js';

export type ManifestTypes =
| ManifestBundle<ManifestTypes>
| ManifestCondition
| ManifestDynamicRootOrigin
| ManifestDynamicRootQueryStep
| ManifestFileUploadPreview
| ManifestUfmComponent
| ManifestUfmFilter
| ManifestBase;
export type ManifestTypes = ManifestBundle<ManifestTypes> | ManifestCondition | ManifestBase;

type UnionOfProperties<T> = T extends object ? T[keyof T] : never;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { UmbFileUploadPreviewElement } from '../interfaces/file-upload-preview.interface.js';
import type { UmbFileUploadPreviewElement } from './file-upload-preview.interface.js';
import type { ManifestElement } from '@umbraco-cms/backoffice/extension-api';

export interface ManifestFileUploadPreview extends ManifestElement<UmbFileUploadPreviewElement> {
Expand All @@ -10,3 +10,9 @@ export interface ManifestFileUploadPreview extends ManifestElement<UmbFileUpload
*/
forMimeTypes: string | Array<string>;
}

declare global {
interface UmbExtensionManifestMap {
umbFileUploadPreview: ManifestFileUploadPreview;
}
}
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
export * from './preview/index.js';
export * from './input-upload-field.element.js';
export * from './file-upload-preview.extension.js';
export * from './file-upload-preview.interface.js';
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element';
import { UmbChangeEvent } from '@umbraco-cms/backoffice/event';

import { UmbExtensionsManifestInitializer } from '@umbraco-cms/backoffice/extension-api';
import { type ManifestFileUploadPreview, umbExtensionsRegistry } from '@umbraco-cms/backoffice/extension-registry';
import { umbExtensionsRegistry } from '@umbraco-cms/backoffice/extension-registry';
import type { ManifestFileUploadPreview } from './file-upload-preview.extension.js';

@customElement('umb-input-upload-field')
export class UmbInputUploadFieldElement extends UmbLitElement {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,14 @@ import {
UMB_CONTENT_PICKER_DOCUMENT_ROOT_ORIGIN_PICKER_MODAL,
UMB_CONTENT_PICKER_DOCUMENT_ROOT_QUERY_STEP_PICKER_MODAL,
} from '../modals/index.js';
import type { ManifestDynamicRootOrigin, ManifestDynamicRootQueryStep } from '../dynamic-root.extension.js';
import { html, css, customElement, property, ifDefined, state, repeat } from '@umbraco-cms/backoffice/external/lit';
import { UmbChangeEvent } from '@umbraco-cms/backoffice/event';
import { UmbId } from '@umbraco-cms/backoffice/id';
import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element';
import { UmbSorterController } from '@umbraco-cms/backoffice/sorter';
import { umbExtensionsRegistry } from '@umbraco-cms/backoffice/extension-registry';
import { UMB_MODAL_MANAGER_CONTEXT } from '@umbraco-cms/backoffice/modal';
import type {
ManifestDynamicRootOrigin,
ManifestDynamicRootQueryStep,
} from '@umbraco-cms/backoffice/extension-registry';
import type { UmbModalContext } from '@umbraco-cms/backoffice/modal';
import { UmbFormControlMixin } from '@umbraco-cms/backoffice/validation';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,10 @@ export interface MetaDynamicRootQueryStep {
description?: string;
icon?: string;
}

declare global {
interface UmbExtensionManifestMap {
umbDynamicRootOrigin: ManifestDynamicRootOrigin;
umbDynamicRootQueryStep: ManifestDynamicRootQueryStep;
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export * from './modals/index.js';
export * from './repository/index.js';
export * from './components/index.js';
export * from './dynamic-root.extension.js';
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { UmbContentPickerDynamicRoot } from '../../types.js';
import type { ManifestDynamicRootOrigin } from '../dynamic-root.extension.js';
import type { UmbContentPickerDocumentRootOriginModalData } from './index.js';
import { html, customElement, state, ifDefined, repeat } from '@umbraco-cms/backoffice/external/lit';
import { UmbDocumentPickerInputContext } from '@umbraco-cms/backoffice/document';
import { UmbModalBaseElement } from '@umbraco-cms/backoffice/modal';
import type { ManifestDynamicRootOrigin } from '@umbraco-cms/backoffice/extension-registry';

@customElement('umb-dynamic-root-origin-picker-modal')
export class UmbDynamicRootOriginPickerModalModalElement extends UmbModalBaseElement<UmbContentPickerDocumentRootOriginModalData> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import type { UmbContentPickerDynamicRootQueryStep } from '../../types.js';
import type { ManifestDynamicRootQueryStep } from '../dynamic-root.extension.js';
import type { UmbContentPickerDocumentRootQueryStepModalData } from './index.js';
import { UmbDocumentTypePickerInputContext } from '@umbraco-cms/backoffice/document-type';
import { UmbId } from '@umbraco-cms/backoffice/id';
import { UmbModalBaseElement } from '@umbraco-cms/backoffice/modal';
import { html, customElement, state, ifDefined, repeat } from '@umbraco-cms/backoffice/external/lit';
import type { ManifestDynamicRootQueryStep } from '@umbraco-cms/backoffice/extension-registry';

@customElement('umb-dynamic-root-query-step-picker-modal')
export class UmbDynamicRootQueryStepPickerModalModalElement extends UmbModalBaseElement<UmbContentPickerDocumentRootQueryStepModalData> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
import type { ManifestDynamicRootOrigin, ManifestDynamicRootQueryStep } from '../dynamic-root.extension.js';
import {
UMB_CONTENT_PICKER_DOCUMENT_ROOT_ORIGIN_PICKER_MODAL_ALIAS,
UMB_CONTENT_PICKER_DOCUMENT_ROOT_QUERY_STEP_PICKER_MODAL_ALIAS,
} from './constants.js';
import type {
ManifestDynamicRootOrigin,
ManifestDynamicRootQueryStep,
} from '@umbraco-cms/backoffice/extension-registry';
import { UmbModalToken } from '@umbraco-cms/backoffice/modal';

export interface UmbContentPickerDocumentRootOriginModalData {
Expand Down
2 changes: 1 addition & 1 deletion src/packages/ufm/components/manifests.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { ManifestUfmComponent } from '@umbraco-cms/backoffice/extension-registry';
import type { ManifestUfmComponent } from '../ufm-component.extension.js';

export const manifests: Array<ManifestUfmComponent> = [
{
Expand Down
2 changes: 1 addition & 1 deletion src/packages/ufm/components/ufm-component-base.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { UfmToken } from '../plugins/marked-ufm.plugin.js';
import type { UmbUfmComponentApi } from '@umbraco-cms/backoffice/extension-registry';
import type { UmbUfmComponentApi } from '../ufm-component.extension.js';

export abstract class UmbUfmComponentBase implements UmbUfmComponentApi {
protected getAttributes(text: string): string | null {
Expand Down
3 changes: 2 additions & 1 deletion src/packages/ufm/contexts/ufm.context.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import { ufm } from '../plugins/marked-ufm.plugin.js';
import type { UfmPlugin } from '../plugins/marked-ufm.plugin.js';
import type { ManifestUfmComponent } from '../ufm-component.extension.js';
import type { ManifestUfmFilter } from '../ufm-filter.extension.js';
import { DOMPurify } from '@umbraco-cms/backoffice/external/dompurify';
import { Marked } from '@umbraco-cms/backoffice/external/marked';
import { UmbArrayState } from '@umbraco-cms/backoffice/observable-api';
import { UmbContextBase } from '@umbraco-cms/backoffice/class-api';
import { UmbContextToken } from '@umbraco-cms/backoffice/context-api';
import { UmbExtensionsApiInitializer } from '@umbraco-cms/backoffice/extension-api';
import { umbExtensionsRegistry } from '@umbraco-cms/backoffice/extension-registry';
import type { ManifestUfmFilter, ManifestUfmComponent } from '@umbraco-cms/backoffice/extension-registry';
import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api';
import type { UmbExtensionApiInitializer } from '@umbraco-cms/backoffice/extension-api';

Expand Down
2 changes: 1 addition & 1 deletion src/packages/ufm/filters/manifests.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { ManifestUfmFilter } from '@umbraco-cms/backoffice/extension-registry';
import type { ManifestUfmFilter } from '../ufm-filter.extension.js';

export const manifests: Array<ManifestUfmFilter> = [
{
Expand Down
2 changes: 2 additions & 0 deletions src/packages/ufm/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ export * from './types.js';
export * from './components/index.js';
export * from './contexts/index.js';
export * from './plugins/index.js';
export * from './ufm-component.extension.js';
export * from './ufm-filter.extension.js';
2 changes: 1 addition & 1 deletion src/packages/ufm/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { UmbUfmFilterApi } from '@umbraco-cms/backoffice/extension-registry';
import type { UmbUfmFilterApi } from './ufm-filter.extension.js';

export abstract class UmbUfmFilterBase implements UmbUfmFilterApi {
abstract filter(...args: Array<unknown>): string | undefined | null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,9 @@ export interface ManifestUfmComponent extends ManifestApi<UmbUfmComponentApi> {
type: 'ufmComponent';
meta: MetaUfmComponent;
}

declare global {
interface UmbExtensionManifestMap {
umbUfmComponent: ManifestUfmComponent;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,9 @@ export interface ManifestUfmFilter extends ManifestApi<UmbUfmFilterApi> {
type: 'ufmFilter';
meta: MetaUfmFilter;
}

declare global {
interface UmbExtensionManifestMap {
umbUfmFilter: ManifestUfmFilter;
}
}
Loading