@tiptap/react 2.0.0-beta.98 → 2.0.0-beta.99
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/dist/packages/core/src/CommandManager.d.ts +1 -1
- package/dist/packages/core/src/Editor.d.ts +4 -2
- package/dist/packages/core/src/EventEmitter.d.ts +1 -1
- package/dist/packages/core/src/ExtensionManager.d.ts +1 -1
- package/dist/packages/core/src/helpers/combineTransactionSteps.d.ts +1 -1
- package/dist/packages/core/src/helpers/createChainableState.d.ts +1 -1
- package/dist/packages/core/src/helpers/createDocument.d.ts +1 -1
- package/dist/packages/core/src/helpers/createNodeFromContent.d.ts +1 -1
- package/dist/packages/core/src/helpers/defaultBlockAt.d.ts +1 -1
- package/dist/packages/core/src/helpers/findChildren.d.ts +1 -1
- package/dist/packages/core/src/helpers/findChildrenInRange.d.ts +1 -1
- package/dist/packages/core/src/helpers/findParentNode.d.ts +1 -1
- package/dist/packages/core/src/helpers/findParentNodeClosestToPos.d.ts +1 -1
- package/dist/packages/core/src/helpers/generateHTML.d.ts +1 -1
- package/dist/packages/core/src/helpers/generateJSON.d.ts +1 -1
- package/dist/packages/core/src/helpers/generateText.d.ts +1 -1
- package/dist/packages/core/src/helpers/getAttributes.d.ts +1 -1
- package/dist/packages/core/src/helpers/getAttributesFromExtensions.d.ts +1 -1
- package/dist/packages/core/src/helpers/getChangedRanges.d.ts +1 -1
- package/dist/packages/core/src/helpers/getDebugJSON.d.ts +1 -1
- package/dist/packages/core/src/helpers/getExtensionField.d.ts +1 -1
- package/dist/packages/core/src/helpers/getHTMLFromFragment.d.ts +1 -1
- package/dist/packages/core/src/helpers/getMarkAttributes.d.ts +1 -1
- package/dist/packages/core/src/helpers/getMarkRange.d.ts +1 -1
- package/dist/packages/core/src/helpers/getMarkType.d.ts +1 -1
- package/dist/packages/core/src/helpers/getMarksBetween.d.ts +1 -1
- package/dist/packages/core/src/helpers/getNodeAttributes.d.ts +1 -1
- package/dist/packages/core/src/helpers/getNodeType.d.ts +1 -1
- package/dist/packages/core/src/helpers/getRenderedAttributes.d.ts +1 -1
- package/dist/packages/core/src/helpers/getSchema.d.ts +1 -1
- package/dist/packages/core/src/helpers/getSchemaByResolvedExtensions.d.ts +1 -1
- package/dist/packages/core/src/helpers/getSchemaTypeByName.d.ts +1 -1
- package/dist/packages/core/src/helpers/getSchemaTypeNameByName.d.ts +1 -1
- package/dist/packages/core/src/helpers/getSplittedAttributes.d.ts +1 -1
- package/dist/packages/core/src/helpers/getText.d.ts +1 -1
- package/dist/packages/core/src/helpers/getTextBetween.d.ts +1 -1
- package/dist/packages/core/src/helpers/getTextSeralizersFromSchema.d.ts +1 -1
- package/dist/packages/core/src/helpers/injectExtensionAttributesToParseRule.d.ts +1 -1
- package/dist/packages/core/src/helpers/isActive.d.ts +1 -1
- package/dist/packages/core/src/helpers/isExtensionRulesEnabled.d.ts +1 -1
- package/dist/packages/core/src/helpers/isList.d.ts +1 -1
- package/dist/packages/core/src/helpers/isMarkActive.d.ts +1 -1
- package/dist/packages/core/src/helpers/isNodeActive.d.ts +1 -1
- package/dist/packages/core/src/helpers/isNodeEmpty.d.ts +1 -1
- package/dist/packages/core/src/helpers/isNodeSelection.d.ts +1 -1
- package/dist/packages/core/src/helpers/isTextSelection.d.ts +1 -1
- package/dist/packages/core/src/helpers/posToDOMRect.d.ts +1 -1
- package/dist/packages/core/src/helpers/resolveFocusPosition.d.ts +4 -0
- package/dist/packages/core/src/helpers/selectionToInsertionEnd.d.ts +1 -1
- package/dist/packages/core/src/helpers/splitExtensions.d.ts +1 -1
- package/dist/packages/core/src/index.d.ts +40 -40
- package/dist/packages/core/src/inputRules/markInputRule.d.ts +1 -1
- package/dist/packages/core/src/inputRules/nodeInputRule.d.ts +1 -1
- package/dist/packages/core/src/inputRules/textInputRule.d.ts +1 -1
- package/dist/packages/core/src/inputRules/textblockTypeInputRule.d.ts +1 -1
- package/dist/packages/core/src/inputRules/wrappingInputRule.d.ts +1 -1
- package/dist/packages/core/src/pasteRules/markPasteRule.d.ts +1 -1
- package/dist/packages/core/src/pasteRules/textPasteRule.d.ts +1 -1
- package/dist/packages/core/src/style.d.ts +1 -2
- package/dist/packages/core/src/utilities/callOrReturn.d.ts +1 -1
- package/dist/packages/core/src/utilities/createStyleTag.d.ts +1 -1
- package/dist/packages/core/src/utilities/deleteProps.d.ts +1 -1
- package/dist/packages/core/src/utilities/elementFromString.d.ts +1 -1
- package/dist/packages/core/src/utilities/findDuplicates.d.ts +1 -1
- package/dist/packages/core/src/utilities/fromString.d.ts +1 -1
- package/dist/packages/core/src/utilities/isClass.d.ts +1 -1
- package/dist/packages/core/src/utilities/isEmptyObject.d.ts +1 -1
- package/dist/packages/core/src/utilities/isFunction.d.ts +1 -1
- package/dist/packages/core/src/utilities/isNumber.d.ts +1 -1
- package/dist/packages/core/src/utilities/isObject.d.ts +1 -1
- package/dist/packages/core/src/utilities/isPlainObject.d.ts +1 -1
- package/dist/packages/core/src/utilities/isRegExp.d.ts +1 -1
- package/dist/packages/core/src/utilities/isString.d.ts +1 -1
- package/dist/packages/core/src/utilities/isiOS.d.ts +1 -1
- package/dist/packages/core/src/utilities/mergeAttributes.d.ts +1 -1
- package/dist/packages/core/src/utilities/mergeDeep.d.ts +1 -1
- package/dist/packages/core/src/utilities/minMax.d.ts +1 -1
- package/dist/packages/core/src/utilities/objectIncludes.d.ts +1 -1
- package/dist/packages/core/src/utilities/removeDuplicates.d.ts +1 -1
- package/dist/packages/extension-bullet-list/src/bullet-list.d.ts +1 -0
- package/dist/packages/extension-character-count/src/character-count.d.ts +25 -4
- package/dist/packages/extension-link/src/helpers/autolink.d.ts +1 -1
- package/dist/packages/extension-link/src/helpers/clickHandler.d.ts +1 -1
- package/dist/packages/extension-link/src/helpers/pasteHandler.d.ts +1 -1
- package/dist/packages/extension-ordered-list/src/ordered-list.d.ts +1 -0
- package/dist/packages/extension-task-list/src/task-list.d.ts +1 -0
- package/dist/packages/html/src/generateHTML.d.ts +1 -1
- package/dist/packages/html/src/generateJSON.d.ts +1 -1
- package/dist/packages/html/src/getHTMLFromFragment.d.ts +1 -1
- package/dist/packages/html/src/index.d.ts +2 -2
- package/package.json +4 -4
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { EditorState, Transaction } from 'prosemirror-state';
|
|
2
2
|
import { Editor } from './Editor';
|
|
3
3
|
import { SingleCommands, ChainedCommands, CanCommands, AnyCommands, CommandProps } from './types';
|
|
4
|
-
export
|
|
4
|
+
export declare class CommandManager {
|
|
5
5
|
editor: Editor;
|
|
6
6
|
rawCommands: AnyCommands;
|
|
7
7
|
customState?: EditorState;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { EditorState, Plugin, PluginKey, Transaction } from 'prosemirror-state';
|
|
2
2
|
import { EditorView } from 'prosemirror-view';
|
|
3
3
|
import { Schema, MarkType, NodeType } from 'prosemirror-model';
|
|
4
|
-
import ExtensionManager from './ExtensionManager';
|
|
5
|
-
import EventEmitter from './EventEmitter';
|
|
4
|
+
import { ExtensionManager } from './ExtensionManager';
|
|
5
|
+
import { EventEmitter } from './EventEmitter';
|
|
6
6
|
import { EditorOptions, CanCommands, ChainedCommands, JSONContent, SingleCommands, TextSerializer, EditorEvents } from './types';
|
|
7
7
|
import * as extensions from './extensions';
|
|
8
8
|
export { extensions };
|
|
@@ -132,6 +132,8 @@ export declare class Editor extends EventEmitter<EditorEvents> {
|
|
|
132
132
|
get isEmpty(): boolean;
|
|
133
133
|
/**
|
|
134
134
|
* Get the number of characters for the current document.
|
|
135
|
+
*
|
|
136
|
+
* @deprecated
|
|
135
137
|
*/
|
|
136
138
|
getCharacterCount(): number;
|
|
137
139
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
declare type StringKeyOf<T> = Extract<keyof T, string>;
|
|
2
2
|
declare type CallbackType<T extends Record<string, any>, EventName extends StringKeyOf<T>> = T[EventName] extends any[] ? T[EventName] : [T[EventName]];
|
|
3
3
|
declare type CallbackFunction<T extends Record<string, any>, EventName extends StringKeyOf<T>> = (...props: CallbackType<T, EventName>) => any;
|
|
4
|
-
export
|
|
4
|
+
export declare class EventEmitter<T extends Record<string, any>> {
|
|
5
5
|
private callbacks;
|
|
6
6
|
on<EventName extends StringKeyOf<T>>(event: EventName, fn: CallbackFunction<T, EventName>): this;
|
|
7
7
|
protected emit<EventName extends StringKeyOf<T>>(event: EventName, ...args: CallbackType<T, EventName>): this;
|
|
@@ -2,7 +2,7 @@ import { Schema } from 'prosemirror-model';
|
|
|
2
2
|
import { Plugin } from 'prosemirror-state';
|
|
3
3
|
import { Editor } from './Editor';
|
|
4
4
|
import { Extensions, RawCommands } from './types';
|
|
5
|
-
export
|
|
5
|
+
export declare class ExtensionManager {
|
|
6
6
|
editor: Editor;
|
|
7
7
|
schema: Schema;
|
|
8
8
|
extensions: Extensions;
|
|
@@ -4,4 +4,4 @@ import { Transform } from 'prosemirror-transform';
|
|
|
4
4
|
/**
|
|
5
5
|
* Returns a new `Transform` based on all steps of the passed transactions.
|
|
6
6
|
*/
|
|
7
|
-
export
|
|
7
|
+
export declare function combineTransactionSteps(oldDoc: ProseMirrorNode, transactions: Transaction[]): Transform;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { Schema, Node as ProseMirrorNode, ParseOptions } from 'prosemirror-model';
|
|
2
2
|
import { Content } from '../types';
|
|
3
|
-
export
|
|
3
|
+
export declare function createDocument(content: Content, schema: Schema, parseOptions?: ParseOptions): ProseMirrorNode;
|
|
@@ -4,4 +4,4 @@ export declare type CreateNodeFromContentOptions = {
|
|
|
4
4
|
slice?: boolean;
|
|
5
5
|
parseOptions?: ParseOptions;
|
|
6
6
|
};
|
|
7
|
-
export
|
|
7
|
+
export declare function createNodeFromContent(content: Content, schema: Schema, options?: CreateNodeFromContentOptions): ProseMirrorNode | Fragment;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { ContentMatch, NodeType } from 'prosemirror-model';
|
|
2
|
-
export
|
|
2
|
+
export declare function defaultBlockAt(match: ContentMatch): NodeType | null;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { Node as ProseMirrorNode } from 'prosemirror-model';
|
|
2
2
|
import { Predicate, NodeWithPos } from '../types';
|
|
3
|
-
export
|
|
3
|
+
export declare function findChildren(node: ProseMirrorNode, predicate: Predicate): NodeWithPos[];
|
|
@@ -3,4 +3,4 @@ import { Predicate, Range, NodeWithPos } from '../types';
|
|
|
3
3
|
/**
|
|
4
4
|
* Same as `findChildren` but searches only within a `range`.
|
|
5
5
|
*/
|
|
6
|
-
export
|
|
6
|
+
export declare function findChildrenInRange(node: ProseMirrorNode, range: Range, predicate: Predicate): NodeWithPos[];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="prosemirror-model" />
|
|
2
2
|
import { Selection } from 'prosemirror-state';
|
|
3
3
|
import { Predicate } from '../types';
|
|
4
|
-
export
|
|
4
|
+
export declare function findParentNode(predicate: Predicate): (selection: Selection) => {
|
|
5
5
|
pos: number;
|
|
6
6
|
start: number;
|
|
7
7
|
depth: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ResolvedPos, Node as ProseMirrorNode } from 'prosemirror-model';
|
|
2
2
|
import { Predicate } from '../types';
|
|
3
|
-
export
|
|
3
|
+
export declare function findParentNodeClosestToPos($pos: ResolvedPos, predicate: Predicate): ({
|
|
4
4
|
pos: number;
|
|
5
5
|
start: number;
|
|
6
6
|
depth: number;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { Extensions, JSONContent } from '../types';
|
|
2
|
-
export
|
|
2
|
+
export declare function generateHTML(doc: JSONContent, extensions: Extensions): string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { Extensions } from '../types';
|
|
2
|
-
export
|
|
2
|
+
export declare function generateJSON(html: string, extensions: Extensions): Record<string, any>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Extensions, JSONContent, TextSerializer } from '../types';
|
|
2
|
-
export
|
|
2
|
+
export declare function generateText(doc: JSONContent, extensions: Extensions, options?: {
|
|
3
3
|
blockSeparator?: string;
|
|
4
4
|
textSerializers?: Record<string, TextSerializer>;
|
|
5
5
|
}): string;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { MarkType, NodeType } from 'prosemirror-model';
|
|
2
2
|
import { EditorState } from 'prosemirror-state';
|
|
3
|
-
export
|
|
3
|
+
export declare function getAttributes(state: EditorState, typeOrName: string | NodeType | MarkType): Record<string, any>;
|
|
@@ -3,4 +3,4 @@ import { Extensions, ExtensionAttribute } from '../types';
|
|
|
3
3
|
* Get a list of all extension attributes defined in `addAttribute` and `addGlobalAttribute`.
|
|
4
4
|
* @param extensions List of extensions
|
|
5
5
|
*/
|
|
6
|
-
export
|
|
6
|
+
export declare function getAttributesFromExtensions(extensions: Extensions): ExtensionAttribute[];
|
|
@@ -8,4 +8,4 @@ export declare type ChangedRange = {
|
|
|
8
8
|
* Returns a list of changed ranges
|
|
9
9
|
* based on the first and last state of all steps.
|
|
10
10
|
*/
|
|
11
|
-
export
|
|
11
|
+
export declare function getChangedRanges(transform: Transform): ChangedRange[];
|
|
@@ -4,5 +4,5 @@ interface DebugJSONContent extends JSONContent {
|
|
|
4
4
|
from: number;
|
|
5
5
|
to: number;
|
|
6
6
|
}
|
|
7
|
-
export
|
|
7
|
+
export declare function getDebugJSON(node: ProseMirrorNode, startOffset?: number): DebugJSONContent;
|
|
8
8
|
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { AnyExtension, RemoveThis, MaybeThisParameterType } from '../types';
|
|
2
|
-
export
|
|
2
|
+
export declare function getExtensionField<T = any>(extension: AnyExtension, field: string, context?: Omit<MaybeThisParameterType<T>, 'parent'>): RemoveThis<T>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { Schema, Fragment } from 'prosemirror-model';
|
|
2
|
-
export
|
|
2
|
+
export declare function getHTMLFromFragment(fragment: Fragment, schema: Schema): string;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { EditorState } from 'prosemirror-state';
|
|
2
2
|
import { MarkType } from 'prosemirror-model';
|
|
3
|
-
export
|
|
3
|
+
export declare function getMarkAttributes(state: EditorState, typeOrName: string | MarkType): Record<string, any>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { MarkType, ResolvedPos } from 'prosemirror-model';
|
|
2
2
|
import { Range } from '../types';
|
|
3
|
-
export
|
|
3
|
+
export declare function getMarkRange($pos: ResolvedPos, type: MarkType, attributes?: Record<string, any>): Range | void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { MarkType, Schema } from 'prosemirror-model';
|
|
2
|
-
export
|
|
2
|
+
export declare function getMarkType(nameOrType: string | MarkType, schema: Schema): MarkType;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { Node as ProseMirrorNode } from 'prosemirror-model';
|
|
2
2
|
import { MarkRange } from '../types';
|
|
3
|
-
export
|
|
3
|
+
export declare function getMarksBetween(from: number, to: number, doc: ProseMirrorNode): MarkRange[];
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { EditorState } from 'prosemirror-state';
|
|
2
2
|
import { NodeType } from 'prosemirror-model';
|
|
3
|
-
export
|
|
3
|
+
export declare function getNodeAttributes(state: EditorState, typeOrName: string | NodeType): Record<string, any>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { NodeType, Schema } from 'prosemirror-model';
|
|
2
|
-
export
|
|
2
|
+
export declare function getNodeType(nameOrType: string | NodeType, schema: Schema): NodeType;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { Node, Mark } from 'prosemirror-model';
|
|
2
2
|
import { ExtensionAttribute } from '../types';
|
|
3
|
-
export
|
|
3
|
+
export declare function getRenderedAttributes(nodeOrMark: Node | Mark, extensionAttributes: ExtensionAttribute[]): Record<string, any>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { MarkType, NodeType, Schema } from 'prosemirror-model';
|
|
2
|
-
export
|
|
2
|
+
export declare function getSchemaTypeByName(name: string, schema: Schema): NodeType | MarkType | null;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { Schema } from 'prosemirror-model';
|
|
2
|
-
export
|
|
2
|
+
export declare function getSchemaTypeNameByName(name: string, schema: Schema): 'node' | 'mark' | null;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { ExtensionAttribute } from '../types';
|
|
2
|
-
export
|
|
2
|
+
export declare function getSplittedAttributes(extensionAttributes: ExtensionAttribute[], typeName: string, attributes: Record<string, any>): Record<string, any>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TextSerializer } from '../types';
|
|
2
2
|
import { Node as ProseMirrorNode } from 'prosemirror-model';
|
|
3
|
-
export
|
|
3
|
+
export declare function getText(node: ProseMirrorNode, options?: {
|
|
4
4
|
blockSeparator?: string;
|
|
5
5
|
textSerializers?: Record<string, TextSerializer>;
|
|
6
6
|
}): string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Range, TextSerializer } from '../types';
|
|
2
2
|
import { Node as ProseMirrorNode } from 'prosemirror-model';
|
|
3
|
-
export
|
|
3
|
+
export declare function getTextBetween(startNode: ProseMirrorNode, range: Range, options?: {
|
|
4
4
|
blockSeparator?: string;
|
|
5
5
|
textSerializers?: Record<string, TextSerializer>;
|
|
6
6
|
}): string;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { Schema } from 'prosemirror-model';
|
|
2
2
|
import { TextSerializer } from '../types';
|
|
3
|
-
export
|
|
3
|
+
export declare function getTextSeralizersFromSchema(schema: Schema): Record<string, TextSerializer>;
|
|
@@ -6,4 +6,4 @@ import { ExtensionAttribute } from '../types';
|
|
|
6
6
|
* @param parseRule ProseMirror ParseRule
|
|
7
7
|
* @param extensionAttributes List of attributes to inject
|
|
8
8
|
*/
|
|
9
|
-
export
|
|
9
|
+
export declare function injectExtensionAttributesToParseRule(parseRule: ParseRule, extensionAttributes: ExtensionAttribute[]): ParseRule;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { EditorState } from 'prosemirror-state';
|
|
2
|
-
export
|
|
2
|
+
export declare function isActive(state: EditorState, name: string | null, attributes?: Record<string, any>): boolean;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { AnyExtension, EnableRules } from '../types';
|
|
2
|
-
export
|
|
2
|
+
export declare function isExtensionRulesEnabled(extension: AnyExtension, enabled: EnableRules): boolean;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { Extensions } from '../types';
|
|
2
|
-
export
|
|
2
|
+
export declare function isList(name: string, extensions: Extensions): boolean;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { EditorState } from 'prosemirror-state';
|
|
2
2
|
import { MarkType } from 'prosemirror-model';
|
|
3
|
-
export
|
|
3
|
+
export declare function isMarkActive(state: EditorState, typeOrName: MarkType | string | null, attributes?: Record<string, any>): boolean;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { EditorState } from 'prosemirror-state';
|
|
2
2
|
import { NodeType } from 'prosemirror-model';
|
|
3
|
-
export
|
|
3
|
+
export declare function isNodeActive(state: EditorState, typeOrName: NodeType | string | null, attributes?: Record<string, any>): boolean;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { Node as ProseMirrorNode } from 'prosemirror-model';
|
|
2
|
-
export
|
|
2
|
+
export declare function isNodeEmpty(node: ProseMirrorNode): boolean;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { NodeSelection } from 'prosemirror-state';
|
|
2
|
-
export
|
|
2
|
+
export declare function isNodeSelection(value: unknown): value is NodeSelection;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { TextSelection } from 'prosemirror-state';
|
|
2
|
-
export
|
|
2
|
+
export declare function isTextSelection(value: unknown): value is TextSelection;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { EditorView } from 'prosemirror-view';
|
|
2
|
-
export
|
|
2
|
+
export declare function posToDOMRect(view: EditorView, from: number, to: number): DOMRect;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { Transaction } from 'prosemirror-state';
|
|
2
|
-
export
|
|
2
|
+
export declare function selectionToInsertionEnd(tr: Transaction, startLen: number, bias: number): void;
|
|
@@ -2,7 +2,7 @@ import { Extensions } from '../types';
|
|
|
2
2
|
import { Extension } from '../Extension';
|
|
3
3
|
import { Node } from '../Node';
|
|
4
4
|
import { Mark } from '../Mark';
|
|
5
|
-
export
|
|
5
|
+
export declare function splitExtensions(extensions: Extensions): {
|
|
6
6
|
baseExtensions: Extension<any, any>[];
|
|
7
7
|
nodeExtensions: Node<any, any>[];
|
|
8
8
|
markExtensions: Mark<any, any>[];
|
|
@@ -10,46 +10,46 @@ export * from './InputRule';
|
|
|
10
10
|
export * from './PasteRule';
|
|
11
11
|
export * from './CommandManager';
|
|
12
12
|
export * from './types';
|
|
13
|
-
export
|
|
14
|
-
export
|
|
15
|
-
export
|
|
16
|
-
export
|
|
17
|
-
export
|
|
18
|
-
export
|
|
19
|
-
export
|
|
20
|
-
export
|
|
21
|
-
export
|
|
22
|
-
export
|
|
23
|
-
export
|
|
24
|
-
export
|
|
25
|
-
export
|
|
26
|
-
export
|
|
27
|
-
export
|
|
28
|
-
export
|
|
29
|
-
export
|
|
30
|
-
export
|
|
31
|
-
export
|
|
32
|
-
export
|
|
33
|
-
export
|
|
34
|
-
export
|
|
35
|
-
export
|
|
36
|
-
export
|
|
37
|
-
export
|
|
38
|
-
export
|
|
39
|
-
export
|
|
40
|
-
export
|
|
41
|
-
export
|
|
42
|
-
export
|
|
43
|
-
export
|
|
44
|
-
export
|
|
45
|
-
export
|
|
46
|
-
export
|
|
47
|
-
export
|
|
48
|
-
export
|
|
49
|
-
export
|
|
50
|
-
export
|
|
51
|
-
export
|
|
52
|
-
export
|
|
13
|
+
export * from './inputRules/nodeInputRule';
|
|
14
|
+
export * from './inputRules/markInputRule';
|
|
15
|
+
export * from './inputRules/textblockTypeInputRule';
|
|
16
|
+
export * from './inputRules/textInputRule';
|
|
17
|
+
export * from './inputRules/wrappingInputRule';
|
|
18
|
+
export * from './pasteRules/markPasteRule';
|
|
19
|
+
export * from './pasteRules/textPasteRule';
|
|
20
|
+
export * from './utilities/callOrReturn';
|
|
21
|
+
export * from './utilities/mergeAttributes';
|
|
22
|
+
export * from './helpers/combineTransactionSteps';
|
|
23
|
+
export * from './helpers/defaultBlockAt';
|
|
24
|
+
export * from './helpers/getExtensionField';
|
|
25
|
+
export * from './helpers/findChildren';
|
|
26
|
+
export * from './helpers/findChildrenInRange';
|
|
27
|
+
export * from './helpers/findParentNode';
|
|
28
|
+
export * from './helpers/findParentNodeClosestToPos';
|
|
29
|
+
export * from './helpers/generateHTML';
|
|
30
|
+
export * from './helpers/generateJSON';
|
|
31
|
+
export * from './helpers/generateText';
|
|
32
|
+
export * from './helpers/getChangedRanges';
|
|
33
|
+
export * from './helpers/getSchema';
|
|
34
|
+
export * from './helpers/getHTMLFromFragment';
|
|
35
|
+
export * from './helpers/getDebugJSON';
|
|
36
|
+
export * from './helpers/getAttributes';
|
|
37
|
+
export * from './helpers/getMarkAttributes';
|
|
38
|
+
export * from './helpers/getMarkRange';
|
|
39
|
+
export * from './helpers/getMarkType';
|
|
40
|
+
export * from './helpers/getMarksBetween';
|
|
41
|
+
export * from './helpers/getNodeAttributes';
|
|
42
|
+
export * from './helpers/getNodeType';
|
|
43
|
+
export * from './helpers/getText';
|
|
44
|
+
export * from './helpers/getTextBetween';
|
|
45
|
+
export * from './helpers/isActive';
|
|
46
|
+
export * from './helpers/isList';
|
|
47
|
+
export * from './helpers/isMarkActive';
|
|
48
|
+
export * from './helpers/isNodeActive';
|
|
49
|
+
export * from './helpers/isNodeEmpty';
|
|
50
|
+
export * from './helpers/isNodeSelection';
|
|
51
|
+
export * from './helpers/isTextSelection';
|
|
52
|
+
export * from './helpers/posToDOMRect';
|
|
53
53
|
export interface Commands<ReturnType = any> {
|
|
54
54
|
}
|
|
55
55
|
export interface ExtensionConfig<Options = any, Storage = any> {
|
|
@@ -5,7 +5,7 @@ import { ExtendedRegExpMatchArray } from '../types';
|
|
|
5
5
|
* Build an input rule that adds a mark when the
|
|
6
6
|
* matched text is typed into it.
|
|
7
7
|
*/
|
|
8
|
-
export
|
|
8
|
+
export declare function markInputRule(config: {
|
|
9
9
|
find: InputRuleFinder;
|
|
10
10
|
type: MarkType;
|
|
11
11
|
getAttributes?: Record<string, any> | ((match: ExtendedRegExpMatchArray) => Record<string, any>) | false | null;
|
|
@@ -5,7 +5,7 @@ import { ExtendedRegExpMatchArray } from '../types';
|
|
|
5
5
|
* Build an input rule that adds a node when the
|
|
6
6
|
* matched text is typed into it.
|
|
7
7
|
*/
|
|
8
|
-
export
|
|
8
|
+
export declare function nodeInputRule(config: {
|
|
9
9
|
find: InputRuleFinder;
|
|
10
10
|
type: NodeType;
|
|
11
11
|
getAttributes?: Record<string, any> | ((match: ExtendedRegExpMatchArray) => Record<string, any>) | false | null;
|
|
@@ -3,7 +3,7 @@ import { InputRule, InputRuleFinder } from '../InputRule';
|
|
|
3
3
|
* Build an input rule that replaces text when the
|
|
4
4
|
* matched text is typed into it.
|
|
5
5
|
*/
|
|
6
|
-
export
|
|
6
|
+
export declare function textInputRule(config: {
|
|
7
7
|
find: InputRuleFinder;
|
|
8
8
|
replace: string;
|
|
9
9
|
}): InputRule;
|
|
@@ -7,7 +7,7 @@ import { ExtendedRegExpMatchArray } from '../types';
|
|
|
7
7
|
* probably want the regexp to start with `^`, so that the pattern can
|
|
8
8
|
* only occur at the start of a textblock.
|
|
9
9
|
*/
|
|
10
|
-
export
|
|
10
|
+
export declare function textblockTypeInputRule(config: {
|
|
11
11
|
find: InputRuleFinder;
|
|
12
12
|
type: NodeType;
|
|
13
13
|
getAttributes?: Record<string, any> | ((match: ExtendedRegExpMatchArray) => Record<string, any>) | false | null;
|
|
@@ -15,7 +15,7 @@ import { ExtendedRegExpMatchArray } from '../types';
|
|
|
15
15
|
* expression match and the node before the wrapped node, and can
|
|
16
16
|
* return a boolean to indicate whether a join should happen.
|
|
17
17
|
*/
|
|
18
|
-
export
|
|
18
|
+
export declare function wrappingInputRule(config: {
|
|
19
19
|
find: InputRuleFinder;
|
|
20
20
|
type: NodeType;
|
|
21
21
|
getAttributes?: Record<string, any> | ((match: ExtendedRegExpMatchArray) => Record<string, any>) | false | null;
|
|
@@ -5,7 +5,7 @@ import { ExtendedRegExpMatchArray } from '../types';
|
|
|
5
5
|
* Build an paste rule that adds a mark when the
|
|
6
6
|
* matched text is pasted into it.
|
|
7
7
|
*/
|
|
8
|
-
export
|
|
8
|
+
export declare function markPasteRule(config: {
|
|
9
9
|
find: PasteRuleFinder;
|
|
10
10
|
type: MarkType;
|
|
11
11
|
getAttributes?: Record<string, any> | ((match: ExtendedRegExpMatchArray) => Record<string, any>) | false | null;
|
|
@@ -3,7 +3,7 @@ import { PasteRule, PasteRuleFinder } from '../PasteRule';
|
|
|
3
3
|
* Build an paste rule that replaces text when the
|
|
4
4
|
* matched text is pasted into it.
|
|
5
5
|
*/
|
|
6
|
-
export
|
|
6
|
+
export declare function textPasteRule(config: {
|
|
7
7
|
find: PasteRuleFinder;
|
|
8
8
|
replace: string;
|
|
9
9
|
}): PasteRule;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
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}";
|
|
2
|
-
export default style;
|
|
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}";
|
|
@@ -6,4 +6,4 @@ import { MaybeReturnType } from '../types';
|
|
|
6
6
|
* @param context Optional context to bind to function.
|
|
7
7
|
* @param props Optional props to pass to function.
|
|
8
8
|
*/
|
|
9
|
-
export
|
|
9
|
+
export declare function callOrReturn<T>(value: T, context?: any, ...props: any[]): MaybeReturnType<T>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export declare function createStyleTag(style: string): HTMLStyleElement;
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* @param obj Object
|
|
4
4
|
* @param key Key to remove
|
|
5
5
|
*/
|
|
6
|
-
export
|
|
6
|
+
export declare function deleteProps(obj: Record<string, any>, propOrProps: string | string[]): Record<string, any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export declare function elementFromString(value: string): HTMLElement;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export declare function findDuplicates(items: any[]): any[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export declare function fromString(value: any): any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export declare function isClass(value: any): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export declare function isEmptyObject(value?: {}): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export declare function isFunction(value: any): value is Function;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export declare function isNumber(value: any): value is number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export declare function isObject(value: any): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export declare function isPlainObject(value: any): value is Record<string, any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export declare function isRegExp(value: any): value is RegExp;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export declare function isString(value: any): value is string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export declare function isiOS(): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export declare function mergeAttributes(...objects: Record<string, any>[]): Record<string, any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export declare function mergeDeep(target: Record<string, any>, source: Record<string, any>): Record<string, any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export declare function minMax(value?: number, min?: number, max?: number): number;
|
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
* @param object1 Object
|
|
4
4
|
* @param object2 Object
|
|
5
5
|
*/
|
|
6
|
-
export
|
|
6
|
+
export declare function objectIncludes(object1: Record<string, any>, object2: Record<string, any>, options?: {
|
|
7
7
|
strict: boolean;
|
|
8
8
|
}): boolean;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Removes duplicated values within an array.
|
|
3
3
|
* Supports numbers, strings and objects.
|
|
4
4
|
*/
|
|
5
|
-
export
|
|
5
|
+
export declare function removeDuplicates<T>(array: T[], by?: {
|
|
6
6
|
(value: any, replacer?: ((this: any, key: string, value: any) => any) | undefined, space?: string | number | undefined): string;
|
|
7
7
|
(value: any, replacer?: (string | number)[] | null | undefined, space?: string | number | undefined): string;
|
|
8
8
|
}): T[];
|
|
@@ -1,7 +1,28 @@
|
|
|
1
1
|
import { Extension } from '@tiptap/core';
|
|
2
|
-
import {
|
|
3
|
-
export declare const pluginKey: PluginKey<any, any>;
|
|
2
|
+
import { Node as ProseMirrorNode } from 'prosemirror-model';
|
|
4
3
|
export interface CharacterCountOptions {
|
|
5
|
-
|
|
4
|
+
/**
|
|
5
|
+
* The maximum number of characters that should be allowed. Defaults to `0`.
|
|
6
|
+
*/
|
|
7
|
+
limit: number | null | undefined;
|
|
8
|
+
/**
|
|
9
|
+
* The mode by which the size is calculated. Defaults to 'textSize'.
|
|
10
|
+
*/
|
|
11
|
+
mode: 'textSize' | 'nodeSize';
|
|
6
12
|
}
|
|
7
|
-
export
|
|
13
|
+
export interface CharacterCountStorage {
|
|
14
|
+
/**
|
|
15
|
+
* Get the number of characters for the current document.
|
|
16
|
+
*/
|
|
17
|
+
characters: (options?: {
|
|
18
|
+
node?: ProseMirrorNode;
|
|
19
|
+
mode?: 'textSize' | 'nodeSize';
|
|
20
|
+
}) => number;
|
|
21
|
+
/**
|
|
22
|
+
* Get the number of words for the current document.
|
|
23
|
+
*/
|
|
24
|
+
words: (options?: {
|
|
25
|
+
node?: ProseMirrorNode;
|
|
26
|
+
}) => number;
|
|
27
|
+
}
|
|
28
|
+
export declare const CharacterCount: Extension<CharacterCountOptions, CharacterCountStorage>;
|
|
@@ -3,5 +3,5 @@ import { MarkType } from 'prosemirror-model';
|
|
|
3
3
|
declare type ClickHandlerOptions = {
|
|
4
4
|
type: MarkType;
|
|
5
5
|
};
|
|
6
|
-
export
|
|
6
|
+
export declare function clickHandler(options: ClickHandlerOptions): Plugin;
|
|
7
7
|
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { Extensions, JSONContent } from '@tiptap/core';
|
|
2
|
-
export
|
|
2
|
+
export declare function generateHTML(doc: JSONContent, extensions: Extensions): string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { Extensions } from '@tiptap/core';
|
|
2
|
-
export
|
|
2
|
+
export declare function generateJSON(html: string, extensions: Extensions): Record<string, any>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { Node, Schema } from 'prosemirror-model';
|
|
2
|
-
export
|
|
2
|
+
export declare function getHTMLFromFragment(doc: Node, schema: Schema): string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
1
|
+
export * from './generateHTML';
|
|
2
|
+
export * from './generateJSON';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tiptap/react",
|
|
3
3
|
"description": "React components for tiptap",
|
|
4
|
-
"version": "2.0.0-beta.
|
|
4
|
+
"version": "2.0.0-beta.99",
|
|
5
5
|
"homepage": "https://tiptap.dev",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"tiptap",
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
"react-dom": "^17.0.0"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@tiptap/extension-bubble-menu": "^2.0.0-beta.
|
|
36
|
-
"@tiptap/extension-floating-menu": "^2.0.0-beta.
|
|
35
|
+
"@tiptap/extension-bubble-menu": "^2.0.0-beta.52",
|
|
36
|
+
"@tiptap/extension-floating-menu": "^2.0.0-beta.47",
|
|
37
37
|
"prosemirror-view": "^1.23.3"
|
|
38
38
|
},
|
|
39
39
|
"repository": {
|
|
@@ -41,5 +41,5 @@
|
|
|
41
41
|
"url": "https://github.com/ueberdosis/tiptap",
|
|
42
42
|
"directory": "packages/react"
|
|
43
43
|
},
|
|
44
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "56cbf99f9f636930f77840d6e69dd1d8d2063e37"
|
|
45
45
|
}
|