@tiptap/extension-paragraph
Advanced tools
Comparing version 2.0.0-beta.213 to 2.0.0-beta.214
@@ -1,40 +0,36 @@ | ||
// src/paragraph.ts | ||
import { mergeAttributes, Node } from "@tiptap/core"; | ||
var Paragraph = Node.create({ | ||
name: "paragraph", | ||
priority: 1e3, | ||
addOptions() { | ||
return { | ||
HTMLAttributes: {} | ||
}; | ||
}, | ||
group: "block", | ||
content: "inline*", | ||
parseHTML() { | ||
return [ | ||
{ tag: "p" } | ||
]; | ||
}, | ||
renderHTML({ HTMLAttributes }) { | ||
return ["p", mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0]; | ||
}, | ||
addCommands() { | ||
return { | ||
setParagraph: () => ({ commands }) => { | ||
return commands.setNode(this.name); | ||
} | ||
}; | ||
}, | ||
addKeyboardShortcuts() { | ||
return { | ||
"Mod-Alt-0": () => this.editor.commands.setParagraph() | ||
}; | ||
} | ||
import { Node, mergeAttributes } from '@tiptap/core'; | ||
const Paragraph = Node.create({ | ||
name: 'paragraph', | ||
priority: 1000, | ||
addOptions() { | ||
return { | ||
HTMLAttributes: {}, | ||
}; | ||
}, | ||
group: 'block', | ||
content: 'inline*', | ||
parseHTML() { | ||
return [ | ||
{ tag: 'p' }, | ||
]; | ||
}, | ||
renderHTML({ HTMLAttributes }) { | ||
return ['p', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0]; | ||
}, | ||
addCommands() { | ||
return { | ||
setParagraph: () => ({ commands }) => { | ||
return commands.setNode(this.name); | ||
}, | ||
}; | ||
}, | ||
addKeyboardShortcuts() { | ||
return { | ||
'Mod-Alt-0': () => this.editor.commands.setParagraph(), | ||
}; | ||
}, | ||
}); | ||
// src/index.ts | ||
var src_default = Paragraph; | ||
export { | ||
Paragraph, | ||
src_default as default | ||
}; | ||
export { Paragraph, Paragraph as default }; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@tiptap/extension-paragraph", | ||
"description": "paragraph extension for tiptap", | ||
"version": "2.0.0-beta.213", | ||
"version": "2.0.0-beta.214", | ||
"homepage": "https://tiptap.dev", | ||
@@ -18,3 +18,3 @@ "keywords": [ | ||
".": { | ||
"types": "./dist/index.d.ts", | ||
"types": "./dist/packages/extension-paragraph/src/index.d.ts", | ||
"import": "./dist/index.js", | ||
@@ -26,3 +26,4 @@ "require": "./dist/index.cjs" | ||
"module": "dist/index.js", | ||
"types": "dist/index.d.ts", | ||
"umd": "dist/index.umd.js", | ||
"types": "dist/packages/extension-paragraph/src/index.d.ts", | ||
"files": [ | ||
@@ -36,3 +37,3 @@ "src", | ||
"devDependencies": { | ||
"@tiptap/core": "^2.0.0-beta.213" | ||
"@tiptap/core": "^2.0.0-beta.214" | ||
}, | ||
@@ -45,15 +46,5 @@ "repository": { | ||
"scripts": { | ||
"build": "tsup" | ||
}, | ||
"tsup": { | ||
"entry": [ | ||
"src/index.ts" | ||
], | ||
"dts": true, | ||
"splitting": true, | ||
"format": [ | ||
"esm", | ||
"cjs" | ||
] | ||
"clean": "rm -rf dist", | ||
"build": "npm run clean && rollup -c" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
12562
12
178