@opens/widget-ui 1.1.0 → 1.1.2

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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app-screen-page.vue.d.ts","sourceRoot":"","sources":["../src/components/pages/app-screen-page.vue"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,kHAAkH,CAAC;AACzI,cAAc,kHAAkH,CAAC;AACjI,eAAe,SAAS,CAAC"}
@@ -1,54 +1,5 @@
1
- import { MessageAttachment, MessageResponse } from '@opens/gateways/chat-webservice';
2
- export type { MessageAttachment, MessageResponse };
3
- export type ServiceChatMessageFrom = 'system' | 'operator' | 'contact';
4
- export type ServiceChatMessageType = 'text' | 'automatic' | 'image' | 'document' | 'audio' | 'voice' | 'video' | 'interactive' | 'survey' | '_grouped_images';
5
- export type ServiceChatMessageAttachmentType = 'image' | 'video' | 'audio' | 'document';
6
- export type ServiceChatMessageAttachment = Omit<MessageAttachment, 'type'> & {
7
- type: ServiceChatMessageAttachmentType;
8
- };
9
- export type ServiceChatInteractiveOption = {
10
- label: string;
11
- value: string;
12
- description?: string;
13
- selected?: boolean;
14
- disabled?: boolean;
15
- };
16
- export type ServiceChatInteractiveBody = {
17
- description?: string;
18
- menu: ServiceChatInteractiveOption[];
19
- };
20
- export type ServiceChatMessage = Partial<Omit<MessageResponse, 'attachments' | 'caption'>> & {
21
- messageType: string;
22
- messageBody: string;
23
- caption?: string | null;
24
- attachments?: {
25
- data: ServiceChatMessageAttachment[];
26
- } | null;
27
- messages?: ServiceChatMessage[];
28
- };
29
- export type ServiceChatMessageAction = {
30
- action: 'download';
31
- message: ServiceChatMessage;
32
- attachment?: ServiceChatMessageAttachment;
33
- } | {
34
- action: 'select-option';
35
- message: ServiceChatMessage;
36
- option: ServiceChatInteractiveOption;
37
- } | {
38
- action: 'select-survey';
39
- message: ServiceChatMessage;
40
- option: ServiceChatInteractiveOption;
41
- };
42
- export type ServiceChatAttachmentType = 'image' | 'document';
43
- export type ServiceChatAttachment = {
44
- file: File;
45
- type: ServiceChatAttachmentType;
46
- previewUrl?: string;
47
- };
48
- export type ServiceChatAudio = {
49
- file: File;
50
- previewUrl: string;
51
- };
1
+ import { ServiceChatAttachment, ServiceChatAudio, ServiceChatMessage } from '../domain/chat-message';
2
+ export type { MessageAttachment, MessageResponse, ServiceChatAttachment, ServiceChatAttachmentType, ServiceChatAudio, ServiceChatInteractiveBody, ServiceChatInteractiveOption, ServiceChatMessage, ServiceChatMessageAction, ServiceChatMessageAttachment, ServiceChatMessageAttachmentType, ServiceChatMessageFrom, ServiceChatMessageType, } from '../domain/chat-message';
52
3
  export declare function useChatService(): {
53
4
  isSendingMessage: import('vue').Ref<boolean, boolean>;
54
5
  isErrorLoading: import('vue').Ref<boolean, boolean>;
@@ -139,7 +90,7 @@ export declare function useChatService(): {
139
90
  filename: string;
140
91
  contentType: string;
141
92
  link?: string | undefined;
142
- type: ServiceChatMessageAttachmentType;
93
+ type: import('./use-chat-service').ServiceChatMessageAttachmentType;
143
94
  }[];
144
95
  } | null | undefined;
145
96
  messages?: /*elided*/ any[] | undefined;
@@ -228,7 +179,7 @@ export declare function useChatService(): {
228
179
  filename: string;
229
180
  contentType: string;
230
181
  link?: string | undefined;
231
- type: ServiceChatMessageAttachmentType;
182
+ type: import('./use-chat-service').ServiceChatMessageAttachmentType;
232
183
  }[];
233
184
  } | null | undefined;
234
185
  messages?: /*elided*/ any[] | undefined;
@@ -0,0 +1,3 @@
1
+ export { ServiceChatMessageBuilder } from './service-chat-message.builder';
2
+ export { ServiceChatMessageVO } from './service-chat-message.vo';
3
+ export type { MessageAttachment, MessageResponse, ServiceChatAttachment, ServiceChatAttachmentType, ServiceChatAudio, ServiceChatInteractiveBody, ServiceChatInteractiveOption, ServiceChatMessage, ServiceChatMessageAction, ServiceChatMessageAttachment, ServiceChatMessageAttachmentType, ServiceChatMessageFrom, ServiceChatMessageType, } from './types';
@@ -0,0 +1,11 @@
1
+ import { ServiceChatMessageVO } from './service-chat-message.vo';
2
+ import { ServiceChatMessageAttachment } from './types';
3
+ /** Fluent builder for creating normalized service chat message value objects. */
4
+ export declare class ServiceChatMessageBuilder {
5
+ private payload;
6
+ private constructor();
7
+ static create(): ServiceChatMessageBuilder;
8
+ withRaw(message: Record<string, unknown>): this;
9
+ withAttachments(data: ServiceChatMessageAttachment[]): this;
10
+ build(): ServiceChatMessageVO;
11
+ }
@@ -0,0 +1,13 @@
1
+ import { ServiceChatMessage, ServiceChatMessageAttachment, ServiceChatMessageFrom } from './types';
2
+ /** Value object representing a normalized service chat message. */
3
+ export declare class ServiceChatMessageVO {
4
+ readonly payload: ServiceChatMessage;
5
+ constructor(payload: ServiceChatMessage);
6
+ static fromJSON(payload: ServiceChatMessage): ServiceChatMessageVO;
7
+ static toJSON(vo: ServiceChatMessageVO): ServiceChatMessage;
8
+ toJSON(): ServiceChatMessage;
9
+ get from(): ServiceChatMessageFrom;
10
+ get isSystemLike(): boolean;
11
+ get attachments(): ServiceChatMessageAttachment[];
12
+ get primaryAttachment(): ServiceChatMessageAttachment | undefined;
13
+ }
@@ -0,0 +1,51 @@
1
+ import { MessageAttachment, MessageResponse } from '@opens/gateways/chat-webservice';
2
+ export type { MessageAttachment, MessageResponse };
3
+ export type ServiceChatMessageFrom = 'system' | 'operator' | 'contact';
4
+ export type ServiceChatMessageType = 'text' | 'automatic' | 'image' | 'document' | 'audio' | 'voice' | 'video' | 'interactive' | 'survey' | '_grouped_images';
5
+ export type ServiceChatMessageAttachmentType = 'image' | 'video' | 'audio' | 'document';
6
+ export type ServiceChatMessageAttachment = Omit<MessageAttachment, 'type'> & {
7
+ type: ServiceChatMessageAttachmentType;
8
+ };
9
+ export type ServiceChatInteractiveOption = {
10
+ label: string;
11
+ value: string;
12
+ description?: string;
13
+ selected?: boolean;
14
+ disabled?: boolean;
15
+ };
16
+ export type ServiceChatInteractiveBody = {
17
+ description?: string;
18
+ menu: ServiceChatInteractiveOption[];
19
+ };
20
+ export type ServiceChatMessage = Partial<Omit<MessageResponse, 'attachments' | 'caption'>> & {
21
+ messageType: string;
22
+ messageBody: string;
23
+ caption?: string | null;
24
+ attachments?: {
25
+ data: ServiceChatMessageAttachment[];
26
+ } | null;
27
+ messages?: ServiceChatMessage[];
28
+ };
29
+ export type ServiceChatMessageAction = {
30
+ action: 'download';
31
+ message: ServiceChatMessage;
32
+ attachment?: ServiceChatMessageAttachment;
33
+ } | {
34
+ action: 'select-option';
35
+ message: ServiceChatMessage;
36
+ option: ServiceChatInteractiveOption;
37
+ } | {
38
+ action: 'select-survey';
39
+ message: ServiceChatMessage;
40
+ option: ServiceChatInteractiveOption;
41
+ };
42
+ export type ServiceChatAttachmentType = 'image' | 'document';
43
+ export type ServiceChatAttachment = {
44
+ file: File;
45
+ type: ServiceChatAttachmentType;
46
+ previewUrl?: string;
47
+ };
48
+ export type ServiceChatAudio = {
49
+ file: File;
50
+ previewUrl: string;
51
+ };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  export { default, AppIdentificationPage, AppFormTextInput, AppWidgetAnchor, AppServicePage, AppWidgetView, AppScreenPage, AppTextInput, AppCarousel, AppAudioPlayer, AppSkeleton, AppMessage, AppButton, AppWidget, AppEmpty, AppGroup, AppIcon, AppText, } from './main';
2
2
  export type { MessageAttachment, MessageResponse, ServiceChatInteractiveBody, ServiceChatInteractiveOption, ServiceChatMessage, ServiceChatMessageAction, ServiceChatMessageAttachment, ServiceChatMessageAttachmentType, ServiceChatMessageFrom, ServiceChatMessageType, } from './composables/use-chat-service';
3
+ export { ServiceChatMessageBuilder, ServiceChatMessageVO } from './domain/chat-message';
3
4
  export { useVoiceService } from './composables/use-voice-service';
4
5
  export { useChatService } from './composables/use-chat-service';
5
6
  export type { MaskFunction } from './composables/use-mask-functions';
package/dist/main.d.ts CHANGED
@@ -22,6 +22,7 @@ declare const _default: {
22
22
  export default _default;
23
23
  export { AppIdentificationPage, AppFormTextInput, AppWidgetAnchor, AppServicePage, AppWidgetView, AppScreenPage, AppTextInput, AppCarousel, AppAudioPlayer, AppSkeleton, AppEmpty, AppMessage, AppWidget, AppButton, AppGroup, AppIcon, AppText, };
24
24
  export type { MessageAttachment, MessageResponse, ServiceChatInteractiveBody, ServiceChatInteractiveOption, ServiceChatMessage, ServiceChatMessageAction, ServiceChatMessageAttachment, ServiceChatMessageAttachmentType, ServiceChatMessageFrom, ServiceChatMessageType, } from './composables/use-chat-service';
25
+ export { ServiceChatMessageBuilder, ServiceChatMessageVO } from './domain/chat-message';
25
26
  export { useVoiceService } from './composables/use-voice-service';
26
27
  export { useChatService } from './composables/use-chat-service';
27
28
  export { useServicePage } from './composables/use-service-page';
@@ -1,4 +1,4 @@
1
- import { ServiceChatMessageAttachment, ServiceChatInteractiveBody, ServiceChatMessageFrom, ServiceChatMessage } from '../composables/use-chat-service';
1
+ import { ServiceChatMessageAttachment, ServiceChatInteractiveBody, ServiceChatMessageFrom, ServiceChatMessage } from '../domain/chat-message';
2
2
  export declare const getMessageFrom: (message: ServiceChatMessage) => ServiceChatMessageFrom;
3
3
  export declare const getMessageAttachments: (message: ServiceChatMessage) => ServiceChatMessageAttachment[];
4
4
  export declare const getPrimaryAttachment: (message: ServiceChatMessage) => ServiceChatMessageAttachment;
@@ -1,3 +1,3 @@
1
- import { ServiceChatMessage } from '../composables/use-chat-service';
1
+ import { ServiceChatMessage } from '../domain/chat-message';
2
2
  import { Component } from 'vue';
3
3
  export declare const resolveMessageComponent: (message: ServiceChatMessage) => Component;