251212_01_ENH : kri-editor 1차 완성, 프로젝트 정보 저장 api연동 완료

This commit is contained in:
2025-12-12 17:27:12 +09:00
parent 1080880fba
commit d9775c8a1d
46 changed files with 2124 additions and 1668 deletions

View File

@@ -1,5 +1,13 @@
import { Extension } from "@tiptap/core";
declare module "@tiptap/core" {
interface Commands<ReturnType> {
fontSize: {
setFontSize: (fontSize: string | null) => ReturnType;
};
}
}
export const FontSize = Extension.create({
name: "fontSize",
addGlobalAttributes() {
@@ -19,4 +27,17 @@ export const FontSize = Extension.create({
},
];
},
addCommands() {
return {
setFontSize:
(fontSize) =>
({ chain }) => {
if (!fontSize) {
return chain().setMark("textStyle", { fontSize: null }).removeEmptyTextStyle().run();
}
return chain().setMark("textStyle", { fontSize }).run();
},
};
},
});