260702_01_ENH: 리스트 작업 도중 공용 ui를 적용하기 위한 중간 커밋

This commit is contained in:
2026-07-02 17:02:17 +09:00
parent 6944064377
commit a8ce35f5bf
111 changed files with 2833 additions and 2557 deletions

View File

@@ -3,7 +3,8 @@ import { Extension } from "@tiptap/core";
declare module "@tiptap/core" {
interface Commands<ReturnType> {
fontSize: {
setFontSize: (fontSize: string | null) => ReturnType;
setFontSize: (fontSize: string) => ReturnType;
unsetFontSize: () => ReturnType;
};
}
}
@@ -17,7 +18,7 @@ export const FontSize = Extension.create({
attributes: {
fontSize: {
default: null as string | null,
parseHTML: (element) => (element as HTMLElement).style.fontSize || null,
parseHTML: (element) => (element).style.fontSize || null,
renderHTML: (attributes) => {
if (!attributes.fontSize) return {};
return { style: `font-size:${attributes.fontSize}` };
@@ -33,11 +34,13 @@ export const FontSize = Extension.create({
setFontSize:
(fontSize) =>
({ chain }) => {
if (!fontSize) {
return chain().setMark("textStyle", { fontSize: null }).removeEmptyTextStyle().run();
}
return chain().setMark("textStyle", { fontSize }).run();
},
unsetFontSize:
() =>
({ chain }) => {
return chain().setMark("textStyle", { fontSize: null }).removeEmptyTextStyle().run();
},
};
},
});