@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.
Files changed (222) hide show
  1. package/README.md +127 -0
  2. package/dist/index.cjs +6 -0
  3. package/dist/index.cjs.map +1 -0
  4. package/dist/index.mjs +9360 -0
  5. package/dist/index.mjs.map +1 -0
  6. package/dist/style.css +1 -0
  7. package/dist/types/adapter/HostAdapter.d.ts +13 -0
  8. package/dist/types/adapter/HostAdapter.d.ts.map +1 -0
  9. package/dist/types/adapter/PushPort.d.ts +10 -0
  10. package/dist/types/adapter/PushPort.d.ts.map +1 -0
  11. package/dist/types/adapter/index.d.ts +7 -0
  12. package/dist/types/adapter/index.d.ts.map +1 -0
  13. package/dist/types/adapter/mock/MockCallAdapter.d.ts +14 -0
  14. package/dist/types/adapter/mock/MockCallAdapter.d.ts.map +1 -0
  15. package/dist/types/adapter/mock/MockChatActionAdapter.d.ts +9 -0
  16. package/dist/types/adapter/mock/MockChatActionAdapter.d.ts.map +1 -0
  17. package/dist/types/adapter/mock/MockChatAdapter.d.ts +7 -0
  18. package/dist/types/adapter/mock/MockChatAdapter.d.ts.map +1 -0
  19. package/dist/types/adapter/mock/MockMedicationAdapter.d.ts +7 -0
  20. package/dist/types/adapter/mock/MockMedicationAdapter.d.ts.map +1 -0
  21. package/dist/types/adapter/mock/MockServiceAdapter.d.ts +6 -0
  22. package/dist/types/adapter/mock/MockServiceAdapter.d.ts.map +1 -0
  23. package/dist/types/adapter/mock/createMockAdapter.d.ts +13 -0
  24. package/dist/types/adapter/mock/createMockAdapter.d.ts.map +1 -0
  25. package/dist/types/adapter/mock/index.d.ts +12 -0
  26. package/dist/types/adapter/mock/index.d.ts.map +1 -0
  27. package/dist/types/adapter/ports/CallAdapter.d.ts +36 -0
  28. package/dist/types/adapter/ports/CallAdapter.d.ts.map +1 -0
  29. package/dist/types/adapter/ports/ChatActionAdapter.d.ts +17 -0
  30. package/dist/types/adapter/ports/ChatActionAdapter.d.ts.map +1 -0
  31. package/dist/types/adapter/ports/ChatAdapter.d.ts +22 -0
  32. package/dist/types/adapter/ports/ChatAdapter.d.ts.map +1 -0
  33. package/dist/types/adapter/ports/MedicationAdapter.d.ts +6 -0
  34. package/dist/types/adapter/ports/MedicationAdapter.d.ts.map +1 -0
  35. package/dist/types/adapter/ports/ServiceAdapter.d.ts +16 -0
  36. package/dist/types/adapter/ports/ServiceAdapter.d.ts.map +1 -0
  37. package/dist/types/components/ChatPage.vue.d.ts +8 -0
  38. package/dist/types/components/ChatPage.vue.d.ts.map +1 -0
  39. package/dist/types/components/call/CallBoard.vue.d.ts +154 -0
  40. package/dist/types/components/call/CallBoard.vue.d.ts.map +1 -0
  41. package/dist/types/components/call/CallMemberDisplay.vue.d.ts +57 -0
  42. package/dist/types/components/call/CallMemberDisplay.vue.d.ts.map +1 -0
  43. package/dist/types/components/call/CallPageOverlay.vue.d.ts +1365 -0
  44. package/dist/types/components/call/CallPageOverlay.vue.d.ts.map +1 -0
  45. package/dist/types/components/call/paint-board/BoardColorPicker.vue.d.ts +41 -0
  46. package/dist/types/components/call/paint-board/BoardColorPicker.vue.d.ts.map +1 -0
  47. package/dist/types/components/call/paint-board/BrushSizeSlider.vue.d.ts +48 -0
  48. package/dist/types/components/call/paint-board/BrushSizeSlider.vue.d.ts.map +1 -0
  49. package/dist/types/components/call/paint-board/CallPaintBoard.vue.d.ts +127 -0
  50. package/dist/types/components/call/paint-board/CallPaintBoard.vue.d.ts.map +1 -0
  51. package/dist/types/components/chat/ChatBubble.vue.d.ts +12236 -0
  52. package/dist/types/components/chat/ChatBubble.vue.d.ts.map +1 -0
  53. package/dist/types/components/chat/ChatInput.vue.d.ts +2477 -0
  54. package/dist/types/components/chat/ChatInput.vue.d.ts.map +1 -0
  55. package/dist/types/components/chat/ChatMessages.vue.d.ts +13873 -0
  56. package/dist/types/components/chat/ChatMessages.vue.d.ts.map +1 -0
  57. package/dist/types/components/chat/ChatPageBar.vue.d.ts +1204 -0
  58. package/dist/types/components/chat/ChatPageBar.vue.d.ts.map +1 -0
  59. package/dist/types/components/chat/ChatProfileOverview.vue.d.ts +327 -0
  60. package/dist/types/components/chat/ChatProfileOverview.vue.d.ts.map +1 -0
  61. package/dist/types/components/chat/ChatView.vue.d.ts +4 -0
  62. package/dist/types/components/chat/ChatView.vue.d.ts.map +1 -0
  63. package/dist/types/components/chat/PatientReferral.vue.d.ts +33 -0
  64. package/dist/types/components/chat/PatientReferral.vue.d.ts.map +1 -0
  65. package/dist/types/components/chat/chat-bubbles/BubbleOptions.vue.d.ts +53 -0
  66. package/dist/types/components/chat/chat-bubbles/BubbleOptions.vue.d.ts.map +1 -0
  67. package/dist/types/components/chat/chat-bubbles/BubbleVideo.vue.d.ts +103 -0
  68. package/dist/types/components/chat/chat-bubbles/BubbleVideo.vue.d.ts.map +1 -0
  69. package/dist/types/components/chat/chat-bubbles/FileDisplay.vue.d.ts +170 -0
  70. package/dist/types/components/chat/chat-bubbles/FileDisplay.vue.d.ts.map +1 -0
  71. package/dist/types/components/chat/chat-bubbles/ImageGroupDisplay.vue.d.ts +74 -0
  72. package/dist/types/components/chat/chat-bubbles/ImageGroupDisplay.vue.d.ts.map +1 -0
  73. package/dist/types/components/chat/chat-bubbles/RequestCard.vue.d.ts +11449 -0
  74. package/dist/types/components/chat/chat-bubbles/RequestCard.vue.d.ts.map +1 -0
  75. package/dist/types/components/chat/chat-bubbles/VoiceDisplay.vue.d.ts +107 -0
  76. package/dist/types/components/chat/chat-bubbles/VoiceDisplay.vue.d.ts.map +1 -0
  77. package/dist/types/components/chat/chat-bubbles/request-card/ProviderDisplay.vue.d.ts +56 -0
  78. package/dist/types/components/chat/chat-bubbles/request-card/ProviderDisplay.vue.d.ts.map +1 -0
  79. package/dist/types/components/chat/chat-input/AttachementFileDisplay.vue.d.ts +28 -0
  80. package/dist/types/components/chat/chat-input/AttachementFileDisplay.vue.d.ts.map +1 -0
  81. package/dist/types/components/chat/chat-input/InputAttachement.vue.d.ts +72 -0
  82. package/dist/types/components/chat/chat-input/InputAttachement.vue.d.ts.map +1 -0
  83. package/dist/types/components/chat/chat-input/PermissionPopup.vue.d.ts +15 -0
  84. package/dist/types/components/chat/chat-input/PermissionPopup.vue.d.ts.map +1 -0
  85. package/dist/types/components/chat/chat-input/VideoRecordDisplay.vue.d.ts +149 -0
  86. package/dist/types/components/chat/chat-input/VideoRecordDisplay.vue.d.ts.map +1 -0
  87. package/dist/types/components/chat/contact/ChatContactDisplay.vue.d.ts +85 -0
  88. package/dist/types/components/chat/contact/ChatContactDisplay.vue.d.ts.map +1 -0
  89. package/dist/types/components/chat/contact/ChatList.vue.d.ts +3111 -0
  90. package/dist/types/components/chat/contact/ChatList.vue.d.ts.map +1 -0
  91. package/dist/types/components/chat/contact/ChatListSearch.vue.d.ts +24 -0
  92. package/dist/types/components/chat/contact/ChatListSearch.vue.d.ts.map +1 -0
  93. package/dist/types/components/chat/contact/ContactAvatar.vue.d.ts +28 -0
  94. package/dist/types/components/chat/contact/ContactAvatar.vue.d.ts.map +1 -0
  95. package/dist/types/components/chat/medic-features/MedicDisplay.vue.d.ts +61 -0
  96. package/dist/types/components/chat/medic-features/MedicDisplay.vue.d.ts.map +1 -0
  97. package/dist/types/components/chat/medic-features/MedicSelector.vue.d.ts +1113 -0
  98. package/dist/types/components/chat/medic-features/MedicSelector.vue.d.ts.map +1 -0
  99. package/dist/types/components/chat/medic-features/MedicSelectorContent.vue.d.ts +1060 -0
  100. package/dist/types/components/chat/medic-features/MedicSelectorContent.vue.d.ts.map +1 -0
  101. package/dist/types/components/chat/medic-features/PrescribtionDisplay.vue.d.ts +1431 -0
  102. package/dist/types/components/chat/medic-features/PrescribtionDisplay.vue.d.ts.map +1 -0
  103. package/dist/types/components/chat/profile/FileDisplay.vue.d.ts +28 -0
  104. package/dist/types/components/chat/profile/FileDisplay.vue.d.ts.map +1 -0
  105. package/dist/types/components/general/FileFormatDisplay.vue.d.ts +60 -0
  106. package/dist/types/components/general/FileFormatDisplay.vue.d.ts.map +1 -0
  107. package/dist/types/components/general/LoadingStatus.vue.d.ts +59 -0
  108. package/dist/types/components/general/LoadingStatus.vue.d.ts.map +1 -0
  109. package/dist/types/components/general/NoDataDisplay.vue.d.ts +24 -0
  110. package/dist/types/components/general/NoDataDisplay.vue.d.ts.map +1 -0
  111. package/dist/types/components/general/SafeEmojiText.vue.d.ts +24 -0
  112. package/dist/types/components/general/SafeEmojiText.vue.d.ts.map +1 -0
  113. package/dist/types/components/global/BCarousel.vue.d.ts +48 -0
  114. package/dist/types/components/global/BCarousel.vue.d.ts.map +1 -0
  115. package/dist/types/composables/chat/useChatRecording.d.ts +74 -0
  116. package/dist/types/composables/chat/useChatRecording.d.ts.map +1 -0
  117. package/dist/types/composables/useAppPermissions.d.ts +25 -0
  118. package/dist/types/composables/useAppPermissions.d.ts.map +1 -0
  119. package/dist/types/composables/useAppToast.d.ts +6 -0
  120. package/dist/types/composables/useAppToast.d.ts.map +1 -0
  121. package/dist/types/composables/useClickOutside.d.ts +3 -0
  122. package/dist/types/composables/useClickOutside.d.ts.map +1 -0
  123. package/dist/types/composables/useDate.d.ts +24 -0
  124. package/dist/types/composables/useDate.d.ts.map +1 -0
  125. package/dist/types/composables/useDevice.d.ts +32 -0
  126. package/dist/types/composables/useDevice.d.ts.map +1 -0
  127. package/dist/types/composables/useLocale.d.ts +12 -0
  128. package/dist/types/composables/useLocale.d.ts.map +1 -0
  129. package/dist/types/composables/useTheme.d.ts +4 -0
  130. package/dist/types/composables/useTheme.d.ts.map +1 -0
  131. package/dist/types/composables/useValidation.d.ts +20 -0
  132. package/dist/types/composables/useValidation.d.ts.map +1 -0
  133. package/dist/types/composables/useWindowSize.d.ts +5 -0
  134. package/dist/types/composables/useWindowSize.d.ts.map +1 -0
  135. package/dist/types/directives/filePicker.d.ts +4 -0
  136. package/dist/types/directives/filePicker.d.ts.map +1 -0
  137. package/dist/types/directives/imagePicker.d.ts +4 -0
  138. package/dist/types/directives/imagePicker.d.ts.map +1 -0
  139. package/dist/types/directives/loading.d.ts +6 -0
  140. package/dist/types/directives/loading.d.ts.map +1 -0
  141. package/dist/types/index.d.ts +10 -0
  142. package/dist/types/index.d.ts.map +1 -0
  143. package/dist/types/install.d.ts +20 -0
  144. package/dist/types/install.d.ts.map +1 -0
  145. package/dist/types/mock/chat.seed.d.ts +20 -0
  146. package/dist/types/mock/chat.seed.d.ts.map +1 -0
  147. package/dist/types/mock/helpers.d.ts +3 -0
  148. package/dist/types/mock/helpers.d.ts.map +1 -0
  149. package/dist/types/mock/index.d.ts +5 -0
  150. package/dist/types/mock/index.d.ts.map +1 -0
  151. package/dist/types/mock/medication.seed.d.ts +4 -0
  152. package/dist/types/mock/medication.seed.d.ts.map +1 -0
  153. package/dist/types/mock/service.seed.d.ts +13 -0
  154. package/dist/types/mock/service.seed.d.ts.map +1 -0
  155. package/dist/types/nuxt-shims.d.ts +43 -0
  156. package/dist/types/nuxt-shims.d.ts.map +1 -0
  157. package/dist/types/prime-preset.d.ts +72 -0
  158. package/dist/types/prime-preset.d.ts.map +1 -0
  159. package/dist/types/stores/callStore.d.ts +518 -0
  160. package/dist/types/stores/callStore.d.ts.map +1 -0
  161. package/dist/types/stores/chatActionStore.d.ts +11303 -0
  162. package/dist/types/stores/chatActionStore.d.ts.map +1 -0
  163. package/dist/types/stores/chatStore.d.ts +2966 -0
  164. package/dist/types/stores/chatStore.d.ts.map +1 -0
  165. package/dist/types/stores/createStores.d.ts +19290 -0
  166. package/dist/types/stores/createStores.d.ts.map +1 -0
  167. package/dist/types/stores/medicationsStore.d.ts +3542 -0
  168. package/dist/types/stores/medicationsStore.d.ts.map +1 -0
  169. package/dist/types/stores/serviceStore.d.ts +953 -0
  170. package/dist/types/stores/serviceStore.d.ts.map +1 -0
  171. package/dist/types/themes/factory.d.ts +4 -0
  172. package/dist/types/themes/factory.d.ts.map +1 -0
  173. package/dist/types/types/address.d.ts +26 -0
  174. package/dist/types/types/address.d.ts.map +1 -0
  175. package/dist/types/types/calendar.d.ts +88 -0
  176. package/dist/types/types/calendar.d.ts.map +1 -0
  177. package/dist/types/types/call.d.ts +9 -0
  178. package/dist/types/types/call.d.ts.map +1 -0
  179. package/dist/types/types/chat.d.ts +71 -0
  180. package/dist/types/types/chat.d.ts.map +1 -0
  181. package/dist/types/types/clinic.d.ts +7 -0
  182. package/dist/types/types/clinic.d.ts.map +1 -0
  183. package/dist/types/types/components/chat-input.d.ts +4 -0
  184. package/dist/types/types/components/chat-input.d.ts.map +1 -0
  185. package/dist/types/types/components/input.d.ts +13 -0
  186. package/dist/types/types/components/input.d.ts.map +1 -0
  187. package/dist/types/types/components/menu-options.d.ts +7 -0
  188. package/dist/types/types/components/menu-options.d.ts.map +1 -0
  189. package/dist/types/types/components/menu.d.ts +5 -0
  190. package/dist/types/types/components/menu.d.ts.map +1 -0
  191. package/dist/types/types/components/modal.d.ts +17 -0
  192. package/dist/types/types/components/modal.d.ts.map +1 -0
  193. package/dist/types/types/components/nav-item.d.ts +11 -0
  194. package/dist/types/types/components/nav-item.d.ts.map +1 -0
  195. package/dist/types/types/components/nav-sub-item.d.ts +9 -0
  196. package/dist/types/types/components/nav-sub-item.d.ts.map +1 -0
  197. package/dist/types/types/components/popup.d.ts +5 -0
  198. package/dist/types/types/components/popup.d.ts.map +1 -0
  199. package/dist/types/types/components/select.d.ts +8 -0
  200. package/dist/types/types/components/select.d.ts.map +1 -0
  201. package/dist/types/types/components/toast.d.ts +5 -0
  202. package/dist/types/types/components/toast.d.ts.map +1 -0
  203. package/dist/types/types/env/runtimeConfig.d.ts +22 -0
  204. package/dist/types/types/invoice.d.ts +8 -0
  205. package/dist/types/types/invoice.d.ts.map +1 -0
  206. package/dist/types/types/medic.d.ts +6 -0
  207. package/dist/types/types/medic.d.ts.map +1 -0
  208. package/dist/types/types/medication.d.ts +25 -0
  209. package/dist/types/types/medication.d.ts.map +1 -0
  210. package/dist/types/types/notification.d.ts +10 -0
  211. package/dist/types/types/notification.d.ts.map +1 -0
  212. package/dist/types/types/service.d.ts +25 -0
  213. package/dist/types/types/service.d.ts.map +1 -0
  214. package/dist/types/types/story.d.ts +12 -0
  215. package/dist/types/types/story.d.ts.map +1 -0
  216. package/dist/types/types/theme.d.ts +26 -0
  217. package/dist/types/types/theme.d.ts.map +1 -0
  218. package/dist/types/utils/emojiParser.d.ts +2 -0
  219. package/dist/types/utils/emojiParser.d.ts.map +1 -0
  220. package/dist/types/utils/format.d.ts +52 -0
  221. package/dist/types/utils/format.d.ts.map +1 -0
  222. 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`