@lexion-rte/angular 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/angular
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
@@ -1,10 +1,14 @@
1
1
  # @lexion-rte/angular
2
2
 
3
- Angular adapter utilities for Lexion.
3
+ Angular integration helpers for Lexion.
4
4
 
5
- ## What It Is
5
+ ## Overview
6
6
 
7
- `@lexion-rte/angular` provides `createLexionAngularAdapter` to attach/detach the editor and bridge value/touched callbacks.
7
+ `@lexion-rte/angular` provides an adapter that:
8
+
9
+ - attaches/detaches editor lifecycle to Angular components
10
+ - supports value updates and read-only toggling
11
+ - exposes hooks compatible with form-style change/touched flow
8
12
 
9
13
  ## Install
10
14
 
@@ -12,7 +16,25 @@ Angular adapter utilities for Lexion.
12
16
  pnpm add @lexion-rte/angular @angular/core @angular/forms
13
17
  ```
14
18
 
15
- ## Usage
19
+ ## Adapter API
20
+
21
+ Create adapter:
22
+
23
+ - `createLexionAngularAdapter(options?)`
24
+
25
+ Main methods:
26
+
27
+ - `attach(element)`
28
+ - `detach()`
29
+ - `update({ value?, readOnly?, onChange? })`
30
+ - `writeValue(value)`
31
+ - `setDisabledState(disabled)`
32
+ - `registerOnChange(handler)`
33
+ - `registerOnTouched(handler)`
34
+ - `markAsTouched()`
35
+ - `destroy()`
36
+
37
+ ## Component Lifecycle Example
16
38
 
17
39
  ```ts
18
40
  import { AfterViewInit, Component, ElementRef, OnDestroy, ViewChild } from "@angular/core";
@@ -26,7 +48,11 @@ export class EditorComponent implements AfterViewInit, OnDestroy {
26
48
  @ViewChild("editorHost", { static: true })
27
49
  private editorHost!: ElementRef<HTMLElement>;
28
50
 
29
- private readonly adapter = createLexionAngularAdapter();
51
+ private readonly adapter = createLexionAngularAdapter({
52
+ onChange: (value) => {
53
+ console.log("changed", value);
54
+ }
55
+ });
30
56
 
31
57
  ngAfterViewInit(): void {
32
58
  this.adapter.attach(this.editorHost.nativeElement);
@@ -38,3 +64,7 @@ export class EditorComponent implements AfterViewInit, OnDestroy {
38
64
  }
39
65
  ```
40
66
 
67
+ ## Notes
68
+
69
+ - `attach()` is idempotent for the same element.
70
+ - Use `setDisabledState(true)` for read-only behavior in form-driven components.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lexion-rte/angular",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Angular adapter utilities for the Lexion editor.",
5
5
  "private": false,
6
6
  "type": "module",
@@ -38,8 +38,8 @@
38
38
  "@angular/forms": "^17.0.0 || ^18.0.0 || ^19.0.0"
39
39
  },
40
40
  "dependencies": {
41
- "@lexion-rte/core": "0.1.1",
42
- "@lexion-rte/web": "0.1.1"
41
+ "@lexion-rte/core": "0.1.2",
42
+ "@lexion-rte/web": "0.1.2"
43
43
  },
44
44
  "scripts": {
45
45
  "build": "tsc -p tsconfig.json",