Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@tiptap/extension-ordered-list

Package Overview
Dependencies
Maintainers
2
Versions
170
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tiptap/extension-ordered-list - npm Package Compare versions

Comparing version 2.0.0-alpha.4 to 2.0.0-alpha.5

dist/packages/extension-ordered-list/src/ordered-list.d.ts

8

CHANGELOG.md

@@ -6,2 +6,10 @@ # Change Log

# [2.0.0-alpha.5](https://github.com/ueberdosis/tiptap-next/compare/@tiptap/extension-ordered-list@2.0.0-alpha.4...@tiptap/extension-ordered-list@2.0.0-alpha.5) (2020-12-18)
**Note:** Version bump only for package @tiptap/extension-ordered-list
# [2.0.0-alpha.4](https://github.com/ueberdosis/tiptap-next/compare/@tiptap/extension-ordered-list@2.0.0-alpha.3...@tiptap/extension-ordered-list@2.0.0-alpha.4) (2020-12-02)

@@ -8,0 +16,0 @@

20

dist/packages/extension-ordered-list/src/index.d.ts

@@ -1,19 +0,3 @@

import { Command, Node } from '@tiptap/core';
export interface OrderedListOptions {
HTMLAttributes: {
[key: string]: any;
};
}
export declare const inputRegex: RegExp;
declare const OrderedList: Node<OrderedListOptions, {
/**
* Toggle an ordered list
*/
toggleOrderedList: () => Command;
}>;
import { OrderedList } from './ordered-list';
export * from './ordered-list';
export default OrderedList;
declare module '@tiptap/core' {
interface AllExtensions {
OrderedList: typeof OrderedList;
}
}

@@ -63,4 +63,5 @@ 'use strict';

exports.OrderedList = OrderedList;
exports.default = OrderedList;
exports.inputRegex = inputRegex;
//# sourceMappingURL=tiptap-extension-ordered-list.cjs.js.map

@@ -60,3 +60,3 @@ import { Node, mergeAttributes } from '@tiptap/core';

export default OrderedList;
export { inputRegex };
export { OrderedList, inputRegex };
//# sourceMappingURL=tiptap-extension-ordered-list.esm.js.map

@@ -62,2 +62,3 @@ (function (global, factory) {

exports.OrderedList = OrderedList;
exports.default = OrderedList;

@@ -64,0 +65,0 @@ exports.inputRegex = inputRegex;

{
"name": "@tiptap/extension-ordered-list",
"description": "ordered list extension for tiptap",
"version": "2.0.0-alpha.4",
"version": "2.0.0-alpha.5",
"homepage": "https://tiptap.dev",

@@ -30,3 +30,3 @@ "keywords": [

},
"gitHead": "a884cb81de8783d0097741c1ddb97a82ea88ae0e"
"gitHead": "0371cb0a5d803a44d93532aa34419ec7ffffdc24"
}

@@ -1,87 +0,5 @@

import { Command, Node, mergeAttributes } from '@tiptap/core'
import { wrappingInputRule } from 'prosemirror-inputrules'
import { OrderedList } from './ordered-list'
export interface OrderedListOptions {
HTMLAttributes: {
[key: string]: any
},
}
export * from './ordered-list'
export const inputRegex = /^(\d+)\.\s$/
const OrderedList = Node.create({
name: 'orderedList',
defaultOptions: <OrderedListOptions>{
HTMLAttributes: {},
},
group: 'block list',
content: 'listItem+',
addAttributes() {
return {
start: {
default: 1,
parseHTML: element => ({
start: element.hasAttribute('start')
? parseInt(element.getAttribute('start') || '', 10)
: 1,
}),
},
}
},
parseHTML() {
return [
{
tag: 'ol',
},
]
},
renderHTML({ HTMLAttributes }) {
const { start, ...attributesWithoutStart } = HTMLAttributes
return start === 1
? ['ol', mergeAttributes(this.options.HTMLAttributes, attributesWithoutStart), 0]
: ['ol', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0]
},
addCommands() {
return {
/**
* Toggle an ordered list
*/
toggleOrderedList: (): Command => ({ commands }) => {
return commands.toggleList('orderedList', 'listItem')
},
}
},
addKeyboardShortcuts() {
return {
'Mod-Shift-7': () => this.editor.commands.toggleOrderedList(),
}
},
addInputRules() {
return [
wrappingInputRule(
inputRegex,
this.type,
match => ({ order: +match[1] }),
(match, node) => node.childCount + node.attrs.order === +match[1],
),
]
},
})
export default OrderedList
declare module '@tiptap/core' {
interface AllExtensions {
OrderedList: typeof OrderedList,
}
}

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc