@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
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Главный экспорт валидаторов
3
+ *
4
+ * Структура:
5
+ * - validators/chats - валидация чатов
6
+ * - validators/messages - валидация сообщений
7
+ * - validators/sidebar - валидация sidebar items
8
+ *
9
+ * @example
10
+ * // Импорт валидатора чатов
11
+ * import { useChatValidator } from '@/apps/validators/chats';
12
+ *
13
+ * @example
14
+ * // Импорт валидатора сообщений
15
+ * import { useMessageValidator } from '@/apps/validators/messages';
16
+ *
17
+ * @example
18
+ * // Импорт валидатора sidebar
19
+ * import { useSidebarValidator } from '@/apps/validators/sidebar';
20
+ *
21
+ * @example
22
+ * // Импорт всех валидаторов
23
+ * import { useChatValidator, useMessageValidator, useSidebarValidator } from '@/apps/validators';
24
+ */
25
+ export * from './chats';
26
+ export * from './messages';
27
+ export * from './sidebar';
28
+ export * from './examples';
29
+ export * from './test';
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Валидатор сообщений
3
+ * Экспорт всех компонентов валидации сообщений
4
+ */
5
+ export * from './types';
6
+ export { validateMessages, getMessageValidationReport, type MessageValidationError, type MessageValidationResult } from './messageValidator';
7
+ export * from './useMessageValidator';
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Валидатор для данных сообщений
3
+ */
4
+ export interface MessageValidationError {
5
+ path: string;
6
+ message: string;
7
+ value?: any;
8
+ }
9
+ export interface MessageValidationResult {
10
+ isValid: boolean;
11
+ errors: MessageValidationError[];
12
+ warnings: MessageValidationError[];
13
+ }
14
+ /**
15
+ * Основная функция валидации списка сообщений
16
+ */
17
+ export declare function validateMessages(messages: any): MessageValidationResult;
18
+ /**
19
+ * Получить читаемый отчет о валидации
20
+ */
21
+ export declare function getMessageValidationReport(result: MessageValidationResult): string;
@@ -0,0 +1,66 @@
1
+ /**
2
+ * Типы для данных сообщений
3
+ */
4
+ export interface MessageAction {
5
+ action: string;
6
+ title: string;
7
+ icon?: string;
8
+ }
9
+ export interface MessageReply {
10
+ messageId: string | number;
11
+ type: string;
12
+ text?: string;
13
+ url?: string;
14
+ filename?: string;
15
+ }
16
+ export interface MessageEmbed {
17
+ type: string;
18
+ url: string;
19
+ }
20
+ export interface MessageLinkPreview {
21
+ title: string;
22
+ imageUrl: string;
23
+ url: string;
24
+ description: string;
25
+ }
26
+ export interface MessageTranscript {
27
+ text?: string;
28
+ dialog?: Array<{
29
+ time: string;
30
+ text: string;
31
+ position: string;
32
+ }>;
33
+ }
34
+ export interface MessageKeyboardButton {
35
+ key: string;
36
+ text: string;
37
+ action: any;
38
+ color: any;
39
+ order: number;
40
+ }
41
+ export interface Message {
42
+ chatId: number;
43
+ dialogId?: string;
44
+ messageId: string | number;
45
+ type: string;
46
+ timestamp: string | number;
47
+ direction?: 'incoming' | 'outgoing';
48
+ status?: 'read' | 'sent' | 'received';
49
+ text?: string;
50
+ header?: string;
51
+ subText?: string;
52
+ avatar?: string;
53
+ url?: string;
54
+ filename?: string;
55
+ alt?: string;
56
+ views?: number;
57
+ actions?: MessageAction[];
58
+ reply?: MessageReply;
59
+ embed?: MessageEmbed;
60
+ linkPreview?: MessageLinkPreview;
61
+ transcript?: MessageTranscript;
62
+ keyboard?: MessageKeyboardButton[];
63
+ callDuration?: string;
64
+ isMissedCall?: boolean;
65
+ }
66
+ export type MessageList = Message[];
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Реактивный composable для валидации сообщений
3
+ */
4
+ import { type Ref } from 'vue';
5
+ import { type MessageValidationResult } from './messageValidator';
6
+ export interface UseMessageValidatorOptions {
7
+ autoValidate?: boolean;
8
+ debounce?: number;
9
+ }
10
+ export interface UseMessageValidatorReturn {
11
+ validationResult: Ref<MessageValidationResult | null>;
12
+ isValid: Ref<boolean>;
13
+ errors: Ref<MessageValidationResult['errors']>;
14
+ warnings: Ref<MessageValidationResult['warnings']>;
15
+ errorCount: Ref<number>;
16
+ warningCount: Ref<number>;
17
+ report: Ref<string>;
18
+ validate: () => MessageValidationResult;
19
+ reset: () => void;
20
+ showReport: () => void;
21
+ }
22
+ /**
23
+ * Composable для реактивной валидации сообщений
24
+ *
25
+ * @param messagesData - реактивная ссылка на данные сообщений
26
+ * @param options - опции валидатора
27
+ * @returns объект с реактивными свойствами и методами валидации
28
+ *
29
+ * @example
30
+ * ```ts
31
+ * import { ref } from 'vue';
32
+ * import { useMessageValidator } from '@/apps/validators/useMessageValidator';
33
+ * import { messages } from '@/apps/data/messages';
34
+ *
35
+ * const messagesData = ref(messages);
36
+ * const { isValid, errorCount, showReport } = useMessageValidator(messagesData, {
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 useMessageValidator(messagesData: Ref<any>, options?: UseMessageValidatorOptions): UseMessageValidatorReturn;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Валидатор sidebar items
3
+ * Экспорт всех компонентов валидации sidebar items
4
+ */
5
+ export * from './types';
6
+ export { validateSidebarItems, getSidebarValidationReport, type SidebarValidationError, type SidebarValidationResult } from './sidebarValidator';
7
+ export * from './useSidebarValidator';
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Валидатор для данных sidebar items
3
+ */
4
+ export interface SidebarValidationError {
5
+ path: string;
6
+ message: string;
7
+ value?: any;
8
+ }
9
+ export interface SidebarValidationResult {
10
+ isValid: boolean;
11
+ errors: SidebarValidationError[];
12
+ warnings: SidebarValidationError[];
13
+ }
14
+ /**
15
+ * Основная функция валидации списка sidebar items
16
+ */
17
+ export declare function validateSidebarItems(items: any): SidebarValidationResult;
18
+ /**
19
+ * Получить читаемый отчет о валидации
20
+ */
21
+ export declare function getSidebarValidationReport(result: SidebarValidationResult): string;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Типы для данных sidebar items
3
+ */
4
+ export interface SidebarItem {
5
+ itemId: string;
6
+ icon: string;
7
+ name?: string;
8
+ notificationCount: number;
9
+ notificationColor?: string;
10
+ selected: boolean;
11
+ isFixedBottom?: boolean;
12
+ isFixedTop?: boolean;
13
+ }
14
+ export type SidebarItemList = SidebarItem[];
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Реактивный composable для валидации sidebar items
3
+ */
4
+ import { type Ref } from 'vue';
5
+ import { type SidebarValidationResult } from './sidebarValidator';
6
+ export interface UseSidebarValidatorOptions {
7
+ autoValidate?: boolean;
8
+ debounce?: number;
9
+ }
10
+ export interface UseSidebarValidatorReturn {
11
+ validationResult: Ref<SidebarValidationResult | null>;
12
+ isValid: Ref<boolean>;
13
+ errors: Ref<SidebarValidationResult['errors']>;
14
+ warnings: Ref<SidebarValidationResult['warnings']>;
15
+ errorCount: Ref<number>;
16
+ warningCount: Ref<number>;
17
+ report: Ref<string>;
18
+ validate: () => SidebarValidationResult;
19
+ reset: () => void;
20
+ showReport: () => void;
21
+ }
22
+ /**
23
+ * Composable для реактивной валидации sidebar items
24
+ *
25
+ * @param sidebarData - реактивная ссылка на данные sidebar items
26
+ * @param options - опции валидатора
27
+ * @returns объект с реактивными свойствами и методами валидации
28
+ *
29
+ * @example
30
+ * ```ts
31
+ * import { ref } from 'vue';
32
+ * import { useSidebarValidator } from '@/apps/validators/sidebar';
33
+ * import { sidebarItems } from '@/apps/data/sidebarItems';
34
+ *
35
+ * const sidebarData = ref(sidebarItems);
36
+ * const { isValid, errorCount, showReport } = useSidebarValidator(sidebarData, {
37
+ * autoValidate: true,
38
+ * debounce: 300
39
+ * });
40
+ *
41
+ * // Показать полный отчет в консоли
42
+ * showReport();
43
+ * ```
44
+ */
45
+ export declare function useSidebarValidator(sidebarData: Ref<any>, options?: UseSidebarValidatorOptions): UseSidebarValidatorReturn;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Простой тестовый файл для проверки валидатора
3
+ *
4
+ * Использование:
5
+ *
6
+ * В вашем компоненте или приложении:
7
+ * ```ts
8
+ * import { testChatsValidation } from '@/apps/validators/test';
9
+ * testChatsValidation();
10
+ * ```
11
+ */
12
+ /**
13
+ * Запустить валидацию текущих данных чатов и вывести результат в консоль
14
+ */
15
+ export declare function testChatsValidation(): import("./chats").ValidationResult;
16
+ /**
17
+ * Валидация произвольных данных чатов
18
+ */
19
+ export declare function testCustomChats(customChats: any[]): import("./chats").ValidationResult;
20
+ /**
21
+ * Пример валидации с ошибками (для тестирования)
22
+ */
23
+ export declare function testWithErrors(): import("./chats").ValidationResult;
@@ -1,14 +1,14 @@
1
1
  declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
2
2
  size: {
3
- type: (NumberConstructor | StringConstructor)[];
3
+ type: (StringConstructor | NumberConstructor)[];
4
4
  default: number;
5
5
  };
6
6
  width: {
7
- type: (NumberConstructor | StringConstructor)[];
7
+ type: (StringConstructor | NumberConstructor)[];
8
8
  default: number;
9
9
  };
10
10
  height: {
11
- type: (NumberConstructor | StringConstructor)[];
11
+ type: (StringConstructor | NumberConstructor)[];
12
12
  default: number;
13
13
  };
14
14
  }>, {}, {}, {
@@ -16,15 +16,15 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
16
16
  computedHeight(): string | number;
17
17
  }, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
18
18
  size: {
19
- type: (NumberConstructor | StringConstructor)[];
19
+ type: (StringConstructor | NumberConstructor)[];
20
20
  default: number;
21
21
  };
22
22
  width: {
23
- type: (NumberConstructor | StringConstructor)[];
23
+ type: (StringConstructor | NumberConstructor)[];
24
24
  default: number;
25
25
  };
26
26
  height: {
27
- type: (NumberConstructor | StringConstructor)[];
27
+ type: (StringConstructor | NumberConstructor)[];
28
28
  default: number;
29
29
  };
30
30
  }>> & Readonly<{}>, {
@@ -1,13 +1,13 @@
1
1
  declare const _default: import("vue").DefineComponent<{}, {
2
2
  $emit: (event: "select-attribute-channel" | "phone-call", ...args: any[]) => void;
3
- contactAttributes: unknown[];
4
3
  channels: unknown[];
4
+ contactAttributes: unknown[];
5
5
  recentAttributeChannels: Record<string, any>;
6
6
  selectedDialog: Record<string, any>;
7
7
  channelTooltips: Record<string, any>;
8
8
  $props: {
9
- readonly contactAttributes?: unknown[] | undefined;
10
9
  readonly channels?: unknown[] | undefined;
10
+ readonly contactAttributes?: unknown[] | undefined;
11
11
  readonly recentAttributeChannels?: Record<string, any> | undefined;
12
12
  readonly selectedDialog?: Record<string, any> | undefined;
13
13
  readonly channelTooltips?: Record<string, any> | undefined;
@@ -3,14 +3,14 @@ declare const meta: {
3
3
  title: string;
4
4
  component: import("vue").DefineComponent<{}, {
5
5
  $emit: (event: "select-attribute-channel" | "phone-call", ...args: any[]) => void;
6
- contactAttributes: unknown[];
7
6
  channels: unknown[];
7
+ contactAttributes: unknown[];
8
8
  recentAttributeChannels: Record<string, any>;
9
9
  selectedDialog: Record<string, any>;
10
10
  channelTooltips: Record<string, any>;
11
11
  $props: {
12
- readonly contactAttributes?: unknown[] | undefined;
13
12
  readonly channels?: unknown[] | undefined;
13
+ readonly contactAttributes?: unknown[] | undefined;
14
14
  readonly recentAttributeChannels?: Record<string, any> | undefined;
15
15
  readonly selectedDialog?: Record<string, any> | undefined;
16
16
  readonly channelTooltips?: Record<string, any> | undefined;
@@ -1,11 +1,11 @@
1
1
  declare const _default: import("vue").DefineComponent<{}, {
2
2
  $emit: (event: "edit", ...args: any[]) => void;
3
- index: number;
4
3
  value: string;
4
+ index: number;
5
5
  isFilled: boolean;
6
6
  $props: {
7
- readonly index?: number | undefined;
8
7
  readonly value?: string | undefined;
8
+ readonly index?: number | undefined;
9
9
  readonly isFilled?: boolean | undefined;
10
10
  };
11
11
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -1,11 +1,11 @@
1
1
  declare const _default: import("vue").DefineComponent<{}, {
2
2
  $emit: (event: "close" | "select-attribute-channel" | "open-crm", ...args: any[]) => void;
3
- channels: unknown[];
4
3
  contact: Record<string, any>;
4
+ channels: unknown[];
5
5
  currentDialog: Record<string, any>;
6
6
  $props: {
7
- readonly channels?: unknown[] | undefined;
8
7
  readonly contact?: Record<string, any> | undefined;
8
+ readonly channels?: unknown[] | undefined;
9
9
  readonly currentDialog?: Record<string, any> | undefined;
10
10
  };
11
11
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -4,12 +4,12 @@ declare const meta: {
4
4
  title: string;
5
5
  component: import("vue").DefineComponent<{}, {
6
6
  $emit: (event: "close" | "select-attribute-channel" | "open-crm", ...args: any[]) => void;
7
- channels: unknown[];
8
7
  contact: Record<string, any>;
8
+ channels: unknown[];
9
9
  currentDialog: Record<string, any>;
10
10
  $props: {
11
- readonly channels?: unknown[] | undefined;
12
11
  readonly contact?: Record<string, any> | undefined;
12
+ readonly channels?: unknown[] | undefined;
13
13
  readonly currentDialog?: Record<string, any> | undefined;
14
14
  };
15
15
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -3,14 +3,14 @@ declare const _default: import("vue").DefineComponent<{}, {
3
3
  filter: Function;
4
4
  name: string;
5
5
  title: string;
6
- channels: unknown[];
7
6
  contacts: unknown[];
7
+ channels: unknown[];
8
8
  $props: {
9
9
  readonly filter?: Function | undefined;
10
10
  readonly name?: string | undefined;
11
11
  readonly title?: string | undefined;
12
- readonly channels?: unknown[] | undefined;
13
12
  readonly contacts?: unknown[] | undefined;
13
+ readonly channels?: unknown[] | undefined;
14
14
  };
15
15
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
16
16
  export default _default;
@@ -6,14 +6,14 @@ declare const meta: {
6
6
  filter: Function;
7
7
  name: string;
8
8
  title: string;
9
- channels: unknown[];
10
9
  contacts: unknown[];
10
+ channels: unknown[];
11
11
  $props: {
12
12
  readonly filter?: Function | undefined;
13
13
  readonly name?: string | undefined;
14
14
  readonly title?: string | undefined;
15
- readonly channels?: unknown[] | undefined;
16
15
  readonly contacts?: unknown[] | undefined;
16
+ readonly channels?: unknown[] | undefined;
17
17
  };
18
18
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
19
19
  args: {};
@@ -17,7 +17,6 @@ export { default as FeedFoundItem } from './2_blocks/FeedFoundItem/FeedFoundItem
17
17
  export { default as FeedFoundObjects } from './2_blocks/FeedFoundObjects/FeedFoundObjects.vue';
18
18
  export { default as FeedSearch } from './2_blocks/FeedSearch/FeedSearch.vue';
19
19
  export { default as SelectUser } from './2_blocks/SelectUser/SelectUser.vue';
20
- export { default as SelectUser2 } from './2_blocks/SelectUser2/SelectUser2.vue';
21
20
  export { default as ButtonCommandsSelector } from './2_chatinput_elements/ButtonCommandsSelector/ButtonCommandsSelector.vue';
22
21
  export { default as ButtonEmojiPicker } from './2_chatinput_elements/ButtonEmojiPicker/ButtonEmojiPicker.vue';
23
22
  export { default as ButtonTemplateSelector } from './2_chatinput_elements/ButtonTemplateSelector/ButtonTemplateSelector.vue';
@@ -61,9 +60,6 @@ export { default as SystemMessage } from './2_feed_elements/SystemMessage/System
61
60
  export { default as TextMessage } from './2_feed_elements/TextMessage/TextMessage.vue';
62
61
  export { default as TypingMessage } from './2_feed_elements/TypingMessage/TypingMessage.vue';
63
62
  export { default as VideoMessage } from './2_feed_elements/VideoMessage/VideoMessage.vue';
64
- export { default as CreateChat } from './2_modals/CreateChat/CreateChat.vue';
65
- export { default as CreateChat2 } from './2_modals/CreateChat2/CreateChat2.vue';
66
- export { default as CreateDialog } from './2_modals/CreateDialog/CreateDialog.vue';
67
63
  export { default as Modal } from './2_modals/Modal/Modal.vue';
68
64
  export { default as ModalFullscreen } from './2_modals/ModalFullscreen/ModalFullscreen.vue';
69
65
  export { default as ModalNoFooter } from './2_modals/ModalNoFooter/ModalNoFooter.vue';
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Форматирует Unix timestamp в читаемое представление времени относительно текущего момента
3
+ *
4
+ * @param timestamp - Unix timestamp в секундах в виде строки
5
+ * @returns Форматированная строка времени или undefined, если timestamp пустой
6
+ *
7
+ * Формат возвращаемого значения зависит от давности события:
8
+ * - "Только что" - если прошло меньше секунды
9
+ * - "X секунды назад" - если прошло меньше минуты
10
+ * - "X минуты назад" - если прошло меньше часа
11
+ * - "X часа назад" - если прошло меньше суток
12
+ * - "X дня назад" - если прошло от 1 до 30 дней
13
+ * - Дата в формате "dd.mm.yyyy" (ru-RU) - если прошло больше 30 дней
14
+ *
15
+ * @example
16
+ * formatTimestamp('1697558400') // может вернуть "5 минут назад" или "2 дня назад"
17
+ * formatTimestamp('') // returns undefined
18
+ * formatTimestamp('1609459200') // returns "01.01.2021" (если прошло больше месяца)
19
+ */
20
+ export declare function formatTimestamp(timestamp: string): string | undefined;
@@ -0,0 +1,14 @@
1
+ export declare const statuses: string[];
2
+ /**
3
+ * Преобразует статус сообщения в соответствующий CSS-класс для стилизации
4
+ *
5
+ * @param status - Статус сообщения ('read', 'received', 'sent' или другое значение)
6
+ * @returns CSS-класс для статуса ('status--read', 'status--received') или пустую строку для остальных случаев
7
+ *
8
+ * @example
9
+ * getStatus('read') // returns 'status--read'
10
+ * getStatus('received') // returns 'status--received'
11
+ * getStatus('sent') // returns ''
12
+ * getStatus('unknown') // returns ''
13
+ */
14
+ export declare const getStatus: (status: string) => string;
@@ -0,0 +1,5 @@
1
+ export * from './getStatusMessage';
2
+ export * from './formatTimestamp';
3
+ export * from './playNotificationAudio';
4
+ export * from './insertDaySeparators';
5
+ export * from './sortByTimestamp';
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Вставляет разделители дней между сообщениями в хронологическом порядке
3
+ *
4
+ * Функция анализирует временные метки сообщений и добавляет специальные объекты-разделители
5
+ * перед сообщениями из нового дня. Разделители помогают визуально группировать сообщения по датам.
6
+ *
7
+ * @param messages - Массив объектов с полем timestamp (Unix timestamp в секундах)
8
+ * @param outPreviousDay - Опциональный timestamp предыдущего дня для учета истории.
9
+ * Используется, чтобы не вставлять разделитель в начале, если это тот же день
10
+ * @returns Массив, содержащий исходные сообщения и вставленные разделители дней
11
+ *
12
+ * Формат разделителя дня:
13
+ * ```ts
14
+ * {
15
+ * isSeparator: true,
16
+ * day: string, // "Сегодня" | "Вчера" | локализованная дата
17
+ * text: string, // то же, что и day
18
+ * type: 'system.date'
19
+ * }
20
+ * ```
21
+ *
22
+ * Метки дней:
23
+ * - "Сегодня" - для сообщений текущего дня
24
+ * - "Вчера" - для сообщений вчерашнего дня
25
+ * - Локализованная дата (через toLocaleDateString()) - для более старых дат
26
+ *
27
+ * @example
28
+ * const messages = [
29
+ * { timestamp: 1727027959, text: 'Привет' }, // сегодня
30
+ * { timestamp: 1726916359, text: 'Как дела?' }, // вчера
31
+ * { timestamp: 1726830251, text: 'Хорошо' } // позавчера
32
+ * ];
33
+ * const result = insertDaySeparators(messages);
34
+ * // Результат будет содержать разделители между днями:
35
+ * // [
36
+ * // { isSeparator: true, day: 'Сегодня', text: 'Сегодня', type: 'system.date' },
37
+ * // { timestamp: 1727027959, text: 'Привет' },
38
+ * // { isSeparator: true, day: 'Вчера', text: 'Вчера', type: 'system.date' },
39
+ * // { timestamp: 1726916359, text: 'Как дела?' },
40
+ * // { isSeparator: true, day: '20.09.2024', text: '20.09.2024', type: 'system.date' },
41
+ * // { timestamp: 1726830251, text: 'Хорошо' }
42
+ * // ]
43
+ */
44
+ export declare const insertDaySeparators: (messages: {
45
+ timestamp: number;
46
+ }[], outPreviousDay?: number | null) => unknown[];
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Воспроизводит звук уведомления с проверкой разрешений на аудио
3
+ *
4
+ * @returns Promise, который разрешается после попытки воспроизведения звука
5
+ */
6
+ export declare const playNotificationAudio: () => Promise<void>;
@@ -1,8 +1,3 @@
1
- export * from './formatTimestamp';
2
- export * from './generatePreview';
3
- export * from './getStatusMessage';
4
- export * from './getTypeFileByMime';
5
- export * from './throttle';
6
1
  export * from './uploadFile';
7
2
  export * from './useDelayDebouncedRef';
8
3
  export * from './useImmediateDebouncedRef';
@@ -11,5 +6,4 @@ export * from './useModal';
11
6
  export * from './useSearchModel';
12
7
  export * from './useTheme';
13
8
  export * from './useVideoRecorder';
14
- export * from './insertDaySeparators';
15
- export * from './playNotificationAudio';
9
+ export * from './modals';
@@ -0,0 +1,4 @@
1
+ export * from './useCreateChat';
2
+ export * from './useCreateChat2';
3
+ export * from './useCreateDialog';
4
+ export * from './useModalSelectUser2';
@@ -0,0 +1,3 @@
1
+ export * from './generatePreview';
2
+ export * from './getTypeFileByMime';
3
+ export * from './uploadFile';