VOOZH about

URL: https://www.nuget.org/packages/StepWise.ProseMirror/

⇱ NuGet Gallery | StepWise.ProseMirror 0.1.15




StepWise.ProseMirror 0.1.15

Prefix Reserved
dotnet add package StepWise.ProseMirror --version 0.1.15
 
 
NuGet\Install-Package StepWise.ProseMirror -Version 0.1.15
 
 
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="StepWise.ProseMirror" Version="0.1.15" />
 
 
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="StepWise.ProseMirror" Version="0.1.15" />
 
Directory.Packages.props
<PackageReference Include="StepWise.ProseMirror" />
 
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add StepWise.ProseMirror --version 0.1.15
 
 
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: StepWise.ProseMirror, 0.1.15"
 
 
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package StepWise.ProseMirror@0.1.15
 
 
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=StepWise.ProseMirror&version=0.1.15
 
Install as a Cake Addin
#tool nuget:?package=StepWise.ProseMirror&version=0.1.15
 
Install as a Cake Tool
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

ProseMirror.Net

This project is not dead! ProseMirror's core packages see very little change due to maturity; including bug fixes. ProseMirror.Net powers the collaborative editing backend at StepWiseHQ.

The best way to work with ProseMirror document models in DotNet:

  • Document and step DTOs for serialization/deserialization
  • Building and updating documents server-side
  • Server-side schema validation
  • Building collaborative editing backends

ProseMirror.Net is a direct translation of the core ProseMirror packages from TypeScript to C#

  • prosemirror-model
  • prosemirror-transform
  • prosemirror-test-builder
  • prosemirror-schema-basic
  • prosemirror-schema-list

Getting Started

dotnet add package StepWise.ProseMirror

Basic Usage

using StepWise.Prose.Model;

var schemaSpec = new SchemaSpec() {
	Nodes = new()
	{
		["doc"] = new() { Content = "paragraph+" },
		["paragraph"] = new() { Content = "text*" },
		["text"] = new() { }
	},
 Marks = new()
};
var schema = new Schema(schemaSpec);

var doc = schema.Node("doc", null, [
	schema.Node("paragraph", null, [
		schema.Text("Hello World")
	], null)
], null);

Console.WriteLine(doc.ToString()); // doc(paragraph("Hello World"))

Test Builder & Transform

using StepWise.Prose.Model;
using StepWise.Prose.TestBuilder;
using StepWise.Prose.Transformation;

using static StepWise.Prose.TestBuilder.Builder;

Node node = doc(p("Hello <a>"));

var tr = new Transform(node);

tr.ReplaceWith(node.Tag()["a"], node.Tag()["a"], schema.Text("World"));

Console.WriteLine(tr.Doc.ToString()); // doc(paragraph("Hello World"))

Deserializing Steps

using StepWise.Prose.Model;
using StepWise.Prose.TestBuilder;
using StepWise.Prose.Transformation;

using static StepWise.Prose.TestBuilder.Builder;

Node node = doc(p("Hello <a>"));

var stepJsonString = """{"stepType":"replace","from":7,"to":7,"slice":{"content":[{"type":"text","text":"World","marks":[]}]}}""";
var step = Step.FromJSON(Builder.schema, StepDto.FromJson(stepJsonString));

var tr = new Transform(node);
tr.Step(step);

Console.WriteLine(tr.Doc.ToString()); // doc(paragraph("Hello World"))

Deserializing Docs(Nodes)

using StepWise.Prose.Model;
using StepWise.Prose.TestBuilder;

var docJsonString = """{"type":"doc","content":[{"type":"paragraph","content":[{"type":"text","text":"Hello World","marks":[]}],"marks":[]}],"marks":[]}""";
var doc = Node.FromJSON(Builder.schema, NodeDto.FromJson(docJsonString));

Console.WriteLine(doc.ToString()); // doc(paragraph("Hello World"))
Product Versions Compatible and additional computed target framework versions.
.NET net8.0 net8.0 is compatible.  net8.0-android net8.0-android was computed.  net8.0-browser net8.0-browser was computed.  net8.0-ios net8.0-ios was computed.  net8.0-maccatalyst net8.0-maccatalyst was computed.  net8.0-macos net8.0-macos was computed.  net8.0-tvos net8.0-tvos was computed.  net8.0-windows net8.0-windows was computed.  net9.0 net9.0 was computed.  net9.0-android net9.0-android was computed.  net9.0-browser net9.0-browser was computed.  net9.0-ios net9.0-ios was computed.  net9.0-maccatalyst net9.0-maccatalyst was computed.  net9.0-macos net9.0-macos was computed.  net9.0-tvos net9.0-tvos was computed.  net9.0-windows net9.0-windows was computed.  net10.0 net10.0 was computed.  net10.0-android net10.0-android was computed.  net10.0-browser net10.0-browser was computed.  net10.0-ios net10.0-ios was computed.  net10.0-maccatalyst net10.0-maccatalyst was computed.  net10.0-macos net10.0-macos was computed.  net10.0-tvos net10.0-tvos was computed.  net10.0-windows net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.15 82,924 5/7/2024
0.1.14 473 4/19/2024
0.1.13 266 4/19/2024
0.1.12 263 4/19/2024
0.1.11 264 4/19/2024
0.1.10 516 4/19/2024
0.1.9 517 3/17/2024
0.1.8 319 10/2/2023
0.1.7 251 9/26/2023
0.1.6 279 8/23/2023
0.1.5 295 8/5/2023
0.1.3 317 7/18/2023
0.1.2 320 7/18/2023
0.1.1 765 7/14/2023