@notectl/core 1.7.0 → 1.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/chunks/{AttrRegistry-I-VdmRnN.mjs → AttrRegistry-Ci0qAvtS.mjs} +2 -2
- package/dist/chunks/{AttrRegistry-I-VdmRnN.mjs.map → AttrRegistry-Ci0qAvtS.mjs.map} +1 -1
- package/dist/chunks/AttributedMarkCommands-BETuHXj8.mjs +58 -0
- package/dist/chunks/AttributedMarkCommands-BETuHXj8.mjs.map +1 -0
- package/dist/chunks/{CaretNavigation-CAJXoaae.mjs → CaretNavigation-qLfeL0So.mjs} +56 -56
- package/dist/chunks/{CaretNavigation-CAJXoaae.mjs.map → CaretNavigation-qLfeL0So.mjs.map} +1 -1
- package/dist/chunks/ColorGrid-BBkN0AOb.mjs +80 -0
- package/dist/chunks/ColorGrid-BBkN0AOb.mjs.map +1 -0
- package/dist/chunks/ColorPickerPopup-D3ysvOH-.mjs +37 -0
- package/dist/chunks/ColorPickerPopup-D3ysvOH-.mjs.map +1 -0
- package/dist/chunks/ColorValidation-CV4f1wu6.mjs +39 -0
- package/dist/chunks/ColorValidation-CV4f1wu6.mjs.map +1 -0
- package/dist/chunks/{Document-CuwE73FF.mjs → Document-DfZ1NOjs.mjs} +15 -15
- package/dist/chunks/{Document-CuwE73FF.mjs.map → Document-DfZ1NOjs.mjs.map} +1 -1
- package/dist/chunks/MarkCommands-uybmkw9l.mjs +94 -0
- package/dist/chunks/MarkCommands-uybmkw9l.mjs.map +1 -0
- package/dist/chunks/{NavigationUtils-CyW0Vo8A.mjs → NavigationUtils-Cspt2ZrK.mjs} +3 -3
- package/dist/chunks/{NavigationUtils-CyW0Vo8A.mjs.map → NavigationUtils-Cspt2ZrK.mjs.map} +1 -1
- package/dist/chunks/{NodeResolver-B-wzthAQ.mjs → NodeResolver-CzLmmrph.mjs} +2 -2
- package/dist/chunks/{NodeResolver-B-wzthAQ.mjs.map → NodeResolver-CzLmmrph.mjs.map} +1 -1
- package/dist/chunks/PopupPositioning-Cn6L_mO2.mjs +30 -0
- package/dist/chunks/PopupPositioning-Cn6L_mO2.mjs.map +1 -0
- package/dist/chunks/RangeIterator-Bye0UtbY.mjs +16 -0
- package/dist/chunks/RangeIterator-Bye0UtbY.mjs.map +1 -0
- package/dist/chunks/{Selection-DmFDwiPJ.mjs → Selection-BRTab5hO.mjs} +7 -7
- package/dist/chunks/{Selection-DmFDwiPJ.mjs.map → Selection-BRTab5hO.mjs.map} +1 -1
- package/dist/chunks/ToolbarItem-BpZggUGo.mjs.map +1 -1
- package/dist/chunks/{ToolbarKeyboardNav-B32OMv8r.mjs → ToolbarKeyboardNav-DhpL8zNV.mjs} +3 -3
- package/dist/chunks/{ToolbarKeyboardNav-B32OMv8r.mjs.map → ToolbarKeyboardNav-DhpL8zNV.mjs.map} +1 -1
- package/dist/chunks/{ToolbarPlugin-B6JETWaw.mjs → ToolbarPlugin-B7oJRzpl.mjs} +339 -127
- package/dist/chunks/ToolbarPlugin-B7oJRzpl.mjs.map +1 -0
- package/dist/chunks/{index-CAV2N-fF.mjs → index-Bt_d4IqB.mjs} +8 -8
- package/dist/chunks/{index-CAV2N-fF.mjs.map → index-Bt_d4IqB.mjs.map} +1 -1
- package/dist/chunks/{index-pxbbDHVH.mjs → index-CFJFD4lF.mjs} +3 -3
- package/dist/chunks/{index-pxbbDHVH.mjs.map → index-CFJFD4lF.mjs.map} +1 -1
- package/dist/chunks/{index-C0cEs7Jc.mjs → index-CFPP456m.mjs} +10 -10
- package/dist/chunks/{index-C0cEs7Jc.mjs.map → index-CFPP456m.mjs.map} +1 -1
- package/dist/chunks/{index-FlTg80Pk.mjs → index-CH1r7DL-.mjs} +257 -298
- package/dist/chunks/index-CH1r7DL-.mjs.map +1 -0
- package/dist/chunks/{index-D0s0Q8Wc.mjs → index-CfyS_pgH.mjs} +25 -18
- package/dist/chunks/index-CfyS_pgH.mjs.map +1 -0
- package/dist/chunks/{index-CflvcXSd.mjs → index-Ckzqtn5D.mjs} +17 -14
- package/dist/chunks/{index-CflvcXSd.mjs.map → index-Ckzqtn5D.mjs.map} +1 -1
- package/dist/chunks/{index-C9gc3Bws.mjs → index-CrKz_IEn.mjs} +32 -32
- package/dist/chunks/{index-C9gc3Bws.mjs.map → index-CrKz_IEn.mjs.map} +1 -1
- package/dist/chunks/{index-DMt3ojrY.mjs → index-DGKQhSAl.mjs} +2 -2
- package/dist/chunks/{index-DMt3ojrY.mjs.map → index-DGKQhSAl.mjs.map} +1 -1
- package/dist/chunks/{index-CoeD4T9-.mjs → index-DIvHQtE2.mjs} +10 -7
- package/dist/chunks/{index-CoeD4T9-.mjs.map → index-DIvHQtE2.mjs.map} +1 -1
- package/dist/chunks/index-DayTn6Re.mjs +166 -0
- package/dist/chunks/index-DayTn6Re.mjs.map +1 -0
- package/dist/chunks/index-Deag_lVi.mjs +121 -0
- package/dist/chunks/index-Deag_lVi.mjs.map +1 -0
- package/dist/chunks/{index--z_Txzej.mjs → index-DmuuFS5D.mjs} +6 -6
- package/dist/chunks/{index--z_Txzej.mjs.map → index-DmuuFS5D.mjs.map} +1 -1
- package/dist/chunks/{index-B9GkDVsx.mjs → index-DoCvDkfj.mjs} +77 -94
- package/dist/chunks/index-DoCvDkfj.mjs.map +1 -0
- package/dist/chunks/index-DuRNETFv.mjs +296 -0
- package/dist/chunks/index-DuRNETFv.mjs.map +1 -0
- package/dist/chunks/{index-B-NSeaM4.mjs → index-Dum8yE_t.mjs} +12 -12
- package/dist/chunks/{index-B-NSeaM4.mjs.map → index-Dum8yE_t.mjs.map} +1 -1
- package/dist/chunks/{index-CNs4QQ8l.mjs → index-Dy6SllXW.mjs} +52 -64
- package/dist/chunks/index-Dy6SllXW.mjs.map +1 -0
- package/dist/chunks/{index-D8tbbW97.mjs → index-E7OgN7hM.mjs} +2 -2
- package/dist/chunks/{index-D8tbbW97.mjs.map → index-E7OgN7hM.mjs.map} +1 -1
- package/dist/chunks/{index-DyIwN_67.mjs → index-yhz2qeeh.mjs} +220 -218
- package/dist/chunks/index-yhz2qeeh.mjs.map +1 -0
- package/dist/commands/AttributedMarkCommands.d.ts +46 -0
- package/dist/commands/AttributedMarkCommands.d.ts.map +1 -0
- package/dist/commands/CommandHelpers.d.ts +21 -0
- package/dist/commands/CommandHelpers.d.ts.map +1 -0
- package/dist/commands/Commands.d.ts +2 -8
- package/dist/commands/Commands.d.ts.map +1 -1
- package/dist/commands/DeleteCommands.d.ts.map +1 -1
- package/dist/commands/GapCursorCommands.d.ts.map +1 -1
- package/dist/commands/NodeSelectionCommands.d.ts.map +1 -1
- package/dist/commands/PasteCommand.d.ts.map +1 -1
- package/dist/commands/RangeIterator.d.ts +10 -0
- package/dist/commands/RangeIterator.d.ts.map +1 -0
- package/dist/editor/DocumentParser.d.ts.map +1 -1
- package/dist/editor/DocumentSerializer.d.ts +2 -0
- package/dist/editor/DocumentSerializer.d.ts.map +1 -1
- package/dist/editor/MarkSerializer.d.ts +11 -0
- package/dist/editor/MarkSerializer.d.ts.map +1 -0
- package/dist/editor/NotectlEditor.d.ts +6 -3
- package/dist/editor/NotectlEditor.d.ts.map +1 -1
- package/dist/editor/PaperLayoutController.d.ts +2 -0
- package/dist/editor/PaperLayoutController.d.ts.map +1 -1
- package/dist/editor/styles/font-select.d.ts +1 -1
- package/dist/editor/styles/font-select.d.ts.map +1 -1
- package/dist/editor/styles/font-size-select.d.ts +1 -1
- package/dist/editor/styles/font-size-select.d.ts.map +1 -1
- package/dist/editor/styles/heading-select.d.ts +1 -1
- package/dist/editor/styles/heading-select.d.ts.map +1 -1
- package/dist/editor/styles/toolbar.d.ts +1 -1
- package/dist/editor/styles/toolbar.d.ts.map +1 -1
- package/dist/index.d.ts +8 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/input/ClipboardHandler.d.ts +0 -2
- package/dist/input/ClipboardHandler.d.ts.map +1 -1
- package/dist/model/MarkSpec.d.ts +6 -0
- package/dist/model/MarkSpec.d.ts.map +1 -1
- package/dist/notectl-core.mjs +2227 -2090
- package/dist/notectl-core.mjs.map +1 -1
- package/dist/notectl-core.umd.js +2527 -2337
- package/dist/notectl-core.umd.js.map +1 -1
- package/dist/plugins/PluginManager.d.ts +2 -0
- package/dist/plugins/PluginManager.d.ts.map +1 -1
- package/dist/plugins/alignment.mjs +1 -1
- package/dist/plugins/blockquote.mjs +1 -1
- package/dist/plugins/caret-navigation.mjs +1 -1
- package/dist/plugins/code-block.mjs +1 -1
- package/dist/plugins/font/FontPlugin.d.ts +0 -6
- package/dist/plugins/font/FontPlugin.d.ts.map +1 -1
- package/dist/plugins/font-size/FontSizeOperations.d.ts.map +1 -1
- package/dist/plugins/font-size/FontSizePlugin.d.ts +0 -5
- package/dist/plugins/font-size/FontSizePlugin.d.ts.map +1 -1
- package/dist/plugins/font-size.mjs +1 -1
- package/dist/plugins/font.mjs +1 -1
- package/dist/plugins/gap-cursor.mjs +7 -7
- package/dist/plugins/hard-break.mjs +2 -25
- package/dist/plugins/hard-break.mjs.map +1 -1
- package/dist/plugins/heading/HeadingBlockTypePicker.d.ts +1 -7
- package/dist/plugins/heading/HeadingBlockTypePicker.d.ts.map +1 -1
- package/dist/plugins/heading/HeadingPlugin.d.ts +0 -6
- package/dist/plugins/heading/HeadingPlugin.d.ts.map +1 -1
- package/dist/plugins/heading.mjs +1 -1
- package/dist/plugins/highlight/HighlightPlugin.d.ts.map +1 -1
- package/dist/plugins/highlight.mjs +1 -1
- package/dist/plugins/horizontal-rule.mjs +1 -1
- package/dist/plugins/image/ImagePlugin.d.ts.map +1 -1
- package/dist/plugins/image.mjs +1 -1
- package/dist/plugins/link/LinkPlugin.d.ts.map +1 -1
- package/dist/plugins/link.mjs +1 -1
- package/dist/plugins/list/ListPlugin.d.ts.map +1 -1
- package/dist/plugins/list.mjs +1 -1
- package/dist/plugins/shared/ColorGrid.d.ts +25 -0
- package/dist/plugins/shared/ColorGrid.d.ts.map +1 -0
- package/dist/plugins/shared/ColorMarkOperations.d.ts.map +1 -1
- package/dist/plugins/shared/ColorPickerPopup.d.ts.map +1 -1
- package/dist/plugins/shared/ColorValidation.d.ts +13 -2
- package/dist/plugins/shared/ColorValidation.d.ts.map +1 -1
- package/dist/plugins/shared/PopupKeyboardPatterns.d.ts +43 -0
- package/dist/plugins/shared/PopupKeyboardPatterns.d.ts.map +1 -0
- package/dist/plugins/shared/PopupManager.d.ts +45 -0
- package/dist/plugins/shared/PopupManager.d.ts.map +1 -0
- package/dist/plugins/shared/PopupPositioning.d.ts +21 -0
- package/dist/plugins/shared/PopupPositioning.d.ts.map +1 -0
- package/dist/plugins/strikethrough.mjs +1 -1
- package/dist/plugins/super-sub.mjs +1 -1
- package/dist/plugins/table/TableBorderColor.d.ts.map +1 -1
- package/dist/plugins/table/TableContextMenu.d.ts +2 -1
- package/dist/plugins/table/TableContextMenu.d.ts.map +1 -1
- package/dist/plugins/table.mjs +1 -1
- package/dist/plugins/text-color/TextColorPlugin.d.ts.map +1 -1
- package/dist/plugins/text-color.mjs +1 -1
- package/dist/plugins/text-formatting.mjs +1 -1
- package/dist/plugins/toolbar/ToolbarItem.d.ts +11 -2
- package/dist/plugins/toolbar/ToolbarItem.d.ts.map +1 -1
- package/dist/plugins/toolbar/ToolbarOverflowController.d.ts +5 -1
- package/dist/plugins/toolbar/ToolbarOverflowController.d.ts.map +1 -1
- package/dist/plugins/toolbar/ToolbarPlugin.d.ts +1 -0
- package/dist/plugins/toolbar/ToolbarPlugin.d.ts.map +1 -1
- package/dist/plugins/toolbar/ToolbarPopupController.d.ts +9 -1
- package/dist/plugins/toolbar/ToolbarPopupController.d.ts.map +1 -1
- package/dist/plugins/toolbar/index.d.ts +1 -1
- package/dist/plugins/toolbar/index.d.ts.map +1 -1
- package/dist/plugins/toolbar.mjs +1 -1
- package/dist/state/BlockTreeOps.d.ts +21 -0
- package/dist/state/BlockTreeOps.d.ts.map +1 -0
- package/dist/state/InlineContentOps.d.ts +37 -0
- package/dist/state/InlineContentOps.d.ts.map +1 -0
- package/dist/state/StepApplication.d.ts.map +1 -1
- package/dist/test/PluginTestUtils.d.ts +4 -0
- package/dist/test/PluginTestUtils.d.ts.map +1 -1
- package/package.json +2 -2
- package/dist/chunks/ColorNames-BdsHwA2f.mjs +0 -59
- package/dist/chunks/ColorNames-BdsHwA2f.mjs.map +0 -1
- package/dist/chunks/ColorPickerPopup-xL8ZUfpB.mjs +0 -125
- package/dist/chunks/ColorPickerPopup-xL8ZUfpB.mjs.map +0 -1
- package/dist/chunks/Commands-CicwYoTQ.mjs +0 -286
- package/dist/chunks/Commands-CicwYoTQ.mjs.map +0 -1
- package/dist/chunks/MarkCommands-CC37WA7Z.mjs +0 -94
- package/dist/chunks/MarkCommands-CC37WA7Z.mjs.map +0 -1
- package/dist/chunks/ToolbarPlugin-B6JETWaw.mjs.map +0 -1
- package/dist/chunks/index-B9GkDVsx.mjs.map +0 -1
- package/dist/chunks/index-CKPrAOr6.mjs +0 -209
- package/dist/chunks/index-CKPrAOr6.mjs.map +0 -1
- package/dist/chunks/index-CNs4QQ8l.mjs.map +0 -1
- package/dist/chunks/index-D0s0Q8Wc.mjs.map +0 -1
- package/dist/chunks/index-DfzCof6H.mjs +0 -191
- package/dist/chunks/index-DfzCof6H.mjs.map +0 -1
- package/dist/chunks/index-DyIwN_67.mjs.map +0 -1
- package/dist/chunks/index-FlTg80Pk.mjs.map +0 -1
|
@@ -1,90 +1,88 @@
|
|
|
1
1
|
import { r as e } from "./resolvePluginLocale-B4w1OkPy.mjs";
|
|
2
2
|
import { c as t } from "./NodeSpec-NZVvcCuH.mjs";
|
|
3
|
-
import { i as n, a as
|
|
4
|
-
import { a as r } from "./ToolbarPlugin-
|
|
5
|
-
import {
|
|
3
|
+
import { i as n, a as i, b as o, d as a } from "./Selection-BRTab5hO.mjs";
|
|
4
|
+
import { a as r } from "./ToolbarPlugin-B7oJRzpl.mjs";
|
|
5
|
+
import { a as c, c as l, d as s, m as g, u as d } from "./Document-DfZ1NOjs.mjs";
|
|
6
6
|
import { n as h } from "./TypeBrands-C09nE2qO.mjs";
|
|
7
|
-
function p(e2, t2, n2,
|
|
8
|
-
const
|
|
9
|
-
|
|
7
|
+
function p(e2, t2, n2, i2) {
|
|
8
|
+
const o2 = document.createElement("button");
|
|
9
|
+
o2.type = "button", o2.className = "notectl-heading-picker__item", o2.setAttribute("role", "option"), o2.setAttribute("aria-selected", String(t2)), t2 && o2.classList.add("notectl-heading-picker__item--active");
|
|
10
10
|
const a2 = document.createElement("span");
|
|
11
|
-
a2.className = "notectl-heading-picker__check", a2.textContent = t2 ? "✓" : "",
|
|
11
|
+
a2.className = "notectl-heading-picker__check", a2.textContent = t2 ? "✓" : "", o2.appendChild(a2);
|
|
12
12
|
const r2 = document.createElement("span");
|
|
13
|
-
return r2.className = "notectl-heading-picker__label", r2.textContent = e2,
|
|
13
|
+
return r2.className = "notectl-heading-picker__label", r2.textContent = e2, i2 && (r2.style.fontSize = i2.fontSize, r2.style.fontWeight = i2.fontWeight), o2.appendChild(r2), o2.addEventListener("mousedown", n2), o2;
|
|
14
14
|
}
|
|
15
15
|
function b(e2, t2) {
|
|
16
16
|
return e2[`heading${t2}`];
|
|
17
17
|
}
|
|
18
18
|
function u(e2, t2) {
|
|
19
|
-
const
|
|
20
|
-
if (n(
|
|
21
|
-
const a2 =
|
|
22
|
-
return !!a2 && (a2.type === t2 ?
|
|
19
|
+
const o2 = e2.getState();
|
|
20
|
+
if (n(o2.selection) || i(o2.selection)) return false;
|
|
21
|
+
const a2 = o2.getBlock(o2.selection.anchor.blockId);
|
|
22
|
+
return !!a2 && (a2.type === t2 ? f(e2, h("paragraph")) : f(e2, h(t2)));
|
|
23
23
|
}
|
|
24
|
-
function
|
|
25
|
-
const
|
|
26
|
-
if (n(a2) ||
|
|
27
|
-
const r2 =
|
|
28
|
-
return !!r2 && ("heading" === r2.type && r2.attrs?.level === t2 ?
|
|
24
|
+
function k(e2, t2) {
|
|
25
|
+
const o2 = e2.getState(), a2 = o2.selection;
|
|
26
|
+
if (n(a2) || i(a2)) return false;
|
|
27
|
+
const r2 = o2.getBlock(a2.anchor.blockId);
|
|
28
|
+
return !!r2 && ("heading" === r2.type && r2.attrs?.level === t2 ? f(e2, h("paragraph")) : f(e2, h("heading"), { level: t2 }));
|
|
29
29
|
}
|
|
30
|
-
function
|
|
30
|
+
function f(e2, t2, o2) {
|
|
31
31
|
const a2 = e2.getState(), r2 = a2.selection;
|
|
32
|
-
if (n(r2) ||
|
|
32
|
+
if (n(r2) || i(r2)) return false;
|
|
33
33
|
const g2 = a2.getBlock(r2.anchor.blockId);
|
|
34
34
|
if (!g2) return false;
|
|
35
35
|
const d2 = a2.transaction("command"), h2 = e2.getSchemaRegistry().getNodeSpec(t2);
|
|
36
36
|
h2?.excludeMarks && h2.excludeMarks.length > 0 && ((function(e3, t3, n2) {
|
|
37
|
-
if (0 ===
|
|
38
|
-
const
|
|
37
|
+
if (0 === c(t3)) return;
|
|
38
|
+
const i2 = new Set(n2), o3 = l(t3);
|
|
39
39
|
let a3 = 0;
|
|
40
|
-
for (const n3 of
|
|
41
|
-
if (n3.text.length > 0) for (const
|
|
40
|
+
for (const n3 of o3) if (s(n3)) {
|
|
41
|
+
if (n3.text.length > 0) for (const o4 of n3.marks) i2.has(o4.type) && e3.removeMark(t3.id, a3, a3 + n3.text.length, o4);
|
|
42
42
|
a3 += n3.text.length;
|
|
43
43
|
} else a3 += 1;
|
|
44
44
|
})(d2, g2, h2.excludeMarks), (function(e3, t3, n2) {
|
|
45
45
|
if (!t3.storedMarks) return;
|
|
46
|
-
const
|
|
47
|
-
|
|
46
|
+
const i2 = new Set(n2), o3 = t3.storedMarks.filter((e4) => !i2.has(e4.type));
|
|
47
|
+
o3.length !== t3.storedMarks.length && e3.setStoredMarks(o3.length > 0 ? o3 : null, t3.storedMarks);
|
|
48
48
|
})(d2, a2, h2.excludeMarks));
|
|
49
|
-
const p2 = d2.setBlockType(r2.anchor.blockId, t2,
|
|
49
|
+
const p2 = d2.setBlockType(r2.anchor.blockId, t2, o2).setSelection(r2).build();
|
|
50
50
|
return e2.dispatch(p2), true;
|
|
51
51
|
}
|
|
52
52
|
const m = /* @__PURE__ */ new Set(["heading", "title", "subtitle"]);
|
|
53
|
-
const y = { paragraph: "Paragraph", title: "Title", subtitle: "Subtitle", heading1: "Heading 1", heading2: "Heading 2", heading3: "Heading 3", heading4: "Heading 4", heading5: "Heading 5", heading6: "Heading 6", blockTypeLabel: "Block Type", blockTypesAria: "Block types" },
|
|
53
|
+
const y = { paragraph: "Paragraph", title: "Title", subtitle: "Subtitle", heading1: "Heading 1", heading2: "Heading 2", heading3: "Heading 3", heading4: "Heading 4", heading5: "Heading 5", heading6: "Heading 6", blockTypeLabel: "Block Type", blockTypesAria: "Block types" }, T = { en: y, de: { paragraph: "Absatz", title: "Titel", subtitle: "Untertitel", heading1: "Überschrift 1", heading2: "Überschrift 2", heading3: "Überschrift 3", heading4: "Überschrift 4", heading5: "Überschrift 5", heading6: "Überschrift 6", blockTypeLabel: "Blocktyp", blockTypesAria: "Blocktypen" }, es: { paragraph: "Párrafo", title: "Título", subtitle: "Subtítulo", heading1: "Encabezado 1", heading2: "Encabezado 2", heading3: "Encabezado 3", heading4: "Encabezado 4", heading5: "Encabezado 5", heading6: "Encabezado 6", blockTypeLabel: "Tipo de bloque", blockTypesAria: "Tipos de bloque" }, fr: { paragraph: "Paragraphe", title: "Titre", subtitle: "Sous-titre", heading1: "Titre 1", heading2: "Titre 2", heading3: "Titre 3", heading4: "Titre 4", heading5: "Titre 5", heading6: "Titre 6", blockTypeLabel: "Type de bloc", blockTypesAria: "Types de bloc" }, zh: { paragraph: "正文", title: "标题", subtitle: "副标题", heading1: "一级标题", heading2: "二级标题", heading3: "三级标题", heading4: "四级标题", heading5: "五级标题", heading6: "六级标题", blockTypeLabel: "块类型", blockTypesAria: "块类型列表" }, ru: { paragraph: "Абзац", title: "Заголовок", subtitle: "Подзаголовок", heading1: "Заголовок 1", heading2: "Заголовок 2", heading3: "Заголовок 3", heading4: "Заголовок 4", heading5: "Заголовок 5", heading6: "Заголовок 6", blockTypeLabel: "Тип блока", blockTypesAria: "Типы блоков" }, ar: { paragraph: "فقرة", title: "عنوان", subtitle: "عنوان فرعي", heading1: "عنوان 1", heading2: "عنوان 2", heading3: "عنوان 3", heading4: "عنوان 4", heading5: "عنوان 5", heading6: "عنوان 6", blockTypeLabel: "نوع الكتلة", blockTypesAria: "أنواع الكتل" }, hi: { paragraph: "अनुच्छेद", title: "शीर्षक", subtitle: "उपशीर्षक", heading1: "शीर्षक 1", heading2: "शीर्षक 2", heading3: "शीर्षक 3", heading4: "शीर्षक 4", heading5: "शीर्षक 5", heading6: "शीर्षक 6", blockTypeLabel: "ब्लॉक प्रकार", blockTypesAria: "ब्लॉक प्रकार सूची" } }, v = { levels: [1, 2, 3, 4, 5, 6] }, x = { 1: "h1", 2: "h2", 3: "h3", 4: "h4", 5: "h5", 6: "h6" };
|
|
54
54
|
class S {
|
|
55
55
|
id = "heading";
|
|
56
56
|
name = "Heading";
|
|
57
57
|
priority = 30;
|
|
58
58
|
config;
|
|
59
59
|
locale;
|
|
60
|
-
context = null;
|
|
61
|
-
comboLabel = null;
|
|
62
60
|
constructor(e2) {
|
|
63
|
-
this.config = { ...
|
|
61
|
+
this.config = { ...v, ...e2 };
|
|
64
62
|
}
|
|
65
63
|
init(t2) {
|
|
66
|
-
this.locale = e(
|
|
64
|
+
this.locale = e(T, t2, this.config.locale), t2.registerStyleSheet("\n/* Heading Select — Width overrides for combobox button */\n.notectl-toolbar-btn--heading {\n min-width: 100px;\n max-width: 160px;\n}\n\n/* Heading Picker Popup */\n.notectl-heading-picker {\n min-width: 200px;\n max-height: 320px;\n overflow-y: auto;\n}\n\n.notectl-heading-picker__list {\n padding: 4px 0;\n}\n\n.notectl-heading-picker__item {\n display: flex;\n align-items: center;\n gap: 8px;\n width: 100%;\n padding: 7px 12px;\n border: none;\n background: none;\n cursor: pointer;\n font-size: 14px;\n color: var(--notectl-fg);\n text-align: left;\n white-space: nowrap;\n font-family: inherit;\n transition: background 0.1s;\n}\n\n.notectl-heading-picker__item:hover {\n background: var(--notectl-hover-bg);\n}\n\n.notectl-heading-picker__item--active {\n background: var(--notectl-active-bg);\n color: var(--notectl-primary-fg);\n}\n\n.notectl-heading-picker__item--active:hover {\n background: var(--notectl-active-bg);\n}\n\n.notectl-heading-picker__check {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 16px;\n flex-shrink: 0;\n font-size: 13px;\n font-weight: 600;\n color: var(--notectl-primary-fg);\n}\n\n.notectl-heading-picker__label {\n flex: 1;\n}\n"), this.registerNodeSpecs(t2), (function(e2, t3) {
|
|
67
65
|
e2.registerCommand("setTitle", () => u(e2, "title")), e2.registerCommand("setSubtitle", () => u(e2, "subtitle"));
|
|
68
|
-
for (const n2 of t3.levels) e2.registerCommand(`setHeading${n2}`, () =>
|
|
69
|
-
e2.registerCommand("toggleHeading", () =>
|
|
66
|
+
for (const n2 of t3.levels) e2.registerCommand(`setHeading${n2}`, () => k(e2, n2));
|
|
67
|
+
e2.registerCommand("toggleHeading", () => k(e2, 1)), e2.registerCommand("setParagraph", () => f(e2, h("paragraph")));
|
|
70
68
|
})(t2, this.config), (function(e2, t3) {
|
|
71
69
|
const r2 = { Enter: () => (function(e3) {
|
|
72
70
|
return (function(e4, t4) {
|
|
73
71
|
const a2 = e4.getState();
|
|
74
|
-
if (n(a2.selection) ||
|
|
72
|
+
if (n(a2.selection) || i(a2.selection)) return false;
|
|
75
73
|
const r3 = a2.selection;
|
|
76
|
-
if (!
|
|
77
|
-
const
|
|
78
|
-
return !(!
|
|
74
|
+
if (!o(r3)) return false;
|
|
75
|
+
const c2 = a2.getBlock(r3.anchor.blockId);
|
|
76
|
+
return !(!c2 || !m.has(c2.type)) && t4({ state: a2, block: c2, blockId: r3.anchor.blockId, offset: r3.anchor.offset });
|
|
79
77
|
})(e3, (t4) => {
|
|
80
78
|
if ("" === g(t4.block)) {
|
|
81
79
|
const n3 = t4.state.transaction("input").setBlockType(t4.blockId, h("paragraph")).setSelection(t4.state.selection).build();
|
|
82
80
|
return e3.dispatch(n3), true;
|
|
83
81
|
}
|
|
84
|
-
const n2 =
|
|
82
|
+
const n2 = c(t4.block);
|
|
85
83
|
if (t4.offset >= n2) {
|
|
86
|
-
const n3 = d(),
|
|
87
|
-
return e3.dispatch(
|
|
84
|
+
const n3 = d(), i2 = t4.state.transaction("input").splitBlock(t4.blockId, t4.offset, n3).setBlockType(n3, h("paragraph")).setSelection(a(n3, 0)).build();
|
|
85
|
+
return e3.dispatch(i2), true;
|
|
88
86
|
}
|
|
89
87
|
return false;
|
|
90
88
|
});
|
|
@@ -93,76 +91,61 @@ class S {
|
|
|
93
91
|
e2.registerKeymap(r2);
|
|
94
92
|
})(t2, this.config), (function(e2, t3) {
|
|
95
93
|
for (const r2 of t3.levels) {
|
|
96
|
-
const t4 = "#".repeat(r2),
|
|
97
|
-
e2.registerInputRule({ pattern:
|
|
94
|
+
const t4 = "#".repeat(r2), c2 = new RegExp(`^${t4} $`);
|
|
95
|
+
e2.registerInputRule({ pattern: c2, handler(e3, t5, c3, l2) {
|
|
98
96
|
const s2 = e3.selection;
|
|
99
|
-
if (n(s2) ||
|
|
100
|
-
if (!
|
|
97
|
+
if (n(s2) || i(s2)) return null;
|
|
98
|
+
if (!o(s2)) return null;
|
|
101
99
|
const g2 = e3.getBlock(s2.anchor.blockId);
|
|
102
|
-
return g2 && "paragraph" === g2.type ? e3.transaction("input").deleteTextAt(s2.anchor.blockId,
|
|
100
|
+
return g2 && "paragraph" === g2.type ? e3.transaction("input").deleteTextAt(s2.anchor.blockId, c3, c3 + r2 + 1).setBlockType(s2.anchor.blockId, h("heading"), { level: r2 }).setSelection(a(s2.anchor.blockId, 0)).build() : null;
|
|
103
101
|
} });
|
|
104
102
|
}
|
|
105
|
-
})(t2, this.config), (function(e2, t3,
|
|
106
|
-
e2.registerBlockTypePickerEntry({ id: "paragraph", label:
|
|
107
|
-
if (n(e3.selection) ||
|
|
103
|
+
})(t2, this.config), (function(e2, t3, o2) {
|
|
104
|
+
e2.registerBlockTypePickerEntry({ id: "paragraph", label: o2.paragraph, command: "setParagraph", priority: 10, isActive: (e3) => {
|
|
105
|
+
if (n(e3.selection) || i(e3.selection)) return false;
|
|
108
106
|
const t4 = e3.getBlock(e3.selection.anchor.blockId);
|
|
109
107
|
return "paragraph" === t4?.type;
|
|
110
|
-
} }), e2.registerBlockTypePickerEntry({ id: "title", label:
|
|
111
|
-
if (n(e3.selection) ||
|
|
108
|
+
} }), e2.registerBlockTypePickerEntry({ id: "title", label: o2.title, command: "setTitle", priority: 20, style: { fontSize: "1.6em", fontWeight: "700" }, isActive: (e3) => {
|
|
109
|
+
if (n(e3.selection) || i(e3.selection)) return false;
|
|
112
110
|
const t4 = e3.getBlock(e3.selection.anchor.blockId);
|
|
113
111
|
return "title" === t4?.type;
|
|
114
|
-
} }), e2.registerBlockTypePickerEntry({ id: "subtitle", label:
|
|
115
|
-
if (n(e3.selection) ||
|
|
112
|
+
} }), e2.registerBlockTypePickerEntry({ id: "subtitle", label: o2.subtitle, command: "setSubtitle", priority: 30, style: { fontSize: "1.3em", fontWeight: "500" }, isActive: (e3) => {
|
|
113
|
+
if (n(e3.selection) || i(e3.selection)) return false;
|
|
116
114
|
const t4 = e3.getBlock(e3.selection.anchor.blockId);
|
|
117
115
|
return "subtitle" === t4?.type;
|
|
118
116
|
} });
|
|
119
|
-
for (const a2 of t3.levels) e2.registerBlockTypePickerEntry({ id: `heading-${a2}`, label: b(
|
|
120
|
-
if (n(e3.selection) ||
|
|
117
|
+
for (const a2 of t3.levels) e2.registerBlockTypePickerEntry({ id: `heading-${a2}`, label: b(o2, a2), command: `setHeading${a2}`, priority: 100 + a2, style: { fontSize: 1.4 - 0.1 * a2 + "em", fontWeight: "600" }, isActive: (e3) => {
|
|
118
|
+
if (n(e3.selection) || i(e3.selection)) return false;
|
|
121
119
|
const t4 = e3.getBlock(e3.selection.anchor.blockId);
|
|
122
120
|
return "heading" === t4?.type && t4.attrs?.level === a2;
|
|
123
121
|
} });
|
|
124
|
-
})(t2, this.config, this.locale), (function(e2, t3,
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
122
|
+
})(t2, this.config, this.locale), (function(e2, t3, o2) {
|
|
123
|
+
e2.registerToolbarItem({ id: "heading", group: "block", label: o2.blockTypeLabel, tooltip: o2.blockTypeLabel, command: "setParagraph", priority: 50, popupType: "combobox", separatorAfter: t3.separatorAfter, getLabel: (t4) => (function(e3, t5, o3) {
|
|
124
|
+
if (n(e3.selection) || i(e3.selection)) return o3.paragraph;
|
|
125
|
+
const a2 = t5.getBlockTypePickerRegistry().getBlockTypePickerEntries();
|
|
126
|
+
for (const t6 of a2) if (t6.isActive(e3)) return t6.label;
|
|
127
|
+
return o3.paragraph;
|
|
128
|
+
})(t4, e2, o2), renderPopup: (e3, t4) => {
|
|
129
|
+
!(function(e4, t5, o3) {
|
|
128
130
|
e4.classList.add("notectl-heading-picker");
|
|
129
|
-
const
|
|
130
|
-
if (n(
|
|
131
|
-
const
|
|
132
|
-
|
|
133
|
-
const
|
|
134
|
-
for (const e5 of
|
|
135
|
-
const n2 = e5.isActive(
|
|
136
|
-
|
|
131
|
+
const a2 = t5.getState();
|
|
132
|
+
if (n(a2.selection) || i(a2.selection)) return;
|
|
133
|
+
const c2 = document.createElement("div");
|
|
134
|
+
c2.className = "notectl-heading-picker__list", c2.setAttribute("role", "listbox"), c2.setAttribute("aria-label", o3.blockTypesAria);
|
|
135
|
+
const l2 = t5.getBlockTypePickerRegistry().getBlockTypePickerEntries();
|
|
136
|
+
for (const e5 of l2) {
|
|
137
|
+
const n2 = e5.isActive(a2);
|
|
138
|
+
c2.appendChild(p(e5.label, n2, (n3) => {
|
|
137
139
|
n3.preventDefault(), n3.stopPropagation(), t5.executeCommand(e5.command);
|
|
138
|
-
const
|
|
139
|
-
|
|
140
|
+
const i2 = t5.getService(r);
|
|
141
|
+
i2?.closePopup();
|
|
140
142
|
}, e5.style));
|
|
141
143
|
}
|
|
142
|
-
e4.appendChild(
|
|
143
|
-
})(e3, t4,
|
|
144
|
+
e4.appendChild(c2);
|
|
145
|
+
})(e3, t4, o2);
|
|
144
146
|
}, isActive: (t4) => e2.getBlockTypePickerRegistry().getBlockTypePickerEntries().some((e3) => "paragraph" !== e3.id && e3.isActive(t4)) });
|
|
145
147
|
})(t2, this.config, this.locale);
|
|
146
148
|
}
|
|
147
|
-
destroy() {
|
|
148
|
-
this.context = null, this.comboLabel = null;
|
|
149
|
-
}
|
|
150
|
-
onStateChange(e2, t2, i2) {
|
|
151
|
-
this.context && (this.comboLabel = (function(e3, t3, i3, a2) {
|
|
152
|
-
let r2 = a2;
|
|
153
|
-
if (!r2) {
|
|
154
|
-
const e4 = t3.getPluginContainer("top");
|
|
155
|
-
if (!e4) return null;
|
|
156
|
-
if (r2 = e4.querySelector("[data-heading-label]") ?? null, !r2) return null;
|
|
157
|
-
}
|
|
158
|
-
return r2.textContent = (function(e4, t4, i4) {
|
|
159
|
-
if (n(e4.selection) || o(e4.selection)) return i4.paragraph;
|
|
160
|
-
const a3 = t4.getBlockTypePickerRegistry().getBlockTypePickerEntries();
|
|
161
|
-
for (const t5 of a3) if (t5.isActive(e4)) return t5.label;
|
|
162
|
-
return i4.paragraph;
|
|
163
|
-
})(e3, t3, i3), r2;
|
|
164
|
-
})(t2, this.context, this.locale, this.comboLabel));
|
|
165
|
-
}
|
|
166
149
|
registerNodeSpecs(e2) {
|
|
167
150
|
e2.registerNodeSpec({ type: "title", group: "block", content: { allow: ["text"] }, excludeMarks: ["fontSize"], toDOM(e3) {
|
|
168
151
|
const n2 = t("h1", e3.id);
|
|
@@ -172,16 +155,16 @@ class S {
|
|
|
172
155
|
return n2.classList.add("notectl-subtitle"), n2;
|
|
173
156
|
}, toHTML: (e3, t2) => `<h2>${t2 || "<br>"}</h2>`, sanitize: { tags: ["h2"] } }), e2.registerNodeSpec({ type: "heading", group: "block", content: { allow: ["text"] }, excludeMarks: ["fontSize"], attrs: { level: { default: 1 } }, toDOM(e3) {
|
|
174
157
|
const n2 = e3.attrs?.level ?? 1;
|
|
175
|
-
return t(
|
|
158
|
+
return t(x[n2] ?? "h1", e3.id);
|
|
176
159
|
}, toHTML(e3, t2) {
|
|
177
|
-
const n2 = e3.attrs?.level ?? 1,
|
|
178
|
-
return `<${
|
|
160
|
+
const n2 = e3.attrs?.level ?? 1, i2 = x[n2] ?? "h1";
|
|
161
|
+
return `<${i2}>${t2 || "<br>"}</${i2}>`;
|
|
179
162
|
}, parseHTML: [{ tag: "h1", getAttrs: () => ({ level: 1 }) }, { tag: "h2", getAttrs: () => ({ level: 2 }) }, { tag: "h3", getAttrs: () => ({ level: 3 }) }, { tag: "h4", getAttrs: () => ({ level: 4 }) }, { tag: "h5", getAttrs: () => ({ level: 5 }) }, { tag: "h6", getAttrs: () => ({ level: 6 }) }], sanitize: { tags: ["h1", "h2", "h3", "h4", "h5", "h6"] } });
|
|
180
163
|
}
|
|
181
164
|
}
|
|
182
165
|
export {
|
|
183
166
|
S as H,
|
|
184
|
-
|
|
167
|
+
T as a,
|
|
185
168
|
y as b
|
|
186
169
|
};
|
|
187
|
-
//# sourceMappingURL=index-
|
|
170
|
+
//# sourceMappingURL=index-DoCvDkfj.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-DoCvDkfj.mjs","sources":["../../src/plugins/heading/HeadingBlockTypePicker.ts","../../src/plugins/heading/HeadingCommands.ts","../../src/plugins/heading/HeadingKeyboardHandlers.ts","../../src/plugins/heading/HeadingLocale.ts","../../src/plugins/heading/HeadingPlugin.ts","../../src/editor/styles/heading-select.ts","../../src/plugins/heading/HeadingInputRules.ts"],"sourcesContent":["/**\n * Block type picker entries and toolbar dropdown for heading block types.\n * Registers picker entries for paragraph, title, subtitle, and all heading levels,\n * plus a combobox-style toolbar item with a custom popup.\n */\n\nimport { isGapCursor, isNodeSelection } from '../../model/Selection.js';\nimport type { EditorState } from '../../state/EditorState.js';\nimport type { PluginContext } from '../Plugin.js';\nimport { ToolbarServiceKey } from '../toolbar/ToolbarPlugin.js';\nimport type { PickerEntryStyle } from './BlockTypePickerEntry.js';\nimport type { HeadingLocale } from './HeadingLocale.js';\nimport type { HeadingConfig } from './HeadingPlugin.js';\nimport type { HeadingLevel } from './HeadingPlugin.js';\n\n// --- Picker Entry Registration ---\n\n/** Registers block type picker entries for paragraph, title, subtitle, and heading levels. */\nexport function registerHeadingPickerEntries(\n\tcontext: PluginContext,\n\tconfig: HeadingConfig,\n\tlocale: HeadingLocale,\n): void {\n\tcontext.registerBlockTypePickerEntry({\n\t\tid: 'paragraph',\n\t\tlabel: locale.paragraph,\n\t\tcommand: 'setParagraph',\n\t\tpriority: 10,\n\t\tisActive: (state) => {\n\t\t\tif (isNodeSelection(state.selection) || isGapCursor(state.selection)) return false;\n\t\t\tconst block = state.getBlock(state.selection.anchor.blockId);\n\t\t\treturn block?.type === 'paragraph';\n\t\t},\n\t});\n\n\tcontext.registerBlockTypePickerEntry({\n\t\tid: 'title',\n\t\tlabel: locale.title,\n\t\tcommand: 'setTitle',\n\t\tpriority: 20,\n\t\tstyle: { fontSize: '1.6em', fontWeight: '700' },\n\t\tisActive: (state) => {\n\t\t\tif (isNodeSelection(state.selection) || isGapCursor(state.selection)) return false;\n\t\t\tconst block = state.getBlock(state.selection.anchor.blockId);\n\t\t\treturn block?.type === 'title';\n\t\t},\n\t});\n\n\tcontext.registerBlockTypePickerEntry({\n\t\tid: 'subtitle',\n\t\tlabel: locale.subtitle,\n\t\tcommand: 'setSubtitle',\n\t\tpriority: 30,\n\t\tstyle: { fontSize: '1.3em', fontWeight: '500' },\n\t\tisActive: (state) => {\n\t\t\tif (isNodeSelection(state.selection) || isGapCursor(state.selection)) return false;\n\t\t\tconst block = state.getBlock(state.selection.anchor.blockId);\n\t\t\treturn block?.type === 'subtitle';\n\t\t},\n\t});\n\n\tfor (const level of config.levels) {\n\t\tcontext.registerBlockTypePickerEntry({\n\t\t\tid: `heading-${level}`,\n\t\t\tlabel: getHeadingLabel(locale, level),\n\t\t\tcommand: `setHeading${level}`,\n\t\t\tpriority: 100 + level,\n\t\t\tstyle: { fontSize: `${1.4 - level * 0.1}em`, fontWeight: '600' },\n\t\t\tisActive: (state) => {\n\t\t\t\tif (isNodeSelection(state.selection) || isGapCursor(state.selection)) return false;\n\t\t\t\tconst block = state.getBlock(state.selection.anchor.blockId);\n\t\t\t\treturn block?.type === 'heading' && block.attrs?.level === level;\n\t\t\t},\n\t\t});\n\t}\n}\n\n// --- Toolbar Item ---\n\n/** Registers the heading toolbar dropdown with a combobox picker popup. */\nexport function registerHeadingToolbarItem(\n\tcontext: PluginContext,\n\tconfig: HeadingConfig,\n\tlocale: HeadingLocale,\n): void {\n\tcontext.registerToolbarItem({\n\t\tid: 'heading',\n\t\tgroup: 'block',\n\t\tlabel: locale.blockTypeLabel,\n\t\ttooltip: locale.blockTypeLabel,\n\t\tcommand: 'setParagraph',\n\t\tpriority: 50,\n\t\tpopupType: 'combobox',\n\t\tseparatorAfter: config.separatorAfter,\n\t\tgetLabel: (state: EditorState): string => getActiveLabel(state, context, locale),\n\t\trenderPopup: (container, ctx) => {\n\t\t\trenderHeadingPopup(container, ctx, locale);\n\t\t},\n\t\tisActive: (state) => {\n\t\t\tconst entries = context.getBlockTypePickerRegistry().getBlockTypePickerEntries();\n\t\t\treturn entries.some((entry) => entry.id !== 'paragraph' && entry.isActive(state));\n\t\t},\n\t});\n}\n\n// --- Popup Rendering ---\n\nfunction renderHeadingPopup(\n\tcontainer: HTMLElement,\n\tcontext: PluginContext,\n\tlocale: HeadingLocale,\n): void {\n\tcontainer.classList.add('notectl-heading-picker');\n\n\tconst state: EditorState = context.getState();\n\tif (isNodeSelection(state.selection) || isGapCursor(state.selection)) return;\n\n\tconst list: HTMLDivElement = document.createElement('div');\n\tlist.className = 'notectl-heading-picker__list';\n\tlist.setAttribute('role', 'listbox');\n\tlist.setAttribute('aria-label', locale.blockTypesAria);\n\n\tconst entries = context.getBlockTypePickerRegistry().getBlockTypePickerEntries();\n\tfor (const entry of entries) {\n\t\tconst active: boolean = entry.isActive(state);\n\t\tlist.appendChild(\n\t\t\tcreatePickerItem(\n\t\t\t\tentry.label,\n\t\t\t\tactive,\n\t\t\t\t(e: MouseEvent) => {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\te.stopPropagation();\n\t\t\t\t\tcontext.executeCommand(entry.command);\n\t\t\t\t\tconst toolbar = context.getService(ToolbarServiceKey);\n\t\t\t\t\ttoolbar?.closePopup();\n\t\t\t\t},\n\t\t\t\tentry.style,\n\t\t\t),\n\t\t);\n\t}\n\n\tcontainer.appendChild(list);\n}\n\nfunction createPickerItem(\n\tlabel: string,\n\tisActive: boolean,\n\thandler: (e: MouseEvent) => void,\n\tstyle?: PickerEntryStyle,\n): HTMLButtonElement {\n\tconst item: HTMLButtonElement = document.createElement('button');\n\titem.type = 'button';\n\titem.className = 'notectl-heading-picker__item';\n\titem.setAttribute('role', 'option');\n\titem.setAttribute('aria-selected', String(isActive));\n\n\tif (isActive) {\n\t\titem.classList.add('notectl-heading-picker__item--active');\n\t}\n\n\tconst check: HTMLSpanElement = document.createElement('span');\n\tcheck.className = 'notectl-heading-picker__check';\n\tcheck.textContent = isActive ? '\\u2713' : '';\n\titem.appendChild(check);\n\n\tconst labelSpan: HTMLSpanElement = document.createElement('span');\n\tlabelSpan.className = 'notectl-heading-picker__label';\n\tlabelSpan.textContent = label;\n\tif (style) {\n\t\tlabelSpan.style.fontSize = style.fontSize;\n\t\tlabelSpan.style.fontWeight = style.fontWeight;\n\t}\n\titem.appendChild(labelSpan);\n\n\titem.addEventListener('mousedown', handler);\n\treturn item;\n}\n\n// --- Helpers ---\n\nfunction getHeadingLabel(locale: HeadingLocale, level: HeadingLevel): string {\n\tconst key = `heading${level}` as keyof HeadingLocale;\n\treturn locale[key] as string;\n}\n\nfunction getActiveLabel(state: EditorState, context: PluginContext, locale: HeadingLocale): string {\n\tif (isNodeSelection(state.selection) || isGapCursor(state.selection)) return locale.paragraph;\n\tconst entries = context.getBlockTypePickerRegistry().getBlockTypePickerEntries();\n\tfor (const entry of entries) {\n\t\tif (entry.isActive(state)) return entry.label;\n\t}\n\treturn locale.paragraph;\n}\n","/**\n * Command registration and implementations for heading block types.\n * Handles toggle between heading/title/subtitle and paragraph,\n * plus excluded-mark stripping when switching block types.\n */\n\nimport type { BlockNode, Mark } from '../../model/Document.js';\nimport { getBlockLength, getInlineChildren, isTextNode } from '../../model/Document.js';\nimport { isGapCursor, isNodeSelection } from '../../model/Selection.js';\nimport { type NodeTypeName, nodeType } from '../../model/TypeBrands.js';\nimport type { EditorState } from '../../state/EditorState.js';\nimport type { TransactionBuilder } from '../../state/Transaction.js';\nimport type { PluginContext } from '../Plugin.js';\nimport type { HeadingConfig, HeadingLevel } from './HeadingPlugin.js';\n\n/** Registers all heading commands (setTitle, setSubtitle, setHeadingN, toggleHeading, setParagraph). */\nexport function registerHeadingCommands(context: PluginContext, config: HeadingConfig): void {\n\tcontext.registerCommand('setTitle', () => toggleSpecialBlock(context, 'title'));\n\n\tcontext.registerCommand('setSubtitle', () => toggleSpecialBlock(context, 'subtitle'));\n\n\tfor (const level of config.levels) {\n\t\tcontext.registerCommand(`setHeading${level}`, () => toggleHeading(context, level));\n\t}\n\n\tcontext.registerCommand('toggleHeading', () => toggleHeading(context, 1));\n\n\tcontext.registerCommand('setParagraph', () => setBlockType(context, nodeType('paragraph')));\n}\n\n// --- Command Implementations ---\n\n/**\n * Toggles between a special block type (title/subtitle) and paragraph.\n * If the block is already that type, resets to paragraph.\n */\nfunction toggleSpecialBlock(context: PluginContext, type: string): boolean {\n\tconst state: EditorState = context.getState();\n\tif (isNodeSelection(state.selection) || isGapCursor(state.selection)) return false;\n\n\tconst block: BlockNode | undefined = state.getBlock(state.selection.anchor.blockId);\n\tif (!block) return false;\n\n\tif (block.type === type) {\n\t\treturn setBlockType(context, nodeType('paragraph'));\n\t}\n\n\treturn setBlockType(context, nodeType(type) as NodeTypeName);\n}\n\n/**\n * Toggles between heading (at given level) and paragraph.\n * If the block is already a heading at the same level, resets to paragraph.\n */\nfunction toggleHeading(context: PluginContext, level: HeadingLevel): boolean {\n\tconst state: EditorState = context.getState();\n\tconst sel = state.selection;\n\tif (isNodeSelection(sel) || isGapCursor(sel)) return false;\n\n\tconst block: BlockNode | undefined = state.getBlock(sel.anchor.blockId);\n\tif (!block) return false;\n\n\tif (block.type === 'heading' && block.attrs?.level === level) {\n\t\treturn setBlockType(context, nodeType('paragraph'));\n\t}\n\n\treturn setBlockType(context, nodeType('heading'), { level });\n}\n\nfunction setBlockType(\n\tcontext: PluginContext,\n\ttype: NodeTypeName,\n\tattrs?: Record<string, string | number | boolean>,\n): boolean {\n\tconst state: EditorState = context.getState();\n\tconst sel = state.selection;\n\tif (isNodeSelection(sel) || isGapCursor(sel)) return false;\n\n\tconst block: BlockNode | undefined = state.getBlock(sel.anchor.blockId);\n\tif (!block) return false;\n\n\tconst builder: TransactionBuilder = state.transaction('command');\n\n\tconst spec = context.getSchemaRegistry().getNodeSpec(type);\n\tif (spec?.excludeMarks && spec.excludeMarks.length > 0) {\n\t\tstripExcludedMarks(builder, block, spec.excludeMarks);\n\t\tclearExcludedStoredMarks(builder, state, spec.excludeMarks);\n\t}\n\n\tconst tr = builder.setBlockType(sel.anchor.blockId, type, attrs).setSelection(sel).build();\n\tcontext.dispatch(tr);\n\treturn true;\n}\n\n// --- Mark Stripping Helpers ---\n\n/**\n * Adds removeMark steps for each excluded mark type found\n * on the block's inline text content.\n */\nfunction stripExcludedMarks(\n\tbuilder: TransactionBuilder,\n\tblock: BlockNode,\n\texcludeMarks: readonly string[],\n): void {\n\tconst blockLength: number = getBlockLength(block);\n\tif (blockLength === 0) return;\n\n\tconst excludeSet: Set<string> = new Set(excludeMarks);\n\tconst inlineChildren = getInlineChildren(block);\n\tlet offset = 0;\n\n\tfor (const child of inlineChildren) {\n\t\tif (isTextNode(child)) {\n\t\t\tif (child.text.length > 0) {\n\t\t\t\tfor (const mark of child.marks) {\n\t\t\t\t\tif (excludeSet.has(mark.type)) {\n\t\t\t\t\t\tbuilder.removeMark(block.id, offset, offset + child.text.length, mark);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\toffset += child.text.length;\n\t\t} else {\n\t\t\toffset += 1;\n\t\t}\n\t}\n}\n\n/**\n * Clears excluded mark types from stored marks so that\n * subsequent typing does not reintroduce them.\n */\nfunction clearExcludedStoredMarks(\n\tbuilder: TransactionBuilder,\n\tstate: EditorState,\n\texcludeMarks: readonly string[],\n): void {\n\tif (!state.storedMarks) return;\n\n\tconst excludeSet: Set<string> = new Set(excludeMarks);\n\tconst filtered: readonly Mark[] = state.storedMarks.filter((m: Mark) => !excludeSet.has(m.type));\n\n\tif (filtered.length !== state.storedMarks.length) {\n\t\tbuilder.setStoredMarks(filtered.length > 0 ? filtered : null, state.storedMarks);\n\t}\n}\n","/**\n * Keyboard handlers for heading block types.\n * Handles Enter key behavior: empty heading → paragraph, cursor at end → split + paragraph.\n */\n\nimport type { BlockNode } from '../../model/Document.js';\nimport { generateBlockId, getBlockLength, getBlockText } from '../../model/Document.js';\nimport {\n\tcreateCollapsedSelection,\n\tisCollapsed,\n\tisGapCursor,\n\tisNodeSelection,\n} from '../../model/Selection.js';\nimport type { BlockId } from '../../model/TypeBrands.js';\nimport { nodeType } from '../../model/TypeBrands.js';\nimport type { EditorState } from '../../state/EditorState.js';\nimport type { PluginContext } from '../Plugin.js';\nimport type { HeadingConfig } from './HeadingPlugin.js';\n\n// --- Context Guard ---\n\nconst HEADING_TYPES: ReadonlySet<string> = new Set(['heading', 'title', 'subtitle']);\n\ninterface HeadingContext {\n\treadonly state: EditorState;\n\treadonly block: BlockNode;\n\treadonly blockId: BlockId;\n\treadonly offset: number;\n}\n\n/**\n * Guards against NodeSelection, non-collapsed selections, and non-heading blocks.\n * Returns false (not handled) if the cursor is not inside a heading-type block.\n */\nfunction withHeadingContext(\n\tcontext: PluginContext,\n\thandler: (ctx: HeadingContext) => boolean,\n): boolean {\n\tconst state: EditorState = context.getState();\n\tif (isNodeSelection(state.selection) || isGapCursor(state.selection)) return false;\n\n\tconst sel = state.selection;\n\tif (!isCollapsed(sel)) return false;\n\n\tconst block: BlockNode | undefined = state.getBlock(sel.anchor.blockId);\n\tif (!block || !HEADING_TYPES.has(block.type)) return false;\n\n\treturn handler({\n\t\tstate,\n\t\tblock,\n\t\tblockId: sel.anchor.blockId,\n\t\toffset: sel.anchor.offset,\n\t});\n}\n\n/** Registers all heading keyboard handlers (Enter, Mod-Shift-N shortcuts). */\nexport function registerHeadingKeymaps(context: PluginContext, config: HeadingConfig): void {\n\tconst keymap: Record<string, () => boolean> = {\n\t\tEnter: () => handleEnter(context),\n\t};\n\n\tfor (const level of config.levels) {\n\t\tif (level <= 6) {\n\t\t\tkeymap[`Mod-Shift-${level}`] = () => context.executeCommand(`setHeading${level}`);\n\t\t}\n\t}\n\n\tcontext.registerKeymap(keymap);\n}\n\n// --- Enter Handler ---\n\n/**\n * Handles Enter inside a heading block.\n * Empty heading → convert to paragraph.\n * Cursor at end → split and convert new block to paragraph.\n * Cursor in middle → normal split (both stay heading).\n */\nfunction handleEnter(context: PluginContext): boolean {\n\treturn withHeadingContext(context, (ctx) => {\n\t\tconst text: string = getBlockText(ctx.block);\n\n\t\tif (text === '') {\n\t\t\tconst tr = ctx.state\n\t\t\t\t.transaction('input')\n\t\t\t\t.setBlockType(ctx.blockId, nodeType('paragraph'))\n\t\t\t\t.setSelection(ctx.state.selection)\n\t\t\t\t.build();\n\t\t\tcontext.dispatch(tr);\n\t\t\treturn true;\n\t\t}\n\n\t\tconst blockLength: number = getBlockLength(ctx.block);\n\n\t\tif (ctx.offset >= blockLength) {\n\t\t\tconst newBlockId = generateBlockId();\n\t\t\tconst tr = ctx.state\n\t\t\t\t.transaction('input')\n\t\t\t\t.splitBlock(ctx.blockId, ctx.offset, newBlockId)\n\t\t\t\t.setBlockType(newBlockId, nodeType('paragraph'))\n\t\t\t\t.setSelection(createCollapsedSelection(newBlockId, 0))\n\t\t\t\t.build();\n\t\t\tcontext.dispatch(tr);\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t});\n}\n","/**\n * Locale interface and default English locale for the HeadingPlugin.\n */\n\n// --- Locale Interface ---\n\nexport interface HeadingLocale {\n\treadonly paragraph: string;\n\treadonly title: string;\n\treadonly subtitle: string;\n\treadonly heading1: string;\n\treadonly heading2: string;\n\treadonly heading3: string;\n\treadonly heading4: string;\n\treadonly heading5: string;\n\treadonly heading6: string;\n\treadonly blockTypeLabel: string;\n\treadonly blockTypesAria: string;\n}\n\n// --- Default English Locale ---\n\nexport const HEADING_LOCALE_EN: HeadingLocale = {\n\tparagraph: 'Paragraph',\n\ttitle: 'Title',\n\tsubtitle: 'Subtitle',\n\theading1: 'Heading 1',\n\theading2: 'Heading 2',\n\theading3: 'Heading 3',\n\theading4: 'Heading 4',\n\theading5: 'Heading 5',\n\theading6: 'Heading 6',\n\tblockTypeLabel: 'Block Type',\n\tblockTypesAria: 'Block types',\n};\n\n// --- German Locale ---\n\nexport const HEADING_LOCALE_DE: HeadingLocale = {\n\tparagraph: 'Absatz',\n\ttitle: 'Titel',\n\tsubtitle: 'Untertitel',\n\theading1: 'Überschrift 1',\n\theading2: 'Überschrift 2',\n\theading3: 'Überschrift 3',\n\theading4: 'Überschrift 4',\n\theading5: 'Überschrift 5',\n\theading6: 'Überschrift 6',\n\tblockTypeLabel: 'Blocktyp',\n\tblockTypesAria: 'Blocktypen',\n};\n\n// --- Spanish Locale ---\n\nexport const HEADING_LOCALE_ES: HeadingLocale = {\n\tparagraph: 'Párrafo',\n\ttitle: 'Título',\n\tsubtitle: 'Subtítulo',\n\theading1: 'Encabezado 1',\n\theading2: 'Encabezado 2',\n\theading3: 'Encabezado 3',\n\theading4: 'Encabezado 4',\n\theading5: 'Encabezado 5',\n\theading6: 'Encabezado 6',\n\tblockTypeLabel: 'Tipo de bloque',\n\tblockTypesAria: 'Tipos de bloque',\n};\n\n// --- French Locale ---\n\nexport const HEADING_LOCALE_FR: HeadingLocale = {\n\tparagraph: 'Paragraphe',\n\ttitle: 'Titre',\n\tsubtitle: 'Sous-titre',\n\theading1: 'Titre 1',\n\theading2: 'Titre 2',\n\theading3: 'Titre 3',\n\theading4: 'Titre 4',\n\theading5: 'Titre 5',\n\theading6: 'Titre 6',\n\tblockTypeLabel: 'Type de bloc',\n\tblockTypesAria: 'Types de bloc',\n};\n\n// --- Chinese (Simplified) Locale ---\n\nexport const HEADING_LOCALE_ZH: HeadingLocale = {\n\tparagraph: '正文',\n\ttitle: '标题',\n\tsubtitle: '副标题',\n\theading1: '一级标题',\n\theading2: '二级标题',\n\theading3: '三级标题',\n\theading4: '四级标题',\n\theading5: '五级标题',\n\theading6: '六级标题',\n\tblockTypeLabel: '块类型',\n\tblockTypesAria: '块类型列表',\n};\n\n// --- Russian Locale ---\n\nexport const HEADING_LOCALE_RU: HeadingLocale = {\n\tparagraph: 'Абзац',\n\ttitle: 'Заголовок',\n\tsubtitle: 'Подзаголовок',\n\theading1: 'Заголовок 1',\n\theading2: 'Заголовок 2',\n\theading3: 'Заголовок 3',\n\theading4: 'Заголовок 4',\n\theading5: 'Заголовок 5',\n\theading6: 'Заголовок 6',\n\tblockTypeLabel: 'Тип блока',\n\tblockTypesAria: 'Типы блоков',\n};\n\n// --- Arabic Locale ---\n\nexport const HEADING_LOCALE_AR: HeadingLocale = {\n\tparagraph: 'فقرة',\n\ttitle: 'عنوان',\n\tsubtitle: 'عنوان فرعي',\n\theading1: 'عنوان 1',\n\theading2: 'عنوان 2',\n\theading3: 'عنوان 3',\n\theading4: 'عنوان 4',\n\theading5: 'عنوان 5',\n\theading6: 'عنوان 6',\n\tblockTypeLabel: 'نوع الكتلة',\n\tblockTypesAria: 'أنواع الكتل',\n};\n\n// --- Hindi Locale ---\n\nexport const HEADING_LOCALE_HI: HeadingLocale = {\n\tparagraph: 'अनुच्छेद',\n\ttitle: 'शीर्षक',\n\tsubtitle: 'उपशीर्षक',\n\theading1: 'शीर्षक 1',\n\theading2: 'शीर्षक 2',\n\theading3: 'शीर्षक 3',\n\theading4: 'शीर्षक 4',\n\theading5: 'शीर्षक 5',\n\theading6: 'शीर्षक 6',\n\tblockTypeLabel: 'ब्लॉक प्रकार',\n\tblockTypesAria: 'ब्लॉक प्रकार सूची',\n};\n\n// --- Locale Map ---\n\nexport const HEADING_LOCALES: Record<string, HeadingLocale> = {\n\ten: HEADING_LOCALE_EN,\n\tde: HEADING_LOCALE_DE,\n\tes: HEADING_LOCALE_ES,\n\tfr: HEADING_LOCALE_FR,\n\tzh: HEADING_LOCALE_ZH,\n\tru: HEADING_LOCALE_RU,\n\tar: HEADING_LOCALE_AR,\n\thi: HEADING_LOCALE_HI,\n};\n","/**\n * HeadingPlugin: registers Title, Subtitle, and H1–H6 heading block types\n * with NodeSpec, toggle commands, keyboard shortcuts, input rules, and a\n * combobox-style toolbar dropdown that reflects the current block type.\n *\n * This file is a thin orchestrator — command logic, input rules, keyboard\n * handlers, and picker/toolbar rendering are delegated to dedicated modules.\n */\n\nimport { HEADING_SELECT_CSS } from '../../editor/styles/heading-select.js';\nimport { resolvePluginLocale } from '../../i18n/resolvePluginLocale.js';\nimport { createBlockElement } from '../../model/NodeSpec.js';\nimport type { Plugin, PluginContext } from '../Plugin.js';\nimport type { BlockAlignment } from '../alignment/AlignmentPlugin.js';\nimport {\n\tregisterHeadingPickerEntries,\n\tregisterHeadingToolbarItem,\n} from './HeadingBlockTypePicker.js';\nimport { registerHeadingCommands } from './HeadingCommands.js';\nimport { registerHeadingInputRules } from './HeadingInputRules.js';\nimport { registerHeadingKeymaps } from './HeadingKeyboardHandlers.js';\nimport { HEADING_LOCALES, type HeadingLocale } from './HeadingLocale.js';\n\n// --- Attribute Registry Augmentation ---\n\ndeclare module '../../model/AttrRegistry.js' {\n\tinterface NodeAttrRegistry {\n\t\theading: { level: HeadingLevel; align?: BlockAlignment };\n\t\ttitle: { align?: BlockAlignment };\n\t\tsubtitle: { align?: BlockAlignment };\n\t}\n}\n\n// --- Configuration ---\n\nexport type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;\n\nexport interface HeadingConfig {\n\t/** Which heading levels to enable. Defaults to [1, 2, 3, 4, 5, 6]. */\n\treadonly levels: readonly HeadingLevel[];\n\t/** When true, a separator is rendered after the heading toolbar item. */\n\treadonly separatorAfter?: boolean;\n\treadonly locale?: HeadingLocale;\n}\n\nconst DEFAULT_CONFIG: HeadingConfig = {\n\tlevels: [1, 2, 3, 4, 5, 6],\n};\n\n// --- Heading Tag Mapping ---\n\nconst HEADING_TAGS: Record<HeadingLevel, string> = {\n\t1: 'h1',\n\t2: 'h2',\n\t3: 'h3',\n\t4: 'h4',\n\t5: 'h5',\n\t6: 'h6',\n};\n\n// --- Plugin ---\n\nexport class HeadingPlugin implements Plugin {\n\treadonly id = 'heading';\n\treadonly name = 'Heading';\n\treadonly priority = 30;\n\n\tprivate readonly config: HeadingConfig;\n\tprivate locale!: HeadingLocale;\n\n\tconstructor(config?: Partial<HeadingConfig>) {\n\t\tthis.config = { ...DEFAULT_CONFIG, ...config };\n\t}\n\n\tinit(context: PluginContext): void {\n\t\tthis.locale = resolvePluginLocale(HEADING_LOCALES, context, this.config.locale);\n\t\tcontext.registerStyleSheet(HEADING_SELECT_CSS);\n\n\t\tthis.registerNodeSpecs(context);\n\t\tregisterHeadingCommands(context, this.config);\n\t\tregisterHeadingKeymaps(context, this.config);\n\t\tregisterHeadingInputRules(context, this.config);\n\t\tregisterHeadingPickerEntries(context, this.config, this.locale);\n\t\tregisterHeadingToolbarItem(context, this.config, this.locale);\n\t}\n\n\tprivate registerNodeSpecs(context: PluginContext): void {\n\t\tcontext.registerNodeSpec({\n\t\t\ttype: 'title',\n\t\t\tgroup: 'block',\n\t\t\tcontent: { allow: ['text'] },\n\t\t\texcludeMarks: ['fontSize'],\n\t\t\ttoDOM(node) {\n\t\t\t\tconst el = createBlockElement('h1', node.id);\n\t\t\t\tel.classList.add('notectl-title');\n\t\t\t\treturn el;\n\t\t\t},\n\t\t\ttoHTML(_node, content) {\n\t\t\t\treturn `<h1>${content || '<br>'}</h1>`;\n\t\t\t},\n\t\t\tsanitize: { tags: ['h1'] },\n\t\t});\n\n\t\tcontext.registerNodeSpec({\n\t\t\ttype: 'subtitle',\n\t\t\tgroup: 'block',\n\t\t\tcontent: { allow: ['text'] },\n\t\t\texcludeMarks: ['fontSize'],\n\t\t\ttoDOM(node) {\n\t\t\t\tconst el = createBlockElement('h2', node.id);\n\t\t\t\tel.classList.add('notectl-subtitle');\n\t\t\t\treturn el;\n\t\t\t},\n\t\t\ttoHTML(_node, content) {\n\t\t\t\treturn `<h2>${content || '<br>'}</h2>`;\n\t\t\t},\n\t\t\tsanitize: { tags: ['h2'] },\n\t\t});\n\n\t\tcontext.registerNodeSpec({\n\t\t\ttype: 'heading',\n\t\t\tgroup: 'block',\n\t\t\tcontent: { allow: ['text'] },\n\t\t\texcludeMarks: ['fontSize'],\n\t\t\tattrs: {\n\t\t\t\tlevel: { default: 1 },\n\t\t\t},\n\t\t\ttoDOM(node) {\n\t\t\t\tconst level = node.attrs?.level ?? 1;\n\t\t\t\tconst tag = HEADING_TAGS[level] ?? 'h1';\n\t\t\t\treturn createBlockElement(tag, node.id);\n\t\t\t},\n\t\t\ttoHTML(node, content) {\n\t\t\t\tconst level = (node.attrs?.level ?? 1) as HeadingLevel;\n\t\t\t\tconst tag: string = HEADING_TAGS[level] ?? 'h1';\n\t\t\t\treturn `<${tag}>${content || '<br>'}</${tag}>`;\n\t\t\t},\n\t\t\tparseHTML: [\n\t\t\t\t{ tag: 'h1', getAttrs: () => ({ level: 1 }) },\n\t\t\t\t{ tag: 'h2', getAttrs: () => ({ level: 2 }) },\n\t\t\t\t{ tag: 'h3', getAttrs: () => ({ level: 3 }) },\n\t\t\t\t{ tag: 'h4', getAttrs: () => ({ level: 4 }) },\n\t\t\t\t{ tag: 'h5', getAttrs: () => ({ level: 5 }) },\n\t\t\t\t{ tag: 'h6', getAttrs: () => ({ level: 6 }) },\n\t\t\t],\n\t\t\tsanitize: { tags: ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'] },\n\t\t});\n\t}\n}\n","/** Heading picker toolbar combobox + popup styles. */\nexport const HEADING_SELECT_CSS = `\n/* Heading Select — Width overrides for combobox button */\n.notectl-toolbar-btn--heading {\n\tmin-width: 100px;\n\tmax-width: 160px;\n}\n\n/* Heading Picker Popup */\n.notectl-heading-picker {\n\tmin-width: 200px;\n\tmax-height: 320px;\n\toverflow-y: auto;\n}\n\n.notectl-heading-picker__list {\n\tpadding: 4px 0;\n}\n\n.notectl-heading-picker__item {\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 8px;\n\twidth: 100%;\n\tpadding: 7px 12px;\n\tborder: none;\n\tbackground: none;\n\tcursor: pointer;\n\tfont-size: 14px;\n\tcolor: var(--notectl-fg);\n\ttext-align: left;\n\twhite-space: nowrap;\n\tfont-family: inherit;\n\ttransition: background 0.1s;\n}\n\n.notectl-heading-picker__item:hover {\n\tbackground: var(--notectl-hover-bg);\n}\n\n.notectl-heading-picker__item--active {\n\tbackground: var(--notectl-active-bg);\n\tcolor: var(--notectl-primary-fg);\n}\n\n.notectl-heading-picker__item--active:hover {\n\tbackground: var(--notectl-active-bg);\n}\n\n.notectl-heading-picker__check {\n\tdisplay: inline-flex;\n\talign-items: center;\n\tjustify-content: center;\n\twidth: 16px;\n\tflex-shrink: 0;\n\tfont-size: 13px;\n\tfont-weight: 600;\n\tcolor: var(--notectl-primary-fg);\n}\n\n.notectl-heading-picker__label {\n\tflex: 1;\n}\n`;\n","/**\n * Input rule registration for heading block types.\n * Converts `# `, `## `, etc. at the start of a paragraph into headings.\n */\n\nimport {\n\tcreateCollapsedSelection,\n\tisCollapsed,\n\tisGapCursor,\n\tisNodeSelection,\n} from '../../model/Selection.js';\nimport { nodeType } from '../../model/TypeBrands.js';\nimport type { PluginContext } from '../Plugin.js';\nimport type { HeadingConfig } from './HeadingPlugin.js';\n\n/** Registers markdown-style input rules (e.g. `# ` → H1) for configured heading levels. */\nexport function registerHeadingInputRules(context: PluginContext, config: HeadingConfig): void {\n\tfor (const level of config.levels) {\n\t\tconst hashes: string = '#'.repeat(level);\n\t\tconst pattern: RegExp = new RegExp(`^${hashes} $`);\n\n\t\tcontext.registerInputRule({\n\t\t\tpattern,\n\t\t\thandler(state, _match, start, _end) {\n\t\t\t\tconst sel = state.selection;\n\t\t\t\tif (isNodeSelection(sel) || isGapCursor(sel)) return null;\n\t\t\t\tif (!isCollapsed(sel)) return null;\n\n\t\t\t\tconst block = state.getBlock(sel.anchor.blockId);\n\t\t\t\tif (!block || block.type !== 'paragraph') return null;\n\n\t\t\t\treturn state\n\t\t\t\t\t.transaction('input')\n\t\t\t\t\t.deleteTextAt(sel.anchor.blockId, start, start + level + 1)\n\t\t\t\t\t.setBlockType(sel.anchor.blockId, nodeType('heading'), { level })\n\t\t\t\t\t.setSelection(createCollapsedSelection(sel.anchor.blockId, 0))\n\t\t\t\t\t.build();\n\t\t\t},\n\t\t});\n\t}\n}\n"],"names":["createPickerItem","label","isActive","handler","style","item","document","createElement","type","className","setAttribute","String","classList","add","check","textContent","appendChild","labelSpan","fontSize","fontWeight","addEventListener","getHeadingLabel","locale","level","toggleSpecialBlock","context","state","getState","isNodeSelection","selection","isGapCursor","block","getBlock","anchor","blockId","setBlockType","nodeType","toggleHeading","sel","attrs","builder","transaction","spec","getSchemaRegistry","getNodeSpec","excludeMarks","length","getBlockLength","excludeSet","Set","inlineChildren","getInlineChildren","offset","child","isTextNode","text","mark","marks","has","removeMark","id","storedMarks","filtered","filter","m","setStoredMarks","tr","setSelection","build","dispatch","HEADING_TYPES","HEADING_LOCALE_EN","paragraph","title","subtitle","heading1","heading2","heading3","heading4","heading5","heading6","blockTypeLabel","blockTypesAria","HEADING_LOCALES","en","de","es","fr","zh","ru","ar","hi","DEFAULT_CONFIG","levels","HEADING_TAGS","HeadingPlugin","name","priority","config","this","resolvePluginLocale","registerStyleSheet","registerNodeSpecs","registerCommand","keymap","Enter","isCollapsed","ctx","getBlockText","blockLength","newBlockId","generateBlockId","splitBlock","createCollapsedSelection","executeCommand","registerKeymap","hashes","repeat","pattern","RegExp","registerInputRule","_match","start","_end","deleteTextAt","registerBlockTypePickerEntry","command","registerToolbarItem","group","tooltip","popupType","separatorAfter","getLabel","entries","getBlockTypePickerRegistry","getBlockTypePickerEntries","entry","renderPopup","container","list","active","e","preventDefault","stopPropagation","toolbar","getService","ToolbarServiceKey","closePopup","some","registerNodeSpec","content","allow","node","el","createBlockElement","toHTML","_node","sanitize","tags","default","tag","parseHTML","getAttrs"],"mappings":";;;;;;AAgJA,SAASA,EACRC,IACAC,IACAC,IACAC;AAEA,QAAMC,KAA0BC,SAASC,cAAc,QAAA;AACvDF,EAAAA,GAAKG,OAAO,UACZH,GAAKI,YAAY,gCACjBJ,GAAKK,aAAa,QAAQ,WAC1BL,GAAKK,aAAa,iBAAiBC,OAAOT,EAAAA,CAAAA,GAEtCA,MACHG,GAAKO,UAAUC,IAAI,sCAAA;AAGpB,QAAMC,KAAyBR,SAASC,cAAc,MAAA;AACtDO,EAAAA,GAAML,YAAY,iCAClBK,GAAMC,cAAcb,KAAW,MAAW,IAC1CG,GAAKW,YAAYF;AAEjB,QAAMG,KAA6BX,SAASC,cAAc,MAAA;AAU1D,SATAU,GAAUR,YAAY,iCACtBQ,GAAUF,cAAcd,IACpBG,OACHa,GAAUb,MAAMc,WAAWd,GAAMc,UACjCD,GAAUb,MAAMe,aAAaf,GAAMe,aAEpCd,GAAKW,YAAYC,EAAAA,GAEjBZ,GAAKe,iBAAiB,aAAajB,EAAAA,GAC5BE;AACR;AAIA,SAASgB,EAAgBC,IAAuBC,IAAAA;AAE/C,SAAOD,GADK,UAAUC,EAAAA,EAAAA;AAEvB;ACnJA,SAASC,EAAmBC,IAAwBjB,IAAAA;AACnD,QAAMkB,KAAqBD,GAAQE,SAAAA;AACnC,MAAIC,EAA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