@tiptap/core 3.0.0-next.3 → 3.0.0-next.5
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 +2627 -2651
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2423 -2688
- package/dist/index.d.ts +2423 -2688
- package/dist/index.js +2639 -2684
- package/dist/index.js.map +1 -1
- package/dist/jsx-runtime/jsx-runtime.cjs +56 -0
- package/dist/jsx-runtime/jsx-runtime.cjs.map +1 -0
- package/dist/jsx-runtime/jsx-runtime.d.cts +22 -0
- package/dist/jsx-runtime/jsx-runtime.d.ts +22 -0
- package/dist/jsx-runtime/jsx-runtime.js +26 -0
- package/dist/jsx-runtime/jsx-runtime.js.map +1 -0
- package/jsx-runtime/index.cjs +1 -0
- package/jsx-runtime/index.d.cts +1 -0
- package/jsx-runtime/index.d.ts +1 -0
- package/jsx-runtime/index.js +1 -0
- package/package.json +27 -6
- package/src/CommandManager.ts +2 -9
- package/src/Editor.ts +191 -94
- package/src/EventEmitter.ts +7 -10
- package/src/Extendable.ts +483 -0
- package/src/Extension.ts +5 -496
- package/src/ExtensionManager.ts +81 -135
- package/src/InputRule.ts +35 -48
- package/src/Mark.ts +135 -623
- package/src/MarkView.ts +66 -0
- package/src/Node.ts +325 -829
- package/src/NodePos.ts +1 -3
- package/src/NodeView.ts +10 -20
- package/src/PasteRule.ts +43 -55
- package/src/Tracker.ts +7 -9
- package/src/commands/blur.ts +14 -12
- package/src/commands/clearContent.ts +12 -5
- package/src/commands/clearNodes.ts +32 -30
- package/src/commands/command.ts +1 -1
- package/src/commands/createParagraphNear.ts +5 -3
- package/src/commands/cut.ts +12 -10
- package/src/commands/deleteCurrentNode.ts +23 -21
- package/src/commands/deleteNode.ts +18 -16
- package/src/commands/deleteRange.ts +10 -8
- package/src/commands/deleteSelection.ts +5 -3
- package/src/commands/enter.ts +6 -4
- package/src/commands/exitCode.ts +5 -3
- package/src/commands/extendMarkRange.ts +14 -12
- package/src/commands/first.ts +2 -4
- package/src/commands/focus.ts +51 -48
- package/src/commands/forEach.ts +2 -2
- package/src/commands/insertContent.ts +12 -14
- package/src/commands/insertContentAt.ts +105 -98
- package/src/commands/join.ts +20 -12
- package/src/commands/joinItemBackward.ts +16 -18
- package/src/commands/joinItemForward.ts +16 -18
- package/src/commands/joinTextblockBackward.ts +5 -3
- package/src/commands/joinTextblockForward.ts +5 -3
- package/src/commands/keyboardShortcut.ts +29 -34
- package/src/commands/lift.ts +10 -8
- package/src/commands/liftEmptyBlock.ts +6 -4
- package/src/commands/liftListItem.ts +6 -4
- package/src/commands/newlineInCode.ts +5 -3
- package/src/commands/resetAttributes.ts +36 -41
- package/src/commands/scrollIntoView.ts +9 -7
- package/src/commands/selectAll.ts +10 -8
- package/src/commands/selectNodeBackward.ts +5 -3
- package/src/commands/selectNodeForward.ts +5 -3
- package/src/commands/selectParentNode.ts +5 -3
- package/src/commands/selectTextblockEnd.ts +5 -3
- package/src/commands/selectTextblockStart.ts +5 -3
- package/src/commands/setContent.ts +37 -36
- package/src/commands/setMark.ts +55 -57
- package/src/commands/setMeta.ts +7 -5
- package/src/commands/setNode.ts +32 -30
- package/src/commands/setNodeSelection.ts +11 -9
- package/src/commands/setTextSelection.ts +15 -13
- package/src/commands/sinkListItem.ts +6 -4
- package/src/commands/splitBlock.ts +67 -76
- package/src/commands/splitListItem.ts +93 -106
- package/src/commands/toggleList.ts +73 -71
- package/src/commands/toggleMark.ts +11 -9
- package/src/commands/toggleNode.ts +18 -16
- package/src/commands/toggleWrap.ts +10 -8
- package/src/commands/undoInputRule.ts +31 -29
- package/src/commands/unsetAllMarks.ts +16 -14
- package/src/commands/unsetMark.ts +27 -25
- package/src/commands/updateAttributes.ts +92 -100
- package/src/commands/wrapIn.ts +6 -4
- package/src/commands/wrapInList.ts +6 -4
- package/src/extensions/clipboardTextSerializer.ts +2 -4
- package/src/extensions/delete.ts +89 -0
- package/src/extensions/focusEvents.ts +2 -6
- package/src/extensions/index.ts +1 -0
- package/src/extensions/keymap.ts +58 -50
- package/src/extensions/paste.ts +0 -1
- package/src/extensions/tabindex.ts +1 -1
- package/src/helpers/combineTransactionSteps.ts +1 -4
- package/src/helpers/createChainableState.ts +1 -4
- package/src/helpers/createDocument.ts +1 -3
- package/src/helpers/createNodeFromContent.ts +4 -10
- package/src/helpers/findChildrenInRange.ts +1 -5
- package/src/helpers/findParentNode.ts +3 -1
- package/src/helpers/flattenExtensions.ts +30 -0
- package/src/helpers/getAttributes.ts +1 -4
- package/src/helpers/getAttributesFromExtensions.ts +28 -37
- package/src/helpers/getChangedRanges.ts +13 -11
- package/src/helpers/getExtensionField.ts +11 -11
- package/src/helpers/getMarkAttributes.ts +1 -4
- package/src/helpers/getMarkRange.ts +5 -15
- package/src/helpers/getMarkType.ts +1 -3
- package/src/helpers/getNodeAttributes.ts +1 -4
- package/src/helpers/getNodeType.ts +1 -3
- package/src/helpers/getRenderedAttributes.ts +1 -3
- package/src/helpers/getSchema.ts +2 -2
- package/src/helpers/getSchemaByResolvedExtensions.ts +45 -77
- package/src/helpers/getSplittedAttributes.ts +4 -4
- package/src/helpers/getTextContentFromNodes.ts +8 -11
- package/src/helpers/index.ts +4 -0
- package/src/helpers/injectExtensionAttributesToParseRule.ts +1 -1
- package/src/helpers/isActive.ts +1 -5
- package/src/helpers/isExtensionRulesEnabled.ts +1 -3
- package/src/helpers/isNodeEmpty.ts +2 -2
- package/src/helpers/resolveExtensions.ts +25 -0
- package/src/helpers/resolveFocusPosition.ts +3 -14
- package/src/helpers/rewriteUnknownContent.ts +149 -0
- package/src/helpers/sortExtensions.ts +26 -0
- package/src/index.ts +3 -7
- package/src/inputRules/markInputRule.ts +1 -5
- package/src/inputRules/nodeInputRule.ts +2 -9
- package/src/inputRules/textInputRule.ts +1 -4
- package/src/inputRules/textblockTypeInputRule.ts +2 -8
- package/src/inputRules/wrappingInputRule.ts +13 -19
- package/src/jsx-runtime.ts +64 -0
- package/src/pasteRules/markPasteRule.ts +1 -3
- package/src/pasteRules/nodePasteRule.ts +2 -8
- package/src/pasteRules/textPasteRule.ts +1 -4
- package/src/types.ts +529 -174
- package/src/utilities/createStyleTag.ts +3 -1
- package/src/utilities/deleteProps.ts +7 -11
- package/src/utilities/elementFromString.ts +3 -0
- package/src/utilities/findDuplicates.ts +4 -1
- package/src/utilities/index.ts +1 -0
- package/src/utilities/isFunction.ts +1 -0
- package/src/utilities/isMacOS.ts +1 -3
- package/src/utilities/isiOS.ts +5 -10
- package/src/utilities/mergeAttributes.ts +17 -7
- package/src/utilities/removeDuplicates.ts +1 -3
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/jsx-runtime.ts
|
|
21
|
+
var jsx_runtime_exports = {};
|
|
22
|
+
__export(jsx_runtime_exports, {
|
|
23
|
+
Fragment: () => Fragment,
|
|
24
|
+
createElement: () => h,
|
|
25
|
+
h: () => h,
|
|
26
|
+
jsx: () => h,
|
|
27
|
+
jsxDEV: () => h,
|
|
28
|
+
jsxs: () => h
|
|
29
|
+
});
|
|
30
|
+
module.exports = __toCommonJS(jsx_runtime_exports);
|
|
31
|
+
function Fragment(props) {
|
|
32
|
+
return props.children;
|
|
33
|
+
}
|
|
34
|
+
var h = (tag, attributes) => {
|
|
35
|
+
if (tag === "slot") {
|
|
36
|
+
return 0;
|
|
37
|
+
}
|
|
38
|
+
if (tag instanceof Function) {
|
|
39
|
+
return tag(attributes);
|
|
40
|
+
}
|
|
41
|
+
const { children, ...rest } = attributes != null ? attributes : {};
|
|
42
|
+
if (tag === "svg") {
|
|
43
|
+
throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");
|
|
44
|
+
}
|
|
45
|
+
return [tag, rest, children];
|
|
46
|
+
};
|
|
47
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
48
|
+
0 && (module.exports = {
|
|
49
|
+
Fragment,
|
|
50
|
+
createElement,
|
|
51
|
+
h,
|
|
52
|
+
jsx,
|
|
53
|
+
jsxDEV,
|
|
54
|
+
jsxs
|
|
55
|
+
});
|
|
56
|
+
//# sourceMappingURL=jsx-runtime.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/jsx-runtime.ts"],"sourcesContent":["export type Attributes = Record<string, any>\n\nexport type DOMOutputSpecElement = 0 | Attributes | DOMOutputSpecArray\n/**\n * Better describes the output of a `renderHTML` function in prosemirror\n * @see https://prosemirror.net/docs/ref/#model.DOMOutputSpec\n */\nexport type DOMOutputSpecArray =\n | [string]\n | [string, Attributes]\n | [string, 0]\n | [string, Attributes, 0]\n | [string, Attributes, DOMOutputSpecArray | 0]\n | [string, DOMOutputSpecArray]\n\ndeclare global {\n // eslint-disable-next-line @typescript-eslint/no-namespace\n namespace JSX {\n // @ts-ignore - conflict with React typings\n type Element = [string, ...any[]]\n // @ts-ignore - conflict with React typings\n interface IntrinsicElements {\n // @ts-ignore - conflict with React typings\n [key: string]: any\n }\n }\n}\n\nexport type JSXRenderer = (\n tag: 'slot' | string | ((props?: Attributes) => DOMOutputSpecArray | DOMOutputSpecElement),\n props?: Attributes,\n ...children: JSXRenderer[]\n) => DOMOutputSpecArray | DOMOutputSpecElement\n\nexport function Fragment(props: { children: JSXRenderer[] }) {\n return props.children\n}\n\nexport const h: JSXRenderer = (tag, attributes) => {\n // Treat the slot tag as the Prosemirror hole to render content into\n if (tag === 'slot') {\n return 0\n }\n\n // If the tag is a function, call it with the props\n if (tag instanceof Function) {\n return tag(attributes)\n }\n\n const { children, ...rest } = attributes ?? {}\n\n if (tag === 'svg') {\n throw new Error('SVG elements are not supported in the JSX syntax, use the array syntax instead')\n }\n\n // Otherwise, return the tag, attributes, and children\n return [tag, rest, children]\n}\n\n// See\n// https://esbuild.github.io/api/#jsx-import-source\n// https://www.typescriptlang.org/tsconfig/#jsxImportSource\n\nexport { h as createElement, h as jsx, h as jsxDEV, h as jsxs }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAkCO,SAAS,SAAS,OAAoC;AAC3D,SAAO,MAAM;AACf;AAEO,IAAM,IAAiB,CAAC,KAAK,eAAe;AAEjD,MAAI,QAAQ,QAAQ;AAClB,WAAO;AAAA,EACT;AAGA,MAAI,eAAe,UAAU;AAC3B,WAAO,IAAI,UAAU;AAAA,EACvB;AAEA,QAAM,EAAE,UAAU,GAAG,KAAK,IAAI,kCAAc,CAAC;AAE7C,MAAI,QAAQ,OAAO;AACjB,UAAM,IAAI,MAAM,gFAAgF;AAAA,EAClG;AAGA,SAAO,CAAC,KAAK,MAAM,QAAQ;AAC7B;","names":[]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
type Attributes = Record<string, any>;
|
|
2
|
+
type DOMOutputSpecElement = 0 | Attributes | DOMOutputSpecArray;
|
|
3
|
+
/**
|
|
4
|
+
* Better describes the output of a `renderHTML` function in prosemirror
|
|
5
|
+
* @see https://prosemirror.net/docs/ref/#model.DOMOutputSpec
|
|
6
|
+
*/
|
|
7
|
+
type DOMOutputSpecArray = [string] | [string, Attributes] | [string, 0] | [string, Attributes, 0] | [string, Attributes, DOMOutputSpecArray | 0] | [string, DOMOutputSpecArray];
|
|
8
|
+
declare global {
|
|
9
|
+
namespace JSX {
|
|
10
|
+
type Element = [string, ...any[]];
|
|
11
|
+
interface IntrinsicElements {
|
|
12
|
+
[key: string]: any;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
type JSXRenderer = (tag: 'slot' | string | ((props?: Attributes) => DOMOutputSpecArray | DOMOutputSpecElement), props?: Attributes, ...children: JSXRenderer[]) => DOMOutputSpecArray | DOMOutputSpecElement;
|
|
17
|
+
declare function Fragment(props: {
|
|
18
|
+
children: JSXRenderer[];
|
|
19
|
+
}): JSXRenderer[];
|
|
20
|
+
declare const h: JSXRenderer;
|
|
21
|
+
|
|
22
|
+
export { type Attributes, type DOMOutputSpecArray, type DOMOutputSpecElement, Fragment, type JSXRenderer, h as createElement, h, h as jsx, h as jsxDEV, h as jsxs };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
type Attributes = Record<string, any>;
|
|
2
|
+
type DOMOutputSpecElement = 0 | Attributes | DOMOutputSpecArray;
|
|
3
|
+
/**
|
|
4
|
+
* Better describes the output of a `renderHTML` function in prosemirror
|
|
5
|
+
* @see https://prosemirror.net/docs/ref/#model.DOMOutputSpec
|
|
6
|
+
*/
|
|
7
|
+
type DOMOutputSpecArray = [string] | [string, Attributes] | [string, 0] | [string, Attributes, 0] | [string, Attributes, DOMOutputSpecArray | 0] | [string, DOMOutputSpecArray];
|
|
8
|
+
declare global {
|
|
9
|
+
namespace JSX {
|
|
10
|
+
type Element = [string, ...any[]];
|
|
11
|
+
interface IntrinsicElements {
|
|
12
|
+
[key: string]: any;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
type JSXRenderer = (tag: 'slot' | string | ((props?: Attributes) => DOMOutputSpecArray | DOMOutputSpecElement), props?: Attributes, ...children: JSXRenderer[]) => DOMOutputSpecArray | DOMOutputSpecElement;
|
|
17
|
+
declare function Fragment(props: {
|
|
18
|
+
children: JSXRenderer[];
|
|
19
|
+
}): JSXRenderer[];
|
|
20
|
+
declare const h: JSXRenderer;
|
|
21
|
+
|
|
22
|
+
export { type Attributes, type DOMOutputSpecArray, type DOMOutputSpecElement, Fragment, type JSXRenderer, h as createElement, h, h as jsx, h as jsxDEV, h as jsxs };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// src/jsx-runtime.ts
|
|
2
|
+
function Fragment(props) {
|
|
3
|
+
return props.children;
|
|
4
|
+
}
|
|
5
|
+
var h = (tag, attributes) => {
|
|
6
|
+
if (tag === "slot") {
|
|
7
|
+
return 0;
|
|
8
|
+
}
|
|
9
|
+
if (tag instanceof Function) {
|
|
10
|
+
return tag(attributes);
|
|
11
|
+
}
|
|
12
|
+
const { children, ...rest } = attributes != null ? attributes : {};
|
|
13
|
+
if (tag === "svg") {
|
|
14
|
+
throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");
|
|
15
|
+
}
|
|
16
|
+
return [tag, rest, children];
|
|
17
|
+
};
|
|
18
|
+
export {
|
|
19
|
+
Fragment,
|
|
20
|
+
h as createElement,
|
|
21
|
+
h,
|
|
22
|
+
h as jsx,
|
|
23
|
+
h as jsxDEV,
|
|
24
|
+
h as jsxs
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=jsx-runtime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/jsx-runtime.ts"],"sourcesContent":["export type Attributes = Record<string, any>\n\nexport type DOMOutputSpecElement = 0 | Attributes | DOMOutputSpecArray\n/**\n * Better describes the output of a `renderHTML` function in prosemirror\n * @see https://prosemirror.net/docs/ref/#model.DOMOutputSpec\n */\nexport type DOMOutputSpecArray =\n | [string]\n | [string, Attributes]\n | [string, 0]\n | [string, Attributes, 0]\n | [string, Attributes, DOMOutputSpecArray | 0]\n | [string, DOMOutputSpecArray]\n\ndeclare global {\n // eslint-disable-next-line @typescript-eslint/no-namespace\n namespace JSX {\n // @ts-ignore - conflict with React typings\n type Element = [string, ...any[]]\n // @ts-ignore - conflict with React typings\n interface IntrinsicElements {\n // @ts-ignore - conflict with React typings\n [key: string]: any\n }\n }\n}\n\nexport type JSXRenderer = (\n tag: 'slot' | string | ((props?: Attributes) => DOMOutputSpecArray | DOMOutputSpecElement),\n props?: Attributes,\n ...children: JSXRenderer[]\n) => DOMOutputSpecArray | DOMOutputSpecElement\n\nexport function Fragment(props: { children: JSXRenderer[] }) {\n return props.children\n}\n\nexport const h: JSXRenderer = (tag, attributes) => {\n // Treat the slot tag as the Prosemirror hole to render content into\n if (tag === 'slot') {\n return 0\n }\n\n // If the tag is a function, call it with the props\n if (tag instanceof Function) {\n return tag(attributes)\n }\n\n const { children, ...rest } = attributes ?? {}\n\n if (tag === 'svg') {\n throw new Error('SVG elements are not supported in the JSX syntax, use the array syntax instead')\n }\n\n // Otherwise, return the tag, attributes, and children\n return [tag, rest, children]\n}\n\n// See\n// https://esbuild.github.io/api/#jsx-import-source\n// https://www.typescriptlang.org/tsconfig/#jsxImportSource\n\nexport { h as createElement, h as jsx, h as jsxDEV, h as jsxs }\n"],"mappings":";AAkCO,SAAS,SAAS,OAAoC;AAC3D,SAAO,MAAM;AACf;AAEO,IAAM,IAAiB,CAAC,KAAK,eAAe;AAEjD,MAAI,QAAQ,QAAQ;AAClB,WAAO;AAAA,EACT;AAGA,MAAI,eAAe,UAAU;AAC3B,WAAO,IAAI,UAAU;AAAA,EACvB;AAEA,QAAM,EAAE,UAAU,GAAG,KAAK,IAAI,kCAAc,CAAC;AAE7C,MAAI,QAAQ,OAAO;AACjB,UAAM,IAAI,MAAM,gFAAgF;AAAA,EAClG;AAGA,SAAO,CAAC,KAAK,MAAM,QAAQ;AAC7B;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../dist/jsx-runtime/jsx-runtime.cjs'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../src/jsx-runtime.ts'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type * from '../src/jsx-runtime.ts'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../dist/jsx-runtime/jsx-runtime.js'
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tiptap/core",
|
|
3
3
|
"description": "headless rich text editor",
|
|
4
|
-
"version": "3.0.0-next.
|
|
4
|
+
"version": "3.0.0-next.5",
|
|
5
5
|
"homepage": "https://tiptap.dev",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"tiptap",
|
|
@@ -18,9 +18,28 @@
|
|
|
18
18
|
"type": "module",
|
|
19
19
|
"exports": {
|
|
20
20
|
".": {
|
|
21
|
-
"types":
|
|
21
|
+
"types": {
|
|
22
|
+
"import": "./dist/index.d.ts",
|
|
23
|
+
"require": "./dist/index.d.cts"
|
|
24
|
+
},
|
|
22
25
|
"import": "./dist/index.js",
|
|
23
26
|
"require": "./dist/index.cjs"
|
|
27
|
+
},
|
|
28
|
+
"./jsx-runtime": {
|
|
29
|
+
"types": {
|
|
30
|
+
"import": "./jsx-runtime/index.d.ts",
|
|
31
|
+
"require": "./jsx-runtime/index.d.cts"
|
|
32
|
+
},
|
|
33
|
+
"import": "./jsx-runtime/index.js",
|
|
34
|
+
"require": "./jsx-runtime/index.cjs"
|
|
35
|
+
},
|
|
36
|
+
"./jsx-dev-runtime": {
|
|
37
|
+
"types": {
|
|
38
|
+
"import": "./jsx-dev-runtime/index.d.ts",
|
|
39
|
+
"require": "./jsx-dev-runtime/index.d.cts"
|
|
40
|
+
},
|
|
41
|
+
"import": "./jsx-dev-runtime/index.js",
|
|
42
|
+
"require": "./jsx-dev-runtime/index.cjs"
|
|
24
43
|
}
|
|
25
44
|
},
|
|
26
45
|
"main": "dist/index.cjs",
|
|
@@ -28,10 +47,11 @@
|
|
|
28
47
|
"types": "dist/index.d.ts",
|
|
29
48
|
"files": [
|
|
30
49
|
"src",
|
|
31
|
-
"dist"
|
|
50
|
+
"dist",
|
|
51
|
+
"jsx-runtime"
|
|
32
52
|
],
|
|
33
53
|
"devDependencies": {
|
|
34
|
-
"@tiptap/pm": "^3.0.0-next.
|
|
54
|
+
"@tiptap/pm": "^3.0.0-next.5"
|
|
35
55
|
},
|
|
36
56
|
"peerDependencies": {
|
|
37
57
|
"@tiptap/pm": "^3.0.0-next.1"
|
|
@@ -43,6 +63,7 @@
|
|
|
43
63
|
},
|
|
44
64
|
"sideEffects": false,
|
|
45
65
|
"scripts": {
|
|
46
|
-
"build": "tsup"
|
|
66
|
+
"build": "tsup",
|
|
67
|
+
"lint": "prettier ./src/ --check && eslint --cache --quiet --no-error-on-unmatched-pattern ./src/"
|
|
47
68
|
}
|
|
48
|
-
}
|
|
69
|
+
}
|
package/src/CommandManager.ts
CHANGED
|
@@ -2,9 +2,7 @@ import { EditorState, Transaction } from '@tiptap/pm/state'
|
|
|
2
2
|
|
|
3
3
|
import { Editor } from './Editor.js'
|
|
4
4
|
import { createChainableState } from './helpers/createChainableState.js'
|
|
5
|
-
import {
|
|
6
|
-
AnyCommands, CanCommands, ChainedCommands, CommandProps, SingleCommands,
|
|
7
|
-
} from './types.js'
|
|
5
|
+
import { AnyCommands, CanCommands, ChainedCommands, CommandProps, SingleCommands } from './types.js'
|
|
8
6
|
|
|
9
7
|
export class CommandManager {
|
|
10
8
|
editor: Editor
|
|
@@ -66,12 +64,7 @@ export class CommandManager {
|
|
|
66
64
|
const tr = startTr || state.tr
|
|
67
65
|
|
|
68
66
|
const run = () => {
|
|
69
|
-
if (
|
|
70
|
-
!hasStartTransaction
|
|
71
|
-
&& shouldDispatch
|
|
72
|
-
&& !tr.getMeta('preventDispatch')
|
|
73
|
-
&& !this.hasCustomState
|
|
74
|
-
) {
|
|
67
|
+
if (!hasStartTransaction && shouldDispatch && !tr.getMeta('preventDispatch') && !this.hasCustomState) {
|
|
75
68
|
view.dispatch(tr)
|
|
76
69
|
}
|
|
77
70
|
|