@mobilon-dev/chotto 0.3.11 → 0.3.12

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 (60) hide show
  1. package/dist/CreateChat-DYGyItgE.js +31 -0
  2. package/dist/CreateChat2-BssQxlzC.js +42 -0
  3. package/dist/CreateDialog-nG1d1JLQ.js +77 -0
  4. package/dist/{ModalVideoRecorder-BM0u4RGq.js → ModalVideoRecorder-Di7x1f3E.js} +1 -1
  5. package/dist/SelectUser2-CMkdxD6H.js +46 -0
  6. package/dist/chotto.css +1 -1
  7. package/dist/{index-BHd0LYyt.js → index-CBuP7XAZ.js} +2594 -2714
  8. package/dist/types/apps/data/index.d.ts +1 -0
  9. package/dist/types/apps/data/themes.d.ts +7 -0
  10. package/dist/types/apps/validators/chats/chatValidator.d.ts +21 -0
  11. package/dist/types/apps/validators/chats/index.d.ts +7 -0
  12. package/dist/types/apps/validators/chats/types.d.ts +63 -0
  13. package/dist/types/apps/validators/chats/useChatValidator.d.ts +49 -0
  14. package/dist/types/apps/validators/examples.d.ts +1358 -0
  15. package/dist/types/apps/validators/index.d.ts +29 -0
  16. package/dist/types/apps/validators/messages/index.d.ts +7 -0
  17. package/dist/types/apps/validators/messages/messageValidator.d.ts +21 -0
  18. package/dist/types/apps/validators/messages/types.d.ts +66 -0
  19. package/dist/types/apps/validators/messages/useMessageValidator.d.ts +49 -0
  20. package/dist/types/apps/validators/sidebar/index.d.ts +7 -0
  21. package/dist/types/apps/validators/sidebar/sidebarValidator.d.ts +21 -0
  22. package/dist/types/apps/validators/sidebar/types.d.ts +14 -0
  23. package/dist/types/apps/validators/sidebar/useSidebarValidator.d.ts +45 -0
  24. package/dist/types/apps/validators/test.d.ts +23 -0
  25. package/dist/types/components/1_icons/AvatarIcon.vue.d.ts +6 -6
  26. package/dist/types/components/2_blocks/CommunicationPanel/CommunicationPanel.vue.d.ts +2 -2
  27. package/dist/types/components/2_blocks/CommunicationPanel/stories/CommunicationPanel.stories.d.ts +2 -2
  28. package/dist/types/components/2_chatinput_elements/PlaceholderComponent/PlaceholderComponent.vue.d.ts +2 -2
  29. package/dist/types/components/2_elements/ContactInfo/ContactInfo.vue.d.ts +2 -2
  30. package/dist/types/components/2_elements/ContactInfo/stories/ContactInfo.stories.d.ts +2 -2
  31. package/dist/types/components/2_modals/CreateDialog/CreateDialog.vue.d.ts +2 -2
  32. package/dist/types/components/2_modals/CreateDialog/stories/CreateDialog.stories.d.ts +2 -2
  33. package/dist/types/components/index.d.ts +0 -4
  34. package/dist/types/functions/formatTimestamp.d.ts +20 -0
  35. package/dist/types/functions/getStatusMessage.d.ts +14 -0
  36. package/dist/types/functions/index.d.ts +5 -0
  37. package/dist/types/functions/insertDaySeparators.d.ts +46 -0
  38. package/dist/types/functions/playNotificationAudio.d.ts +6 -0
  39. package/dist/types/hooks/index.d.ts +1 -7
  40. package/dist/types/hooks/modals/index.d.ts +4 -0
  41. package/dist/types/hooks/uploadFile/index.d.ts +3 -0
  42. package/dist/types/hooks/useMessage.d.ts +69 -1
  43. package/dist/types/index.d.ts +1 -0
  44. package/dist/vuessages.es.js +81 -81
  45. package/dist/vuessages.umd.js +5 -5
  46. package/package.json +1 -1
  47. package/dist/types/apps/helpers/index.d.ts +0 -9
  48. package/dist/types/hooks/formatTimestamp.d.ts +0 -1
  49. package/dist/types/hooks/getStatusMessage.d.ts +0 -2
  50. package/dist/types/hooks/insertDaySeparators.d.ts +0 -3
  51. package/dist/types/hooks/playNotificationAudio.d.ts +0 -1
  52. /package/dist/types/{hooks → components/3_compounds/Feed/functions}/throttle.d.ts +0 -0
  53. /package/dist/types/{apps/helpers → functions}/sortByTimestamp.d.ts +0 -0
  54. /package/dist/types/{apps/helpers → hooks/modals}/useCreateChat.d.ts +0 -0
  55. /package/dist/types/{apps/helpers → hooks/modals}/useCreateChat2.d.ts +0 -0
  56. /package/dist/types/{apps/helpers → hooks/modals}/useCreateDialog.d.ts +0 -0
  57. /package/dist/types/{apps/helpers → hooks/modals}/useModalSelectUser2.d.ts +0 -0
  58. /package/dist/types/hooks/{generatePreview.d.ts → uploadFile/generatePreview.d.ts} +0 -0
  59. /package/dist/types/hooks/{getTypeFileByMime.d.ts → uploadFile/getTypeFileByMime.d.ts} +0 -0
  60. /package/dist/types/hooks/{uploadFile.d.ts → uploadFile/uploadFile.d.ts} +0 -0
@@ -7,3 +7,4 @@ export * from './users';
7
7
  export * from './templates';
8
8
  export * from './groupTemplates';
9
9
  export * from './wabaTemplates';
10
+ export * from './themes';
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Конфигурация доступных тем для приложений
3
+ */
4
+ export declare const themes: {
5
+ code: string;
6
+ name: string;
7
+ }[];
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Валидатор для данных чатов
3
+ */
4
+ export interface ValidationError {
5
+ path: string;
6
+ message: string;
7
+ value?: any;
8
+ }
9
+ export interface ValidationResult {
10
+ isValid: boolean;
11
+ errors: ValidationError[];
12
+ warnings: ValidationError[];
13
+ }
14
+ /**
15
+ * Основная функция валидации списка чатов
16
+ */
17
+ export declare function validateChats(chats: any): ValidationResult;
18
+ /**
19
+ * Получить читаемый отчет о валидации
20
+ */
21
+ export declare function getValidationReport(result: ValidationResult): string;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Валидатор чатов
3
+ * Экспорт всех компонентов валидации чатов
4
+ */
5
+ export * from './types';
6
+ export * from './chatValidator';
7
+ export * from './useChatValidator';
@@ -0,0 +1,63 @@
1
+ /**
2
+ * Типы для данных чатов
3
+ */
4
+ export interface ChatAction {
5
+ action: string;
6
+ title: string;
7
+ icon?: string;
8
+ }
9
+ export interface ContactAttribute {
10
+ id: string;
11
+ type?: string;
12
+ data?: string | {
13
+ id: string;
14
+ nickname: string;
15
+ phone: string;
16
+ };
17
+ value: string;
18
+ }
19
+ export interface Contact {
20
+ attributes: ContactAttribute[];
21
+ }
22
+ export interface Dialog {
23
+ branchId?: string;
24
+ dialogId: string;
25
+ attributeId?: string;
26
+ channelId?: string;
27
+ icon?: string;
28
+ name: string;
29
+ fullname?: string;
30
+ countUnread?: number;
31
+ 'lastActivity.time'?: string;
32
+ 'lastActivity.timestamp': number;
33
+ isSelected: boolean;
34
+ }
35
+ export interface Command {
36
+ action: string;
37
+ title: string;
38
+ description: string;
39
+ }
40
+ export interface Chat {
41
+ chatId: number;
42
+ name: string;
43
+ avatar?: string;
44
+ countUnread: number;
45
+ lastMessage: string;
46
+ 'lastActivity.time'?: string;
47
+ 'lastActivity.timestamp': string;
48
+ 'lastMessage.status'?: 'read' | 'sent' | 'received';
49
+ isFixedTop?: boolean;
50
+ isFixedBottom?: boolean;
51
+ isFixed?: boolean;
52
+ status?: string;
53
+ statusMessage?: string;
54
+ colorUnread?: string;
55
+ actions?: ChatAction[];
56
+ typing?: boolean;
57
+ metadata?: string;
58
+ dialogsExpanded?: boolean;
59
+ dialogs?: Dialog[];
60
+ contact?: Contact;
61
+ commands?: Command[];
62
+ }
63
+ export type ChatList = Chat[];
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Реактивный composable для валидации чатов
3
+ */
4
+ import { type Ref } from 'vue';
5
+ import { type ValidationResult } from './chatValidator';
6
+ export interface UseChatValidatorOptions {
7
+ autoValidate?: boolean;
8
+ debounce?: number;
9
+ }
10
+ export interface UseChatValidatorReturn {
11
+ validationResult: Ref<ValidationResult | null>;
12
+ isValid: Ref<boolean>;
13
+ errors: Ref<ValidationResult['errors']>;
14
+ warnings: Ref<ValidationResult['warnings']>;
15
+ errorCount: Ref<number>;
16
+ warningCount: Ref<number>;
17
+ report: Ref<string>;
18
+ validate: () => ValidationResult;
19
+ reset: () => void;
20
+ showReport: () => void;
21
+ }
22
+ /**
23
+ * Composable для реактивной валидации чатов
24
+ *
25
+ * @param chatsData - реактивная ссылка на данные чатов
26
+ * @param options - опции валидатора
27
+ * @returns объект с реактивными свойствами и методами валидации
28
+ *
29
+ * @example
30
+ * ```ts
31
+ * import { ref } from 'vue';
32
+ * import { useChatValidator } from '@/apps/validators/useChatValidator';
33
+ * import { chats } from '@/apps/data/chats';
34
+ *
35
+ * const chatsData = ref(chats);
36
+ * const { isValid, errorCount, showReport } = useChatValidator(chatsData, {
37
+ * autoValidate: true,
38
+ * debounce: 300
39
+ * });
40
+ *
41
+ * // Валидация запускается автоматически
42
+ * console.log(isValid.value); // true/false
43
+ * console.log(errorCount.value); // количество ошибок
44
+ *
45
+ * // Показать полный отчет в консоли
46
+ * showReport();
47
+ * ```
48
+ */
49
+ export declare function useChatValidator(chatsData: Ref<any>, options?: UseChatValidatorOptions): UseChatValidatorReturn;