@tryghost/koenig-lexical 0.0.3 → 0.0.5

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 CHANGED
@@ -4,7 +4,20 @@ Early stage re-write of Ghost's editor, using Lexical as the editor framework in
4
4
 
5
5
  ## Development
6
6
 
7
- Run `yarn dev` to start the development server. This will generate a demo site from the `index.html` file which renders the demo app in `demo/demo.jsx` and makes it available on http://localhost:5173
7
+ Run `yarn dev` to start the development server to test/develop the editor standalone. This will generate a demo site from the `index.html` file which renders the demo app in `demo/demo.jsx` and makes it available on http://localhost:5173
8
+
9
+ To test/develop inside of Admin you can run `yarn preview` then in Ghost set your `editor.url` value in `config.local.json` to `http://127.0.0.1:4173/koenig-lexical.umd.js` and load Admin as usual.
10
+
11
+ ```json
12
+ {
13
+ ...
14
+ "editor": {
15
+ "url": "http://127.0.0.1:4173/koenig-lexical.umd.js"
16
+ }
17
+ }
18
+ ```
19
+
20
+ `yarn preview` by itself only serves the library files, it's possible ro run `yarn built --watch` in a separate terminal tab to have auto-rebuild whilst developing.
8
21
 
9
22
  ### Project structure
10
23
 
@@ -4676,17 +4676,19 @@ const Ks = {
4676
4676
  namespace: "KoenigEditor",
4677
4677
  theme: Ds
4678
4678
  }, Td = ({
4679
- nodes: n = [...Fs],
4680
- onError: e = Bs,
4681
- children: t
4679
+ initialEditorState: n,
4680
+ nodes: e = [...Fs],
4681
+ onError: t = Bs,
4682
+ children: r
4682
4683
  }) => {
4683
- const r = ae.useMemo(() => Object.assign({}, Ks, {
4684
- nodes: n,
4685
- onError: e
4686
- }), [n, e]);
4684
+ const i = ae.useMemo(() => Object.assign({}, Ks, {
4685
+ nodes: e,
4686
+ editorState: n,
4687
+ onError: t
4688
+ }), [n, e, t]);
4687
4689
  return /* @__PURE__ */ Ee(Vl.LexicalComposer, {
4688
- initialConfig: r,
4689
- children: t
4690
+ initialConfig: i,
4691
+ children: r
4690
4692
  });
4691
4693
  };
4692
4694
  var Go = {}, ce = {}, G = re;