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

@milkdown/prose

Package Overview
Dependencies
Maintainers
1
Versions
71
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@milkdown/prose - npm Package Compare versions

Comparing version 6.0.2 to 6.1.0

lib/commands.d.ts

65

lib/index.d.ts

@@ -1,3 +0,62 @@

export * from './prosemirror';
export * from './toolkit';
//# sourceMappingURL=index.d.ts.map
import { InputRule } from 'prosemirror-inputrules';
import { PluginKey, Plugin, Transaction, Selection } from 'prosemirror-state';
import { MarkType, NodeType, Node, Schema, ResolvedPos, Mark } from 'prosemirror-model';
import { EditorView, Decoration, NodeView } from 'prosemirror-view';
declare const customInputRulesKey: PluginKey<any, any>;
declare const customInputRules: ({ rules }: {
rules: InputRule[];
}) => Plugin;
declare function markRule(regexp: RegExp, markType: MarkType): InputRule;
declare type Point = [top: number, left: number];
declare const calculateNodePosition: (view: EditorView, target: HTMLElement, handler: (selectedRect: DOMRect, targetRect: DOMRect, parentRect: DOMRect) => Point) => void;
declare type Rect = {
left: number;
right: number;
top: number;
bottom: number;
};
declare const calculateTextPosition: (view: EditorView, target: HTMLElement, handler: (start: Rect, end: Rect, targetRect: DOMRect, parentRect: DOMRect) => Point) => void;
declare const cloneTr: (tr: Transaction) => any;
declare const equalNodeType: (nodeType: NodeType | NodeType[], node: Node) => boolean;
declare type Predicate = (node: Node) => boolean;
declare type NodeWithPos = {
pos: number;
node: Node;
};
declare const flatten: (node: Node, descend?: boolean) => NodeWithPos[];
declare const findChildren: (predicate: Predicate) => (node: Node, descend?: boolean | undefined) => NodeWithPos[];
declare const findChildrenByMark: (node: Node, markType: MarkType, descend?: boolean | undefined) => NodeWithPos[];
declare const getNodeFromSchema: (type: string, schema: Schema) => NodeType;
declare const getMarkFromSchema: (type: string, schema: Schema) => MarkType;
declare type ContentNodeWithPos = {
pos: number;
start: number;
depth: number;
node: Node;
};
declare const findParentNodeClosestToPos: (predicate: Predicate) => ($pos: ResolvedPos) => ContentNodeWithPos | undefined;
declare const findParentNode: (predicate: Predicate) => (selection: Selection) => ContentNodeWithPos | undefined;
declare const findSelectedNodeOfType: (selection: Selection, nodeType: NodeType) => ContentNodeWithPos | undefined;
declare type NodeViewParams = [node: Node, view: EditorView, getPos: () => number, decorations: Decoration[]];
declare type MarkViewParams = [mark: Mark, view: EditorView, getPos: boolean, decorations: Decoration[]];
declare type ViewParams = [
atom: Node | Mark,
view: EditorView,
getPos: (() => number) | boolean,
decorations: Decoration[]
];
declare type NodeViewFactory = (...params: NodeViewParams) => NodeView;
declare type MarkViewFactory = (...params: MarkViewParams) => NodeView;
declare type ViewFactory = (...params: ViewParams) => NodeView;
export { ContentNodeWithPos, MarkViewFactory, MarkViewParams, NodeViewFactory, NodeViewParams, NodeWithPos, ViewFactory, ViewParams, calculateNodePosition, calculateTextPosition, cloneTr, customInputRules, customInputRulesKey, equalNodeType, findChildren, findChildrenByMark, findParentNode, findParentNodeClosestToPos, findSelectedNodeOfType, flatten, getMarkFromSchema, getNodeFromSchema, markRule };
//# sourceMappingURL=index.d.ts.map
{
"name": "@milkdown/prose",
"version": "6.0.2",
"version": "6.1.0",
"type": "module",
"main": "./lib/index.es.js",
"main": "./lib/index.js",
"types": "./lib/index.d.ts",
"exports": {
".": {
"import": "./lib/index.js",
"types": "./lib/index.d.ts"
},
"./commands": {
"import": "./lib/commands.js",
"types": "./lib/commands.d.ts"
},
"./dropcursor": {
"import": "./lib/dropcursor.js",
"types": "./lib/dropcursor.d.ts"
},
"./gapcursor": {
"import": "./lib/gapcursor.js",
"types": "./lib/gapcursor.d.ts"
},
"./history": {
"import": "./lib/history.js",
"types": "./lib/history.d.ts"
},
"./inputrules": {
"import": "./lib/inputrules.js",
"types": "./lib/inputrules.d.ts"
},
"./keymap": {
"import": "./lib/keymap.js",
"types": "./lib/keymap.d.ts"
},
"./model": {
"import": "./lib/model.js",
"types": "./lib/model.d.ts"
},
"./schema-list": {
"import": "./lib/schema-list.js",
"types": "./lib/schema-list.d.ts"
},
"./state": {
"import": "./lib/state.js",
"types": "./lib/state.d.ts"
},
"./tables": {
"import": "./lib/tables.js",
"types": "./lib/tables.d.ts"
},
"./transform": {
"import": "./lib/transform.js",
"types": "./lib/transform.d.ts"
},
"./view": {
"import": "./lib/view.js",
"types": "./lib/view.d.ts"
}
},
"typesVersions": {
"*": {
"commands": [
"lib/commands.d.ts"
],
"dropcursor": [
"lib/dropcursor.d.ts"
],
"gapcursor": [
"lib/gapcursor.d.ts"
],
"history": [
"lib/history.d.ts"
],
"inputrules": [
"lib/inputrules.d.ts"
],
"keymap": [
"lib/keymap.d.ts"
],
"model": [
"lib/model.d.ts"
],
"schema-list": [
"lib/schema-list.d.ts"
],
"state": [
"lib/state.d.ts"
],
"tables": [
"lib/tables.d.ts"
],
"transform": [
"lib/transform.d.ts"
],
"view": [
"lib/view.d.ts"
]
}
},
"sideEffects": false,

@@ -14,3 +108,3 @@ "license": "MIT",

"dependencies": {
"@milkdown/exception": "6.0.2",
"@milkdown/exception": "6.1.0",
"@types/prosemirror-commands": "^1.0.4",

@@ -66,8 +160,7 @@ "@types/prosemirror-dropcursor": "^1.0.2",

"scripts": {
"start": "concurrently -n es,dts \"vite build --watch\" \"tsc --emitDeclarationOnly --watch\"",
"start": "rollup -c -w",
"test": "vitest",
"tsc": "tsc --noEmit",
"build": "vite build && tsc --emitDeclarationOnly"
},
"readme": "# @milkdown/prose\n\nProsemirror toolkit for [milkdown](https://saul-mirone.github.io/milkdown/).\n\nCheck API on [document website](https://milkdown.dev/#/prose).\n\n# License\n\nMilkdown is open sourced software licensed under [MIT license](https://github.com/Saul-Mirone/milkdown/blob/main/LICENSE).\n"
"tsc": "tsc --noEmit && echo",
"build": "rollup -c && echo"
}
}

6

README.md
# @milkdown/prose
Prosemirror toolkit for [milkdown](https://saul-mirone.github.io/milkdown/).
The prose module of [milkdown](https://milkdown.dev/).
Check API on [document website](https://milkdown.dev/#/prose).
# Official Documentation
Documentation can be found on the [Milkdown website](https://milkdown.dev/prose).
# License
Milkdown is open sourced software licensed under [MIT license](https://github.com/Saul-Mirone/milkdown/blob/main/LICENSE).
/* Copyright 2021, Milkdown by Mirone. */
export * from './prosemirror';
export * from './toolkit';
/* Copyright 2021, Milkdown by Mirone. */
import type { InputRule } from 'prosemirror-inputrules';
import { EditorState, Plugin, PluginKey, PluginSpec, TextSelection, Transaction } from 'prosemirror-state';
import type { EditorView } from 'prosemirror-view';
import type { InputRule } from '../../inputrules';
import { EditorState, Plugin, PluginKey, PluginSpec, TextSelection, Transaction } from '../../state';
import type { EditorView } from '../../view';

@@ -7,0 +7,0 @@ function run(view: EditorView, from: number, to: number, text: string, rules: InputRule[], plugin: Plugin) {

/* Copyright 2021, Milkdown by Mirone. */
import { InputRule } from 'prosemirror-inputrules';
import { Mark, MarkType } from 'prosemirror-model';
import { EditorState } from 'prosemirror-state';
import { InputRule } from '../../inputrules';
import { Mark, MarkType } from '../../model';
import { EditorState } from '../../state';

@@ -6,0 +6,0 @@ export function markRule(regexp: RegExp, markType: MarkType): InputRule {

/* Copyright 2021, Milkdown by Mirone. */
import type { EditorView } from 'prosemirror-view';
import type { EditorView } from '../../view';

@@ -4,0 +4,0 @@ type Point = [top: number, left: number];

/* Copyright 2021, Milkdown by Mirone. */
import type { Node as ProseNode, NodeType } from 'prosemirror-model';
import type { Transaction } from 'prosemirror-state';
import type { Node as ProseNode, NodeType } from '../../model';
import type { Transaction } from '../../state';

@@ -5,0 +5,0 @@ export const cloneTr = (tr: Transaction) => {

/* Copyright 2021, Milkdown by Mirone. */
import type { MarkType, Node as ProseNode } from 'prosemirror-model';
import type { MarkType, Node as ProseNode } from '../../model';
import type { Predicate } from './types';

@@ -5,0 +4,0 @@

/* Copyright 2021, Milkdown by Mirone. */
import { getAtomFromSchemaFail } from '@milkdown/exception';
import type { MarkType, NodeType, Schema } from 'prosemirror-model';
import type { MarkType, NodeType, Schema } from '../../model';
export const getNodeFromSchema = (type: string, schema: Schema): NodeType => {

@@ -6,0 +7,0 @@ const target = schema.nodes[type];

/* Copyright 2021, Milkdown by Mirone. */
import type { Node as ProseNode, NodeType, ResolvedPos } from 'prosemirror-model';
import { NodeSelection, Selection } from 'prosemirror-state';
import type { Node as ProseNode, NodeType, ResolvedPos } from '../../model';
import { NodeSelection, Selection } from '../../state';
import { equalNodeType } from './helper';

@@ -6,0 +5,0 @@ import type { Predicate } from './types';

/* Copyright 2021, Milkdown by Mirone. */
import type { Node as ProseNode } from 'prosemirror-model';
import type { Node as ProseNode } from '../../model';
export type Predicate = (node: ProseNode) => boolean;
/* Copyright 2021, Milkdown by Mirone. */
import type { Mark, Node } from 'prosemirror-model';
import type { Decoration, EditorView, NodeView } from 'prosemirror-view';
import type { Mark, Node } from '../../model';
import type { Decoration, EditorView, NodeView } from '../../view';

@@ -6,0 +6,0 @@ export type NodeViewParams = [node: Node, view: EditorView, getPos: () => number, decorations: Decoration[]];

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