feat: add imagevault images to RTE
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
import { InsertResponse } from "../components/imageVaultImage"
|
||||
import { RTEItemTypeEnum } from "./enums"
|
||||
import type { EmbedTypesEnum, RTEItemType } from "./enums"
|
||||
|
||||
import type { Lang } from "@/constants/languages"
|
||||
import type { EmbedTypesEnum, RTEItemType } from "./enums"
|
||||
|
||||
export interface Attributes {
|
||||
[key: string]: any
|
||||
@@ -36,3 +38,9 @@ export interface RTELinkAttrs extends Attributes {
|
||||
target: HTMLAnchorElement["target"]
|
||||
type: RTEItemTypeEnum.entry
|
||||
}
|
||||
|
||||
export interface RTEImageVaultAttrs extends Attributes, InsertResponse {
|
||||
height: string
|
||||
width: string
|
||||
style: string[]
|
||||
}
|
||||
|
||||
@@ -36,6 +36,7 @@ export enum RTETypeEnum {
|
||||
thead = "thead",
|
||||
tr = "tr",
|
||||
ul = "ul",
|
||||
ImageVault = "ImageVault",
|
||||
}
|
||||
|
||||
export type RTEType = keyof typeof RTETypeEnum
|
||||
|
||||
@@ -5,6 +5,7 @@ import type {
|
||||
Attributes,
|
||||
RTEAnchorAttrs,
|
||||
RTEAssetAttrs,
|
||||
RTEImageVaultAttrs,
|
||||
RTELinkAttrs,
|
||||
} from "./attrs"
|
||||
import type { RenderOptions } from "./option"
|
||||
@@ -36,6 +37,11 @@ export interface RTEReferenceLinkNode extends RTEDefaultNode {
|
||||
attrs: RTELinkAttrs
|
||||
}
|
||||
|
||||
export interface RTEImageVaultNode extends RTEDefaultNode {
|
||||
attrs: RTEImageVaultAttrs
|
||||
type: RTETypeEnum.ImageVault
|
||||
}
|
||||
|
||||
export enum RTEMarkType {
|
||||
bold = "bold",
|
||||
break = "break",
|
||||
@@ -58,9 +64,11 @@ export type RTETextNode = RTETextNodeOptionalKeys & {
|
||||
text: string
|
||||
}
|
||||
|
||||
export type RTERegularNode = RTEDefaultNode | RTEAnchorNode
|
||||
export type RTERegularNode = RTEDefaultNode | RTEAnchorNode | RTEImageVaultNode
|
||||
|
||||
export type RTEReferenceNode = RTEDefaultNode | RTEAnchorNode
|
||||
export type RTEImageNode = RTEDefaultNode | RTEImageVaultNode
|
||||
|
||||
export type RTEReferenceNode = RTEAnchorNode
|
||||
|
||||
export type RTENode = RTERegularNode | RTEReferenceNode | RTETextNode
|
||||
|
||||
|
||||
Reference in New Issue
Block a user