@ablogcms/block-editor 3.2.28-beta.0
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 +21 -0
- package/dist/chunk-4KUPYKHV.mjs +34 -0
- package/dist/chunk-4KUPYKHV.mjs.map +1 -0
- package/dist/chunk-57Q3DEDF.mjs +23 -0
- package/dist/chunk-57Q3DEDF.mjs.map +1 -0
- package/dist/chunk-DUT25D7Z.mjs +20 -0
- package/dist/chunk-DUT25D7Z.mjs.map +1 -0
- package/dist/chunk-EM5TLDPY.mjs +17 -0
- package/dist/chunk-EM5TLDPY.mjs.map +1 -0
- package/dist/chunk-GIHTGDIW.mjs +23 -0
- package/dist/chunk-GIHTGDIW.mjs.map +1 -0
- package/dist/chunk-HNSTT2Z4.mjs +87 -0
- package/dist/chunk-HNSTT2Z4.mjs.map +1 -0
- package/dist/chunk-JYUNKG2P.mjs +88 -0
- package/dist/chunk-JYUNKG2P.mjs.map +1 -0
- package/dist/chunk-OFWQRNO2.mjs +56 -0
- package/dist/chunk-OFWQRNO2.mjs.map +1 -0
- package/dist/chunk-OZG2BL6F.mjs +61 -0
- package/dist/chunk-OZG2BL6F.mjs.map +1 -0
- package/dist/chunk-S24TRRWW.mjs +3126 -0
- package/dist/chunk-S24TRRWW.mjs.map +1 -0
- package/dist/chunk-TKSGCO5Z.mjs +2813 -0
- package/dist/chunk-TKSGCO5Z.mjs.map +1 -0
- package/dist/chunk-XGAKMQH4.mjs +627 -0
- package/dist/chunk-XGAKMQH4.mjs.map +1 -0
- package/dist/components/BlockEditor/BlockEditor.d.ts +36 -0
- package/dist/components/BlockEditor/BlockEditor.mjs +19 -0
- package/dist/components/BlockEditor/BlockEditor.mjs.map +1 -0
- package/dist/components/BlockEditor/index.d.ts +1 -0
- package/dist/components/BlockEditor/types.d.ts +10 -0
- package/dist/components/menus/ContentItemMenu/ContentItemMenu.d.ts +10 -0
- package/dist/components/menus/ContentItemMenu/components/BlockMenus.d.ts +8 -0
- package/dist/components/menus/ContentItemMenu/components/IdEditor.d.ts +5 -0
- package/dist/components/menus/ContentItemMenu/hooks/useContentItemActions.d.ts +17 -0
- package/dist/components/menus/ContentItemMenu/hooks/useData.d.ts +13 -0
- package/dist/components/menus/ContentItemMenu/index.d.ts +1 -0
- package/dist/components/menus/LinkMenu/LinkMenu.d.ts +4 -0
- package/dist/components/menus/LinkMenu/index.d.ts +1 -0
- package/dist/components/menus/TextMenu/TextMenu.d.ts +6 -0
- package/dist/components/menus/TextMenu/components/ContentTypePicker.d.ts +8 -0
- package/dist/components/menus/TextMenu/components/CustomClassPicker.d.ts +6 -0
- package/dist/components/menus/TextMenu/components/EditLinkPopover.d.ts +8 -0
- package/dist/components/menus/TextMenu/components/FontFamilyPicker.d.ts +5 -0
- package/dist/components/menus/TextMenu/components/FontSizePicker.d.ts +5 -0
- package/dist/components/menus/TextMenu/hooks/useTextmenuCommands.d.ts +25 -0
- package/dist/components/menus/TextMenu/hooks/useTextmenuStates.d.ts +22 -0
- package/dist/components/menus/TextMenu/index.d.ts +1 -0
- package/dist/components/menus/index.d.ts +3 -0
- package/dist/components/menus/types.d.ts +18 -0
- package/dist/components/panels/AlignPicker/AlignPicker.d.ts +5 -0
- package/dist/components/panels/AlignPicker/AlignPicker.mjs +12 -0
- package/dist/components/panels/AlignPicker/AlignPicker.mjs.map +1 -0
- package/dist/components/panels/AlignPicker/index.d.ts +1 -0
- package/dist/components/panels/Colorpicker/ColorButton.d.ts +6 -0
- package/dist/components/panels/Colorpicker/ColorButton.mjs +10 -0
- package/dist/components/panels/Colorpicker/ColorButton.mjs.map +1 -0
- package/dist/components/panels/Colorpicker/Colorpicker.d.ts +6 -0
- package/dist/components/panels/Colorpicker/index.d.ts +1 -0
- package/dist/components/panels/LinkEditorPanel/LinkEditorPanel.d.ts +17 -0
- package/dist/components/panels/LinkEditorPanel/index.d.ts +1 -0
- package/dist/components/panels/LinkPreviewPanel/LinkPreviewPanel.d.ts +6 -0
- package/dist/components/panels/LinkPreviewPanel/index.d.ts +1 -0
- package/dist/components/panels/index.d.ts +4 -0
- package/dist/components/ui/Icon.d.ts +5 -0
- package/dist/components/ui/Icon.mjs +7 -0
- package/dist/components/ui/Icon.mjs.map +1 -0
- package/dist/components/ui/Surface.d.ts +6 -0
- package/dist/components/ui/Surface.mjs +10 -0
- package/dist/components/ui/Surface.mjs.map +1 -0
- package/dist/components/ui/Toolbar.d.ts +45 -0
- package/dist/components/ui/Toolbar.mjs +11 -0
- package/dist/components/ui/Toolbar.mjs.map +1 -0
- package/dist/config/blockMenuCategories.d.ts +22 -0
- package/dist/config/blockMenuCategories.mjs +19 -0
- package/dist/config/blockMenuCategories.mjs.map +1 -0
- package/dist/config/blocks/__tests__/createMockEditor.d.ts +29 -0
- package/dist/config/blocks/blockquote.d.ts +3 -0
- package/dist/config/blocks/bulletList.d.ts +3 -0
- package/dist/config/blocks/codeBlock.d.ts +3 -0
- package/dist/config/blocks/columns1.d.ts +3 -0
- package/dist/config/blocks/columns2.d.ts +3 -0
- package/dist/config/blocks/columns3.d.ts +3 -0
- package/dist/config/blocks/createHeadingActions.d.ts +7 -0
- package/dist/config/blocks/file.d.ts +3 -0
- package/dist/config/blocks/heading1.d.ts +3 -0
- package/dist/config/blocks/heading2.d.ts +3 -0
- package/dist/config/blocks/heading3.d.ts +3 -0
- package/dist/config/blocks/heading4.d.ts +3 -0
- package/dist/config/blocks/heading5.d.ts +3 -0
- package/dist/config/blocks/heading6.d.ts +3 -0
- package/dist/config/blocks/horizontalRule.d.ts +3 -0
- package/dist/config/blocks/image.d.ts +3 -0
- package/dist/config/blocks/index.d.ts +13 -0
- package/dist/config/blocks/linkButton.d.ts +3 -0
- package/dist/config/blocks/numberedList.d.ts +3 -0
- package/dist/config/blocks/paragraph.d.ts +3 -0
- package/dist/config/blocks/table.d.ts +3 -0
- package/dist/context/EditorExtensions.d.ts +12 -0
- package/dist/context/EditorExtensions.mjs +18 -0
- package/dist/context/EditorExtensions.mjs.map +1 -0
- package/dist/context/EditorSettings.d.ts +7 -0
- package/dist/context/EditorSettings.mjs +12 -0
- package/dist/context/EditorSettings.mjs.map +1 -0
- package/dist/dataview/column-type.d.ts +11 -0
- package/dist/dataview/column-type.mjs +14 -0
- package/dist/dataview/column-type.mjs.map +1 -0
- package/dist/extensions/BaseBlock/BaseBlock.d.ts +12 -0
- package/dist/extensions/BaseBlock/index.d.ts +1 -0
- package/dist/extensions/BlockquoteFigure/BlockquoteFigure.d.ts +11 -0
- package/dist/extensions/BlockquoteFigure/Quote/Quote.d.ts +3 -0
- package/dist/extensions/BlockquoteFigure/Quote/index.d.ts +1 -0
- package/dist/extensions/BlockquoteFigure/QuoteCaption/QuoteCaption.d.ts +3 -0
- package/dist/extensions/BlockquoteFigure/QuoteCaption/index.d.ts +1 -0
- package/dist/extensions/BlockquoteFigure/index.d.ts +1 -0
- package/dist/extensions/CustomConvertBlock/CustomConvertBlock.d.ts +14 -0
- package/dist/extensions/CustomConvertBlock/index.d.ts +1 -0
- package/dist/extensions/CustomMark/CustomMark.d.ts +3 -0
- package/dist/extensions/CustomMark/index.d.ts +1 -0
- package/dist/extensions/Document/Document.d.ts +2 -0
- package/dist/extensions/Document/index.d.ts +1 -0
- package/dist/extensions/Figcaption/Figcaption.d.ts +5 -0
- package/dist/extensions/Figcaption/index.d.ts +1 -0
- package/dist/extensions/Figure/Figure.d.ts +5 -0
- package/dist/extensions/Figure/index.d.ts +1 -0
- package/dist/extensions/FileBlock/FileBlock.d.ts +25 -0
- package/dist/extensions/FileBlock/components/FileBlockCaption.d.ts +6 -0
- package/dist/extensions/FileBlock/components/FileBlockMenu.d.ts +4 -0
- package/dist/extensions/FileBlock/components/FileBlockView.d.ts +9 -0
- package/dist/extensions/FileBlock/index.d.ts +1 -0
- package/dist/extensions/FileBlock/mediaUpdateHooks.d.ts +10 -0
- package/dist/extensions/FontStyle/FontStyle.d.ts +20 -0
- package/dist/extensions/FontStyle/index.d.ts +1 -0
- package/dist/extensions/Heading/Heading.d.ts +2 -0
- package/dist/extensions/Heading/index.d.ts +1 -0
- package/dist/extensions/HorizontalRule/HorizontalRule.d.ts +2 -0
- package/dist/extensions/HorizontalRule/index.d.ts +1 -0
- package/dist/extensions/Image/Image.d.ts +2 -0
- package/dist/extensions/Image/index.d.ts +1 -0
- package/dist/extensions/ImageBlock/ImageBlock.d.ts +34 -0
- package/dist/extensions/ImageBlock/components/ImageBlockCaption.d.ts +6 -0
- package/dist/extensions/ImageBlock/components/ImageBlockLink.d.ts +6 -0
- package/dist/extensions/ImageBlock/components/ImageBlockMenu.d.ts +4 -0
- package/dist/extensions/ImageBlock/components/ImageBlockView.d.ts +9 -0
- package/dist/extensions/ImageBlock/components/ImageBlockWidth.d.ts +5 -0
- package/dist/extensions/ImageBlock/index.d.ts +1 -0
- package/dist/extensions/ImageBlock/mediaUpdateHooks.d.ts +10 -0
- package/dist/extensions/Link/Link.d.ts +4 -0
- package/dist/extensions/Link/index.d.ts +1 -0
- package/dist/extensions/LinkButton/LinkButton.d.ts +15 -0
- package/dist/extensions/LinkButton/components/LinkButtonMenu.d.ts +4 -0
- package/dist/extensions/LinkButton/components/LinkButtonView.d.ts +7 -0
- package/dist/extensions/LinkButton/index.d.ts +1 -0
- package/dist/extensions/MediaUpload/MediaUpload.d.ts +12 -0
- package/dist/extensions/MediaUpload/index.d.ts +1 -0
- package/dist/extensions/MediaUpload/view/Dropzone.d.ts +7 -0
- package/dist/extensions/MediaUpload/view/filterFilesByMediaType.d.ts +10 -0
- package/dist/extensions/MediaUpload/view/hooks.d.ts +26 -0
- package/dist/extensions/MediaUpload/view/index.d.ts +1 -0
- package/dist/extensions/MediaUpload/view/insertMediaBlocks.d.ts +22 -0
- package/dist/extensions/MultiColumn/Column.d.ts +3 -0
- package/dist/extensions/MultiColumn/Columns.d.ts +16 -0
- package/dist/extensions/MultiColumn/index.d.ts +2 -0
- package/dist/extensions/PasteHandler/PasteHandler.d.ts +4 -0
- package/dist/extensions/PasteHandler/index.d.ts +1 -0
- package/dist/extensions/Selection/Selection.d.ts +3 -0
- package/dist/extensions/Selection/index.d.ts +1 -0
- package/dist/extensions/SlashCommand/BlockMenu.d.ts +9 -0
- package/dist/extensions/SlashCommand/SlashCommand.d.ts +18 -0
- package/dist/extensions/SlashCommand/index.d.ts +1 -0
- package/dist/extensions/Table/Cell.d.ts +12 -0
- package/dist/extensions/Table/Header.d.ts +9 -0
- package/dist/extensions/Table/Row.d.ts +2 -0
- package/dist/extensions/Table/Table.d.ts +9 -0
- package/dist/extensions/Table/index.d.ts +4 -0
- package/dist/extensions/Table/menus/ColorPicker.d.ts +4 -0
- package/dist/extensions/Table/menus/TableColumn/index.d.ts +4 -0
- package/dist/extensions/Table/menus/TableColumn/utils.d.ts +8 -0
- package/dist/extensions/Table/menus/TableMenu/index.d.ts +4 -0
- package/dist/extensions/Table/menus/TableRow/index.d.ts +4 -0
- package/dist/extensions/Table/menus/TableRow/utils.d.ts +8 -0
- package/dist/extensions/Table/menus/hooks.d.ts +5 -0
- package/dist/extensions/Table/menus/index.d.ts +3 -0
- package/dist/extensions/Table/utils.d.ts +44 -0
- package/dist/extensions/TrailingNode/index.d.ts +1 -0
- package/dist/extensions/TrailingNode/trailing-node.d.ts +11 -0
- package/dist/extensions/extension-kit.d.ts +10 -0
- package/dist/extensions/index.d.ts +34 -0
- package/dist/extensions/mediaBlockContent.d.ts +41 -0
- package/dist/hooks/resolveCommands.d.ts +10 -0
- package/dist/hooks/useBlockEditor.d.ts +27 -0
- package/dist/hooks/useBlockMenus.d.ts +17 -0
- package/dist/hooks/useEditorViewDom.d.ts +15 -0
- package/dist/hooks/useFrequentlyUsed.d.ts +6 -0
- package/dist/hooks/useSettings.d.ts +10 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.mjs +33 -0
- package/dist/index.mjs.map +1 -0
- package/dist/lib/utils/commandUsageStorage.d.ts +14 -0
- package/dist/lib/utils/index.d.ts +5 -0
- package/dist/lib/utils/isCustomNodeSelected.d.ts +4 -0
- package/dist/lib/utils/isTextSelected.d.ts +5 -0
- package/dist/tiptap/core.d.ts +1 -0
- package/dist/tiptap/core.mjs +3 -0
- package/dist/tiptap/core.mjs.map +1 -0
- package/dist/tiptap/pm/changeset.d.ts +1 -0
- package/dist/tiptap/pm/changeset.mjs +3 -0
- package/dist/tiptap/pm/changeset.mjs.map +1 -0
- package/dist/tiptap/pm/commands.d.ts +1 -0
- package/dist/tiptap/pm/commands.mjs +3 -0
- package/dist/tiptap/pm/commands.mjs.map +1 -0
- package/dist/tiptap/pm/dropcursor.d.ts +1 -0
- package/dist/tiptap/pm/dropcursor.mjs +3 -0
- package/dist/tiptap/pm/dropcursor.mjs.map +1 -0
- package/dist/tiptap/pm/gapcursor.d.ts +1 -0
- package/dist/tiptap/pm/gapcursor.mjs +3 -0
- package/dist/tiptap/pm/gapcursor.mjs.map +1 -0
- package/dist/tiptap/pm/history.d.ts +1 -0
- package/dist/tiptap/pm/history.mjs +3 -0
- package/dist/tiptap/pm/history.mjs.map +1 -0
- package/dist/tiptap/pm/inputrules.d.ts +1 -0
- package/dist/tiptap/pm/inputrules.mjs +3 -0
- package/dist/tiptap/pm/inputrules.mjs.map +1 -0
- package/dist/tiptap/pm/keymap.d.ts +1 -0
- package/dist/tiptap/pm/keymap.mjs +3 -0
- package/dist/tiptap/pm/keymap.mjs.map +1 -0
- package/dist/tiptap/pm/model.d.ts +1 -0
- package/dist/tiptap/pm/model.mjs +3 -0
- package/dist/tiptap/pm/model.mjs.map +1 -0
- package/dist/tiptap/pm/schema-list.d.ts +1 -0
- package/dist/tiptap/pm/schema-list.mjs +3 -0
- package/dist/tiptap/pm/schema-list.mjs.map +1 -0
- package/dist/tiptap/pm/state.d.ts +1 -0
- package/dist/tiptap/pm/state.mjs +3 -0
- package/dist/tiptap/pm/state.mjs.map +1 -0
- package/dist/tiptap/pm/tables.d.ts +1 -0
- package/dist/tiptap/pm/tables.mjs +3 -0
- package/dist/tiptap/pm/tables.mjs.map +1 -0
- package/dist/tiptap/pm/transform.d.ts +1 -0
- package/dist/tiptap/pm/transform.mjs +3 -0
- package/dist/tiptap/pm/transform.mjs.map +1 -0
- package/dist/tiptap/pm/view.d.ts +1 -0
- package/dist/tiptap/pm/view.mjs +3 -0
- package/dist/tiptap/pm/view.mjs.map +1 -0
- package/dist/tiptap/react.d.ts +1 -0
- package/dist/tiptap/react.mjs +3 -0
- package/dist/tiptap/react.mjs.map +1 -0
- package/dist/tiptap/suggestion.d.ts +3 -0
- package/dist/tiptap/suggestion.mjs +8 -0
- package/dist/tiptap/suggestion.mjs.map +1 -0
- package/dist/tiptap/tiptap.d.ts +48 -0
- package/dist/tiptap/tiptap.mjs +41 -0
- package/dist/tiptap/tiptap.mjs.map +1 -0
- package/dist/types/index.d.ts +149 -0
- package/dist/types/index.mjs +1 -0
- package/dist/types/index.mjs.map +1 -0
- package/dist/utils/createBlockMenu.d.ts +30 -0
- package/dist/utils/createProps.d.ts +7 -0
- package/dist/utils/createProps.mjs +7 -0
- package/dist/utils/createProps.mjs.map +1 -0
- package/dist/utils/mergeBlockDefinitions.d.ts +10 -0
- package/dist/utils/mergeBlockDefinitions.mjs +8 -0
- package/dist/utils/mergeBlockDefinitions.mjs.map +1 -0
- package/dist/utils/mergeSettings.d.ts +11 -0
- package/dist/utils/normalizeSettings.d.ts +28 -0
- package/dist/utils/normalizeSettings.mjs +13 -0
- package/dist/utils/normalizeSettings.mjs.map +1 -0
- package/package.json +243 -0
|
@@ -0,0 +1,627 @@
|
|
|
1
|
+
// src/config/blocks/paragraph.ts
|
|
2
|
+
var paragraph = {
|
|
3
|
+
label: "\u6BB5\u843D",
|
|
4
|
+
icon: "title",
|
|
5
|
+
description: "\u6BB5\u843D",
|
|
6
|
+
isTextMenu: true,
|
|
7
|
+
aliases: ["p", "paragraph", "text"],
|
|
8
|
+
menuCategory: "basic",
|
|
9
|
+
createActions: (cmd, ctx) => ({
|
|
10
|
+
action: (editor) => {
|
|
11
|
+
ctx.recordUsage(cmd);
|
|
12
|
+
editor.chain().focus().setParagraph().run();
|
|
13
|
+
const { $from } = editor.state.selection;
|
|
14
|
+
const pos = $from.before($from.depth);
|
|
15
|
+
editor.chain().focus().setBlockAttrs(pos, { class: cmd.class }).run();
|
|
16
|
+
},
|
|
17
|
+
convert: (editor, pos) => {
|
|
18
|
+
const chain = editor.chain();
|
|
19
|
+
chain.setNodeSelection(pos);
|
|
20
|
+
chain.removeList(pos).removeBlockquote(pos).setParagraph().run();
|
|
21
|
+
const { $from } = editor.state.selection;
|
|
22
|
+
const newPos = $from.before(1);
|
|
23
|
+
editor.chain().focus().setBlockAttrs(newPos, { class: cmd.class }).run();
|
|
24
|
+
},
|
|
25
|
+
isDisabled: (editor) => {
|
|
26
|
+
const isSame = cmd.class ? editor.isActive("paragraph", { class: cmd.class }) : editor.isActive("paragraph", { class: null }) || editor.isActive("paragraph", { class: "" });
|
|
27
|
+
if (isSame) {
|
|
28
|
+
return true;
|
|
29
|
+
}
|
|
30
|
+
if (editor.isActive("paragraph")) {
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
33
|
+
return !editor.can().setParagraph();
|
|
34
|
+
},
|
|
35
|
+
isActive: (editor) => {
|
|
36
|
+
if (cmd.class) {
|
|
37
|
+
return editor.isActive("paragraph", { class: cmd.class });
|
|
38
|
+
}
|
|
39
|
+
return editor.isActive("paragraph", { class: null }) || editor.isActive("paragraph", { class: "" });
|
|
40
|
+
}
|
|
41
|
+
})
|
|
42
|
+
};
|
|
43
|
+
var paragraph_default = paragraph;
|
|
44
|
+
|
|
45
|
+
// src/config/blocks/createHeadingActions.ts
|
|
46
|
+
function createHeadingActions(level) {
|
|
47
|
+
return (cmd, ctx) => ({
|
|
48
|
+
action: (editor) => {
|
|
49
|
+
ctx.recordUsage(cmd);
|
|
50
|
+
editor.chain().focus().setHeading({ level }).run();
|
|
51
|
+
const { $from } = editor.state.selection;
|
|
52
|
+
const pos = $from.before($from.depth);
|
|
53
|
+
editor.chain().focus().setBlockAttrs(pos, { class: cmd.class }).run();
|
|
54
|
+
},
|
|
55
|
+
convert: (editor, pos) => {
|
|
56
|
+
const chain = editor.chain();
|
|
57
|
+
chain.setNodeSelection(pos);
|
|
58
|
+
chain.removeList(pos).removeBlockquote(pos).setHeading({ level }).run();
|
|
59
|
+
const { $from } = editor.state.selection;
|
|
60
|
+
const newPos = $from.before(1);
|
|
61
|
+
editor.chain().focus().setBlockAttrs(newPos, { class: cmd.class }).run();
|
|
62
|
+
},
|
|
63
|
+
isDisabled: (editor) => {
|
|
64
|
+
const isSame = cmd.class ? editor.isActive("heading", { level, class: cmd.class }) : editor.isActive("heading", { level, class: null }) || editor.isActive("heading", { level, class: "" });
|
|
65
|
+
if (isSame) {
|
|
66
|
+
return true;
|
|
67
|
+
}
|
|
68
|
+
if (editor.isActive("heading", { level })) {
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
71
|
+
return !editor.can().setHeading({ level });
|
|
72
|
+
},
|
|
73
|
+
isActive: (editor) => {
|
|
74
|
+
if (cmd.class) {
|
|
75
|
+
return editor.isActive("heading", { level, class: cmd.class });
|
|
76
|
+
}
|
|
77
|
+
return editor.isActive("heading", { level, class: null }) || editor.isActive("heading", { level, class: "" });
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// src/config/blocks/heading1.ts
|
|
83
|
+
var heading1 = {
|
|
84
|
+
label: "\u898B\u51FA\u30571",
|
|
85
|
+
icon: "format_h1",
|
|
86
|
+
description: "\u898B\u51FA\u3057",
|
|
87
|
+
isTextMenu: true,
|
|
88
|
+
aliases: ["h1", "heading1"],
|
|
89
|
+
menuCategory: "basic",
|
|
90
|
+
createActions: createHeadingActions(1)
|
|
91
|
+
};
|
|
92
|
+
var heading1_default = heading1;
|
|
93
|
+
|
|
94
|
+
// src/config/blocks/heading2.ts
|
|
95
|
+
var heading2 = {
|
|
96
|
+
label: "\u898B\u51FA\u30572",
|
|
97
|
+
icon: "format_h2",
|
|
98
|
+
description: "\u898B\u51FA\u30572",
|
|
99
|
+
isTextMenu: true,
|
|
100
|
+
aliases: ["h2", "heading2"],
|
|
101
|
+
menuCategory: "basic",
|
|
102
|
+
createActions: createHeadingActions(2)
|
|
103
|
+
};
|
|
104
|
+
var heading2_default = heading2;
|
|
105
|
+
|
|
106
|
+
// src/config/blocks/heading3.ts
|
|
107
|
+
var heading3 = {
|
|
108
|
+
label: "\u898B\u51FA\u30573",
|
|
109
|
+
icon: "format_h3",
|
|
110
|
+
description: "\u898B\u51FA\u30573",
|
|
111
|
+
isTextMenu: true,
|
|
112
|
+
aliases: ["h3", "heading3"],
|
|
113
|
+
menuCategory: "basic",
|
|
114
|
+
createActions: createHeadingActions(3)
|
|
115
|
+
};
|
|
116
|
+
var heading3_default = heading3;
|
|
117
|
+
|
|
118
|
+
// src/config/blocks/heading4.ts
|
|
119
|
+
var heading4 = {
|
|
120
|
+
label: "\u898B\u51FA\u30574",
|
|
121
|
+
icon: "format_h4",
|
|
122
|
+
description: "\u898B\u51FA\u30574",
|
|
123
|
+
isTextMenu: true,
|
|
124
|
+
aliases: ["h4", "heading4"],
|
|
125
|
+
menuCategory: "basic",
|
|
126
|
+
createActions: createHeadingActions(4)
|
|
127
|
+
};
|
|
128
|
+
var heading4_default = heading4;
|
|
129
|
+
|
|
130
|
+
// src/config/blocks/heading5.ts
|
|
131
|
+
var heading5 = {
|
|
132
|
+
label: "\u898B\u51FA\u30575",
|
|
133
|
+
icon: "format_h5",
|
|
134
|
+
description: "\u898B\u51FA\u30575",
|
|
135
|
+
isTextMenu: true,
|
|
136
|
+
aliases: ["h5", "heading5"],
|
|
137
|
+
menuCategory: "basic",
|
|
138
|
+
createActions: createHeadingActions(5)
|
|
139
|
+
};
|
|
140
|
+
var heading5_default = heading5;
|
|
141
|
+
|
|
142
|
+
// src/config/blocks/heading6.ts
|
|
143
|
+
var heading6 = {
|
|
144
|
+
label: "\u898B\u51FA\u30576",
|
|
145
|
+
icon: "format_h6",
|
|
146
|
+
description: "\u898B\u51FA\u30576",
|
|
147
|
+
isTextMenu: true,
|
|
148
|
+
aliases: ["h6", "heading6"],
|
|
149
|
+
menuCategory: "basic",
|
|
150
|
+
createActions: createHeadingActions(6)
|
|
151
|
+
};
|
|
152
|
+
var heading6_default = heading6;
|
|
153
|
+
|
|
154
|
+
// src/config/blocks/bulletList.ts
|
|
155
|
+
var bulletList = {
|
|
156
|
+
label: "\u30EA\u30B9\u30C8",
|
|
157
|
+
icon: "format_list_bulleted",
|
|
158
|
+
description: "\u9806\u5E8F\u306A\u3057\u30EA\u30B9\u30C8",
|
|
159
|
+
isTextMenu: true,
|
|
160
|
+
aliases: ["ul", "list"],
|
|
161
|
+
menuCategory: "basic",
|
|
162
|
+
createActions: (cmd, ctx) => ({
|
|
163
|
+
action: (editor) => {
|
|
164
|
+
ctx.recordUsage(cmd);
|
|
165
|
+
editor.chain().focus().toggleBulletList().run();
|
|
166
|
+
const { $from } = editor.state.selection;
|
|
167
|
+
for (let { depth } = $from; depth > 0; depth--) {
|
|
168
|
+
const node = $from.node(depth);
|
|
169
|
+
if (node.type.name === "bulletList") {
|
|
170
|
+
const pos = $from.before(depth);
|
|
171
|
+
editor.chain().focus().setBlockAttrs(pos, { class: cmd.class }).run();
|
|
172
|
+
break;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
},
|
|
176
|
+
convert: (editor, pos) => {
|
|
177
|
+
const chain = editor.chain();
|
|
178
|
+
chain.setNodeSelection(pos);
|
|
179
|
+
chain.removeList(pos).removeBlockquote(pos).splitBulletList(pos).run();
|
|
180
|
+
const { $from } = editor.state.selection;
|
|
181
|
+
const newPos = $from.before(1);
|
|
182
|
+
editor.chain().focus().setBlockAttrs(newPos, { class: cmd.class }).run();
|
|
183
|
+
},
|
|
184
|
+
isDisabled: (editor) => {
|
|
185
|
+
const isSame = cmd.class ? editor.isActive("bulletList", { class: cmd.class }) : editor.isActive("bulletList", { class: null }) || editor.isActive("bulletList", { class: "" });
|
|
186
|
+
if (isSame) {
|
|
187
|
+
return true;
|
|
188
|
+
}
|
|
189
|
+
if (editor.isActive("bulletList") || editor.isActive("orderedList")) {
|
|
190
|
+
return false;
|
|
191
|
+
}
|
|
192
|
+
return !editor.can().toggleBulletList();
|
|
193
|
+
},
|
|
194
|
+
isActive: (editor) => editor.isActive("bulletList")
|
|
195
|
+
})
|
|
196
|
+
};
|
|
197
|
+
var bulletList_default = bulletList;
|
|
198
|
+
|
|
199
|
+
// src/config/blocks/numberedList.ts
|
|
200
|
+
var numberedList = {
|
|
201
|
+
label: "\u756A\u53F7\u4ED8\u304D\u30EA\u30B9\u30C8",
|
|
202
|
+
icon: "format_list_numbered",
|
|
203
|
+
description: "\u756A\u53F7\u4ED8\u304D\u30EA\u30B9\u30C8",
|
|
204
|
+
isTextMenu: true,
|
|
205
|
+
aliases: ["ol", "ordered list"],
|
|
206
|
+
menuCategory: "basic",
|
|
207
|
+
createActions: (cmd, ctx) => ({
|
|
208
|
+
action: (editor) => {
|
|
209
|
+
ctx.recordUsage(cmd);
|
|
210
|
+
editor.chain().focus().toggleOrderedList().run();
|
|
211
|
+
const { $from } = editor.state.selection;
|
|
212
|
+
for (let { depth } = $from; depth > 0; depth--) {
|
|
213
|
+
const node = $from.node(depth);
|
|
214
|
+
if (node.type.name === "orderedList") {
|
|
215
|
+
const pos = $from.before(depth);
|
|
216
|
+
editor.chain().focus().setBlockAttrs(pos, { class: cmd.class }).run();
|
|
217
|
+
break;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
},
|
|
221
|
+
convert: (editor, pos) => {
|
|
222
|
+
const chain = editor.chain();
|
|
223
|
+
chain.setNodeSelection(pos);
|
|
224
|
+
chain.removeList(pos).removeBlockquote(pos).splitOrderedList(pos).run();
|
|
225
|
+
const { $from } = editor.state.selection;
|
|
226
|
+
const newPos = $from.before(1);
|
|
227
|
+
editor.chain().focus().setBlockAttrs(newPos, { class: cmd.class }).run();
|
|
228
|
+
},
|
|
229
|
+
isDisabled: (editor) => {
|
|
230
|
+
const isSame = cmd.class ? editor.isActive("orderedList", { class: cmd.class }) : editor.isActive("orderedList", { class: null }) || editor.isActive("orderedList", { class: "" });
|
|
231
|
+
if (isSame) {
|
|
232
|
+
return true;
|
|
233
|
+
}
|
|
234
|
+
if (editor.isActive("orderedList") || editor.isActive("bulletList")) {
|
|
235
|
+
return false;
|
|
236
|
+
}
|
|
237
|
+
return !editor.can().toggleOrderedList();
|
|
238
|
+
},
|
|
239
|
+
isActive: (editor) => editor.isActive("orderedList")
|
|
240
|
+
})
|
|
241
|
+
};
|
|
242
|
+
var numberedList_default = numberedList;
|
|
243
|
+
|
|
244
|
+
// src/config/blocks/blockquote.ts
|
|
245
|
+
var blockquote = {
|
|
246
|
+
label: "\u5F15\u7528",
|
|
247
|
+
icon: "format_quote",
|
|
248
|
+
description: "\u5F15\u7528",
|
|
249
|
+
isTextMenu: false,
|
|
250
|
+
aliases: ["quote"],
|
|
251
|
+
menuCategory: "basic",
|
|
252
|
+
createActions: (cmd, ctx) => ({
|
|
253
|
+
action: (editor) => {
|
|
254
|
+
ctx.recordUsage(cmd);
|
|
255
|
+
editor.chain().focus().setBlockquote().run();
|
|
256
|
+
const { $from } = editor.state.selection;
|
|
257
|
+
for (let { depth } = $from; depth > 0; depth--) {
|
|
258
|
+
const node = $from.node(depth);
|
|
259
|
+
if (node.type.name === "blockquote") {
|
|
260
|
+
const pos = $from.before(depth);
|
|
261
|
+
editor.chain().focus().setBlockAttrs(pos, { class: cmd.class }).run();
|
|
262
|
+
break;
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
},
|
|
266
|
+
convert: (editor, pos) => {
|
|
267
|
+
const chain = editor.chain();
|
|
268
|
+
chain.setNodeSelection(pos);
|
|
269
|
+
chain.setBlockquote().run();
|
|
270
|
+
const { $from } = editor.state.selection;
|
|
271
|
+
const newPos = $from.before(1);
|
|
272
|
+
editor.chain().focus().setBlockAttrs(newPos, { class: cmd.class }).run();
|
|
273
|
+
},
|
|
274
|
+
isDisabled: (editor) => {
|
|
275
|
+
const isSame = cmd.class ? editor.isActive("blockquote", { class: cmd.class }) : editor.isActive("blockquote", { class: null }) || editor.isActive("blockquote", { class: "" });
|
|
276
|
+
if (isSame) {
|
|
277
|
+
return true;
|
|
278
|
+
}
|
|
279
|
+
if (editor.isActive("blockquote")) {
|
|
280
|
+
return false;
|
|
281
|
+
}
|
|
282
|
+
return true;
|
|
283
|
+
},
|
|
284
|
+
isActive: (editor) => editor.isActive("blockquote")
|
|
285
|
+
})
|
|
286
|
+
};
|
|
287
|
+
var blockquote_default = blockquote;
|
|
288
|
+
|
|
289
|
+
// src/config/blocks/codeBlock.ts
|
|
290
|
+
var codeBlock = {
|
|
291
|
+
label: "\u30B3\u30FC\u30C9",
|
|
292
|
+
icon: "code_blocks",
|
|
293
|
+
description: "\u30B3\u30FC\u30C9\u30D6\u30ED\u30C3\u30AF",
|
|
294
|
+
isTextMenu: false,
|
|
295
|
+
aliases: ["code"],
|
|
296
|
+
menuCategory: "basic",
|
|
297
|
+
createActions: (cmd, ctx) => ({
|
|
298
|
+
action: (editor) => {
|
|
299
|
+
ctx.recordUsage(cmd);
|
|
300
|
+
editor.chain().focus().setCodeBlock().run();
|
|
301
|
+
const { $from } = editor.state.selection;
|
|
302
|
+
for (let { depth } = $from; depth > 0; depth--) {
|
|
303
|
+
const node = $from.node(depth);
|
|
304
|
+
if (node.type.name === "codeBlock") {
|
|
305
|
+
const pos = $from.before(depth);
|
|
306
|
+
editor.chain().focus().setBlockAttrs(pos, { class: cmd.class }).run();
|
|
307
|
+
break;
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
},
|
|
311
|
+
convert: (editor, pos) => {
|
|
312
|
+
const chain = editor.chain();
|
|
313
|
+
chain.setNodeSelection(pos);
|
|
314
|
+
chain.removeList(pos).removeBlockquote(pos).setCodeBlock().run();
|
|
315
|
+
const { $from } = editor.state.selection;
|
|
316
|
+
const newPos = $from.before(1);
|
|
317
|
+
editor.chain().focus().setBlockAttrs(newPos, { class: cmd.class }).run();
|
|
318
|
+
},
|
|
319
|
+
isDisabled: (editor) => {
|
|
320
|
+
const isSame = cmd.class ? editor.isActive("codeBlock", { class: cmd.class }) : editor.isActive("codeBlock", { class: null }) || editor.isActive("codeBlock", { class: "" });
|
|
321
|
+
if (isSame) {
|
|
322
|
+
return true;
|
|
323
|
+
}
|
|
324
|
+
if (editor.isActive("codeBlock")) {
|
|
325
|
+
return false;
|
|
326
|
+
}
|
|
327
|
+
return !editor.can().setCodeBlock();
|
|
328
|
+
},
|
|
329
|
+
isActive: (editor) => editor.isActive("codeBlock")
|
|
330
|
+
})
|
|
331
|
+
};
|
|
332
|
+
var codeBlock_default = codeBlock;
|
|
333
|
+
|
|
334
|
+
// src/config/blocks/image.ts
|
|
335
|
+
import { NodeSelection } from "@tiptap/pm/state";
|
|
336
|
+
var image = {
|
|
337
|
+
label: "\u753B\u50CF",
|
|
338
|
+
icon: "photo",
|
|
339
|
+
description: "\u30E1\u30C7\u30A3\u30A2\u753B\u50CF",
|
|
340
|
+
isTextMenu: false,
|
|
341
|
+
aliases: ["img", "image", "media"],
|
|
342
|
+
menuCategory: "insert",
|
|
343
|
+
createActions: (cmd, ctx) => ({
|
|
344
|
+
action: (editor) => {
|
|
345
|
+
ctx.recordUsage(cmd);
|
|
346
|
+
const { $from } = editor.state.selection;
|
|
347
|
+
const pos = $from.before($from.depth);
|
|
348
|
+
editor.chain().focus().uploadMediaImage().setBlockAttrs(pos, { class: cmd.class }).run();
|
|
349
|
+
},
|
|
350
|
+
convert: (editor) => {
|
|
351
|
+
const { state } = editor;
|
|
352
|
+
const { selection } = state;
|
|
353
|
+
if (editor.isActive("imageBlock") || selection instanceof NodeSelection && selection.node.type.name === "imageBlock") {
|
|
354
|
+
editor.chain().focus().updateAttributes("imageBlock", { class: cmd.class }).run();
|
|
355
|
+
}
|
|
356
|
+
},
|
|
357
|
+
isDisabled: (editor) => {
|
|
358
|
+
const isSame = cmd.class ? editor.isActive("imageBlock", { class: cmd.class }) : editor.isActive("imageBlock", { class: null }) || editor.isActive("imageBlock", { class: "" });
|
|
359
|
+
if (isSame) {
|
|
360
|
+
return true;
|
|
361
|
+
}
|
|
362
|
+
if (editor.isActive("imageBlock")) {
|
|
363
|
+
return false;
|
|
364
|
+
}
|
|
365
|
+
return true;
|
|
366
|
+
},
|
|
367
|
+
isActive: (editor) => editor.isActive("imageBlock")
|
|
368
|
+
})
|
|
369
|
+
};
|
|
370
|
+
var image_default = image;
|
|
371
|
+
|
|
372
|
+
// src/config/blocks/file.ts
|
|
373
|
+
import { NodeSelection as NodeSelection2 } from "@tiptap/pm/state";
|
|
374
|
+
var file = {
|
|
375
|
+
label: "\u30D5\u30A1\u30A4\u30EB",
|
|
376
|
+
icon: "draft",
|
|
377
|
+
description: "\u30E1\u30C7\u30A3\u30A2\u30D5\u30A1\u30A4\u30EB",
|
|
378
|
+
isTextMenu: false,
|
|
379
|
+
aliases: ["file", "media"],
|
|
380
|
+
menuCategory: "insert",
|
|
381
|
+
createActions: (cmd, ctx) => ({
|
|
382
|
+
action: (editor) => {
|
|
383
|
+
ctx.recordUsage(cmd);
|
|
384
|
+
const { $from } = editor.state.selection;
|
|
385
|
+
const pos = $from.before($from.depth);
|
|
386
|
+
editor.chain().focus().uploadMediaFile().setBlockAttrs(pos, { class: cmd.class }).run();
|
|
387
|
+
},
|
|
388
|
+
convert: (editor) => {
|
|
389
|
+
const { state } = editor;
|
|
390
|
+
const { selection } = state;
|
|
391
|
+
if (editor.isActive("fileBlock") || selection instanceof NodeSelection2 && selection.node.type.name === "fileBlock") {
|
|
392
|
+
editor.chain().focus().updateAttributes("fileBlock", { class: cmd.class }).run();
|
|
393
|
+
}
|
|
394
|
+
},
|
|
395
|
+
isDisabled: (editor) => {
|
|
396
|
+
const isSame = cmd.class ? editor.isActive("fileBlock", { class: cmd.class }) : editor.isActive("fileBlock", { class: null }) || editor.isActive("fileBlock", { class: "" });
|
|
397
|
+
if (isSame) {
|
|
398
|
+
return true;
|
|
399
|
+
}
|
|
400
|
+
if (editor.isActive("fileBlock")) {
|
|
401
|
+
return false;
|
|
402
|
+
}
|
|
403
|
+
return true;
|
|
404
|
+
},
|
|
405
|
+
isActive: (editor) => editor.isActive("fileBlock")
|
|
406
|
+
})
|
|
407
|
+
};
|
|
408
|
+
var file_default = file;
|
|
409
|
+
|
|
410
|
+
// src/config/blocks/linkButton.ts
|
|
411
|
+
import { NodeSelection as NodeSelection3 } from "@tiptap/pm/state";
|
|
412
|
+
var linkButton = {
|
|
413
|
+
label: "\u30EA\u30F3\u30AF\u30DC\u30BF\u30F3",
|
|
414
|
+
icon: "link",
|
|
415
|
+
description: "\u30EA\u30F3\u30AF\u30DC\u30BF\u30F3",
|
|
416
|
+
isTextMenu: false,
|
|
417
|
+
aliases: ["link", "button"],
|
|
418
|
+
menuCategory: "insert",
|
|
419
|
+
createActions: (cmd, ctx) => ({
|
|
420
|
+
action: (editor) => {
|
|
421
|
+
ctx.recordUsage(cmd);
|
|
422
|
+
const { $from } = editor.state.selection;
|
|
423
|
+
const pos = $from.before($from.depth);
|
|
424
|
+
editor.chain().focus().setLinkButtonBlock().setBlockAttrs(pos, { class: cmd.class }).run();
|
|
425
|
+
},
|
|
426
|
+
convert: (editor) => {
|
|
427
|
+
const { state } = editor;
|
|
428
|
+
const { selection } = state;
|
|
429
|
+
if (editor.isActive("linkButton") || selection instanceof NodeSelection3 && selection.node.type.name === "linkButton") {
|
|
430
|
+
editor.chain().focus().updateAttributes("linkButton", { class: cmd.class }).run();
|
|
431
|
+
}
|
|
432
|
+
},
|
|
433
|
+
isDisabled: (editor) => {
|
|
434
|
+
const isSame = cmd.class ? editor.isActive("linkButton", { class: cmd.class }) : editor.isActive("linkButton", { class: null }) || editor.isActive("linkButton", { class: "" });
|
|
435
|
+
if (isSame) {
|
|
436
|
+
return true;
|
|
437
|
+
}
|
|
438
|
+
if (editor.isActive("linkButton")) {
|
|
439
|
+
return false;
|
|
440
|
+
}
|
|
441
|
+
return true;
|
|
442
|
+
},
|
|
443
|
+
isActive: (editor) => editor.isActive("linkButton")
|
|
444
|
+
})
|
|
445
|
+
};
|
|
446
|
+
var linkButton_default = linkButton;
|
|
447
|
+
|
|
448
|
+
// src/config/blocks/table.ts
|
|
449
|
+
import { NodeSelection as NodeSelection4 } from "@tiptap/pm/state";
|
|
450
|
+
var table = {
|
|
451
|
+
label: "\u30C6\u30FC\u30D6\u30EB",
|
|
452
|
+
icon: "table",
|
|
453
|
+
description: "\u30C6\u30FC\u30D6\u30EB",
|
|
454
|
+
isTextMenu: false,
|
|
455
|
+
aliases: ["table"],
|
|
456
|
+
menuCategory: "insert",
|
|
457
|
+
createActions: (cmd, ctx) => ({
|
|
458
|
+
action: (editor) => {
|
|
459
|
+
ctx.recordUsage(cmd);
|
|
460
|
+
editor.chain().focus().insertTable({ rows: 3, cols: 3, withHeaderRow: false }).run();
|
|
461
|
+
const { $from } = editor.state.selection;
|
|
462
|
+
for (let { depth } = $from; depth > 0; depth--) {
|
|
463
|
+
const node = $from.node(depth);
|
|
464
|
+
if (node.type.name === "table") {
|
|
465
|
+
const pos = $from.before(depth);
|
|
466
|
+
editor.chain().focus().setBlockAttrs(pos, { class: cmd.class }).run();
|
|
467
|
+
break;
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
},
|
|
471
|
+
convert: (editor) => {
|
|
472
|
+
const { state } = editor;
|
|
473
|
+
const { selection } = state;
|
|
474
|
+
if (editor.isActive("table") || selection instanceof NodeSelection4 && selection.node.type.name === "table") {
|
|
475
|
+
editor.chain().focus().updateAttributes("table", { class: cmd.class }).run();
|
|
476
|
+
}
|
|
477
|
+
},
|
|
478
|
+
isDisabled: (editor) => {
|
|
479
|
+
const isSame = cmd.class ? editor.isActive("table", { class: cmd.class }) : editor.isActive("table", { class: null }) || editor.isActive("table", { class: "" });
|
|
480
|
+
if (isSame) {
|
|
481
|
+
return true;
|
|
482
|
+
}
|
|
483
|
+
if (editor.isActive("table")) {
|
|
484
|
+
return false;
|
|
485
|
+
}
|
|
486
|
+
return true;
|
|
487
|
+
},
|
|
488
|
+
isActive: (editor) => editor.isActive("table")
|
|
489
|
+
})
|
|
490
|
+
};
|
|
491
|
+
var table_default = table;
|
|
492
|
+
|
|
493
|
+
// src/config/blocks/columns1.ts
|
|
494
|
+
var columns1 = {
|
|
495
|
+
label: "1\u30AB\u30E9\u30E0",
|
|
496
|
+
icon: "rectangle",
|
|
497
|
+
description: "1\u30AB\u30E9\u30E0",
|
|
498
|
+
isTextMenu: false,
|
|
499
|
+
aliases: ["cols1", "columns1"],
|
|
500
|
+
menuCategory: "layout",
|
|
501
|
+
createActions: (cmd, ctx) => ({
|
|
502
|
+
action: (editor) => {
|
|
503
|
+
ctx.recordUsage(cmd);
|
|
504
|
+
const { $from } = editor.state.selection;
|
|
505
|
+
const pos = $from.before($from.depth);
|
|
506
|
+
editor.chain().focus().setColumns("one-column" /* OneColumn */).focus(editor.state.selection.head - 1).setBlockAttrs(pos, { class: cmd.class }).run();
|
|
507
|
+
},
|
|
508
|
+
convert: () => {
|
|
509
|
+
},
|
|
510
|
+
isDisabled: () => true,
|
|
511
|
+
isActive: (editor) => editor.isActive("columns1")
|
|
512
|
+
})
|
|
513
|
+
};
|
|
514
|
+
var columns1_default = columns1;
|
|
515
|
+
|
|
516
|
+
// src/config/blocks/columns2.ts
|
|
517
|
+
var columns2 = {
|
|
518
|
+
label: "2\u30AB\u30E9\u30E0\u306B\u5206\u5272",
|
|
519
|
+
icon: "view_column",
|
|
520
|
+
description: "2\u30AB\u30E9\u30E0\u306B\u5206\u5272",
|
|
521
|
+
isTextMenu: false,
|
|
522
|
+
aliases: ["cols2", "columns2"],
|
|
523
|
+
menuCategory: "layout",
|
|
524
|
+
createActions: (cmd, ctx) => ({
|
|
525
|
+
action: (editor) => {
|
|
526
|
+
ctx.recordUsage(cmd);
|
|
527
|
+
const { $from } = editor.state.selection;
|
|
528
|
+
const pos = $from.before($from.depth);
|
|
529
|
+
editor.chain().focus().setColumns("two-column" /* TwoColumn */).focus(editor.state.selection.head - 1).setBlockAttrs(pos, { class: cmd.class }).run();
|
|
530
|
+
},
|
|
531
|
+
convert: () => {
|
|
532
|
+
},
|
|
533
|
+
isDisabled: () => true,
|
|
534
|
+
isActive: (editor) => editor.isActive("columns2")
|
|
535
|
+
})
|
|
536
|
+
};
|
|
537
|
+
var columns2_default = columns2;
|
|
538
|
+
|
|
539
|
+
// src/config/blocks/columns3.ts
|
|
540
|
+
var columns3 = {
|
|
541
|
+
label: "3\u30AB\u30E9\u30E0\u306B\u5206\u5272",
|
|
542
|
+
icon: "view_column",
|
|
543
|
+
description: "3\u30AB\u30E9\u30E0\u306B\u5206\u5272",
|
|
544
|
+
isTextMenu: false,
|
|
545
|
+
aliases: ["cols3", "columns3"],
|
|
546
|
+
menuCategory: "layout",
|
|
547
|
+
createActions: (cmd, ctx) => ({
|
|
548
|
+
action: (editor) => {
|
|
549
|
+
ctx.recordUsage(cmd);
|
|
550
|
+
const { $from } = editor.state.selection;
|
|
551
|
+
const pos = $from.before($from.depth);
|
|
552
|
+
editor.chain().focus().setColumns("three-column" /* ThreeColumn */).focus(editor.state.selection.head - 1).setBlockAttrs(pos, { class: cmd.class }).run();
|
|
553
|
+
},
|
|
554
|
+
convert: () => {
|
|
555
|
+
},
|
|
556
|
+
isDisabled: () => true,
|
|
557
|
+
isActive: (editor) => editor.isActive("columns3")
|
|
558
|
+
})
|
|
559
|
+
};
|
|
560
|
+
var columns3_default = columns3;
|
|
561
|
+
|
|
562
|
+
// src/config/blocks/horizontalRule.ts
|
|
563
|
+
var horizontalRule = {
|
|
564
|
+
label: "\u6C34\u5E73\u7F6B\u7DDA",
|
|
565
|
+
icon: "horizontal_rule",
|
|
566
|
+
description: "\u6C34\u5E73\u7F6B\u7DDA",
|
|
567
|
+
isTextMenu: false,
|
|
568
|
+
aliases: ["hr", "rule", "separator"],
|
|
569
|
+
menuCategory: "insert",
|
|
570
|
+
createActions: (cmd, ctx) => ({
|
|
571
|
+
action: (editor) => {
|
|
572
|
+
ctx.recordUsage(cmd);
|
|
573
|
+
const { $from } = editor.state.selection;
|
|
574
|
+
const pos = $from.before($from.depth);
|
|
575
|
+
editor.chain().focus().setHorizontalRule().run();
|
|
576
|
+
editor.chain().focus().setBlockAttrs(pos, { class: cmd.class }).run();
|
|
577
|
+
},
|
|
578
|
+
convert: () => {
|
|
579
|
+
},
|
|
580
|
+
isDisabled: () => true,
|
|
581
|
+
isActive: (editor) => editor.isActive("horizontalRule")
|
|
582
|
+
})
|
|
583
|
+
};
|
|
584
|
+
var horizontalRule_default = horizontalRule;
|
|
585
|
+
|
|
586
|
+
// src/config/blocks/index.ts
|
|
587
|
+
var BLOCK_DEFINITIONS = {
|
|
588
|
+
paragraph: paragraph_default,
|
|
589
|
+
heading1: heading1_default,
|
|
590
|
+
heading2: heading2_default,
|
|
591
|
+
heading3: heading3_default,
|
|
592
|
+
heading4: heading4_default,
|
|
593
|
+
heading5: heading5_default,
|
|
594
|
+
heading6: heading6_default,
|
|
595
|
+
bulletList: bulletList_default,
|
|
596
|
+
numberedList: numberedList_default,
|
|
597
|
+
blockquote: blockquote_default,
|
|
598
|
+
codeBlock: codeBlock_default,
|
|
599
|
+
image: image_default,
|
|
600
|
+
file: file_default,
|
|
601
|
+
linkButton: linkButton_default,
|
|
602
|
+
table: table_default,
|
|
603
|
+
horizontalRule: horizontalRule_default,
|
|
604
|
+
columns1: columns1_default,
|
|
605
|
+
columns2: columns2_default,
|
|
606
|
+
columns3: columns3_default
|
|
607
|
+
};
|
|
608
|
+
var blocks_default = BLOCK_DEFINITIONS;
|
|
609
|
+
|
|
610
|
+
// src/utils/mergeBlockDefinitions.ts
|
|
611
|
+
function mergeBlockDefinitions(additional) {
|
|
612
|
+
if (!additional) {
|
|
613
|
+
return blocks_default;
|
|
614
|
+
}
|
|
615
|
+
for (const type of Object.keys(additional)) {
|
|
616
|
+
if (type in blocks_default) {
|
|
617
|
+
console.warn(`[block-editor] registerBlockDefinition("${type}") \u304C\u30B3\u30A2\u306E\u7D44\u307F\u8FBC\u307F\u5B9A\u7FA9\u3092\u4E0A\u66F8\u304D\u3057\u307E\u3057\u305F\u3002`);
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
return { ...blocks_default, ...additional };
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
export {
|
|
624
|
+
blocks_default,
|
|
625
|
+
mergeBlockDefinitions
|
|
626
|
+
};
|
|
627
|
+
//# sourceMappingURL=chunk-XGAKMQH4.mjs.map
|