Adds tiptapExtension manifest type
This commit is contained in:
@@ -42,6 +42,7 @@ import type { ManifestSectionView } from './section-view.model.js';
|
||||
import type { ManifestStore, ManifestTreeStore, ManifestItemStore } from './store.model.js';
|
||||
import type { ManifestTheme } from './theme.model.js';
|
||||
import type { ManifestTinyMcePlugin } from './tinymce-plugin.model.js';
|
||||
import type { ManifestTiptapExtension } from './tiptap-extension.model.js';
|
||||
import type { ManifestTree } from './tree.model.js';
|
||||
import type { ManifestTreeItem } from './tree-item.model.js';
|
||||
import type { ManifestUfmComponent } from './ufm-component.model.js';
|
||||
@@ -113,6 +114,7 @@ export type * from './section.model.js';
|
||||
export type * from './store.model.js';
|
||||
export type * from './theme.model.js';
|
||||
export type * from './tinymce-plugin.model.js';
|
||||
export type * from './tiptap-extension.model.js';
|
||||
export type * from './tree-item.model.js';
|
||||
export type * from './tree.model.js';
|
||||
export type * from './ufm-component.model.js';
|
||||
@@ -206,6 +208,7 @@ export type ManifestTypes =
|
||||
| ManifestStore
|
||||
| ManifestTheme
|
||||
| ManifestTinyMcePlugin
|
||||
| ManifestTiptapExtension
|
||||
| ManifestTree
|
||||
| ManifestTreeItem
|
||||
| ManifestTreeStore
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
import type { UmbTiptapExtensionBase } from '@umbraco-cms/backoffice/tiptap';
|
||||
import type { ManifestApi } from '@umbraco-cms/backoffice/extension-api';
|
||||
|
||||
export interface ManifestTiptapExtension extends ManifestApi<UmbTiptapExtensionBase> {
|
||||
type: 'tiptapExtension';
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
import { manifests as tiptapManifests } from './tiptap/manifests.js';
|
||||
import type { ManifestTypes } from '@umbraco-cms/backoffice/extension-registry';
|
||||
|
||||
export const manifests = [...tiptapManifests];
|
||||
export const manifests: Array<ManifestTypes> = [...tiptapManifests];
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
export * from './input-tiptap.element.js';
|
||||
export * from './tiptap-extension.js';
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
import { UmbControllerBase } from '@umbraco-cms/backoffice/class-api';
|
||||
import type { Editor, Extension, Mark, Node } from '@umbraco-cms/backoffice/external/tiptap';
|
||||
import type { TemplateResult } from '@umbraco-cms/backoffice/external/lit';
|
||||
import type { UmbApi } from '@umbraco-cms/backoffice/extension-api';
|
||||
import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api';
|
||||
|
||||
export abstract class UmbTiptapExtensionBase extends UmbControllerBase implements UmbApi {
|
||||
constructor(host: UmbControllerHost) {
|
||||
super(host);
|
||||
}
|
||||
|
||||
abstract getExtensions(): Array<Extension | Mark | Node>;
|
||||
|
||||
abstract getToolbarButtons(): Array<UmbTiptapToolbarButton>;
|
||||
}
|
||||
|
||||
export interface UmbTiptapToolbarButton {
|
||||
name: string;
|
||||
icon: string | TemplateResult;
|
||||
isActive: (editor?: Editor) => boolean | undefined;
|
||||
command: (editor?: Editor) => boolean | undefined | void | Promise<boolean> | Promise<undefined> | Promise<void>;
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
export * from './components/index.js';
|
||||
Reference in New Issue
Block a user