diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/common/create/create-option-action/default/entity-create-option-action.element.ts b/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/common/create/create-option-action/default/entity-create-option-action.element.ts deleted file mode 100644 index 5c926bbe3e..0000000000 --- a/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/common/create/create-option-action/default/entity-create-option-action.element.ts +++ /dev/null @@ -1,87 +0,0 @@ -import type { UmbEntityCreateOptionAction } from '../entity-create-option-action.interface.js'; -import type { UmbEntityCreateOptionActionElement } from '../entity-create-option-action-element.interface.js'; -import type { ManifestEntityCreateOptionAction } from '../entity-create-option-action.extension.js'; -import type { MetaEntityCreateOptionActionDefaultKind } from './types.js'; -import { UmbActionExecutedEvent } from '@umbraco-cms/backoffice/event'; -import { html, nothing, ifDefined, customElement, property, state } from '@umbraco-cms/backoffice/external/lit'; -import type { UUIMenuItemEvent } from '@umbraco-cms/backoffice/external/uui'; -import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element'; - -const elementName = 'umb-entity-create-option-action'; -@customElement(elementName) -export class UmbEntityCreateOptionActionDefaultElement< - MetaType extends MetaEntityCreateOptionActionDefaultKind = MetaEntityCreateOptionActionDefaultKind, - ApiType extends UmbEntityCreateOptionAction = UmbEntityCreateOptionAction, - > - extends UmbLitElement - implements UmbEntityCreateOptionActionElement -{ - #api?: ApiType; - - // TODO: Do these need to be properties? [NL] - @property({ type: String }) - entityType?: string | null; - - // TODO: Do these need to be properties? [NL] - @property({ type: String }) - public unique?: string | null; - - @property({ attribute: false }) - public manifest?: ManifestEntityCreateOptionAction; - - public set api(api: ApiType | undefined) { - this.#api = api; - - // TODO: Fix so when we use a HREF it does not refresh the page? - this.#api?.getHref?.().then((href) => { - this._href = href; - // TODO: Do we need to update the component here? [NL] - }); - } - - @state() - _href?: string; - - override async focus() { - await this.updateComplete; - this.shadowRoot?.querySelector('uui-menu-item')?.focus(); - } - - async #onClickLabel(event: UUIMenuItemEvent) { - if (!this._href) { - event.stopPropagation(); - await this.#api?.execute(); - } - this.dispatchEvent(new UmbActionExecutedEvent()); - } - - // TODO: we need to stop the regular click event from bubbling up to the table so it doesn't select the row. - // This should probably be handled in the UUI Menu item component. so we don't dispatch a label-click event and click event at the same time. - #onClick(event: PointerEvent) { - event.stopPropagation(); - } - - override render() { - const label = this.manifest?.meta.label ? this.localize.string(this.manifest.meta.label) : this.manifest?.name; - - return html` - - ${this.manifest?.meta.icon - ? html`` - : nothing} - - `; - } -} - -export { UmbEntityCreateOptionActionDefaultElement as element }; - -declare global { - interface HTMLElementTagNameMap { - [elementName]: UmbEntityCreateOptionActionDefaultElement; - } -} diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/common/create/create-option-action/default/index.ts b/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/common/create/create-option-action/default/index.ts deleted file mode 100644 index d4702960d5..0000000000 --- a/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/common/create/create-option-action/default/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './types.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/common/create/create-option-action/default/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/common/create/create-option-action/default/manifests.ts deleted file mode 100644 index b1b7de24bf..0000000000 --- a/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/common/create/create-option-action/default/manifests.ts +++ /dev/null @@ -1,20 +0,0 @@ -import type { UmbExtensionManifestKind } from '@umbraco-cms/backoffice/extension-registry'; - -export const manifests: Array = [ - { - type: 'kind', - alias: 'Umb.Kind.EntityCreateOptionAction.Default', - matchKind: 'default', - matchType: 'entityCreateOptionAction', - manifest: { - type: 'entityCreateOptionAction', - kind: 'default', - weight: 1000, - element: () => import('./entity-create-option-action.element.js'), - meta: { - icon: '', - label: 'Default Entity Create Option Action', - }, - }, - }, -]; diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/common/create/create-option-action/default/types.ts b/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/common/create/create-option-action/default/types.ts deleted file mode 100644 index 465664c91c..0000000000 --- a/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/common/create/create-option-action/default/types.ts +++ /dev/null @@ -1,44 +0,0 @@ -import type { - ManifestEntityCreateOptionAction, - MetaEntityCreateOptionAction, -} from '../entity-create-option-action.extension.js'; - -export interface ManifestEntityCreateOptionActionDefaultKind - extends ManifestEntityCreateOptionAction { - type: 'entityCreateOptionAction'; - kind: 'default'; -} - -export interface MetaEntityCreateOptionActionDefaultKind extends MetaEntityCreateOptionAction { - /** - * An icon to represent the action to be performed - * @examples [ - * "icon-box", - * "icon-grid" - * ] - */ - icon: string; - - /** - * The friendly name of the action to perform - * @examples [ - * "Create", - * "Create Content Template" - * ] - */ - label: string; - - /** - * The action requires additional input from the user. - * A dialog will prompt the user for more information or to make a choice. - * @type {boolean} - * @memberof MetaEntityCreateOptionActionDefaultKind - */ - additionalOptions?: boolean; -} - -declare global { - interface UmbExtensionManifestMap { - umbDefaultEntityCreateOptionActionKind: ManifestEntityCreateOptionActionDefaultKind; - } -} diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/common/create/create-option-action/entity-create-option-action-element.interface.ts b/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/common/create/create-option-action/entity-create-option-action-element.interface.ts deleted file mode 100644 index 6f2c9ab833..0000000000 --- a/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/common/create/create-option-action/entity-create-option-action-element.interface.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { UmbControllerHostElement } from '@umbraco-cms/backoffice/controller-api'; - -// eslint-disable-next-line @typescript-eslint/no-empty-object-type -export interface UmbEntityCreateOptionActionElement extends UmbControllerHostElement {} diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/common/create/create-option-action/entity-create-option-action.extension.ts b/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/common/create/create-option-action/entity-create-option-action.extension.ts index 9aff339da4..37341069c2 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/common/create/create-option-action/entity-create-option-action.extension.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/common/create/create-option-action/entity-create-option-action.extension.ts @@ -1,9 +1,9 @@ import type { UmbEntityCreateOptionAction } from './entity-create-option-action.interface.js'; -import type { ManifestElementAndApi, ManifestWithDynamicConditions } from '@umbraco-cms/backoffice/extension-api'; +import type { ManifestApi, ManifestWithDynamicConditions } from '@umbraco-cms/backoffice/extension-api'; export interface ManifestEntityCreateOptionAction< MetaType extends MetaEntityCreateOptionAction = MetaEntityCreateOptionAction, -> extends ManifestElementAndApi>, +> extends ManifestApi>, ManifestWithDynamicConditions { type: 'entityCreateOptionAction'; forEntityTypes: Array; diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/common/create/create-option-action/index.ts b/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/common/create/create-option-action/index.ts index 5eb9c9635d..f14590182c 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/common/create/create-option-action/index.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/common/create/create-option-action/index.ts @@ -1,12 +1,7 @@ import './global-components/index.js'; -export * from './default/index.js'; export * from './global-components/index.js'; - export * from './entity-create-option-action-base.js'; export * from './entity-create-option-action.extension.js'; export * from './entity-create-option-action.interface.js'; - -export type * from './entity-create-option-action-element.interface.js'; - export * from './types.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/common/create/create-option-action/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/common/create/create-option-action/manifests.ts deleted file mode 100644 index 43d020c74e..0000000000 --- a/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/common/create/create-option-action/manifests.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { manifests as defaultManifests } from './default/manifests.js'; -import type { UmbExtensionManifestKind } from '@umbraco-cms/backoffice/extension-registry'; - -export const manifests: Array = [...defaultManifests]; diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/common/create/create.action.ts b/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/common/create/create.action.ts index d96860c9b9..a912365d80 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/common/create/create.action.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/common/create/create.action.ts @@ -23,7 +23,7 @@ export class UmbCreateEntityAction extends UmbEntityActionBase { this.#hasSingleOption = actionOptions.length === 1; this.#singleActionOptionManifest = this.#hasSingleOption - ? (actionOptions[0].manifest as ManifestEntityCreateOptionAction) + ? (actionOptions[0].manifest as unknown as ManifestEntityCreateOptionAction) : undefined; }, 'umbEntityActionsObserver', diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/common/create/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/common/create/manifests.ts index 6aee3f93b6..d1e496f559 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/common/create/manifests.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/common/create/manifests.ts @@ -1,5 +1,4 @@ import { manifest as createKindManifest } from './create.action.kind.js'; import { manifests as modalManifests } from './modal/manifests.js'; -import { manifests as createOptionActionManifests } from './create-option-action/manifests.js'; -export const manifests = [createKindManifest, ...modalManifests, ...createOptionActionManifests]; +export const manifests = [createKindManifest, ...modalManifests];