@tiptap/extension-paragraph 2.0.0-beta.21 → 2.0.0-beta.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/packages/extension-paragraph/src/index.d.ts +3 -0
- package/dist/packages/extension-paragraph/src/paragraph.d.ts +15 -0
- package/dist/tiptap-extension-paragraph.cjs.js +41 -0
- package/dist/tiptap-extension-paragraph.cjs.js.map +1 -0
- package/dist/tiptap-extension-paragraph.esm.js +36 -0
- package/dist/tiptap-extension-paragraph.esm.js.map +1 -0
- package/dist/tiptap-extension-paragraph.umd.js +45 -0
- package/dist/tiptap-extension-paragraph.umd.js.map +1 -0
- package/package.json +2 -2
- package/src/paragraph.ts +2 -2
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Node } from '@tiptap/core';
|
|
2
|
+
export interface ParagraphOptions {
|
|
3
|
+
HTMLAttributes: Record<string, any>;
|
|
4
|
+
}
|
|
5
|
+
declare module '@tiptap/core' {
|
|
6
|
+
interface Commands<ReturnType> {
|
|
7
|
+
paragraph: {
|
|
8
|
+
/**
|
|
9
|
+
* Toggle a paragraph
|
|
10
|
+
*/
|
|
11
|
+
setParagraph: () => ReturnType;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
export declare const Paragraph: Node<ParagraphOptions, any>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var core = require('@tiptap/core');
|
|
6
|
+
|
|
7
|
+
const Paragraph = core.Node.create({
|
|
8
|
+
name: 'paragraph',
|
|
9
|
+
priority: 1000,
|
|
10
|
+
addOptions() {
|
|
11
|
+
return {
|
|
12
|
+
HTMLAttributes: {},
|
|
13
|
+
};
|
|
14
|
+
},
|
|
15
|
+
group: 'block',
|
|
16
|
+
content: 'inline*',
|
|
17
|
+
parseHTML() {
|
|
18
|
+
return [
|
|
19
|
+
{ tag: 'p' },
|
|
20
|
+
];
|
|
21
|
+
},
|
|
22
|
+
renderHTML({ HTMLAttributes }) {
|
|
23
|
+
return ['p', core.mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0];
|
|
24
|
+
},
|
|
25
|
+
addCommands() {
|
|
26
|
+
return {
|
|
27
|
+
setParagraph: () => ({ commands }) => {
|
|
28
|
+
return commands.setNode(this.name);
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
},
|
|
32
|
+
addKeyboardShortcuts() {
|
|
33
|
+
return {
|
|
34
|
+
'Mod-Alt-0': () => this.editor.commands.setParagraph(),
|
|
35
|
+
};
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
exports.Paragraph = Paragraph;
|
|
40
|
+
exports["default"] = Paragraph;
|
|
41
|
+
//# sourceMappingURL=tiptap-extension-paragraph.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tiptap-extension-paragraph.cjs.js","sources":["../src/paragraph.ts"],"sourcesContent":["import { mergeAttributes, Node } from '@tiptap/core'\n\nexport interface ParagraphOptions {\n HTMLAttributes: Record<string, any>,\n}\n\ndeclare module '@tiptap/core' {\n interface Commands<ReturnType> {\n paragraph: {\n /**\n * Toggle a paragraph\n */\n setParagraph: () => ReturnType,\n }\n }\n}\n\nexport const Paragraph = Node.create<ParagraphOptions>({\n name: 'paragraph',\n\n priority: 1000,\n\n addOptions() {\n return {\n HTMLAttributes: {},\n }\n },\n\n group: 'block',\n\n content: 'inline*',\n\n parseHTML() {\n return [\n { tag: 'p' },\n ]\n },\n\n renderHTML({ HTMLAttributes }) {\n return ['p', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0]\n },\n\n addCommands() {\n return {\n setParagraph: () => ({ commands }) => {\n return commands.setNode(this.name)\n },\n }\n },\n\n addKeyboardShortcuts() {\n return {\n 'Mod-Alt-0': () => this.editor.commands.setParagraph(),\n }\n },\n})\n"],"names":["Node","mergeAttributes"],"mappings":";;;;;;AAiBa,MAAA,SAAS,GAAGA,SAAI,CAAC,MAAM,CAAmB;AACrD,IAAA,IAAI,EAAE,WAAW;AAEjB,IAAA,QAAQ,EAAE,IAAI;IAEd,UAAU,GAAA;QACR,OAAO;AACL,YAAA,cAAc,EAAE,EAAE;SACnB,CAAA;KACF;AAED,IAAA,KAAK,EAAE,OAAO;AAEd,IAAA,OAAO,EAAE,SAAS;IAElB,SAAS,GAAA;QACP,OAAO;YACL,EAAE,GAAG,EAAE,GAAG,EAAE;SACb,CAAA;KACF;IAED,UAAU,CAAC,EAAE,cAAc,EAAE,EAAA;AAC3B,QAAA,OAAO,CAAC,GAAG,EAAEC,oBAAe,CAAC,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE,cAAc,CAAC,EAAE,CAAC,CAAC,CAAA;KAC9E;IAED,WAAW,GAAA;QACT,OAAO;YACL,YAAY,EAAE,MAAM,CAAC,EAAE,QAAQ,EAAE,KAAI;gBACnC,OAAO,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;aACnC;SACF,CAAA;KACF;IAED,oBAAoB,GAAA;QAClB,OAAO;YACL,WAAW,EAAE,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,YAAY,EAAE;SACvD,CAAA;KACF;AACF,CAAA;;;;;"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Node, mergeAttributes } from '@tiptap/core';
|
|
2
|
+
|
|
3
|
+
const Paragraph = Node.create({
|
|
4
|
+
name: 'paragraph',
|
|
5
|
+
priority: 1000,
|
|
6
|
+
addOptions() {
|
|
7
|
+
return {
|
|
8
|
+
HTMLAttributes: {},
|
|
9
|
+
};
|
|
10
|
+
},
|
|
11
|
+
group: 'block',
|
|
12
|
+
content: 'inline*',
|
|
13
|
+
parseHTML() {
|
|
14
|
+
return [
|
|
15
|
+
{ tag: 'p' },
|
|
16
|
+
];
|
|
17
|
+
},
|
|
18
|
+
renderHTML({ HTMLAttributes }) {
|
|
19
|
+
return ['p', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0];
|
|
20
|
+
},
|
|
21
|
+
addCommands() {
|
|
22
|
+
return {
|
|
23
|
+
setParagraph: () => ({ commands }) => {
|
|
24
|
+
return commands.setNode(this.name);
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
},
|
|
28
|
+
addKeyboardShortcuts() {
|
|
29
|
+
return {
|
|
30
|
+
'Mod-Alt-0': () => this.editor.commands.setParagraph(),
|
|
31
|
+
};
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
export { Paragraph, Paragraph as default };
|
|
36
|
+
//# sourceMappingURL=tiptap-extension-paragraph.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tiptap-extension-paragraph.esm.js","sources":["../src/paragraph.ts"],"sourcesContent":["import { mergeAttributes, Node } from '@tiptap/core'\n\nexport interface ParagraphOptions {\n HTMLAttributes: Record<string, any>,\n}\n\ndeclare module '@tiptap/core' {\n interface Commands<ReturnType> {\n paragraph: {\n /**\n * Toggle a paragraph\n */\n setParagraph: () => ReturnType,\n }\n }\n}\n\nexport const Paragraph = Node.create<ParagraphOptions>({\n name: 'paragraph',\n\n priority: 1000,\n\n addOptions() {\n return {\n HTMLAttributes: {},\n }\n },\n\n group: 'block',\n\n content: 'inline*',\n\n parseHTML() {\n return [\n { tag: 'p' },\n ]\n },\n\n renderHTML({ HTMLAttributes }) {\n return ['p', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0]\n },\n\n addCommands() {\n return {\n setParagraph: () => ({ commands }) => {\n return commands.setNode(this.name)\n },\n }\n },\n\n addKeyboardShortcuts() {\n return {\n 'Mod-Alt-0': () => this.editor.commands.setParagraph(),\n }\n },\n})\n"],"names":[],"mappings":";;AAiBa,MAAA,SAAS,GAAG,IAAI,CAAC,MAAM,CAAmB;AACrD,IAAA,IAAI,EAAE,WAAW;AAEjB,IAAA,QAAQ,EAAE,IAAI;IAEd,UAAU,GAAA;QACR,OAAO;AACL,YAAA,cAAc,EAAE,EAAE;SACnB,CAAA;KACF;AAED,IAAA,KAAK,EAAE,OAAO;AAEd,IAAA,OAAO,EAAE,SAAS;IAElB,SAAS,GAAA;QACP,OAAO;YACL,EAAE,GAAG,EAAE,GAAG,EAAE;SACb,CAAA;KACF;IAED,UAAU,CAAC,EAAE,cAAc,EAAE,EAAA;AAC3B,QAAA,OAAO,CAAC,GAAG,EAAE,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE,cAAc,CAAC,EAAE,CAAC,CAAC,CAAA;KAC9E;IAED,WAAW,GAAA;QACT,OAAO;YACL,YAAY,EAAE,MAAM,CAAC,EAAE,QAAQ,EAAE,KAAI;gBACnC,OAAO,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;aACnC;SACF,CAAA;KACF;IAED,oBAAoB,GAAA;QAClB,OAAO;YACL,WAAW,EAAE,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,YAAY,EAAE;SACvD,CAAA;KACF;AACF,CAAA;;;;"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
(function (global, factory) {
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@tiptap/core')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports', '@tiptap/core'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["@tiptap/extension-paragraph"] = {}, global.core));
|
|
5
|
+
})(this, (function (exports, core) { 'use strict';
|
|
6
|
+
|
|
7
|
+
const Paragraph = core.Node.create({
|
|
8
|
+
name: 'paragraph',
|
|
9
|
+
priority: 1000,
|
|
10
|
+
addOptions() {
|
|
11
|
+
return {
|
|
12
|
+
HTMLAttributes: {},
|
|
13
|
+
};
|
|
14
|
+
},
|
|
15
|
+
group: 'block',
|
|
16
|
+
content: 'inline*',
|
|
17
|
+
parseHTML() {
|
|
18
|
+
return [
|
|
19
|
+
{ tag: 'p' },
|
|
20
|
+
];
|
|
21
|
+
},
|
|
22
|
+
renderHTML({ HTMLAttributes }) {
|
|
23
|
+
return ['p', core.mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0];
|
|
24
|
+
},
|
|
25
|
+
addCommands() {
|
|
26
|
+
return {
|
|
27
|
+
setParagraph: () => ({ commands }) => {
|
|
28
|
+
return commands.setNode(this.name);
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
},
|
|
32
|
+
addKeyboardShortcuts() {
|
|
33
|
+
return {
|
|
34
|
+
'Mod-Alt-0': () => this.editor.commands.setParagraph(),
|
|
35
|
+
};
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
exports.Paragraph = Paragraph;
|
|
40
|
+
exports["default"] = Paragraph;
|
|
41
|
+
|
|
42
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
43
|
+
|
|
44
|
+
}));
|
|
45
|
+
//# sourceMappingURL=tiptap-extension-paragraph.umd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tiptap-extension-paragraph.umd.js","sources":["../src/paragraph.ts"],"sourcesContent":["import { mergeAttributes, Node } from '@tiptap/core'\n\nexport interface ParagraphOptions {\n HTMLAttributes: Record<string, any>,\n}\n\ndeclare module '@tiptap/core' {\n interface Commands<ReturnType> {\n paragraph: {\n /**\n * Toggle a paragraph\n */\n setParagraph: () => ReturnType,\n }\n }\n}\n\nexport const Paragraph = Node.create<ParagraphOptions>({\n name: 'paragraph',\n\n priority: 1000,\n\n addOptions() {\n return {\n HTMLAttributes: {},\n }\n },\n\n group: 'block',\n\n content: 'inline*',\n\n parseHTML() {\n return [\n { tag: 'p' },\n ]\n },\n\n renderHTML({ HTMLAttributes }) {\n return ['p', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0]\n },\n\n addCommands() {\n return {\n setParagraph: () => ({ commands }) => {\n return commands.setNode(this.name)\n },\n }\n },\n\n addKeyboardShortcuts() {\n return {\n 'Mod-Alt-0': () => this.editor.commands.setParagraph(),\n }\n },\n})\n"],"names":["Node","mergeAttributes"],"mappings":";;;;;;AAiBa,QAAA,SAAS,GAAGA,SAAI,CAAC,MAAM,CAAmB;EACrD,IAAA,IAAI,EAAE,WAAW;EAEjB,IAAA,QAAQ,EAAE,IAAI;MAEd,UAAU,GAAA;UACR,OAAO;EACL,YAAA,cAAc,EAAE,EAAE;WACnB,CAAA;OACF;EAED,IAAA,KAAK,EAAE,OAAO;EAEd,IAAA,OAAO,EAAE,SAAS;MAElB,SAAS,GAAA;UACP,OAAO;cACL,EAAE,GAAG,EAAE,GAAG,EAAE;WACb,CAAA;OACF;MAED,UAAU,CAAC,EAAE,cAAc,EAAE,EAAA;EAC3B,QAAA,OAAO,CAAC,GAAG,EAAEC,oBAAe,CAAC,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE,cAAc,CAAC,EAAE,CAAC,CAAC,CAAA;OAC9E;MAED,WAAW,GAAA;UACT,OAAO;cACL,YAAY,EAAE,MAAM,CAAC,EAAE,QAAQ,EAAE,KAAI;kBACnC,OAAO,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;eACnC;WACF,CAAA;OACF;MAED,oBAAoB,GAAA;UAClB,OAAO;cACL,WAAW,EAAE,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,YAAY,EAAE;WACvD,CAAA;OACF;EACF,CAAA;;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tiptap/extension-paragraph",
|
|
3
3
|
"description": "paragraph extension for tiptap",
|
|
4
|
-
"version": "2.0.0-beta.
|
|
4
|
+
"version": "2.0.0-beta.26",
|
|
5
5
|
"homepage": "https://tiptap.dev",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"tiptap",
|
|
@@ -28,5 +28,5 @@
|
|
|
28
28
|
"url": "https://github.com/ueberdosis/tiptap",
|
|
29
29
|
"directory": "packages/extension-paragraph"
|
|
30
30
|
},
|
|
31
|
-
"gitHead": "
|
|
31
|
+
"gitHead": "591c0807a2ab5c34b4b7fe12c12511fe4f493ebd"
|
|
32
32
|
}
|
package/src/paragraph.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { mergeAttributes, Node } from '@tiptap/core'
|
|
2
2
|
|
|
3
3
|
export interface ParagraphOptions {
|
|
4
4
|
HTMLAttributes: Record<string, any>,
|
|
@@ -43,7 +43,7 @@ export const Paragraph = Node.create<ParagraphOptions>({
|
|
|
43
43
|
addCommands() {
|
|
44
44
|
return {
|
|
45
45
|
setParagraph: () => ({ commands }) => {
|
|
46
|
-
return commands.setNode(
|
|
46
|
+
return commands.setNode(this.name)
|
|
47
47
|
},
|
|
48
48
|
}
|
|
49
49
|
},
|