@acorex/components 21.0.0-next.3 โ 21.0.0-next.31
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/accordion/index.d.ts +0 -1
- package/autocomplete/index.d.ts +23 -9
- package/button/index.d.ts +38 -17
- package/chips/index.d.ts +3 -8
- package/code-editor/README.md +291 -1
- package/code-editor/index.d.ts +260 -12
- package/command/index.d.ts +1 -0
- package/conversation2/README.md +426 -0
- package/conversation2/index.d.ts +6139 -0
- package/data-table/index.d.ts +79 -7
- package/dialog/index.d.ts +1 -1
- package/drawer/README.md +2 -2
- package/drawer/index.d.ts +33 -57
- package/drawer-legacy/README.md +3 -0
- package/drawer-legacy/index.d.ts +86 -0
- package/editor/README.md +3 -0
- package/editor/index.d.ts +79 -0
- package/fesm2022/acorex-components-accordion.mjs +19 -24
- package/fesm2022/acorex-components-accordion.mjs.map +1 -1
- package/fesm2022/acorex-components-action-sheet.mjs +12 -12
- package/fesm2022/acorex-components-action-sheet.mjs.map +1 -1
- package/fesm2022/acorex-components-alert.mjs +14 -14
- package/fesm2022/acorex-components-alert.mjs.map +1 -1
- package/fesm2022/acorex-components-aspect-ratio.mjs +4 -4
- package/fesm2022/acorex-components-aspect-ratio.mjs.map +1 -1
- package/fesm2022/acorex-components-audio-wave.mjs +12 -11
- package/fesm2022/acorex-components-audio-wave.mjs.map +1 -1
- package/fesm2022/acorex-components-autocomplete.mjs +30 -13
- package/fesm2022/acorex-components-autocomplete.mjs.map +1 -1
- package/fesm2022/acorex-components-avatar.mjs +13 -13
- package/fesm2022/acorex-components-avatar.mjs.map +1 -1
- package/fesm2022/acorex-components-badge.mjs +10 -10
- package/fesm2022/acorex-components-badge.mjs.map +1 -1
- package/fesm2022/acorex-components-bottom-navigation.mjs +12 -12
- package/fesm2022/acorex-components-bottom-navigation.mjs.map +1 -1
- package/fesm2022/acorex-components-breadcrumbs.mjs +12 -12
- package/fesm2022/acorex-components-breadcrumbs.mjs.map +1 -1
- package/fesm2022/acorex-components-button-group.mjs +17 -19
- package/fesm2022/acorex-components-button-group.mjs.map +1 -1
- package/fesm2022/acorex-components-button.mjs +78 -29
- package/fesm2022/acorex-components-button.mjs.map +1 -1
- package/fesm2022/acorex-components-calendar.mjs +18 -18
- package/fesm2022/acorex-components-calendar.mjs.map +1 -1
- package/fesm2022/acorex-components-check-box.mjs +11 -11
- package/fesm2022/acorex-components-check-box.mjs.map +1 -1
- package/fesm2022/acorex-components-chips.mjs +12 -14
- package/fesm2022/acorex-components-chips.mjs.map +1 -1
- package/fesm2022/acorex-components-circular-progress.mjs +13 -11
- package/fesm2022/acorex-components-circular-progress.mjs.map +1 -1
- package/fesm2022/acorex-components-code-editor.mjs +494 -162
- package/fesm2022/acorex-components-code-editor.mjs.map +1 -1
- package/fesm2022/acorex-components-collapse.mjs +13 -28
- package/fesm2022/acorex-components-collapse.mjs.map +1 -1
- package/fesm2022/acorex-components-color-box.mjs +11 -11
- package/fesm2022/acorex-components-color-box.mjs.map +1 -1
- package/fesm2022/acorex-components-color-palette.mjs +32 -32
- package/fesm2022/acorex-components-color-palette.mjs.map +1 -1
- package/fesm2022/acorex-components-command.mjs +18 -11
- package/fesm2022/acorex-components-command.mjs.map +1 -1
- package/fesm2022/acorex-components-comment.mjs +34 -34
- package/fesm2022/acorex-components-comment.mjs.map +1 -1
- package/fesm2022/acorex-components-conversation.mjs +56 -65
- package/fesm2022/acorex-components-conversation.mjs.map +1 -1
- package/fesm2022/acorex-components-conversation2.mjs +17641 -0
- package/fesm2022/acorex-components-conversation2.mjs.map +1 -0
- package/fesm2022/acorex-components-cron-job.mjs +53 -53
- package/fesm2022/acorex-components-cron-job.mjs.map +1 -1
- package/fesm2022/acorex-components-data-list.mjs +5 -5
- package/fesm2022/acorex-components-data-list.mjs.map +1 -1
- package/fesm2022/acorex-components-data-pager.mjs +53 -41
- package/fesm2022/acorex-components-data-pager.mjs.map +1 -1
- package/fesm2022/acorex-components-data-table.mjs +462 -105
- package/fesm2022/acorex-components-data-table.mjs.map +1 -1
- package/fesm2022/acorex-components-datetime-box.mjs +10 -10
- package/fesm2022/acorex-components-datetime-box.mjs.map +1 -1
- package/fesm2022/acorex-components-datetime-input.mjs +8 -8
- package/fesm2022/acorex-components-datetime-input.mjs.map +1 -1
- package/fesm2022/acorex-components-datetime-picker.mjs +11 -11
- package/fesm2022/acorex-components-datetime-picker.mjs.map +1 -1
- package/fesm2022/acorex-components-decorators.mjs +96 -54
- package/fesm2022/acorex-components-decorators.mjs.map +1 -1
- package/fesm2022/acorex-components-dialog.mjs +26 -16
- package/fesm2022/acorex-components-dialog.mjs.map +1 -1
- package/fesm2022/acorex-components-drawer-legacy.mjs +218 -0
- package/fesm2022/acorex-components-drawer-legacy.mjs.map +1 -0
- package/fesm2022/acorex-components-drawer.mjs +66 -150
- package/fesm2022/acorex-components-drawer.mjs.map +1 -1
- package/fesm2022/acorex-components-dropdown-button.mjs +9 -9
- package/fesm2022/acorex-components-dropdown-button.mjs.map +1 -1
- package/fesm2022/acorex-components-dropdown.mjs +18 -16
- package/fesm2022/acorex-components-dropdown.mjs.map +1 -1
- package/fesm2022/acorex-components-editor.mjs +195 -0
- package/fesm2022/acorex-components-editor.mjs.map +1 -0
- package/fesm2022/acorex-components-file-explorer.mjs +28 -28
- package/fesm2022/acorex-components-file-explorer.mjs.map +1 -1
- package/fesm2022/acorex-components-flow-chart.mjs +18 -18
- package/fesm2022/acorex-components-flow-chart.mjs.map +1 -1
- package/fesm2022/acorex-components-form.mjs +52 -35
- package/fesm2022/acorex-components-form.mjs.map +1 -1
- package/fesm2022/acorex-components-grid-layout-builder.mjs +14 -15
- package/fesm2022/acorex-components-grid-layout-builder.mjs.map +1 -1
- package/fesm2022/acorex-components-image-editor.mjs +166 -126
- package/fesm2022/acorex-components-image-editor.mjs.map +1 -1
- package/fesm2022/acorex-components-image.mjs +10 -10
- package/fesm2022/acorex-components-image.mjs.map +1 -1
- package/fesm2022/acorex-components-json-viewer.mjs +9 -9
- package/fesm2022/acorex-components-json-viewer.mjs.map +1 -1
- package/fesm2022/acorex-components-kanban.mjs +9 -7
- package/fesm2022/acorex-components-kanban.mjs.map +1 -1
- package/fesm2022/acorex-components-kbd.mjs +8 -8
- package/fesm2022/acorex-components-kbd.mjs.map +1 -1
- package/fesm2022/acorex-components-label.mjs +9 -9
- package/fesm2022/acorex-components-label.mjs.map +1 -1
- package/fesm2022/acorex-components-list.mjs +10 -10
- package/fesm2022/acorex-components-list.mjs.map +1 -1
- package/fesm2022/acorex-components-loading-dialog.mjs +22 -13
- package/fesm2022/acorex-components-loading-dialog.mjs.map +1 -1
- package/fesm2022/acorex-components-loading.mjs +23 -23
- package/fesm2022/acorex-components-loading.mjs.map +1 -1
- package/fesm2022/acorex-components-map.mjs +16 -15
- package/fesm2022/acorex-components-map.mjs.map +1 -1
- package/fesm2022/acorex-components-media-viewer.mjs +78 -97
- package/fesm2022/acorex-components-media-viewer.mjs.map +1 -1
- package/fesm2022/acorex-components-menu.mjs +24 -24
- package/fesm2022/acorex-components-menu.mjs.map +1 -1
- package/fesm2022/{acorex-components-modal-acorex-components-modal-h5Y-qcbh.mjs โ acorex-components-modal-acorex-components-modal-BmmAkCKJ.mjs} +24 -24
- package/fesm2022/acorex-components-modal-acorex-components-modal-BmmAkCKJ.mjs.map +1 -0
- package/fesm2022/acorex-components-modal-modal-content.component-5GqTzNOs.mjs +214 -0
- package/fesm2022/acorex-components-modal-modal-content.component-5GqTzNOs.mjs.map +1 -0
- package/fesm2022/acorex-components-modal.mjs +1 -1
- package/fesm2022/acorex-components-navbar.mjs +9 -9
- package/fesm2022/acorex-components-navbar.mjs.map +1 -1
- package/fesm2022/acorex-components-notification.mjs +16 -23
- package/fesm2022/acorex-components-notification.mjs.map +1 -1
- package/fesm2022/acorex-components-number-box-legacy.mjs +412 -0
- package/fesm2022/acorex-components-number-box-legacy.mjs.map +1 -0
- package/fesm2022/acorex-components-number-box.mjs +98 -331
- package/fesm2022/acorex-components-number-box.mjs.map +1 -1
- package/fesm2022/acorex-components-otp.mjs +10 -10
- package/fesm2022/acorex-components-otp.mjs.map +1 -1
- package/fesm2022/acorex-components-page.mjs +10 -10
- package/fesm2022/acorex-components-page.mjs.map +1 -1
- package/fesm2022/acorex-components-paint.mjs +35 -40
- package/fesm2022/acorex-components-paint.mjs.map +1 -1
- package/fesm2022/acorex-components-password-box.mjs +13 -13
- package/fesm2022/acorex-components-password-box.mjs.map +1 -1
- package/fesm2022/acorex-components-pdf-reader.mjs +8 -8
- package/fesm2022/acorex-components-pdf-reader.mjs.map +1 -1
- package/fesm2022/acorex-components-phone-box.mjs +10 -10
- package/fesm2022/acorex-components-phone-box.mjs.map +1 -1
- package/fesm2022/acorex-components-picker.mjs +17 -17
- package/fesm2022/acorex-components-picker.mjs.map +1 -1
- package/fesm2022/acorex-components-popover.mjs +12 -12
- package/fesm2022/acorex-components-popover.mjs.map +1 -1
- package/fesm2022/acorex-components-popup.mjs +13 -13
- package/fesm2022/acorex-components-popup.mjs.map +1 -1
- package/fesm2022/acorex-components-progress-bar.mjs +11 -9
- package/fesm2022/acorex-components-progress-bar.mjs.map +1 -1
- package/fesm2022/acorex-components-qrcode.mjs +8 -8
- package/fesm2022/acorex-components-qrcode.mjs.map +1 -1
- package/fesm2022/acorex-components-query-builder.mjs +9 -9
- package/fesm2022/acorex-components-query-builder.mjs.map +1 -1
- package/fesm2022/acorex-components-radio.mjs +7 -7
- package/fesm2022/acorex-components-radio.mjs.map +1 -1
- package/fesm2022/acorex-components-rail-navigation.mjs +40 -38
- package/fesm2022/acorex-components-rail-navigation.mjs.map +1 -1
- package/fesm2022/acorex-components-range-slider.mjs +11 -11
- package/fesm2022/acorex-components-range-slider.mjs.map +1 -1
- package/fesm2022/acorex-components-rate-picker.mjs +20 -35
- package/fesm2022/acorex-components-rate-picker.mjs.map +1 -1
- package/fesm2022/acorex-components-rest-api-generator.mjs +23 -23
- package/fesm2022/acorex-components-rest-api-generator.mjs.map +1 -1
- package/fesm2022/acorex-components-result.mjs +8 -8
- package/fesm2022/acorex-components-result.mjs.map +1 -1
- package/fesm2022/acorex-components-routing-progress.mjs +8 -8
- package/fesm2022/acorex-components-routing-progress.mjs.map +1 -1
- package/fesm2022/acorex-components-rrule.mjs +111 -16
- package/fesm2022/acorex-components-rrule.mjs.map +1 -1
- package/fesm2022/acorex-components-scheduler-picker.mjs +2339 -0
- package/fesm2022/acorex-components-scheduler-picker.mjs.map +1 -0
- package/fesm2022/acorex-components-scheduler.mjs +52 -52
- package/fesm2022/acorex-components-scheduler.mjs.map +1 -1
- package/fesm2022/acorex-components-scss.mjs +4 -4
- package/fesm2022/acorex-components-scss.mjs.map +1 -1
- package/fesm2022/acorex-components-search-box.mjs +23 -12
- package/fesm2022/acorex-components-search-box.mjs.map +1 -1
- package/fesm2022/acorex-components-select-box.mjs +36 -17
- package/fesm2022/acorex-components-select-box.mjs.map +1 -1
- package/fesm2022/acorex-components-selection-list-2.mjs +10 -10
- package/fesm2022/acorex-components-selection-list-2.mjs.map +1 -1
- package/fesm2022/acorex-components-selection-list.mjs +10 -10
- package/fesm2022/acorex-components-selection-list.mjs.map +1 -1
- package/fesm2022/acorex-components-side-menu.mjs +31 -38
- package/fesm2022/acorex-components-side-menu.mjs.map +1 -1
- package/fesm2022/acorex-components-skeleton.mjs +8 -8
- package/fesm2022/acorex-components-skeleton.mjs.map +1 -1
- package/fesm2022/acorex-components-slider.mjs +11 -11
- package/fesm2022/acorex-components-slider.mjs.map +1 -1
- package/fesm2022/acorex-components-sliding-item.mjs +17 -17
- package/fesm2022/acorex-components-sliding-item.mjs.map +1 -1
- package/fesm2022/acorex-components-step-wizard.mjs +16 -16
- package/fesm2022/acorex-components-step-wizard.mjs.map +1 -1
- package/fesm2022/acorex-components-switch.mjs +14 -14
- package/fesm2022/acorex-components-switch.mjs.map +1 -1
- package/fesm2022/acorex-components-tabs.mjs +20 -16
- package/fesm2022/acorex-components-tabs.mjs.map +1 -1
- package/fesm2022/acorex-components-tag-box.mjs +51 -21
- package/fesm2022/acorex-components-tag-box.mjs.map +1 -1
- package/fesm2022/acorex-components-tag.mjs +47 -11
- package/fesm2022/acorex-components-tag.mjs.map +1 -1
- package/fesm2022/acorex-components-text-area.mjs +9 -9
- package/fesm2022/acorex-components-text-area.mjs.map +1 -1
- package/fesm2022/acorex-components-text-box.mjs +13 -13
- package/fesm2022/acorex-components-text-box.mjs.map +1 -1
- package/fesm2022/acorex-components-time-duration.mjs +54 -14
- package/fesm2022/acorex-components-time-duration.mjs.map +1 -1
- package/fesm2022/acorex-components-time-line.mjs +14 -29
- package/fesm2022/acorex-components-time-line.mjs.map +1 -1
- package/fesm2022/acorex-components-toast.mjs +14 -14
- package/fesm2022/acorex-components-toast.mjs.map +1 -1
- package/fesm2022/acorex-components-toolbar.mjs +9 -9
- package/fesm2022/acorex-components-toolbar.mjs.map +1 -1
- package/fesm2022/acorex-components-tooltip.mjs +12 -12
- package/fesm2022/acorex-components-tooltip.mjs.map +1 -1
- package/fesm2022/acorex-components-tree-view.mjs +16 -45
- package/fesm2022/acorex-components-tree-view.mjs.map +1 -1
- package/fesm2022/acorex-components-tree2.mjs +689 -0
- package/fesm2022/acorex-components-tree2.mjs.map +1 -0
- package/fesm2022/acorex-components-uploader.mjs +28 -641
- package/fesm2022/acorex-components-uploader.mjs.map +1 -1
- package/fesm2022/acorex-components-video-player.mjs +8 -8
- package/fesm2022/acorex-components-video-player.mjs.map +1 -1
- package/fesm2022/acorex-components-wysiwyg.mjs +213 -462
- package/fesm2022/acorex-components-wysiwyg.mjs.map +1 -1
- package/fesm2022/acorex-components.mjs.map +1 -1
- package/form/index.d.ts +3 -3
- package/grid-layout-builder/index.d.ts +1 -2
- package/image-editor/index.d.ts +8 -5
- package/loading/index.d.ts +1 -1
- package/media-viewer/index.d.ts +2 -3
- package/notification/index.d.ts +0 -2
- package/number-box/README.md +2 -2
- package/number-box/index.d.ts +31 -171
- package/number-box-legacy/README.md +3 -0
- package/number-box-legacy/index.d.ts +191 -0
- package/package.json +53 -26
- package/paint/index.d.ts +1 -6
- package/phone-box/index.d.ts +4 -4
- package/rate-picker/index.d.ts +5 -15
- package/rrule/index.d.ts +96 -1
- package/scheduler-picker/README.md +15 -0
- package/scheduler-picker/index.d.ts +1360 -0
- package/search-box/index.d.ts +6 -1
- package/select-box/index.d.ts +15 -10
- package/side-menu/index.d.ts +3 -2
- package/tag/index.d.ts +8 -2
- package/tag-box/index.d.ts +12 -3
- package/time-duration/index.d.ts +19 -3
- package/tree2/README.md +3 -0
- package/tree2/index.d.ts +337 -0
- package/uploader/index.d.ts +4 -331
- package/wysiwyg/index.d.ts +57 -159
- package/drawer-2/README.md +0 -3
- package/drawer-2/index.d.ts +0 -62
- package/fesm2022/acorex-components-drawer-2.mjs +0 -134
- package/fesm2022/acorex-components-drawer-2.mjs.map +0 -1
- package/fesm2022/acorex-components-modal-acorex-components-modal-h5Y-qcbh.mjs.map +0 -1
- package/fesm2022/acorex-components-modal-modal-content.component-B6tyMLdU.mjs +0 -235
- package/fesm2022/acorex-components-modal-modal-content.component-B6tyMLdU.mjs.map +0 -1
- package/fesm2022/acorex-components-number-box-2.mjs +0 -183
- package/fesm2022/acorex-components-number-box-2.mjs.map +0 -1
- package/number-box-2/README.md +0 -3
- package/number-box-2/index.d.ts +0 -41
|
@@ -0,0 +1,426 @@
|
|
|
1
|
+
# @acorex/components/conversation2
|
|
2
|
+
|
|
3
|
+
A modern, fully-featured conversation/chat component for Angular 18+. Built with signals, standalone components, and extensibility in mind.
|
|
4
|
+
|
|
5
|
+
## ๐ Features
|
|
6
|
+
|
|
7
|
+
- **Real-time Messaging** - Live message updates with WebSocket support
|
|
8
|
+
- **Multiple Message Types** - Text, images, videos, audio, voice, files, locations, stickers, contacts
|
|
9
|
+
- **Rich Interactions** - Reactions, replies, message editing, deletion, forwarding
|
|
10
|
+
- **Group & Private Chats** - Support for 1-on-1 and group conversations
|
|
11
|
+
- **Typing Indicators** - Real-time typing status
|
|
12
|
+
- **Read Receipts** - Message delivery and read status
|
|
13
|
+
- **Infinite Scroll** - Efficient pagination for message history
|
|
14
|
+
- **Search** - Search within conversations and messages
|
|
15
|
+
- **Extensible** - Plugin system for custom message renderers and actions
|
|
16
|
+
- **Responsive** - Mobile-friendly design
|
|
17
|
+
- **Accessibility** - ARIA labels and keyboard navigation
|
|
18
|
+
|
|
19
|
+
## ๐ฆ Installation
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
npm install @acorex/components/conversation2
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## ๐ง Peer Dependencies
|
|
26
|
+
|
|
27
|
+
This package requires the following peer dependencies:
|
|
28
|
+
|
|
29
|
+
### Required Angular Dependencies
|
|
30
|
+
|
|
31
|
+
```json
|
|
32
|
+
{
|
|
33
|
+
"@angular/common": "^18.0.0",
|
|
34
|
+
"@angular/core": "^18.0.0",
|
|
35
|
+
"@angular/forms": "^18.0.0",
|
|
36
|
+
"rxjs": "^7.8.0"
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Required Acorex Dependencies
|
|
41
|
+
|
|
42
|
+
#### Core Packages
|
|
43
|
+
|
|
44
|
+
- `@acorex/cdk/common` - Common utilities and directives
|
|
45
|
+
- `@acorex/core/date-time` - Date and time formatting
|
|
46
|
+
- `@acorex/core/format` - General formatting utilities
|
|
47
|
+
|
|
48
|
+
#### Component Packages
|
|
49
|
+
|
|
50
|
+
- `@acorex/components/avatar` - User avatars
|
|
51
|
+
- `@acorex/components/badge` - Notification badges
|
|
52
|
+
- `@acorex/components/button` - Button components
|
|
53
|
+
- `@acorex/components/decorators` - Decorative elements
|
|
54
|
+
- `@acorex/components/dialog` - Dialog service
|
|
55
|
+
- `@acorex/components/dropdown` - Dropdown panels
|
|
56
|
+
- `@acorex/components/image` - Image components
|
|
57
|
+
- `@acorex/components/label` - Label components
|
|
58
|
+
- `@acorex/components/loading` - Loading indicators
|
|
59
|
+
- `@acorex/components/menu` - Context menus
|
|
60
|
+
- `@acorex/components/popover` - Popover components
|
|
61
|
+
- `@acorex/components/popup` - Popup service
|
|
62
|
+
- `@acorex/components/search-box` - Search functionality
|
|
63
|
+
- `@acorex/components/select-box` - Select dropdowns
|
|
64
|
+
- `@acorex/components/tabs` - Tab components
|
|
65
|
+
- `@acorex/components/text-area` - Text input areas
|
|
66
|
+
- `@acorex/components/text-box` - Text input boxes
|
|
67
|
+
- `@acorex/components/toast` - Toast notifications
|
|
68
|
+
- `@acorex/components/tooltip` - Tooltips
|
|
69
|
+
- `@acorex/components/uploader` - File upload functionality
|
|
70
|
+
|
|
71
|
+
## ๐ฏ Quick Start
|
|
72
|
+
|
|
73
|
+
> **New to Conversation2?** Check out our [5-Minute Quick Start Guide](./docs/QUICK-START.md) for the fastest way to get started!
|
|
74
|
+
|
|
75
|
+
### Detailed Setup
|
|
76
|
+
|
|
77
|
+
### 1. Standalone Application (Recommended)
|
|
78
|
+
|
|
79
|
+
```typescript
|
|
80
|
+
import { ApplicationConfig } from '@angular/core';
|
|
81
|
+
import { provideConversation, AXIndexedDBApi } from '@acorex/components/conversation2';
|
|
82
|
+
|
|
83
|
+
export const appConfig: ApplicationConfig = {
|
|
84
|
+
providers: [
|
|
85
|
+
provideConversation({
|
|
86
|
+
api: AXIndexedDBApi, // or your custom API implementation
|
|
87
|
+
config: {
|
|
88
|
+
pageSize: 20,
|
|
89
|
+
maxFileSize: 10 * 1024 * 1024, // 10MB
|
|
90
|
+
allowedFileTypes: ['image/*', 'video/*', 'audio/*', 'application/pdf'],
|
|
91
|
+
},
|
|
92
|
+
registry: {
|
|
93
|
+
// Optional: Register custom message renderers, actions, etc.
|
|
94
|
+
}
|
|
95
|
+
})
|
|
96
|
+
]
|
|
97
|
+
};
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### 2. NgModule Application (Legacy)
|
|
101
|
+
|
|
102
|
+
```typescript
|
|
103
|
+
import { NgModule } from '@angular/core';
|
|
104
|
+
import { AXConversation2Module, AXIndexedDBApi } from '@acorex/components/conversation2';
|
|
105
|
+
|
|
106
|
+
@NgModule({
|
|
107
|
+
imports: [
|
|
108
|
+
AXConversation2Module.forRoot({
|
|
109
|
+
api: AXIndexedDBApi,
|
|
110
|
+
config: { /* ... */ }
|
|
111
|
+
})
|
|
112
|
+
]
|
|
113
|
+
})
|
|
114
|
+
export class AppModule { }
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### 3. Use in Template
|
|
118
|
+
|
|
119
|
+
```html
|
|
120
|
+
<ax-conversation-container></ax-conversation-container>
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## ๐ API Implementation
|
|
124
|
+
|
|
125
|
+
You must provide an API implementation that extends `AXConversationApi`:
|
|
126
|
+
|
|
127
|
+
```typescript
|
|
128
|
+
import { Injectable } from '@angular/core';
|
|
129
|
+
import { HttpClient } from '@angular/common/http';
|
|
130
|
+
import { AXConversationApi, AXPagination, AXPaginatedResult } from '@acorex/components/conversation2';
|
|
131
|
+
|
|
132
|
+
@Injectable()
|
|
133
|
+
export class MyConversationApi extends AXConversationApi {
|
|
134
|
+
constructor(private http: HttpClient) {
|
|
135
|
+
super();
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
async connect(): Promise<void> {
|
|
139
|
+
// Initialize WebSocket connection
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
async fetchConversations(pagination: AXPagination): Promise<AXPaginatedResult<AXConversation>> {
|
|
143
|
+
const response = await this.http.get('/api/conversations', {
|
|
144
|
+
params: { page: pagination.page, pageSize: pagination.pageSize }
|
|
145
|
+
}).toPromise();
|
|
146
|
+
return response;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
// Implement other required methods...
|
|
150
|
+
}
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
### Built-in API Implementations
|
|
154
|
+
|
|
155
|
+
#### IndexedDB API (Development/Demo)
|
|
156
|
+
|
|
157
|
+
```typescript
|
|
158
|
+
import { AXIndexedDBApi } from '@acorex/components/conversation2';
|
|
159
|
+
|
|
160
|
+
// Provides in-memory storage with sample data
|
|
161
|
+
// Perfect for development and demos
|
|
162
|
+
provideConversation({ api: AXIndexedDBApi })
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
#### IndexedDB with AI API (AI-Powered Demo)
|
|
166
|
+
|
|
167
|
+
```typescript
|
|
168
|
+
import { AXIndexedDBAIApi } from '@acorex/components/conversation2';
|
|
169
|
+
|
|
170
|
+
// Includes AI-powered auto-responses
|
|
171
|
+
provideConversation({ api: AXIndexedDBAIApi })
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
## โ๏ธ Configuration
|
|
175
|
+
|
|
176
|
+
### Conversation Config
|
|
177
|
+
|
|
178
|
+
```typescript
|
|
179
|
+
interface AXConversationConfig {
|
|
180
|
+
// Pagination
|
|
181
|
+
pageSize?: number; // Default: 20
|
|
182
|
+
infiniteScrollThreshold?: number; // Default: 200px
|
|
183
|
+
scrollThreshold?: number; // Default: 100px
|
|
184
|
+
|
|
185
|
+
// File Upload
|
|
186
|
+
maxFileSize?: number; // Default: 10MB
|
|
187
|
+
allowedFileTypes?: string[]; // Default: all types
|
|
188
|
+
|
|
189
|
+
// UI Behavior
|
|
190
|
+
messageHighlightDuration?: number; // Default: 2000ms
|
|
191
|
+
typingIndicatorTimeout?: number; // Default: 3000ms
|
|
192
|
+
|
|
193
|
+
// Features
|
|
194
|
+
enableReactions?: boolean; // Default: true
|
|
195
|
+
enableReplies?: boolean; // Default: true
|
|
196
|
+
enableEditing?: boolean; // Default: true
|
|
197
|
+
enableDeletion?: boolean; // Default: true
|
|
198
|
+
}
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
### Registry Configuration
|
|
202
|
+
|
|
203
|
+
```typescript
|
|
204
|
+
interface AXRegistryConfiguration {
|
|
205
|
+
messageRenderers?: AXMessageRenderer[];
|
|
206
|
+
messageActions?: AXMessageAction[];
|
|
207
|
+
composerActions?: AXComposerAction[];
|
|
208
|
+
composerTabs?: AXComposerTab[];
|
|
209
|
+
conversationTabs?: AXConversationTab[];
|
|
210
|
+
infoBarActions?: AXInfoBarAction[];
|
|
211
|
+
conversationItemActions?: AXConversationItemAction[];
|
|
212
|
+
}
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
## ๐จ Customization
|
|
216
|
+
|
|
217
|
+
### Custom Message Renderer
|
|
218
|
+
|
|
219
|
+
```typescript
|
|
220
|
+
import { Component, input } from '@angular/core';
|
|
221
|
+
import { AXMessageRenderer } from '@acorex/components/conversation2';
|
|
222
|
+
|
|
223
|
+
@Component({
|
|
224
|
+
selector: 'my-custom-renderer',
|
|
225
|
+
template: `<div>{{ message().payload.customData }}</div>`
|
|
226
|
+
})
|
|
227
|
+
export class MyCustomRendererComponent {
|
|
228
|
+
message = input.required<AXMessage>();
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
const myRenderer: AXMessageRenderer = {
|
|
232
|
+
type: 'custom',
|
|
233
|
+
component: MyCustomRendererComponent,
|
|
234
|
+
priority: 100
|
|
235
|
+
};
|
|
236
|
+
|
|
237
|
+
// Register in config
|
|
238
|
+
provideConversation({
|
|
239
|
+
api: MyApi,
|
|
240
|
+
registry: {
|
|
241
|
+
messageRenderers: [myRenderer]
|
|
242
|
+
}
|
|
243
|
+
});
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
### Custom Message Action
|
|
247
|
+
|
|
248
|
+
```typescript
|
|
249
|
+
const forwardAction: AXMessageAction = {
|
|
250
|
+
id: 'forward',
|
|
251
|
+
label: 'Forward',
|
|
252
|
+
icon: 'forward',
|
|
253
|
+
shortcut: 'Ctrl+F',
|
|
254
|
+
enabled: (message, user) => message.senderId === user.id,
|
|
255
|
+
execute: async (message, service) => {
|
|
256
|
+
// Forward logic
|
|
257
|
+
}
|
|
258
|
+
};
|
|
259
|
+
|
|
260
|
+
provideConversation({
|
|
261
|
+
api: MyApi,
|
|
262
|
+
registry: {
|
|
263
|
+
messageActions: [forwardAction]
|
|
264
|
+
}
|
|
265
|
+
});
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
## ๐ฑ Components
|
|
269
|
+
|
|
270
|
+
### Main Components
|
|
271
|
+
|
|
272
|
+
- `<ax-conversation-container>` - Full conversation UI with sidebar, messages, and composer
|
|
273
|
+
- `<ax-conversation-sidebar>` - Conversation list sidebar
|
|
274
|
+
- `<ax-conversation-message-list>` - Message list with virtual scrolling
|
|
275
|
+
- `<ax-conversation-composer>` - Message input area
|
|
276
|
+
- `<ax-conversation-info-bar>` - Conversation header with actions
|
|
277
|
+
|
|
278
|
+
### Usage Examples
|
|
279
|
+
|
|
280
|
+
```html
|
|
281
|
+
<!-- Full conversation UI -->
|
|
282
|
+
<ax-conversation-container></ax-conversation-container>
|
|
283
|
+
|
|
284
|
+
<!-- Custom layout -->
|
|
285
|
+
<div class="my-chat-layout">
|
|
286
|
+
<ax-conversation-sidebar></ax-conversation-sidebar>
|
|
287
|
+
<div class="chat-main">
|
|
288
|
+
<ax-conversation-info-bar></ax-conversation-info-bar>
|
|
289
|
+
<ax-conversation-message-list></ax-conversation-message-list>
|
|
290
|
+
<ax-conversation-composer></ax-conversation-composer>
|
|
291
|
+
</div>
|
|
292
|
+
</div>
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
## ๐ญ Services
|
|
296
|
+
|
|
297
|
+
### AXConversationService
|
|
298
|
+
|
|
299
|
+
Main service for conversation operations:
|
|
300
|
+
|
|
301
|
+
```typescript
|
|
302
|
+
import { inject } from '@angular/core';
|
|
303
|
+
import { AXConversationService } from '@acorex/components/conversation2';
|
|
304
|
+
|
|
305
|
+
export class MyComponent {
|
|
306
|
+
private conversationService = inject(AXConversationService);
|
|
307
|
+
|
|
308
|
+
async sendMessage() {
|
|
309
|
+
await this.conversationService.sendMessage({
|
|
310
|
+
conversationId: 'conv-123',
|
|
311
|
+
type: 'text',
|
|
312
|
+
payload: { text: 'Hello!' }
|
|
313
|
+
});
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
async createConversation() {
|
|
317
|
+
const conv = await this.conversationService.createConversation(
|
|
318
|
+
['user-1', 'user-2'],
|
|
319
|
+
'private'
|
|
320
|
+
);
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
## ๐งช Testing
|
|
326
|
+
|
|
327
|
+
```typescript
|
|
328
|
+
import { TestBed } from '@angular/core/testing';
|
|
329
|
+
import { provideConversation, AXConversationService } from '@acorex/components/conversation2';
|
|
330
|
+
import { MockConversationApi } from './mocks/mock-api';
|
|
331
|
+
|
|
332
|
+
describe('MyComponent', () => {
|
|
333
|
+
beforeEach(() => {
|
|
334
|
+
TestBed.configureTestingModule({
|
|
335
|
+
providers: [
|
|
336
|
+
provideConversation({ api: MockConversationApi })
|
|
337
|
+
]
|
|
338
|
+
});
|
|
339
|
+
});
|
|
340
|
+
|
|
341
|
+
it('should send message', async () => {
|
|
342
|
+
const service = TestBed.inject(AXConversationService);
|
|
343
|
+
const message = await service.sendMessage({
|
|
344
|
+
conversationId: 'test',
|
|
345
|
+
type: 'text',
|
|
346
|
+
payload: { text: 'Test' }
|
|
347
|
+
});
|
|
348
|
+
expect(message).toBeDefined();
|
|
349
|
+
});
|
|
350
|
+
});
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
## ๐ฏ Message Types
|
|
354
|
+
|
|
355
|
+
Supported message types out of the box:
|
|
356
|
+
|
|
357
|
+
- **text** - Plain text messages
|
|
358
|
+
- **image** - Image messages with thumbnails
|
|
359
|
+
- **video** - Video messages with playback
|
|
360
|
+
- **audio** - Audio file messages
|
|
361
|
+
- **voice** - Voice recordings
|
|
362
|
+
- **file** - Generic file attachments
|
|
363
|
+
- **location** - Location sharing
|
|
364
|
+
- **sticker** - Sticker messages
|
|
365
|
+
- **contact** - Contact card sharing
|
|
366
|
+
- **system** - System notifications
|
|
367
|
+
|
|
368
|
+
## ๐ Security Considerations
|
|
369
|
+
|
|
370
|
+
- **API Keys**: Never hardcode API keys in source code. Use environment variables or injection tokens.
|
|
371
|
+
- **File Upload**: Validate file types and sizes on both client and server.
|
|
372
|
+
- **XSS Protection**: All user content is sanitized by default.
|
|
373
|
+
- **Authentication**: Implement proper authentication in your API layer.
|
|
374
|
+
|
|
375
|
+
## ๐ Performance Tips
|
|
376
|
+
|
|
377
|
+
1. **Virtual Scrolling**: Enabled by default for large message lists
|
|
378
|
+
2. **Lazy Loading**: Images and media are loaded on demand
|
|
379
|
+
3. **Pagination**: Messages are loaded in pages to reduce initial load
|
|
380
|
+
4. **Debouncing**: Typing indicators are debounced to reduce network traffic
|
|
381
|
+
5. **Memoization**: Use computed signals for expensive calculations
|
|
382
|
+
|
|
383
|
+
## ๐ Troubleshooting
|
|
384
|
+
|
|
385
|
+
### Common Issues
|
|
386
|
+
|
|
387
|
+
**Issue**: Messages not appearing
|
|
388
|
+
|
|
389
|
+
- Check if API is connected: `conversationService.connectionStatus$()`
|
|
390
|
+
- Verify API implementation returns correct data structure
|
|
391
|
+
|
|
392
|
+
**Issue**: File upload fails
|
|
393
|
+
|
|
394
|
+
- Check `maxFileSize` and `allowedFileTypes` configuration
|
|
395
|
+
- Verify API `uploadFile()` implementation
|
|
396
|
+
|
|
397
|
+
**Issue**: Styling issues
|
|
398
|
+
|
|
399
|
+
- Ensure all Acorex component styles are imported
|
|
400
|
+
- Check for CSS conflicts with global styles
|
|
401
|
+
|
|
402
|
+
## ๐ Additional Resources
|
|
403
|
+
|
|
404
|
+
- [Quick Start Guide](./docs/QUICK-START.md) - Get started in 5 minutes
|
|
405
|
+
- [Architecture Overview](./docs/ARCHITECTURE-OVERVIEW.md) - Understand the module structure
|
|
406
|
+
- [API Documentation](./docs/ARCHITECTURE-APIS.md) - Implement custom backends
|
|
407
|
+
- [Component Guide](./docs/ARCHITECTURE-COMPONENTS.md) - Learn about components
|
|
408
|
+
- [Plugin System](./docs/ARCHITECTURE-PLUGINS.md) - Extend functionality
|
|
409
|
+
- [Usage Guide](./docs/USAGE-GUIDE.md) - Advanced usage patterns
|
|
410
|
+
|
|
411
|
+
## ๐ค Contributing
|
|
412
|
+
|
|
413
|
+
Contributions are welcome! Please read our [Contributing Guide](./CONTRIBUTING.md) for details.
|
|
414
|
+
|
|
415
|
+
## ๐ License
|
|
416
|
+
|
|
417
|
+
MIT License - see LICENSE file for details
|
|
418
|
+
|
|
419
|
+
## ๐ Changelog
|
|
420
|
+
|
|
421
|
+
See [CHANGELOG.md](./CHANGELOG.md) for version history and updates.
|
|
422
|
+
|
|
423
|
+
## ๐ฌ Support
|
|
424
|
+
|
|
425
|
+
- GitHub Issues: [Report a bug](https://github.com/acorexui/acorex-ui/issues)
|
|
426
|
+
- Discussions: [Ask questions](https://github.com/acorexui/acorex-ui/discussions)
|