@opens/widget-ui 1.1.0 → 1.2.1

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 (43) hide show
  1. package/dist/app-audio-player.vue.d.ts.map +1 -0
  2. package/dist/app-carousel.vue.d.ts.map +1 -0
  3. package/dist/app-empty.vue.d.ts.map +1 -0
  4. package/dist/app-group.vue.d.ts.map +1 -0
  5. package/dist/app-skeleton.vue.d.ts.map +1 -0
  6. package/dist/components/buttons/app-button.vue.d.ts +1 -1
  7. package/dist/components/icons/app-icon.vue.d.ts +3 -3
  8. package/dist/components/widget/app-widget-anchor.vue.d.ts +2 -2
  9. package/dist/composables/use-app-widget.d.ts +102 -36
  10. package/dist/composables/use-chat-service.d.ts +44 -87
  11. package/dist/composables/use-service-page.d.ts +42 -36
  12. package/dist/domain/chat-message/index.d.ts +3 -0
  13. package/dist/domain/chat-message/service-chat-message.builder.d.ts +11 -0
  14. package/dist/domain/chat-message/service-chat-message.vo.d.ts +13 -0
  15. package/dist/domain/chat-message/types.d.ts +51 -0
  16. package/dist/index.d.ts +2 -1
  17. package/dist/main.d.ts +2 -1
  18. package/dist/mocks/demo-config.d.ts +1 -1
  19. package/dist/pages/app-identification-page.vue.d.ts.map +1 -0
  20. package/dist/pages/app-service-page.vue.d.ts.map +1 -0
  21. package/dist/utils/message-helpers.d.ts +2 -2
  22. package/dist/utils/resolve-message-component.d.ts +1 -1
  23. package/dist/widget/app-widget-view.vue.d.ts +1 -1
  24. package/dist/widget/app-widget.vue.d.ts +1 -1
  25. package/dist/yunique_widget_ui.cjs.js +1 -1
  26. package/dist/yunique_widget_ui.css +1 -1
  27. package/dist/yunique_widget_ui.es.js +2246 -2126
  28. package/dist/yunique_widget_ui.umd.js +2 -2
  29. package/package.json +3 -3
  30. package/dist/app-identification-page.vue.d.ts.map +0 -1
  31. package/dist/app-service-page.vue.d.ts.map +0 -1
  32. package/dist/ui/app-audio-player.vue.d.ts.map +0 -1
  33. package/dist/ui/app-carousel.vue.d.ts.map +0 -1
  34. package/dist/ui/app-empty.vue.d.ts.map +0 -1
  35. package/dist/ui/app-group.vue.d.ts.map +0 -1
  36. package/dist/ui/app-skeleton.vue.d.ts.map +0 -1
  37. /package/dist/{ui/app-audio-player.vue.d.ts → app-audio-player.vue.d.ts} +0 -0
  38. /package/dist/{ui/app-carousel.vue.d.ts → app-carousel.vue.d.ts} +0 -0
  39. /package/dist/{ui/app-empty.vue.d.ts → app-empty.vue.d.ts} +0 -0
  40. /package/dist/{ui/app-group.vue.d.ts → app-group.vue.d.ts} +0 -0
  41. /package/dist/{ui/app-skeleton.vue.d.ts → app-skeleton.vue.d.ts} +0 -0
  42. /package/dist/{app-identification-page.vue.d.ts → pages/app-identification-page.vue.d.ts} +0 -0
  43. /package/dist/{app-service-page.vue.d.ts → pages/app-service-page.vue.d.ts} +0 -0
@@ -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, MessageAttachmentType, MessageInteractiveBody, MessageInteractiveOption, MessageResponse, MessageType } from '@opens/gateways/chat-webservice';
2
+ export type { MessageAttachment, MessageAttachmentType, MessageInteractiveBody, MessageInteractiveOption, MessageResponse, MessageType, };
3
+ /** UI-facing sender role derived from provider (not an API field). */
4
+ export type ServiceChatMessageFrom = 'system' | 'operator' | 'contact';
5
+ /** API message types plus client-only synthetic kinds used by the widget. */
6
+ export type ServiceChatMessageType = MessageType | '_grouped_images';
7
+ export type ServiceChatMessageAttachmentType = MessageAttachmentType;
8
+ export type ServiceChatMessageAttachment = MessageAttachment;
9
+ /** Interactive option enriched with UI selection/disabled state after parsing. */
10
+ export type ServiceChatInteractiveOption = MessageInteractiveOption & {
11
+ selected?: boolean;
12
+ disabled?: boolean;
13
+ };
14
+ /** Interactive body with UI-enriched menu options. */
15
+ export type ServiceChatInteractiveBody = Omit<MessageInteractiveBody, 'menu'> & {
16
+ menu: ServiceChatInteractiveOption[];
17
+ };
18
+ /**
19
+ * Widget view-model for chat messages.
20
+ * Based on the API contract, with optional nested messages for client-side grouping.
21
+ */
22
+ export type ServiceChatMessage = Partial<Omit<MessageResponse, 'messageType'>> & {
23
+ messageType: ServiceChatMessageType | string;
24
+ messageBody: string;
25
+ messages?: ServiceChatMessage[];
26
+ };
27
+ /** UI actions emitted by message components. */
28
+ export type ServiceChatMessageAction = {
29
+ action: 'download';
30
+ message: ServiceChatMessage;
31
+ attachment?: ServiceChatMessageAttachment;
32
+ } | {
33
+ action: 'select-option';
34
+ message: ServiceChatMessage;
35
+ option: ServiceChatInteractiveOption;
36
+ } | {
37
+ action: 'select-survey';
38
+ message: ServiceChatMessage;
39
+ option: ServiceChatInteractiveOption;
40
+ };
41
+ /** Local composer attachment before upload (File-based, not API payload). */
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
- export type { MessageAttachment, MessageResponse, ServiceChatInteractiveBody, ServiceChatInteractiveOption, ServiceChatMessage, ServiceChatMessageAction, ServiceChatMessageAttachment, ServiceChatMessageAttachmentType, ServiceChatMessageFrom, ServiceChatMessageType, } from './composables/use-chat-service';
2
+ export type { MessageAttachment, MessageAttachmentType, MessageInteractiveBody, MessageInteractiveOption, MessageResponse, MessageType, 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
@@ -21,7 +21,8 @@ declare const _default: {
21
21
  };
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
- export type { MessageAttachment, MessageResponse, ServiceChatInteractiveBody, ServiceChatInteractiveOption, ServiceChatMessage, ServiceChatMessageAction, ServiceChatMessageAttachment, ServiceChatMessageAttachmentType, ServiceChatMessageFrom, ServiceChatMessageType, } from './composables/use-chat-service';
24
+ export type { MessageAttachment, MessageAttachmentType, MessageInteractiveBody, MessageInteractiveOption, MessageResponse, MessageType, 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';
@@ -9,7 +9,7 @@ export declare const demoWidgetConfig: {
9
9
  isClosable: true;
10
10
  };
11
11
  appearance: {
12
- theme: "light";
12
+ theme: "dark";
13
13
  primaryColor: string;
14
14
  };
15
15
  anchor: {
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app-identification-page.vue.d.ts","sourceRoot":"","sources":["../../src/components/pages/app-identification-page.vue"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,0HAA0H,CAAC;AACjJ,cAAc,0HAA0H,CAAC;AACzI,eAAe,SAAS,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app-service-page.vue.d.ts","sourceRoot":"","sources":["../../src/components/pages/app-service-page.vue"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,mHAAmH,CAAC;AAC1I,cAAc,mHAAmH,CAAC;AAClI,eAAe,SAAS,CAAC"}
@@ -1,7 +1,7 @@
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
- export declare const getPrimaryAttachment: (message: ServiceChatMessage) => ServiceChatMessageAttachment;
4
+ export declare const getPrimaryAttachment: (message: ServiceChatMessage) => import('@opens/gateways/chat-webservice').MessageAttachment;
5
5
  export declare const formatMessageTime: (createdAt?: string | Date) => string;
6
6
  export declare const isPdfAttachment: (attachment: ServiceChatMessageAttachment) => boolean;
7
7
  export declare const parseInteractiveBody: (message: ServiceChatMessage) => ServiceChatInteractiveBody | null;
@@ -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;
@@ -1,5 +1,5 @@
1
1
  export * from "/opt/atlassian/pipelines/agent/build/src/components/widget/app-widget-view.vue?vue&type=script&setup=true&lang.ts";
2
- import "/opt/atlassian/pipelines/agent/build/src/components/widget/app-widget-view.vue?vue&type=style&index=0&scoped=d2af3e5d&lang.css";
2
+ import "/opt/atlassian/pipelines/agent/build/src/components/widget/app-widget-view.vue?vue&type=style&index=0&scoped=6d5217d3&lang.css";
3
3
  declare const _default: any;
4
4
  export default _default;
5
5
  //# sourceMappingURL=app-widget-view.vue.d.ts.map
@@ -1,5 +1,5 @@
1
1
  export * from "/opt/atlassian/pipelines/agent/build/src/components/widget/app-widget.vue?vue&type=script&setup=true&lang.ts";
2
- import "/opt/atlassian/pipelines/agent/build/src/components/widget/app-widget.vue?vue&type=style&index=0&scoped=3cfc0e90&lang.css";
2
+ import "/opt/atlassian/pipelines/agent/build/src/components/widget/app-widget.vue?vue&type=style&index=0&scoped=eac31e46&lang.css";
3
3
  declare const _default: any;
4
4
  export default _default;
5
5
  //# sourceMappingURL=app-widget.vue.d.ts.map