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

@milkdown/preset-gfm

Package Overview
Dependencies
Maintainers
1
Versions
108
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@milkdown/preset-gfm - npm Package Compare versions

Comparing version 4.14.2 to 5.0.0

2

lib/auto-link.d.ts

@@ -1,2 +0,2 @@

export declare const urlPlugin: import("@milkdown/core").MilkdownPlugin;
export declare const urlPlugin: import("@milkdown/utils/src/types").AddMetadata<(options?: Partial<import("@milkdown/utils").CommonOptions<string, import("@milkdown/utils/src/types").UnknownRecord>> | undefined) => import("@milkdown/core").MilkdownPlugin>;
//# sourceMappingURL=auto-link.d.ts.map
/* Copyright 2021, Milkdown by Mirone. */
import { prosePluginFactory } from '@milkdown/core';
import { InputRule, inputRules } from '@milkdown/prose';
import { createPlugin } from '@milkdown/utils';
const urlRegex = /(https?:\/\/)?www\.[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z]{2,}\b(?:[-a-zA-Z0-9@:%._+~#=?!&/]*)(?:[-a-zA-Z0-9@:%._+~#=?!&/]*)$/;

@@ -18,3 +18,3 @@ const proseUrlPlugin = () => inputRules({

});
export const urlPlugin = prosePluginFactory(proseUrlPlugin());
export const urlPlugin = createPlugin(() => ({ prosePlugins: () => [proseUrlPlugin()] }));
//# sourceMappingURL=auto-link.js.map

@@ -5,9 +5,7 @@ import { AtomList } from '@milkdown/utils';

export * from './task-list-item';
export { BreakTable, createTable, InsertTable, NextCell, PrevCell, table, tableNodes, tablePlugins, } from '@milkdown/plugin-table';
export { BreakTable, createTable, InsertTable, NextCell, PrevCell, table, tablePlugin, } from '@milkdown/plugin-table';
export { blockquote, bulletList, codeFence, codeInline, commonmark, commonmarkNodes, commonmarkPlugins, doc, em, hardbreak, heading, hr, image, InsertHardbreak, InsertHr, InsertImage, LiftListItem, link, listItem, ModifyImage, ModifyLink, orderedList, paragraph, SinkListItem, SplitListItem, strong, text, ToggleBold, ToggleInlineCode, ToggleItalic, ToggleLink, TurnIntoCodeFence, TurnIntoHeading, TurnIntoText, WrapInBlockquote, WrapInBulletList, WrapInOrderedList, } from '@milkdown/preset-commonmark';
export declare const gfmNodes: AtomList<import("@milkdown/utils/lib/types").PluginWithMetadata<string, import("@milkdown/preset-commonmark").ImageOptions, import("@milkdown/core").Node> | import("@milkdown/utils/lib/types").PluginWithMetadata<"CodeFence", {
export declare const gfm: AtomList<(import("@milkdown/utils/src/types").Metadata<(options?: Partial<import("@milkdown/utils").CommonOptions<"CodeFence", {
languageList?: string[] | undefined;
}, import("@milkdown/core").Node>>;
export declare const gfmPlugins: AtomList<import("@milkdown/core").MilkdownPlugin>;
export declare const gfm: AtomList<import("@milkdown/core").MilkdownPlugin>;
}>> | undefined) => import("@milkdown/core").MilkdownPlugin> & import("@milkdown/core").MilkdownPlugin) | (import("@milkdown/utils/src/types").Metadata<(options?: Partial<import("@milkdown/utils").CommonOptions<string, import("@milkdown/preset-commonmark").ImageOptions>> | undefined) => import("@milkdown/core").MilkdownPlugin> & import("@milkdown/core").MilkdownPlugin)>;
export declare const commands: {

@@ -14,0 +12,0 @@ readonly ToggleStrikeThrough: import("@milkdown/core").CmdKey<undefined>;

/* Copyright 2021, Milkdown by Mirone. */
import { tableNodes, tablePlugins } from '@milkdown/plugin-table';
import { commands as commonmarkCommands, commonmarkNodes, commonmarkPlugins } from '@milkdown/preset-commonmark';
import { tablePlugin } from '@milkdown/plugin-table';
import { commands as commonmarkCommands, commonmark } from '@milkdown/preset-commonmark';
import { AtomList } from '@milkdown/utils';

@@ -15,3 +15,3 @@ import { urlPlugin } from './auto-link';

// gather
table, tableNodes, tablePlugins, } from '@milkdown/plugin-table';
table, tablePlugin, } from '@milkdown/plugin-table';
export { blockquote, bulletList, codeFence, codeInline, commonmark,

@@ -24,5 +24,3 @@ // gather

InsertHardbreak, InsertHr, InsertImage, LiftListItem, link, listItem, ModifyImage, ModifyLink, orderedList, paragraph, SinkListItem, SplitListItem, strong, text, ToggleBold, ToggleInlineCode, ToggleItalic, ToggleLink, TurnIntoCodeFence, TurnIntoHeading, TurnIntoText, WrapInBlockquote, WrapInBulletList, WrapInOrderedList, } from '@milkdown/preset-commonmark';
export const gfmNodes = AtomList.create([...commonmarkNodes, ...tableNodes, strikeThrough(), taskListItem()]);
export const gfmPlugins = AtomList.create([...tablePlugins, ...commonmarkPlugins, urlPlugin]);
export const gfm = AtomList.create([...gfmNodes, ...gfmPlugins]);
export const gfm = AtomList.create([...commonmark, tablePlugin(), urlPlugin(), strikeThrough(), taskListItem()]);
export const commands = Object.assign(Object.assign({}, commonmarkCommands), { ToggleStrikeThrough,

@@ -29,0 +27,0 @@ TurnIntoTaskList,

export declare const ToggleStrikeThrough: import("@milkdown/core").CmdKey<undefined>;
export declare const strikeThrough: import("@milkdown/utils/lib/types").Origin<"StrikeThrough", import("@milkdown/utils/lib/types").UnknownRecord, import("@milkdown/core").Mark>;
export declare const strikeThrough: import("@milkdown/utils/src/types").AddMetadata<(options?: Partial<import("@milkdown/utils/src/types").UnknownRecord> | undefined) => import("@milkdown/core").MilkdownPlugin>;
//# sourceMappingURL=strike-through.d.ts.map

@@ -8,3 +8,3 @@ /* Copyright 2021, Milkdown by Mirone. */

export const ToggleStrikeThrough = createCmdKey();
export const strikeThrough = createMark((_, utils) => {
export const strikeThrough = createMark((utils) => {
const id = 'strike_through';

@@ -16,3 +16,3 @@ const style = utils.getStyle((themeTool) => css `

id,
schema: {
schema: () => ({
parseDOM: [

@@ -23,17 +23,17 @@ { tag: 'del' },

toDOM: (mark) => ['del', { class: utils.getClassName(mark.attrs, 'strike-through', style) }],
},
parser: {
match: (node) => node.type === 'delete',
runner: (state, node, markType) => {
state.openMark(markType);
state.next(node.children);
state.closeMark(markType);
parseMarkdown: {
match: (node) => node.type === 'delete',
runner: (state, node, markType) => {
state.openMark(markType);
state.next(node.children);
state.closeMark(markType);
},
},
},
serializer: {
match: (mark) => mark.type.name === id,
runner: (state, mark) => {
state.withMark(mark, 'delete');
toMarkdown: {
match: (mark) => mark.type.name === id,
runner: (state, mark) => {
state.withMark(mark, 'delete');
},
},
},
}),
inputRules: (markType) => [

@@ -40,0 +40,0 @@ markRule(/(?:~~)([^~]+)(?:~~)$/, markType),

@@ -7,4 +7,4 @@ import { SupportedKeys } from './supported-keys';

export declare const TurnIntoTaskList: import("@milkdown/core").CmdKey<undefined>;
export declare const taskListItem: import("@milkdown/utils/lib/types").Origin<Keys, import("@milkdown/utils/lib/types").UnknownRecord, import("@milkdown/core").Node>;
export declare const taskListItem: import("@milkdown/utils/src/types").AddMetadata<(options?: Partial<import("@milkdown/utils").CommonOptions<Keys, import("@milkdown/utils/src/types").UnknownRecord>> | undefined) => import("@milkdown/core").MilkdownPlugin>;
export {};
//# sourceMappingURL=task-list-item.d.ts.map

@@ -12,3 +12,3 @@ /* Copyright 2021, Milkdown by Mirone. */

export const TurnIntoTaskList = createCmdKey();
export const taskListItem = createNode((_, utils) => {
export const taskListItem = createNode((utils) => {
const id = 'task_list_item';

@@ -63,3 +63,3 @@ const style = utils.getStyle(({ palette, size }) => css `

id,
schema: {
schema: () => ({
group: 'listItem',

@@ -93,21 +93,21 @@ content: 'paragraph block*',

],
},
parser: {
match: ({ type, checked }) => {
return type === 'listItem' && checked !== null;
parseMarkdown: {
match: ({ type, checked }) => {
return type === 'listItem' && checked !== null;
},
runner: (state, node, type) => {
state.openNode(type, { checked: node.checked });
state.next(node.children);
state.closeNode();
},
},
runner: (state, node, type) => {
state.openNode(type, { checked: node.checked });
state.next(node.children);
state.closeNode();
toMarkdown: {
match: (node) => node.type.name === id,
runner: (state, node) => {
state.openNode('listItem', undefined, { checked: node.attrs.checked });
state.next(node.content);
state.closeNode();
},
},
},
serializer: {
match: (node) => node.type.name === id,
runner: (state, node) => {
state.openNode('listItem', undefined, { checked: node.attrs.checked });
state.next(node.content);
state.closeNode();
},
},
}),
inputRules: (nodeType) => [

@@ -130,4 +130,4 @@ wrappingInputRule(/^\s*(\[([ |x])\])\s$/, nodeType, (match) => ({

},
view: (node, view, getPos) => {
const createIcon = utils.ctx.get(themeToolCtx).slots.icon;
view: (ctx) => (node, view, getPos) => {
const createIcon = ctx.get(themeToolCtx).slots.icon;
const listItem = document.createElement('li');

@@ -134,0 +134,0 @@ const checkboxWrapper = document.createElement('label');

{
"name": "@milkdown/preset-gfm",
"version": "4.14.2",
"version": "5.0.0",
"main": "lib/index.js",

@@ -24,8 +24,8 @@ "module": "lib/index.js",

"@emotion/css": "^11.1.3",
"@milkdown/plugin-table": "4.14.2",
"@milkdown/preset-commonmark": "4.14.2",
"@milkdown/utils": "4.14.2",
"@milkdown/plugin-table": "5.0.0",
"@milkdown/preset-commonmark": "5.0.0",
"@milkdown/utils": "5.0.0",
"@types/prosemirror-schema-list": "^1.0.3",
"prosemirror-schema-list": "^1.1.4",
"tslib": "^2.2.0"
"tslib": "^2.3.1"
},

@@ -32,0 +32,0 @@ "devDependencies": {

/* Copyright 2021, Milkdown by Mirone. */
import { prosePluginFactory } from '@milkdown/core';
import { InputRule, inputRules } from '@milkdown/prose';
import { createPlugin } from '@milkdown/utils';

@@ -27,2 +27,2 @@ const urlRegex =

export const urlPlugin = prosePluginFactory(proseUrlPlugin());
export const urlPlugin = createPlugin(() => ({ prosePlugins: () => [proseUrlPlugin()] }));
/* Copyright 2021, Milkdown by Mirone. */
import { tableNodes, tablePlugins } from '@milkdown/plugin-table';
import { commands as commonmarkCommands, commonmarkNodes, commonmarkPlugins } from '@milkdown/preset-commonmark';
import { tablePlugin } from '@milkdown/plugin-table';
import { commands as commonmarkCommands, commonmark } from '@milkdown/preset-commonmark';
import { AtomList } from '@milkdown/utils';

@@ -28,4 +28,3 @@

table,
tableNodes,
tablePlugins,
tablePlugin,
} from '@milkdown/plugin-table';

@@ -75,5 +74,3 @@ export {

export const gfmNodes = AtomList.create([...commonmarkNodes, ...tableNodes, strikeThrough(), taskListItem()]);
export const gfmPlugins = AtomList.create([...tablePlugins, ...commonmarkPlugins, urlPlugin]);
export const gfm = AtomList.create([...gfmNodes, ...gfmPlugins]);
export const gfm = AtomList.create([...commonmark, tablePlugin(), urlPlugin(), strikeThrough(), taskListItem()]);

@@ -80,0 +77,0 @@ export const commands = {

@@ -13,3 +13,3 @@ /* Copyright 2021, Milkdown by Mirone. */

export const strikeThrough = createMark<Keys>((_, utils) => {
export const strikeThrough = createMark<Keys>((utils) => {
const id = 'strike_through';

@@ -25,3 +25,3 @@ const style = utils.getStyle(

id,
schema: {
schema: () => ({
parseDOM: [

@@ -32,17 +32,17 @@ { tag: 'del' },

toDOM: (mark) => ['del', { class: utils.getClassName(mark.attrs, 'strike-through', style) }],
},
parser: {
match: (node) => node.type === 'delete',
runner: (state, node, markType) => {
state.openMark(markType);
state.next(node.children);
state.closeMark(markType);
parseMarkdown: {
match: (node) => node.type === 'delete',
runner: (state, node, markType) => {
state.openMark(markType);
state.next(node.children);
state.closeMark(markType);
},
},
},
serializer: {
match: (mark) => mark.type.name === id,
runner: (state, mark) => {
state.withMark(mark, 'delete');
toMarkdown: {
match: (mark) => mark.type.name === id,
runner: (state, mark) => {
state.withMark(mark, 'delete');
},
},
},
}),
inputRules: (markType) => [

@@ -49,0 +49,0 @@ markRule(/(?:~~)([^~]+)(?:~~)$/, markType),

@@ -18,3 +18,3 @@ /* Copyright 2021, Milkdown by Mirone. */

export const taskListItem = createNode<Keys>((_, utils) => {
export const taskListItem = createNode<Keys>((utils) => {
const id = 'task_list_item';

@@ -73,3 +73,3 @@ const style = utils.getStyle(

id,
schema: {
schema: () => ({
group: 'listItem',

@@ -103,21 +103,21 @@ content: 'paragraph block*',

],
},
parser: {
match: ({ type, checked }) => {
return type === 'listItem' && checked !== null;
parseMarkdown: {
match: ({ type, checked }) => {
return type === 'listItem' && checked !== null;
},
runner: (state, node, type) => {
state.openNode(type, { checked: node.checked as boolean });
state.next(node.children);
state.closeNode();
},
},
runner: (state, node, type) => {
state.openNode(type, { checked: node.checked as boolean });
state.next(node.children);
state.closeNode();
toMarkdown: {
match: (node) => node.type.name === id,
runner: (state, node) => {
state.openNode('listItem', undefined, { checked: node.attrs.checked });
state.next(node.content);
state.closeNode();
},
},
},
serializer: {
match: (node) => node.type.name === id,
runner: (state, node) => {
state.openNode('listItem', undefined, { checked: node.attrs.checked });
state.next(node.content);
state.closeNode();
},
},
}),
inputRules: (nodeType) => [

@@ -140,4 +140,4 @@ wrappingInputRule(/^\s*(\[([ |x])\])\s$/, nodeType, (match) => ({

},
view: (node, view, getPos) => {
const createIcon = utils.ctx.get(themeToolCtx).slots.icon;
view: (ctx) => (node, view, getPos) => {
const createIcon = ctx.get(themeToolCtx).slots.icon;

@@ -144,0 +144,0 @@ const listItem = document.createElement('li');

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

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