From 6d5c1c40e194597cedf88e62ce6868bf053d6fd3 Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Sat, 18 Apr 2026 16:30:14 +0000 Subject: [PATCH 1/5] Changes Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com> --- src/components/forms/custom-form-builder.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/forms/custom-form-builder.tsx b/src/components/forms/custom-form-builder.tsx index eeedc0b..ca0e67b 100644 --- a/src/components/forms/custom-form-builder.tsx +++ b/src/components/forms/custom-form-builder.tsx @@ -4,6 +4,7 @@ import StarterKit from "@tiptap/starter-kit"; import Underline from "@tiptap/extension-underline"; import TextAlign from "@tiptap/extension-text-align"; import Paragraph from "@tiptap/extension-paragraph"; +import Heading from "@tiptap/extension-heading"; import { Table } from "@tiptap/extension-table"; import { TableRow } from "@tiptap/extension-table-row"; import { TableCell } from "@tiptap/extension-table-cell"; From a4432f126c894576431a74d126f7fb65a2c88956 Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Sat, 18 Apr 2026 16:30:25 +0000 Subject: [PATCH 2/5] Changes Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com> --- src/components/forms/custom-form-builder.tsx | 23 +++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) 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" }, From b19a3b44094b614c11c1092d4a190614fa8eed74 Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Sat, 18 Apr 2026 16:30:37 +0000 Subject: [PATCH 3/5] Changes Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com> --- src/components/forms/custom-form-builder.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/components/forms/custom-form-builder.tsx b/src/components/forms/custom-form-builder.tsx index 1ba1bda..b6fddef 100644 --- a/src/components/forms/custom-form-builder.tsx +++ b/src/components/forms/custom-form-builder.tsx @@ -144,6 +144,8 @@ const PaddedHeading = Heading.extend({ }; }, }); + +const FONT_FAMILIES = [ { 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" }, From a14b1772caff5117ae8c52680e211163c5749289 Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Sat, 18 Apr 2026 16:30:45 +0000 Subject: [PATCH 4/5] Changes Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com> --- src/components/forms/custom-form-builder.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/forms/custom-form-builder.tsx b/src/components/forms/custom-form-builder.tsx index b6fddef..638baf8 100644 --- a/src/components/forms/custom-form-builder.tsx +++ b/src/components/forms/custom-form-builder.tsx @@ -292,8 +292,9 @@ export function CustomFormBuilder() { const editor = useEditor({ extensions: [ - StarterKit.configure({ heading: { levels: [1, 2, 3] }, paragraph: false }), + StarterKit.configure({ heading: false, paragraph: false }), PaddedParagraph, + PaddedHeading.configure({ levels: [1, 2, 3] }), Underline, TextAlign.configure({ types: ["heading", "paragraph"] }), Table.configure({ resizable: true, HTMLAttributes: { class: "cf-table" } }), From 1377af9576d1d80f08e49a794622d39b28eedab3 Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Sat, 18 Apr 2026 16:31:00 +0000 Subject: [PATCH 5/5] Changes Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com> --- src/components/forms/custom-form-builder.tsx | 28 +++++++++++++++++--- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/src/components/forms/custom-form-builder.tsx b/src/components/forms/custom-form-builder.tsx index 638baf8..b135bb9 100644 --- a/src/components/forms/custom-form-builder.tsx +++ b/src/components/forms/custom-form-builder.tsx @@ -356,19 +356,39 @@ export function CustomFormBuilder() { const INDENT_STEP = 36; // ~0.5" + const activeIndentNode = (): "heading" | "paragraph" | null => { + if (!editor) return null; + if (editor.isActive("heading")) return "heading"; + if (editor.isActive("paragraph")) return "paragraph"; + return null; + }; + const indent = () => { if (!editor) return; - const cur = Number(editor.getAttributes("paragraph").indent ?? 0); - editor.chain().focus().updateAttributes("paragraph", { indent: cur + INDENT_STEP }).run(); + // Lists: nest the item instead of changing padding + if (editor.isActive("listItem")) { + editor.chain().focus().sinkListItem("listItem").run(); + return; + } + const node = activeIndentNode(); + if (!node) return; + const cur = Number(editor.getAttributes(node).indent ?? 0); + editor.chain().focus().updateAttributes(node, { indent: cur + INDENT_STEP }).run(); }; const outdent = () => { if (!editor) return; - const cur = Number(editor.getAttributes("paragraph").indent ?? 0); + if (editor.isActive("listItem")) { + editor.chain().focus().liftListItem("listItem").run(); + return; + } + const node = activeIndentNode(); + if (!node) return; + const cur = Number(editor.getAttributes(node).indent ?? 0); editor .chain() .focus() - .updateAttributes("paragraph", { indent: Math.max(0, cur - INDENT_STEP) }) + .updateAttributes(node, { indent: Math.max(0, cur - INDENT_STEP) }) .run(); };