@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,15 @@
|
|
|
1
|
+
import { Range } from '@tiptap/core';
|
|
2
|
+
declare module '@tiptap/core' {
|
|
3
|
+
interface Commands<ReturnType> {
|
|
4
|
+
linkButton: {
|
|
5
|
+
setLinkButtonBlock: () => ReturnType;
|
|
6
|
+
setLinkButtonBlockAt: (attributes: {
|
|
7
|
+
pos: number | Range;
|
|
8
|
+
}) => ReturnType;
|
|
9
|
+
setLinkButtonBlockAlign: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
10
|
+
setLinkButtonBlockLink: (link: string, openInNewTab?: boolean) => ReturnType;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
export declare const LinkButton: import("@tiptap/core").Node<import("../ImageBlock/index.js").ImageBlockOptions, any>;
|
|
15
|
+
export default LinkButton;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './LinkButton.js';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Node } from '@tiptap/react';
|
|
2
|
+
declare module '@tiptap/core' {
|
|
3
|
+
interface Commands<ReturnType> {
|
|
4
|
+
mediaSelect: {
|
|
5
|
+
uploadMediaImage: (file?: File[]) => ReturnType;
|
|
6
|
+
uploadMediaFile: (file?: File[]) => ReturnType;
|
|
7
|
+
uploadMedia: (file?: File[]) => ReturnType;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
export declare const MediaUpload: Node<any, any>;
|
|
12
|
+
export default MediaUpload;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './MediaUpload.js';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { MediaViewFileType } from '@ablogcms/media/types';
|
|
2
|
+
/**
|
|
3
|
+
* ドロップ/選択されたファイルを枠の種別 (accept) で絞り込む。
|
|
4
|
+
* - 'image' (画像ブロックの枠): 画像 (image/svg/HEIC) のみ
|
|
5
|
+
* - 'file' (ファイルブロックの枠): 画像以外のファイルのみ
|
|
6
|
+
* - 'all' (エディタ本文への直接ドロップ): 全件 (混在可)
|
|
7
|
+
*
|
|
8
|
+
* アップロード前にこの関数で弾くことで、枠の種別に合わないファイルがそもそもアップロードされない。
|
|
9
|
+
*/
|
|
10
|
+
export declare const filterFilesByMediaType: (files: File[], accept: MediaViewFileType) => File[];
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { ExtendedFile } from '@ablogcms/lib/read-files';
|
|
2
|
+
export type MediaDropAreaState = {
|
|
3
|
+
isInsertModalOpen: boolean;
|
|
4
|
+
files: File[];
|
|
5
|
+
tab: 'upload' | 'select';
|
|
6
|
+
};
|
|
7
|
+
export declare const useMediaSelect: () => {
|
|
8
|
+
isInsertModalOpen: boolean;
|
|
9
|
+
files: File[];
|
|
10
|
+
tab: "select" | "upload";
|
|
11
|
+
uploadFile: (files: File[]) => void;
|
|
12
|
+
handleModalClose: () => void;
|
|
13
|
+
handleSelectClick: () => void;
|
|
14
|
+
};
|
|
15
|
+
export declare const useFileUpload: ({ uploader }: {
|
|
16
|
+
uploader: (files: File[]) => void;
|
|
17
|
+
}) => {
|
|
18
|
+
fileInputRef: import("react").RefObject<HTMLInputElement | null>;
|
|
19
|
+
handleUploadClick: () => void;
|
|
20
|
+
handleUploadFile: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
21
|
+
};
|
|
22
|
+
export declare const useDropZone: ({ uploader }: {
|
|
23
|
+
uploader: (files: File[]) => void;
|
|
24
|
+
}) => {
|
|
25
|
+
onDrop: (files: ExtendedFile[]) => void;
|
|
26
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Dropzone.js';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { Editor } from '@tiptap/core';
|
|
2
|
+
import type { MediaItem, MediaViewFileType } from '@ablogcms/media/types';
|
|
3
|
+
/**
|
|
4
|
+
* 挿入対象を枠の種別 (accept) に従い、選択順を保って選別する。
|
|
5
|
+
* - 'image' (画像ブロックの枠): 画像 (image/svg) かつ表示用サムネイル (media_thumbnail) を持つものだけ
|
|
6
|
+
* - 'file' (ファイルブロックの枠): 画像以外のファイルだけ
|
|
7
|
+
* - 'all' (エディタ本文への直接ドロップ): 画像はサムネイル必須・ファイルは全件 (混在可)
|
|
8
|
+
*
|
|
9
|
+
* これにより、画像枠にファイル・ファイル枠に画像が紛れても、枠の種別に合うものだけが挿入される。
|
|
10
|
+
*/
|
|
11
|
+
export declare const selectInsertableMedia: (items: MediaItem[], accept: MediaViewFileType) => MediaItem[];
|
|
12
|
+
/**
|
|
13
|
+
* 選択メディアを枠の種別 (accept) で絞り込み、media_type で画像/ファイルブロックに振り分けて、
|
|
14
|
+
* プレースホルダ (MediaUpload ノード) の range を一括置換する。insertContentAt による一括置換のため、
|
|
15
|
+
* 対象が複数あっても 1 回の挿入で選択順に生成され、プレースホルダも確実に消える。
|
|
16
|
+
*
|
|
17
|
+
* @returns 挿入したブロック数 (挿入対象が無ければ 0、このとき editor は操作しない)
|
|
18
|
+
*/
|
|
19
|
+
export declare const insertMediaBlocks: (editor: Editor, items: MediaItem[], accept: MediaViewFileType, className: string, range: {
|
|
20
|
+
from: number;
|
|
21
|
+
to: number;
|
|
22
|
+
}) => number;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Node } from '@tiptap/core';
|
|
2
|
+
export declare enum ColumnLayout {
|
|
3
|
+
OneColumn = "one-column",
|
|
4
|
+
TwoColumn = "two-column",
|
|
5
|
+
ThreeColumn = "three-column"
|
|
6
|
+
}
|
|
7
|
+
declare module '@tiptap/core' {
|
|
8
|
+
interface Commands<ReturnType> {
|
|
9
|
+
columns: {
|
|
10
|
+
setColumns: (layout?: ColumnLayout) => ReturnType;
|
|
11
|
+
setLayout: (layout: ColumnLayout) => ReturnType;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
export declare const Columns: Node<any, any>;
|
|
16
|
+
export default Columns;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './PasteHandler.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Selection.js';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { BlockMenuProps } from '../../types/index.js';
|
|
3
|
+
interface BlockMenuRef {
|
|
4
|
+
onKeyDown: (event: {
|
|
5
|
+
event: KeyboardEvent;
|
|
6
|
+
}) => boolean;
|
|
7
|
+
}
|
|
8
|
+
declare const BlockMenu: React.ForwardRefExoticComponent<BlockMenuProps & React.RefAttributes<BlockMenuRef>>;
|
|
9
|
+
export default BlockMenu;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Editor, Extension } from '@tiptap/core';
|
|
2
|
+
import type { BlockMenuItem } from '../../types/index.js';
|
|
3
|
+
declare module '@tiptap/core' {
|
|
4
|
+
interface Storage {
|
|
5
|
+
slashCommand: {
|
|
6
|
+
rect: DOMRect;
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
declare const SlashCommand: Extension<{
|
|
11
|
+
getItems: (_props: {
|
|
12
|
+
query: string;
|
|
13
|
+
editor: Editor;
|
|
14
|
+
}) => BlockMenuItem[];
|
|
15
|
+
}, {
|
|
16
|
+
rect: DOMRect;
|
|
17
|
+
}>;
|
|
18
|
+
export default SlashCommand;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as SlashCommand } from './SlashCommand.js';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Node } from '@tiptap/core';
|
|
2
|
+
export interface TableCellOptions {
|
|
3
|
+
HTMLAttributes: Record<string, any>;
|
|
4
|
+
}
|
|
5
|
+
declare module '@tiptap/core' {
|
|
6
|
+
interface Commands<ReturnType> {
|
|
7
|
+
tableCell: {
|
|
8
|
+
setCellBackgroundColor: (color: string) => ReturnType;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
export declare const TableCell: Node<TableCellOptions, any>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
declare module '@tiptap/core' {
|
|
2
|
+
interface Commands<ReturnType> {
|
|
3
|
+
tableHeader: {
|
|
4
|
+
setHeaderBackgroundColor: (color: string) => ReturnType;
|
|
5
|
+
};
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
export declare const TableHeader: import("@tiptap/core").Node<import("@tiptap/extension-table").TableHeaderOptions, any>;
|
|
9
|
+
export default TableHeader;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
declare module '@tiptap/core' {
|
|
2
|
+
interface Commands<ReturnType> {
|
|
3
|
+
tableBlock: {
|
|
4
|
+
toggleTableScrollable: () => ReturnType;
|
|
5
|
+
};
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
export declare const Table: import("@tiptap/core").Node<import("@tiptap/extension-table").TableOptions, any>;
|
|
9
|
+
export default Table;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Editor } from '@tiptap/react';
|
|
2
|
+
import { EditorView } from '@tiptap/pm/view';
|
|
3
|
+
export declare const isColumnGripSelected: ({ editor, view, from }: {
|
|
4
|
+
editor: Editor;
|
|
5
|
+
view: EditorView;
|
|
6
|
+
from: number;
|
|
7
|
+
}) => boolean;
|
|
8
|
+
export default isColumnGripSelected;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Selection, Transaction } from '@tiptap/pm/state';
|
|
2
|
+
import { CellSelection, Rect } from '@tiptap/pm/tables';
|
|
3
|
+
import { Node, ResolvedPos } from '@tiptap/pm/model';
|
|
4
|
+
export declare const isRectSelected: (rect: Rect) => (selection: CellSelection) => boolean;
|
|
5
|
+
export declare const findTable: (selection: Selection) => {
|
|
6
|
+
pos: number;
|
|
7
|
+
start: number;
|
|
8
|
+
depth: number;
|
|
9
|
+
node: Node;
|
|
10
|
+
} | undefined;
|
|
11
|
+
export declare const isCellSelection: (selection: unknown) => selection is CellSelection;
|
|
12
|
+
export declare const isColumnSelected: (columnIndex: number) => (selection: Selection) => boolean;
|
|
13
|
+
export declare const isRowSelected: (rowIndex: number) => (selection: Selection) => boolean;
|
|
14
|
+
export declare const isTableSelected: (selection: Selection) => boolean;
|
|
15
|
+
export declare const getCellsInColumn: (columnIndex: number | number[]) => (selection: Selection) => {
|
|
16
|
+
pos: number;
|
|
17
|
+
start: number;
|
|
18
|
+
node: Node | null | undefined;
|
|
19
|
+
}[] | null;
|
|
20
|
+
export declare const getCellsInRow: (rowIndex: number | number[]) => (selection: Selection) => {
|
|
21
|
+
pos: number;
|
|
22
|
+
start: number;
|
|
23
|
+
node: Node | null | undefined;
|
|
24
|
+
}[] | null;
|
|
25
|
+
export declare const getCellsInTable: (selection: Selection) => {
|
|
26
|
+
pos: number;
|
|
27
|
+
start: number;
|
|
28
|
+
node: Node | null;
|
|
29
|
+
}[] | null;
|
|
30
|
+
export declare const findParentNodeClosestToPos: ($pos: ResolvedPos, predicate: (node: Node) => boolean) => {
|
|
31
|
+
pos: number;
|
|
32
|
+
start: number;
|
|
33
|
+
depth: number;
|
|
34
|
+
node: Node;
|
|
35
|
+
} | null;
|
|
36
|
+
export declare const findCellClosestToPos: ($pos: ResolvedPos) => {
|
|
37
|
+
pos: number;
|
|
38
|
+
start: number;
|
|
39
|
+
depth: number;
|
|
40
|
+
node: Node;
|
|
41
|
+
} | null;
|
|
42
|
+
export declare const selectColumn: (index: number) => (tr: Transaction) => Transaction;
|
|
43
|
+
export declare const selectRow: (index: number) => (tr: Transaction) => Transaction;
|
|
44
|
+
export declare const selectTable: (tr: Transaction) => Transaction;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './trailing-node.js';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Extension } from '@tiptap/core';
|
|
2
|
+
/**
|
|
3
|
+
* Extension based on:
|
|
4
|
+
* - https://github.com/ueberdosis/tiptap/blob/v1/packages/tiptap-extensions/src/extensions/TrailingNode.js
|
|
5
|
+
* - https://github.com/remirror/remirror/blob/e0f1bec4a1e8073ce8f5500d62193e52321155b9/packages/prosemirror-trailing-node/src/trailing-node-plugin.ts
|
|
6
|
+
*/
|
|
7
|
+
export interface TrailingNodeOptions {
|
|
8
|
+
node: string;
|
|
9
|
+
notAfter: string[];
|
|
10
|
+
}
|
|
11
|
+
export declare const TrailingNode: Extension<TrailingNodeOptions, any>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface ExtensionKitOptions {
|
|
2
|
+
/** 画像の新規挿入時に拡大表示(Lightbox)をデフォルト有効にするかを返す getter */
|
|
3
|
+
getImageDefaultLightbox?: () => boolean;
|
|
4
|
+
}
|
|
5
|
+
export declare const ExtensionKit: ({ getImageDefaultLightbox }?: ExtensionKitOptions) => (import("@tiptap/core").Extension<any, any> | import("@tiptap/core").Node<import("@tiptap/extension-table").TableOptions, any> | import("@tiptap/core").Node<import("./Table/Cell.js").TableCellOptions, any> | import("@tiptap/core").Node<import("@tiptap/extension-horizontal-rule").HorizontalRuleOptions, any> | import("@tiptap/core").Node<import("@tiptap/extension-heading").HeadingOptions, any> | import("@tiptap/core").Node<any, any> | import("@tiptap/core").Extension<import("./TrailingNode/index.js").TrailingNodeOptions, any> | import("@tiptap/core").Mark<any, any> | import("@tiptap/core").Extension<{
|
|
6
|
+
types: string[];
|
|
7
|
+
}, any> | import("@tiptap/core").Node<{
|
|
8
|
+
HTMLAttributes: {};
|
|
9
|
+
}, any> | import("@tiptap/core").Mark<import("@tiptap/extension-link").LinkOptions, any> | import("@tiptap/core").Node<import("./ImageBlock/index.js").ImageBlockOptions, any> | import("@tiptap/core").Extension<import("@tiptap/starter-kit").StarterKitOptions, any> | import("@tiptap/core").Extension<import("@tiptap/extensions").UndoRedoOptions, any> | import("@tiptap/core").Mark<import("@tiptap/extension-text-style").TextStyleOptions, any> | import("@tiptap/core").Mark<import("@tiptap/extension-highlight").HighlightOptions, any> | import("@tiptap/core").Mark<import("@tiptap/extension-underline").UnderlineOptions, any> | import("@tiptap/core").Extension<import("@tiptap/extension-text-align").TextAlignOptions, any> | import("@tiptap/core").Extension<import("@tiptap/extension-typography").TypographyOptions, any> | import("@tiptap/core").Extension<import("@tiptap/extensions").PlaceholderOptions, any> | import("@tiptap/core").Extension<import("@tiptap/extensions").FocusOptions, any> | import("@tiptap/core").Extension<import("@tiptap/extensions").DropcursorOptions, any>)[];
|
|
10
|
+
export default ExtensionKit;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export { StarterKit } from '@tiptap/starter-kit';
|
|
2
|
+
export { Highlight } from '@tiptap/extension-highlight';
|
|
3
|
+
export { Underline } from '@tiptap/extension-underline';
|
|
4
|
+
export { TextAlign } from '@tiptap/extension-text-align';
|
|
5
|
+
export { TextStyle } from '@tiptap/extension-text-style';
|
|
6
|
+
export { Typography } from '@tiptap/extension-typography';
|
|
7
|
+
export { Subscript } from '@tiptap/extension-subscript';
|
|
8
|
+
export { Superscript } from '@tiptap/extension-superscript';
|
|
9
|
+
export { Paragraph } from '@tiptap/extension-paragraph';
|
|
10
|
+
export { CodeBlock } from '@tiptap/extension-code-block';
|
|
11
|
+
export { BulletList, OrderedList } from '@tiptap/extension-list';
|
|
12
|
+
export { Placeholder, Focus, Dropcursor } from '@tiptap/extensions';
|
|
13
|
+
export { Selection } from './Selection/index.js';
|
|
14
|
+
export { Table, TableCell, TableHeader, TableRow } from './Table/index.js';
|
|
15
|
+
export { HorizontalRule } from './HorizontalRule/index.js';
|
|
16
|
+
export { Heading } from './Heading/index.js';
|
|
17
|
+
export { Document } from './Document/index.js';
|
|
18
|
+
export { TrailingNode } from './TrailingNode/index.js';
|
|
19
|
+
export { SlashCommand } from './SlashCommand/index.js';
|
|
20
|
+
export { FontStyle } from './FontStyle/index.js';
|
|
21
|
+
export { Figure } from './Figure/index.js';
|
|
22
|
+
export { Figcaption } from './Figcaption/index.js';
|
|
23
|
+
export { BlockquoteFigure } from './BlockquoteFigure/index.js';
|
|
24
|
+
export { Quote } from './BlockquoteFigure/Quote/index.js';
|
|
25
|
+
export { QuoteCaption } from './BlockquoteFigure/QuoteCaption/index.js';
|
|
26
|
+
export { Link, isAllowedBlockEditorLinkUri } from './Link/index.js';
|
|
27
|
+
export { ImageBlock } from './ImageBlock/index.js';
|
|
28
|
+
export { FileBlock } from './FileBlock/index.js';
|
|
29
|
+
export { PasteHandler } from './PasteHandler/index.js';
|
|
30
|
+
export { LinkButton } from './LinkButton/index.js';
|
|
31
|
+
export { Columns, Column } from './MultiColumn/index.js';
|
|
32
|
+
export { MediaUpload } from './MediaUpload/index.js';
|
|
33
|
+
export { CustomMark } from './CustomMark/index.js';
|
|
34
|
+
export { CustomConvertBlock } from './CustomConvertBlock/index.js';
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { MediaItem } from '@ablogcms/media/types';
|
|
2
|
+
/**
|
|
3
|
+
* メディアから画像ブロック (imageBlock) の属性を組み立てる。
|
|
4
|
+
* media_size ("幅x高さ") から width/height を取り出す。
|
|
5
|
+
*/
|
|
6
|
+
export declare const createImageBlockAttrs: (mediaItem: MediaItem, className?: string) => {
|
|
7
|
+
src: string;
|
|
8
|
+
class: string | null;
|
|
9
|
+
mediaId: number;
|
|
10
|
+
entryId: any;
|
|
11
|
+
width: number | null;
|
|
12
|
+
height: number | null;
|
|
13
|
+
link: string;
|
|
14
|
+
caption: string;
|
|
15
|
+
alt: string;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* メディアからファイルブロック (fileBlock) の属性を組み立てる。
|
|
19
|
+
*/
|
|
20
|
+
export declare const createFileBlockAttrs: (mediaItem: MediaItem, className?: string) => {
|
|
21
|
+
href: string;
|
|
22
|
+
icon: string;
|
|
23
|
+
iconWidth: string;
|
|
24
|
+
iconHeight: string;
|
|
25
|
+
class: string | null;
|
|
26
|
+
mediaId: number;
|
|
27
|
+
caption: string | null;
|
|
28
|
+
alt: string | null;
|
|
29
|
+
extension: string | null;
|
|
30
|
+
fileSize: number | null;
|
|
31
|
+
};
|
|
32
|
+
export type MediaBlockContent = {
|
|
33
|
+
type: 'imageBlock' | 'fileBlock';
|
|
34
|
+
attrs: Record<string, unknown>;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* メディアの media_type に応じて、挿入する画像/ファイルブロックの JSONContent を組み立てる。
|
|
38
|
+
* 画像 (image) と svg は imageBlock、それ以外 (file) は fileBlock として扱う。
|
|
39
|
+
* これにより、画像とファイルが混在していても 1 回の挿入で適切なブロックへ振り分けられる。
|
|
40
|
+
*/
|
|
41
|
+
export declare const buildMediaBlockContent: (mediaItem: MediaItem, className: string, noLightbox: string) => MediaBlockContent;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { BlockDefinition, CommandItem } from '../types/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* CommandItem に、その type に対応する action / convert / isDisabled / isActive を差し込む。
|
|
4
|
+
* 実体はすべて `config/blocks/{type}.ts` 側に置かれている。
|
|
5
|
+
* コアの `BLOCK_DEFINITIONS` に無い type でも `additionalDefinitions`(プラグインが
|
|
6
|
+
* `registerBlockDefinition` で登録した分)にあれば解決する。定義のない type は黙って捨てる。
|
|
7
|
+
* マスター合成(コア + additionalDefinitions、キー衝突時は additionalDefinitions 側優先 +
|
|
8
|
+
* console.warn)は `mergeBlockDefinitions` に一元化してあり、`normalizeSettings` と同じ規約を使う。
|
|
9
|
+
*/
|
|
10
|
+
export default function resolveCommands(commands: CommandItem[], recordUsage: (command: CommandItem) => void, additionalDefinitions?: Record<string, BlockDefinition>): CommandItem[];
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type AnyExtension, type Editor, type EditorOptions } from '@tiptap/react';
|
|
2
|
+
import type { BlockDefinition, BlockMenuItem } from '../types/index.js';
|
|
3
|
+
export interface UseBlockEditorOptions extends Partial<Pick<EditorOptions, 'autofocus' | 'editorProps' | 'enableContentCheck' | 'emitContentError' | 'onCreate' | 'onContentError' | 'onSelectionUpdate' | 'onTransaction' | 'onFocus' | 'onBlur' | 'onDestroy' | 'onPaste' | 'onDrop'>> {
|
|
4
|
+
defaultValue?: string;
|
|
5
|
+
onUpdate: (value: string) => void;
|
|
6
|
+
blockMenus?: BlockMenuItem[];
|
|
7
|
+
/** 画像の新規挿入時に拡大表示(Lightbox)をデフォルト有効にするか。未指定時は現行動作(オン)。 */
|
|
8
|
+
imageDefaultLightbox?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* ExtensionKit の後段に追加登録する Tiptap 拡張(`ctx.blockEditor.registerExtension` 経由)。
|
|
11
|
+
* Tiptap は動的な拡張の付け外しに対応しないため、初回マウント時にのみ確定する
|
|
12
|
+
* (`useMemo` の依存配列が空。マウント後の変更は無視される)。
|
|
13
|
+
*/
|
|
14
|
+
extensions?: AnyExtension[];
|
|
15
|
+
/**
|
|
16
|
+
* コアの `BLOCK_DEFINITIONS` に加えてマージする追加マスター(`ctx.blockEditor.registerBlockDefinition`
|
|
17
|
+
* 経由)。`resolveCommands` へそのまま渡す。
|
|
18
|
+
*/
|
|
19
|
+
blockDefinitions?: Record<string, BlockDefinition>;
|
|
20
|
+
}
|
|
21
|
+
export declare const useBlockEditor: ({ defaultValue, onUpdate, blockMenus, imageDefaultLightbox, extensions: extraExtensions, blockDefinitions, ...editorOptions }: UseBlockEditorOptions) => {
|
|
22
|
+
editor: Editor;
|
|
23
|
+
getFilteredBlockMenus: ({ query, editor }: {
|
|
24
|
+
query: string;
|
|
25
|
+
editor: Editor;
|
|
26
|
+
}) => BlockMenuItem[];
|
|
27
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Editor } from '@tiptap/core';
|
|
2
|
+
import type { BlockDefinition, BlockMenuItem } from '../types/index.js';
|
|
3
|
+
interface UseBlockMenusOptions {
|
|
4
|
+
blockMenus: BlockMenuItem[];
|
|
5
|
+
/** コアの `BLOCK_DEFINITIONS` に加えてマージする追加マスター。`resolveCommands` へそのまま渡す。 */
|
|
6
|
+
blockDefinitions?: Record<string, BlockDefinition>;
|
|
7
|
+
}
|
|
8
|
+
export interface UseBlockMenusResult {
|
|
9
|
+
groups: BlockMenuItem[];
|
|
10
|
+
getFilteredBlockMenus: ({ query, editor }: {
|
|
11
|
+
query: string;
|
|
12
|
+
editor: Editor;
|
|
13
|
+
}) => BlockMenuItem[];
|
|
14
|
+
}
|
|
15
|
+
export declare function useBlockMenus({ blockMenus, blockDefinitions }: UseBlockMenusOptions): UseBlockMenusResult;
|
|
16
|
+
export declare function useFilteredCommands(menus: BlockMenuItem[], editor: Editor, currentPos: number): BlockMenuItem[];
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Editor } from '@tiptap/react';
|
|
2
|
+
/**
|
|
3
|
+
* エディタの ProseMirror ビューの DOM 要素を、利用できるようになってから返す。
|
|
4
|
+
*
|
|
5
|
+
* Tiptap v3 は `editor.view` を Proxy にしており、ビューがまだ作られていない状態で
|
|
6
|
+
* プロパティへアクセスすると例外を投げる(v2 では undefined が返るだけだった)。
|
|
7
|
+
* そのためレンダー中に `editor.view.dom` を読むコード(useEffect の依存配列に
|
|
8
|
+
* 直接書くなど)は初回レンダーで必ず落ちる。
|
|
9
|
+
*
|
|
10
|
+
* `editor.isInitialized` の確認だけでは足りない。ビューは `EditorContent` の副作用で
|
|
11
|
+
* 作られるため、兄弟コンポーネントの副作用が先に走るとまだ未初期化のことがある。
|
|
12
|
+
* そこで `create` イベントを購読して、初期化後に state 更新で再レンダーさせる。
|
|
13
|
+
*/
|
|
14
|
+
export declare function useEditorViewDom(editor: Editor): HTMLElement | null;
|
|
15
|
+
export default useEditorViewDom;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { CommandItem } from '../types/index.js';
|
|
2
|
+
import { type CommandIdentifier } from '../lib/utils/commandUsageStorage.js';
|
|
3
|
+
export declare const useFrequentlyUsed: () => {
|
|
4
|
+
frequentlyUsed: CommandIdentifier[];
|
|
5
|
+
recordUsage: (command: CommandItem) => void;
|
|
6
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { EditorSettings, EditorSettingsOverride } from '../types/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* このパッケージ自体はデータを取得しない(設定値の出所は呼び出し側の責務)。
|
|
4
|
+
* `editorSettings` は呼び出し側(コア側の `useBlockEditorSettings` 等)が取得・正規化
|
|
5
|
+
* (`normalizeSettings`) 済みの EditorSettings を注入する引数で、省略時は既定値
|
|
6
|
+
* (`DEFAULT_EDITOR_SETTINGS`) を基点にする。`override` はエディター個別の宣言的な上書き設定
|
|
7
|
+
* (`<acms-block-editor>` の `settings` 属性経由で渡される EditorSettingsOverride。旧
|
|
8
|
+
* `.js-block-editor` の公開仕様である `data-settings` もこの経路に変換されて合流する)。
|
|
9
|
+
*/
|
|
10
|
+
export declare function useSettings(editorSettings?: EditorSettings, override?: EditorSettingsOverride): EditorSettings;
|
package/dist/index.d.ts
ADDED
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import {
|
|
2
|
+
BlockEditor
|
|
3
|
+
} from "./chunk-S24TRRWW.mjs";
|
|
4
|
+
import "./chunk-OFWQRNO2.mjs";
|
|
5
|
+
import "./chunk-GIHTGDIW.mjs";
|
|
6
|
+
import "./chunk-HNSTT2Z4.mjs";
|
|
7
|
+
import {
|
|
8
|
+
createProps
|
|
9
|
+
} from "./chunk-4KUPYKHV.mjs";
|
|
10
|
+
import "./chunk-EM5TLDPY.mjs";
|
|
11
|
+
import "./chunk-TKSGCO5Z.mjs";
|
|
12
|
+
import "./chunk-57Q3DEDF.mjs";
|
|
13
|
+
import {
|
|
14
|
+
SettingsProvider,
|
|
15
|
+
useSettingsContext
|
|
16
|
+
} from "./chunk-DUT25D7Z.mjs";
|
|
17
|
+
import {
|
|
18
|
+
DEFAULT_EDITOR_SETTINGS,
|
|
19
|
+
defaultFeatures,
|
|
20
|
+
normalizeSettings
|
|
21
|
+
} from "./chunk-JYUNKG2P.mjs";
|
|
22
|
+
import "./chunk-XGAKMQH4.mjs";
|
|
23
|
+
import "./chunk-OZG2BL6F.mjs";
|
|
24
|
+
export {
|
|
25
|
+
BlockEditor,
|
|
26
|
+
DEFAULT_EDITOR_SETTINGS,
|
|
27
|
+
SettingsProvider,
|
|
28
|
+
createProps,
|
|
29
|
+
defaultFeatures,
|
|
30
|
+
normalizeSettings,
|
|
31
|
+
useSettingsContext
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { CommandItem } from '../../types/index.js';
|
|
2
|
+
export type CommandIdentifier = Pick<CommandItem, 'name' | 'class'>;
|
|
3
|
+
/**
|
|
4
|
+
* localStorageのキーを生成する
|
|
5
|
+
*/
|
|
6
|
+
export declare const getKey: () => string;
|
|
7
|
+
/**
|
|
8
|
+
* コマンドの使用を記録する
|
|
9
|
+
*/
|
|
10
|
+
export declare const recordCommandUsage: (command: CommandItem) => void;
|
|
11
|
+
/**
|
|
12
|
+
* よく使うコマンドのリストを取得する(頻度順、同率なら最新使用順)
|
|
13
|
+
*/
|
|
14
|
+
export declare const getFrequentlyUsedCommands: (limit?: number) => CommandIdentifier[];
|