biel-search 0.0.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 (136) hide show
  1. package/LICENSE +21 -0
  2. package/dist/biel-search/biel-search.css +1 -0
  3. package/dist/biel-search/biel-search.esm.js +2 -0
  4. package/dist/biel-search/biel-search.esm.js.map +1 -0
  5. package/dist/biel-search/index.esm.js +2 -0
  6. package/dist/biel-search/index.esm.js.map +1 -0
  7. package/dist/biel-search/p-1b3c90ca.js +3 -0
  8. package/dist/biel-search/p-1b3c90ca.js.map +1 -0
  9. package/dist/biel-search/p-e1255160.js +2 -0
  10. package/dist/biel-search/p-e1255160.js.map +1 -0
  11. package/dist/biel-search/p-fe900c87.entry.js +3 -0
  12. package/dist/biel-search/p-fe900c87.entry.js.map +1 -0
  13. package/dist/cjs/app-globals-3a1e7e63.js +7 -0
  14. package/dist/cjs/app-globals-3a1e7e63.js.map +1 -0
  15. package/dist/cjs/biel-bot_8.cjs.entry.js +63952 -0
  16. package/dist/cjs/biel-bot_8.cjs.entry.js.map +1 -0
  17. package/dist/cjs/biel-search.cjs.js +27 -0
  18. package/dist/cjs/biel-search.cjs.js.map +1 -0
  19. package/dist/cjs/index-05fc01fd.js +1281 -0
  20. package/dist/cjs/index-05fc01fd.js.map +1 -0
  21. package/dist/cjs/index.cjs.js +11 -0
  22. package/dist/cjs/index.cjs.js.map +1 -0
  23. package/dist/cjs/loader.cjs.js +17 -0
  24. package/dist/cjs/loader.cjs.js.map +1 -0
  25. package/dist/collection/collection-manifest.json +19 -0
  26. package/dist/collection/components/biel-bot/biel-bot.css +189 -0
  27. package/dist/collection/components/biel-bot/biel-bot.js +338 -0
  28. package/dist/collection/components/biel-bot/biel-bot.js.map +1 -0
  29. package/dist/collection/components/biel-button/biel-button.css +63 -0
  30. package/dist/collection/components/biel-button/biel-button.js +301 -0
  31. package/dist/collection/components/biel-button/biel-button.js.map +1 -0
  32. package/dist/collection/components/biel-chat/biel-chat.css +75 -0
  33. package/dist/collection/components/biel-chat/biel-chat.js +119 -0
  34. package/dist/collection/components/biel-chat/biel-chat.js.map +1 -0
  35. package/dist/collection/components/biel-header/biel-header.css +49 -0
  36. package/dist/collection/components/biel-header/biel-header.js +165 -0
  37. package/dist/collection/components/biel-header/biel-header.js.map +1 -0
  38. package/dist/collection/components/biel-input/biel-input.css +55 -0
  39. package/dist/collection/components/biel-input/biel-input.js +164 -0
  40. package/dist/collection/components/biel-input/biel-input.js.map +1 -0
  41. package/dist/collection/components/biel-message/biel-message.css +38 -0
  42. package/dist/collection/components/biel-message/biel-message.js +98 -0
  43. package/dist/collection/components/biel-message/biel-message.js.map +1 -0
  44. package/dist/collection/components/biel-table/biel-table.css +37 -0
  45. package/dist/collection/components/biel-table/biel-table.js +43 -0
  46. package/dist/collection/components/biel-table/biel-table.js.map +1 -0
  47. package/dist/collection/components/code-snippet/code-snippet.css +162 -0
  48. package/dist/collection/components/code-snippet/code-snippet.js +101 -0
  49. package/dist/collection/components/code-snippet/code-snippet.js.map +1 -0
  50. package/dist/collection/index.js +11 -0
  51. package/dist/collection/index.js.map +1 -0
  52. package/dist/collection/services/biel-service.js +33 -0
  53. package/dist/collection/services/biel-service.js.map +1 -0
  54. package/dist/collection/services/biel-websocket-service.js +64 -0
  55. package/dist/collection/services/biel-websocket-service.js.map +1 -0
  56. package/dist/collection/utils/utils.js +4 -0
  57. package/dist/collection/utils/utils.js.map +1 -0
  58. package/dist/components/biel-bot.d.ts +11 -0
  59. package/dist/components/biel-bot.js +8 -0
  60. package/dist/components/biel-bot.js.map +1 -0
  61. package/dist/components/biel-button.d.ts +11 -0
  62. package/dist/components/biel-button.js +152 -0
  63. package/dist/components/biel-button.js.map +1 -0
  64. package/dist/components/biel-chat.d.ts +11 -0
  65. package/dist/components/biel-chat.js +8 -0
  66. package/dist/components/biel-chat.js.map +1 -0
  67. package/dist/components/biel-header.d.ts +11 -0
  68. package/dist/components/biel-header.js +8 -0
  69. package/dist/components/biel-header.js.map +1 -0
  70. package/dist/components/biel-input.d.ts +11 -0
  71. package/dist/components/biel-input.js +8 -0
  72. package/dist/components/biel-input.js.map +1 -0
  73. package/dist/components/biel-message.d.ts +11 -0
  74. package/dist/components/biel-message.js +8 -0
  75. package/dist/components/biel-message.js.map +1 -0
  76. package/dist/components/biel-table.d.ts +11 -0
  77. package/dist/components/biel-table.js +8 -0
  78. package/dist/components/biel-table.js.map +1 -0
  79. package/dist/components/code-snippet.d.ts +11 -0
  80. package/dist/components/code-snippet.js +8 -0
  81. package/dist/components/code-snippet.js.map +1 -0
  82. package/dist/components/index.d.ts +33 -0
  83. package/dist/components/index.js +9 -0
  84. package/dist/components/index.js.map +1 -0
  85. package/dist/components/p-09743aa7.js +88 -0
  86. package/dist/components/p-09743aa7.js.map +1 -0
  87. package/dist/components/p-5a2466bd.js +59456 -0
  88. package/dist/components/p-5a2466bd.js.map +1 -0
  89. package/dist/components/p-7b8b1ac3.js +1098 -0
  90. package/dist/components/p-7b8b1ac3.js.map +1 -0
  91. package/dist/components/p-8e08748d.js +4158 -0
  92. package/dist/components/p-8e08748d.js.map +1 -0
  93. package/dist/components/p-b920c67f.js +239 -0
  94. package/dist/components/p-b920c67f.js.map +1 -0
  95. package/dist/components/p-c94c3bd6.js +59 -0
  96. package/dist/components/p-c94c3bd6.js.map +1 -0
  97. package/dist/components/p-f4016e6d.js +37 -0
  98. package/dist/components/p-f4016e6d.js.map +1 -0
  99. package/dist/components/p-fe8bcdeb.js +86 -0
  100. package/dist/components/p-fe8bcdeb.js.map +1 -0
  101. package/dist/esm/app-globals-0f993ce5.js +5 -0
  102. package/dist/esm/app-globals-0f993ce5.js.map +1 -0
  103. package/dist/esm/biel-bot_8.entry.js +63941 -0
  104. package/dist/esm/biel-bot_8.entry.js.map +1 -0
  105. package/dist/esm/biel-search.js +22 -0
  106. package/dist/esm/biel-search.js.map +1 -0
  107. package/dist/esm/index-6ad604ca.js +1252 -0
  108. package/dist/esm/index-6ad604ca.js.map +1 -0
  109. package/dist/esm/index.js +7 -0
  110. package/dist/esm/index.js.map +1 -0
  111. package/dist/esm/loader.js +13 -0
  112. package/dist/esm/loader.js.map +1 -0
  113. package/dist/index.cjs.js +1 -0
  114. package/dist/index.js +1 -0
  115. package/dist/types/components/biel-bot/biel-bot.d.ts +35 -0
  116. package/dist/types/components/biel-button/biel-button.d.ts +23 -0
  117. package/dist/types/components/biel-chat/biel-chat.d.ts +15 -0
  118. package/dist/types/components/biel-header/biel-header.d.ts +15 -0
  119. package/dist/types/components/biel-input/biel-input.d.ts +17 -0
  120. package/dist/types/components/biel-message/biel-message.d.ts +10 -0
  121. package/dist/types/components/biel-table/biel-table.d.ts +4 -0
  122. package/dist/types/components/code-snippet/code-snippet.d.ts +10 -0
  123. package/dist/types/components.d.ts +248 -0
  124. package/dist/types/index.d.ts +11 -0
  125. package/dist/types/services/biel-service.d.ts +11 -0
  126. package/dist/types/services/biel-websocket-service.d.ts +17 -0
  127. package/dist/types/stencil-public-runtime.d.ts +1674 -0
  128. package/dist/types/utils/utils.d.ts +1 -0
  129. package/loader/cdn.js +1 -0
  130. package/loader/index.cjs.js +1 -0
  131. package/loader/index.d.ts +24 -0
  132. package/loader/index.es2017.js +1 -0
  133. package/loader/index.js +2 -0
  134. package/loader/package.json +11 -0
  135. package/package.json +55 -0
  136. package/readme.md +22 -0
@@ -0,0 +1,189 @@
1
+ .text-center {
2
+ flex-grow: 1;
3
+ text-align: center;
4
+ }
5
+
6
+ .biel-bot-wrapper {
7
+ position: absolute;
8
+ z-index: var(--biel-bot-wrapper-z-index);
9
+ }
10
+
11
+ .biel-overlay {
12
+ background-color: var(--biel-bot-screenshot-bg-color);
13
+ height: 100%;
14
+ left: 0;
15
+ position: fixed;
16
+ top: 0;
17
+ width: 100%;
18
+ z-index: var(--biel-bot-screnshot-z-index);
19
+ }
20
+
21
+ .biel-bot {
22
+ display: inline-block;
23
+ position: relative;
24
+ }
25
+
26
+ .biel-bot-content {
27
+ background-color: var(--biel-bot-content-bg-color);
28
+ border: 1px solid var(--biel-bot-header-text-color);
29
+ border-radius: var(--biel-bot-content-border-radius);
30
+ box-shadow: 0px 1px 2px 0px rgba(60, 64, 67, .30), 0px 2px 6px 2px rgba(60, 64, 67, .15);
31
+ box-sizing: border-box;
32
+ color: var(--biel-bot-content-text-color);
33
+ display: flex;
34
+ flex-direction: column;
35
+ font-family: var(--biel-bot-content-font-family);
36
+ left: 50%;
37
+ max-width: 90%;
38
+ max-height: 80vh;
39
+ overflow: hidden;
40
+ padding: 20px;
41
+ position: fixed;
42
+ top: 50%;
43
+ transform: translate(-50%, -50%);
44
+ width: 100%;
45
+ z-index: var(--biel-bot-content-z-index);
46
+ }
47
+
48
+ .biel-bot-header {
49
+ margin-bottom: 20px;
50
+ }
51
+
52
+ .biel-bot-footer {
53
+ font-size: var(--biel-footer-font-size);
54
+ text-align: center;
55
+ }
56
+
57
+ .biel-bot-footer a {
58
+ color: var(--biel-bot-footer-link);
59
+ font-weight: 500;
60
+ text-decoration: none;
61
+ }
62
+
63
+ .biel-logo {
64
+ align-items: center;
65
+ display: flex;
66
+ justify-content: center;
67
+ margin-top: 5px;
68
+ }
69
+
70
+ .biel-logo a {
71
+ margin-left: 3px;
72
+ }
73
+
74
+ .biel-bot-close {
75
+ background-color: var(--biel-bot-close-bg-color);
76
+ border: 0;
77
+ border-radius: 50%;
78
+ cursor: pointer;
79
+ height: 22px;
80
+ margin-left: auto;
81
+ padding: 0;
82
+ width: 22px;
83
+ }
84
+
85
+ .biel-bot-close svg {
86
+ stroke: var(--biel-bot-close-color);
87
+ }
88
+
89
+ .biel-bot-content.fullscreen {
90
+ width: 100vw;
91
+ max-width: 100vw;
92
+ height: 100vh;
93
+ max-height: 100vh;
94
+ border-radius: 0;
95
+ padding: 20px 5vw;
96
+ left: 50%;
97
+ top: 50%;
98
+ max-width: 100vw;
99
+ transform: translate(-50%, -50%);
100
+ }
101
+
102
+ @media screen and (min-width: 768px) {
103
+
104
+ .biel-bot-content {
105
+ max-width: 600px;
106
+ max-height: 82vh;
107
+ }
108
+
109
+ .biel-bot-content.biel-bot-content--bottom-right {
110
+ bottom: var(--biel-bot-content-position-bottom);
111
+ left: initial;
112
+ right: var(--biel-bot-content-position-right);
113
+ top: initial;
114
+ transform: initial;
115
+ }
116
+
117
+ .biel-bot-content.biel-bot-content--bottom-left {
118
+ bottom: var(--biel-bot-content-position-bottom);
119
+ left: var(--biel-bot-content-position-left);
120
+ top: initial;
121
+ transform: initial;
122
+ }
123
+
124
+ .biel-bot-content.biel-bot-content--top-right {
125
+ right: var(--biel-bot-content-position-right);
126
+ top: var(--biel-bot-content-position-top);
127
+ transform: initial;
128
+ }
129
+
130
+ .biel-bot-content.biel-bot-content--top-left {
131
+ left: var(--biel-bot-content-position-left);
132
+ top: var(--biel-bot-content-position-top);
133
+ transform: initial;
134
+ }
135
+
136
+ .biel-bot-content.biel-bot-content--center-left {
137
+ left: 5px;
138
+ right: auto;
139
+ top: 50%;
140
+ transform: translateY(-50%);
141
+ }
142
+
143
+ .biel-bot-content.biel-bot-content--center-right {
144
+ left: auto;
145
+ right: 5px;
146
+ top: 50%;
147
+ transform: translateY(-50%);
148
+ }
149
+
150
+ .biel-bot-content.biel-bot-content--sidebar-left.biel-bot-content--open,
151
+ .biel-bot-content.biel-bot-content--sidebar-right.biel-bot-content--open {
152
+ transform: translateX(0);
153
+ }
154
+
155
+ .biel-bot-content.biel-bot-content--sidebar-left {
156
+ max-width: 300px;
157
+ left: 0;
158
+ right: auto;
159
+ height: 100vh;
160
+ top: 0;
161
+ transform: translateX(-100%);
162
+ transition: transform 0.5s ease-in-out;
163
+ border-radius: 0;
164
+ }
165
+
166
+ .biel-bot-content.biel-bot-content--sidebar-right {
167
+ max-width: 300px;
168
+ left: auto;
169
+ right: 0;
170
+ height: 100vh;
171
+ top: 0;
172
+ transform: translateX(100%);
173
+ transition: transform 0.5s ease-in-out;
174
+ border-radius: 0;
175
+ }
176
+
177
+ .biel-bot-content.fullscreen {
178
+ width: 100vw;
179
+ max-width: 100vw;
180
+ height: 100vh;
181
+ max-height: 100vh;
182
+ border-radius: 0;
183
+ padding: 20px 25vw;
184
+ left: 50%;
185
+ top: 50%;
186
+ max-width: 100vw;
187
+ transform: translate(-50%, -50%);
188
+ }
189
+ }
@@ -0,0 +1,338 @@
1
+ import { h } from "@stencil/core";
2
+ import { BielWebSocketService } from "../../services/biel-websocket-service";
3
+ import { BielService } from "../../services/biel-service";
4
+ export class BielBot {
5
+ handleClose() {
6
+ this.showModal = false;
7
+ document.body.style.overflow = '';
8
+ }
9
+ handleFullscreenClicked() {
10
+ this.isFullscreen = !this.isFullscreen;
11
+ document.body.style.overflow = this.isFullscreen ? 'hidden' : '';
12
+ }
13
+ constructor() {
14
+ this.modalPosition = 'center';
15
+ this.project = '';
16
+ this.showModal = false;
17
+ this.fetchData = true;
18
+ this.headerTitle = 'Company Name AI';
19
+ this.inputPlaceholderText = 'Type your message';
20
+ this.sendButtonText = 'Send';
21
+ this.hideExpandButton = false;
22
+ this.expandModal = false;
23
+ this.errorMessage404 = "Oops! We could not find the provided project ID.";
24
+ this.errorMessage403 = "Oops! The request URL does not match the one defined for this project.";
25
+ this.errorMessageDefault = "Oops! Please try again later.";
26
+ this.footerText = "AI generated answers. Always verify the sources before using them.";
27
+ this.isFullscreen = this.expandModal;
28
+ this.isLoading = false;
29
+ this.showPoweredBy = true;
30
+ this.welcomeMessage = undefined;
31
+ this.messages = [];
32
+ this.webSocketService = new BielWebSocketService(this.project, this.errorMessageDefault);
33
+ this.webSocketService.onMessage(this.handleIncomingMessage.bind(this));
34
+ this.webSocketService.onLoadingStart(() => this.isLoading = true);
35
+ this.webSocketService.onLoadingEnd(() => this.isLoading = false);
36
+ }
37
+ handleIncomingMessage(message) {
38
+ this.messages = [...this.messages, { sender: message.from, text: message.message }];
39
+ }
40
+ async componentWillLoad() {
41
+ if (this.fetchData) {
42
+ this.bielService = new BielService(this.project, this.errorMessage404, this.errorMessage403, this.errorMessageDefault);
43
+ const result = await this.bielService.getProjectDetails();
44
+ if (typeof result === 'string') {
45
+ this.welcomeMessage = result;
46
+ }
47
+ else {
48
+ this.showPoweredBy = result.whitelabel;
49
+ this.welcomeMessage = result.initialMessage;
50
+ }
51
+ if (this.welcomeMessage) {
52
+ this.messages = [{ text: this.welcomeMessage, sender: 'ai' }];
53
+ }
54
+ }
55
+ }
56
+ handleMessageSent(event) {
57
+ this.messages = [...this.messages, { text: event.detail, sender: 'user' }];
58
+ this.webSocketService.sendMessage(event.detail);
59
+ }
60
+ render() {
61
+ return (h("div", { key: '0779ac463e2d1daf5e7d1f6d92ed9592776972bf', class: 'biel-bot-wrapper' }, this.showModal && (h("div", { key: '39c72fbe3b17de2b2b881d8a39bd8bec270cac13', class: "feedback-overlay" })), this.showModal && (h("div", { key: '692eccc43cd4dbc39ba510f8422ab13c083aa782', class: `biel-bot-content biel-bot-content--${this.modalPosition} ${this.showModal ? 'biel-bot-content--open' : ''} ${this.isFullscreen ? 'fullscreen' : ''}`, ref: el => (this.modalContent = el) }, h("div", { key: '01240aab4b14cd6a24bc59c1d951ed679ce8a53c', class: "biel-bot-header" }, h("biel-header", { key: 'c4624af08036041b033cc70c02b508e76787dd0b', headerTitle: this.headerTitle, project: this.project, showPoweredBy: this.showPoweredBy, hideExpandButton: this.hideExpandButton, fullscreen: this.isFullscreen })), h("div", { key: '54d8b6290f60c5b9427b92f89770cda198b06be5', class: "biel-bot-body" }, h("biel-chat", { key: 'd811b46f4dfdd5b41087839f60915f452272ebbf', messages: this.messages, isFullscreen: this.isFullscreen, isLoading: this.isLoading }), h("biel-input", { key: 'fa83a2a460f30367062ecebe5c8f2d36964f8758', placeholderText: this.inputPlaceholderText, sendButtonText: this.sendButtonText, onMessageSent: (event) => this.handleMessageSent(event), isDisabled: this.isLoading })), h("div", { key: '25b1bfa2642d542c621821f5502db5467ab33d8c', class: "biel-bot-footer" }, this.footerText)))));
62
+ }
63
+ static get is() { return "biel-bot"; }
64
+ static get encapsulation() { return "shadow"; }
65
+ static get originalStyleUrls() {
66
+ return {
67
+ "$": ["biel-bot.css"]
68
+ };
69
+ }
70
+ static get styleUrls() {
71
+ return {
72
+ "$": ["biel-bot.css"]
73
+ };
74
+ }
75
+ static get properties() {
76
+ return {
77
+ "modalPosition": {
78
+ "type": "string",
79
+ "mutable": false,
80
+ "complexType": {
81
+ "original": "string",
82
+ "resolved": "string",
83
+ "references": {}
84
+ },
85
+ "required": false,
86
+ "optional": false,
87
+ "docs": {
88
+ "tags": [],
89
+ "text": ""
90
+ },
91
+ "attribute": "modal-position",
92
+ "reflect": false,
93
+ "defaultValue": "'center'"
94
+ },
95
+ "project": {
96
+ "type": "string",
97
+ "mutable": false,
98
+ "complexType": {
99
+ "original": "string",
100
+ "resolved": "string",
101
+ "references": {}
102
+ },
103
+ "required": false,
104
+ "optional": false,
105
+ "docs": {
106
+ "tags": [],
107
+ "text": ""
108
+ },
109
+ "attribute": "project",
110
+ "reflect": false,
111
+ "defaultValue": "''"
112
+ },
113
+ "showModal": {
114
+ "type": "boolean",
115
+ "mutable": true,
116
+ "complexType": {
117
+ "original": "boolean",
118
+ "resolved": "boolean",
119
+ "references": {}
120
+ },
121
+ "required": false,
122
+ "optional": false,
123
+ "docs": {
124
+ "tags": [],
125
+ "text": ""
126
+ },
127
+ "attribute": "show-modal",
128
+ "reflect": true,
129
+ "defaultValue": "false"
130
+ },
131
+ "fetchData": {
132
+ "type": "boolean",
133
+ "mutable": false,
134
+ "complexType": {
135
+ "original": "boolean",
136
+ "resolved": "boolean",
137
+ "references": {}
138
+ },
139
+ "required": false,
140
+ "optional": false,
141
+ "docs": {
142
+ "tags": [],
143
+ "text": ""
144
+ },
145
+ "attribute": "fetch-data",
146
+ "reflect": false,
147
+ "defaultValue": "true"
148
+ },
149
+ "headerTitle": {
150
+ "type": "string",
151
+ "mutable": false,
152
+ "complexType": {
153
+ "original": "string",
154
+ "resolved": "string",
155
+ "references": {}
156
+ },
157
+ "required": false,
158
+ "optional": false,
159
+ "docs": {
160
+ "tags": [],
161
+ "text": ""
162
+ },
163
+ "attribute": "header-title",
164
+ "reflect": false,
165
+ "defaultValue": "'Company Name AI'"
166
+ },
167
+ "inputPlaceholderText": {
168
+ "type": "string",
169
+ "mutable": false,
170
+ "complexType": {
171
+ "original": "string",
172
+ "resolved": "string",
173
+ "references": {}
174
+ },
175
+ "required": false,
176
+ "optional": false,
177
+ "docs": {
178
+ "tags": [],
179
+ "text": ""
180
+ },
181
+ "attribute": "input-placeholder-text",
182
+ "reflect": false,
183
+ "defaultValue": "'Type your message'"
184
+ },
185
+ "sendButtonText": {
186
+ "type": "string",
187
+ "mutable": false,
188
+ "complexType": {
189
+ "original": "string",
190
+ "resolved": "string",
191
+ "references": {}
192
+ },
193
+ "required": false,
194
+ "optional": false,
195
+ "docs": {
196
+ "tags": [],
197
+ "text": ""
198
+ },
199
+ "attribute": "send-button-text",
200
+ "reflect": false,
201
+ "defaultValue": "'Send'"
202
+ },
203
+ "hideExpandButton": {
204
+ "type": "boolean",
205
+ "mutable": false,
206
+ "complexType": {
207
+ "original": "boolean",
208
+ "resolved": "boolean",
209
+ "references": {}
210
+ },
211
+ "required": false,
212
+ "optional": false,
213
+ "docs": {
214
+ "tags": [],
215
+ "text": ""
216
+ },
217
+ "attribute": "hide-expand-button",
218
+ "reflect": false,
219
+ "defaultValue": "false"
220
+ },
221
+ "expandModal": {
222
+ "type": "boolean",
223
+ "mutable": false,
224
+ "complexType": {
225
+ "original": "boolean",
226
+ "resolved": "boolean",
227
+ "references": {}
228
+ },
229
+ "required": false,
230
+ "optional": false,
231
+ "docs": {
232
+ "tags": [],
233
+ "text": ""
234
+ },
235
+ "attribute": "expand-modal",
236
+ "reflect": false,
237
+ "defaultValue": "false"
238
+ },
239
+ "errorMessage404": {
240
+ "type": "string",
241
+ "mutable": false,
242
+ "complexType": {
243
+ "original": "string",
244
+ "resolved": "string",
245
+ "references": {}
246
+ },
247
+ "required": false,
248
+ "optional": false,
249
+ "docs": {
250
+ "tags": [],
251
+ "text": ""
252
+ },
253
+ "attribute": "error-message-4-0-4",
254
+ "reflect": false,
255
+ "defaultValue": "\"Oops! We could not find the provided project ID.\""
256
+ },
257
+ "errorMessage403": {
258
+ "type": "string",
259
+ "mutable": false,
260
+ "complexType": {
261
+ "original": "string",
262
+ "resolved": "string",
263
+ "references": {}
264
+ },
265
+ "required": false,
266
+ "optional": false,
267
+ "docs": {
268
+ "tags": [],
269
+ "text": ""
270
+ },
271
+ "attribute": "error-message-4-0-3",
272
+ "reflect": false,
273
+ "defaultValue": "\"Oops! The request URL does not match the one defined for this project.\""
274
+ },
275
+ "errorMessageDefault": {
276
+ "type": "string",
277
+ "mutable": false,
278
+ "complexType": {
279
+ "original": "string",
280
+ "resolved": "string",
281
+ "references": {}
282
+ },
283
+ "required": false,
284
+ "optional": false,
285
+ "docs": {
286
+ "tags": [],
287
+ "text": ""
288
+ },
289
+ "attribute": "error-message-default",
290
+ "reflect": false,
291
+ "defaultValue": "\"Oops! Please try again later.\""
292
+ },
293
+ "footerText": {
294
+ "type": "string",
295
+ "mutable": false,
296
+ "complexType": {
297
+ "original": "string",
298
+ "resolved": "string",
299
+ "references": {}
300
+ },
301
+ "required": false,
302
+ "optional": false,
303
+ "docs": {
304
+ "tags": [],
305
+ "text": ""
306
+ },
307
+ "attribute": "footer-text",
308
+ "reflect": false,
309
+ "defaultValue": "\"AI generated answers. Always verify the sources before using them.\""
310
+ }
311
+ };
312
+ }
313
+ static get states() {
314
+ return {
315
+ "isFullscreen": {},
316
+ "isLoading": {},
317
+ "showPoweredBy": {},
318
+ "welcomeMessage": {},
319
+ "messages": {}
320
+ };
321
+ }
322
+ static get listeners() {
323
+ return [{
324
+ "name": "closeClicked",
325
+ "method": "handleClose",
326
+ "target": "body",
327
+ "capture": false,
328
+ "passive": false
329
+ }, {
330
+ "name": "fullscreenClicked",
331
+ "method": "handleFullscreenClicked",
332
+ "target": "body",
333
+ "capture": false,
334
+ "passive": false
335
+ }];
336
+ }
337
+ }
338
+ //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C,UAAU,CACZ,CACF,CACP,CACG,CACP,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, h, Listen, Prop, State } from '@stencil/core';\nimport { BielWebSocketService } from '../../services/biel-websocket-service';\nimport { BielService } from '../../services/biel-service';\n\n@Component({\n tag: 'biel-bot',\n styleUrl: 'biel-bot.css',\n shadow: true\n})\nexport class BielBot {\n\n // Define the component properties\n @Prop() modalPosition: string = 'center';\n @Prop() project: string = '';\n @Prop({ mutable: true, reflect: true }) showModal: boolean = false;\n @Prop() fetchData: boolean = true;\n @Prop() headerTitle: string = 'Company Name AI';\n @Prop() inputPlaceholderText: string = 'Type your message';\n @Prop() sendButtonText: string = 'Send';\n @Prop() hideExpandButton: boolean = false;\n @Prop() expandModal: boolean = false;\n @Prop() errorMessage404: string = \"Oops! We could not find the provided project ID.\";\n @Prop() errorMessage403: string = \"Oops! The request URL does not match the one defined for this project.\";\n @Prop() errorMessageDefault: string = \"Oops! Please try again later.\";\n @Prop() footerText: string = \"AI generated answers. Always verify the sources before using them.\";\n\n @State() isFullscreen: boolean = this.expandModal;\n @State() isLoading: boolean = false;\n @State() showPoweredBy: boolean = true;\n @State() welcomeMessage: string;\n @State() messages: { text: string, sender: 'user' | 'ai' }[] = [];\n\n @Listen('closeClicked', { target: 'body' })\n handleClose() {\n this.showModal = false;\n document.body.style.overflow = '';\n }\n @Listen('fullscreenClicked', { target: 'body' })\n handleFullscreenClicked() {\n this.isFullscreen = !this.isFullscreen;\n document.body.style.overflow = this.isFullscreen ? 'hidden' : '';\n }\n\n // Define the accesible and modificable divs in the screenshot\n modalContent: HTMLElement;\n webSocketService: BielWebSocketService;\n bielService: BielService;\n\n constructor() {\n this.webSocketService = new BielWebSocketService(this.project, this.errorMessageDefault);\n this.webSocketService.onMessage(this.handleIncomingMessage.bind(this));\n this.webSocketService.onLoadingStart(() => this.isLoading = true);\n this.webSocketService.onLoadingEnd(() => this.isLoading = false);\n }\n\n handleIncomingMessage(message: any) {\n this.messages = [...this.messages, { sender: message.from, text: message.message }];\n }\n\n async componentWillLoad() {\n if (this.fetchData) {\n this.bielService = new BielService(\n this.project,\n this.errorMessage404,\n this.errorMessage403,\n this.errorMessageDefault\n );\n const result = await this.bielService.getProjectDetails();\n\n if (typeof result === 'string') {\n this.welcomeMessage = result;\n } else {\n this.showPoweredBy = result.whitelabel;\n this.welcomeMessage = result.initialMessage;\n }\n if (this.welcomeMessage) {\n this.messages = [{ text: this.welcomeMessage, sender: 'ai' }];\n }\n }\n }\n\n handleMessageSent(event: CustomEvent<string>) {\n this.messages = [...this.messages, { text: event.detail, sender: 'user' }];\n this.webSocketService.sendMessage(event.detail);\n }\n\n render() {\n return (\n <div class='biel-bot-wrapper'>\n {this.showModal && (<div class=\"feedback-overlay\"></div>)}\n {this.showModal && (\n <div class={`biel-bot-content biel-bot-content--${this.modalPosition} ${this.showModal ? 'biel-bot-content--open' : ''} ${this.isFullscreen ? 'fullscreen' : ''}`} ref={el => (this.modalContent = el)}>\n <div class=\"biel-bot-header\">\n <biel-header headerTitle={this.headerTitle} project={this.project} showPoweredBy={this.showPoweredBy} hideExpandButton={this.hideExpandButton} fullscreen={this.isFullscreen}></biel-header>\n </div>\n <div class=\"biel-bot-body\">\n <biel-chat messages={this.messages} isFullscreen={this.isFullscreen} isLoading={this.isLoading}></biel-chat>\n <biel-input\n placeholderText={this.inputPlaceholderText}\n sendButtonText={this.sendButtonText}\n onMessageSent={(event) => this.handleMessageSent(event)}\n isDisabled={this.isLoading}>\n </biel-input>\n </div>\n <div class=\"biel-bot-footer\">\n {this.footerText}\n </div>\n </div>\n )}\n </div>\n );\n }\n}"]}
@@ -0,0 +1,63 @@
1
+ .biel-button-content {
2
+ cursor: pointer;
3
+ max-width: fit-content;
4
+ z-index: var(-biel-button-z-index);
5
+ }
6
+
7
+ .biel-button-content--light{
8
+ align-items: center;
9
+ background-color: var(--biel-button-light-bg-color);
10
+ border-radius: var(--biel-button-border-radius);
11
+ box-shadow: rgba(60, 64, 67, 0.3) 0px 1px 2px 0px, rgba(60, 64, 67, 0.15) 0px 2px 6px 2px;
12
+ box-sizing: border-box;
13
+ color: var(--biel-button-light-text-color);
14
+ display: flex;
15
+ font-family: var(--feedback-font-family);
16
+ font-size: var(--biel-button-text-font-size);
17
+ font-weight: var(--biel-button-text-font-weight);
18
+ padding: 8px 15px;
19
+ }
20
+
21
+ .biel-button-content--dark{
22
+ align-items: center;
23
+ background-color: var(--biel-button-dark-bg-color);
24
+ border-radius: var(--biel-button-border-radius);
25
+ box-shadow: rgba(60, 64, 67, 0.3) 0px 1px 2px 0px, rgba(60, 64, 67, 0.15) 0px 2px 6px 2px;
26
+ box-sizing: border-box;
27
+ color: var(--biel-button-dark-text-color);
28
+ display: flex;
29
+ font-family: var(--feedback-font-family);
30
+ font-weight: var(--biel-button-text-font-weight);
31
+ font-size: var(--biel-button-text-font-size);
32
+ padding: 8px 15px;
33
+ }
34
+
35
+ .biel-button-content--bottom-right{
36
+ bottom: 10px;
37
+ position: fixed;
38
+ right: 10px;
39
+ }
40
+
41
+ .biel-button-content--center-right{
42
+ position: fixed;
43
+ transform: rotate(-90deg) translateY(-50%);
44
+ top: 50%;
45
+ }
46
+
47
+ .biel-button-content--center-right.biel-button-content--dark,
48
+ .biel-button-content--center-right.biel-button-content--light {
49
+ border-radius: 4px;
50
+ border-bottom-left-radius: 0px;
51
+ border-bottom-right-radius: 0px;
52
+ }
53
+
54
+
55
+ .biel-button-content-icon {
56
+ height: 16px;
57
+ margin-right: 5px;
58
+ width: 16px;
59
+ }
60
+
61
+ .biel-button-content--center-right .biel-button-content-icon {
62
+ rotate: 90deg;
63
+ }