diff --git a/packages/core/src/blocks/HeadingBlockContent/HeadingBlockContent.ts b/packages/core/src/blocks/HeadingBlockContent/HeadingBlockContent.ts
index 8299892a0..f008b53b1 100644
--- a/packages/core/src/blocks/HeadingBlockContent/HeadingBlockContent.ts
+++ b/packages/core/src/blocks/HeadingBlockContent/HeadingBlockContent.ts
@@ -10,9 +10,11 @@ import {
import { createDefaultBlockDOMOutputSpec } from "../defaultBlockHelpers.js";
import { defaultProps } from "../defaultProps.js";
+const HEADING_LEVELS = [1, 2, 3, 4, 5, 6] as const;
+
export const headingPropSchema = {
...defaultProps,
- level: { default: 1, values: [1, 2, 3] as const },
+ level: { default: 1, values: HEADING_LEVELS },
} satisfies PropSchema;
const HeadingBlockContent = createStronglyTypedTiptapNode({
@@ -26,7 +28,7 @@ const HeadingBlockContent = createStronglyTypedTiptapNode({
addInputRules() {
return [
- ...[1, 2, 3].map((level) => {
+ ...HEADING_LEVELS.map((level) => {
// Creates a heading of appropriate level when starting with "#", "##", or "###".
return new InputRule({
find: new RegExp(`^(#{${level}})\\s$`),
@@ -58,63 +60,29 @@ const HeadingBlockContent = createStronglyTypedTiptapNode({
},
addKeyboardShortcuts() {
- return {
- "Mod-Alt-1": () => {
- const blockInfo = getBlockInfoFromSelection(this.editor.state);
- if (
- !blockInfo.isBlockContainer ||
- blockInfo.blockContent.node.type.spec.content !== "inline*"
- ) {
- return true;
- }
-
- // call updateBlockCommand
- return this.editor.commands.command(
- updateBlockCommand(blockInfo.bnBlock.beforePos, {
- type: "heading",
- props: {
- level: 1 as any,
- },
- }),
- );
- },
- "Mod-Alt-2": () => {
- const blockInfo = getBlockInfoFromSelection(this.editor.state);
- if (
- !blockInfo.isBlockContainer ||
- blockInfo.blockContent.node.type.spec.content !== "inline*"
- ) {
- return true;
- }
-
- return this.editor.commands.command(
- updateBlockCommand(blockInfo.bnBlock.beforePos, {
- type: "heading",
- props: {
- level: 2 as any,
- },
- }),
- );
- },
- "Mod-Alt-3": () => {
- const blockInfo = getBlockInfoFromSelection(this.editor.state);
- if (
- !blockInfo.isBlockContainer ||
- blockInfo.blockContent.node.type.spec.content !== "inline*"
- ) {
- return true;
- }
+ return Object.fromEntries(
+ HEADING_LEVELS.map((level) => [
+ `Mod-Alt-${level}`,
+ () => {
+ const blockInfo = getBlockInfoFromSelection(this.editor.state);
+ if (
+ !blockInfo.isBlockContainer ||
+ blockInfo.blockContent.node.type.spec.content !== "inline*"
+ ) {
+ return true;
+ }
- return this.editor.commands.command(
- updateBlockCommand(blockInfo.bnBlock.beforePos, {
- type: "heading",
- props: {
- level: 3 as any,
- },
- }),
- );
- },
- };
+ return this.editor.commands.command(
+ updateBlockCommand(blockInfo.bnBlock.beforePos, {
+ type: "heading",
+ props: {
+ level: level as any,
+ },
+ })
+ );
+ },
+ ])
+ );
},
parseHTML() {
return [
@@ -123,22 +91,11 @@ const HeadingBlockContent = createStronglyTypedTiptapNode({
tag: "div[data-content-type=" + this.name + "]",
contentElement: ".bn-inline-content",
},
- // Parse from external HTML.
- {
- tag: "h1",
- attrs: { level: 1 },
+ ...HEADING_LEVELS.map((level) => ({
+ tag: `h${level}`,
+ attrs: { level },
node: "heading",
- },
- {
- tag: "h2",
- attrs: { level: 2 },
- node: "heading",
- },
- {
- tag: "h3",
- attrs: { level: 3 },
- node: "heading",
- },
+ })),
];
},
diff --git a/packages/core/src/editor/Block.css b/packages/core/src/editor/Block.css
index 8d8437a16..e000e955b 100644
--- a/packages/core/src/editor/Block.css
+++ b/packages/core/src/editor/Block.css
@@ -134,6 +134,15 @@ NESTED BLOCKS
[data-content-type="heading"][data-level="3"] {
--level: 1.3em;
}
+[data-content-type="heading"][data-level="4"] {
+ --level: 1em;
+}
+[data-content-type="heading"][data-level="5"] {
+ --level: 0.9em;
+}
+[data-content-type="heading"][data-level="6"] {
+ --level: 0.8em;
+}
[data-prev-level="1"] {
--prev-level: 3em;
@@ -144,6 +153,15 @@ NESTED BLOCKS
[data-prev-level="3"] {
--prev-level: 1.3em;
}
+[data-prev-level="4"] {
+ --prev-level: 1em;
+}
+[data-prev-level="5"] {
+ --prev-level: 0.9em;
+}
+[data-prev-level="6"] {
+ --prev-level: 0.8em;
+}
.bn-block-outer[data-prev-type="heading"] > .bn-block > .bn-block-content {
font-size: var(--prev-level);
diff --git a/packages/core/src/editor/editor.css b/packages/core/src/editor/editor.css
index 3c5871b89..eb267a7b5 100644
--- a/packages/core/src/editor/editor.css
+++ b/packages/core/src/editor/editor.css
@@ -44,6 +44,9 @@ Tippy popups that are appended to document.body directly
.bn-default-styles h1,
.bn-default-styles h2,
.bn-default-styles h3,
+.bn-default-styles h4,
+.bn-default-styles h5,
+.bn-default-styles h6,
.bn-default-styles li {
margin: 0;
padding: 0;
diff --git a/packages/core/src/i18n/locales/ar.ts b/packages/core/src/i18n/locales/ar.ts
index 4cdaa0b47..d4b420bc3 100644
--- a/packages/core/src/i18n/locales/ar.ts
+++ b/packages/core/src/i18n/locales/ar.ts
@@ -20,6 +20,24 @@ export const ar: Dictionary = {
aliases: ["ع3", "عنوان3", "عنوان فرعي"],
group: "العناوين",
},
+ heading_4: {
+ title: "عنوان 4",
+ subtext: "عنوان فرعي ثانوي صغير",
+ aliases: ["ع4", "عنوان4", "عنوان فرعي صغير"],
+ group: "العناوين",
+ },
+ heading_5: {
+ title: "عنوان 5",
+ subtext: "عنوان فرعي صغير",
+ aliases: ["ع5", "عنوان5", "عنوان فرعي صغير"],
+ group: "العناوين",
+ },
+ heading_6: {
+ title: "عنوان 6",
+ subtext: "أدنى مستوى للعناوين",
+ aliases: ["ع6", "عنوان6", "العنوان الفرعي الأدنى"],
+ group: "العناوين",
+ },
quote: {
title: "اقتباس",
subtext: "اقتباس أو مقتطف",
diff --git a/packages/core/src/i18n/locales/de.ts b/packages/core/src/i18n/locales/de.ts
index d80ef907c..21784124a 100644
--- a/packages/core/src/i18n/locales/de.ts
+++ b/packages/core/src/i18n/locales/de.ts
@@ -20,6 +20,24 @@ export const de: Dictionary = {
aliases: ["h3", "überschrift3", "unterüberschrift"],
group: "Überschriften",
},
+ heading_4: {
+ title: "Überschrift 4",
+ subtext: "Überschrift für kleinere Unterabschnitte",
+ aliases: ["h4", "überschrift4", "unterüberschrift4"],
+ group: "Überschriften",
+ },
+ heading_5: {
+ title: "Überschrift 5",
+ subtext: "Überschrift für tiefere Unterabschnitte",
+ aliases: ["h5", "überschrift5", "unterüberschrift5"],
+ group: "Überschriften",
+ },
+ heading_6: {
+ title: "Überschrift 6",
+ subtext: "Überschrift auf der untersten Ebene",
+ aliases: ["h6", "überschrift6", "unterüberschrift6"],
+ group: "Überschriften",
+ },
quote: {
title: "Zitat",
subtext: "Zitat oder Auszug",
diff --git a/packages/core/src/i18n/locales/en.ts b/packages/core/src/i18n/locales/en.ts
index 162fbf40c..4902c8254 100644
--- a/packages/core/src/i18n/locales/en.ts
+++ b/packages/core/src/i18n/locales/en.ts
@@ -18,6 +18,24 @@ export const en = {
aliases: ["h3", "heading3", "subheading"],
group: "Headings",
},
+ heading_4: {
+ title: "Heading 4",
+ subtext: "Minor subsection heading",
+ aliases: ["h4", "heading4", "subheading4"],
+ group: "Headings",
+ },
+ heading_5: {
+ title: "Heading 5",
+ subtext: "Small subsection heading",
+ aliases: ["h5", "heading5", "subheading5"],
+ group: "Headings",
+ },
+ heading_6: {
+ title: "Heading 6",
+ subtext: "Lowest-level heading",
+ aliases: ["h6", "heading6", "subheading6"],
+ group: "Headings",
+ },
quote: {
title: "Quote",
subtext: "Quote or excerpt",
diff --git a/packages/core/src/i18n/locales/es.ts b/packages/core/src/i18n/locales/es.ts
index 9444beaa9..68cd4b7ac 100644
--- a/packages/core/src/i18n/locales/es.ts
+++ b/packages/core/src/i18n/locales/es.ts
@@ -20,6 +20,24 @@ export const es: Dictionary = {
aliases: ["h3", "encabezado3", "subencabezado"],
group: "Encabezados",
},
+ heading_4: {
+ title: "Encabezado 4",
+ subtext: "Encabezado de subsección menor",
+ aliases: ["h4", "encabezado4", "subencabezado4"],
+ group: "Encabezados",
+ },
+ heading_5: {
+ title: "Encabezado 5",
+ subtext: "Encabezado de subsección pequeña",
+ aliases: ["h5", "encabezado5", "subencabezado5"],
+ group: "Encabezados",
+ },
+ heading_6: {
+ title: "Encabezado 6",
+ subtext: "Encabezado de nivel más bajo",
+ aliases: ["h6", "encabezado6", "subencabezado6"],
+ group: "Encabezados",
+ },
quote: {
title: "Cita",
subtext: "Cita o extracto",
diff --git a/packages/core/src/i18n/locales/fr.ts b/packages/core/src/i18n/locales/fr.ts
index 3969b0e33..dad638872 100644
--- a/packages/core/src/i18n/locales/fr.ts
+++ b/packages/core/src/i18n/locales/fr.ts
@@ -21,6 +21,24 @@ export const fr: Dictionary = {
aliases: ["h3", "titre3", "sous-titre"],
group: "Titres",
},
+ heading_4: {
+ title: "Titre 4",
+ subtext: "Titre de sous‑section mineure",
+ aliases: ["h4", "titre4", "sous‑titre4"],
+ group: "Titres",
+ },
+ heading_5: {
+ title: "Titre 5",
+ subtext: "Titre de sous-section mineure",
+ aliases: ["h5", "titre5", "sous-titre5"],
+ group: "Titres",
+ },
+ heading_6: {
+ title: "Titre 6",
+ subtext: "Titre de niveau le plus bas",
+ aliases: ["h6", "titre6", "sous-titre6"],
+ group: "Titres",
+ },
quote: {
title: "Citation",
subtext: "Citation ou extrait",
diff --git a/packages/core/src/i18n/locales/hr.ts b/packages/core/src/i18n/locales/hr.ts
index c558d42ed..d0ad3abd9 100644
--- a/packages/core/src/i18n/locales/hr.ts
+++ b/packages/core/src/i18n/locales/hr.ts
@@ -20,6 +20,24 @@ export const hr: Dictionary = {
aliases: ["h3", "naslov3", "podnaslov"],
group: "Naslovi",
},
+ heading_4: {
+ title: "Naslov 4",
+ subtext: "Manji naslov podpoglavlja",
+ aliases: ["h4", "naslov4", "podnaslov4"],
+ group: "Naslovi",
+ },
+ heading_5: {
+ title: "Naslov 5",
+ subtext: "Mali naslov podpoglavlja",
+ aliases: ["h5", "naslov5", "podnaslov5"],
+ group: "Naslovi",
+ },
+ heading_6: {
+ title: "Naslov 6",
+ subtext: "Naslov najniže razine",
+ aliases: ["h6", "naslov6", "podnaslov6"],
+ group: "Naslovi",
+ },
quote: {
title: "Citat",
subtext: "Citat ili izvadak",
diff --git a/packages/core/src/i18n/locales/is.ts b/packages/core/src/i18n/locales/is.ts
index 780da27a9..13bf05d07 100644
--- a/packages/core/src/i18n/locales/is.ts
+++ b/packages/core/src/i18n/locales/is.ts
@@ -20,6 +20,24 @@ export const is: Dictionary = {
aliases: ["h3", "fyrirsogn3", "undirfyrirsogn"],
group: "Fyrirsagnir",
},
+ heading_4: {
+ title: "Fyrirsögn 4",
+ subtext: "Titill fyrir minni undirhluta",
+ aliases: ["h4", "fyrirsogn4", "undirfyrirsogn4"],
+ group: "Fyrirsagnir",
+ },
+ heading_5: {
+ title: "Fyrirsögn 5",
+ subtext: "Titill fyrir litla undirkafla",
+ aliases: ["h5", "fyrirsogn5", "undirfyrirsogn5"],
+ group: "Fyrirsagnir",
+ },
+ heading_6: {
+ title: "Fyrirsögn 6",
+ subtext: "Titill á lægsta stigi",
+ aliases: ["h6", "fyrirsogn6", "undirfyrirsogn6"],
+ group: "Fyrirsagnir",
+ },
quote: {
title: "Tilvitnun",
subtext: "Tilvitnun eða útdráttur",
diff --git a/packages/core/src/i18n/locales/it.ts b/packages/core/src/i18n/locales/it.ts
index c48a5e27e..25f0fc958 100644
--- a/packages/core/src/i18n/locales/it.ts
+++ b/packages/core/src/i18n/locales/it.ts
@@ -20,6 +20,24 @@ export const it: Dictionary = {
aliases: ["h3", "intestazione3", "sottotitolo"],
group: "Intestazioni",
},
+ heading_4: {
+ title: "Intestazione 4",
+ subtext: "Intestazione di sottosezione minore",
+ aliases: ["h4", "intestazione4", "sottotitolo4"],
+ group: "Intestazioni",
+ },
+ heading_5: {
+ title: "Intestazione 5",
+ subtext: "Intestazione di sottosezione minore",
+ aliases: ["h5", "intestazione5", "sottotitolo5"],
+ group: "Intestazioni",
+ },
+ heading_6: {
+ title: "Intestazione 6",
+ subtext: "Intestazione di livello più basso",
+ aliases: ["h6", "intestazione6", "sottotitolo6"],
+ group: "Intestazioni",
+ },
quote: {
title: "Citazione",
subtext: "Citazione o estratto",
diff --git a/packages/core/src/i18n/locales/ja.ts b/packages/core/src/i18n/locales/ja.ts
index ca6550144..d2fcddd42 100644
--- a/packages/core/src/i18n/locales/ja.ts
+++ b/packages/core/src/i18n/locales/ja.ts
@@ -20,6 +20,24 @@ export const ja: Dictionary = {
aliases: ["h3", "見出し3", "subheading", "小見出し"],
group: "見出し",
},
+ heading_4: {
+ title: "見出し4",
+ subtext: "小さなサブセクションの見出しに使用",
+ aliases: ["h4", "見出し4", "subheading4", "小見出し4"],
+ group: "見出し",
+ },
+ heading_5: {
+ title: "見出し5",
+ subtext: "小さなサブセクションの見出しに使用",
+ aliases: ["h5", "見出し5", "subheading5", "小見出し5"],
+ group: "見出し",
+ },
+ heading_6: {
+ title: "見出し6",
+ subtext: "最下位レベルの見出しに使用",
+ aliases: ["h6", "見出し6", "subheading6", "小見出し6"],
+ group: "見出し",
+ },
quote: {
title: "引用",
subtext: "引用または抜粋",
diff --git a/packages/core/src/i18n/locales/ko.ts b/packages/core/src/i18n/locales/ko.ts
index ffaf5ee24..877b73e1a 100644
--- a/packages/core/src/i18n/locales/ko.ts
+++ b/packages/core/src/i18n/locales/ko.ts
@@ -20,6 +20,24 @@ export const ko: Dictionary = {
aliases: ["h3", "제목3", "subheading"],
group: "제목",
},
+ heading_4: {
+ title: "제목4",
+ subtext: "하위 소단락 제목",
+ aliases: ["h4", "제목4", "소제목4"],
+ group: "제목",
+ },
+ heading_5: {
+ title: "제목5",
+ subtext: "작은 하위 섹션 제목",
+ aliases: ["h5", "제목5", "소제목5"],
+ group: "제목",
+ },
+ heading_6: {
+ title: "제목6",
+ subtext: "가장 하위 수준 제목",
+ aliases: ["h6", "제목6", "소제목6"],
+ group: "제목",
+ },
quote: {
title: "인용",
subtext: "인용문 또는 발췌",
diff --git a/packages/core/src/i18n/locales/nl.ts b/packages/core/src/i18n/locales/nl.ts
index 83110200e..0536bdd44 100644
--- a/packages/core/src/i18n/locales/nl.ts
+++ b/packages/core/src/i18n/locales/nl.ts
@@ -20,6 +20,24 @@ export const nl: Dictionary = {
aliases: ["h3", "kop3", "subkop"],
group: "Koppen",
},
+ heading_4: {
+ title: "Kop 4",
+ subtext: "Gebruikt voor kleinere subsecties",
+ aliases: ["h4", "kop4", "subkop4"],
+ group: "Koppen",
+ },
+ heading_5: {
+ title: "Kop 5",
+ subtext: "Gebruikt voor kleinere subsecties",
+ aliases: ["h5", "kop5", "subkop5"],
+ group: "Koppen",
+ },
+ heading_6: {
+ title: "Kop 6",
+ subtext: "Gebruikt voor koppen op het laagste niveau",
+ aliases: ["h6", "kop6", "subkop6"],
+ group: "Koppen",
+ },
quote: {
title: "Citaat",
subtext: "Citaat of uittreksel",
diff --git a/packages/core/src/i18n/locales/no.ts b/packages/core/src/i18n/locales/no.ts
index f8c045481..43f88b291 100644
--- a/packages/core/src/i18n/locales/no.ts
+++ b/packages/core/src/i18n/locales/no.ts
@@ -20,6 +20,24 @@ export const no: Dictionary = {
aliases: ["h3", "overskrift3", "underoverskrift"],
group: "Overskrifter",
},
+ heading_4: {
+ title: "Overskrift 4",
+ subtext: "Underoverskrift for mindre underseksjoner",
+ aliases: ["h4", "overskrift4", "underoverskrift4"],
+ group: "Overskrifter",
+ },
+ heading_5: {
+ title: "Overskrift 5",
+ subtext: "Overskrift for mindre underseksjoner",
+ aliases: ["h5", "overskrift5", "underoverskrift5"],
+ group: "Overskrifter",
+ },
+ heading_6: {
+ title: "Overskrift 6",
+ subtext: "Overskrift på laveste nivå",
+ aliases: ["h6", "overskrift6", "underoverskrift6"],
+ group: "Overskrifter",
+ },
quote: {
title: "Sitat",
subtext: "Sitat eller utdrag",
diff --git a/packages/core/src/i18n/locales/pl.ts b/packages/core/src/i18n/locales/pl.ts
index 43b9f9bea..9a4ae215d 100644
--- a/packages/core/src/i18n/locales/pl.ts
+++ b/packages/core/src/i18n/locales/pl.ts
@@ -20,6 +20,24 @@ export const pl: Dictionary = {
aliases: ["h3", "naglowek3", "podnaglowek"],
group: "Nagłówki",
},
+ heading_4: {
+ title: "Nagłówek 4",
+ subtext: "Nagłówek mniejszej podsekcji",
+ aliases: ["h4", "naglowek4", "podnaglowek4"],
+ group: "Nagłówki",
+ },
+ heading_5: {
+ title: "Nagłówek 5",
+ subtext: "Nagłówek mniejszej podsekcji",
+ aliases: ["h5", "naglowek5", "podnaglowek5"],
+ group: "Nagłówki",
+ },
+ heading_6: {
+ title: "Nagłówek 6",
+ subtext: "Nagłówek najniższego poziomu",
+ aliases: ["h6", "naglowek6", "podnaglowek6"],
+ group: "Nagłówki",
+ },
quote: {
title: "Cytat",
subtext: "Cytat lub fragment",
diff --git a/packages/core/src/i18n/locales/pt.ts b/packages/core/src/i18n/locales/pt.ts
index 88212d62f..b7ce0aaec 100644
--- a/packages/core/src/i18n/locales/pt.ts
+++ b/packages/core/src/i18n/locales/pt.ts
@@ -20,6 +20,24 @@ export const pt: Dictionary = {
aliases: ["h3", "titulo3", "subtitulo"],
group: "Títulos",
},
+ heading_4: {
+ title: "Título 4",
+ subtext: "Usado para subseções menores",
+ aliases: ["h4", "titulo4", "subtitulo4"],
+ group: "Títulos",
+ },
+ heading_5: {
+ title: "Título 5",
+ subtext: "Usado para títulos de subseções pequenas",
+ aliases: ["h5", "titulo5", "subtitulo5"],
+ group: "Títulos",
+ },
+ heading_6: {
+ title: "Título 6",
+ subtext: "Usado para títulos de nível mais baixo",
+ aliases: ["h6", "titulo6", "subtitulo6"],
+ group: "Títulos",
+ },
quote: {
title: "Citação",
subtext: "Citação ou trecho",
diff --git a/packages/core/src/i18n/locales/ru.ts b/packages/core/src/i18n/locales/ru.ts
index c43d766dd..a875dc9a3 100644
--- a/packages/core/src/i18n/locales/ru.ts
+++ b/packages/core/src/i18n/locales/ru.ts
@@ -20,6 +20,24 @@ export const ru: Dictionary = {
aliases: ["h3", "heading3", "subheading", "заголовок3", "подзаголовок"],
group: "Заголовки",
},
+ heading_4: {
+ title: "Заголовок 4 уровня",
+ subtext: "Используется для более мелких подразделов",
+ aliases: ["h4", "heading4", "subheading4", "заголовок4", "подзаголовок4"],
+ group: "Заголовки",
+ },
+ heading_5: {
+ title: "Заголовок 5 уровня",
+ subtext: "Используется для заголовков небольших подразделов",
+ aliases: ["h5", "heading5", "subheading5", "заголовок5", "подзаголовок5"],
+ group: "Заголовки",
+ },
+ heading_6: {
+ title: "Заголовок 6 уровня",
+ subtext: "Используется для заголовков самого низкого уровня",
+ aliases: ["h6", "heading6", "subheading6", "заголовок6", "подзаголовок6"],
+ group: "Заголовки",
+ },
quote: {
title: "Цитата",
subtext: "Цитата или отрывок",
diff --git a/packages/core/src/i18n/locales/uk.ts b/packages/core/src/i18n/locales/uk.ts
index 6dbb8c696..dc73c284d 100644
--- a/packages/core/src/i18n/locales/uk.ts
+++ b/packages/core/src/i18n/locales/uk.ts
@@ -20,6 +20,24 @@ export const uk: Dictionary = {
aliases: ["h3", "heading3", "subheading", "заголовок3"],
group: "Заголовки",
},
+ heading_4: {
+ title: "Заголовок 4",
+ subtext: "Використовується для менших підрозділів",
+ aliases: ["h4", "heading4", "subheading4", "заголовок4"],
+ group: "Заголовки",
+ },
+ heading_5: {
+ title: "Заголовок 5",
+ subtext: "Використовується для заголовків менших підрозділів",
+ aliases: ["h5", "heading5", "subheading5", "заголовок5", "підзаголовок5"],
+ group: "Заголовки",
+ },
+ heading_6: {
+ title: "Заголовок 6",
+ subtext: "Використовується для заголовків найнижчого рівня",
+ aliases: ["h6", "heading6", "subheading6", "заголовок6", "підзаголовок6"],
+ group: "Заголовки",
+ },
quote: {
title: "Цитата",
subtext: "Цитата або уривок",
diff --git a/packages/core/src/i18n/locales/vi.ts b/packages/core/src/i18n/locales/vi.ts
index 13ac0048a..94d20d8e1 100644
--- a/packages/core/src/i18n/locales/vi.ts
+++ b/packages/core/src/i18n/locales/vi.ts
@@ -20,6 +20,24 @@ export const vi: Dictionary = {
aliases: ["h3", "tieude3", "tieudephu"],
group: "Tiêu đề",
},
+ heading_4: {
+ title: "Tiêu đề H4",
+ subtext: "Sử dụng cho tiêu đề phụ nhỏ hơn",
+ aliases: ["h4", "tieude4", "tieudephu4"],
+ group: "Tiêu đề",
+ },
+ heading_5: {
+ title: "Tiêu đề H5",
+ subtext: "Sử dụng cho tiêu đề phụ nhỏ hơn",
+ aliases: ["h5", "tieude5", "tieudephu5"],
+ group: "Tiêu đề",
+ },
+ heading_6: {
+ title: "Tiêu đề H6",
+ subtext: "Sử dụng cho tiêu đề cấp thấp nhất",
+ aliases: ["h6", "tieude6", "tieudephu6"],
+ group: "Tiêu đề",
+ },
quote: {
title: "Trích dẫn",
subtext: "Trích dẫn hoặc đoạn trích",
diff --git a/packages/core/src/i18n/locales/zh-tw.ts b/packages/core/src/i18n/locales/zh-tw.ts
index c39906033..e1a042fad 100644
--- a/packages/core/src/i18n/locales/zh-tw.ts
+++ b/packages/core/src/i18n/locales/zh-tw.ts
@@ -20,6 +20,24 @@ export const zhTW: Dictionary = {
aliases: ["h3", "heading3", "subheading", "標題", "三級標題"],
group: "標題",
},
+ heading_4: {
+ title: "四級標題",
+ subtext: "用於小節和分組標題",
+ aliases: ["h4", "heading4", "subheading", "標題", "四級標題"],
+ group: "標題",
+ },
+ heading_5: {
+ title: "五級標題",
+ subtext: "用於小節和分組標題",
+ aliases: ["h5", "heading5", "subheading", "標題", "五級標題"],
+ group: "標題",
+ },
+ heading_6: {
+ title: "六級標題",
+ subtext: "用於小節和分組標題",
+ aliases: ["h6", "heading6", "subheading", "標題", "六級標題"],
+ group: "標題",
+ },
quote: {
title: "引用",
subtext: "引用或摘錄",
diff --git a/packages/core/src/i18n/locales/zh.ts b/packages/core/src/i18n/locales/zh.ts
index a7a934fd1..bffae742d 100644
--- a/packages/core/src/i18n/locales/zh.ts
+++ b/packages/core/src/i18n/locales/zh.ts
@@ -20,6 +20,24 @@ export const zh: Dictionary = {
aliases: ["h3", "heading3", "subheading", "标题", "三级标题"],
group: "标题",
},
+ heading_4: {
+ title: "四级标题",
+ subtext: "用于较小的子节标题",
+ aliases: ["h4", "heading4", "subheading4", "四级标题"],
+ group: "标题",
+ },
+ heading_5: {
+ title: "五级标题",
+ subtext: "用于较小的子节标题",
+ aliases: ["h5", "heading5", "subheading5", "五级标题"],
+ group: "标题",
+ },
+ heading_6: {
+ title: "六级标题",
+ subtext: "用于最低层级的标题",
+ aliases: ["h6", "heading6", "subheading6", "六级标题"],
+ group: "标题",
+ },
quote: {
title: "引用",
subtext: "引用或摘录",
diff --git a/packages/react/src/components/FormattingToolbar/DefaultSelects/BlockTypeSelect.tsx b/packages/react/src/components/FormattingToolbar/DefaultSelects/BlockTypeSelect.tsx
index 9da718425..163367ea7 100644
--- a/packages/react/src/components/FormattingToolbar/DefaultSelects/BlockTypeSelect.tsx
+++ b/packages/react/src/components/FormattingToolbar/DefaultSelects/BlockTypeSelect.tsx
@@ -11,6 +11,9 @@ import {
RiH1,
RiH2,
RiH3,
+ RiH4,
+ RiH5,
+ RiH6,
RiListCheck3,
RiListOrdered,
RiListUnordered,
@@ -76,6 +79,36 @@ export const blockTypeSelectItems = (
"level" in block.props &&
block.props.level === 3,
},
+ {
+ name: dict.slash_menu.heading_4.title,
+ type: "heading",
+ props: { level: 4 },
+ icon: RiH4,
+ isSelected: (block) =>
+ block.type === "heading" &&
+ "level" in block.props &&
+ block.props.level === 4,
+ },
+ {
+ name: dict.slash_menu.heading_5.title,
+ type: "heading",
+ props: { level: 5 },
+ icon: RiH5,
+ isSelected: (block) =>
+ block.type === "heading" &&
+ "level" in block.props &&
+ block.props.level === 5,
+ },
+ {
+ name: dict.slash_menu.heading_6.title,
+ type: "heading",
+ props: { level: 6 },
+ icon: RiH6,
+ isSelected: (block) =>
+ block.type === "heading" &&
+ "level" in block.props &&
+ block.props.level === 6,
+ },
{
name: dict.slash_menu.quote.title,
type: "quote",
diff --git a/packages/react/src/components/SuggestionMenu/getDefaultReactSlashMenuItems.tsx b/packages/react/src/components/SuggestionMenu/getDefaultReactSlashMenuItems.tsx
index 791be083a..2bd33e305 100644
--- a/packages/react/src/components/SuggestionMenu/getDefaultReactSlashMenuItems.tsx
+++ b/packages/react/src/components/SuggestionMenu/getDefaultReactSlashMenuItems.tsx
@@ -13,6 +13,9 @@ import {
RiH1,
RiH2,
RiH3,
+ RiH4,
+ RiH5,
+ RiH6,
RiImage2Fill,
RiListCheck3,
RiListOrdered,
@@ -30,6 +33,9 @@ const icons: Record Paragraph None Bold Italic Underline Paragraph Bold Italic Underline Paragraph 1 Nested Paragraph 1 Nested Paragraph 2Heading 1
Heading 2
Heading 3
+Heading 4
+Heading 5
+Heading 6
Strikethrough AllHeading 1
Heading 2
Heading 3
+ Heading 4
+ Heading 5
+ Heading 6
Strikethrough AllHeading 1
Heading 2
Heading 3
+Heading 4
+Heading 5
+Heading 6
Paragraph 1
Paragraph 2
Paragraph 3
@@ -854,6 +866,12 @@ Paragraph ### Heading 3 +#### Heading 4 + +##### Heading 5 + +###### Heading 6 + Paragraph P**ara***grap*h