@infonomic/payload-alternative-lexical-editor 1.0.3 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -90,11 +90,28 @@ The configuration in this repo is using the `beforeChange` strategy, although th
|
|
|
90
90
|
|
|
91
91
|
## Getting Started
|
|
92
92
|
|
|
93
|
+
### To run the editor examples from within this repo:
|
|
94
|
+
|
|
93
95
|
1. Clone this repo
|
|
94
96
|
2. If you don't already have an instance of MongoDB running locally we've provided a docker composer file and a shell start script. To start `cd mongodb` from the project root. `mkdir data` and then `./mongo.sh up` to start a local instance of MongoDB with a fresh database.
|
|
95
97
|
3. In the `apps/next` directory - copy `.env.example` to `.env` (Note: Don't deploy this to production or a public service without changing your PAYLOAD_SECRET).
|
|
96
98
|
4. From the root - run `pnpm install` followed by `pnpm dev`.
|
|
97
99
|
5. To run a production build - from the root run `pnpm build` followed by `pnpm start`.
|
|
98
100
|
|
|
101
|
+
### To install and run the editor in your own project.
|
|
102
|
+
|
|
103
|
+
1. `pnpm add @infonomic/payload-alternative-lexical-editor` or `npm install @infonomic/payload-alternative-lexical-editor`
|
|
104
|
+
2. Configure the editor in `payload.config.ts`
|
|
105
|
+
|
|
106
|
+
```ts
|
|
107
|
+
import { lexicalEditor } from '@infonomic/payload-alternative-lexical-editor'
|
|
108
|
+
|
|
109
|
+
...
|
|
110
|
+
// @ts-expect-error: our return type for editorConfig is different
|
|
111
|
+
editor: lexicalEditor(),
|
|
112
|
+
...
|
|
113
|
+
```
|
|
114
|
+
Follow the examples in this repo under apps/next for configuration options and settings for the editor (turning editor features on or off).
|
|
115
|
+
|
|
99
116
|
Thoughts, suggestions or contributions more than welcome. We hope that some of this helps.
|
|
100
117
|
|