@milkdown/prose
Advanced tools
Comparing version 6.0.2 to 6.1.0
@@ -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 |
109
package.json
{ | ||
"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" | ||
} | ||
} |
# @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
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
51078
80
12
611
1
+ Added@milkdown/exception@6.1.0(transitive)
- Removed@milkdown/exception@6.0.2(transitive)
Updated@milkdown/exception@6.1.0