Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/mangoweb/plate-content-editor


https://github.com/mangoweb/plate-content-editor

Last synced: 14 days ago
JSON representation

Awesome Lists containing this project

README

        

# App

image

## Requirements

- React 19 (When using npm package)
- Node.js
- pnpm

```sh
brew install pnpm
```

## Setup

### Install dependencies

```sh
pnpm i
```

## Development

### Demo

```sh
pnpm dev
```

## Usage

### Install

```npmrc
@mangoweb:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=ghp_YOUR_TOKEN
```

[Generate a new token](https://github.com/settings/tokens/new)

read:packages

```sh
pnpm i @mangoweb/plate-content-editor
```

### Contember

#### Dynamic

```tsx
import "@mangoweb/plate-content-editor/plate.css";
const PlateEditorForContember = lazy(
() => import("@mangoweb/plate-content-editor/contember")
);




Loading...}>


;
```

#### Static

```tsx
import "@mangoweb/plate-content-editor/plate.css";
import PlateEditorForContember from "@mangoweb/plate-content-editor/contember";


;
```

### Next

#### RSC

(Text and images would be rendered during static generation)

```tsx
"use client";

import type { PlateEditorValue } from "@mangoweb/plate-content-editor";

import "@mangoweb/plate-content-editor/plate.css";
import Plate from "@mangoweb/plate-content-editor/readonly";

type BlogContentRenderProps = {
content: unknown;
};
export const BlogContentRender = (props: BlogContentRenderProps) => {
const { content } = props;

const parsed = content as PlateEditorValue;
return ;
};
```

#### Dynamic

```tsx
"use client";

import "@mangoweb/plate-content-editor/plate.css";
const Plate = dynamic(() => import("@mangoweb/plate-content-editor/readonly"), {
loading: () =>

Loading...

,
});

type BlogContentRenderProps = {
content: unknown;
};
export const BlogContentRender = (props: BlogContentRenderProps) => {
const { content } = props;

const parsed = content as PlateEditorValue;
return ;
};
```

### Monorepo

```sh
git clone --depth 1 https://github.com/manGoweb/plate-content-editor.git
rm -rf plate-content-editor/.git
```

Replace `@mangoweb/plate-content-editor` with your monorepo name and add package to workspace