@evercam/ui 0.0.63-preview-efeedback-button-e3a6a22ed → 0.0.63-preview-efeedback-button-3fce0f8c1

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.
@@ -1042,6 +1042,11 @@
1042
1042
  "description": "",
1043
1043
  "default": false
1044
1044
  },
1045
+ "EChat/is-disabled": {
1046
+ "type": "boolean",
1047
+ "description": "",
1048
+ "default": false
1049
+ },
1045
1050
  "EChat/header-text": {
1046
1051
  "type": "string",
1047
1052
  "description": "",
@@ -1057,11 +1062,6 @@
1057
1062
  "description": "",
1058
1063
  "default": ""
1059
1064
  },
1060
- "EChat/disabled": {
1061
- "type": "boolean",
1062
- "description": "",
1063
- "default": false
1064
- },
1065
1065
  "EChat/suggestions": {
1066
1066
  "type": "array",
1067
1067
  "description": ""
@@ -1,5 +1,5 @@
1
1
  import Vue from "vue";
2
- import { ChatMessage, ChatMessageRole, ChatSuggestion, UserFeedback } from '../../types';
2
+ import { ChatMessage, ChatMessageRole, ChatSuggestion, Feedback } from '../../types';
3
3
  declare const _default: import("vue/types/vue").ExtendedVue<Vue<Record<string, any>, Record<string, any>, never, never, (event: string, ...args: any[]) => Vue<Record<string, any>, Record<string, any>, never, never, any>>, {
4
4
  prompt: string;
5
5
  containerHeight: number;
@@ -11,12 +11,13 @@ declare const _default: import("vue/types/vue").ExtendedVue<Vue<Record<string, a
11
11
  isUserMessage(message: ChatMessage): boolean;
12
12
  hasActions(message: ChatMessage): boolean;
13
13
  getMessageContent(message: ChatMessage): string | string[];
14
+ getMessageInitials(message: ChatMessage): string | null;
14
15
  getMessageClasses(message: ChatMessage, index: number): {
15
16
  "e-mb-11": boolean;
16
17
  };
17
18
  updateChatBodyHeight(): void;
18
19
  isAvatarVisible(message: ChatMessage): boolean;
19
- onMessageFeedback(feedback: UserFeedback, messageId?: number): void;
20
+ onMessageFeedback(feedback: Feedback, messageId?: number): void;
20
21
  }, {
21
22
  ChatMessageRole: typeof ChatMessageRole;
22
23
  userInitials: string;
@@ -36,10 +37,10 @@ declare const _default: import("vue/types/vue").ExtendedVue<Vue<Record<string, a
36
37
  showCopilotAvatar: boolean;
37
38
  readonly: boolean;
38
39
  isLoading: boolean;
40
+ isDisabled: boolean;
39
41
  headerText: string;
40
42
  inputPlaceholder: string;
41
43
  loadingMessage: string;
42
- disabled: boolean;
43
44
  suggestions: ChatSuggestion[];
44
45
  }, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin>;
45
46
  export default _default;
@@ -1,11 +1,11 @@
1
1
  import Vue from "vue";
2
- import { ChatMessageRole, UserFeedback } from '../../types';
2
+ import { ChatMessageRole, Feedback } from '../../types';
3
3
  declare const _default: import("vue/types/vue").ExtendedVue<Vue<Record<string, any>, Record<string, any>, never, never, (event: string, ...args: any[]) => Vue<Record<string, any>, Record<string, any>, never, never, any>>, {
4
4
  showActions: boolean;
5
5
  }, {
6
6
  onMouseOver(): void;
7
7
  onMouseLeave(e: MouseEvent): void;
8
- onFeedback(feedback: UserFeedback): void;
8
+ onFeedback(feedback: Feedback): void;
9
9
  }, {
10
10
  isBotRole: boolean;
11
11
  isStream: boolean;
package/dist/index.d.ts CHANGED
@@ -1088,12 +1088,13 @@ export declare const components: {
1088
1088
  isUserMessage(message: import('./types').ChatMessage): boolean;
1089
1089
  hasActions(message: import('./types').ChatMessage): boolean;
1090
1090
  getMessageContent(message: import('./types').ChatMessage): string | string[];
1091
+ getMessageInitials(message: import('./types').ChatMessage): string | null;
1091
1092
  getMessageClasses(message: import('./types').ChatMessage, index: number): {
1092
1093
  "e-mb-11": boolean;
1093
1094
  };
1094
1095
  updateChatBodyHeight(): void;
1095
1096
  isAvatarVisible(message: import('./types').ChatMessage): boolean;
1096
- onMessageFeedback(feedback: import('./types').UserFeedback, messageId?: number | undefined): void;
1097
+ onMessageFeedback(feedback: import('./types').Feedback, messageId?: number | undefined): void;
1097
1098
  }, {
1098
1099
  ChatMessageRole: typeof import('./types').ChatMessageRole;
1099
1100
  userInitials: string;
@@ -1113,10 +1114,10 @@ export declare const components: {
1113
1114
  showCopilotAvatar: boolean;
1114
1115
  readonly: boolean;
1115
1116
  isLoading: boolean;
1117
+ isDisabled: boolean;
1116
1118
  headerText: string;
1117
1119
  inputPlaceholder: string;
1118
1120
  loadingMessage: string;
1119
- disabled: boolean;
1120
1121
  suggestions: import('./types').ChatSuggestion[];
1121
1122
  }, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin>;
1122
1123
  EContextProvider: any;
package/dist/index.mjs CHANGED
@@ -16976,7 +16976,6 @@ const A4 = Z.extend({
16976
16976
  currentChunkIndex: 0,
16977
16977
  chunkQueue: [],
16978
16978
  isProcessing: !1,
16979
- isHovered: !1,
16980
16979
  typewriter: null,
16981
16980
  timestamps: []
16982
16981
  };
@@ -17459,7 +17458,7 @@ const t8 = e8.exports, r8 = Z.extend({
17459
17458
  });
17460
17459
  var n8 = function() {
17461
17460
  var e = this, r = e._self._c;
17462
- return r("div", { staticClass: "e-markdown__actions-container e-relative e-h-0" }, [r("div", { staticClass: "e-message__actions e-flex e-gap-1 e-pt-2" }, [e.showCopyButton ? r("ECopyToClipboardBtn", { attrs: { text: e.messageText, dark: e.dark, "button-size": "base", "button-classes": "e-bg-transparent e-border-none", description: "Copy" } }) : e._e(), e.showFeedbackButtons ? r("EFeedbackButton", { attrs: { dark: e.dark, "with-text": "", "button-size": "base", "button-classes": "e-bg-transparent e-border-none" }, on: { submit: function(n) {
17461
+ return r("div", { staticClass: "e-message__actions e-relative e-h-0" }, [r("div", { staticClass: "e-message__actions-container e-flex e-gap-1 e-pt-2" }, [e.showCopyButton ? r("ECopyToClipboardBtn", { attrs: { text: e.messageText, dark: e.dark, "button-size": "base", "button-classes": "e-bg-transparent e-border-none", description: "Copy" } }) : e._e(), e.showFeedbackButtons ? r("EFeedbackButton", { attrs: { dark: e.dark, "with-text": "", "button-size": "base", "button-classes": "e-bg-transparent e-border-none" }, on: { submit: function(n) {
17463
17462
  return e.handleFeedback(e.FeedbackType.positive, n);
17464
17463
  } }, nativeOn: { click: function(n) {
17465
17464
  return e.openFeedbackDialog.apply(null, arguments);
@@ -17590,7 +17589,7 @@ var l8 = function() {
17590
17589
  return [e._t("timestamp", function() {
17591
17590
  return [e._v(e._s(n))];
17592
17591
  }, { timestamp: n })];
17593
- } }], null, !0) }) : r("p", { staticClass: "e-chat-message__content e-font-medium e-text-wrap e-mb-1 e-mt-[12px] e-rounded-lg e-p-2 e-px-4", class: e.userMessageClasses }, [e._v(" " + e._s(e.message) + " ")])], 2)]), r("EFadeTransition", [e.withActions && e.showActions ? r("EChatMessageActions", { staticClass: "e-left-11", attrs: { dark: e.dark, "show-copy-button": e.showCopyButton, "show-feedback-buttons": e.showFeedbackButtons, message: e.message }, on: { feedback: e.onFeedback } }) : e._e()], 1)], 1);
17592
+ } }], null, !0) }) : r("p", { staticClass: "e-chat-message__content e-font-medium e-text-wrap e-mb-1 e-mt-[12px] e-rounded-lg e-p-2 e-px-4", class: e.userMessageClasses }, [e._v(" " + e._s(e.message) + " ")]), e._t("extraContent")], 2)]), r("EFadeTransition", [e.withActions && e.showActions ? r("EChatMessageActions", { staticClass: "e-left-11", attrs: { dark: e.dark, "show-copy-button": e.showCopyButton, "show-feedback-buttons": e.showFeedbackButtons, message: e.message }, on: { feedback: e.onFeedback } }) : e._e()], 1)], 1);
17594
17593
  }, c8 = [], u8 = /* @__PURE__ */ q(
17595
17594
  o8,
17596
17595
  l8,
@@ -17879,6 +17878,10 @@ const k8 = T8.exports, M8 = Z.extend({
17879
17878
  type: Boolean,
17880
17879
  default: !1
17881
17880
  },
17881
+ isDisabled: {
17882
+ type: Boolean,
17883
+ default: !1
17884
+ },
17882
17885
  headerText: {
17883
17886
  type: String,
17884
17887
  default: "Evercam Copilot"
@@ -17891,10 +17894,6 @@ const k8 = T8.exports, M8 = Z.extend({
17891
17894
  type: String,
17892
17895
  default: ""
17893
17896
  },
17894
- disabled: {
17895
- type: Boolean,
17896
- default: !1
17897
- },
17898
17897
  suggestions: {
17899
17898
  type: Array,
17900
17899
  default: () => []
@@ -17963,17 +17962,20 @@ const k8 = T8.exports, M8 = Z.extend({
17963
17962
  },
17964
17963
  methods: {
17965
17964
  sendMessage() {
17966
- !this.disabled && this.prompt.length > 0 && (this.$emit("user-message", this.prompt), this.prompt = "");
17965
+ !this.isDisabled && this.prompt.length > 0 && (this.$emit("user-message", this.prompt), this.prompt = "");
17967
17966
  },
17968
17967
  isUserMessage(t) {
17969
17968
  return t.role === Xe.USER;
17970
17969
  },
17971
17970
  hasActions(t) {
17972
- return t.role === Xe.COPILOT;
17971
+ return this.isLoading || this.isDisabled ? !1 : t.role === Xe.COPILOT;
17973
17972
  },
17974
17973
  getMessageContent(t) {
17975
17974
  return t.content;
17976
17975
  },
17976
+ getMessageInitials(t) {
17977
+ return this.isUserMessage(t) ? this.userInitials : null;
17978
+ },
17977
17979
  getMessageClasses(t, e) {
17978
17980
  return {
17979
17981
  "e-mb-11": e === this.messages.length - 1 && this.hasActions(t)
@@ -18007,7 +18009,7 @@ var $8 = function() {
18007
18009
  return e.$emit("suggestion-clicked", n);
18008
18010
  } } })], 1);
18009
18011
  }), 1)], 1) : r("div", e._l(e.messages, function(n, s) {
18010
- return r("EChatMessage", { key: `${n.id}-${s}`, class: e.getMessageClasses(n, s), attrs: { "data-message-id": n.id, "is-loading": n.isLoading, message: e.getMessageContent(e.messages[s]), initials: e.isUserMessage(n) ? e.userInitials : null, "show-avatar": e.isAvatarVisible(n), role: n.role, dark: e.dark, "with-actions": e.hasActions(n), "show-copy-button": "", "show-feedback-buttons": !e.readonly }, on: { feedback: function(l) {
18012
+ return r("EChatMessage", { key: `${n.id}-${s}`, class: e.getMessageClasses(n, s), attrs: { dark: e.dark, role: n.role, "is-loading": n.isLoading, "data-message-id": n.id, "show-feedback-buttons": !e.readonly, "show-copy-button": "", message: e.getMessageContent(n), initials: e.getMessageInitials(n), "show-avatar": e.isAvatarVisible(n), "with-actions": e.hasActions(n) }, on: { feedback: function(l) {
18011
18013
  return e.onMessageFeedback(l, n.id);
18012
18014
  }, "animation-end": function(l) {
18013
18015
  return e.$emit("animation-end", l);
@@ -18015,8 +18017,10 @@ var $8 = function() {
18015
18017
  return [e._t("timestamp", function() {
18016
18018
  return [e._v(e._s(l))];
18017
18019
  }, { timestamp: l })];
18018
- } }], null, !0) });
18019
- }), 1), e.isLoading ? r("EChatMessage", { attrs: { "is-loading": "", "loading-message": e.loadingMessage, "data-message-id": -1, "show-avatar": e.showCopilotAvatar, role: e.ChatMessageRole.COPILOT, dark: e.dark } }) : e._e()], 1), r("EChatFooter", { directives: [{ name: "show", rawName: "v-show", value: !e.readonly, expression: "!readonly" }], ref: "chatFooter", attrs: { dark: e.dark, inline: e.inlineFooter } }, [r("EChatInput", { attrs: { dark: e.dark, disabled: e.disabled, placeholder: e.inputPlaceholder }, on: { "prompt-changed": function(n) {
18020
+ } }, { key: "extraContent", fn: function() {
18021
+ return [e._t("message.extraContent", null, { message: n })];
18022
+ }, proxy: !0 }], null, !0) });
18023
+ }), 1), e.isLoading ? r("EChatMessage", { attrs: { "is-loading": "", "loading-message": e.loadingMessage, "data-message-id": -1, "show-avatar": e.showCopilotAvatar, role: e.ChatMessageRole.COPILOT, dark: e.dark } }) : e._e()], 1), r("EChatFooter", { directives: [{ name: "show", rawName: "v-show", value: !e.readonly, expression: "!readonly" }], ref: "chatFooter", attrs: { dark: e.dark, inline: e.inlineFooter } }, [r("EChatInput", { attrs: { dark: e.dark, disabled: e.isDisabled, placeholder: e.inputPlaceholder }, on: { "prompt-changed": function(n) {
18020
18024
  return e.$emit("prompt-changed", n);
18021
18025
  }, submit: e.sendMessage }, model: { value: e.prompt, callback: function(n) {
18022
18026
  e.prompt = n;
@@ -18027,7 +18031,7 @@ var $8 = function() {
18027
18031
  E8,
18028
18032
  !1,
18029
18033
  null,
18030
- "51995acf",
18034
+ "74a0db0c",
18031
18035
  null,
18032
18036
  null
18033
18037
  );