@mobilon-dev/chotto 0.3.11 → 0.3.13

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 (63) hide show
  1. package/dist/CreateChat-BLSa6Pvz.js +31 -0
  2. package/dist/CreateChat2-DkcpMfu0.js +42 -0
  3. package/dist/CreateDialog-CRtDbLYn.js +77 -0
  4. package/dist/{ModalVideoRecorder-BM0u4RGq.js → ModalVideoRecorder-DRMD5W4Z.js} +1 -1
  5. package/dist/SelectUser2-DxExoHs-.js +46 -0
  6. package/dist/chotto.css +1 -1
  7. package/dist/{index-BHd0LYyt.js → index-CbPyuani.js} +4842 -4532
  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/components/1_icons/AvatarIcon.vue.d.ts +6 -6
  11. package/dist/types/components/2_blocks/CommunicationPanel/CommunicationPanel.vue.d.ts +2 -2
  12. package/dist/types/components/2_blocks/CommunicationPanel/stories/CommunicationPanel.stories.d.ts +2 -2
  13. package/dist/types/components/2_chatinput_elements/PlaceholderComponent/PlaceholderComponent.vue.d.ts +2 -2
  14. package/dist/types/components/2_elements/ContactInfo/ContactInfo.vue.d.ts +2 -2
  15. package/dist/types/components/2_elements/ContactInfo/stories/ContactInfo.stories.d.ts +2 -2
  16. package/dist/types/components/2_modals/CreateDialog/CreateDialog.vue.d.ts +2 -2
  17. package/dist/types/components/2_modals/CreateDialog/stories/CreateDialog.stories.d.ts +2 -2
  18. package/dist/types/components/3_compounds/ChatList/ChatList.vue.d.ts +2 -2
  19. package/dist/types/components/5_containers/BaseContainer/BaseContainer.vue.d.ts +0 -2
  20. package/dist/types/components/5_containers/FloatContainer/FloatContainer.vue.d.ts +0 -2
  21. package/dist/types/components/index.d.ts +0 -4
  22. package/dist/types/functions/formatTimestamp.d.ts +20 -0
  23. package/dist/types/functions/getStatusMessage.d.ts +14 -0
  24. package/dist/types/functions/index.d.ts +5 -0
  25. package/dist/types/functions/insertDaySeparators.d.ts +46 -0
  26. package/dist/types/functions/playNotificationAudio.d.ts +6 -0
  27. package/dist/types/hooks/index.d.ts +2 -9
  28. package/dist/types/hooks/modals/index.d.ts +5 -0
  29. package/dist/types/hooks/uploadFile/index.d.ts +3 -0
  30. package/dist/types/hooks/useMessage.d.ts +69 -1
  31. package/dist/types/hooks/validators/chats/chatValidator.d.ts +21 -0
  32. package/dist/types/hooks/validators/chats/index.d.ts +7 -0
  33. package/dist/types/hooks/validators/chats/types.d.ts +63 -0
  34. package/dist/types/hooks/validators/chats/useChatValidator.d.ts +49 -0
  35. package/dist/types/hooks/validators/index.d.ts +3 -0
  36. package/dist/types/hooks/validators/messages/index.d.ts +7 -0
  37. package/dist/types/hooks/validators/messages/messageValidator.d.ts +21 -0
  38. package/dist/types/hooks/validators/messages/types.d.ts +66 -0
  39. package/dist/types/hooks/validators/messages/useMessageValidator.d.ts +49 -0
  40. package/dist/types/hooks/validators/sidebar/index.d.ts +7 -0
  41. package/dist/types/hooks/validators/sidebar/sidebarValidator.d.ts +21 -0
  42. package/dist/types/hooks/validators/sidebar/types.d.ts +14 -0
  43. package/dist/types/hooks/validators/sidebar/useSidebarValidator.d.ts +45 -0
  44. package/dist/types/index.d.ts +1 -0
  45. package/dist/vuessages.es.js +91 -83
  46. package/dist/vuessages.umd.js +45 -6
  47. package/package.json +1 -1
  48. package/dist/types/apps/helpers/index.d.ts +0 -9
  49. package/dist/types/hooks/formatTimestamp.d.ts +0 -1
  50. package/dist/types/hooks/getStatusMessage.d.ts +0 -2
  51. package/dist/types/hooks/insertDaySeparators.d.ts +0 -3
  52. package/dist/types/hooks/playNotificationAudio.d.ts +0 -1
  53. /package/dist/types/{hooks → components/3_compounds/Feed/functions}/throttle.d.ts +0 -0
  54. /package/dist/types/{apps/helpers → functions}/sortByTimestamp.d.ts +0 -0
  55. /package/dist/types/{apps/helpers → hooks/modals}/useCreateChat.d.ts +0 -0
  56. /package/dist/types/{apps/helpers → hooks/modals}/useCreateChat2.d.ts +0 -0
  57. /package/dist/types/{apps/helpers → hooks/modals}/useCreateDialog.d.ts +0 -0
  58. /package/dist/types/hooks/{useModal.d.ts → modals/useModal.d.ts} +0 -0
  59. /package/dist/types/{apps/helpers → hooks/modals}/useModalSelectUser2.d.ts +0 -0
  60. /package/dist/types/hooks/{useVideoRecorder.d.ts → modals/useVideoRecorder.d.ts} +0 -0
  61. /package/dist/types/hooks/{generatePreview.d.ts → uploadFile/generatePreview.d.ts} +0 -0
  62. /package/dist/types/hooks/{getTypeFileByMime.d.ts → uploadFile/getTypeFileByMime.d.ts} +0 -0
  63. /package/dist/types/hooks/{uploadFile.d.ts → uploadFile/uploadFile.d.ts} +0 -0
@@ -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;
@@ -2,3 +2,4 @@ import 'primeicons/primeicons.css';
2
2
  import './themes/global.scss';
3
3
  export * from './components';
4
4
  export * from './hooks';
5
+ export * from './functions';
@@ -1,99 +1,107 @@
1
- import { am as s, J as t, y as o, A as l, ap as n, ak as r, K as i, k as d, B as c, l as u, m as p, n as M, N as g, z as C, v as m, D as h, ag as y, w as S, ah as F, G as B, x as A, ao as I, a as R, b as T, f as b, c as f, H as P, C as x, aa as D, ab as k, ac as v, O as W, Q as L, E as w, al as E, ai as U, F as V, g as j, R as K, an as N, h as Q, X as q, o as z, p as G, aq as O, Y as H, L as J, M as X, Z as Y, ad as Z, ae as $, af as _, P as aa, $ as ea, a0 as sa, a1 as ta, a2 as oa, a3 as la, a4 as na, S as ra, i as ia, j as da, d as ca, aj as ua, a5 as pa, a6 as Ma, e as ga, q as Ca, a7 as ma, I as ha, T as ya, a8 as Sa, U as Fa, a9 as Ba, V as Aa, r as Ia, s as Ra, t as Ta, u as ba, W as fa, ar as Pa, as as xa, au as Da, av as ka, aF as va, aG as Wa, at as La, aw as wa, ax as Ea, ay as Ua, az as Va, aA as ja, aB as Ka, aE as Na, aC as Qa, aD as qa } from "./index-BHd0LYyt.js";
1
+ import { ai as s, I as t, x as o, A as l, al as i, ag as r, J as n, j as d, B as u, k as c, l as M, m as g, K as p, y as m, u as C, z as h, ac as y, v as S, ad as B, D as F, w as I, ak as A, a as R, b as T, f as b, c as v, G as V, C as f, N as P, O as x, E as D, ah as k, ae as L, F as W, g as w, Q as E, aj as U, h as j, R as K, n as N, o as O, am as Q, X as q, L as z, M as G, Y as H, a9 as J, aa as X, ab as Y, P as Z, Z as $, $ as _, a0 as aa, a1 as ea, a2 as sa, a3 as ta, S as oa, i as la, d as ia, af as ra, a4 as na, a5 as da, e as ua, p as ca, a6 as Ma, H as ga, T as pa, a7 as ma, U as Ca, a8 as ha, V as ya, q as Sa, r as Ba, s as Fa, t as Ia, W as Aa, aL as Ra, an as Ta, aE as ba, aH as va, aK as Va, ao as fa, aB as Pa, aN as xa, aM as Da, aO as ka, aJ as La, ap as Wa, aC as wa, aq as Ea, ar as Ua, as as ja, aF as Ka, av as Na, aw as Oa, ax as Qa, ay as qa, az as za, at as Ga, aI as Ha, au as Ja, aA as Xa, aD as Ya, aG as Za } from "./index-CbPyuani.js";
2
2
  export {
3
3
  s as AdaptiveExtendedLayout,
4
4
  t as AudioMessage,
5
5
  o as AudioRecorder,
6
6
  l as AvatarIcon,
7
- n as BaseContainer,
7
+ i as BaseContainer,
8
8
  r as BaseLayout,
9
- i as BaseReplyMessage,
9
+ n as BaseReplyMessage,
10
10
  d as ButtonCommandsSelector,
11
- c as ButtonContextMenu,
12
- u as ButtonEmojiPicker,
13
- p as ButtonTemplateSelector,
14
- M as ButtonWabaTemplateSelector,
15
- g as CallMessage,
16
- C as ChannelSelector,
17
- m as ChatFilter,
11
+ u as ButtonContextMenu,
12
+ c as ButtonEmojiPicker,
13
+ M as ButtonTemplateSelector,
14
+ g as ButtonWabaTemplateSelector,
15
+ p as CallMessage,
16
+ m as ChannelSelector,
17
+ C as ChatFilter,
18
18
  h as ChatInfo,
19
19
  y as ChatInput,
20
20
  S as ChatItem,
21
- F as ChatList,
22
- B as ChatPanel,
23
- A as ChatTabs,
24
- I as ChatWrapper,
21
+ B as ChatList,
22
+ F as ChatPanel,
23
+ I as ChatTabs,
24
+ A as ChatWrapper,
25
25
  R as CheckIcon,
26
26
  T as CloseButtonIcon,
27
27
  b as CommunicationPanel,
28
- f as ContactCRMIcon,
29
- P as ContactInfo,
30
- x as ContextMenu,
31
- D as CreateChat,
32
- k as CreateChat2,
33
- v as CreateDialog,
34
- W as DateMessage,
35
- L as DateMessageSticky,
36
- w as EmbedPreview,
37
- E as ExtendedLayout,
38
- U as Feed,
39
- V as FeedFoundItem,
40
- j as FeedFoundObjects,
41
- K as FeedKeyboard,
42
- N as FeedLayout,
43
- Q as FeedSearch,
44
- q as FileMessage,
45
- z as FilePreview,
46
- G as FileUploader,
47
- O as FloatContainer,
48
- H as ImageMessage,
49
- J as LinkPreview,
50
- X as MenuIcon,
51
- Y as MessageKeyboard,
52
- Z as Modal,
53
- $ as ModalFullscreen,
54
- _ as ModalNoFooter,
55
- aa as PlaceholderComponent,
56
- ea as ReplyAudioMessage,
57
- sa as ReplyCallMessage,
58
- ta as ReplyFileMessage,
59
- oa as ReplyImageMessage,
60
- la as ReplyTextMessage,
61
- na as ReplyVideoMessage,
62
- ra as SearchIcon,
63
- ia as SelectUser,
64
- da as SelectUser2,
65
- ca as SettingsIcon,
66
- ua as SideBar,
67
- pa as SplashScreen,
68
- Ma as SystemMessage,
69
- ga as TelegramIcon,
70
- Ca as TemplateSelector,
71
- ma as TextMessage,
72
- ha as ThemeMode,
73
- ya as Tooltip,
74
- Sa as TypingMessage,
75
- Fa as UserProfile,
76
- Ba as VideoMessage,
77
- Aa as VideoRecorder,
78
- Ia as WABAAttachmentSection,
79
- Ra as WABAQuickReplyButtons,
80
- Ta as WABASeparatedQuickButtons,
81
- ba as WABATemplateSelector,
82
- fa as WhatsAppIcon,
83
- Pa as formatTimestamp,
84
- xa as generatePreview,
85
- Da as getStatus,
86
- ka as getTypeFileByMime,
87
- va as insertDaySeparators,
88
- Wa as playNotificationAudio,
28
+ v as ContactCRMIcon,
29
+ V as ContactInfo,
30
+ f as ContextMenu,
31
+ P as DateMessage,
32
+ x as DateMessageSticky,
33
+ D as EmbedPreview,
34
+ k as ExtendedLayout,
35
+ L as Feed,
36
+ W as FeedFoundItem,
37
+ w as FeedFoundObjects,
38
+ E as FeedKeyboard,
39
+ U as FeedLayout,
40
+ j as FeedSearch,
41
+ K as FileMessage,
42
+ N as FilePreview,
43
+ O as FileUploader,
44
+ Q as FloatContainer,
45
+ q as ImageMessage,
46
+ z as LinkPreview,
47
+ G as MenuIcon,
48
+ H as MessageKeyboard,
49
+ J as Modal,
50
+ X as ModalFullscreen,
51
+ Y as ModalNoFooter,
52
+ Z as PlaceholderComponent,
53
+ $ as ReplyAudioMessage,
54
+ _ as ReplyCallMessage,
55
+ aa as ReplyFileMessage,
56
+ ea as ReplyImageMessage,
57
+ sa as ReplyTextMessage,
58
+ ta as ReplyVideoMessage,
59
+ oa as SearchIcon,
60
+ la as SelectUser,
61
+ ia as SettingsIcon,
62
+ ra as SideBar,
63
+ na as SplashScreen,
64
+ da as SystemMessage,
65
+ ua as TelegramIcon,
66
+ ca as TemplateSelector,
67
+ Ma as TextMessage,
68
+ ga as ThemeMode,
69
+ pa as Tooltip,
70
+ ma as TypingMessage,
71
+ Ca as UserProfile,
72
+ ha as VideoMessage,
73
+ ya as VideoRecorder,
74
+ Sa as WABAAttachmentSection,
75
+ Ba as WABAQuickReplyButtons,
76
+ Fa as WABASeparatedQuickButtons,
77
+ Ia as WABATemplateSelector,
78
+ Aa as WhatsAppIcon,
79
+ Ra as formatTimestamp,
80
+ Ta as generatePreview,
81
+ ba as getMessageValidationReport,
82
+ va as getSidebarValidationReport,
83
+ Va as getStatus,
84
+ fa as getTypeFileByMime,
85
+ Pa as getValidationReport,
86
+ xa as insertDaySeparators,
87
+ Da as playNotificationAudio,
88
+ ka as sortByTimestamp,
89
89
  La as statuses,
90
- wa as throttle,
91
- Ea as uploadFile,
92
- Ua as useDelayDebouncedRef,
93
- Va as useImmediateDebouncedRef,
90
+ Wa as uploadFile,
91
+ wa as useChatValidator,
92
+ Ea as useDelayDebouncedRef,
93
+ Ua as useImmediateDebouncedRef,
94
94
  ja as useMessage,
95
- Ka as useModal,
96
- Na as useModalVideoRecorder,
97
- Qa as useSearchModel,
98
- qa as useTheme
95
+ Ka as useMessageValidator,
96
+ Na as useModalCreateChat,
97
+ Oa as useModalCreateChat2,
98
+ Qa as useModalCreateDialog,
99
+ qa as useModalSelectUser2,
100
+ za as useModalVideoRecorder,
101
+ Ga as useSearchModel,
102
+ Ha as useSidebarValidator,
103
+ Ja as useTheme,
104
+ Xa as validateChats,
105
+ Ya as validateMessages,
106
+ Za as validateSidebarItems
99
107
  };