@tiptap/extension-bullet-list
Advanced tools
Comparing version 2.0.0-beta.213 to 2.0.0-beta.214
@@ -1,52 +0,47 @@ | ||
// src/bullet-list.ts | ||
import { mergeAttributes, Node, wrappingInputRule } from "@tiptap/core"; | ||
var inputRegex = /^\s*([-+*])\s$/; | ||
var BulletList = Node.create({ | ||
name: "bulletList", | ||
addOptions() { | ||
return { | ||
itemTypeName: "listItem", | ||
HTMLAttributes: {} | ||
}; | ||
}, | ||
group: "block list", | ||
content() { | ||
return `${this.options.itemTypeName}+`; | ||
}, | ||
parseHTML() { | ||
return [ | ||
{ tag: "ul" } | ||
]; | ||
}, | ||
renderHTML({ HTMLAttributes }) { | ||
return ["ul", mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0]; | ||
}, | ||
addCommands() { | ||
return { | ||
toggleBulletList: () => ({ commands }) => { | ||
return commands.toggleList(this.name, this.options.itemTypeName); | ||
} | ||
}; | ||
}, | ||
addKeyboardShortcuts() { | ||
return { | ||
"Mod-Shift-8": () => this.editor.commands.toggleBulletList() | ||
}; | ||
}, | ||
addInputRules() { | ||
return [ | ||
wrappingInputRule({ | ||
find: inputRegex, | ||
type: this.type | ||
}) | ||
]; | ||
} | ||
import { Node, mergeAttributes, wrappingInputRule } from '@tiptap/core'; | ||
const inputRegex = /^\s*([-+*])\s$/; | ||
const BulletList = Node.create({ | ||
name: 'bulletList', | ||
addOptions() { | ||
return { | ||
itemTypeName: 'listItem', | ||
HTMLAttributes: {}, | ||
}; | ||
}, | ||
group: 'block list', | ||
content() { | ||
return `${this.options.itemTypeName}+`; | ||
}, | ||
parseHTML() { | ||
return [ | ||
{ tag: 'ul' }, | ||
]; | ||
}, | ||
renderHTML({ HTMLAttributes }) { | ||
return ['ul', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0]; | ||
}, | ||
addCommands() { | ||
return { | ||
toggleBulletList: () => ({ commands }) => { | ||
return commands.toggleList(this.name, this.options.itemTypeName); | ||
}, | ||
}; | ||
}, | ||
addKeyboardShortcuts() { | ||
return { | ||
'Mod-Shift-8': () => this.editor.commands.toggleBulletList(), | ||
}; | ||
}, | ||
addInputRules() { | ||
return [ | ||
wrappingInputRule({ | ||
find: inputRegex, | ||
type: this.type, | ||
}), | ||
]; | ||
}, | ||
}); | ||
// src/index.ts | ||
var src_default = BulletList; | ||
export { | ||
BulletList, | ||
src_default as default, | ||
inputRegex | ||
}; | ||
export { BulletList, BulletList as default, inputRegex }; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@tiptap/extension-bullet-list", | ||
"description": "bullet list 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-bullet-list/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-bullet-list/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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15986
12
227