@lexion-rte/solid 0.1.1 → 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 CHANGED
@@ -1,5 +1,14 @@
1
1
  # @lexion-rte/solid
2
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
+
3
12
  ## 0.1.1
4
13
 
5
14
  ### Patch Changes
package/README.md CHANGED
@@ -2,9 +2,9 @@
2
2
 
3
3
  SolidJS adapter utilities for Lexion.
4
4
 
5
- ## What It Is
5
+ ## Overview
6
6
 
7
- `@lexion-rte/solid` provides `createLexionSolidAdapter` for mounting and controlling the editor from Solid lifecycle hooks.
7
+ `@lexion-rte/solid` provides an imperative adapter for Solid lifecycle integration.
8
8
 
9
9
  ## Install
10
10
 
@@ -12,7 +12,22 @@ SolidJS adapter utilities for Lexion.
12
12
  pnpm add @lexion-rte/solid solid-js
13
13
  ```
14
14
 
15
- ## Usage
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
16
31
 
17
32
  ```ts
18
33
  import { createSignal, createEffect, onCleanup, onMount } from "solid-js";
@@ -26,8 +41,9 @@ const adapter = createLexionSolidAdapter({
26
41
 
27
42
  let host!: HTMLDivElement;
28
43
 
29
- onMount(() => adapter.mount(host));
30
- onCleanup(() => adapter.destroy());
44
+ onMount(() => {
45
+ adapter.mount(host);
46
+ });
31
47
 
32
48
  createEffect(() => {
33
49
  const nextValue = value();
@@ -35,5 +51,13 @@ createEffect(() => {
35
51
  adapter.update({ value: nextValue });
36
52
  }
37
53
  });
54
+
55
+ onCleanup(() => {
56
+ adapter.destroy();
57
+ });
38
58
  ```
39
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.1",
3
+ "version": "0.1.2",
4
4
  "description": "SolidJS adapter utilities for the Lexion editor.",
5
5
  "private": false,
6
6
  "type": "module",
@@ -37,8 +37,8 @@
37
37
  "solid-js": "^1.8.0"
38
38
  },
39
39
  "dependencies": {
40
- "@lexion-rte/web": "0.1.1",
41
- "@lexion-rte/core": "0.1.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",