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,301 @@
1
+ import { Host, h } from "@stencil/core";
2
+ export class BielButton {
3
+ constructor() {
4
+ this.customFont = false;
5
+ this.project = '';
6
+ this.buttonStyle = 'default';
7
+ this.buttonPosition = 'default';
8
+ this.modalPosition = 'center';
9
+ this.hideIcon = false;
10
+ this.hideExpandButton = false;
11
+ this.expandModal = false;
12
+ this.errorMessage404 = "Oops! We could not find the provided project ID.";
13
+ this.errorMessage403 = "Oops! The request URL does not match the one defined for this project.";
14
+ this.errorMessageDefault = "Oops! Please try again later.";
15
+ this.footerText = "This AI is experimental. Always verify the answers before using them.";
16
+ }
17
+ connectedCallback() {
18
+ this.bielBot = document.createElement('biel-bot');
19
+ const props = [
20
+ 'modalPosition',
21
+ 'customFont',
22
+ 'project',
23
+ 'hideExpandButton',
24
+ 'expandModal',
25
+ 'errorMessage404',
26
+ 'errorMessage403',
27
+ 'errorMessageDefault',
28
+ 'footerText',
29
+ ];
30
+ props.forEach(prop => {
31
+ this.bielBot[prop] = this[prop];
32
+ });
33
+ document.body.appendChild(this.bielBot);
34
+ }
35
+ disconnectedCallback() {
36
+ document.body.removeChild(this.bielBot);
37
+ }
38
+ isSafariBrowser() {
39
+ const isSafari = /safari/i.test(navigator.userAgent) && !/chrome/i.test(navigator.userAgent);
40
+ return isSafari;
41
+ }
42
+ componentDidLoad() {
43
+ if (this.buttonPosition === 'center-right') {
44
+ const buttonContent = this.el.shadowRoot.querySelector('.biel-button-content');
45
+ let adjustment = 0;
46
+ if (this.isSafariBrowser()) {
47
+ adjustment = 10;
48
+ }
49
+ buttonContent.style.right = `${(buttonContent.offsetWidth + adjustment) / 2 * -1}px`;
50
+ }
51
+ if (!this.customFont) {
52
+ this.loadInterFont();
53
+ }
54
+ }
55
+ loadInterFont() {
56
+ const link = document.createElement('link');
57
+ link.href = 'https://fonts.googleapis.com/css2?family=Inter:wght@400;500&display=swap';
58
+ link.rel = 'stylesheet';
59
+ document.head.appendChild(link);
60
+ }
61
+ showModal() {
62
+ this.bielBot.showModal = true;
63
+ }
64
+ render() {
65
+ return (h(Host, { key: 'fefafe4081c2545a927f0dc153e516105376faf1' }, h("a", { key: 'ccf704b7d06b0a3a67c8c4d172b1a6eff24515c4', class: `biel-button-content biel-button-content--${this.buttonStyle} biel-button-content--${this.buttonPosition}`, onClick: () => this.showModal() }, !this.hideIcon && this.buttonStyle === 'dark' && (h("span", { key: '26f7e3ea098c8ba800c97d80aeaa984b7a7f7c46', class: "biel-button-content-icon" }, h("svg", { key: '9d9a30872f17b34432c26f422021712abce413bd', xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "#fff", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", class: "feather feather-edit-3" }, h("path", { key: '8ba714fb2be9051b44be5d1488db23f5031152fc', d: "M12 20h9" }), h("path", { key: '54c3fb22298ae18acd5ba9d322e9ac783dc997a8', d: "M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z" })))), !this.hideIcon && this.buttonStyle === 'light' && (h("span", { key: '8a6b0039b86c4694c61cb0106e665dbcb4970b7d', class: "biel-button-content-icon" }, h("svg", { key: 'f343877b86e6c68b20b1372d6c5e3a992f8153ac', xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "#0070F4", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", class: "feather feather-edit-3" }, h("path", { key: '3928d5d90384fee101d555191604455fd11e08da', d: "M12 20h9" }), h("path", { key: 'b33b4b21494843c23528082329a09b798623d5fb', d: "M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z" })))), h("slot", { key: '47b3047e7de5e47a6d337649c24bd9a3b71ed23b' }))));
66
+ }
67
+ static get is() { return "biel-button"; }
68
+ static get encapsulation() { return "shadow"; }
69
+ static get originalStyleUrls() {
70
+ return {
71
+ "$": ["biel-button.css"]
72
+ };
73
+ }
74
+ static get styleUrls() {
75
+ return {
76
+ "$": ["biel-button.css"]
77
+ };
78
+ }
79
+ static get properties() {
80
+ return {
81
+ "customFont": {
82
+ "type": "boolean",
83
+ "mutable": false,
84
+ "complexType": {
85
+ "original": "boolean",
86
+ "resolved": "boolean",
87
+ "references": {}
88
+ },
89
+ "required": false,
90
+ "optional": false,
91
+ "docs": {
92
+ "tags": [],
93
+ "text": ""
94
+ },
95
+ "attribute": "custom-font",
96
+ "reflect": false,
97
+ "defaultValue": "false"
98
+ },
99
+ "project": {
100
+ "type": "string",
101
+ "mutable": false,
102
+ "complexType": {
103
+ "original": "string",
104
+ "resolved": "string",
105
+ "references": {}
106
+ },
107
+ "required": false,
108
+ "optional": false,
109
+ "docs": {
110
+ "tags": [],
111
+ "text": ""
112
+ },
113
+ "attribute": "project",
114
+ "reflect": false,
115
+ "defaultValue": "''"
116
+ },
117
+ "buttonStyle": {
118
+ "type": "string",
119
+ "mutable": false,
120
+ "complexType": {
121
+ "original": "string",
122
+ "resolved": "string",
123
+ "references": {}
124
+ },
125
+ "required": false,
126
+ "optional": false,
127
+ "docs": {
128
+ "tags": [],
129
+ "text": ""
130
+ },
131
+ "attribute": "button-style",
132
+ "reflect": false,
133
+ "defaultValue": "'default'"
134
+ },
135
+ "buttonPosition": {
136
+ "type": "string",
137
+ "mutable": false,
138
+ "complexType": {
139
+ "original": "string",
140
+ "resolved": "string",
141
+ "references": {}
142
+ },
143
+ "required": false,
144
+ "optional": false,
145
+ "docs": {
146
+ "tags": [],
147
+ "text": ""
148
+ },
149
+ "attribute": "button-position",
150
+ "reflect": false,
151
+ "defaultValue": "'default'"
152
+ },
153
+ "modalPosition": {
154
+ "type": "string",
155
+ "mutable": false,
156
+ "complexType": {
157
+ "original": "string",
158
+ "resolved": "string",
159
+ "references": {}
160
+ },
161
+ "required": false,
162
+ "optional": false,
163
+ "docs": {
164
+ "tags": [],
165
+ "text": ""
166
+ },
167
+ "attribute": "modal-position",
168
+ "reflect": false,
169
+ "defaultValue": "'center'"
170
+ },
171
+ "hideIcon": {
172
+ "type": "boolean",
173
+ "mutable": false,
174
+ "complexType": {
175
+ "original": "boolean",
176
+ "resolved": "boolean",
177
+ "references": {}
178
+ },
179
+ "required": false,
180
+ "optional": false,
181
+ "docs": {
182
+ "tags": [],
183
+ "text": ""
184
+ },
185
+ "attribute": "hide-icon",
186
+ "reflect": false,
187
+ "defaultValue": "false"
188
+ },
189
+ "hideExpandButton": {
190
+ "type": "boolean",
191
+ "mutable": false,
192
+ "complexType": {
193
+ "original": "boolean",
194
+ "resolved": "boolean",
195
+ "references": {}
196
+ },
197
+ "required": false,
198
+ "optional": false,
199
+ "docs": {
200
+ "tags": [],
201
+ "text": ""
202
+ },
203
+ "attribute": "hide-expand-button",
204
+ "reflect": false,
205
+ "defaultValue": "false"
206
+ },
207
+ "expandModal": {
208
+ "type": "boolean",
209
+ "mutable": false,
210
+ "complexType": {
211
+ "original": "boolean",
212
+ "resolved": "boolean",
213
+ "references": {}
214
+ },
215
+ "required": false,
216
+ "optional": false,
217
+ "docs": {
218
+ "tags": [],
219
+ "text": ""
220
+ },
221
+ "attribute": "expand-modal",
222
+ "reflect": false,
223
+ "defaultValue": "false"
224
+ },
225
+ "errorMessage404": {
226
+ "type": "string",
227
+ "mutable": false,
228
+ "complexType": {
229
+ "original": "string",
230
+ "resolved": "string",
231
+ "references": {}
232
+ },
233
+ "required": false,
234
+ "optional": false,
235
+ "docs": {
236
+ "tags": [],
237
+ "text": ""
238
+ },
239
+ "attribute": "error-message-4-0-4",
240
+ "reflect": false,
241
+ "defaultValue": "\"Oops! We could not find the provided project ID.\""
242
+ },
243
+ "errorMessage403": {
244
+ "type": "string",
245
+ "mutable": false,
246
+ "complexType": {
247
+ "original": "string",
248
+ "resolved": "string",
249
+ "references": {}
250
+ },
251
+ "required": false,
252
+ "optional": false,
253
+ "docs": {
254
+ "tags": [],
255
+ "text": ""
256
+ },
257
+ "attribute": "error-message-4-0-3",
258
+ "reflect": false,
259
+ "defaultValue": "\"Oops! The request URL does not match the one defined for this project.\""
260
+ },
261
+ "errorMessageDefault": {
262
+ "type": "string",
263
+ "mutable": false,
264
+ "complexType": {
265
+ "original": "string",
266
+ "resolved": "string",
267
+ "references": {}
268
+ },
269
+ "required": false,
270
+ "optional": false,
271
+ "docs": {
272
+ "tags": [],
273
+ "text": ""
274
+ },
275
+ "attribute": "error-message-default",
276
+ "reflect": false,
277
+ "defaultValue": "\"Oops! Please try again later.\""
278
+ },
279
+ "footerText": {
280
+ "type": "string",
281
+ "mutable": false,
282
+ "complexType": {
283
+ "original": "string",
284
+ "resolved": "string",
285
+ "references": {}
286
+ },
287
+ "required": false,
288
+ "optional": false,
289
+ "docs": {
290
+ "tags": [],
291
+ "text": ""
292
+ },
293
+ "attribute": "footer-text",
294
+ "reflect": false,
295
+ "defaultValue": "\"This AI is experimental. Always verify the answers before using them.\""
296
+ }
297
+ };
298
+ }
299
+ static get elementRef() { return "el"; }
300
+ }
301
+ //# sourceMappingURL=biel-button.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"biel-button.js","sourceRoot":"","sources":["../../../src/components/biel-button/biel-button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAOlE,MAAM,OAAO,UAAU;;0BAIS,KAAK;uBACT,EAAE;2BACE,SAAS;8BACN,SAAS;6BACV,QAAQ;wBACZ,KAAK;gCACG,KAAK;2BACV,KAAK;+BACF,kDAAkD;+BAClD,wEAAwE;mCACpE,+BAA+B;0BACxC,uEAAuE;;IAEpG,iBAAiB;QACf,IAAI,CAAC,OAAO,GAAG,QAAQ,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;QAClD,MAAM,KAAK,GAAG;YACZ,eAAe;YACf,YAAY;YACZ,SAAS;YACT,kBAAkB;YAClB,aAAa;YACb,iBAAiB;YACjB,iBAAiB;YACjB,qBAAqB;YACrB,YAAY;SACb,CAAC;QAEF,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;YACnB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC;QAClC,CAAC,CAAC,CAAC;QAEH,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC1C,CAAC;IAED,oBAAoB;QAClB,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC1C,CAAC;IAED,eAAe;QACb,MAAM,QAAQ,GAAG,SAAS,CAAC,I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export class BielButton {\n\n bielBot: any;\n @Element() el: HTMLElement;\n @Prop() customFont: boolean = false;\n @Prop() project: string = '';\n @Prop() buttonStyle: string = 'default';\n @Prop() buttonPosition: string = 'default';\n @Prop() modalPosition: string = 'center';\n @Prop() hideIcon: boolean = false;\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 = \"This AI is experimental. Always verify the answers before using them.\";\n\n connectedCallback() {\n this.bielBot = document.createElement('biel-bot');\n const props = [\n 'modalPosition',\n 'customFont',\n 'project',\n 'hideExpandButton',\n 'expandModal',\n 'errorMessage404',\n 'errorMessage403',\n 'errorMessageDefault',\n 'footerText',\n ];\n\n props.forEach(prop => {\n this.bielBot[prop] = this[prop];\n });\n\n document.body.appendChild(this.bielBot);\n }\n\n disconnectedCallback() {\n document.body.removeChild(this.bielBot);\n }\n\n isSafariBrowser() {\n const isSafari = /safari/i.test(navigator.userAgent) && !/chrome/i.test(navigator.userAgent);\n return isSafari;\n }\n\n componentDidLoad() {\n if (this.buttonPosition === 'center-right') {\n const buttonContent = this.el.shadowRoot.querySelector('.biel-button-content') as HTMLElement;\n let adjustment = 0;\n if (this.isSafariBrowser()) {\n adjustment = 10;\n }\n buttonContent.style.right = `${(buttonContent.offsetWidth + adjustment) / 2 * -1}px`;\n }\n if (!this.customFont) {\n this.loadInterFont();\n }\n }\n\n loadInterFont() {\n const link = document.createElement('link');\n link.href = 'https://fonts.googleapis.com/css2?family=Inter:wght@400;500&display=swap';\n link.rel = 'stylesheet';\n document.head.appendChild(link);\n }\n\n showModal() {\n this.bielBot.showModal = true;\n }\n\n render() {\n return (\n <Host>\n <a class={`biel-button-content biel-button-content--${this.buttonStyle} biel-button-content--${this.buttonPosition}`} onClick={() => this.showModal()}>\n {!this.hideIcon && this.buttonStyle === 'dark' && (\n <span class=\"biel-button-content-icon\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"#fff\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"feather feather-edit-3\"><path d=\"M12 20h9\"></path><path d=\"M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z\"></path></svg>\n </span>\n )}\n {!this.hideIcon && this.buttonStyle === 'light' && (\n <span class=\"biel-button-content-icon\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"#0070F4\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"feather feather-edit-3\"><path d=\"M12 20h9\"></path><path d=\"M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z\"></path></svg>\n </span>\n )}\n <slot />\n </a>\n </Host>\n );\n }\n}\n"]}
@@ -0,0 +1,75 @@
1
+ .biel-chat-container {
2
+ display: flex;
3
+ flex-direction: column;
4
+ max-height: 50vh;
5
+ overflow-y: auto;
6
+ padding: 10px;
7
+ }
8
+
9
+ .biel-chat-container.fullscreen {
10
+ height: calc(100vh - (200px + var(--biel-footer-font-size) + 12px));
11
+ max-height: calc(100vh - (200px + var(--biel-footer-font-size) + 12px));
12
+ }
13
+
14
+ .biel-chat-container::-webkit-scrollbar {
15
+ width: 6px;
16
+ }
17
+
18
+ .biel-chat-container::-webkit-scrollbar-thumb {
19
+ background-color: var(--biel-chat-scrollbar-color);
20
+ border-radius: 10px;
21
+ border: 3px solid transparent;
22
+ }
23
+
24
+ .biel-chat-container::-webkit-scrollbar-thumb:hover {
25
+ background-color: var(--biel-chat-scrollbar-hover-color);
26
+ }
27
+
28
+ .loading-animation {
29
+ display: flex;
30
+ align-items: center;
31
+ justify-content: center;
32
+ height: 40px;
33
+ margin-top: 10px;
34
+ }
35
+
36
+ .loading-animation .dot {
37
+ width: 8px;
38
+ height: 8px;
39
+ margin: 0 5px;
40
+ background-color: var(--biel-text-color);
41
+ border-radius: 50%;
42
+ animation: bounce 1.2s infinite ease-in-out;
43
+ }
44
+
45
+ .loading-animation .dot:nth-child(1) {
46
+ animation-delay: -0.32s;
47
+ }
48
+
49
+ .loading-animation .dot:nth-child(2) {
50
+ animation-delay: -0.16s;
51
+ }
52
+
53
+ .loading-animation .dot:nth-child(3) {
54
+ animation-delay: 0s;
55
+ }
56
+
57
+ @keyframes bounce {
58
+
59
+ 0%,
60
+ 80%,
61
+ 100% {
62
+ transform: scale(0);
63
+ }
64
+
65
+ 40% {
66
+ transform: scale(1);
67
+ }
68
+ }
69
+
70
+ @media screen and (min-width: 768px) {
71
+ .biel-chat-container.fullscreen {
72
+ height: calc(100vh - (200px + 12px));
73
+ max-height: calc(100vh - (200px + 12px));
74
+ }
75
+ }
@@ -0,0 +1,119 @@
1
+ import { h } from "@stencil/core";
2
+ export class BielChat {
3
+ constructor() {
4
+ this.offset = 0;
5
+ this.messages = [];
6
+ this.isFullscreen = undefined;
7
+ this.isLoading = false;
8
+ }
9
+ handleTextareaHeightChanged(event) {
10
+ this.offset += event.detail;
11
+ if (this.isFullscreen) {
12
+ this.adjustChatHeight();
13
+ }
14
+ }
15
+ adjustChatHeight() {
16
+ const chatContainer = this.el.shadowRoot.querySelector('.biel-chat-container');
17
+ chatContainer.style.height = '';
18
+ if (this.isFullscreen) {
19
+ const previousHeight = parseInt(getComputedStyle(chatContainer).getPropertyValue('height'));
20
+ chatContainer.style.height = `${previousHeight - this.offset}px`;
21
+ }
22
+ }
23
+ componentDidUpdate() {
24
+ this.scrollToBottom();
25
+ this.adjustChatHeight();
26
+ }
27
+ scrollToBottom() {
28
+ const container = this.el.shadowRoot.querySelector('.biel-chat-container');
29
+ if (container) {
30
+ container.scrollTop = container.scrollHeight;
31
+ }
32
+ }
33
+ render() {
34
+ return (h("div", { key: '4bdea230464e58db6f7fb8726bdd5451be57d19c', class: `biel-chat-container ${this.isFullscreen ? 'fullscreen' : ''}` }, this.messages.map((message) => (h("biel-message", { text: message.text, sender: message.sender }))), this.isLoading && (h("div", { key: '148478d5d3dfbd23fa1f18599270bc8d501d3444', class: "loading-animation" }, h("div", { key: '1c95aeff506a63f5f47e7c89f62f032af60d63c9', class: "dot" }), h("div", { key: '505b689618bde42bfeaa362211086af52481d410', class: "dot" }), h("div", { key: '7f53dd97cdc665bb9747a39f128ede88838b7a6a', class: "dot" })))));
35
+ }
36
+ static get is() { return "biel-chat"; }
37
+ static get encapsulation() { return "shadow"; }
38
+ static get originalStyleUrls() {
39
+ return {
40
+ "$": ["biel-chat.css"]
41
+ };
42
+ }
43
+ static get styleUrls() {
44
+ return {
45
+ "$": ["biel-chat.css"]
46
+ };
47
+ }
48
+ static get properties() {
49
+ return {
50
+ "messages": {
51
+ "type": "unknown",
52
+ "mutable": false,
53
+ "complexType": {
54
+ "original": "{ text: string, sender: 'user' | 'ai' }[]",
55
+ "resolved": "{ text: string; sender: \"user\" | \"ai\"; }[]",
56
+ "references": {}
57
+ },
58
+ "required": false,
59
+ "optional": false,
60
+ "docs": {
61
+ "tags": [],
62
+ "text": ""
63
+ },
64
+ "defaultValue": "[]"
65
+ },
66
+ "isFullscreen": {
67
+ "type": "boolean",
68
+ "mutable": false,
69
+ "complexType": {
70
+ "original": "boolean",
71
+ "resolved": "boolean",
72
+ "references": {}
73
+ },
74
+ "required": false,
75
+ "optional": false,
76
+ "docs": {
77
+ "tags": [],
78
+ "text": ""
79
+ },
80
+ "attribute": "is-fullscreen",
81
+ "reflect": false
82
+ },
83
+ "isLoading": {
84
+ "type": "boolean",
85
+ "mutable": false,
86
+ "complexType": {
87
+ "original": "boolean",
88
+ "resolved": "boolean",
89
+ "references": {}
90
+ },
91
+ "required": false,
92
+ "optional": false,
93
+ "docs": {
94
+ "tags": [],
95
+ "text": ""
96
+ },
97
+ "attribute": "is-loading",
98
+ "reflect": false,
99
+ "defaultValue": "false"
100
+ }
101
+ };
102
+ }
103
+ static get states() {
104
+ return {
105
+ "offset": {}
106
+ };
107
+ }
108
+ static get elementRef() { return "el"; }
109
+ static get listeners() {
110
+ return [{
111
+ "name": "textareaHeightChanged",
112
+ "method": "handleTextareaHeightChanged",
113
+ "target": "body",
114
+ "capture": false,
115
+ "passive": false
116
+ }];
117
+ }
118
+ }
119
+ //# sourceMappingURL=biel-chat.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"biel-chat.js","sourceRoot":"","sources":["../../../src/components/biel-chat/biel-chat.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAO3E,MAAM,OAAO,QAAQ;;sBAEO,CAAC;wBAEmC,EAAE;;yBAEnC,KAAK;;IAKlC,2BAA2B,CAAC,KAA0B;QACpD,IAAI,CAAC,MAAM,IAAI,KAAK,CAAC,MAAM,CAAC;QAC5B,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;YACtB,IAAI,CAAC,gBAAgB,EAAE,CAAC;QAC1B,CAAC;IACH,CAAC;IAED,gBAAgB;QACd,MAAM,aAAa,GAAG,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,aAAa,CAAc,sBAAsB,CAAC,CAAC;QAC5F,aAAa,CAAC,KAAK,CAAC,MAAM,GAAG,EAAE,CAAC;QAChC,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;YACtB,MAAM,cAAc,GAAG,QAAQ,CAAC,gBAAgB,CAAC,aAAa,CAAC,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC,CAAC;YAC5F,aAAa,CAAC,KAAK,CAAC,MAAM,GAAG,GAAG,cAAc,GAAG,IAAI,CAAC,MAAM,IAAI,CAAC;QACnE,CAAC;IACH,CAAC;IAED,kBAAkB;QAChB,IAAI,CAAC,cAAc,EAAE,CAAC;QACtB,IAAI,CAAC,gBAAgB,EAAE,CAAC;IAC1B,CAAC;IAED,cAAc;QACZ,MAAM,SAAS,GAAG,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,aAAa,CAAC,sBAAsB,CAAC,CAAC;QAC3E,IAAI,SAAS,EAAE,CAAC;YACd,SAAS,CAAC,SAAS,GAAG,SAAS,CAAC,YAAY,CAAC;QAC/C,CAAC;IACH,CAAC;IAED,MAAM;QACJ,OAAO,CACL,4DAAK,KAAK,EAAE,uBAAuB,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,EAAE;YACvE,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAC9B,oBAAc,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,GAAiB,CAC1E,CAAC;YACD,IAAI,CAAC,SAAS,IAAI,CACjB,4DAAK,KAAK,EAAC,mBAAmB;gBAC5B,4DAAK,KAAK,EAAC,KAAK,GAAO;gBACvB,4DAAK,KAAK,EAAC,KAAK,GAAO;gBACvB,4DAAK,KAAK,EAAC,KAAK,GAAO,CACnB,CACP,CACG,CACP,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Prop, h, Listen, State } from '@stencil/core';\n\n@Component({\n tag: 'biel-chat',\n styleUrl: 'biel-chat.css',\n shadow: true,\n})\nexport class BielChat {\n\n @State() offset: number = 0;\n\n @Prop() messages: { text: string, sender: 'user' | 'ai' }[] = [];\n @Prop() isFullscreen: boolean;\n @Prop() isLoading: boolean = false;\n\n @Element() el: HTMLElement;\n\n @Listen('textareaHeightChanged', { target: 'body' })\n handleTextareaHeightChanged(event: CustomEvent<number>) {\n this.offset += event.detail;\n if (this.isFullscreen) {\n this.adjustChatHeight();\n }\n }\n\n adjustChatHeight() {\n const chatContainer = this.el.shadowRoot.querySelector<HTMLElement>('.biel-chat-container');\n chatContainer.style.height = '';\n if (this.isFullscreen) {\n const previousHeight = parseInt(getComputedStyle(chatContainer).getPropertyValue('height'));\n chatContainer.style.height = `${previousHeight - this.offset}px`;\n }\n }\n\n componentDidUpdate() {\n this.scrollToBottom();\n this.adjustChatHeight();\n }\n\n scrollToBottom() {\n const container = this.el.shadowRoot.querySelector('.biel-chat-container');\n if (container) {\n container.scrollTop = container.scrollHeight;\n }\n }\n\n render() {\n return (\n <div class={`biel-chat-container ${this.isFullscreen ? 'fullscreen' : ''}`}>\n {this.messages.map((message) => (\n <biel-message text={message.text} sender={message.sender}></biel-message>\n ))}\n {this.isLoading && (\n <div class=\"loading-animation\">\n <div class=\"dot\"></div>\n <div class=\"dot\"></div>\n <div class=\"dot\"></div>\n </div>\n )}\n </div>\n );\n }\n}\n"]}
@@ -0,0 +1,49 @@
1
+ .biel-header {
2
+ display: flex;
3
+ padding-bottom: 10px;
4
+ color: var(--biel-header-text-color);
5
+ border-bottom: 1px solid var(--biel-header-border-color);
6
+ flex-direction: column;
7
+ text-align: center;
8
+ }
9
+
10
+ .biel-header__title-container {
11
+ display: flex;
12
+ flex-direction: column;
13
+ align-items: center;
14
+ flex-grow: 1;
15
+ }
16
+
17
+ .biel-header__title {
18
+ font-size: var(--biel-header-font-size);
19
+ font-weight: var(--biel-header-font-weight);
20
+ }
21
+
22
+ .biel-header__powered-by {
23
+ color: var(--biel-header-powered-by-text-color);
24
+ padding-top: 5px;
25
+ font-size: 12px;
26
+ height: 12px;
27
+ }
28
+
29
+ .biel-header__powered-by a {
30
+ color: var(--biel-header-powered-by-link-color);
31
+ font-weight: 500;
32
+ text-decoration: none;
33
+ }
34
+
35
+ .biel-header__icons {
36
+ display: flex;
37
+ justify-content: flex-end;
38
+ }
39
+
40
+ .biel-header__icon {
41
+ color: var(--biel-header-text-color);
42
+ background: none;
43
+ border: none;
44
+ cursor: pointer;
45
+ display: flex;
46
+ padding: 3px;
47
+ padding-top: 0;
48
+ margin-left: 5px;
49
+ }