diff --git a/src/components/forms/custom-form-builder.tsx b/src/components/forms/custom-form-builder.tsx index ca0e67b..1ba1bda 100644 --- a/src/components/forms/custom-form-builder.tsx +++ b/src/components/forms/custom-form-builder.tsx @@ -122,7 +122,28 @@ const PaddedParagraph = Paragraph.extend({ }, }); -const FONT_FAMILIES = [ +// Heading with same indent attribute so indent works on H1-H3 too +const PaddedHeading = Heading.extend({ + addAttributes() { + return { + ...this.parent?.(), + indent: { + default: 0, + parseHTML: (el) => { + const pl = (el as HTMLElement).style.paddingLeft; + if (!pl) return 0; + const n = parseInt(pl, 10); + return isNaN(n) ? 0 : n; + }, + renderHTML: (attrs) => { + const i = Number(attrs.indent ?? 0); + if (!i) return {}; + return { style: `padding-left: ${i}px` }; + }, + }, + }; + }, +}); { value: "Bookman Old Style", label: "Bookman Old Style", pdf: "times" }, { value: "Times New Roman", label: "Times New Roman", pdf: "times" }, { value: "Georgia", label: "Georgia", pdf: "times" },