@lexion-rte/solid 0.1.0 → 0.1.2
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/CHANGELOG.md +23 -0
- package/README.md +63 -0
- package/package.json +6 -6
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# @lexion-rte/solid
|
|
2
|
+
|
|
3
|
+
## 0.1.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Refresh package metadata links and expand package-level README documentation.
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @lexion-rte/core@0.1.2
|
|
10
|
+
- @lexion-rte/web@0.1.2
|
|
11
|
+
|
|
12
|
+
## 0.1.1
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- Update package metadata and documentation for the `@lexion-rte` package set.
|
|
17
|
+
|
|
18
|
+
- Align repository/homepage/bugs metadata with the current GitHub repository owner.
|
|
19
|
+
- Add package-level README files with package purpose and usage examples.
|
|
20
|
+
|
|
21
|
+
- Updated dependencies
|
|
22
|
+
- @lexion-rte/core@0.1.1
|
|
23
|
+
- @lexion-rte/web@0.1.1
|
package/README.md
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# @lexion-rte/solid
|
|
2
|
+
|
|
3
|
+
SolidJS adapter utilities for Lexion.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
`@lexion-rte/solid` provides an imperative adapter for Solid lifecycle integration.
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
pnpm add @lexion-rte/solid solid-js
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## API
|
|
16
|
+
|
|
17
|
+
- `createLexionSolidAdapter(options?)`
|
|
18
|
+
- `LexionSolidAdapter`
|
|
19
|
+
|
|
20
|
+
Methods:
|
|
21
|
+
|
|
22
|
+
- `mount(element)`
|
|
23
|
+
- `update({ value?, readOnly?, onChange? })`
|
|
24
|
+
- `setValue(value)`
|
|
25
|
+
- `setReadOnly(readOnly)`
|
|
26
|
+
- `execute(command, ...args)`
|
|
27
|
+
- `destroy()`
|
|
28
|
+
- `editor` getter
|
|
29
|
+
|
|
30
|
+
## Solid Integration Example
|
|
31
|
+
|
|
32
|
+
```ts
|
|
33
|
+
import { createSignal, createEffect, onCleanup, onMount } from "solid-js";
|
|
34
|
+
import type { JSONDocument } from "@lexion-rte/core";
|
|
35
|
+
import { createLexionSolidAdapter } from "@lexion-rte/solid";
|
|
36
|
+
|
|
37
|
+
const [value, setValue] = createSignal<JSONDocument | undefined>(undefined);
|
|
38
|
+
const adapter = createLexionSolidAdapter({
|
|
39
|
+
onChange: (nextValue) => setValue(nextValue)
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
let host!: HTMLDivElement;
|
|
43
|
+
|
|
44
|
+
onMount(() => {
|
|
45
|
+
adapter.mount(host);
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
createEffect(() => {
|
|
49
|
+
const nextValue = value();
|
|
50
|
+
if (nextValue) {
|
|
51
|
+
adapter.update({ value: nextValue });
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
onCleanup(() => {
|
|
56
|
+
adapter.destroy();
|
|
57
|
+
});
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Notes
|
|
61
|
+
|
|
62
|
+
- Always call `destroy()` on cleanup.
|
|
63
|
+
- `execute()` throws if the adapter is not mounted.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lexion-rte/solid",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "SolidJS adapter utilities for the Lexion editor.",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
@@ -15,12 +15,12 @@
|
|
|
15
15
|
"license": "GPL-3.0-only",
|
|
16
16
|
"repository": {
|
|
17
17
|
"type": "git",
|
|
18
|
-
"url": "https://github.com/
|
|
18
|
+
"url": "https://github.com/dariusve/lexion.git",
|
|
19
19
|
"directory": "packages/solid"
|
|
20
20
|
},
|
|
21
|
-
"homepage": "https://github.com/
|
|
21
|
+
"homepage": "https://github.com/dariusve/lexion/tree/main/packages/solid",
|
|
22
22
|
"bugs": {
|
|
23
|
-
"url": "https://github.com/
|
|
23
|
+
"url": "https://github.com/dariusve/lexion/issues"
|
|
24
24
|
},
|
|
25
25
|
"keywords": [
|
|
26
26
|
"lexion",
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
"solid-js": "^1.8.0"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@lexion-rte/core": "0.1.
|
|
41
|
-
"@lexion-rte/web": "0.1.
|
|
40
|
+
"@lexion-rte/core": "0.1.2",
|
|
41
|
+
"@lexion-rte/web": "0.1.2"
|
|
42
42
|
},
|
|
43
43
|
"scripts": {
|
|
44
44
|
"build": "tsc -p tsconfig.json",
|