@prosekit/core
Advanced tools
Comparing version 0.1.0 to 0.1.1
@@ -735,2 +735,11 @@ import { AllSelection } from '@prosekit/pm/state'; | ||
/** | ||
* Parse a JSON object to a ProseMirror node. | ||
* | ||
* @public | ||
*/ | ||
declare function nodeFromJSON(json: NodeJSON, schema: Schema): ProseMirrorNode; | ||
export { nodeFromJSON } | ||
export { nodeFromJSON as nodeFromJSON_alias_1 } | ||
/** | ||
* A JSON representation of the prosemirror node. | ||
@@ -901,2 +910,11 @@ * | ||
/** | ||
* Parse a JSON object to a ProseMirror state. | ||
* | ||
* @public | ||
*/ | ||
declare function stateFromJSON(json: StateJSON, schema: Schema): EditorState; | ||
export { stateFromJSON } | ||
export { stateFromJSON as stateFromJSON_alias_1 } | ||
/** | ||
* A JSON representation of the prosemirror state. | ||
@@ -903,0 +921,0 @@ * |
@@ -60,2 +60,4 @@ export { addMark } from './_tsup-dts-rollup'; | ||
export { nodeFromHTML } from './_tsup-dts-rollup'; | ||
export { nodeFromJSON } from './_tsup-dts-rollup'; | ||
export { stateFromJSON } from './_tsup-dts-rollup'; | ||
export { isAllSelection } from './_tsup-dts-rollup'; | ||
@@ -62,0 +64,0 @@ export { isMark } from './_tsup-dts-rollup'; |
@@ -220,3 +220,3 @@ // src/commands/add-mark.ts | ||
import { Schema as Schema6 } from "@prosekit/pm/model"; | ||
import { EditorState } from "@prosekit/pm/state"; | ||
import { EditorState as EditorState2 } from "@prosekit/pm/state"; | ||
import { EditorView } from "@prosekit/pm/view"; | ||
@@ -344,2 +344,3 @@ | ||
import { DOMParser } from "@prosekit/pm/model"; | ||
import { EditorState } from "@prosekit/pm/state"; | ||
@@ -401,2 +402,8 @@ // src/utils/get-dom-api.ts | ||
} | ||
function nodeFromJSON(json, schema) { | ||
return schema.nodeFromJSON(json); | ||
} | ||
function stateFromJSON(json, schema) { | ||
return EditorState.fromJSON({ schema }, json); | ||
} | ||
@@ -843,3 +850,3 @@ // src/extensions/default-state.ts | ||
const stateConfig = stateInput ? stateInput({ schema }) : { schema }; | ||
const state = EditorState.create(stateConfig); | ||
const state = EditorState2.create(stateConfig); | ||
if (commandInput) { | ||
@@ -1454,5 +1461,7 @@ for (const [name, commandCreator] of Object.entries(commandInput)) { | ||
nodeFromHTML, | ||
nodeFromJSON, | ||
pluginFacet, | ||
removeMark, | ||
setBlockType, | ||
stateFromJSON, | ||
toggleMark, | ||
@@ -1459,0 +1468,0 @@ toggleNode, |
{ | ||
"name": "@prosekit/core", | ||
"type": "module", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"private": false, | ||
@@ -6,0 +6,0 @@ "author": { |
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
74807
2406