@trixwell/ngx-parl 1.0.0 → 1.0.1

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.
Files changed (2) hide show
  1. package/README.md +58 -42
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,63 +1,79 @@
1
1
  # NgxParl
2
2
 
3
- This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 20.3.0.
3
+ This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 20.3.6.
4
4
 
5
- ## Code scaffolding
5
+ ## Overview
6
6
 
7
- Angular CLI includes powerful code scaffolding tools. To generate a new component, run:
7
+ ![img_1.png](img_1.png)
8
8
 
9
- ```bash
10
- ng generate component component-name
11
- ```
12
-
13
- For a complete list of available schematics (such as `components`, `directives`, or `pipes`), run:
9
+ NgxParl is an Angular chat component that renders a fully interactive, customizable messaging interface. It supports features such as real-time message updates from external sources, sending and editing messages, deleting messages, day separators, and smooth auto-scrolling. The component is backend-agnostic, works with any data source, and integrates seamlessly with Angular Material, making it easy to plug into different projects as an open-source chat UI.
14
10
 
15
- ```bash
16
- ng generate --help
17
- ```
11
+ # GitHub Repository: [Trixwell/parl](https://github.com/Trixwell/parl)
18
12
 
19
- ## Building
13
+ ## Installation
14
+ To use NgxParl, ensure you have Angular and Angular Material installed. Then, import the component into your module:
20
15
 
21
- To build the library, run:
22
-
23
- ```bash
24
- ng build ngx-parl
16
+ ```
17
+ npm install @trixwell/ngx-parl
25
18
  ```
26
19
 
27
- This command will compile your project, and the build artifacts will be placed in the `dist/` directory.
20
+ ## Required peer dependencies:
28
21
 
29
- ### Publishing the Library
22
+ ```
23
+ npm install @angular/material
24
+ ```
30
25
 
31
- Once the project is built, you can publish your library by following these steps:
26
+ In your app.module.ts:
32
27
 
33
- 1. Navigate to the `dist` directory:
34
- ```bash
35
- cd dist/ngx-parl
36
- ```
28
+ ```
29
+ import { NgxParl } from 'ngx-parl';
30
+
31
+ @NgModule({
32
+ declarations: [AppComponent],
33
+ imports: [NgxParl],
34
+ bootstrap: [AppComponent],
35
+ })
36
+ export class AppModule {}
37
+ ```
37
38
 
38
- 2. Run the `npm publish` command to publish your library to the npm registry:
39
- ```bash
40
- npm publish
41
- ```
39
+ Signal Data
42
40
 
43
- ## Running unit tests
41
+ | Name | Type | Description |
42
+ |:-------------:|:-------------:|:-----------------------------------------------------------------:|
43
+ | header | boolean | Display the chat title with the name of the interlocutor |
44
+ | messageList | ChatMessage[] | List of chat messages, user information |
45
+ | messageUpdate | ChatMessage | Subject / Observable / Signal, який надсилає нове повідомлення |
44
46
 
45
- To execute unit tests with the [Karma](https://karma-runner.github.io) test runner, use the following command:
47
+ # Example Usage
46
48
 
47
- ```bash
48
- ng test
49
+ ## Component Setup
49
50
  ```
50
-
51
- ## Running end-to-end tests
52
-
53
- For end-to-end (e2e) testing, run:
54
-
55
- ```bash
56
- ng e2e
51
+ public header = input<boolean>(true);
52
+ public messageList = model<ChatMessage[]>([]);
53
+ public messageUpdate = model<ChatMessage>();
57
54
  ```
58
55
 
59
- Angular CLI does not come with an end-to-end testing framework by default. You can choose one that suits your needs.
60
-
61
- ## Additional Resources
56
+ ## Entity
57
+ ```
58
+ export interface ChatMessageDTO {
59
+ id: number;
60
+ chat_id: number;
61
+ cr_time: string; // ISO or 'YYYY-MM-DD HH:mm:ss'
62
+ type: ChatMessageType;
63
+ user: string;
64
+ content: string;
65
+ avatar?: string | null;
66
+ file_path?: string[] | null;
67
+ checked?: boolean | null;
68
+ }
69
+
70
+ export type ChatMessageType = 'incoming' | 'outgoing';
71
+ ```
62
72
 
63
- For more information on using the Angular CLI, including detailed command references, visit the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page.
73
+ ## Template
74
+ ```
75
+ <ngx-parl [header]="header()"
76
+ [(messageList)]="messageList"
77
+ [(messageUpdate)]="messageUpdate">
78
+ </ngx-parl>
79
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trixwell/ngx-parl",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "license": "LGPL-3.0",
5
5
  "description": "Highly customizable Angular Material chat component",
6
6
  "keywords": [