@tiptap/starter-kit 3.0.0 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +21 -0
- package/README.md +5 -1
- package/dist/index.cjs +123 -91
- package/dist/index.cjs.map +1 -1
- package/dist/{packages/starter-kit/src/starter-kit.d.ts → index.d.cts} +32 -10
- package/dist/index.d.ts +136 -0
- package/dist/index.js +98 -88
- package/dist/index.js.map +1 -1
- package/package.json +33 -26
- package/src/starter-kit.ts +107 -55
- package/dist/index.umd.js +0 -81
- package/dist/index.umd.js.map +0 -1
- package/dist/packages/core/src/CommandManager.d.ts +0 -20
- package/dist/packages/core/src/Editor.d.ts +0 -161
- package/dist/packages/core/src/EventEmitter.d.ts +0 -11
- package/dist/packages/core/src/Extension.d.ts +0 -343
- package/dist/packages/core/src/ExtensionManager.d.ts +0 -55
- package/dist/packages/core/src/InputRule.d.ts +0 -42
- package/dist/packages/core/src/Mark.d.ts +0 -451
- package/dist/packages/core/src/Node.d.ts +0 -611
- package/dist/packages/core/src/NodePos.d.ts +0 -44
- package/dist/packages/core/src/NodeView.d.ts +0 -31
- package/dist/packages/core/src/PasteRule.d.ts +0 -50
- package/dist/packages/core/src/Tracker.d.ts +0 -11
- package/dist/packages/core/src/commands/blur.d.ts +0 -13
- package/dist/packages/core/src/commands/clearContent.d.ts +0 -14
- package/dist/packages/core/src/commands/clearNodes.d.ts +0 -13
- package/dist/packages/core/src/commands/command.d.ts +0 -18
- package/dist/packages/core/src/commands/createParagraphNear.d.ts +0 -13
- package/dist/packages/core/src/commands/cut.d.ts +0 -20
- package/dist/packages/core/src/commands/deleteCurrentNode.d.ts +0 -13
- package/dist/packages/core/src/commands/deleteNode.d.ts +0 -15
- package/dist/packages/core/src/commands/deleteRange.d.ts +0 -14
- package/dist/packages/core/src/commands/deleteSelection.d.ts +0 -13
- package/dist/packages/core/src/commands/enter.d.ts +0 -13
- package/dist/packages/core/src/commands/exitCode.d.ts +0 -13
- package/dist/packages/core/src/commands/extendMarkRange.d.ts +0 -25
- package/dist/packages/core/src/commands/first.d.ts +0 -14
- package/dist/packages/core/src/commands/focus.d.ts +0 -27
- package/dist/packages/core/src/commands/forEach.d.ts +0 -14
- package/dist/packages/core/src/commands/index.d.ts +0 -55
- package/dist/packages/core/src/commands/insertContent.d.ts +0 -34
- package/dist/packages/core/src/commands/insertContentAt.d.ts +0 -47
- package/dist/packages/core/src/commands/join.d.ts +0 -41
- package/dist/packages/core/src/commands/joinItemBackward.d.ts +0 -13
- package/dist/packages/core/src/commands/joinItemForward.d.ts +0 -13
- package/dist/packages/core/src/commands/joinTextblockBackward.d.ts +0 -12
- package/dist/packages/core/src/commands/joinTextblockForward.d.ts +0 -12
- package/dist/packages/core/src/commands/keyboardShortcut.d.ts +0 -14
- package/dist/packages/core/src/commands/lift.d.ts +0 -17
- package/dist/packages/core/src/commands/liftEmptyBlock.d.ts +0 -13
- package/dist/packages/core/src/commands/liftListItem.d.ts +0 -15
- package/dist/packages/core/src/commands/newlineInCode.d.ts +0 -13
- package/dist/packages/core/src/commands/resetAttributes.d.ts +0 -16
- package/dist/packages/core/src/commands/scrollIntoView.d.ts +0 -13
- package/dist/packages/core/src/commands/selectAll.d.ts +0 -13
- package/dist/packages/core/src/commands/selectNodeBackward.d.ts +0 -13
- package/dist/packages/core/src/commands/selectNodeForward.d.ts +0 -13
- package/dist/packages/core/src/commands/selectParentNode.d.ts +0 -13
- package/dist/packages/core/src/commands/selectTextblockEnd.d.ts +0 -13
- package/dist/packages/core/src/commands/selectTextblockStart.d.ts +0 -13
- package/dist/packages/core/src/commands/setContent.d.ts +0 -40
- package/dist/packages/core/src/commands/setMark.d.ts +0 -15
- package/dist/packages/core/src/commands/setMeta.d.ts +0 -15
- package/dist/packages/core/src/commands/setNode.d.ts +0 -16
- package/dist/packages/core/src/commands/setNodeSelection.d.ts +0 -14
- package/dist/packages/core/src/commands/setTextSelection.d.ts +0 -14
- package/dist/packages/core/src/commands/sinkListItem.d.ts +0 -15
- package/dist/packages/core/src/commands/splitBlock.d.ts +0 -17
- package/dist/packages/core/src/commands/splitListItem.d.ts +0 -15
- package/dist/packages/core/src/commands/toggleList.d.ts +0 -18
- package/dist/packages/core/src/commands/toggleMark.d.ts +0 -30
- package/dist/packages/core/src/commands/toggleNode.d.ts +0 -17
- package/dist/packages/core/src/commands/toggleWrap.d.ts +0 -16
- package/dist/packages/core/src/commands/undoInputRule.d.ts +0 -13
- package/dist/packages/core/src/commands/unsetAllMarks.d.ts +0 -13
- package/dist/packages/core/src/commands/unsetMark.d.ts +0 -25
- package/dist/packages/core/src/commands/updateAttributes.d.ts +0 -24
- package/dist/packages/core/src/commands/wrapIn.d.ts +0 -16
- package/dist/packages/core/src/commands/wrapInList.d.ts +0 -16
- package/dist/packages/core/src/extensions/clipboardTextSerializer.d.ts +0 -5
- package/dist/packages/core/src/extensions/commands.d.ts +0 -3
- package/dist/packages/core/src/extensions/editable.d.ts +0 -2
- package/dist/packages/core/src/extensions/focusEvents.d.ts +0 -2
- package/dist/packages/core/src/extensions/index.d.ts +0 -6
- package/dist/packages/core/src/extensions/keymap.d.ts +0 -2
- package/dist/packages/core/src/extensions/tabindex.d.ts +0 -2
- package/dist/packages/core/src/helpers/combineTransactionSteps.d.ts +0 -10
- package/dist/packages/core/src/helpers/createChainableState.d.ts +0 -10
- package/dist/packages/core/src/helpers/createDocument.d.ts +0 -12
- package/dist/packages/core/src/helpers/createNodeFromContent.d.ts +0 -15
- package/dist/packages/core/src/helpers/defaultBlockAt.d.ts +0 -7
- package/dist/packages/core/src/helpers/findChildren.d.ts +0 -9
- package/dist/packages/core/src/helpers/findChildrenInRange.d.ts +0 -10
- package/dist/packages/core/src/helpers/findParentNode.d.ts +0 -16
- package/dist/packages/core/src/helpers/findParentNodeClosestToPos.d.ts +0 -17
- package/dist/packages/core/src/helpers/generateHTML.d.ts +0 -8
- package/dist/packages/core/src/helpers/generateJSON.d.ts +0 -8
- package/dist/packages/core/src/helpers/generateText.d.ts +0 -12
- package/dist/packages/core/src/helpers/getAttributes.d.ts +0 -9
- package/dist/packages/core/src/helpers/getAttributesFromExtensions.d.ts +0 -6
- package/dist/packages/core/src/helpers/getChangedRanges.d.ts +0 -11
- package/dist/packages/core/src/helpers/getDebugJSON.d.ts +0 -8
- package/dist/packages/core/src/helpers/getExtensionField.d.ts +0 -9
- package/dist/packages/core/src/helpers/getHTMLFromFragment.d.ts +0 -2
- package/dist/packages/core/src/helpers/getMarkAttributes.d.ts +0 -3
- package/dist/packages/core/src/helpers/getMarkRange.d.ts +0 -3
- package/dist/packages/core/src/helpers/getMarkType.d.ts +0 -2
- package/dist/packages/core/src/helpers/getMarksBetween.d.ts +0 -3
- package/dist/packages/core/src/helpers/getNodeAtPosition.d.ts +0 -11
- package/dist/packages/core/src/helpers/getNodeAttributes.d.ts +0 -3
- package/dist/packages/core/src/helpers/getNodeType.d.ts +0 -2
- package/dist/packages/core/src/helpers/getRenderedAttributes.d.ts +0 -3
- package/dist/packages/core/src/helpers/getSchema.d.ts +0 -4
- package/dist/packages/core/src/helpers/getSchemaByResolvedExtensions.d.ts +0 -10
- package/dist/packages/core/src/helpers/getSchemaTypeByName.d.ts +0 -8
- package/dist/packages/core/src/helpers/getSchemaTypeNameByName.d.ts +0 -8
- package/dist/packages/core/src/helpers/getSplittedAttributes.d.ts +0 -9
- package/dist/packages/core/src/helpers/getText.d.ts +0 -15
- package/dist/packages/core/src/helpers/getTextBetween.d.ts +0 -14
- package/dist/packages/core/src/helpers/getTextContentFromNodes.d.ts +0 -8
- package/dist/packages/core/src/helpers/getTextSerializersFromSchema.d.ts +0 -8
- package/dist/packages/core/src/helpers/index.d.ts +0 -50
- package/dist/packages/core/src/helpers/injectExtensionAttributesToParseRule.d.ts +0 -9
- package/dist/packages/core/src/helpers/isActive.d.ts +0 -2
- package/dist/packages/core/src/helpers/isAtEndOfNode.d.ts +0 -2
- package/dist/packages/core/src/helpers/isAtStartOfNode.d.ts +0 -2
- package/dist/packages/core/src/helpers/isExtensionRulesEnabled.d.ts +0 -2
- package/dist/packages/core/src/helpers/isList.d.ts +0 -2
- package/dist/packages/core/src/helpers/isMarkActive.d.ts +0 -3
- package/dist/packages/core/src/helpers/isNodeActive.d.ts +0 -3
- package/dist/packages/core/src/helpers/isNodeEmpty.d.ts +0 -2
- package/dist/packages/core/src/helpers/isNodeSelection.d.ts +0 -2
- package/dist/packages/core/src/helpers/isTextSelection.d.ts +0 -2
- package/dist/packages/core/src/helpers/posToDOMRect.d.ts +0 -2
- package/dist/packages/core/src/helpers/resolveFocusPosition.d.ts +0 -4
- package/dist/packages/core/src/helpers/selectionToInsertionEnd.d.ts +0 -2
- package/dist/packages/core/src/helpers/splitExtensions.d.ts +0 -9
- package/dist/packages/core/src/index.d.ts +0 -24
- package/dist/packages/core/src/inputRules/index.d.ts +0 -5
- package/dist/packages/core/src/inputRules/markInputRule.d.ts +0 -13
- package/dist/packages/core/src/inputRules/nodeInputRule.d.ts +0 -23
- package/dist/packages/core/src/inputRules/textInputRule.d.ts +0 -10
- package/dist/packages/core/src/inputRules/textblockTypeInputRule.d.ts +0 -15
- package/dist/packages/core/src/inputRules/wrappingInputRule.d.ts +0 -28
- package/dist/packages/core/src/pasteRules/index.d.ts +0 -3
- package/dist/packages/core/src/pasteRules/markPasteRule.d.ts +0 -13
- package/dist/packages/core/src/pasteRules/nodePasteRule.d.ts +0 -13
- package/dist/packages/core/src/pasteRules/textPasteRule.d.ts +0 -10
- package/dist/packages/core/src/style.d.ts +0 -1
- package/dist/packages/core/src/types.d.ts +0 -255
- package/dist/packages/core/src/utilities/callOrReturn.d.ts +0 -9
- package/dist/packages/core/src/utilities/createStyleTag.d.ts +0 -1
- package/dist/packages/core/src/utilities/deleteProps.d.ts +0 -6
- package/dist/packages/core/src/utilities/elementFromString.d.ts +0 -1
- package/dist/packages/core/src/utilities/escapeForRegEx.d.ts +0 -1
- package/dist/packages/core/src/utilities/findDuplicates.d.ts +0 -1
- package/dist/packages/core/src/utilities/fromString.d.ts +0 -1
- package/dist/packages/core/src/utilities/index.d.ts +0 -20
- package/dist/packages/core/src/utilities/isAndroid.d.ts +0 -1
- package/dist/packages/core/src/utilities/isEmptyObject.d.ts +0 -1
- package/dist/packages/core/src/utilities/isFunction.d.ts +0 -1
- package/dist/packages/core/src/utilities/isMacOS.d.ts +0 -1
- package/dist/packages/core/src/utilities/isNumber.d.ts +0 -1
- package/dist/packages/core/src/utilities/isPlainObject.d.ts +0 -1
- package/dist/packages/core/src/utilities/isRegExp.d.ts +0 -1
- package/dist/packages/core/src/utilities/isString.d.ts +0 -1
- package/dist/packages/core/src/utilities/isiOS.d.ts +0 -1
- package/dist/packages/core/src/utilities/mergeAttributes.d.ts +0 -1
- package/dist/packages/core/src/utilities/mergeDeep.d.ts +0 -1
- package/dist/packages/core/src/utilities/minMax.d.ts +0 -1
- package/dist/packages/core/src/utilities/objectIncludes.d.ts +0 -8
- package/dist/packages/core/src/utilities/removeDuplicates.d.ts +0 -8
- package/dist/packages/extension-blockquote/src/blockquote.d.ts +0 -36
- package/dist/packages/extension-blockquote/src/index.d.ts +0 -3
- package/dist/packages/extension-bold/src/bold.d.ts +0 -48
- package/dist/packages/extension-bold/src/index.d.ts +0 -3
- package/dist/packages/extension-bullet-list/src/bullet-list.d.ts +0 -48
- package/dist/packages/extension-bullet-list/src/index.d.ts +0 -3
- package/dist/packages/extension-code/src/code.d.ts +0 -40
- package/dist/packages/extension-code/src/index.d.ts +0 -3
- package/dist/packages/extension-code-block/src/code-block.d.ts +0 -59
- package/dist/packages/extension-code-block/src/index.d.ts +0 -3
- package/dist/packages/extension-document/src/document.d.ts +0 -6
- package/dist/packages/extension-document/src/index.d.ts +0 -3
- package/dist/packages/extension-dropcursor/src/dropcursor.d.ts +0 -28
- package/dist/packages/extension-dropcursor/src/index.d.ts +0 -3
- package/dist/packages/extension-gapcursor/src/gapcursor.d.ts +0 -22
- package/dist/packages/extension-gapcursor/src/index.d.ts +0 -3
- package/dist/packages/extension-hard-break/src/hard-break.d.ts +0 -31
- package/dist/packages/extension-hard-break/src/index.d.ts +0 -3
- package/dist/packages/extension-heading/src/heading.d.ts +0 -46
- package/dist/packages/extension-heading/src/index.d.ts +0 -3
- package/dist/packages/extension-history/src/history.d.ts +0 -41
- package/dist/packages/extension-history/src/index.d.ts +0 -3
- package/dist/packages/extension-horizontal-rule/src/horizontal-rule.d.ts +0 -25
- package/dist/packages/extension-horizontal-rule/src/index.d.ts +0 -3
- package/dist/packages/extension-italic/src/index.d.ts +0 -3
- package/dist/packages/extension-italic/src/italic.d.ts +0 -51
- package/dist/packages/extension-list-item/src/index.d.ts +0 -3
- package/dist/packages/extension-list-item/src/list-item.d.ts +0 -26
- package/dist/packages/extension-ordered-list/src/index.d.ts +0 -3
- package/dist/packages/extension-ordered-list/src/ordered-list.d.ts +0 -49
- package/dist/packages/extension-paragraph/src/index.d.ts +0 -3
- package/dist/packages/extension-paragraph/src/paragraph.d.ts +0 -25
- package/dist/packages/extension-strike/src/index.d.ts +0 -3
- package/dist/packages/extension-strike/src/strike.d.ts +0 -43
- package/dist/packages/extension-text/src/index.d.ts +0 -3
- package/dist/packages/extension-text/src/text.d.ts +0 -6
- package/dist/packages/extension-text-style/src/index.d.ts +0 -3
- package/dist/packages/extension-text-style/src/text-style.d.ts +0 -26
- package/dist/packages/starter-kit/src/index.d.ts +0 -4
package/src/starter-kit.ts
CHANGED
|
@@ -1,131 +1,167 @@
|
|
|
1
1
|
import { Extension } from '@tiptap/core'
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
2
|
+
import type { BlockquoteOptions } from '@tiptap/extension-blockquote'
|
|
3
|
+
import { Blockquote } from '@tiptap/extension-blockquote'
|
|
4
|
+
import type { BoldOptions } from '@tiptap/extension-bold'
|
|
5
|
+
import { Bold } from '@tiptap/extension-bold'
|
|
6
|
+
import type { CodeOptions } from '@tiptap/extension-code'
|
|
7
|
+
import { Code } from '@tiptap/extension-code'
|
|
8
|
+
import type { CodeBlockOptions } from '@tiptap/extension-code-block'
|
|
9
|
+
import { CodeBlock } from '@tiptap/extension-code-block'
|
|
7
10
|
import { Document } from '@tiptap/extension-document'
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { Heading
|
|
12
|
-
import {
|
|
13
|
-
import { HorizontalRule
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
11
|
+
import type { HardBreakOptions } from '@tiptap/extension-hard-break'
|
|
12
|
+
import { HardBreak } from '@tiptap/extension-hard-break'
|
|
13
|
+
import type { HeadingOptions } from '@tiptap/extension-heading'
|
|
14
|
+
import { Heading } from '@tiptap/extension-heading'
|
|
15
|
+
import type { HorizontalRuleOptions } from '@tiptap/extension-horizontal-rule'
|
|
16
|
+
import { HorizontalRule } from '@tiptap/extension-horizontal-rule'
|
|
17
|
+
import type { ItalicOptions } from '@tiptap/extension-italic'
|
|
18
|
+
import { Italic } from '@tiptap/extension-italic'
|
|
19
|
+
import type { LinkOptions } from '@tiptap/extension-link'
|
|
20
|
+
import { Link } from '@tiptap/extension-link'
|
|
21
|
+
import type { BulletListOptions, ListItemOptions, ListKeymapOptions, OrderedListOptions } from '@tiptap/extension-list'
|
|
22
|
+
import { BulletList, ListItem, ListKeymap, OrderedList } from '@tiptap/extension-list'
|
|
23
|
+
import type { ParagraphOptions } from '@tiptap/extension-paragraph'
|
|
24
|
+
import { Paragraph } from '@tiptap/extension-paragraph'
|
|
25
|
+
import type { StrikeOptions } from '@tiptap/extension-strike'
|
|
26
|
+
import { Strike } from '@tiptap/extension-strike'
|
|
19
27
|
import { Text } from '@tiptap/extension-text'
|
|
28
|
+
import type { UnderlineOptions } from '@tiptap/extension-underline'
|
|
29
|
+
import { Underline } from '@tiptap/extension-underline'
|
|
30
|
+
import type { DropcursorOptions, TrailingNodeOptions, UndoRedoOptions } from '@tiptap/extensions'
|
|
31
|
+
import { Dropcursor, Gapcursor, TrailingNode, UndoRedo } from '@tiptap/extensions'
|
|
20
32
|
|
|
21
33
|
export interface StarterKitOptions {
|
|
22
34
|
/**
|
|
23
35
|
* If set to false, the blockquote extension will not be registered
|
|
24
36
|
* @example blockquote: false
|
|
25
37
|
*/
|
|
26
|
-
blockquote: Partial<BlockquoteOptions> | false
|
|
38
|
+
blockquote: Partial<BlockquoteOptions> | false
|
|
27
39
|
|
|
28
40
|
/**
|
|
29
41
|
* If set to false, the bold extension will not be registered
|
|
30
42
|
* @example bold: false
|
|
31
43
|
*/
|
|
32
|
-
bold: Partial<BoldOptions> | false
|
|
44
|
+
bold: Partial<BoldOptions> | false
|
|
33
45
|
|
|
34
46
|
/**
|
|
35
47
|
* If set to false, the bulletList extension will not be registered
|
|
36
48
|
* @example bulletList: false
|
|
37
49
|
*/
|
|
38
|
-
bulletList: Partial<BulletListOptions> | false
|
|
50
|
+
bulletList: Partial<BulletListOptions> | false
|
|
39
51
|
|
|
40
52
|
/**
|
|
41
53
|
* If set to false, the code extension will not be registered
|
|
42
54
|
* @example code: false
|
|
43
55
|
*/
|
|
44
|
-
code: Partial<CodeOptions> | false
|
|
56
|
+
code: Partial<CodeOptions> | false
|
|
45
57
|
|
|
46
58
|
/**
|
|
47
59
|
* If set to false, the codeBlock extension will not be registered
|
|
48
60
|
* @example codeBlock: false
|
|
49
61
|
*/
|
|
50
|
-
codeBlock: Partial<CodeBlockOptions> | false
|
|
62
|
+
codeBlock: Partial<CodeBlockOptions> | false
|
|
51
63
|
|
|
52
64
|
/**
|
|
53
65
|
* If set to false, the document extension will not be registered
|
|
54
66
|
* @example document: false
|
|
55
67
|
*/
|
|
56
|
-
document: false
|
|
68
|
+
document: false
|
|
57
69
|
|
|
58
70
|
/**
|
|
59
71
|
* If set to false, the dropcursor extension will not be registered
|
|
60
72
|
* @example dropcursor: false
|
|
61
73
|
*/
|
|
62
|
-
dropcursor: Partial<DropcursorOptions> | false
|
|
74
|
+
dropcursor: Partial<DropcursorOptions> | false
|
|
63
75
|
|
|
64
76
|
/**
|
|
65
77
|
* If set to false, the gapcursor extension will not be registered
|
|
66
78
|
* @example gapcursor: false
|
|
67
79
|
*/
|
|
68
|
-
gapcursor: false
|
|
80
|
+
gapcursor: false
|
|
69
81
|
|
|
70
82
|
/**
|
|
71
83
|
* If set to false, the hardBreak extension will not be registered
|
|
72
84
|
* @example hardBreak: false
|
|
73
85
|
*/
|
|
74
|
-
hardBreak: Partial<HardBreakOptions> | false
|
|
86
|
+
hardBreak: Partial<HardBreakOptions> | false
|
|
75
87
|
|
|
76
88
|
/**
|
|
77
89
|
* If set to false, the heading extension will not be registered
|
|
78
90
|
* @example heading: false
|
|
79
91
|
*/
|
|
80
|
-
heading: Partial<HeadingOptions> | false
|
|
92
|
+
heading: Partial<HeadingOptions> | false
|
|
81
93
|
|
|
82
94
|
/**
|
|
83
|
-
* If set to false, the
|
|
84
|
-
* @example
|
|
95
|
+
* If set to false, the undo-redo extension will not be registered
|
|
96
|
+
* @example undoRedo: false
|
|
85
97
|
*/
|
|
86
|
-
|
|
98
|
+
undoRedo: Partial<UndoRedoOptions> | false
|
|
87
99
|
|
|
88
100
|
/**
|
|
89
101
|
* If set to false, the horizontalRule extension will not be registered
|
|
90
102
|
* @example horizontalRule: false
|
|
91
103
|
*/
|
|
92
|
-
horizontalRule: Partial<HorizontalRuleOptions> | false
|
|
104
|
+
horizontalRule: Partial<HorizontalRuleOptions> | false
|
|
93
105
|
|
|
94
106
|
/**
|
|
95
107
|
* If set to false, the italic extension will not be registered
|
|
96
108
|
* @example italic: false
|
|
97
109
|
*/
|
|
98
|
-
italic: Partial<ItalicOptions> | false
|
|
110
|
+
italic: Partial<ItalicOptions> | false
|
|
99
111
|
|
|
100
112
|
/**
|
|
101
113
|
* If set to false, the listItem extension will not be registered
|
|
102
114
|
* @example listItem: false
|
|
103
115
|
*/
|
|
104
|
-
listItem: Partial<ListItemOptions> | false
|
|
116
|
+
listItem: Partial<ListItemOptions> | false
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* If set to false, the listItemKeymap extension will not be registered
|
|
120
|
+
* @example listKeymap: false
|
|
121
|
+
*/
|
|
122
|
+
listKeymap: Partial<ListKeymapOptions> | false
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* If set to false, the link extension will not be registered
|
|
126
|
+
* @example link: false
|
|
127
|
+
*/
|
|
128
|
+
link: Partial<LinkOptions> | false
|
|
105
129
|
|
|
106
130
|
/**
|
|
107
131
|
* If set to false, the orderedList extension will not be registered
|
|
108
132
|
* @example orderedList: false
|
|
109
133
|
*/
|
|
110
|
-
orderedList: Partial<OrderedListOptions> | false
|
|
134
|
+
orderedList: Partial<OrderedListOptions> | false
|
|
111
135
|
|
|
112
136
|
/**
|
|
113
137
|
* If set to false, the paragraph extension will not be registered
|
|
114
138
|
* @example paragraph: false
|
|
115
139
|
*/
|
|
116
|
-
paragraph: Partial<ParagraphOptions> | false
|
|
140
|
+
paragraph: Partial<ParagraphOptions> | false
|
|
117
141
|
|
|
118
142
|
/**
|
|
119
143
|
* If set to false, the strike extension will not be registered
|
|
120
144
|
* @example strike: false
|
|
121
145
|
*/
|
|
122
|
-
strike: Partial<StrikeOptions> | false
|
|
146
|
+
strike: Partial<StrikeOptions> | false
|
|
123
147
|
|
|
124
148
|
/**
|
|
125
149
|
* If set to false, the text extension will not be registered
|
|
126
150
|
* @example text: false
|
|
127
151
|
*/
|
|
128
|
-
text: false
|
|
152
|
+
text: false
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* If set to false, the underline extension will not be registered
|
|
156
|
+
* @example underline: false
|
|
157
|
+
*/
|
|
158
|
+
underline: Partial<UnderlineOptions> | false
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* If set to false, the trailingNode extension will not be registered
|
|
162
|
+
* @example trailingNode: false
|
|
163
|
+
*/
|
|
164
|
+
trailingNode: Partial<TrailingNodeOptions> | false
|
|
129
165
|
}
|
|
130
166
|
|
|
131
167
|
/**
|
|
@@ -140,75 +176,91 @@ export const StarterKit = Extension.create<StarterKitOptions>({
|
|
|
140
176
|
const extensions = []
|
|
141
177
|
|
|
142
178
|
if (this.options.bold !== false) {
|
|
143
|
-
extensions.push(Bold.configure(this.options
|
|
179
|
+
extensions.push(Bold.configure(this.options.bold))
|
|
144
180
|
}
|
|
145
181
|
|
|
146
182
|
if (this.options.blockquote !== false) {
|
|
147
|
-
extensions.push(Blockquote.configure(this.options
|
|
183
|
+
extensions.push(Blockquote.configure(this.options.blockquote))
|
|
148
184
|
}
|
|
149
185
|
|
|
150
186
|
if (this.options.bulletList !== false) {
|
|
151
|
-
extensions.push(BulletList.configure(this.options
|
|
187
|
+
extensions.push(BulletList.configure(this.options.bulletList))
|
|
152
188
|
}
|
|
153
189
|
|
|
154
190
|
if (this.options.code !== false) {
|
|
155
|
-
extensions.push(Code.configure(this.options
|
|
191
|
+
extensions.push(Code.configure(this.options.code))
|
|
156
192
|
}
|
|
157
193
|
|
|
158
194
|
if (this.options.codeBlock !== false) {
|
|
159
|
-
extensions.push(CodeBlock.configure(this.options
|
|
195
|
+
extensions.push(CodeBlock.configure(this.options.codeBlock))
|
|
160
196
|
}
|
|
161
197
|
|
|
162
198
|
if (this.options.document !== false) {
|
|
163
|
-
extensions.push(Document.configure(this.options
|
|
199
|
+
extensions.push(Document.configure(this.options.document))
|
|
164
200
|
}
|
|
165
201
|
|
|
166
202
|
if (this.options.dropcursor !== false) {
|
|
167
|
-
extensions.push(Dropcursor.configure(this.options
|
|
203
|
+
extensions.push(Dropcursor.configure(this.options.dropcursor))
|
|
168
204
|
}
|
|
169
205
|
|
|
170
206
|
if (this.options.gapcursor !== false) {
|
|
171
|
-
extensions.push(Gapcursor.configure(this.options
|
|
207
|
+
extensions.push(Gapcursor.configure(this.options.gapcursor))
|
|
172
208
|
}
|
|
173
209
|
|
|
174
210
|
if (this.options.hardBreak !== false) {
|
|
175
|
-
extensions.push(HardBreak.configure(this.options
|
|
211
|
+
extensions.push(HardBreak.configure(this.options.hardBreak))
|
|
176
212
|
}
|
|
177
213
|
|
|
178
214
|
if (this.options.heading !== false) {
|
|
179
|
-
extensions.push(Heading.configure(this.options
|
|
215
|
+
extensions.push(Heading.configure(this.options.heading))
|
|
180
216
|
}
|
|
181
217
|
|
|
182
|
-
if (this.options.
|
|
183
|
-
extensions.push(
|
|
218
|
+
if (this.options.undoRedo !== false) {
|
|
219
|
+
extensions.push(UndoRedo.configure(this.options.undoRedo))
|
|
184
220
|
}
|
|
185
221
|
|
|
186
222
|
if (this.options.horizontalRule !== false) {
|
|
187
|
-
extensions.push(HorizontalRule.configure(this.options
|
|
223
|
+
extensions.push(HorizontalRule.configure(this.options.horizontalRule))
|
|
188
224
|
}
|
|
189
225
|
|
|
190
226
|
if (this.options.italic !== false) {
|
|
191
|
-
extensions.push(Italic.configure(this.options
|
|
227
|
+
extensions.push(Italic.configure(this.options.italic))
|
|
192
228
|
}
|
|
193
229
|
|
|
194
230
|
if (this.options.listItem !== false) {
|
|
195
|
-
extensions.push(ListItem.configure(this.options
|
|
231
|
+
extensions.push(ListItem.configure(this.options.listItem))
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
if (this.options.listKeymap !== false) {
|
|
235
|
+
extensions.push(ListKeymap.configure(this.options?.listKeymap))
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
if (this.options.link !== false) {
|
|
239
|
+
extensions.push(Link.configure(this.options?.link))
|
|
196
240
|
}
|
|
197
241
|
|
|
198
242
|
if (this.options.orderedList !== false) {
|
|
199
|
-
extensions.push(OrderedList.configure(this.options
|
|
243
|
+
extensions.push(OrderedList.configure(this.options.orderedList))
|
|
200
244
|
}
|
|
201
245
|
|
|
202
246
|
if (this.options.paragraph !== false) {
|
|
203
|
-
extensions.push(Paragraph.configure(this.options
|
|
247
|
+
extensions.push(Paragraph.configure(this.options.paragraph))
|
|
204
248
|
}
|
|
205
249
|
|
|
206
250
|
if (this.options.strike !== false) {
|
|
207
|
-
extensions.push(Strike.configure(this.options
|
|
251
|
+
extensions.push(Strike.configure(this.options.strike))
|
|
208
252
|
}
|
|
209
253
|
|
|
210
254
|
if (this.options.text !== false) {
|
|
211
|
-
extensions.push(Text.configure(this.options
|
|
255
|
+
extensions.push(Text.configure(this.options.text))
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
if (this.options.underline !== false) {
|
|
259
|
+
extensions.push(Underline.configure(this.options?.underline))
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
if (this.options.trailingNode !== false) {
|
|
263
|
+
extensions.push(TrailingNode.configure(this.options?.trailingNode))
|
|
212
264
|
}
|
|
213
265
|
|
|
214
266
|
return extensions
|
package/dist/index.umd.js
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@tiptap/core'), require('@tiptap/extension-blockquote'), require('@tiptap/extension-bold'), require('@tiptap/extension-bullet-list'), require('@tiptap/extension-code'), require('@tiptap/extension-code-block'), require('@tiptap/extension-document'), require('@tiptap/extension-dropcursor'), require('@tiptap/extension-gapcursor'), require('@tiptap/extension-hard-break'), require('@tiptap/extension-heading'), require('@tiptap/extension-history'), require('@tiptap/extension-horizontal-rule'), require('@tiptap/extension-italic'), require('@tiptap/extension-list-item'), require('@tiptap/extension-ordered-list'), require('@tiptap/extension-paragraph'), require('@tiptap/extension-strike'), require('@tiptap/extension-text')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define(['exports', '@tiptap/core', '@tiptap/extension-blockquote', '@tiptap/extension-bold', '@tiptap/extension-bullet-list', '@tiptap/extension-code', '@tiptap/extension-code-block', '@tiptap/extension-document', '@tiptap/extension-dropcursor', '@tiptap/extension-gapcursor', '@tiptap/extension-hard-break', '@tiptap/extension-heading', '@tiptap/extension-history', '@tiptap/extension-horizontal-rule', '@tiptap/extension-italic', '@tiptap/extension-list-item', '@tiptap/extension-ordered-list', '@tiptap/extension-paragraph', '@tiptap/extension-strike', '@tiptap/extension-text'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["@tiptap/starter-kit"] = {}, global.core, global.extensionBlockquote, global.extensionBold, global.extensionBulletList, global.extensionCode, global.extensionCodeBlock, global.extensionDocument, global.extensionDropcursor, global.extensionGapcursor, global.extensionHardBreak, global.extensionHeading, global.extensionHistory, global.extensionHorizontalRule, global.extensionItalic, global.extensionListItem, global.extensionOrderedList, global.extensionParagraph, global.extensionStrike, global.extensionText));
|
|
5
|
-
})(this, (function (exports, core, extensionBlockquote, extensionBold, extensionBulletList, extensionCode, extensionCodeBlock, extensionDocument, extensionDropcursor, extensionGapcursor, extensionHardBreak, extensionHeading, extensionHistory, extensionHorizontalRule, extensionItalic, extensionListItem, extensionOrderedList, extensionParagraph, extensionStrike, extensionText) { 'use strict';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* The starter kit is a collection of essential editor extensions.
|
|
9
|
-
*
|
|
10
|
-
* It’s a good starting point for building your own editor.
|
|
11
|
-
*/
|
|
12
|
-
const StarterKit = core.Extension.create({
|
|
13
|
-
name: 'starterKit',
|
|
14
|
-
addExtensions() {
|
|
15
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
16
|
-
const extensions = [];
|
|
17
|
-
if (this.options.bold !== false) {
|
|
18
|
-
extensions.push(extensionBold.Bold.configure((_a = this.options) === null || _a === void 0 ? void 0 : _a.bold));
|
|
19
|
-
}
|
|
20
|
-
if (this.options.blockquote !== false) {
|
|
21
|
-
extensions.push(extensionBlockquote.Blockquote.configure((_b = this.options) === null || _b === void 0 ? void 0 : _b.blockquote));
|
|
22
|
-
}
|
|
23
|
-
if (this.options.bulletList !== false) {
|
|
24
|
-
extensions.push(extensionBulletList.BulletList.configure((_c = this.options) === null || _c === void 0 ? void 0 : _c.bulletList));
|
|
25
|
-
}
|
|
26
|
-
if (this.options.code !== false) {
|
|
27
|
-
extensions.push(extensionCode.Code.configure((_d = this.options) === null || _d === void 0 ? void 0 : _d.code));
|
|
28
|
-
}
|
|
29
|
-
if (this.options.codeBlock !== false) {
|
|
30
|
-
extensions.push(extensionCodeBlock.CodeBlock.configure((_e = this.options) === null || _e === void 0 ? void 0 : _e.codeBlock));
|
|
31
|
-
}
|
|
32
|
-
if (this.options.document !== false) {
|
|
33
|
-
extensions.push(extensionDocument.Document.configure((_f = this.options) === null || _f === void 0 ? void 0 : _f.document));
|
|
34
|
-
}
|
|
35
|
-
if (this.options.dropcursor !== false) {
|
|
36
|
-
extensions.push(extensionDropcursor.Dropcursor.configure((_g = this.options) === null || _g === void 0 ? void 0 : _g.dropcursor));
|
|
37
|
-
}
|
|
38
|
-
if (this.options.gapcursor !== false) {
|
|
39
|
-
extensions.push(extensionGapcursor.Gapcursor.configure((_h = this.options) === null || _h === void 0 ? void 0 : _h.gapcursor));
|
|
40
|
-
}
|
|
41
|
-
if (this.options.hardBreak !== false) {
|
|
42
|
-
extensions.push(extensionHardBreak.HardBreak.configure((_j = this.options) === null || _j === void 0 ? void 0 : _j.hardBreak));
|
|
43
|
-
}
|
|
44
|
-
if (this.options.heading !== false) {
|
|
45
|
-
extensions.push(extensionHeading.Heading.configure((_k = this.options) === null || _k === void 0 ? void 0 : _k.heading));
|
|
46
|
-
}
|
|
47
|
-
if (this.options.history !== false) {
|
|
48
|
-
extensions.push(extensionHistory.History.configure((_l = this.options) === null || _l === void 0 ? void 0 : _l.history));
|
|
49
|
-
}
|
|
50
|
-
if (this.options.horizontalRule !== false) {
|
|
51
|
-
extensions.push(extensionHorizontalRule.HorizontalRule.configure((_m = this.options) === null || _m === void 0 ? void 0 : _m.horizontalRule));
|
|
52
|
-
}
|
|
53
|
-
if (this.options.italic !== false) {
|
|
54
|
-
extensions.push(extensionItalic.Italic.configure((_o = this.options) === null || _o === void 0 ? void 0 : _o.italic));
|
|
55
|
-
}
|
|
56
|
-
if (this.options.listItem !== false) {
|
|
57
|
-
extensions.push(extensionListItem.ListItem.configure((_p = this.options) === null || _p === void 0 ? void 0 : _p.listItem));
|
|
58
|
-
}
|
|
59
|
-
if (this.options.orderedList !== false) {
|
|
60
|
-
extensions.push(extensionOrderedList.OrderedList.configure((_q = this.options) === null || _q === void 0 ? void 0 : _q.orderedList));
|
|
61
|
-
}
|
|
62
|
-
if (this.options.paragraph !== false) {
|
|
63
|
-
extensions.push(extensionParagraph.Paragraph.configure((_r = this.options) === null || _r === void 0 ? void 0 : _r.paragraph));
|
|
64
|
-
}
|
|
65
|
-
if (this.options.strike !== false) {
|
|
66
|
-
extensions.push(extensionStrike.Strike.configure((_s = this.options) === null || _s === void 0 ? void 0 : _s.strike));
|
|
67
|
-
}
|
|
68
|
-
if (this.options.text !== false) {
|
|
69
|
-
extensions.push(extensionText.Text.configure((_t = this.options) === null || _t === void 0 ? void 0 : _t.text));
|
|
70
|
-
}
|
|
71
|
-
return extensions;
|
|
72
|
-
},
|
|
73
|
-
});
|
|
74
|
-
|
|
75
|
-
exports.StarterKit = StarterKit;
|
|
76
|
-
exports.default = StarterKit;
|
|
77
|
-
|
|
78
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
79
|
-
|
|
80
|
-
}));
|
|
81
|
-
//# sourceMappingURL=index.umd.js.map
|
package/dist/index.umd.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.umd.js","sources":["../src/starter-kit.ts"],"sourcesContent":["import { Extension } from '@tiptap/core'\nimport { Blockquote, BlockquoteOptions } from '@tiptap/extension-blockquote'\nimport { Bold, BoldOptions } from '@tiptap/extension-bold'\nimport { BulletList, BulletListOptions } from '@tiptap/extension-bullet-list'\nimport { Code, CodeOptions } from '@tiptap/extension-code'\nimport { CodeBlock, CodeBlockOptions } from '@tiptap/extension-code-block'\nimport { Document } from '@tiptap/extension-document'\nimport { Dropcursor, DropcursorOptions } from '@tiptap/extension-dropcursor'\nimport { Gapcursor } from '@tiptap/extension-gapcursor'\nimport { HardBreak, HardBreakOptions } from '@tiptap/extension-hard-break'\nimport { Heading, HeadingOptions } from '@tiptap/extension-heading'\nimport { History, HistoryOptions } from '@tiptap/extension-history'\nimport { HorizontalRule, HorizontalRuleOptions } from '@tiptap/extension-horizontal-rule'\nimport { Italic, ItalicOptions } from '@tiptap/extension-italic'\nimport { ListItem, ListItemOptions } from '@tiptap/extension-list-item'\nimport { OrderedList, OrderedListOptions } from '@tiptap/extension-ordered-list'\nimport { Paragraph, ParagraphOptions } from '@tiptap/extension-paragraph'\nimport { Strike, StrikeOptions } from '@tiptap/extension-strike'\nimport { Text } from '@tiptap/extension-text'\n\nexport interface StarterKitOptions {\n /**\n * If set to false, the blockquote extension will not be registered\n * @example blockquote: false\n */\n blockquote: Partial<BlockquoteOptions> | false,\n\n /**\n * If set to false, the bold extension will not be registered\n * @example bold: false\n */\n bold: Partial<BoldOptions> | false,\n\n /**\n * If set to false, the bulletList extension will not be registered\n * @example bulletList: false\n */\n bulletList: Partial<BulletListOptions> | false,\n\n /**\n * If set to false, the code extension will not be registered\n * @example code: false\n */\n code: Partial<CodeOptions> | false,\n\n /**\n * If set to false, the codeBlock extension will not be registered\n * @example codeBlock: false\n */\n codeBlock: Partial<CodeBlockOptions> | false,\n\n /**\n * If set to false, the document extension will not be registered\n * @example document: false\n */\n document: false,\n\n /**\n * If set to false, the dropcursor extension will not be registered\n * @example dropcursor: false\n */\n dropcursor: Partial<DropcursorOptions> | false,\n\n /**\n * If set to false, the gapcursor extension will not be registered\n * @example gapcursor: false\n */\n gapcursor: false,\n\n /**\n * If set to false, the hardBreak extension will not be registered\n * @example hardBreak: false\n */\n hardBreak: Partial<HardBreakOptions> | false,\n\n /**\n * If set to false, the heading extension will not be registered\n * @example heading: false\n */\n heading: Partial<HeadingOptions> | false,\n\n /**\n * If set to false, the history extension will not be registered\n * @example history: false\n */\n history: Partial<HistoryOptions> | false,\n\n /**\n * If set to false, the horizontalRule extension will not be registered\n * @example horizontalRule: false\n */\n horizontalRule: Partial<HorizontalRuleOptions> | false,\n\n /**\n * If set to false, the italic extension will not be registered\n * @example italic: false\n */\n italic: Partial<ItalicOptions> | false,\n\n /**\n * If set to false, the listItem extension will not be registered\n * @example listItem: false\n */\n listItem: Partial<ListItemOptions> | false,\n\n /**\n * If set to false, the orderedList extension will not be registered\n * @example orderedList: false\n */\n orderedList: Partial<OrderedListOptions> | false,\n\n /**\n * If set to false, the paragraph extension will not be registered\n * @example paragraph: false\n */\n paragraph: Partial<ParagraphOptions> | false,\n\n /**\n * If set to false, the strike extension will not be registered\n * @example strike: false\n */\n strike: Partial<StrikeOptions> | false,\n\n /**\n * If set to false, the text extension will not be registered\n * @example text: false\n */\n text: false,\n}\n\n/**\n * The starter kit is a collection of essential editor extensions.\n *\n * It’s a good starting point for building your own editor.\n */\nexport const StarterKit = Extension.create<StarterKitOptions>({\n name: 'starterKit',\n\n addExtensions() {\n const extensions = []\n\n if (this.options.bold !== false) {\n extensions.push(Bold.configure(this.options?.bold))\n }\n\n if (this.options.blockquote !== false) {\n extensions.push(Blockquote.configure(this.options?.blockquote))\n }\n\n if (this.options.bulletList !== false) {\n extensions.push(BulletList.configure(this.options?.bulletList))\n }\n\n if (this.options.code !== false) {\n extensions.push(Code.configure(this.options?.code))\n }\n\n if (this.options.codeBlock !== false) {\n extensions.push(CodeBlock.configure(this.options?.codeBlock))\n }\n\n if (this.options.document !== false) {\n extensions.push(Document.configure(this.options?.document))\n }\n\n if (this.options.dropcursor !== false) {\n extensions.push(Dropcursor.configure(this.options?.dropcursor))\n }\n\n if (this.options.gapcursor !== false) {\n extensions.push(Gapcursor.configure(this.options?.gapcursor))\n }\n\n if (this.options.hardBreak !== false) {\n extensions.push(HardBreak.configure(this.options?.hardBreak))\n }\n\n if (this.options.heading !== false) {\n extensions.push(Heading.configure(this.options?.heading))\n }\n\n if (this.options.history !== false) {\n extensions.push(History.configure(this.options?.history))\n }\n\n if (this.options.horizontalRule !== false) {\n extensions.push(HorizontalRule.configure(this.options?.horizontalRule))\n }\n\n if (this.options.italic !== false) {\n extensions.push(Italic.configure(this.options?.italic))\n }\n\n if (this.options.listItem !== false) {\n extensions.push(ListItem.configure(this.options?.listItem))\n }\n\n if (this.options.orderedList !== false) {\n extensions.push(OrderedList.configure(this.options?.orderedList))\n }\n\n if (this.options.paragraph !== false) {\n extensions.push(Paragraph.configure(this.options?.paragraph))\n }\n\n if (this.options.strike !== false) {\n extensions.push(Strike.configure(this.options?.strike))\n }\n\n if (this.options.text !== false) {\n extensions.push(Text.configure(this.options?.text))\n }\n\n return extensions\n },\n})\n"],"names":["Extension","Bold","Blockquote","BulletList","Code","CodeBlock","Document","Dropcursor","Gapcursor","HardBreak","Heading","History","HorizontalRule","Italic","ListItem","OrderedList","Paragraph","Strike","Text"],"mappings":";;;;;;EAkIA;;;;EAIG;AACU,QAAA,UAAU,GAAGA,cAAS,CAAC,MAAM,CAAoB;EAC5D,IAAA,IAAI,EAAE,YAAY;MAElB,aAAa,GAAA;;UACX,MAAM,UAAU,GAAG,EAAE,CAAA;UAErB,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,KAAK,KAAK,EAAE;EAC/B,YAAA,UAAU,CAAC,IAAI,CAACC,kBAAI,CAAC,SAAS,CAAC,CAAA,EAAA,GAAA,IAAI,CAAC,OAAO,MAAA,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAE,IAAI,CAAC,CAAC,CAAA;WACpD;UAED,IAAI,IAAI,CAAC,OAAO,CAAC,UAAU,KAAK,KAAK,EAAE;EACrC,YAAA,UAAU,CAAC,IAAI,CAACC,8BAAU,CAAC,SAAS,CAAC,CAAA,EAAA,GAAA,IAAI,CAAC,OAAO,MAAA,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAE,UAAU,CAAC,CAAC,CAAA;WAChE;UAED,IAAI,IAAI,CAAC,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C9D;UAED,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,KAAK,KAAK,EAAE;EACjC,YAAA,UAAU,CAAC,IAAI,CAACC,sBAAM,CAAC,SAAS,CAAC,CAAA,EAAA,GAAA,IAAI,CAAC,OAAO,MAAA,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAE,MAAM,CAAC,CAAC,CAAA;WACxD;UAED,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,KAAK,KAAK,EAAE;EAC/B,YAAA,UAAU,CAAC,IAAI,CAACC,kBAAI,CAAC,SAAS,CAAC,CAAA,EAAA,GAAA,IAAI,CAAC,OAAO,MAAA,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAE,IAAI,CAAC,CAAC,CAAA;WACpD;EAED,QAAA,OAAO,UAAU,CAAA;OAClB;EACF,CAAA;;;;;;;;;;;"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { EditorState, Transaction } from '@tiptap/pm/state';
|
|
2
|
-
import { Editor } from './Editor.js';
|
|
3
|
-
import { AnyCommands, CanCommands, ChainedCommands, CommandProps, SingleCommands } from './types.js';
|
|
4
|
-
export declare class CommandManager {
|
|
5
|
-
editor: Editor;
|
|
6
|
-
rawCommands: AnyCommands;
|
|
7
|
-
customState?: EditorState;
|
|
8
|
-
constructor(props: {
|
|
9
|
-
editor: Editor;
|
|
10
|
-
state?: EditorState;
|
|
11
|
-
});
|
|
12
|
-
get hasCustomState(): boolean;
|
|
13
|
-
get state(): EditorState;
|
|
14
|
-
get commands(): SingleCommands;
|
|
15
|
-
get chain(): () => ChainedCommands;
|
|
16
|
-
get can(): () => CanCommands;
|
|
17
|
-
createChain(startTr?: Transaction, shouldDispatch?: boolean): ChainedCommands;
|
|
18
|
-
createCan(startTr?: Transaction): CanCommands;
|
|
19
|
-
buildProps(tr: Transaction, shouldDispatch?: boolean): CommandProps;
|
|
20
|
-
}
|
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
import { MarkType, NodeType, Schema } from '@tiptap/pm/model';
|
|
2
|
-
import { EditorState, Plugin, PluginKey, Transaction } from '@tiptap/pm/state';
|
|
3
|
-
import { EditorView } from '@tiptap/pm/view';
|
|
4
|
-
import { EventEmitter } from './EventEmitter.js';
|
|
5
|
-
import { ExtensionManager } from './ExtensionManager.js';
|
|
6
|
-
import { NodePos } from './NodePos.js';
|
|
7
|
-
import { CanCommands, ChainedCommands, EditorEvents, EditorOptions, JSONContent, SingleCommands, TextSerializer } from './types.js';
|
|
8
|
-
export * as extensions from './extensions/index.js';
|
|
9
|
-
declare global {
|
|
10
|
-
interface HTMLElement {
|
|
11
|
-
editor?: Editor;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
export declare class Editor extends EventEmitter<EditorEvents> {
|
|
15
|
-
private commandManager;
|
|
16
|
-
extensionManager: ExtensionManager;
|
|
17
|
-
private css;
|
|
18
|
-
schema: Schema;
|
|
19
|
-
view: EditorView;
|
|
20
|
-
isFocused: boolean;
|
|
21
|
-
extensionStorage: Record<string, any>;
|
|
22
|
-
options: EditorOptions;
|
|
23
|
-
constructor(options?: Partial<EditorOptions>);
|
|
24
|
-
/**
|
|
25
|
-
* Returns the editor storage.
|
|
26
|
-
*/
|
|
27
|
-
get storage(): Record<string, any>;
|
|
28
|
-
/**
|
|
29
|
-
* An object of all registered commands.
|
|
30
|
-
*/
|
|
31
|
-
get commands(): SingleCommands;
|
|
32
|
-
/**
|
|
33
|
-
* Create a command chain to call multiple commands at once.
|
|
34
|
-
*/
|
|
35
|
-
chain(): ChainedCommands;
|
|
36
|
-
/**
|
|
37
|
-
* Check if a command or a command chain can be executed. Without executing it.
|
|
38
|
-
*/
|
|
39
|
-
can(): CanCommands;
|
|
40
|
-
/**
|
|
41
|
-
* Inject CSS styles.
|
|
42
|
-
*/
|
|
43
|
-
private injectCSS;
|
|
44
|
-
/**
|
|
45
|
-
* Update editor options.
|
|
46
|
-
*
|
|
47
|
-
* @param options A list of options
|
|
48
|
-
*/
|
|
49
|
-
setOptions(options?: Partial<EditorOptions>): void;
|
|
50
|
-
/**
|
|
51
|
-
* Update editable state of the editor.
|
|
52
|
-
*/
|
|
53
|
-
setEditable(editable: boolean, emitUpdate?: boolean): void;
|
|
54
|
-
/**
|
|
55
|
-
* Returns whether the editor is editable.
|
|
56
|
-
*/
|
|
57
|
-
get isEditable(): boolean;
|
|
58
|
-
/**
|
|
59
|
-
* Returns the editor state.
|
|
60
|
-
*/
|
|
61
|
-
get state(): EditorState;
|
|
62
|
-
/**
|
|
63
|
-
* Register a ProseMirror plugin.
|
|
64
|
-
*
|
|
65
|
-
* @param plugin A ProseMirror plugin
|
|
66
|
-
* @param handlePlugins Control how to merge the plugin into the existing plugins.
|
|
67
|
-
*/
|
|
68
|
-
registerPlugin(plugin: Plugin, handlePlugins?: (newPlugin: Plugin, plugins: Plugin[]) => Plugin[]): void;
|
|
69
|
-
/**
|
|
70
|
-
* Unregister a ProseMirror plugin.
|
|
71
|
-
*
|
|
72
|
-
* @param nameOrPluginKey The plugins name
|
|
73
|
-
*/
|
|
74
|
-
unregisterPlugin(nameOrPluginKey: string | PluginKey): void;
|
|
75
|
-
/**
|
|
76
|
-
* Creates an extension manager.
|
|
77
|
-
*/
|
|
78
|
-
private createExtensionManager;
|
|
79
|
-
/**
|
|
80
|
-
* Creates an command manager.
|
|
81
|
-
*/
|
|
82
|
-
private createCommandManager;
|
|
83
|
-
/**
|
|
84
|
-
* Creates a ProseMirror schema.
|
|
85
|
-
*/
|
|
86
|
-
private createSchema;
|
|
87
|
-
/**
|
|
88
|
-
* Creates a ProseMirror view.
|
|
89
|
-
*/
|
|
90
|
-
private createView;
|
|
91
|
-
/**
|
|
92
|
-
* Creates all node views.
|
|
93
|
-
*/
|
|
94
|
-
createNodeViews(): void;
|
|
95
|
-
/**
|
|
96
|
-
* Prepend class name to element.
|
|
97
|
-
*/
|
|
98
|
-
prependClass(): void;
|
|
99
|
-
isCapturingTransaction: boolean;
|
|
100
|
-
private capturedTransaction;
|
|
101
|
-
captureTransaction(fn: Function): Transaction | null;
|
|
102
|
-
/**
|
|
103
|
-
* The callback over which to send transactions (state updates) produced by the view.
|
|
104
|
-
*
|
|
105
|
-
* @param transaction An editor state transaction
|
|
106
|
-
*/
|
|
107
|
-
private dispatchTransaction;
|
|
108
|
-
/**
|
|
109
|
-
* Get attributes of the currently selected node or mark.
|
|
110
|
-
*/
|
|
111
|
-
getAttributes(nameOrType: string | NodeType | MarkType): Record<string, any>;
|
|
112
|
-
/**
|
|
113
|
-
* Returns if the currently selected node or mark is active.
|
|
114
|
-
*
|
|
115
|
-
* @param name Name of the node or mark
|
|
116
|
-
* @param attributes Attributes of the node or mark
|
|
117
|
-
*/
|
|
118
|
-
isActive(name: string, attributes?: {}): boolean;
|
|
119
|
-
isActive(attributes: {}): boolean;
|
|
120
|
-
/**
|
|
121
|
-
* Get the document as JSON.
|
|
122
|
-
*/
|
|
123
|
-
getJSON(): JSONContent;
|
|
124
|
-
/**
|
|
125
|
-
* Get the document as HTML.
|
|
126
|
-
*/
|
|
127
|
-
getHTML(): string;
|
|
128
|
-
/**
|
|
129
|
-
* Get the document as text.
|
|
130
|
-
*/
|
|
131
|
-
getText(options?: {
|
|
132
|
-
blockSeparator?: string;
|
|
133
|
-
textSerializers?: Record<string, TextSerializer>;
|
|
134
|
-
}): string;
|
|
135
|
-
/**
|
|
136
|
-
* Check if there is no content.
|
|
137
|
-
*/
|
|
138
|
-
get isEmpty(): boolean;
|
|
139
|
-
/**
|
|
140
|
-
* Get the number of characters for the current document.
|
|
141
|
-
*
|
|
142
|
-
* @deprecated
|
|
143
|
-
*/
|
|
144
|
-
getCharacterCount(): number;
|
|
145
|
-
/**
|
|
146
|
-
* Destroy the editor.
|
|
147
|
-
*/
|
|
148
|
-
destroy(): void;
|
|
149
|
-
/**
|
|
150
|
-
* Check if the editor is already destroyed.
|
|
151
|
-
*/
|
|
152
|
-
get isDestroyed(): boolean;
|
|
153
|
-
$node(selector: string, attributes?: {
|
|
154
|
-
[key: string]: any;
|
|
155
|
-
}): NodePos | null;
|
|
156
|
-
$nodes(selector: string, attributes?: {
|
|
157
|
-
[key: string]: any;
|
|
158
|
-
}): NodePos[] | null;
|
|
159
|
-
$pos(pos: number): NodePos;
|
|
160
|
-
get $doc(): NodePos;
|
|
161
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
type StringKeyOf<T> = Extract<keyof T, string>;
|
|
2
|
-
type CallbackType<T extends Record<string, any>, EventName extends StringKeyOf<T>> = T[EventName] extends any[] ? T[EventName] : [T[EventName]];
|
|
3
|
-
type CallbackFunction<T extends Record<string, any>, EventName extends StringKeyOf<T>> = (...props: CallbackType<T, EventName>) => any;
|
|
4
|
-
export declare class EventEmitter<T extends Record<string, any>> {
|
|
5
|
-
private callbacks;
|
|
6
|
-
on<EventName extends StringKeyOf<T>>(event: EventName, fn: CallbackFunction<T, EventName>): this;
|
|
7
|
-
emit<EventName extends StringKeyOf<T>>(event: EventName, ...args: CallbackType<T, EventName>): this;
|
|
8
|
-
off<EventName extends StringKeyOf<T>>(event: EventName, fn?: CallbackFunction<T, EventName>): this;
|
|
9
|
-
removeAllListeners(): void;
|
|
10
|
-
}
|
|
11
|
-
export {};
|