@yonus_amire01/chat 0.1.0
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/README.md +127 -0
- package/dist/index.cjs +6 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.mjs +9360 -0
- package/dist/index.mjs.map +1 -0
- package/dist/style.css +1 -0
- package/dist/types/adapter/HostAdapter.d.ts +13 -0
- package/dist/types/adapter/HostAdapter.d.ts.map +1 -0
- package/dist/types/adapter/PushPort.d.ts +10 -0
- package/dist/types/adapter/PushPort.d.ts.map +1 -0
- package/dist/types/adapter/index.d.ts +7 -0
- package/dist/types/adapter/index.d.ts.map +1 -0
- package/dist/types/adapter/mock/MockCallAdapter.d.ts +14 -0
- package/dist/types/adapter/mock/MockCallAdapter.d.ts.map +1 -0
- package/dist/types/adapter/mock/MockChatActionAdapter.d.ts +9 -0
- package/dist/types/adapter/mock/MockChatActionAdapter.d.ts.map +1 -0
- package/dist/types/adapter/mock/MockChatAdapter.d.ts +7 -0
- package/dist/types/adapter/mock/MockChatAdapter.d.ts.map +1 -0
- package/dist/types/adapter/mock/MockMedicationAdapter.d.ts +7 -0
- package/dist/types/adapter/mock/MockMedicationAdapter.d.ts.map +1 -0
- package/dist/types/adapter/mock/MockServiceAdapter.d.ts +6 -0
- package/dist/types/adapter/mock/MockServiceAdapter.d.ts.map +1 -0
- package/dist/types/adapter/mock/createMockAdapter.d.ts +13 -0
- package/dist/types/adapter/mock/createMockAdapter.d.ts.map +1 -0
- package/dist/types/adapter/mock/index.d.ts +12 -0
- package/dist/types/adapter/mock/index.d.ts.map +1 -0
- package/dist/types/adapter/ports/CallAdapter.d.ts +36 -0
- package/dist/types/adapter/ports/CallAdapter.d.ts.map +1 -0
- package/dist/types/adapter/ports/ChatActionAdapter.d.ts +17 -0
- package/dist/types/adapter/ports/ChatActionAdapter.d.ts.map +1 -0
- package/dist/types/adapter/ports/ChatAdapter.d.ts +22 -0
- package/dist/types/adapter/ports/ChatAdapter.d.ts.map +1 -0
- package/dist/types/adapter/ports/MedicationAdapter.d.ts +6 -0
- package/dist/types/adapter/ports/MedicationAdapter.d.ts.map +1 -0
- package/dist/types/adapter/ports/ServiceAdapter.d.ts +16 -0
- package/dist/types/adapter/ports/ServiceAdapter.d.ts.map +1 -0
- package/dist/types/components/ChatPage.vue.d.ts +8 -0
- package/dist/types/components/ChatPage.vue.d.ts.map +1 -0
- package/dist/types/components/call/CallBoard.vue.d.ts +154 -0
- package/dist/types/components/call/CallBoard.vue.d.ts.map +1 -0
- package/dist/types/components/call/CallMemberDisplay.vue.d.ts +57 -0
- package/dist/types/components/call/CallMemberDisplay.vue.d.ts.map +1 -0
- package/dist/types/components/call/CallPageOverlay.vue.d.ts +1365 -0
- package/dist/types/components/call/CallPageOverlay.vue.d.ts.map +1 -0
- package/dist/types/components/call/paint-board/BoardColorPicker.vue.d.ts +41 -0
- package/dist/types/components/call/paint-board/BoardColorPicker.vue.d.ts.map +1 -0
- package/dist/types/components/call/paint-board/BrushSizeSlider.vue.d.ts +48 -0
- package/dist/types/components/call/paint-board/BrushSizeSlider.vue.d.ts.map +1 -0
- package/dist/types/components/call/paint-board/CallPaintBoard.vue.d.ts +127 -0
- package/dist/types/components/call/paint-board/CallPaintBoard.vue.d.ts.map +1 -0
- package/dist/types/components/chat/ChatBubble.vue.d.ts +12236 -0
- package/dist/types/components/chat/ChatBubble.vue.d.ts.map +1 -0
- package/dist/types/components/chat/ChatInput.vue.d.ts +2477 -0
- package/dist/types/components/chat/ChatInput.vue.d.ts.map +1 -0
- package/dist/types/components/chat/ChatMessages.vue.d.ts +13873 -0
- package/dist/types/components/chat/ChatMessages.vue.d.ts.map +1 -0
- package/dist/types/components/chat/ChatPageBar.vue.d.ts +1204 -0
- package/dist/types/components/chat/ChatPageBar.vue.d.ts.map +1 -0
- package/dist/types/components/chat/ChatProfileOverview.vue.d.ts +327 -0
- package/dist/types/components/chat/ChatProfileOverview.vue.d.ts.map +1 -0
- package/dist/types/components/chat/ChatView.vue.d.ts +4 -0
- package/dist/types/components/chat/ChatView.vue.d.ts.map +1 -0
- package/dist/types/components/chat/PatientReferral.vue.d.ts +33 -0
- package/dist/types/components/chat/PatientReferral.vue.d.ts.map +1 -0
- package/dist/types/components/chat/chat-bubbles/BubbleOptions.vue.d.ts +53 -0
- package/dist/types/components/chat/chat-bubbles/BubbleOptions.vue.d.ts.map +1 -0
- package/dist/types/components/chat/chat-bubbles/BubbleVideo.vue.d.ts +103 -0
- package/dist/types/components/chat/chat-bubbles/BubbleVideo.vue.d.ts.map +1 -0
- package/dist/types/components/chat/chat-bubbles/FileDisplay.vue.d.ts +170 -0
- package/dist/types/components/chat/chat-bubbles/FileDisplay.vue.d.ts.map +1 -0
- package/dist/types/components/chat/chat-bubbles/ImageGroupDisplay.vue.d.ts +74 -0
- package/dist/types/components/chat/chat-bubbles/ImageGroupDisplay.vue.d.ts.map +1 -0
- package/dist/types/components/chat/chat-bubbles/RequestCard.vue.d.ts +11449 -0
- package/dist/types/components/chat/chat-bubbles/RequestCard.vue.d.ts.map +1 -0
- package/dist/types/components/chat/chat-bubbles/VoiceDisplay.vue.d.ts +107 -0
- package/dist/types/components/chat/chat-bubbles/VoiceDisplay.vue.d.ts.map +1 -0
- package/dist/types/components/chat/chat-bubbles/request-card/ProviderDisplay.vue.d.ts +56 -0
- package/dist/types/components/chat/chat-bubbles/request-card/ProviderDisplay.vue.d.ts.map +1 -0
- package/dist/types/components/chat/chat-input/AttachementFileDisplay.vue.d.ts +28 -0
- package/dist/types/components/chat/chat-input/AttachementFileDisplay.vue.d.ts.map +1 -0
- package/dist/types/components/chat/chat-input/InputAttachement.vue.d.ts +72 -0
- package/dist/types/components/chat/chat-input/InputAttachement.vue.d.ts.map +1 -0
- package/dist/types/components/chat/chat-input/PermissionPopup.vue.d.ts +15 -0
- package/dist/types/components/chat/chat-input/PermissionPopup.vue.d.ts.map +1 -0
- package/dist/types/components/chat/chat-input/VideoRecordDisplay.vue.d.ts +149 -0
- package/dist/types/components/chat/chat-input/VideoRecordDisplay.vue.d.ts.map +1 -0
- package/dist/types/components/chat/contact/ChatContactDisplay.vue.d.ts +85 -0
- package/dist/types/components/chat/contact/ChatContactDisplay.vue.d.ts.map +1 -0
- package/dist/types/components/chat/contact/ChatList.vue.d.ts +3111 -0
- package/dist/types/components/chat/contact/ChatList.vue.d.ts.map +1 -0
- package/dist/types/components/chat/contact/ChatListSearch.vue.d.ts +24 -0
- package/dist/types/components/chat/contact/ChatListSearch.vue.d.ts.map +1 -0
- package/dist/types/components/chat/contact/ContactAvatar.vue.d.ts +28 -0
- package/dist/types/components/chat/contact/ContactAvatar.vue.d.ts.map +1 -0
- package/dist/types/components/chat/medic-features/MedicDisplay.vue.d.ts +61 -0
- package/dist/types/components/chat/medic-features/MedicDisplay.vue.d.ts.map +1 -0
- package/dist/types/components/chat/medic-features/MedicSelector.vue.d.ts +1113 -0
- package/dist/types/components/chat/medic-features/MedicSelector.vue.d.ts.map +1 -0
- package/dist/types/components/chat/medic-features/MedicSelectorContent.vue.d.ts +1060 -0
- package/dist/types/components/chat/medic-features/MedicSelectorContent.vue.d.ts.map +1 -0
- package/dist/types/components/chat/medic-features/PrescribtionDisplay.vue.d.ts +1431 -0
- package/dist/types/components/chat/medic-features/PrescribtionDisplay.vue.d.ts.map +1 -0
- package/dist/types/components/chat/profile/FileDisplay.vue.d.ts +28 -0
- package/dist/types/components/chat/profile/FileDisplay.vue.d.ts.map +1 -0
- package/dist/types/components/general/FileFormatDisplay.vue.d.ts +60 -0
- package/dist/types/components/general/FileFormatDisplay.vue.d.ts.map +1 -0
- package/dist/types/components/general/LoadingStatus.vue.d.ts +59 -0
- package/dist/types/components/general/LoadingStatus.vue.d.ts.map +1 -0
- package/dist/types/components/general/NoDataDisplay.vue.d.ts +24 -0
- package/dist/types/components/general/NoDataDisplay.vue.d.ts.map +1 -0
- package/dist/types/components/general/SafeEmojiText.vue.d.ts +24 -0
- package/dist/types/components/general/SafeEmojiText.vue.d.ts.map +1 -0
- package/dist/types/components/global/BCarousel.vue.d.ts +48 -0
- package/dist/types/components/global/BCarousel.vue.d.ts.map +1 -0
- package/dist/types/composables/chat/useChatRecording.d.ts +74 -0
- package/dist/types/composables/chat/useChatRecording.d.ts.map +1 -0
- package/dist/types/composables/useAppPermissions.d.ts +25 -0
- package/dist/types/composables/useAppPermissions.d.ts.map +1 -0
- package/dist/types/composables/useAppToast.d.ts +6 -0
- package/dist/types/composables/useAppToast.d.ts.map +1 -0
- package/dist/types/composables/useClickOutside.d.ts +3 -0
- package/dist/types/composables/useClickOutside.d.ts.map +1 -0
- package/dist/types/composables/useDate.d.ts +24 -0
- package/dist/types/composables/useDate.d.ts.map +1 -0
- package/dist/types/composables/useDevice.d.ts +32 -0
- package/dist/types/composables/useDevice.d.ts.map +1 -0
- package/dist/types/composables/useLocale.d.ts +12 -0
- package/dist/types/composables/useLocale.d.ts.map +1 -0
- package/dist/types/composables/useTheme.d.ts +4 -0
- package/dist/types/composables/useTheme.d.ts.map +1 -0
- package/dist/types/composables/useValidation.d.ts +20 -0
- package/dist/types/composables/useValidation.d.ts.map +1 -0
- package/dist/types/composables/useWindowSize.d.ts +5 -0
- package/dist/types/composables/useWindowSize.d.ts.map +1 -0
- package/dist/types/directives/filePicker.d.ts +4 -0
- package/dist/types/directives/filePicker.d.ts.map +1 -0
- package/dist/types/directives/imagePicker.d.ts +4 -0
- package/dist/types/directives/imagePicker.d.ts.map +1 -0
- package/dist/types/directives/loading.d.ts +6 -0
- package/dist/types/directives/loading.d.ts.map +1 -0
- package/dist/types/index.d.ts +10 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/install.d.ts +20 -0
- package/dist/types/install.d.ts.map +1 -0
- package/dist/types/mock/chat.seed.d.ts +20 -0
- package/dist/types/mock/chat.seed.d.ts.map +1 -0
- package/dist/types/mock/helpers.d.ts +3 -0
- package/dist/types/mock/helpers.d.ts.map +1 -0
- package/dist/types/mock/index.d.ts +5 -0
- package/dist/types/mock/index.d.ts.map +1 -0
- package/dist/types/mock/medication.seed.d.ts +4 -0
- package/dist/types/mock/medication.seed.d.ts.map +1 -0
- package/dist/types/mock/service.seed.d.ts +13 -0
- package/dist/types/mock/service.seed.d.ts.map +1 -0
- package/dist/types/nuxt-shims.d.ts +43 -0
- package/dist/types/nuxt-shims.d.ts.map +1 -0
- package/dist/types/prime-preset.d.ts +72 -0
- package/dist/types/prime-preset.d.ts.map +1 -0
- package/dist/types/stores/callStore.d.ts +518 -0
- package/dist/types/stores/callStore.d.ts.map +1 -0
- package/dist/types/stores/chatActionStore.d.ts +11303 -0
- package/dist/types/stores/chatActionStore.d.ts.map +1 -0
- package/dist/types/stores/chatStore.d.ts +2966 -0
- package/dist/types/stores/chatStore.d.ts.map +1 -0
- package/dist/types/stores/createStores.d.ts +19290 -0
- package/dist/types/stores/createStores.d.ts.map +1 -0
- package/dist/types/stores/medicationsStore.d.ts +3542 -0
- package/dist/types/stores/medicationsStore.d.ts.map +1 -0
- package/dist/types/stores/serviceStore.d.ts +953 -0
- package/dist/types/stores/serviceStore.d.ts.map +1 -0
- package/dist/types/themes/factory.d.ts +4 -0
- package/dist/types/themes/factory.d.ts.map +1 -0
- package/dist/types/types/address.d.ts +26 -0
- package/dist/types/types/address.d.ts.map +1 -0
- package/dist/types/types/calendar.d.ts +88 -0
- package/dist/types/types/calendar.d.ts.map +1 -0
- package/dist/types/types/call.d.ts +9 -0
- package/dist/types/types/call.d.ts.map +1 -0
- package/dist/types/types/chat.d.ts +71 -0
- package/dist/types/types/chat.d.ts.map +1 -0
- package/dist/types/types/clinic.d.ts +7 -0
- package/dist/types/types/clinic.d.ts.map +1 -0
- package/dist/types/types/components/chat-input.d.ts +4 -0
- package/dist/types/types/components/chat-input.d.ts.map +1 -0
- package/dist/types/types/components/input.d.ts +13 -0
- package/dist/types/types/components/input.d.ts.map +1 -0
- package/dist/types/types/components/menu-options.d.ts +7 -0
- package/dist/types/types/components/menu-options.d.ts.map +1 -0
- package/dist/types/types/components/menu.d.ts +5 -0
- package/dist/types/types/components/menu.d.ts.map +1 -0
- package/dist/types/types/components/modal.d.ts +17 -0
- package/dist/types/types/components/modal.d.ts.map +1 -0
- package/dist/types/types/components/nav-item.d.ts +11 -0
- package/dist/types/types/components/nav-item.d.ts.map +1 -0
- package/dist/types/types/components/nav-sub-item.d.ts +9 -0
- package/dist/types/types/components/nav-sub-item.d.ts.map +1 -0
- package/dist/types/types/components/popup.d.ts +5 -0
- package/dist/types/types/components/popup.d.ts.map +1 -0
- package/dist/types/types/components/select.d.ts +8 -0
- package/dist/types/types/components/select.d.ts.map +1 -0
- package/dist/types/types/components/toast.d.ts +5 -0
- package/dist/types/types/components/toast.d.ts.map +1 -0
- package/dist/types/types/env/runtimeConfig.d.ts +22 -0
- package/dist/types/types/invoice.d.ts +8 -0
- package/dist/types/types/invoice.d.ts.map +1 -0
- package/dist/types/types/medic.d.ts +6 -0
- package/dist/types/types/medic.d.ts.map +1 -0
- package/dist/types/types/medication.d.ts +25 -0
- package/dist/types/types/medication.d.ts.map +1 -0
- package/dist/types/types/notification.d.ts +10 -0
- package/dist/types/types/notification.d.ts.map +1 -0
- package/dist/types/types/service.d.ts +25 -0
- package/dist/types/types/service.d.ts.map +1 -0
- package/dist/types/types/story.d.ts +12 -0
- package/dist/types/types/story.d.ts.map +1 -0
- package/dist/types/types/theme.d.ts +26 -0
- package/dist/types/types/theme.d.ts.map +1 -0
- package/dist/types/utils/emojiParser.d.ts +2 -0
- package/dist/types/utils/emojiParser.d.ts.map +1 -0
- package/dist/types/utils/format.d.ts +52 -0
- package/dist/types/utils/format.d.ts.map +1 -0
- package/package.json +68 -0
package/README.md
ADDED
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
# @behayand/chat
|
|
2
|
+
|
|
3
|
+
Reusable Vue 3 chat dashboard component extracted from the Behayand frontend.
|
|
4
|
+
|
|
5
|
+
The package ships a single composed page component (`<ChatPage />`) plus the host-adapter wiring needed to drive it.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
yarn add @behayand/chat
|
|
11
|
+
# peer dependencies
|
|
12
|
+
yarn add vue vue-i18n pinia @vueuse/core
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Usage (plain Vue + Vite)
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
// main.ts
|
|
19
|
+
import { createApp } from "vue";
|
|
20
|
+
import { createPinia } from "pinia";
|
|
21
|
+
import { createI18n } from "vue-i18n";
|
|
22
|
+
import { BehayandChat, ChatPage } from "@behayand/chat";
|
|
23
|
+
import "@behayand/chat/style.css";
|
|
24
|
+
|
|
25
|
+
import App from "./App.vue";
|
|
26
|
+
// Required message keys — see "i18n keys" below.
|
|
27
|
+
import faMessages from "./locales/fa.json";
|
|
28
|
+
|
|
29
|
+
const app = createApp(App);
|
|
30
|
+
|
|
31
|
+
app.use(createPinia()); // Pinia must be installed BEFORE BehayandChat.
|
|
32
|
+
app.use(
|
|
33
|
+
createI18n({
|
|
34
|
+
legacy: false,
|
|
35
|
+
locale: "fa",
|
|
36
|
+
messages: { fa: faMessages },
|
|
37
|
+
}),
|
|
38
|
+
);
|
|
39
|
+
app.use(BehayandChat /* , { adapter: myAdapter } */);
|
|
40
|
+
|
|
41
|
+
app.mount("#app");
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Then render `<ChatPage />` anywhere.
|
|
45
|
+
|
|
46
|
+
If no `adapter` is passed, `createMockAdapter()` is used so you can preview the UI without a backend.
|
|
47
|
+
|
|
48
|
+
```ts
|
|
49
|
+
import type { HostAdapter } from "@behayand/chat";
|
|
50
|
+
|
|
51
|
+
const adapter: HostAdapter = {
|
|
52
|
+
chat: /* ChatAdapter */,
|
|
53
|
+
chatAction: /* ChatActionAdapter */,
|
|
54
|
+
service: /* ServiceAdapter */,
|
|
55
|
+
medication: /* MedicationAdapter */,
|
|
56
|
+
};
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Usage (Nuxt 3 / 4)
|
|
60
|
+
|
|
61
|
+
Create `app/plugins/behayand-chat.ts`:
|
|
62
|
+
|
|
63
|
+
```ts
|
|
64
|
+
import { BehayandChat } from "@behayand/chat";
|
|
65
|
+
import "@behayand/chat/style.css";
|
|
66
|
+
|
|
67
|
+
export default defineNuxtPlugin((nuxtApp) => {
|
|
68
|
+
nuxtApp.vueApp.use(BehayandChat /* , { adapter } */);
|
|
69
|
+
});
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Pinia and i18n come from `@pinia/nuxt` and `@nuxtjs/i18n` modules — don't install them manually.
|
|
73
|
+
|
|
74
|
+
## What `BehayandChat.install` does
|
|
75
|
+
|
|
76
|
+
- Creates the chat / chat-action / service / medication / call stores against the supplied (or mock) adapter and provides them on the Vue app.
|
|
77
|
+
- Globally registers every component under `components/global/*.vue` (`BButton`, `BLabel`, `BVirtualVerticalList`, …) so templates inside `<ChatPage />` resolve them.
|
|
78
|
+
|
|
79
|
+
You don't need to install PrimeVue — the package doesn't import any PrimeVue components.
|
|
80
|
+
|
|
81
|
+
## i18n keys
|
|
82
|
+
|
|
83
|
+
The chat UI reads keys under `chat.*`. At minimum:
|
|
84
|
+
|
|
85
|
+
```jsonc
|
|
86
|
+
{
|
|
87
|
+
"chat": {
|
|
88
|
+
"you": "You",
|
|
89
|
+
"noConversationSelected": "Select a conversation",
|
|
90
|
+
"noMessages": "No conversations yet",
|
|
91
|
+
"copiedMessage": "Copied",
|
|
92
|
+
"filters": {
|
|
93
|
+
"online": "Online",
|
|
94
|
+
"ended": "Ended",
|
|
95
|
+
"active": "Active"
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Translations for additional message types (file/voice/request bubbles, medication picker, etc.) are required if you exercise those flows. The Persian set used in development lives in the host repo.
|
|
102
|
+
|
|
103
|
+
## Styles
|
|
104
|
+
|
|
105
|
+
`import "@behayand/chat/style.css"` ships:
|
|
106
|
+
|
|
107
|
+
- Tailwind v4 base + utilities (scoped to the package's class usage),
|
|
108
|
+
- Theme tokens (`--color-primary-*`, `--color-surface`, gradient utilities, etc.),
|
|
109
|
+
- `IranYekan` / `IranYekanFaNum` `@font-face` declarations (woff files bundled),
|
|
110
|
+
- Bundled flag SVGs (`fa`/`en`/`ar`).
|
|
111
|
+
|
|
112
|
+
There is no separate `theme.css`/`components.css` to import.
|
|
113
|
+
|
|
114
|
+
## Build
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
yarn build # vite build
|
|
118
|
+
yarn build:strict # vite build + vue-tsc typecheck
|
|
119
|
+
yarn dev # vite build --watch
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
Outputs land in `dist/`:
|
|
123
|
+
|
|
124
|
+
- `dist/index.mjs` / `dist/index.cjs` — ESM and CJS bundles
|
|
125
|
+
- `dist/style.css` — extracted styles (import once)
|
|
126
|
+
- `dist/assets/` — bundled fonts, flag SVGs, lib-images
|
|
127
|
+
- `dist/types/` — generated `.d.ts` tree, entry at `dist/types/index.d.ts`
|