2024-12-20 21:35:42 +08:00
|
|
|
// Copyright (c) 2024-present AI-Labs
|
|
|
|
|
|
|
|
|
|
// @ ts-nocheck
|
|
|
|
|
import { Extensions } from "@tiptap/core";
|
|
|
|
|
import { UAIEditor, UAIEditorOptions } from "./UAIEditor";
|
|
|
|
|
|
|
|
|
|
import { StarterKit } from "@tiptap/starter-kit";
|
2024-12-21 20:15:22 +08:00
|
|
|
import { FontFamily } from "@tiptap/extension-font-family";
|
|
|
|
|
import { TextStyle } from "@tiptap/extension-text-style";
|
2024-12-20 21:35:42 +08:00
|
|
|
|
2024-12-21 20:15:22 +08:00
|
|
|
import FontSize from "../extensions/FontSize.ts";
|
2024-12-20 21:35:42 +08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 定义编辑器的所有自定义扩展组件
|
|
|
|
|
* @param uaiEditor
|
|
|
|
|
* @param _options
|
|
|
|
|
* @returns
|
|
|
|
|
*/
|
|
|
|
|
export const allExtensions = (uaiEditor: UAIEditor, _options: UAIEditorOptions): Extensions => {
|
|
|
|
|
let extensions: Extensions = [
|
|
|
|
|
StarterKit.configure({
|
|
|
|
|
bulletList: false,
|
|
|
|
|
orderedList: false,
|
|
|
|
|
}),
|
2024-12-21 20:15:22 +08:00
|
|
|
FontFamily,
|
|
|
|
|
FontSize.configure({
|
|
|
|
|
|
|
|
|
|
}),
|
|
|
|
|
TextStyle,
|
2024-12-20 21:35:42 +08:00
|
|
|
];
|
|
|
|
|
|
|
|
|
|
return extensions;
|
|
|
|
|
}
|