@mobilon-dev/chotto 0.3.72 → 0.3.74

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.
@@ -3,38 +3,11 @@ import AudioMessage from '../AudioMessage.vue';
3
3
  declare const meta: Meta<typeof AudioMessage>;
4
4
  export default meta;
5
5
  type Story = StoryObj<typeof AudioMessage>;
6
- export declare const Default: Story;
7
- export declare const LeftMessage: Story;
8
- export declare const LeftMessageWithActions: Story;
9
- export declare const RightMessage: Story;
10
- export declare const LeftMessageWithAvatar: Story;
11
- export declare const RightMessageWithAvatar: Story;
12
- export declare const LeftMessageWithAvatarAndSubtext: Story;
13
- export declare const RightMessageWithAvatarAndSubtext: Story;
14
- export declare const RightMessageSent: Story;
15
- export declare const RightMessageReceived: Story;
16
- export declare const RightMessageRead: Story;
17
- export declare const RightMessagePending: Story;
18
- export declare const RightMessageError: Story;
19
- export declare const RightMessageErrorWithStatusMsg: Story;
20
- export declare const RightMessageWithActions: Story;
21
- export declare const RightMessageWithActionsAndText: Story;
22
- export declare const LeftMessageWithActionsAndText: Story;
23
- export declare const RightMessageWithActionsAndTextWithLink: Story;
24
- export declare const LeftMessageWithActionsAndTextWithLink: Story;
25
- export declare const RightMessageWithTranscript: Story;
26
- export declare const LeftMessageWithTranscript: Story;
27
- export declare const LeftMessageWithReplyText: Story;
28
- export declare const RightMessageWithReplyText: Story;
29
- export declare const LeftMessageWithReplyImage: Story;
30
- export declare const RightMessageWithReplyImage: Story;
31
- export declare const LeftMessageWithReplyVideo: Story;
32
- export declare const RightMessageWithReplyVideo: Story;
33
- export declare const LeftMessageWithReplyFile: Story;
34
- export declare const RightMessageWithReplyFile: Story;
35
- export declare const LeftMessageWithReplyAudio: Story;
36
- export declare const RightMessageWithReplyAudio: Story;
37
- export declare const LeftMessageWithReplyCall: Story;
38
- export declare const RightMessageWithReplyCall: Story;
39
- export declare const LeftMessageWithPreviewLink: Story;
40
- export declare const RightMessageWithPreviewLink: Story;
6
+ export declare const WithTextAndSummary: Story;
7
+ export declare const WithoutTextAndSummary: Story;
8
+ export declare const WithoutText: Story;
9
+ export declare const WithoutSummary: Story;
10
+ export declare const PlannedStatus: Story;
11
+ export declare const ErrorStatus: Story;
12
+ export declare const NotConfiguredStatus: Story;
13
+ export declare const WithLongTextAndSummary: Story;
@@ -4,6 +4,15 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
4
4
  type: () => ICallMessage;
5
5
  required: true;
6
6
  };
7
+ /**
8
+ * Позволяет переопределить действие кнопки "Перезвонить" снаружи (например, из feed).
9
+ * Если не задано, компонент эмитит событие `call`.
10
+ */
11
+ onCall: {
12
+ type: () => ((message: ICallMessage) => void) | undefined;
13
+ required: false;
14
+ default: undefined;
15
+ };
7
16
  applyStyle: {
8
17
  type: FunctionConstructor;
9
18
  default: () => null;
@@ -16,11 +25,21 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
16
25
  }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
17
26
  action: (...args: any[]) => void;
18
27
  reply: (...args: any[]) => void;
28
+ call: (...args: any[]) => void;
19
29
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
20
30
  message: {
21
31
  type: () => ICallMessage;
22
32
  required: true;
23
33
  };
34
+ /**
35
+ * Позволяет переопределить действие кнопки "Перезвонить" снаружи (например, из feed).
36
+ * Если не задано, компонент эмитит событие `call`.
37
+ */
38
+ onCall: {
39
+ type: () => ((message: ICallMessage) => void) | undefined;
40
+ required: false;
41
+ default: undefined;
42
+ };
24
43
  applyStyle: {
25
44
  type: FunctionConstructor;
26
45
  default: () => null;
@@ -33,8 +52,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
33
52
  }>> & Readonly<{
34
53
  onAction?: ((...args: any[]) => any) | undefined;
35
54
  onReply?: ((...args: any[]) => any) | undefined;
55
+ onCall?: ((...args: any[]) => any) | undefined;
36
56
  }>, {
37
57
  applyStyle: Function;
38
58
  subtextTooltipData: Record<string, string>;
59
+ onCall: ((message: ICallMessage) => void) | undefined;
39
60
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
40
61
  export default _default;
@@ -4,3 +4,10 @@ declare const meta: Meta<typeof CallMessage>;
4
4
  export default meta;
5
5
  type Story = StoryObj<typeof CallMessage>;
6
6
  export declare const Default: Story;
7
+ export declare const ReadyStatus: Story;
8
+ export declare const PlannedStatus: Story;
9
+ export declare const ErrorStatus: Story;
10
+ export declare const NotConfiguredStatus: Story;
11
+ export declare const WithoutText: Story;
12
+ export declare const WithoutSummary: Story;
13
+ export declare const WithoutTextAndSummary: Story;
@@ -1,4 +1,4 @@
1
- import { IAction, IDialog } from '@types';
1
+ import { IAction } from '@types';
2
2
  export interface Reply {
3
3
  messageId: string;
4
4
  type: string;
@@ -82,16 +82,14 @@ export interface IAudioMessage {
82
82
  actions?: IAction[];
83
83
  views?: number;
84
84
  text?: string;
85
- /** Транскрипт: мок {text}, JSON-строка {"replies":[...]}, либо объект {replies} */
86
- transcript?: {
87
- text: string;
88
- } | string | ICallTranscriptPayload;
89
- /** Резюме: JSON-строка {"summary":"..."}, либо объект {summary} */
90
- summary?: string | ICallSummaryPayload;
85
+ /** Транскрипт со статусом и HTML */
86
+ transcript?: IAudioRecognitionPayload;
87
+ /** Резюме со статусом и HTML */
88
+ summary?: IAudioSummaryPayload;
91
89
  /** Сырые поля API для audio (пример: meta.transcript/meta.summary/meta.url) */
92
90
  meta?: Record<string, unknown> & {
93
- transcript?: string | ICallTranscriptPayload;
94
- summary?: string | ICallSummaryPayload;
91
+ transcript?: IAudioRecognitionPayload;
92
+ summary?: IAudioSummaryPayload;
95
93
  url?: string;
96
94
  };
97
95
  reply?: Reply;
@@ -113,9 +111,15 @@ export interface ICallTranscriptReply {
113
111
  export interface ICallTranscriptPayload {
114
112
  replies?: ICallTranscriptReply[];
115
113
  }
116
- /** Распарсенное тело строки meta.callSummary */
117
- export interface ICallSummaryPayload {
118
- summary?: string;
114
+ export type AudioRecognitionStatus = 'RECOGNITION_PLANNED' | 'RECOGNITION_READY' | 'RECOGNITION_NOT_CONFIGURED' | 'RECOGNITION_ERROR';
115
+ export type AudioSummaryStatus = 'SUMMARY_PLANNED' | 'SUMMARY_READY' | 'SUMMARY_NOT_CONFIGURED' | 'SUMMARY_ERROR';
116
+ export interface IAudioRecognitionPayload {
117
+ status?: AudioRecognitionStatus;
118
+ html?: string;
119
+ }
120
+ export interface IAudioSummaryPayload {
121
+ status?: AudioSummaryStatus;
122
+ html?: string;
119
123
  }
120
124
  export interface ICallMessage {
121
125
  messageId: string;
@@ -137,15 +141,10 @@ export interface ICallMessage {
137
141
  text?: string;
138
142
  actions?: IAction[];
139
143
  views?: number;
140
- /**
141
- * Транскрипт: JSON-строка {"replies":[...]}, объект с replies, либо мок { dialog, text }
142
- */
143
- transcript?: string | ICallTranscriptPayload | {
144
- dialog?: IDialog[];
145
- text?: string;
146
- };
147
- /** Резюме: строка, JSON-строка {"summary":"..."} или объект { summary } */
148
- callSummary?: string | ICallSummaryPayload;
144
+ /** Транскрипт со статусом и HTML */
145
+ transcript?: IAudioRecognitionPayload;
146
+ /** Резюме со статусом и HTML */
147
+ summary?: IAudioSummaryPayload;
149
148
  reactions?: MessageReactions;
150
149
  backgroundColor?: string;
151
150
  hasMessengerAccount?: boolean;
@@ -80,6 +80,15 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
80
80
  required: false;
81
81
  default: () => {};
82
82
  };
83
+ /**
84
+ * Позволяет переопределить действие "Перезвонить" для `message.call`.
85
+ * Будет передано внутрь `CallMessage` как проп `onCall`.
86
+ */
87
+ callMessageOnCallback: {
88
+ type: () => ((message: IFeedObject) => void) | undefined;
89
+ required: false;
90
+ default: undefined;
91
+ };
83
92
  }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
84
93
  loadMore: (...args: any[]) => void;
85
94
  smsInvite: (...args: any[]) => void;
@@ -166,6 +175,15 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
166
175
  required: false;
167
176
  default: () => {};
168
177
  };
178
+ /**
179
+ * Позволяет переопределить действие "Перезвонить" для `message.call`.
180
+ * Будет передано внутрь `CallMessage` как проп `onCall`.
181
+ */
182
+ callMessageOnCallback: {
183
+ type: () => ((message: IFeedObject) => void) | undefined;
184
+ required: false;
185
+ default: undefined;
186
+ };
169
187
  }>> & Readonly<{
170
188
  onLoadMore?: ((...args: any[]) => any) | undefined;
171
189
  onSmsInvite?: ((...args: any[]) => any) | undefined;
@@ -191,6 +209,7 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
191
209
  feedKeyboards: IFeedKeyboard[];
192
210
  feedKeyboardAlign: "left" | "right" | "center";
193
211
  isLoadingMore: boolean;
212
+ callMessageOnCallback: ((message: IFeedObject) => void) | undefined;
194
213
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
195
214
  declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
196
215
  export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mobilon-dev/chotto",
3
- "version": "0.3.72",
3
+ "version": "0.3.74",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",