@tiptap/core 2.0.0-beta.213 → 2.0.0-beta.215
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/index.cjs +3931 -3960
- package/dist/index.cjs.map +1 -0
- package/dist/index.js +3857 -3962
- package/dist/index.js.map +1 -0
- package/dist/index.umd.js +4280 -0
- package/dist/index.umd.js.map +1 -0
- package/dist/packages/core/src/CommandManager.d.ts +20 -0
- package/dist/packages/core/src/Editor.d.ts +147 -0
- package/dist/packages/core/src/EventEmitter.d.ts +11 -0
- package/dist/packages/core/src/Extension.d.ts +227 -0
- package/dist/packages/core/src/ExtensionManager.d.ts +18 -0
- package/dist/packages/core/src/InputRule.d.ts +42 -0
- package/dist/packages/core/src/Mark.d.ts +327 -0
- package/dist/packages/core/src/Node.d.ts +397 -0
- package/dist/packages/core/src/NodeView.d.ts +27 -0
- package/dist/packages/core/src/PasteRule.d.ts +42 -0
- package/dist/packages/core/src/Tracker.d.ts +11 -0
- package/dist/packages/core/src/commands/blur.d.ts +12 -0
- package/dist/packages/core/src/commands/clearContent.d.ts +12 -0
- package/dist/packages/core/src/commands/clearNodes.d.ts +12 -0
- package/dist/packages/core/src/commands/command.d.ts +12 -0
- package/dist/packages/core/src/commands/createParagraphNear.d.ts +12 -0
- package/dist/packages/core/src/commands/deleteCurrentNode.d.ts +12 -0
- package/dist/packages/core/src/commands/deleteNode.d.ts +13 -0
- package/dist/packages/core/src/commands/deleteRange.d.ts +12 -0
- package/dist/packages/core/src/commands/deleteSelection.d.ts +12 -0
- package/dist/packages/core/src/commands/enter.d.ts +12 -0
- package/dist/packages/core/src/commands/exitCode.d.ts +12 -0
- package/dist/packages/core/src/commands/extendMarkRange.d.ts +13 -0
- package/dist/packages/core/src/commands/first.d.ts +12 -0
- package/dist/packages/core/src/commands/focus.d.ts +14 -0
- package/dist/packages/core/src/commands/forEach.d.ts +14 -0
- package/dist/packages/core/src/commands/index.d.ts +50 -0
- package/dist/packages/core/src/commands/insertContent.d.ts +16 -0
- package/dist/packages/core/src/commands/insertContentAt.d.ts +16 -0
- package/dist/packages/core/src/commands/join.d.ts +33 -0
- package/dist/packages/core/src/commands/keyboardShortcut.d.ts +12 -0
- package/dist/packages/core/src/commands/lift.d.ts +13 -0
- package/dist/packages/core/src/commands/liftEmptyBlock.d.ts +12 -0
- package/dist/packages/core/src/commands/liftListItem.d.ts +13 -0
- package/dist/packages/core/src/commands/newlineInCode.d.ts +12 -0
- package/dist/packages/core/src/commands/resetAttributes.d.ts +13 -0
- package/dist/packages/core/src/commands/scrollIntoView.d.ts +12 -0
- package/dist/packages/core/src/commands/selectAll.d.ts +12 -0
- package/dist/packages/core/src/commands/selectNodeBackward.d.ts +12 -0
- package/dist/packages/core/src/commands/selectNodeForward.d.ts +12 -0
- package/dist/packages/core/src/commands/selectParentNode.d.ts +12 -0
- package/dist/packages/core/src/commands/selectTextblockEnd.d.ts +12 -0
- package/dist/packages/core/src/commands/selectTextblockStart.d.ts +12 -0
- package/dist/packages/core/src/commands/setContent.d.ts +13 -0
- package/dist/packages/core/src/commands/setMark.d.ts +13 -0
- package/dist/packages/core/src/commands/setMeta.d.ts +12 -0
- package/dist/packages/core/src/commands/setNode.d.ts +13 -0
- package/dist/packages/core/src/commands/setNodeSelection.d.ts +12 -0
- package/dist/packages/core/src/commands/setTextSelection.d.ts +12 -0
- package/dist/packages/core/src/commands/sinkListItem.d.ts +13 -0
- package/dist/packages/core/src/commands/splitBlock.d.ts +14 -0
- package/dist/packages/core/src/commands/splitListItem.d.ts +13 -0
- package/dist/packages/core/src/commands/toggleList.d.ts +13 -0
- package/dist/packages/core/src/commands/toggleMark.d.ts +18 -0
- package/dist/packages/core/src/commands/toggleNode.d.ts +13 -0
- package/dist/packages/core/src/commands/toggleWrap.d.ts +13 -0
- package/dist/packages/core/src/commands/undoInputRule.d.ts +12 -0
- package/dist/packages/core/src/commands/unsetAllMarks.d.ts +12 -0
- package/dist/packages/core/src/commands/unsetMark.d.ts +18 -0
- package/dist/packages/core/src/commands/updateAttributes.d.ts +13 -0
- package/dist/packages/core/src/commands/wrapIn.d.ts +13 -0
- package/dist/packages/core/src/commands/wrapInList.d.ts +13 -0
- package/dist/packages/core/src/extensions/clipboardTextSerializer.d.ts +2 -0
- package/dist/packages/core/src/extensions/commands.d.ts +3 -0
- package/dist/packages/core/src/extensions/editable.d.ts +2 -0
- package/dist/packages/core/src/extensions/focusEvents.d.ts +2 -0
- package/dist/packages/core/src/extensions/index.d.ts +6 -0
- package/dist/packages/core/src/extensions/keymap.d.ts +2 -0
- package/dist/packages/core/src/extensions/tabindex.d.ts +2 -0
- package/dist/packages/core/src/helpers/combineTransactionSteps.d.ts +7 -0
- package/dist/packages/core/src/helpers/createChainableState.d.ts +5 -0
- package/dist/packages/core/src/helpers/createDocument.d.ts +3 -0
- package/dist/packages/core/src/helpers/createNodeFromContent.d.ts +7 -0
- package/dist/packages/core/src/helpers/defaultBlockAt.d.ts +2 -0
- package/dist/packages/core/src/helpers/findChildren.d.ts +3 -0
- package/dist/packages/core/src/helpers/findChildrenInRange.d.ts +6 -0
- package/dist/packages/core/src/helpers/findParentNode.d.ts +8 -0
- package/dist/packages/core/src/helpers/findParentNodeClosestToPos.d.ts +8 -0
- package/dist/packages/core/src/helpers/generateHTML.d.ts +2 -0
- package/dist/packages/core/src/helpers/generateJSON.d.ts +2 -0
- package/dist/packages/core/src/helpers/generateText.d.ts +5 -0
- package/dist/packages/core/src/helpers/getAttributes.d.ts +3 -0
- package/dist/packages/core/src/helpers/getAttributesFromExtensions.d.ts +6 -0
- package/dist/packages/core/src/helpers/getChangedRanges.d.ts +11 -0
- package/dist/packages/core/src/helpers/getDebugJSON.d.ts +8 -0
- package/dist/packages/core/src/helpers/getExtensionField.d.ts +2 -0
- package/dist/packages/core/src/helpers/getHTMLFromFragment.d.ts +2 -0
- package/dist/packages/core/src/helpers/getMarkAttributes.d.ts +3 -0
- package/dist/packages/core/src/helpers/getMarkRange.d.ts +3 -0
- package/dist/packages/core/src/helpers/getMarkType.d.ts +2 -0
- package/dist/packages/core/src/helpers/getMarksBetween.d.ts +3 -0
- package/dist/packages/core/src/helpers/getNodeAttributes.d.ts +3 -0
- package/dist/packages/core/src/helpers/getNodeType.d.ts +2 -0
- package/dist/packages/core/src/helpers/getRenderedAttributes.d.ts +3 -0
- package/dist/packages/core/src/helpers/getSchema.d.ts +3 -0
- package/dist/packages/core/src/helpers/getSchemaByResolvedExtensions.d.ts +3 -0
- package/dist/packages/core/src/helpers/getSchemaTypeByName.d.ts +2 -0
- package/dist/packages/core/src/helpers/getSchemaTypeNameByName.d.ts +2 -0
- package/dist/packages/core/src/helpers/getSplittedAttributes.d.ts +2 -0
- package/dist/packages/core/src/helpers/getText.d.ts +6 -0
- package/dist/packages/core/src/helpers/getTextBetween.d.ts +6 -0
- package/dist/packages/core/src/helpers/getTextContentFromNodes.d.ts +2 -0
- package/dist/packages/core/src/helpers/getTextSerializersFromSchema.d.ts +3 -0
- package/dist/packages/core/src/helpers/index.d.ts +33 -0
- package/dist/packages/core/src/helpers/injectExtensionAttributesToParseRule.d.ts +9 -0
- package/dist/packages/core/src/helpers/isActive.d.ts +2 -0
- package/dist/packages/core/src/helpers/isExtensionRulesEnabled.d.ts +2 -0
- package/dist/packages/core/src/helpers/isList.d.ts +2 -0
- package/dist/packages/core/src/helpers/isMarkActive.d.ts +3 -0
- package/dist/packages/core/src/helpers/isNodeActive.d.ts +3 -0
- package/dist/packages/core/src/helpers/isNodeEmpty.d.ts +2 -0
- package/dist/packages/core/src/helpers/isNodeSelection.d.ts +2 -0
- package/dist/packages/core/src/helpers/isTextSelection.d.ts +2 -0
- package/dist/packages/core/src/helpers/posToDOMRect.d.ts +2 -0
- package/dist/packages/core/src/helpers/resolveFocusPosition.d.ts +4 -0
- package/dist/packages/core/src/helpers/selectionToInsertionEnd.d.ts +2 -0
- package/dist/packages/core/src/helpers/splitExtensions.d.ts +9 -0
- package/dist/packages/core/src/index.d.ts +23 -0
- package/dist/packages/core/src/inputRules/index.d.ts +5 -0
- package/dist/packages/core/src/inputRules/markInputRule.d.ts +12 -0
- package/dist/packages/core/src/inputRules/nodeInputRule.d.ts +12 -0
- package/dist/packages/core/src/inputRules/textInputRule.d.ts +9 -0
- package/dist/packages/core/src/inputRules/textblockTypeInputRule.d.ts +14 -0
- package/dist/packages/core/src/inputRules/wrappingInputRule.d.ts +23 -0
- package/dist/packages/core/src/pasteRules/index.d.ts +3 -0
- package/dist/packages/core/src/pasteRules/markPasteRule.d.ts +12 -0
- package/dist/packages/core/src/pasteRules/nodePasteRule.d.ts +12 -0
- package/dist/packages/core/src/pasteRules/textPasteRule.d.ts +9 -0
- package/dist/packages/core/src/style.d.ts +1 -0
- package/dist/packages/core/src/types.d.ts +214 -0
- package/dist/packages/core/src/utilities/callOrReturn.d.ts +9 -0
- package/dist/packages/core/src/utilities/createStyleTag.d.ts +1 -0
- package/dist/packages/core/src/utilities/deleteProps.d.ts +6 -0
- package/dist/packages/core/src/utilities/elementFromString.d.ts +1 -0
- package/dist/packages/core/src/utilities/escapeForRegEx.d.ts +1 -0
- package/dist/packages/core/src/utilities/findDuplicates.d.ts +1 -0
- package/dist/packages/core/src/utilities/fromString.d.ts +1 -0
- package/dist/packages/core/src/utilities/index.d.ts +20 -0
- package/dist/packages/core/src/utilities/isEmptyObject.d.ts +1 -0
- package/dist/packages/core/src/utilities/isFunction.d.ts +1 -0
- package/dist/packages/core/src/utilities/isMacOS.d.ts +1 -0
- package/dist/packages/core/src/utilities/isNumber.d.ts +1 -0
- package/dist/packages/core/src/utilities/isPlainObject.d.ts +1 -0
- package/dist/packages/core/src/utilities/isRegExp.d.ts +1 -0
- package/dist/packages/core/src/utilities/isString.d.ts +1 -0
- package/dist/packages/core/src/utilities/isiOS.d.ts +1 -0
- package/dist/packages/core/src/utilities/mergeAttributes.d.ts +1 -0
- package/dist/packages/core/src/utilities/mergeDeep.d.ts +1 -0
- package/dist/packages/core/src/utilities/minMax.d.ts +1 -0
- package/dist/packages/core/src/utilities/objectIncludes.d.ts +8 -0
- package/dist/packages/core/src/utilities/removeDuplicates.d.ts +8 -0
- package/package.json +7 -16
- package/dist/index.d.ts +0 -2330
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
import { Mark as ProseMirrorMark, Node as ProseMirrorNode, ParseOptions } from '@tiptap/pm/model';
|
|
2
|
+
import { EditorState, Transaction } from '@tiptap/pm/state';
|
|
3
|
+
import { Decoration, EditorProps, EditorView, NodeView } from '@tiptap/pm/view';
|
|
4
|
+
import { Commands, ExtensionConfig, MarkConfig, NodeConfig } from '.';
|
|
5
|
+
import { Editor } from './Editor';
|
|
6
|
+
import { Extension } from './Extension';
|
|
7
|
+
import { Mark } from './Mark';
|
|
8
|
+
import { Node } from './Node';
|
|
9
|
+
export declare type AnyConfig = ExtensionConfig | NodeConfig | MarkConfig;
|
|
10
|
+
export declare type AnyExtension = Extension | Node | Mark;
|
|
11
|
+
export declare type Extensions = AnyExtension[];
|
|
12
|
+
export declare type ParentConfig<T> = Partial<{
|
|
13
|
+
[P in keyof T]: Required<T>[P] extends (...args: any) => any ? (...args: Parameters<Required<T>[P]>) => ReturnType<Required<T>[P]> : T[P];
|
|
14
|
+
}>;
|
|
15
|
+
export declare type Primitive = null | undefined | string | number | boolean | symbol | bigint;
|
|
16
|
+
export declare type RemoveThis<T> = T extends (...args: any) => any ? (...args: Parameters<T>) => ReturnType<T> : T;
|
|
17
|
+
export declare type MaybeReturnType<T> = T extends (...args: any) => any ? ReturnType<T> : T;
|
|
18
|
+
export declare type MaybeThisParameterType<T> = Exclude<T, Primitive> extends (...args: any) => any ? ThisParameterType<Exclude<T, Primitive>> : any;
|
|
19
|
+
export interface EditorEvents {
|
|
20
|
+
beforeCreate: {
|
|
21
|
+
editor: Editor;
|
|
22
|
+
};
|
|
23
|
+
create: {
|
|
24
|
+
editor: Editor;
|
|
25
|
+
};
|
|
26
|
+
update: {
|
|
27
|
+
editor: Editor;
|
|
28
|
+
transaction: Transaction;
|
|
29
|
+
};
|
|
30
|
+
selectionUpdate: {
|
|
31
|
+
editor: Editor;
|
|
32
|
+
transaction: Transaction;
|
|
33
|
+
};
|
|
34
|
+
transaction: {
|
|
35
|
+
editor: Editor;
|
|
36
|
+
transaction: Transaction;
|
|
37
|
+
};
|
|
38
|
+
focus: {
|
|
39
|
+
editor: Editor;
|
|
40
|
+
event: FocusEvent;
|
|
41
|
+
transaction: Transaction;
|
|
42
|
+
};
|
|
43
|
+
blur: {
|
|
44
|
+
editor: Editor;
|
|
45
|
+
event: FocusEvent;
|
|
46
|
+
transaction: Transaction;
|
|
47
|
+
};
|
|
48
|
+
destroy: void;
|
|
49
|
+
}
|
|
50
|
+
export declare type EnableRules = (AnyExtension | string)[] | boolean;
|
|
51
|
+
export interface EditorOptions {
|
|
52
|
+
element: Element;
|
|
53
|
+
content: Content;
|
|
54
|
+
extensions: Extensions;
|
|
55
|
+
injectCSS: boolean;
|
|
56
|
+
injectNonce: string | undefined;
|
|
57
|
+
autofocus: FocusPosition;
|
|
58
|
+
editable: boolean;
|
|
59
|
+
editorProps: EditorProps;
|
|
60
|
+
parseOptions: ParseOptions;
|
|
61
|
+
enableInputRules: EnableRules;
|
|
62
|
+
enablePasteRules: EnableRules;
|
|
63
|
+
enableCoreExtensions: boolean;
|
|
64
|
+
onBeforeCreate: (props: EditorEvents['beforeCreate']) => void;
|
|
65
|
+
onCreate: (props: EditorEvents['create']) => void;
|
|
66
|
+
onUpdate: (props: EditorEvents['update']) => void;
|
|
67
|
+
onSelectionUpdate: (props: EditorEvents['selectionUpdate']) => void;
|
|
68
|
+
onTransaction: (props: EditorEvents['transaction']) => void;
|
|
69
|
+
onFocus: (props: EditorEvents['focus']) => void;
|
|
70
|
+
onBlur: (props: EditorEvents['blur']) => void;
|
|
71
|
+
onDestroy: (props: EditorEvents['destroy']) => void;
|
|
72
|
+
}
|
|
73
|
+
export declare type HTMLContent = string;
|
|
74
|
+
export declare type JSONContent = {
|
|
75
|
+
type?: string;
|
|
76
|
+
attrs?: Record<string, any>;
|
|
77
|
+
content?: JSONContent[];
|
|
78
|
+
marks?: {
|
|
79
|
+
type: string;
|
|
80
|
+
attrs?: Record<string, any>;
|
|
81
|
+
[key: string]: any;
|
|
82
|
+
}[];
|
|
83
|
+
text?: string;
|
|
84
|
+
[key: string]: any;
|
|
85
|
+
};
|
|
86
|
+
export declare type Content = HTMLContent | JSONContent | JSONContent[] | null;
|
|
87
|
+
export declare type CommandProps = {
|
|
88
|
+
editor: Editor;
|
|
89
|
+
tr: Transaction;
|
|
90
|
+
commands: SingleCommands;
|
|
91
|
+
can: () => CanCommands;
|
|
92
|
+
chain: () => ChainedCommands;
|
|
93
|
+
state: EditorState;
|
|
94
|
+
view: EditorView;
|
|
95
|
+
dispatch: ((args?: any) => any) | undefined;
|
|
96
|
+
};
|
|
97
|
+
export declare type Command = (props: CommandProps) => boolean;
|
|
98
|
+
export declare type CommandSpec = (...args: any[]) => Command;
|
|
99
|
+
export declare type KeyboardShortcutCommand = (props: {
|
|
100
|
+
editor: Editor;
|
|
101
|
+
}) => boolean;
|
|
102
|
+
export declare type Attribute = {
|
|
103
|
+
default: any;
|
|
104
|
+
rendered?: boolean;
|
|
105
|
+
renderHTML?: ((attributes: Record<string, any>) => Record<string, any> | null) | null;
|
|
106
|
+
parseHTML?: ((element: HTMLElement) => any | null) | null;
|
|
107
|
+
keepOnSplit: boolean;
|
|
108
|
+
isRequired?: boolean;
|
|
109
|
+
};
|
|
110
|
+
export declare type Attributes = {
|
|
111
|
+
[key: string]: Attribute;
|
|
112
|
+
};
|
|
113
|
+
export declare type ExtensionAttribute = {
|
|
114
|
+
type: string;
|
|
115
|
+
name: string;
|
|
116
|
+
attribute: Required<Attribute>;
|
|
117
|
+
};
|
|
118
|
+
export declare type GlobalAttributes = {
|
|
119
|
+
types: string[];
|
|
120
|
+
attributes: {
|
|
121
|
+
[key: string]: Attribute;
|
|
122
|
+
};
|
|
123
|
+
}[];
|
|
124
|
+
export declare type PickValue<T, K extends keyof T> = T[K];
|
|
125
|
+
export declare type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
|
|
126
|
+
export declare type Diff<T extends keyof any, U extends keyof any> = ({
|
|
127
|
+
[P in T]: P;
|
|
128
|
+
} & {
|
|
129
|
+
[P in U]: never;
|
|
130
|
+
} & {
|
|
131
|
+
[x: string]: never;
|
|
132
|
+
})[T];
|
|
133
|
+
export declare type Overwrite<T, U> = Pick<T, Diff<keyof T, keyof U>> & U;
|
|
134
|
+
export declare type ValuesOf<T> = T[keyof T];
|
|
135
|
+
export declare type KeysWithTypeOf<T, Type> = {
|
|
136
|
+
[P in keyof T]: T[P] extends Type ? P : never;
|
|
137
|
+
}[keyof T];
|
|
138
|
+
export declare type NodeViewProps = {
|
|
139
|
+
editor: Editor;
|
|
140
|
+
node: ProseMirrorNode;
|
|
141
|
+
decorations: Decoration[];
|
|
142
|
+
selected: boolean;
|
|
143
|
+
extension: Node;
|
|
144
|
+
getPos: () => number;
|
|
145
|
+
updateAttributes: (attributes: Record<string, any>) => void;
|
|
146
|
+
deleteNode: () => void;
|
|
147
|
+
};
|
|
148
|
+
export interface NodeViewRendererOptions {
|
|
149
|
+
stopEvent: ((props: {
|
|
150
|
+
event: Event;
|
|
151
|
+
}) => boolean) | null;
|
|
152
|
+
ignoreMutation: ((props: {
|
|
153
|
+
mutation: MutationRecord | {
|
|
154
|
+
type: 'selection';
|
|
155
|
+
target: Element;
|
|
156
|
+
};
|
|
157
|
+
}) => boolean) | null;
|
|
158
|
+
}
|
|
159
|
+
export declare type NodeViewRendererProps = {
|
|
160
|
+
editor: Editor;
|
|
161
|
+
node: ProseMirrorNode;
|
|
162
|
+
getPos: (() => number) | boolean;
|
|
163
|
+
HTMLAttributes: Record<string, any>;
|
|
164
|
+
decorations: Decoration[];
|
|
165
|
+
extension: Node;
|
|
166
|
+
};
|
|
167
|
+
export declare type NodeViewRenderer = (props: NodeViewRendererProps) => NodeView | {};
|
|
168
|
+
export declare type AnyCommands = Record<string, (...args: any[]) => Command>;
|
|
169
|
+
export declare type UnionCommands<T = Command> = UnionToIntersection<ValuesOf<Pick<Commands<T>, KeysWithTypeOf<Commands<T>, {}>>>>;
|
|
170
|
+
export declare type RawCommands = {
|
|
171
|
+
[Item in keyof UnionCommands]: UnionCommands<Command>[Item];
|
|
172
|
+
};
|
|
173
|
+
export declare type SingleCommands = {
|
|
174
|
+
[Item in keyof UnionCommands]: UnionCommands<boolean>[Item];
|
|
175
|
+
};
|
|
176
|
+
export declare type ChainedCommands = {
|
|
177
|
+
[Item in keyof UnionCommands]: UnionCommands<ChainedCommands>[Item];
|
|
178
|
+
} & {
|
|
179
|
+
run: () => boolean;
|
|
180
|
+
};
|
|
181
|
+
export declare type CanCommands = SingleCommands & {
|
|
182
|
+
chain: () => ChainedCommands;
|
|
183
|
+
};
|
|
184
|
+
export declare type FocusPosition = 'start' | 'end' | 'all' | number | boolean | null;
|
|
185
|
+
export declare type Range = {
|
|
186
|
+
from: number;
|
|
187
|
+
to: number;
|
|
188
|
+
};
|
|
189
|
+
export declare type NodeRange = {
|
|
190
|
+
node: ProseMirrorNode;
|
|
191
|
+
from: number;
|
|
192
|
+
to: number;
|
|
193
|
+
};
|
|
194
|
+
export declare type MarkRange = {
|
|
195
|
+
mark: ProseMirrorMark;
|
|
196
|
+
from: number;
|
|
197
|
+
to: number;
|
|
198
|
+
};
|
|
199
|
+
export declare type Predicate = (node: ProseMirrorNode) => boolean;
|
|
200
|
+
export declare type NodeWithPos = {
|
|
201
|
+
node: ProseMirrorNode;
|
|
202
|
+
pos: number;
|
|
203
|
+
};
|
|
204
|
+
export declare type TextSerializer = (props: {
|
|
205
|
+
node: ProseMirrorNode;
|
|
206
|
+
pos: number;
|
|
207
|
+
parent: ProseMirrorNode;
|
|
208
|
+
index: number;
|
|
209
|
+
range: Range;
|
|
210
|
+
}) => string;
|
|
211
|
+
export declare type ExtendedRegExpMatchArray = RegExpMatchArray & {
|
|
212
|
+
data?: Record<string, any>;
|
|
213
|
+
};
|
|
214
|
+
export declare type Dispatch = ((args?: any) => any) | undefined;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { MaybeReturnType } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Optionally calls `value` as a function.
|
|
4
|
+
* Otherwise it is returned directly.
|
|
5
|
+
* @param value Function or any value.
|
|
6
|
+
* @param context Optional context to bind to function.
|
|
7
|
+
* @param props Optional props to pass to function.
|
|
8
|
+
*/
|
|
9
|
+
export declare function callOrReturn<T>(value: T, context?: any, ...props: any[]): MaybeReturnType<T>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function createStyleTag(style: string, nonce?: string): HTMLStyleElement;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function elementFromString(value: string): HTMLElement;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function escapeForRegEx(string: string): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function findDuplicates(items: any[]): any[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function fromString(value: any): any;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export * from './callOrReturn';
|
|
2
|
+
export * from './createStyleTag';
|
|
3
|
+
export * from './deleteProps';
|
|
4
|
+
export * from './elementFromString';
|
|
5
|
+
export * from './escapeForRegEx';
|
|
6
|
+
export * from './findDuplicates';
|
|
7
|
+
export * from './fromString';
|
|
8
|
+
export * from './isEmptyObject';
|
|
9
|
+
export * from './isFunction';
|
|
10
|
+
export * from './isiOS';
|
|
11
|
+
export * from './isMacOS';
|
|
12
|
+
export * from './isNumber';
|
|
13
|
+
export * from './isPlainObject';
|
|
14
|
+
export * from './isRegExp';
|
|
15
|
+
export * from './isString';
|
|
16
|
+
export * from './mergeAttributes';
|
|
17
|
+
export * from './mergeDeep';
|
|
18
|
+
export * from './minMax';
|
|
19
|
+
export * from './objectIncludes';
|
|
20
|
+
export * from './removeDuplicates';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function isEmptyObject(value?: {}): boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function isFunction(value: any): value is Function;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function isMacOS(): boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function isNumber(value: any): value is number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function isPlainObject(value: any): value is Record<string, any>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function isRegExp(value: any): value is RegExp;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function isString(value: any): value is string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function isiOS(): boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function mergeAttributes(...objects: Record<string, any>[]): Record<string, any>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function mergeDeep(target: Record<string, any>, source: Record<string, any>): Record<string, any>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function minMax(value?: number, min?: number, max?: number): number;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Removes duplicated values within an array.
|
|
3
|
+
* Supports numbers, strings and objects.
|
|
4
|
+
*/
|
|
5
|
+
export declare function removeDuplicates<T>(array: T[], by?: {
|
|
6
|
+
(value: any, replacer?: ((this: any, key: string, value: any) => any) | undefined, space?: string | number | undefined): string;
|
|
7
|
+
(value: any, replacer?: (string | number)[] | null | undefined, space?: string | number | undefined): string;
|
|
8
|
+
}): T[];
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tiptap/core",
|
|
3
3
|
"description": "headless rich text editor",
|
|
4
|
-
"version": "2.0.0-beta.
|
|
4
|
+
"version": "2.0.0-beta.215",
|
|
5
5
|
"homepage": "https://tiptap.dev",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"tiptap",
|
|
@@ -18,14 +18,15 @@
|
|
|
18
18
|
"type": "module",
|
|
19
19
|
"exports": {
|
|
20
20
|
".": {
|
|
21
|
-
"types": "./dist/index.d.ts",
|
|
21
|
+
"types": "./dist/packages/core/src/index.d.ts",
|
|
22
22
|
"import": "./dist/index.js",
|
|
23
23
|
"require": "./dist/index.cjs"
|
|
24
24
|
}
|
|
25
25
|
},
|
|
26
26
|
"main": "dist/index.cjs",
|
|
27
27
|
"module": "dist/index.js",
|
|
28
|
-
"
|
|
28
|
+
"umd": "dist/index.umd.js",
|
|
29
|
+
"types": "dist/packages/core/src/index.d.ts",
|
|
29
30
|
"files": [
|
|
30
31
|
"src",
|
|
31
32
|
"dist"
|
|
@@ -34,7 +35,7 @@
|
|
|
34
35
|
"@tiptap/pm": "^2.0.0-beta.209"
|
|
35
36
|
},
|
|
36
37
|
"devDependencies": {
|
|
37
|
-
"@tiptap/pm": "^2.0.0-beta.
|
|
38
|
+
"@tiptap/pm": "^2.0.0-beta.215"
|
|
38
39
|
},
|
|
39
40
|
"repository": {
|
|
40
41
|
"type": "git",
|
|
@@ -43,17 +44,7 @@
|
|
|
43
44
|
},
|
|
44
45
|
"sideEffects": false,
|
|
45
46
|
"scripts": {
|
|
46
|
-
"
|
|
47
|
-
|
|
48
|
-
"tsup": {
|
|
49
|
-
"entry": [
|
|
50
|
-
"src/index.ts"
|
|
51
|
-
],
|
|
52
|
-
"dts": true,
|
|
53
|
-
"splitting": true,
|
|
54
|
-
"format": [
|
|
55
|
-
"esm",
|
|
56
|
-
"cjs"
|
|
57
|
-
]
|
|
47
|
+
"clean": "rm -rf dist",
|
|
48
|
+
"build": "npm run clean && rollup -c"
|
|
58
49
|
}
|
|
59
50
|
}
|