@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.
- package/dist/CreateChat-DYGyItgE.js +31 -0
- package/dist/CreateChat2-BssQxlzC.js +42 -0
- package/dist/CreateDialog-nG1d1JLQ.js +77 -0
- package/dist/{ModalVideoRecorder-BM0u4RGq.js → ModalVideoRecorder-Di7x1f3E.js} +1 -1
- package/dist/SelectUser2-CMkdxD6H.js +46 -0
- package/dist/chotto.css +1 -1
- package/dist/{index-BHd0LYyt.js → index-CBuP7XAZ.js} +2594 -2714
- package/dist/types/apps/data/index.d.ts +1 -0
- package/dist/types/apps/data/themes.d.ts +7 -0
- package/dist/types/apps/validators/chats/chatValidator.d.ts +21 -0
- package/dist/types/apps/validators/chats/index.d.ts +7 -0
- package/dist/types/apps/validators/chats/types.d.ts +63 -0
- package/dist/types/apps/validators/chats/useChatValidator.d.ts +49 -0
- package/dist/types/apps/validators/examples.d.ts +1358 -0
- package/dist/types/apps/validators/index.d.ts +29 -0
- package/dist/types/apps/validators/messages/index.d.ts +7 -0
- package/dist/types/apps/validators/messages/messageValidator.d.ts +21 -0
- package/dist/types/apps/validators/messages/types.d.ts +66 -0
- package/dist/types/apps/validators/messages/useMessageValidator.d.ts +49 -0
- package/dist/types/apps/validators/sidebar/index.d.ts +7 -0
- package/dist/types/apps/validators/sidebar/sidebarValidator.d.ts +21 -0
- package/dist/types/apps/validators/sidebar/types.d.ts +14 -0
- package/dist/types/apps/validators/sidebar/useSidebarValidator.d.ts +45 -0
- package/dist/types/apps/validators/test.d.ts +23 -0
- package/dist/types/components/1_icons/AvatarIcon.vue.d.ts +6 -6
- package/dist/types/components/2_blocks/CommunicationPanel/CommunicationPanel.vue.d.ts +2 -2
- package/dist/types/components/2_blocks/CommunicationPanel/stories/CommunicationPanel.stories.d.ts +2 -2
- package/dist/types/components/2_chatinput_elements/PlaceholderComponent/PlaceholderComponent.vue.d.ts +2 -2
- package/dist/types/components/2_elements/ContactInfo/ContactInfo.vue.d.ts +2 -2
- package/dist/types/components/2_elements/ContactInfo/stories/ContactInfo.stories.d.ts +2 -2
- package/dist/types/components/2_modals/CreateDialog/CreateDialog.vue.d.ts +2 -2
- package/dist/types/components/2_modals/CreateDialog/stories/CreateDialog.stories.d.ts +2 -2
- package/dist/types/components/index.d.ts +0 -4
- package/dist/types/functions/formatTimestamp.d.ts +20 -0
- package/dist/types/functions/getStatusMessage.d.ts +14 -0
- package/dist/types/functions/index.d.ts +5 -0
- package/dist/types/functions/insertDaySeparators.d.ts +46 -0
- package/dist/types/functions/playNotificationAudio.d.ts +6 -0
- package/dist/types/hooks/index.d.ts +1 -7
- package/dist/types/hooks/modals/index.d.ts +4 -0
- package/dist/types/hooks/uploadFile/index.d.ts +3 -0
- package/dist/types/hooks/useMessage.d.ts +69 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/vuessages.es.js +81 -81
- package/dist/vuessages.umd.js +5 -5
- package/package.json +1 -1
- package/dist/types/apps/helpers/index.d.ts +0 -9
- package/dist/types/hooks/formatTimestamp.d.ts +0 -1
- package/dist/types/hooks/getStatusMessage.d.ts +0 -2
- package/dist/types/hooks/insertDaySeparators.d.ts +0 -3
- package/dist/types/hooks/playNotificationAudio.d.ts +0 -1
- /package/dist/types/{hooks → components/3_compounds/Feed/functions}/throttle.d.ts +0 -0
- /package/dist/types/{apps/helpers → functions}/sortByTimestamp.d.ts +0 -0
- /package/dist/types/{apps/helpers → hooks/modals}/useCreateChat.d.ts +0 -0
- /package/dist/types/{apps/helpers → hooks/modals}/useCreateChat2.d.ts +0 -0
- /package/dist/types/{apps/helpers → hooks/modals}/useCreateDialog.d.ts +0 -0
- /package/dist/types/{apps/helpers → hooks/modals}/useModalSelectUser2.d.ts +0 -0
- /package/dist/types/hooks/{generatePreview.d.ts → uploadFile/generatePreview.d.ts} +0 -0
- /package/dist/types/hooks/{getTypeFileByMime.d.ts → uploadFile/getTypeFileByMime.d.ts} +0 -0
- /package/dist/types/hooks/{uploadFile.d.ts → uploadFile/uploadFile.d.ts} +0 -0
@@ -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,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;
|