@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.
Files changed (91) hide show
  1. package/dist/packages/core/src/CommandManager.d.ts +1 -1
  2. package/dist/packages/core/src/Editor.d.ts +4 -2
  3. package/dist/packages/core/src/EventEmitter.d.ts +1 -1
  4. package/dist/packages/core/src/ExtensionManager.d.ts +1 -1
  5. package/dist/packages/core/src/helpers/combineTransactionSteps.d.ts +1 -1
  6. package/dist/packages/core/src/helpers/createChainableState.d.ts +1 -1
  7. package/dist/packages/core/src/helpers/createDocument.d.ts +1 -1
  8. package/dist/packages/core/src/helpers/createNodeFromContent.d.ts +1 -1
  9. package/dist/packages/core/src/helpers/defaultBlockAt.d.ts +1 -1
  10. package/dist/packages/core/src/helpers/findChildren.d.ts +1 -1
  11. package/dist/packages/core/src/helpers/findChildrenInRange.d.ts +1 -1
  12. package/dist/packages/core/src/helpers/findParentNode.d.ts +1 -1
  13. package/dist/packages/core/src/helpers/findParentNodeClosestToPos.d.ts +1 -1
  14. package/dist/packages/core/src/helpers/generateHTML.d.ts +1 -1
  15. package/dist/packages/core/src/helpers/generateJSON.d.ts +1 -1
  16. package/dist/packages/core/src/helpers/generateText.d.ts +1 -1
  17. package/dist/packages/core/src/helpers/getAttributes.d.ts +1 -1
  18. package/dist/packages/core/src/helpers/getAttributesFromExtensions.d.ts +1 -1
  19. package/dist/packages/core/src/helpers/getChangedRanges.d.ts +1 -1
  20. package/dist/packages/core/src/helpers/getDebugJSON.d.ts +1 -1
  21. package/dist/packages/core/src/helpers/getExtensionField.d.ts +1 -1
  22. package/dist/packages/core/src/helpers/getHTMLFromFragment.d.ts +1 -1
  23. package/dist/packages/core/src/helpers/getMarkAttributes.d.ts +1 -1
  24. package/dist/packages/core/src/helpers/getMarkRange.d.ts +1 -1
  25. package/dist/packages/core/src/helpers/getMarkType.d.ts +1 -1
  26. package/dist/packages/core/src/helpers/getMarksBetween.d.ts +1 -1
  27. package/dist/packages/core/src/helpers/getNodeAttributes.d.ts +1 -1
  28. package/dist/packages/core/src/helpers/getNodeType.d.ts +1 -1
  29. package/dist/packages/core/src/helpers/getRenderedAttributes.d.ts +1 -1
  30. package/dist/packages/core/src/helpers/getSchema.d.ts +1 -1
  31. package/dist/packages/core/src/helpers/getSchemaByResolvedExtensions.d.ts +1 -1
  32. package/dist/packages/core/src/helpers/getSchemaTypeByName.d.ts +1 -1
  33. package/dist/packages/core/src/helpers/getSchemaTypeNameByName.d.ts +1 -1
  34. package/dist/packages/core/src/helpers/getSplittedAttributes.d.ts +1 -1
  35. package/dist/packages/core/src/helpers/getText.d.ts +1 -1
  36. package/dist/packages/core/src/helpers/getTextBetween.d.ts +1 -1
  37. package/dist/packages/core/src/helpers/getTextSeralizersFromSchema.d.ts +1 -1
  38. package/dist/packages/core/src/helpers/injectExtensionAttributesToParseRule.d.ts +1 -1
  39. package/dist/packages/core/src/helpers/isActive.d.ts +1 -1
  40. package/dist/packages/core/src/helpers/isExtensionRulesEnabled.d.ts +1 -1
  41. package/dist/packages/core/src/helpers/isList.d.ts +1 -1
  42. package/dist/packages/core/src/helpers/isMarkActive.d.ts +1 -1
  43. package/dist/packages/core/src/helpers/isNodeActive.d.ts +1 -1
  44. package/dist/packages/core/src/helpers/isNodeEmpty.d.ts +1 -1
  45. package/dist/packages/core/src/helpers/isNodeSelection.d.ts +1 -1
  46. package/dist/packages/core/src/helpers/isTextSelection.d.ts +1 -1
  47. package/dist/packages/core/src/helpers/posToDOMRect.d.ts +1 -1
  48. package/dist/packages/core/src/helpers/resolveFocusPosition.d.ts +4 -0
  49. package/dist/packages/core/src/helpers/selectionToInsertionEnd.d.ts +1 -1
  50. package/dist/packages/core/src/helpers/splitExtensions.d.ts +1 -1
  51. package/dist/packages/core/src/index.d.ts +40 -40
  52. package/dist/packages/core/src/inputRules/markInputRule.d.ts +1 -1
  53. package/dist/packages/core/src/inputRules/nodeInputRule.d.ts +1 -1
  54. package/dist/packages/core/src/inputRules/textInputRule.d.ts +1 -1
  55. package/dist/packages/core/src/inputRules/textblockTypeInputRule.d.ts +1 -1
  56. package/dist/packages/core/src/inputRules/wrappingInputRule.d.ts +1 -1
  57. package/dist/packages/core/src/pasteRules/markPasteRule.d.ts +1 -1
  58. package/dist/packages/core/src/pasteRules/textPasteRule.d.ts +1 -1
  59. package/dist/packages/core/src/style.d.ts +1 -2
  60. package/dist/packages/core/src/utilities/callOrReturn.d.ts +1 -1
  61. package/dist/packages/core/src/utilities/createStyleTag.d.ts +1 -1
  62. package/dist/packages/core/src/utilities/deleteProps.d.ts +1 -1
  63. package/dist/packages/core/src/utilities/elementFromString.d.ts +1 -1
  64. package/dist/packages/core/src/utilities/findDuplicates.d.ts +1 -1
  65. package/dist/packages/core/src/utilities/fromString.d.ts +1 -1
  66. package/dist/packages/core/src/utilities/isClass.d.ts +1 -1
  67. package/dist/packages/core/src/utilities/isEmptyObject.d.ts +1 -1
  68. package/dist/packages/core/src/utilities/isFunction.d.ts +1 -1
  69. package/dist/packages/core/src/utilities/isNumber.d.ts +1 -1
  70. package/dist/packages/core/src/utilities/isObject.d.ts +1 -1
  71. package/dist/packages/core/src/utilities/isPlainObject.d.ts +1 -1
  72. package/dist/packages/core/src/utilities/isRegExp.d.ts +1 -1
  73. package/dist/packages/core/src/utilities/isString.d.ts +1 -1
  74. package/dist/packages/core/src/utilities/isiOS.d.ts +1 -1
  75. package/dist/packages/core/src/utilities/mergeAttributes.d.ts +1 -1
  76. package/dist/packages/core/src/utilities/mergeDeep.d.ts +1 -1
  77. package/dist/packages/core/src/utilities/minMax.d.ts +1 -1
  78. package/dist/packages/core/src/utilities/objectIncludes.d.ts +1 -1
  79. package/dist/packages/core/src/utilities/removeDuplicates.d.ts +1 -1
  80. package/dist/packages/extension-bullet-list/src/bullet-list.d.ts +1 -0
  81. package/dist/packages/extension-character-count/src/character-count.d.ts +25 -4
  82. package/dist/packages/extension-link/src/helpers/autolink.d.ts +1 -1
  83. package/dist/packages/extension-link/src/helpers/clickHandler.d.ts +1 -1
  84. package/dist/packages/extension-link/src/helpers/pasteHandler.d.ts +1 -1
  85. package/dist/packages/extension-ordered-list/src/ordered-list.d.ts +1 -0
  86. package/dist/packages/extension-task-list/src/task-list.d.ts +1 -0
  87. package/dist/packages/html/src/generateHTML.d.ts +1 -1
  88. package/dist/packages/html/src/generateJSON.d.ts +1 -1
  89. package/dist/packages/html/src/getHTMLFromFragment.d.ts +1 -1
  90. package/dist/packages/html/src/index.d.ts +2 -2
  91. 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 default class CommandManager {
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 default class EventEmitter<T extends Record<string, any>> {
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 default class ExtensionManager {
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 default function combineTransactionSteps(oldDoc: ProseMirrorNode, transactions: Transaction[]): Transform;
7
+ export declare function combineTransactionSteps(oldDoc: ProseMirrorNode, transactions: Transaction[]): Transform;
@@ -1,5 +1,5 @@
1
1
  import { EditorState, Transaction } from 'prosemirror-state';
2
- export default function createChainableState(config: {
2
+ export declare function createChainableState(config: {
3
3
  transaction: Transaction;
4
4
  state: EditorState;
5
5
  }): EditorState;
@@ -1,3 +1,3 @@
1
1
  import { Schema, Node as ProseMirrorNode, ParseOptions } from 'prosemirror-model';
2
2
  import { Content } from '../types';
3
- export default function createDocument(content: Content, schema: Schema, parseOptions?: ParseOptions): ProseMirrorNode;
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 default function createNodeFromContent(content: Content, schema: Schema, options?: CreateNodeFromContentOptions): ProseMirrorNode | Fragment;
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 default function defaultBlockAt(match: ContentMatch): NodeType | null;
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 default function findChildren(node: ProseMirrorNode, predicate: Predicate): NodeWithPos[];
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 default function findChildrenInRange(node: ProseMirrorNode, range: Range, predicate: Predicate): NodeWithPos[];
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 default function findParentNode(predicate: Predicate): (selection: Selection) => {
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 default function findParentNodeClosestToPos($pos: ResolvedPos, predicate: Predicate): ({
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 default function generateHTML(doc: JSONContent, extensions: Extensions): string;
2
+ export declare function generateHTML(doc: JSONContent, extensions: Extensions): string;
@@ -1,2 +1,2 @@
1
1
  import { Extensions } from '../types';
2
- export default function generateJSON(html: string, extensions: Extensions): Record<string, any>;
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 default function generateText(doc: JSONContent, extensions: Extensions, options?: {
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 default function getAttributes(state: EditorState, typeOrName: string | NodeType | MarkType): Record<string, any>;
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 default function getAttributesFromExtensions(extensions: Extensions): ExtensionAttribute[];
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 default function getChangedRanges(transform: Transform): ChangedRange[];
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 default function getDebugJSON(node: ProseMirrorNode, startOffset?: number): DebugJSONContent;
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 default function getExtensionField<T = any>(extension: AnyExtension, field: string, context?: Omit<MaybeThisParameterType<T>, 'parent'>): RemoveThis<T>;
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 default function getHTMLFromFragment(fragment: Fragment, schema: Schema): string;
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 default function getMarkAttributes(state: EditorState, typeOrName: string | MarkType): Record<string, any>;
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 default function getMarkRange($pos: ResolvedPos, type: MarkType, attributes?: Record<string, any>): Range | void;
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 default function getMarkType(nameOrType: string | MarkType, schema: Schema): MarkType;
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 default function getMarksBetween(from: number, to: number, doc: ProseMirrorNode): MarkRange[];
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 default function getNodeAttributes(state: EditorState, typeOrName: string | NodeType): Record<string, any>;
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 default function getNodeType(nameOrType: string | NodeType, schema: Schema): NodeType;
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 default function getRenderedAttributes(nodeOrMark: Node | Mark, extensionAttributes: ExtensionAttribute[]): Record<string, any>;
3
+ export declare function getRenderedAttributes(nodeOrMark: Node | Mark, extensionAttributes: ExtensionAttribute[]): Record<string, any>;
@@ -1,3 +1,3 @@
1
1
  import { Schema } from 'prosemirror-model';
2
2
  import { Extensions } from '../types';
3
- export default function getSchema(extensions: Extensions): Schema;
3
+ export declare function getSchema(extensions: Extensions): Schema;
@@ -1,3 +1,3 @@
1
1
  import { Schema } from 'prosemirror-model';
2
2
  import { Extensions } from '../types';
3
- export default function getSchemaByResolvedExtensions(extensions: Extensions): Schema;
3
+ export declare function getSchemaByResolvedExtensions(extensions: Extensions): Schema;
@@ -1,2 +1,2 @@
1
1
  import { MarkType, NodeType, Schema } from 'prosemirror-model';
2
- export default function getSchemaTypeByName(name: string, schema: Schema): NodeType | MarkType | null;
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 default function getSchemaTypeNameByName(name: string, schema: Schema): 'node' | 'mark' | null;
2
+ export declare function getSchemaTypeNameByName(name: string, schema: Schema): 'node' | 'mark' | null;
@@ -1,2 +1,2 @@
1
1
  import { ExtensionAttribute } from '../types';
2
- export default function getSplittedAttributes(extensionAttributes: ExtensionAttribute[], typeName: string, attributes: Record<string, any>): Record<string, any>;
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 default function getText(node: ProseMirrorNode, options?: {
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 default function getTextBetween(startNode: ProseMirrorNode, range: Range, options?: {
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 default function getTextSeralizersFromSchema(schema: Schema): Record<string, TextSerializer>;
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 default function injectExtensionAttributesToParseRule(parseRule: ParseRule, extensionAttributes: ExtensionAttribute[]): ParseRule;
9
+ export declare function injectExtensionAttributesToParseRule(parseRule: ParseRule, extensionAttributes: ExtensionAttribute[]): ParseRule;
@@ -1,2 +1,2 @@
1
1
  import { EditorState } from 'prosemirror-state';
2
- export default function isActive(state: EditorState, name: string | null, attributes?: Record<string, any>): boolean;
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 default function isExtensionRulesEnabled(extension: AnyExtension, enabled: EnableRules): boolean;
2
+ export declare function isExtensionRulesEnabled(extension: AnyExtension, enabled: EnableRules): boolean;
@@ -1,2 +1,2 @@
1
1
  import { Extensions } from '../types';
2
- export default function isList(name: string, extensions: Extensions): boolean;
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 default function isMarkActive(state: EditorState, typeOrName: MarkType | string | null, attributes?: Record<string, any>): boolean;
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 default function isNodeActive(state: EditorState, typeOrName: NodeType | string | null, attributes?: Record<string, any>): boolean;
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 default function isNodeEmpty(node: ProseMirrorNode): boolean;
2
+ export declare function isNodeEmpty(node: ProseMirrorNode): boolean;
@@ -1,2 +1,2 @@
1
1
  import { NodeSelection } from 'prosemirror-state';
2
- export default function isNodeSelection(value: unknown): value is NodeSelection;
2
+ export declare function isNodeSelection(value: unknown): value is NodeSelection;
@@ -1,2 +1,2 @@
1
1
  import { TextSelection } from 'prosemirror-state';
2
- export default function isTextSelection(value: unknown): value is TextSelection;
2
+ export declare function isTextSelection(value: unknown): value is TextSelection;
@@ -1,2 +1,2 @@
1
1
  import { EditorView } from 'prosemirror-view';
2
- export default function posToDOMRect(view: EditorView, from: number, to: number): DOMRect;
2
+ export declare function posToDOMRect(view: EditorView, from: number, to: number): DOMRect;
@@ -0,0 +1,4 @@
1
+ import { Node as ProseMirrorNode } from 'prosemirror-model';
2
+ import { Selection } from 'prosemirror-state';
3
+ import { FocusPosition } from '../types';
4
+ export declare function resolveFocusPosition(doc: ProseMirrorNode, position?: FocusPosition): Selection | null;
@@ -1,2 +1,2 @@
1
1
  import { Transaction } from 'prosemirror-state';
2
- export default function selectionToInsertionEnd(tr: Transaction, startLen: number, bias: number): void;
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 default function splitExtensions(extensions: Extensions): {
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 { default as nodeInputRule } from './inputRules/nodeInputRule';
14
- export { default as markInputRule } from './inputRules/markInputRule';
15
- export { default as textblockTypeInputRule } from './inputRules/textblockTypeInputRule';
16
- export { default as textInputRule } from './inputRules/textInputRule';
17
- export { default as wrappingInputRule } from './inputRules/wrappingInputRule';
18
- export { default as markPasteRule } from './pasteRules/markPasteRule';
19
- export { default as textPasteRule } from './pasteRules/textPasteRule';
20
- export { default as callOrReturn } from './utilities/callOrReturn';
21
- export { default as mergeAttributes } from './utilities/mergeAttributes';
22
- export { default as combineTransactionSteps } from './helpers/combineTransactionSteps';
23
- export { default as defaultBlockAt } from './helpers/defaultBlockAt';
24
- export { default as getExtensionField } from './helpers/getExtensionField';
25
- export { default as findChildren } from './helpers/findChildren';
26
- export { default as findChildrenInRange } from './helpers/findChildrenInRange';
27
- export { default as findParentNode } from './helpers/findParentNode';
28
- export { default as findParentNodeClosestToPos } from './helpers/findParentNodeClosestToPos';
29
- export { default as generateHTML } from './helpers/generateHTML';
30
- export { default as generateJSON } from './helpers/generateJSON';
31
- export { default as generateText } from './helpers/generateText';
32
- export { default as getChangedRanges } from './helpers/getChangedRanges';
33
- export { default as getSchema } from './helpers/getSchema';
34
- export { default as getHTMLFromFragment } from './helpers/getHTMLFromFragment';
35
- export { default as getDebugJSON } from './helpers/getDebugJSON';
36
- export { default as getAttributes } from './helpers/getAttributes';
37
- export { default as getMarkAttributes } from './helpers/getMarkAttributes';
38
- export { default as getMarkRange } from './helpers/getMarkRange';
39
- export { default as getMarkType } from './helpers/getMarkType';
40
- export { default as getMarksBetween } from './helpers/getMarksBetween';
41
- export { default as getNodeAttributes } from './helpers/getNodeAttributes';
42
- export { default as getNodeType } from './helpers/getNodeType';
43
- export { default as getText } from './helpers/getText';
44
- export { default as getTextBetween } from './helpers/getTextBetween';
45
- export { default as isActive } from './helpers/isActive';
46
- export { default as isList } from './helpers/isList';
47
- export { default as isMarkActive } from './helpers/isMarkActive';
48
- export { default as isNodeActive } from './helpers/isNodeActive';
49
- export { default as isNodeEmpty } from './helpers/isNodeEmpty';
50
- export { default as isNodeSelection } from './helpers/isNodeSelection';
51
- export { default as isTextSelection } from './helpers/isTextSelection';
52
- export { default as posToDOMRect } from './helpers/posToDOMRect';
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 default function markInputRule(config: {
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 default function nodeInputRule(config: {
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 default function textInputRule(config: {
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 default function textblockTypeInputRule(config: {
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 default function wrappingInputRule(config: {
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 default function markPasteRule(config: {
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 default function textPasteRule(config: {
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 default function callOrReturn<T>(value: T, context?: any, ...props: any[]): MaybeReturnType<T>;
9
+ export declare function callOrReturn<T>(value: T, context?: any, ...props: any[]): MaybeReturnType<T>;
@@ -1 +1 @@
1
- export default function createStyleTag(style: string): HTMLStyleElement;
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 default function deleteProps(obj: Record<string, any>, propOrProps: string | string[]): Record<string, any>;
6
+ export declare function deleteProps(obj: Record<string, any>, propOrProps: string | string[]): Record<string, any>;
@@ -1 +1 @@
1
- export default function elementFromString(value: string): HTMLElement;
1
+ export declare function elementFromString(value: string): HTMLElement;
@@ -1 +1 @@
1
- export default function findDuplicates(items: any[]): any[];
1
+ export declare function findDuplicates(items: any[]): any[];
@@ -1 +1 @@
1
- export default function fromString(value: any): any;
1
+ export declare function fromString(value: any): any;
@@ -1 +1 @@
1
- export default function isClass(value: any): boolean;
1
+ export declare function isClass(value: any): boolean;
@@ -1 +1 @@
1
- export default function isEmptyObject(value?: {}): boolean;
1
+ export declare function isEmptyObject(value?: {}): boolean;
@@ -1 +1 @@
1
- export default function isObject(value: any): value is Function;
1
+ export declare function isFunction(value: any): value is Function;
@@ -1 +1 @@
1
- export default function isNumber(value: any): value is number;
1
+ export declare function isNumber(value: any): value is number;
@@ -1 +1 @@
1
- export default function isObject(value: any): boolean;
1
+ export declare function isObject(value: any): boolean;
@@ -1 +1 @@
1
- export default function isPlainObject(value: any): value is Record<string, any>;
1
+ export declare function isPlainObject(value: any): value is Record<string, any>;
@@ -1 +1 @@
1
- export default function isRegExp(value: any): value is RegExp;
1
+ export declare function isRegExp(value: any): value is RegExp;
@@ -1 +1 @@
1
- export default function isString(value: any): value is string;
1
+ export declare function isString(value: any): value is string;
@@ -1 +1 @@
1
- export default function isiOS(): boolean;
1
+ export declare function isiOS(): boolean;
@@ -1 +1 @@
1
- export default function mergeAttributes(...objects: Record<string, any>[]): Record<string, any>;
1
+ export declare function mergeAttributes(...objects: Record<string, any>[]): Record<string, any>;
@@ -1 +1 @@
1
- export default function mergeDeep(target: Record<string, any>, source: Record<string, any>): Record<string, any>;
1
+ export declare function mergeDeep(target: Record<string, any>, source: Record<string, any>): Record<string, any>;
@@ -1 +1 @@
1
- export default function minMax(value?: number, min?: number, max?: number): number;
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 default function objectIncludes(object1: Record<string, any>, object2: Record<string, any>, options?: {
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 default function removeDuplicates<T>(array: T[], by?: {
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,5 +1,6 @@
1
1
  import { Node } from '@tiptap/core';
2
2
  export interface BulletListOptions {
3
+ itemTypeName: string;
3
4
  HTMLAttributes: Record<string, any>;
4
5
  }
5
6
  declare module '@tiptap/core' {
@@ -1,7 +1,28 @@
1
1
  import { Extension } from '@tiptap/core';
2
- import { PluginKey } from 'prosemirror-state';
3
- export declare const pluginKey: PluginKey<any, any>;
2
+ import { Node as ProseMirrorNode } from 'prosemirror-model';
4
3
  export interface CharacterCountOptions {
5
- limit?: number;
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 declare const CharacterCount: Extension<CharacterCountOptions, any>;
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 AutolinkOptions = {
4
4
  type: MarkType;
5
5
  };
6
- export default function autolink(options: AutolinkOptions): Plugin;
6
+ export declare function autolink(options: AutolinkOptions): Plugin;
7
7
  export {};
@@ -3,5 +3,5 @@ import { MarkType } from 'prosemirror-model';
3
3
  declare type ClickHandlerOptions = {
4
4
  type: MarkType;
5
5
  };
6
- export default function clickHandler(options: ClickHandlerOptions): Plugin;
6
+ export declare function clickHandler(options: ClickHandlerOptions): Plugin;
7
7
  export {};
@@ -5,5 +5,5 @@ declare type PasteHandlerOptions = {
5
5
  editor: Editor;
6
6
  type: MarkType;
7
7
  };
8
- export default function pasteHandler(options: PasteHandlerOptions): Plugin;
8
+ export declare function pasteHandler(options: PasteHandlerOptions): Plugin;
9
9
  export {};
@@ -1,5 +1,6 @@
1
1
  import { Node } from '@tiptap/core';
2
2
  export interface OrderedListOptions {
3
+ itemTypeName: string;
3
4
  HTMLAttributes: Record<string, any>;
4
5
  }
5
6
  declare module '@tiptap/core' {
@@ -1,5 +1,6 @@
1
1
  import { Node } from '@tiptap/core';
2
2
  export interface TaskListOptions {
3
+ itemTypeName: string;
3
4
  HTMLAttributes: Record<string, any>;
4
5
  }
5
6
  declare module '@tiptap/core' {
@@ -1,2 +1,2 @@
1
1
  import { Extensions, JSONContent } from '@tiptap/core';
2
- export default function generateHTML(doc: JSONContent, extensions: Extensions): string;
2
+ export declare function generateHTML(doc: JSONContent, extensions: Extensions): string;
@@ -1,2 +1,2 @@
1
1
  import { Extensions } from '@tiptap/core';
2
- export default function generateJSON(html: string, extensions: Extensions): Record<string, any>;
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 default function getHTMLFromFragment(doc: Node, schema: Schema): string;
2
+ export declare function getHTMLFromFragment(doc: Node, schema: Schema): string;
@@ -1,2 +1,2 @@
1
- export { default as generateHTML } from './generateHTML';
2
- export { default as generateJSON } from './generateJSON';
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.98",
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.51",
36
- "@tiptap/extension-floating-menu": "^2.0.0-beta.46",
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": "4e1a50250bc5d3ef916326e5bed30c93448284b3"
44
+ "gitHead": "56cbf99f9f636930f77840d6e69dd1d8d2063e37"
45
45
  }