@tiptap/extension-table-header 3.0.0 → 3.0.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/LICENSE.md +21 -0
- package/README.md +5 -1
- package/dist/index.cjs +32 -51
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +9 -48
- package/dist/index.js.map +1 -1
- package/package.json +11 -9
- package/src/index.ts +3 -2
- package/dist/index.umd.js +0 -57
- package/dist/index.umd.js.map +0 -1
- package/dist/packages/core/src/CommandManager.d.ts +0 -20
- package/dist/packages/core/src/Editor.d.ts +0 -161
- package/dist/packages/core/src/EventEmitter.d.ts +0 -11
- package/dist/packages/core/src/Extension.d.ts +0 -343
- package/dist/packages/core/src/ExtensionManager.d.ts +0 -55
- package/dist/packages/core/src/InputRule.d.ts +0 -42
- package/dist/packages/core/src/Mark.d.ts +0 -451
- package/dist/packages/core/src/Node.d.ts +0 -611
- package/dist/packages/core/src/NodePos.d.ts +0 -44
- package/dist/packages/core/src/NodeView.d.ts +0 -31
- package/dist/packages/core/src/PasteRule.d.ts +0 -50
- package/dist/packages/core/src/Tracker.d.ts +0 -11
- package/dist/packages/core/src/commands/blur.d.ts +0 -13
- package/dist/packages/core/src/commands/clearContent.d.ts +0 -14
- package/dist/packages/core/src/commands/clearNodes.d.ts +0 -13
- package/dist/packages/core/src/commands/command.d.ts +0 -18
- package/dist/packages/core/src/commands/createParagraphNear.d.ts +0 -13
- package/dist/packages/core/src/commands/cut.d.ts +0 -20
- package/dist/packages/core/src/commands/deleteCurrentNode.d.ts +0 -13
- package/dist/packages/core/src/commands/deleteNode.d.ts +0 -15
- package/dist/packages/core/src/commands/deleteRange.d.ts +0 -14
- package/dist/packages/core/src/commands/deleteSelection.d.ts +0 -13
- package/dist/packages/core/src/commands/enter.d.ts +0 -13
- package/dist/packages/core/src/commands/exitCode.d.ts +0 -13
- package/dist/packages/core/src/commands/extendMarkRange.d.ts +0 -25
- package/dist/packages/core/src/commands/first.d.ts +0 -14
- package/dist/packages/core/src/commands/focus.d.ts +0 -27
- package/dist/packages/core/src/commands/forEach.d.ts +0 -14
- package/dist/packages/core/src/commands/index.d.ts +0 -55
- package/dist/packages/core/src/commands/insertContent.d.ts +0 -34
- package/dist/packages/core/src/commands/insertContentAt.d.ts +0 -47
- package/dist/packages/core/src/commands/join.d.ts +0 -41
- package/dist/packages/core/src/commands/joinItemBackward.d.ts +0 -13
- package/dist/packages/core/src/commands/joinItemForward.d.ts +0 -13
- package/dist/packages/core/src/commands/joinTextblockBackward.d.ts +0 -12
- package/dist/packages/core/src/commands/joinTextblockForward.d.ts +0 -12
- package/dist/packages/core/src/commands/keyboardShortcut.d.ts +0 -14
- package/dist/packages/core/src/commands/lift.d.ts +0 -17
- package/dist/packages/core/src/commands/liftEmptyBlock.d.ts +0 -13
- package/dist/packages/core/src/commands/liftListItem.d.ts +0 -15
- package/dist/packages/core/src/commands/newlineInCode.d.ts +0 -13
- package/dist/packages/core/src/commands/resetAttributes.d.ts +0 -16
- package/dist/packages/core/src/commands/scrollIntoView.d.ts +0 -13
- package/dist/packages/core/src/commands/selectAll.d.ts +0 -13
- package/dist/packages/core/src/commands/selectNodeBackward.d.ts +0 -13
- package/dist/packages/core/src/commands/selectNodeForward.d.ts +0 -13
- package/dist/packages/core/src/commands/selectParentNode.d.ts +0 -13
- package/dist/packages/core/src/commands/selectTextblockEnd.d.ts +0 -13
- package/dist/packages/core/src/commands/selectTextblockStart.d.ts +0 -13
- package/dist/packages/core/src/commands/setContent.d.ts +0 -40
- package/dist/packages/core/src/commands/setMark.d.ts +0 -15
- package/dist/packages/core/src/commands/setMeta.d.ts +0 -15
- package/dist/packages/core/src/commands/setNode.d.ts +0 -16
- package/dist/packages/core/src/commands/setNodeSelection.d.ts +0 -14
- package/dist/packages/core/src/commands/setTextSelection.d.ts +0 -14
- package/dist/packages/core/src/commands/sinkListItem.d.ts +0 -15
- package/dist/packages/core/src/commands/splitBlock.d.ts +0 -17
- package/dist/packages/core/src/commands/splitListItem.d.ts +0 -15
- package/dist/packages/core/src/commands/toggleList.d.ts +0 -18
- package/dist/packages/core/src/commands/toggleMark.d.ts +0 -30
- package/dist/packages/core/src/commands/toggleNode.d.ts +0 -17
- package/dist/packages/core/src/commands/toggleWrap.d.ts +0 -16
- package/dist/packages/core/src/commands/undoInputRule.d.ts +0 -13
- package/dist/packages/core/src/commands/unsetAllMarks.d.ts +0 -13
- package/dist/packages/core/src/commands/unsetMark.d.ts +0 -25
- package/dist/packages/core/src/commands/updateAttributes.d.ts +0 -24
- package/dist/packages/core/src/commands/wrapIn.d.ts +0 -16
- package/dist/packages/core/src/commands/wrapInList.d.ts +0 -16
- package/dist/packages/core/src/extensions/clipboardTextSerializer.d.ts +0 -5
- package/dist/packages/core/src/extensions/commands.d.ts +0 -3
- package/dist/packages/core/src/extensions/editable.d.ts +0 -2
- package/dist/packages/core/src/extensions/focusEvents.d.ts +0 -2
- package/dist/packages/core/src/extensions/index.d.ts +0 -6
- package/dist/packages/core/src/extensions/keymap.d.ts +0 -2
- package/dist/packages/core/src/extensions/tabindex.d.ts +0 -2
- package/dist/packages/core/src/helpers/combineTransactionSteps.d.ts +0 -10
- package/dist/packages/core/src/helpers/createChainableState.d.ts +0 -10
- package/dist/packages/core/src/helpers/createDocument.d.ts +0 -12
- package/dist/packages/core/src/helpers/createNodeFromContent.d.ts +0 -15
- package/dist/packages/core/src/helpers/defaultBlockAt.d.ts +0 -7
- package/dist/packages/core/src/helpers/findChildren.d.ts +0 -9
- package/dist/packages/core/src/helpers/findChildrenInRange.d.ts +0 -10
- package/dist/packages/core/src/helpers/findParentNode.d.ts +0 -16
- package/dist/packages/core/src/helpers/findParentNodeClosestToPos.d.ts +0 -17
- package/dist/packages/core/src/helpers/generateHTML.d.ts +0 -8
- package/dist/packages/core/src/helpers/generateJSON.d.ts +0 -8
- package/dist/packages/core/src/helpers/generateText.d.ts +0 -12
- package/dist/packages/core/src/helpers/getAttributes.d.ts +0 -9
- package/dist/packages/core/src/helpers/getAttributesFromExtensions.d.ts +0 -6
- package/dist/packages/core/src/helpers/getChangedRanges.d.ts +0 -11
- package/dist/packages/core/src/helpers/getDebugJSON.d.ts +0 -8
- package/dist/packages/core/src/helpers/getExtensionField.d.ts +0 -9
- package/dist/packages/core/src/helpers/getHTMLFromFragment.d.ts +0 -2
- package/dist/packages/core/src/helpers/getMarkAttributes.d.ts +0 -3
- package/dist/packages/core/src/helpers/getMarkRange.d.ts +0 -3
- package/dist/packages/core/src/helpers/getMarkType.d.ts +0 -2
- package/dist/packages/core/src/helpers/getMarksBetween.d.ts +0 -3
- package/dist/packages/core/src/helpers/getNodeAtPosition.d.ts +0 -11
- package/dist/packages/core/src/helpers/getNodeAttributes.d.ts +0 -3
- package/dist/packages/core/src/helpers/getNodeType.d.ts +0 -2
- package/dist/packages/core/src/helpers/getRenderedAttributes.d.ts +0 -3
- package/dist/packages/core/src/helpers/getSchema.d.ts +0 -4
- package/dist/packages/core/src/helpers/getSchemaByResolvedExtensions.d.ts +0 -10
- package/dist/packages/core/src/helpers/getSchemaTypeByName.d.ts +0 -8
- package/dist/packages/core/src/helpers/getSchemaTypeNameByName.d.ts +0 -8
- package/dist/packages/core/src/helpers/getSplittedAttributes.d.ts +0 -9
- package/dist/packages/core/src/helpers/getText.d.ts +0 -15
- package/dist/packages/core/src/helpers/getTextBetween.d.ts +0 -14
- package/dist/packages/core/src/helpers/getTextContentFromNodes.d.ts +0 -8
- package/dist/packages/core/src/helpers/getTextSerializersFromSchema.d.ts +0 -8
- package/dist/packages/core/src/helpers/index.d.ts +0 -50
- package/dist/packages/core/src/helpers/injectExtensionAttributesToParseRule.d.ts +0 -9
- package/dist/packages/core/src/helpers/isActive.d.ts +0 -2
- package/dist/packages/core/src/helpers/isAtEndOfNode.d.ts +0 -2
- package/dist/packages/core/src/helpers/isAtStartOfNode.d.ts +0 -2
- package/dist/packages/core/src/helpers/isExtensionRulesEnabled.d.ts +0 -2
- package/dist/packages/core/src/helpers/isList.d.ts +0 -2
- package/dist/packages/core/src/helpers/isMarkActive.d.ts +0 -3
- package/dist/packages/core/src/helpers/isNodeActive.d.ts +0 -3
- package/dist/packages/core/src/helpers/isNodeEmpty.d.ts +0 -2
- package/dist/packages/core/src/helpers/isNodeSelection.d.ts +0 -2
- package/dist/packages/core/src/helpers/isTextSelection.d.ts +0 -2
- package/dist/packages/core/src/helpers/posToDOMRect.d.ts +0 -2
- package/dist/packages/core/src/helpers/resolveFocusPosition.d.ts +0 -4
- package/dist/packages/core/src/helpers/selectionToInsertionEnd.d.ts +0 -2
- package/dist/packages/core/src/helpers/splitExtensions.d.ts +0 -9
- package/dist/packages/core/src/index.d.ts +0 -24
- package/dist/packages/core/src/inputRules/index.d.ts +0 -5
- package/dist/packages/core/src/inputRules/markInputRule.d.ts +0 -13
- package/dist/packages/core/src/inputRules/nodeInputRule.d.ts +0 -23
- package/dist/packages/core/src/inputRules/textInputRule.d.ts +0 -10
- package/dist/packages/core/src/inputRules/textblockTypeInputRule.d.ts +0 -15
- package/dist/packages/core/src/inputRules/wrappingInputRule.d.ts +0 -28
- package/dist/packages/core/src/pasteRules/index.d.ts +0 -3
- package/dist/packages/core/src/pasteRules/markPasteRule.d.ts +0 -13
- package/dist/packages/core/src/pasteRules/nodePasteRule.d.ts +0 -13
- package/dist/packages/core/src/pasteRules/textPasteRule.d.ts +0 -10
- package/dist/packages/core/src/style.d.ts +0 -1
- package/dist/packages/core/src/types.d.ts +0 -255
- package/dist/packages/core/src/utilities/callOrReturn.d.ts +0 -9
- package/dist/packages/core/src/utilities/createStyleTag.d.ts +0 -1
- package/dist/packages/core/src/utilities/deleteProps.d.ts +0 -6
- package/dist/packages/core/src/utilities/elementFromString.d.ts +0 -1
- package/dist/packages/core/src/utilities/escapeForRegEx.d.ts +0 -1
- package/dist/packages/core/src/utilities/findDuplicates.d.ts +0 -1
- package/dist/packages/core/src/utilities/fromString.d.ts +0 -1
- package/dist/packages/core/src/utilities/index.d.ts +0 -20
- package/dist/packages/core/src/utilities/isAndroid.d.ts +0 -1
- package/dist/packages/core/src/utilities/isEmptyObject.d.ts +0 -1
- package/dist/packages/core/src/utilities/isFunction.d.ts +0 -1
- package/dist/packages/core/src/utilities/isMacOS.d.ts +0 -1
- package/dist/packages/core/src/utilities/isNumber.d.ts +0 -1
- package/dist/packages/core/src/utilities/isPlainObject.d.ts +0 -1
- package/dist/packages/core/src/utilities/isRegExp.d.ts +0 -1
- package/dist/packages/core/src/utilities/isString.d.ts +0 -1
- package/dist/packages/core/src/utilities/isiOS.d.ts +0 -1
- package/dist/packages/core/src/utilities/mergeAttributes.d.ts +0 -1
- package/dist/packages/core/src/utilities/mergeDeep.d.ts +0 -1
- package/dist/packages/core/src/utilities/minMax.d.ts +0 -1
- package/dist/packages/core/src/utilities/objectIncludes.d.ts +0 -8
- package/dist/packages/core/src/utilities/removeDuplicates.d.ts +0 -8
- package/dist/packages/extension-table-header/src/index.d.ts +0 -3
- package/dist/packages/extension-table-header/src/table-header.d.ts +0 -14
- package/src/table-header.ts +0 -63
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Node as ProseMirrorNode, ResolvedPos } from '@tiptap/pm/model';
|
|
2
|
-
import { Predicate } from '../types.js';
|
|
3
|
-
/**
|
|
4
|
-
* Finds the closest parent node to a resolved position that matches a predicate.
|
|
5
|
-
* @param $pos The resolved position to search from
|
|
6
|
-
* @param predicate The predicate to match
|
|
7
|
-
* @returns The closest parent node to the resolved position that matches the predicate
|
|
8
|
-
* @example ```js
|
|
9
|
-
* findParentNodeClosestToPos($from, node => node.type.name === 'paragraph')
|
|
10
|
-
* ```
|
|
11
|
-
*/
|
|
12
|
-
export declare function findParentNodeClosestToPos($pos: ResolvedPos, predicate: Predicate): {
|
|
13
|
-
pos: number;
|
|
14
|
-
start: number;
|
|
15
|
-
depth: number;
|
|
16
|
-
node: ProseMirrorNode;
|
|
17
|
-
} | undefined;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { Extensions, JSONContent } from '../types.js';
|
|
2
|
-
/**
|
|
3
|
-
* Generate HTML from a JSONContent
|
|
4
|
-
* @param doc The JSONContent to generate HTML from
|
|
5
|
-
* @param extensions The extensions to use for the schema
|
|
6
|
-
* @returns The generated HTML
|
|
7
|
-
*/
|
|
8
|
-
export declare function generateHTML(doc: JSONContent, extensions: Extensions): string;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { Extensions } from '../types.js';
|
|
2
|
-
/**
|
|
3
|
-
* Generate JSONContent from HTML
|
|
4
|
-
* @param html The HTML to generate JSONContent from
|
|
5
|
-
* @param extensions The extensions to use for the schema
|
|
6
|
-
* @returns The generated JSONContent
|
|
7
|
-
*/
|
|
8
|
-
export declare function generateJSON(html: string, extensions: Extensions): Record<string, any>;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { Extensions, JSONContent, TextSerializer } from '../types.js';
|
|
2
|
-
/**
|
|
3
|
-
* Generate raw text from a JSONContent
|
|
4
|
-
* @param doc The JSONContent to generate text from
|
|
5
|
-
* @param extensions The extensions to use for the schema
|
|
6
|
-
* @param options Options for the text generation f.e. blockSeparator or textSerializers
|
|
7
|
-
* @returns The generated text
|
|
8
|
-
*/
|
|
9
|
-
export declare function generateText(doc: JSONContent, extensions: Extensions, options?: {
|
|
10
|
-
blockSeparator?: string;
|
|
11
|
-
textSerializers?: Record<string, TextSerializer>;
|
|
12
|
-
}): string;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { MarkType, NodeType } from '@tiptap/pm/model';
|
|
2
|
-
import { EditorState } from '@tiptap/pm/state';
|
|
3
|
-
/**
|
|
4
|
-
* Get node or mark attributes by type or name on the current editor state
|
|
5
|
-
* @param state The current editor state
|
|
6
|
-
* @param typeOrName The node or mark type or name
|
|
7
|
-
* @returns The attributes of the node or mark or an empty object
|
|
8
|
-
*/
|
|
9
|
-
export declare function getAttributes(state: EditorState, typeOrName: string | NodeType | MarkType): Record<string, any>;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { ExtensionAttribute, Extensions } from '../types.js';
|
|
2
|
-
/**
|
|
3
|
-
* Get a list of all extension attributes defined in `addAttribute` and `addGlobalAttribute`.
|
|
4
|
-
* @param extensions List of extensions
|
|
5
|
-
*/
|
|
6
|
-
export declare function getAttributesFromExtensions(extensions: Extensions): ExtensionAttribute[];
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Transform } from '@tiptap/pm/transform';
|
|
2
|
-
import { Range } from '../types.js';
|
|
3
|
-
export type ChangedRange = {
|
|
4
|
-
oldRange: Range;
|
|
5
|
-
newRange: Range;
|
|
6
|
-
};
|
|
7
|
-
/**
|
|
8
|
-
* Returns a list of changed ranges
|
|
9
|
-
* based on the first and last state of all steps.
|
|
10
|
-
*/
|
|
11
|
-
export declare function getChangedRanges(transform: Transform): ChangedRange[];
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { Node as ProseMirrorNode } from '@tiptap/pm/model';
|
|
2
|
-
import { JSONContent } from '../types.js';
|
|
3
|
-
interface DebugJSONContent extends JSONContent {
|
|
4
|
-
from: number;
|
|
5
|
-
to: number;
|
|
6
|
-
}
|
|
7
|
-
export declare function getDebugJSON(node: ProseMirrorNode, startOffset?: number): DebugJSONContent;
|
|
8
|
-
export {};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { AnyExtension, MaybeThisParameterType, RemoveThis } from '../types.js';
|
|
2
|
-
/**
|
|
3
|
-
* Returns a field from an extension
|
|
4
|
-
* @param extension The Tiptap extension
|
|
5
|
-
* @param field The field, for example `renderHTML` or `priority`
|
|
6
|
-
* @param context The context object that should be passed as `this` into the function
|
|
7
|
-
* @returns The field value
|
|
8
|
-
*/
|
|
9
|
-
export declare function getExtensionField<T = any>(extension: AnyExtension, field: string, context?: Omit<MaybeThisParameterType<T>, 'parent'>): RemoveThis<T>;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Node, NodeType } from '@tiptap/pm/model';
|
|
2
|
-
import { EditorState } from '@tiptap/pm/state';
|
|
3
|
-
/**
|
|
4
|
-
* Finds the first node of a given type or name in the current selection.
|
|
5
|
-
* @param state The editor state.
|
|
6
|
-
* @param typeOrName The node type or name.
|
|
7
|
-
* @param pos The position to start searching from.
|
|
8
|
-
* @param maxDepth The maximum depth to search.
|
|
9
|
-
* @returns The node and the depth as an array.
|
|
10
|
-
*/
|
|
11
|
-
export declare const getNodeAtPosition: (state: EditorState, typeOrName: string | NodeType, pos: number, maxDepth?: number) => [Node | null, number];
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Schema } from '@tiptap/pm/model';
|
|
2
|
-
import { Editor } from '../index.js';
|
|
3
|
-
import { Extensions } from '../types.js';
|
|
4
|
-
/**
|
|
5
|
-
* Creates a new Prosemirror schema based on the given extensions.
|
|
6
|
-
* @param extensions An array of Tiptap extensions
|
|
7
|
-
* @param editor The editor instance
|
|
8
|
-
* @returns A Prosemirror schema
|
|
9
|
-
*/
|
|
10
|
-
export declare function getSchemaByResolvedExtensions(extensions: Extensions, editor?: Editor): Schema;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { MarkType, NodeType, Schema } from '@tiptap/pm/model';
|
|
2
|
-
/**
|
|
3
|
-
* Tries to get a node or mark type by its name.
|
|
4
|
-
* @param name The name of the node or mark type
|
|
5
|
-
* @param schema The Prosemiror schema to search in
|
|
6
|
-
* @returns The node or mark type, or null if it doesn't exist
|
|
7
|
-
*/
|
|
8
|
-
export declare function getSchemaTypeByName(name: string, schema: Schema): NodeType | MarkType | null;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { Schema } from '@tiptap/pm/model';
|
|
2
|
-
/**
|
|
3
|
-
* Get the type of a schema item by its name.
|
|
4
|
-
* @param name The name of the schema item
|
|
5
|
-
* @param schema The Prosemiror schema to search in
|
|
6
|
-
* @returns The type of the schema item (`node` or `mark`), or null if it doesn't exist
|
|
7
|
-
*/
|
|
8
|
-
export declare function getSchemaTypeNameByName(name: string, schema: Schema): 'node' | 'mark' | null;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { ExtensionAttribute } from '../types.js';
|
|
2
|
-
/**
|
|
3
|
-
* Return attributes of an extension that should be splitted by keepOnSplit flag
|
|
4
|
-
* @param extensionAttributes Array of extension attributes
|
|
5
|
-
* @param typeName The type of the extension
|
|
6
|
-
* @param attributes The attributes of the extension
|
|
7
|
-
* @returns The splitted attributes
|
|
8
|
-
*/
|
|
9
|
-
export declare function getSplittedAttributes(extensionAttributes: ExtensionAttribute[], typeName: string, attributes: Record<string, any>): Record<string, any>;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Node as ProseMirrorNode } from '@tiptap/pm/model';
|
|
2
|
-
import { TextSerializer } from '../types.js';
|
|
3
|
-
/**
|
|
4
|
-
* Gets the text of a Prosemirror node
|
|
5
|
-
* @param node The Prosemirror node
|
|
6
|
-
* @param options Options for the text serializer & block separator
|
|
7
|
-
* @returns The text of the node
|
|
8
|
-
* @example ```js
|
|
9
|
-
* const text = getText(node, { blockSeparator: '\n' })
|
|
10
|
-
* ```
|
|
11
|
-
*/
|
|
12
|
-
export declare function getText(node: ProseMirrorNode, options?: {
|
|
13
|
-
blockSeparator?: string;
|
|
14
|
-
textSerializers?: Record<string, TextSerializer>;
|
|
15
|
-
}): string;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Node as ProseMirrorNode } from '@tiptap/pm/model';
|
|
2
|
-
import { Range, TextSerializer } from '../types.js';
|
|
3
|
-
/**
|
|
4
|
-
* Gets the text between two positions in a Prosemirror node
|
|
5
|
-
* and serializes it using the given text serializers and block separator (see getText)
|
|
6
|
-
* @param startNode The Prosemirror node to start from
|
|
7
|
-
* @param range The range of the text to get
|
|
8
|
-
* @param options Options for the text serializer & block separator
|
|
9
|
-
* @returns The text between the two positions
|
|
10
|
-
*/
|
|
11
|
-
export declare function getTextBetween(startNode: ProseMirrorNode, range: Range, options?: {
|
|
12
|
-
blockSeparator?: string;
|
|
13
|
-
textSerializers?: Record<string, TextSerializer>;
|
|
14
|
-
}): string;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { ResolvedPos } from '@tiptap/pm/model';
|
|
2
|
-
/**
|
|
3
|
-
* Returns the text content of a resolved prosemirror position
|
|
4
|
-
* @param $from The resolved position to get the text content from
|
|
5
|
-
* @param maxMatch The maximum number of characters to match
|
|
6
|
-
* @returns The text content
|
|
7
|
-
*/
|
|
8
|
-
export declare const getTextContentFromNodes: ($from: ResolvedPos, maxMatch?: number) => string;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { Schema } from '@tiptap/pm/model';
|
|
2
|
-
import { TextSerializer } from '../types.js';
|
|
3
|
-
/**
|
|
4
|
-
* Find text serializers `toText` in a Prosemirror schema
|
|
5
|
-
* @param schema The Prosemirror schema to search in
|
|
6
|
-
* @returns A record of text serializers by node name
|
|
7
|
-
*/
|
|
8
|
-
export declare function getTextSerializersFromSchema(schema: Schema): Record<string, TextSerializer>;
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
export * from './combineTransactionSteps.js';
|
|
2
|
-
export * from './createChainableState.js';
|
|
3
|
-
export * from './createDocument.js';
|
|
4
|
-
export * from './createNodeFromContent.js';
|
|
5
|
-
export * from './defaultBlockAt.js';
|
|
6
|
-
export * from './findChildren.js';
|
|
7
|
-
export * from './findChildrenInRange.js';
|
|
8
|
-
export * from './findParentNode.js';
|
|
9
|
-
export * from './findParentNodeClosestToPos.js';
|
|
10
|
-
export * from './generateHTML.js';
|
|
11
|
-
export * from './generateJSON.js';
|
|
12
|
-
export * from './generateText.js';
|
|
13
|
-
export * from './getAttributes.js';
|
|
14
|
-
export * from './getAttributesFromExtensions.js';
|
|
15
|
-
export * from './getChangedRanges.js';
|
|
16
|
-
export * from './getDebugJSON.js';
|
|
17
|
-
export * from './getExtensionField.js';
|
|
18
|
-
export * from './getHTMLFromFragment.js';
|
|
19
|
-
export * from './getMarkAttributes.js';
|
|
20
|
-
export * from './getMarkRange.js';
|
|
21
|
-
export * from './getMarksBetween.js';
|
|
22
|
-
export * from './getMarkType.js';
|
|
23
|
-
export * from './getNodeAtPosition.js';
|
|
24
|
-
export * from './getNodeAttributes.js';
|
|
25
|
-
export * from './getNodeType.js';
|
|
26
|
-
export * from './getRenderedAttributes.js';
|
|
27
|
-
export * from './getSchema.js';
|
|
28
|
-
export * from './getSchemaByResolvedExtensions.js';
|
|
29
|
-
export * from './getSchemaTypeByName.js';
|
|
30
|
-
export * from './getSchemaTypeNameByName.js';
|
|
31
|
-
export * from './getSplittedAttributes.js';
|
|
32
|
-
export * from './getText.js';
|
|
33
|
-
export * from './getTextBetween.js';
|
|
34
|
-
export * from './getTextContentFromNodes.js';
|
|
35
|
-
export * from './getTextSerializersFromSchema.js';
|
|
36
|
-
export * from './injectExtensionAttributesToParseRule.js';
|
|
37
|
-
export * from './isActive.js';
|
|
38
|
-
export * from './isAtEndOfNode.js';
|
|
39
|
-
export * from './isAtStartOfNode.js';
|
|
40
|
-
export * from './isExtensionRulesEnabled.js';
|
|
41
|
-
export * from './isList.js';
|
|
42
|
-
export * from './isMarkActive.js';
|
|
43
|
-
export * from './isNodeActive.js';
|
|
44
|
-
export * from './isNodeEmpty.js';
|
|
45
|
-
export * from './isNodeSelection.js';
|
|
46
|
-
export * from './isTextSelection.js';
|
|
47
|
-
export * from './posToDOMRect.js';
|
|
48
|
-
export * from './resolveFocusPosition.js';
|
|
49
|
-
export * from './selectionToInsertionEnd.js';
|
|
50
|
-
export * from './splitExtensions.js';
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { ParseRule } from '@tiptap/pm/model';
|
|
2
|
-
import { ExtensionAttribute } from '../types.js';
|
|
3
|
-
/**
|
|
4
|
-
* This function merges extension attributes into parserule attributes (`attrs` or `getAttrs`).
|
|
5
|
-
* Cancels when `getAttrs` returned `false`.
|
|
6
|
-
* @param parseRule ProseMirror ParseRule
|
|
7
|
-
* @param extensionAttributes List of attributes to inject
|
|
8
|
-
*/
|
|
9
|
-
export declare function injectExtensionAttributesToParseRule(parseRule: ParseRule, extensionAttributes: ExtensionAttribute[]): ParseRule;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Extension } from '../Extension.js';
|
|
2
|
-
import { Mark } from '../Mark.js';
|
|
3
|
-
import { Node } from '../Node.js';
|
|
4
|
-
import { Extensions } from '../types.js';
|
|
5
|
-
export declare function splitExtensions(extensions: Extensions): {
|
|
6
|
-
baseExtensions: Extension<any, any>[];
|
|
7
|
-
nodeExtensions: Node<any, any>[];
|
|
8
|
-
markExtensions: Mark<any, any>[];
|
|
9
|
-
};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
export * from './CommandManager.js';
|
|
2
|
-
export * from './Editor.js';
|
|
3
|
-
export * from './Extension.js';
|
|
4
|
-
export * as extensions from './extensions/index.js';
|
|
5
|
-
export * from './helpers/index.js';
|
|
6
|
-
export * from './InputRule.js';
|
|
7
|
-
export * from './inputRules/index.js';
|
|
8
|
-
export * from './Mark.js';
|
|
9
|
-
export * from './Node.js';
|
|
10
|
-
export * from './NodePos.js';
|
|
11
|
-
export * from './NodeView.js';
|
|
12
|
-
export * from './PasteRule.js';
|
|
13
|
-
export * from './pasteRules/index.js';
|
|
14
|
-
export * from './Tracker.js';
|
|
15
|
-
export * from './types.js';
|
|
16
|
-
export * from './utilities/index.js';
|
|
17
|
-
export interface Commands<ReturnType = any> {
|
|
18
|
-
}
|
|
19
|
-
export interface ExtensionConfig<Options = any, Storage = any> {
|
|
20
|
-
}
|
|
21
|
-
export interface NodeConfig<Options = any, Storage = any> {
|
|
22
|
-
}
|
|
23
|
-
export interface MarkConfig<Options = any, Storage = any> {
|
|
24
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { MarkType } from '@tiptap/pm/model';
|
|
2
|
-
import { InputRule, InputRuleFinder } from '../InputRule.js';
|
|
3
|
-
import { ExtendedRegExpMatchArray } from '../types.js';
|
|
4
|
-
/**
|
|
5
|
-
* Build an input rule that adds a mark when the
|
|
6
|
-
* matched text is typed into it.
|
|
7
|
-
* @see https://tiptap.dev/guide/custom-extensions/#input-rules
|
|
8
|
-
*/
|
|
9
|
-
export declare function markInputRule(config: {
|
|
10
|
-
find: InputRuleFinder;
|
|
11
|
-
type: MarkType;
|
|
12
|
-
getAttributes?: Record<string, any> | ((match: ExtendedRegExpMatchArray) => Record<string, any>) | false | null;
|
|
13
|
-
}): InputRule;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { NodeType } from '@tiptap/pm/model';
|
|
2
|
-
import { InputRule, InputRuleFinder } from '../InputRule.js';
|
|
3
|
-
import { ExtendedRegExpMatchArray } from '../types.js';
|
|
4
|
-
/**
|
|
5
|
-
* Build an input rule that adds a node when the
|
|
6
|
-
* matched text is typed into it.
|
|
7
|
-
* @see https://tiptap.dev/guide/custom-extensions/#input-rules
|
|
8
|
-
*/
|
|
9
|
-
export declare function nodeInputRule(config: {
|
|
10
|
-
/**
|
|
11
|
-
* The regex to match.
|
|
12
|
-
*/
|
|
13
|
-
find: InputRuleFinder;
|
|
14
|
-
/**
|
|
15
|
-
* The node type to add.
|
|
16
|
-
*/
|
|
17
|
-
type: NodeType;
|
|
18
|
-
/**
|
|
19
|
-
* A function that returns the attributes for the node
|
|
20
|
-
* can also be an object of attributes
|
|
21
|
-
*/
|
|
22
|
-
getAttributes?: Record<string, any> | ((match: ExtendedRegExpMatchArray) => Record<string, any>) | false | null;
|
|
23
|
-
}): InputRule;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { InputRule, InputRuleFinder } from '../InputRule.js';
|
|
2
|
-
/**
|
|
3
|
-
* Build an input rule that replaces text when the
|
|
4
|
-
* matched text is typed into it.
|
|
5
|
-
* @see https://tiptap.dev/guide/custom-extensions/#input-rules
|
|
6
|
-
*/
|
|
7
|
-
export declare function textInputRule(config: {
|
|
8
|
-
find: InputRuleFinder;
|
|
9
|
-
replace: string;
|
|
10
|
-
}): InputRule;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { NodeType } from '@tiptap/pm/model';
|
|
2
|
-
import { InputRule, InputRuleFinder } from '../InputRule.js';
|
|
3
|
-
import { ExtendedRegExpMatchArray } from '../types.js';
|
|
4
|
-
/**
|
|
5
|
-
* Build an input rule that changes the type of a textblock when the
|
|
6
|
-
* matched text is typed into it. When using a regular expresion you’ll
|
|
7
|
-
* probably want the regexp to start with `^`, so that the pattern can
|
|
8
|
-
* only occur at the start of a textblock.
|
|
9
|
-
* @see https://tiptap.dev/guide/custom-extensions/#input-rules
|
|
10
|
-
*/
|
|
11
|
-
export declare function textblockTypeInputRule(config: {
|
|
12
|
-
find: InputRuleFinder;
|
|
13
|
-
type: NodeType;
|
|
14
|
-
getAttributes?: Record<string, any> | ((match: ExtendedRegExpMatchArray) => Record<string, any>) | false | null;
|
|
15
|
-
}): InputRule;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { Node as ProseMirrorNode, NodeType } from '@tiptap/pm/model';
|
|
2
|
-
import { Editor } from '../Editor.js';
|
|
3
|
-
import { InputRule, InputRuleFinder } from '../InputRule.js';
|
|
4
|
-
import { ExtendedRegExpMatchArray } from '../types.js';
|
|
5
|
-
/**
|
|
6
|
-
* Build an input rule for automatically wrapping a textblock when a
|
|
7
|
-
* given string is typed. When using a regular expresion you’ll
|
|
8
|
-
* probably want the regexp to start with `^`, so that the pattern can
|
|
9
|
-
* only occur at the start of a textblock.
|
|
10
|
-
*
|
|
11
|
-
* `type` is the type of node to wrap in.
|
|
12
|
-
*
|
|
13
|
-
* By default, if there’s a node with the same type above the newly
|
|
14
|
-
* wrapped node, the rule will try to join those
|
|
15
|
-
* two nodes. You can pass a join predicate, which takes a regular
|
|
16
|
-
* expression match and the node before the wrapped node, and can
|
|
17
|
-
* return a boolean to indicate whether a join should happen.
|
|
18
|
-
* @see https://tiptap.dev/guide/custom-extensions/#input-rules
|
|
19
|
-
*/
|
|
20
|
-
export declare function wrappingInputRule(config: {
|
|
21
|
-
find: InputRuleFinder;
|
|
22
|
-
type: NodeType;
|
|
23
|
-
keepMarks?: boolean;
|
|
24
|
-
keepAttributes?: boolean;
|
|
25
|
-
editor?: Editor;
|
|
26
|
-
getAttributes?: Record<string, any> | ((match: ExtendedRegExpMatchArray) => Record<string, any>) | false | null;
|
|
27
|
-
joinPredicate?: (match: ExtendedRegExpMatchArray, node: ProseMirrorNode) => boolean;
|
|
28
|
-
}): InputRule;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { MarkType } from '@tiptap/pm/model';
|
|
2
|
-
import { PasteRule, PasteRuleFinder } from '../PasteRule.js';
|
|
3
|
-
import { ExtendedRegExpMatchArray } from '../types.js';
|
|
4
|
-
/**
|
|
5
|
-
* Build an paste rule that adds a mark when the
|
|
6
|
-
* matched text is pasted into it.
|
|
7
|
-
* @see https://tiptap.dev/guide/custom-extensions/#paste-rules
|
|
8
|
-
*/
|
|
9
|
-
export declare function markPasteRule(config: {
|
|
10
|
-
find: PasteRuleFinder;
|
|
11
|
-
type: MarkType;
|
|
12
|
-
getAttributes?: Record<string, any> | ((match: ExtendedRegExpMatchArray, event: ClipboardEvent) => Record<string, any>) | false | null;
|
|
13
|
-
}): PasteRule;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { NodeType } from '@tiptap/pm/model';
|
|
2
|
-
import { PasteRule, PasteRuleFinder } from '../PasteRule.js';
|
|
3
|
-
import { ExtendedRegExpMatchArray } from '../types.js';
|
|
4
|
-
/**
|
|
5
|
-
* Build an paste rule that adds a node when the
|
|
6
|
-
* matched text is pasted into it.
|
|
7
|
-
* @see https://tiptap.dev/guide/custom-extensions/#paste-rules
|
|
8
|
-
*/
|
|
9
|
-
export declare function nodePasteRule(config: {
|
|
10
|
-
find: PasteRuleFinder;
|
|
11
|
-
type: NodeType;
|
|
12
|
-
getAttributes?: Record<string, any> | ((match: ExtendedRegExpMatchArray, event: ClipboardEvent) => Record<string, any>) | false | null;
|
|
13
|
-
}): PasteRule;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { PasteRule, PasteRuleFinder } from '../PasteRule.js';
|
|
2
|
-
/**
|
|
3
|
-
* Build an paste rule that replaces text when the
|
|
4
|
-
* matched text is pasted into it.
|
|
5
|
-
* @see https://tiptap.dev/guide/custom-extensions/#paste-rules
|
|
6
|
-
*/
|
|
7
|
-
export declare function textPasteRule(config: {
|
|
8
|
-
find: PasteRuleFinder;
|
|
9
|
-
replace: string;
|
|
10
|
-
}): PasteRule;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const style = ".ProseMirror {\n position: relative;\n}\n\n.ProseMirror {\n word-wrap: break-word;\n white-space: pre-wrap;\n white-space: break-spaces;\n -webkit-font-variant-ligatures: none;\n font-variant-ligatures: none;\n font-feature-settings: \"liga\" 0; /* the above doesn't seem to work in Edge */\n}\n\n.ProseMirror [contenteditable=\"false\"] {\n white-space: normal;\n}\n\n.ProseMirror [contenteditable=\"false\"] [contenteditable=\"true\"] {\n white-space: pre-wrap;\n}\n\n.ProseMirror pre {\n white-space: pre-wrap;\n}\n\nimg.ProseMirror-separator {\n display: inline !important;\n border: none !important;\n margin: 0 !important;\n width: 1px !important;\n height: 1px !important;\n}\n\n.ProseMirror-gapcursor {\n display: none;\n pointer-events: none;\n position: absolute;\n margin: 0;\n}\n\n.ProseMirror-gapcursor:after {\n content: \"\";\n display: block;\n position: absolute;\n top: -2px;\n width: 20px;\n border-top: 1px solid black;\n animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;\n}\n\n@keyframes ProseMirror-cursor-blink {\n to {\n visibility: hidden;\n }\n}\n\n.ProseMirror-hideselection *::selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection *::-moz-selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection * {\n caret-color: transparent;\n}\n\n.ProseMirror-focused .ProseMirror-gapcursor {\n display: block;\n}\n\n.tippy-box[data-animation=fade][data-state=hidden] {\n opacity: 0\n}";
|