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.
- package/LICENSE +21 -0
- package/dist/biel-search/biel-search.css +1 -0
- package/dist/biel-search/biel-search.esm.js +2 -0
- package/dist/biel-search/biel-search.esm.js.map +1 -0
- package/dist/biel-search/index.esm.js +2 -0
- package/dist/biel-search/index.esm.js.map +1 -0
- package/dist/biel-search/p-1b3c90ca.js +3 -0
- package/dist/biel-search/p-1b3c90ca.js.map +1 -0
- package/dist/biel-search/p-e1255160.js +2 -0
- package/dist/biel-search/p-e1255160.js.map +1 -0
- package/dist/biel-search/p-fe900c87.entry.js +3 -0
- package/dist/biel-search/p-fe900c87.entry.js.map +1 -0
- package/dist/cjs/app-globals-3a1e7e63.js +7 -0
- package/dist/cjs/app-globals-3a1e7e63.js.map +1 -0
- package/dist/cjs/biel-bot_8.cjs.entry.js +63952 -0
- package/dist/cjs/biel-bot_8.cjs.entry.js.map +1 -0
- package/dist/cjs/biel-search.cjs.js +27 -0
- package/dist/cjs/biel-search.cjs.js.map +1 -0
- package/dist/cjs/index-05fc01fd.js +1281 -0
- package/dist/cjs/index-05fc01fd.js.map +1 -0
- package/dist/cjs/index.cjs.js +11 -0
- package/dist/cjs/index.cjs.js.map +1 -0
- package/dist/cjs/loader.cjs.js +17 -0
- package/dist/cjs/loader.cjs.js.map +1 -0
- package/dist/collection/collection-manifest.json +19 -0
- package/dist/collection/components/biel-bot/biel-bot.css +189 -0
- package/dist/collection/components/biel-bot/biel-bot.js +338 -0
- package/dist/collection/components/biel-bot/biel-bot.js.map +1 -0
- package/dist/collection/components/biel-button/biel-button.css +63 -0
- package/dist/collection/components/biel-button/biel-button.js +301 -0
- package/dist/collection/components/biel-button/biel-button.js.map +1 -0
- package/dist/collection/components/biel-chat/biel-chat.css +75 -0
- package/dist/collection/components/biel-chat/biel-chat.js +119 -0
- package/dist/collection/components/biel-chat/biel-chat.js.map +1 -0
- package/dist/collection/components/biel-header/biel-header.css +49 -0
- package/dist/collection/components/biel-header/biel-header.js +165 -0
- package/dist/collection/components/biel-header/biel-header.js.map +1 -0
- package/dist/collection/components/biel-input/biel-input.css +55 -0
- package/dist/collection/components/biel-input/biel-input.js +164 -0
- package/dist/collection/components/biel-input/biel-input.js.map +1 -0
- package/dist/collection/components/biel-message/biel-message.css +38 -0
- package/dist/collection/components/biel-message/biel-message.js +98 -0
- package/dist/collection/components/biel-message/biel-message.js.map +1 -0
- package/dist/collection/components/biel-table/biel-table.css +37 -0
- package/dist/collection/components/biel-table/biel-table.js +43 -0
- package/dist/collection/components/biel-table/biel-table.js.map +1 -0
- package/dist/collection/components/code-snippet/code-snippet.css +162 -0
- package/dist/collection/components/code-snippet/code-snippet.js +101 -0
- package/dist/collection/components/code-snippet/code-snippet.js.map +1 -0
- package/dist/collection/index.js +11 -0
- package/dist/collection/index.js.map +1 -0
- package/dist/collection/services/biel-service.js +33 -0
- package/dist/collection/services/biel-service.js.map +1 -0
- package/dist/collection/services/biel-websocket-service.js +64 -0
- package/dist/collection/services/biel-websocket-service.js.map +1 -0
- package/dist/collection/utils/utils.js +4 -0
- package/dist/collection/utils/utils.js.map +1 -0
- package/dist/components/biel-bot.d.ts +11 -0
- package/dist/components/biel-bot.js +8 -0
- package/dist/components/biel-bot.js.map +1 -0
- package/dist/components/biel-button.d.ts +11 -0
- package/dist/components/biel-button.js +152 -0
- package/dist/components/biel-button.js.map +1 -0
- package/dist/components/biel-chat.d.ts +11 -0
- package/dist/components/biel-chat.js +8 -0
- package/dist/components/biel-chat.js.map +1 -0
- package/dist/components/biel-header.d.ts +11 -0
- package/dist/components/biel-header.js +8 -0
- package/dist/components/biel-header.js.map +1 -0
- package/dist/components/biel-input.d.ts +11 -0
- package/dist/components/biel-input.js +8 -0
- package/dist/components/biel-input.js.map +1 -0
- package/dist/components/biel-message.d.ts +11 -0
- package/dist/components/biel-message.js +8 -0
- package/dist/components/biel-message.js.map +1 -0
- package/dist/components/biel-table.d.ts +11 -0
- package/dist/components/biel-table.js +8 -0
- package/dist/components/biel-table.js.map +1 -0
- package/dist/components/code-snippet.d.ts +11 -0
- package/dist/components/code-snippet.js +8 -0
- package/dist/components/code-snippet.js.map +1 -0
- package/dist/components/index.d.ts +33 -0
- package/dist/components/index.js +9 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/p-09743aa7.js +88 -0
- package/dist/components/p-09743aa7.js.map +1 -0
- package/dist/components/p-5a2466bd.js +59456 -0
- package/dist/components/p-5a2466bd.js.map +1 -0
- package/dist/components/p-7b8b1ac3.js +1098 -0
- package/dist/components/p-7b8b1ac3.js.map +1 -0
- package/dist/components/p-8e08748d.js +4158 -0
- package/dist/components/p-8e08748d.js.map +1 -0
- package/dist/components/p-b920c67f.js +239 -0
- package/dist/components/p-b920c67f.js.map +1 -0
- package/dist/components/p-c94c3bd6.js +59 -0
- package/dist/components/p-c94c3bd6.js.map +1 -0
- package/dist/components/p-f4016e6d.js +37 -0
- package/dist/components/p-f4016e6d.js.map +1 -0
- package/dist/components/p-fe8bcdeb.js +86 -0
- package/dist/components/p-fe8bcdeb.js.map +1 -0
- package/dist/esm/app-globals-0f993ce5.js +5 -0
- package/dist/esm/app-globals-0f993ce5.js.map +1 -0
- package/dist/esm/biel-bot_8.entry.js +63941 -0
- package/dist/esm/biel-bot_8.entry.js.map +1 -0
- package/dist/esm/biel-search.js +22 -0
- package/dist/esm/biel-search.js.map +1 -0
- package/dist/esm/index-6ad604ca.js +1252 -0
- package/dist/esm/index-6ad604ca.js.map +1 -0
- package/dist/esm/index.js +7 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/loader.js +13 -0
- package/dist/esm/loader.js.map +1 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/types/components/biel-bot/biel-bot.d.ts +35 -0
- package/dist/types/components/biel-button/biel-button.d.ts +23 -0
- package/dist/types/components/biel-chat/biel-chat.d.ts +15 -0
- package/dist/types/components/biel-header/biel-header.d.ts +15 -0
- package/dist/types/components/biel-input/biel-input.d.ts +17 -0
- package/dist/types/components/biel-message/biel-message.d.ts +10 -0
- package/dist/types/components/biel-table/biel-table.d.ts +4 -0
- package/dist/types/components/code-snippet/code-snippet.d.ts +10 -0
- package/dist/types/components.d.ts +248 -0
- package/dist/types/index.d.ts +11 -0
- package/dist/types/services/biel-service.d.ts +11 -0
- package/dist/types/services/biel-websocket-service.d.ts +17 -0
- package/dist/types/stencil-public-runtime.d.ts +1674 -0
- package/dist/types/utils/utils.d.ts +1 -0
- package/loader/cdn.js +1 -0
- package/loader/index.cjs.js +1 -0
- package/loader/index.d.ts +24 -0
- package/loader/index.es2017.js +1 -0
- package/loader/index.js +2 -0
- package/loader/package.json +11 -0
- package/package.json +55 -0
- package/readme.md +22 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"biel-chat.js","mappings":";;;;;;;","names":[],"sources":[],"sourcesContent":[],"version":3}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface BielHeader extends Components.BielHeader, HTMLElement {}
|
|
4
|
+
export const BielHeader: {
|
|
5
|
+
prototype: BielHeader;
|
|
6
|
+
new (): BielHeader;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"biel-header.js","mappings":";;;;;;;","names":[],"sources":[],"sourcesContent":[],"version":3}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface BielInput extends Components.BielInput, HTMLElement {}
|
|
4
|
+
export const BielInput: {
|
|
5
|
+
prototype: BielInput;
|
|
6
|
+
new (): BielInput;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"biel-input.js","mappings":";;;;;;;","names":[],"sources":[],"sourcesContent":[],"version":3}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface BielMessage extends Components.BielMessage, HTMLElement {}
|
|
4
|
+
export const BielMessage: {
|
|
5
|
+
prototype: BielMessage;
|
|
6
|
+
new (): BielMessage;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { B as BielMessage$1, d as defineCustomElement$1 } from './p-8e08748d.js';
|
|
2
|
+
|
|
3
|
+
const BielMessage = BielMessage$1;
|
|
4
|
+
const defineCustomElement = defineCustomElement$1;
|
|
5
|
+
|
|
6
|
+
export { BielMessage, defineCustomElement };
|
|
7
|
+
|
|
8
|
+
//# sourceMappingURL=biel-message.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"biel-message.js","mappings":";;;;;;;","names":[],"sources":[],"sourcesContent":[],"version":3}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface BielTable extends Components.BielTable, HTMLElement {}
|
|
4
|
+
export const BielTable: {
|
|
5
|
+
prototype: BielTable;
|
|
6
|
+
new (): BielTable;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"biel-table.js","mappings":";;;;;;;","names":[],"sources":[],"sourcesContent":[],"version":3}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface CodeSnippet extends Components.CodeSnippet, HTMLElement {}
|
|
4
|
+
export const CodeSnippet: {
|
|
5
|
+
prototype: CodeSnippet;
|
|
6
|
+
new (): CodeSnippet;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { C as CodeSnippet$1, d as defineCustomElement$1 } from './p-5a2466bd.js';
|
|
2
|
+
|
|
3
|
+
const CodeSnippet = CodeSnippet$1;
|
|
4
|
+
const defineCustomElement = defineCustomElement$1;
|
|
5
|
+
|
|
6
|
+
export { CodeSnippet, defineCustomElement };
|
|
7
|
+
|
|
8
|
+
//# sourceMappingURL=code-snippet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"code-snippet.js","mappings":";;;;;;;","names":[],"sources":[],"sourcesContent":[],"version":3}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Get the base path to where the assets can be found. Use "setAssetPath(path)"
|
|
3
|
+
* if the path needs to be customized.
|
|
4
|
+
*/
|
|
5
|
+
export declare const getAssetPath: (path: string) => string;
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Used to manually set the base path where assets can be found.
|
|
9
|
+
* If the script is used as "module", it's recommended to use "import.meta.url",
|
|
10
|
+
* such as "setAssetPath(import.meta.url)". Other options include
|
|
11
|
+
* "setAssetPath(document.currentScript.src)", or using a bundler's replace plugin to
|
|
12
|
+
* dynamically set the path at build time, such as "setAssetPath(process.env.ASSET_PATH)".
|
|
13
|
+
* But do note that this configuration depends on how your script is bundled, or lack of
|
|
14
|
+
* bundling, and where your assets can be loaded from. Additionally custom bundling
|
|
15
|
+
* will have to ensure the static assets are copied to its build directory.
|
|
16
|
+
*/
|
|
17
|
+
export declare const setAssetPath: (path: string) => void;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Used to specify a nonce value that corresponds with an application's CSP.
|
|
21
|
+
* When set, the nonce will be added to all dynamically created script and style tags at runtime.
|
|
22
|
+
* Alternatively, the nonce value can be set on a meta tag in the DOM head
|
|
23
|
+
* (<meta name="csp-nonce" content="{ nonce value here }" />) which
|
|
24
|
+
* will result in the same behavior.
|
|
25
|
+
*/
|
|
26
|
+
export declare const setNonce: (nonce: string) => void
|
|
27
|
+
|
|
28
|
+
export interface SetPlatformOptions {
|
|
29
|
+
raf?: (c: FrameRequestCallback) => number;
|
|
30
|
+
ael?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
|
|
31
|
+
rel?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
|
|
32
|
+
}
|
|
33
|
+
export declare const setPlatformOptions: (opts: SetPlatformOptions) => void;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { g as getAssetPath, s as setAssetPath, a as setNonce, b as setPlatformOptions } from './p-7b8b1ac3.js';
|
|
2
|
+
|
|
3
|
+
function format(first, middle, last) {
|
|
4
|
+
return (first || '') + (middle ? ` ${middle}` : '') + (last ? ` ${last}` : '');
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export { format };
|
|
8
|
+
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"index.js","mappings":";;SAAgB,MAAM,CAAC,KAAa,EAAE,MAAc,EAAE,IAAY;IAChE,OAAO,CAAC,KAAK,IAAI,EAAE,KAAK,MAAM,GAAG,IAAI,MAAM,EAAE,GAAG,EAAE,CAAC,IAAI,IAAI,GAAG,IAAI,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC;AACjF;;;;","names":[],"sources":["src/utils/utils.ts"],"sourcesContent":["export function format(first: string, middle: string, last: string): string {\n return (first || '') + (middle ? ` ${middle}` : '') + (last ? ` ${last}` : '');\n}\n"],"version":3}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { p as proxyCustomElement, H, c as createEvent, h } from './p-7b8b1ac3.js';
|
|
2
|
+
|
|
3
|
+
const bielInputCss = ".biel-input-container{display:flex;align-items:center;padding:10px}.biel-input__textarea{width:100%;max-height:var(--biel-input-textarea-max-height);min-height:var(--biel-input-textarea-min-height);height:var(--biel-input-textarea-min-height);padding:10px;background-color:var(--biel-bot-content-bg-color);color:var(--biel-input-color);border:1px solid var(--biel-input-border-color);border-radius:var(--biel-input-border-radius);margin-right:10px;font-family:var(--biel-input-font-family);font-size:14px;resize:none;overflow-y:hidden}.biel-input__textarea::-webkit-scrollbar{width:8px}.biel-input__textarea::-webkit-scrollbar-thumb{background-color:var(--biel-chat-scrollbar-color);border-radius:10px;border:3px solid transparent}.biel-input__textarea::-webkit-scrollbar-thumb:hover{background-color:var(--biel-chat-scrollbar-hover-color);cursor:auto}.biel-input__button{padding:12px 16px;background-color:var(--biel-input-button-bg-color);color:var(--biel-input-button-color);border:0;border-radius:var(--biel-input-border-radius);cursor:pointer}.biel-input__button:hover{background-color:var(--biel-input-button-hover-bg-color)}.biel-input__button:disabled{background-color:var(--biel-input-button-hover-bg-color);cursor:not-allowed}";
|
|
4
|
+
const BielInputStyle0 = bielInputCss;
|
|
5
|
+
|
|
6
|
+
const BielInput = /*@__PURE__*/ proxyCustomElement(class BielInput extends H {
|
|
7
|
+
constructor() {
|
|
8
|
+
super();
|
|
9
|
+
this.__registerHost();
|
|
10
|
+
this.__attachShadow();
|
|
11
|
+
this.messageSent = createEvent(this, "messageSent", 7);
|
|
12
|
+
this.textareaHeightChanged = createEvent(this, "textareaHeightChanged", 7);
|
|
13
|
+
this.userInput = '';
|
|
14
|
+
this.placeholderText = 'Type your message';
|
|
15
|
+
this.sendButtonText = 'Send';
|
|
16
|
+
this.isDisabled = false;
|
|
17
|
+
}
|
|
18
|
+
handleInputChange(event) {
|
|
19
|
+
this.userInput = event.target.value;
|
|
20
|
+
this.adjustTextareaHeight();
|
|
21
|
+
}
|
|
22
|
+
handleSendMessage() {
|
|
23
|
+
if (this.userInput.trim()) {
|
|
24
|
+
this.messageSent.emit(this.userInput);
|
|
25
|
+
this.userInput = '';
|
|
26
|
+
this.resetTextareaHeight();
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
handleKeyPress(event) {
|
|
30
|
+
if (event.key === 'Enter' && !event.shiftKey && !this.isDisabled) {
|
|
31
|
+
event.preventDefault();
|
|
32
|
+
this.handleSendMessage();
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
getCSSVariable(element, variableName) {
|
|
36
|
+
return getComputedStyle(element).getPropertyValue(variableName);
|
|
37
|
+
}
|
|
38
|
+
adjustTextareaHeight() {
|
|
39
|
+
const textarea = this.el.shadowRoot.querySelector('textarea');
|
|
40
|
+
const minHeight = this.getCSSVariable(textarea, 'min-height');
|
|
41
|
+
const maxHeight = parseInt(this.getCSSVariable(textarea, 'max-height'));
|
|
42
|
+
const padding = parseInt(this.getCSSVariable(textarea, 'padding')) * 2;
|
|
43
|
+
const previousHeight = parseInt(this.getCSSVariable(textarea, 'height'));
|
|
44
|
+
textarea.style.height = minHeight;
|
|
45
|
+
const newHeight = Math.min(textarea.scrollHeight - padding, maxHeight);
|
|
46
|
+
textarea.style.height = `${newHeight}px`;
|
|
47
|
+
textarea.style.overflowY = newHeight >= maxHeight ? 'visible' : 'hidden';
|
|
48
|
+
if (newHeight !== previousHeight) {
|
|
49
|
+
this.textareaHeightChanged.emit(newHeight - previousHeight);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
resetTextareaHeight() {
|
|
53
|
+
const textarea = this.el.shadowRoot.querySelector('textarea');
|
|
54
|
+
const minHeight = parseInt(this.getCSSVariable(textarea, 'min-height'));
|
|
55
|
+
const previousHeight = parseInt(this.getCSSVariable(textarea, 'height'));
|
|
56
|
+
textarea.style.height = `${minHeight}px`;
|
|
57
|
+
textarea.style.overflowY = 'hidden';
|
|
58
|
+
this.textareaHeightChanged.emit(minHeight - previousHeight);
|
|
59
|
+
}
|
|
60
|
+
render() {
|
|
61
|
+
return (h("div", { key: 'f4a75743dcd62fbfa9e9b290055c7d6c5fc9349d', class: "biel-input-container" }, h("textarea", { key: '04b66c0ae0c0b3a0d6534578b40875bfd1a23dc2', class: "biel-input__textarea", placeholder: this.placeholderText, value: this.userInput, onInput: (event) => this.handleInputChange(event), onKeyPress: (event) => this.handleKeyPress(event) }), h("button", { key: '67fecb28b09cf05908704a31c1bdc5fbf68f1c90', class: "biel-input__button", onClick: () => this.handleSendMessage(), disabled: this.isDisabled }, this.sendButtonText)));
|
|
62
|
+
}
|
|
63
|
+
get el() { return this; }
|
|
64
|
+
static get style() { return BielInputStyle0; }
|
|
65
|
+
}, [1, "biel-input", {
|
|
66
|
+
"placeholderText": [1, "placeholder-text"],
|
|
67
|
+
"sendButtonText": [1, "send-button-text"],
|
|
68
|
+
"isDisabled": [4, "is-disabled"],
|
|
69
|
+
"userInput": [32]
|
|
70
|
+
}]);
|
|
71
|
+
function defineCustomElement() {
|
|
72
|
+
if (typeof customElements === "undefined") {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
const components = ["biel-input"];
|
|
76
|
+
components.forEach(tagName => { switch (tagName) {
|
|
77
|
+
case "biel-input":
|
|
78
|
+
if (!customElements.get(tagName)) {
|
|
79
|
+
customElements.define(tagName, BielInput);
|
|
80
|
+
}
|
|
81
|
+
break;
|
|
82
|
+
} });
|
|
83
|
+
}
|
|
84
|
+
defineCustomElement();
|
|
85
|
+
|
|
86
|
+
export { BielInput as B, defineCustomElement as d };
|
|
87
|
+
|
|
88
|
+
//# sourceMappingURL=p-09743aa7.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"p-09743aa7.js","mappings":";;AAAA,MAAM,YAAY,GAAG,stCAAstC,CAAC;AAC5uC,wBAAe,YAAY;;MCMd,SAAS;;;;;;;yBAES,EAAE;+BAIG,mBAA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AC,cAAc,CAAC,KAAK,CAAC,GACvC,EACZ,+DACE,KAAK,EAAC,oBAAoB,EAC1B,OAAO,EAAE,MAAM,IAAI,CAAC,iBAAiB,EAAE,EACvC,QAAQ,EAAE,IAAI,CAAC,UAAU,IAExB,IAAI,CAAC,cAAc,CACb,CACL,EACN;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/biel-input/biel-input.css?tag=biel-input&encapsulation=shadow","src/components/biel-input/biel-input.tsx"],"sourcesContent":[".biel-input-container {\n display: flex;\n align-items: center;\n padding: 10px;\n}\n\n.biel-input__textarea {\n width: 100%;\n max-height: var(--biel-input-textarea-max-height);\n min-height: var(--biel-input-textarea-min-height);\n height: var(--biel-input-textarea-min-height);\n padding: 10px;\n background-color: var(--biel-bot-content-bg-color);\n color: var(--biel-input-color);\n border: 1px solid var(--biel-input-border-color);\n border-radius: var(--biel-input-border-radius);\n margin-right: 10px;\n font-family: var(--biel-input-font-family);\n font-size: 14px;\n resize: none;\n overflow-y: hidden;\n}\n\n.biel-input__textarea::-webkit-scrollbar {\n width: 8px;\n}\n\n.biel-input__textarea::-webkit-scrollbar-thumb {\n background-color: var(--biel-chat-scrollbar-color);\n border-radius: 10px;\n border: 3px solid transparent;\n}\n\n.biel-input__textarea::-webkit-scrollbar-thumb:hover {\n background-color: var(--biel-chat-scrollbar-hover-color);\n cursor: auto;\n}\n\n.biel-input__button {\n padding: 12px 16px;\n background-color: var(--biel-input-button-bg-color);\n color: var(--biel-input-button-color);\n border: 0;\n border-radius: var(--biel-input-border-radius);\n cursor: pointer;\n}\n\n.biel-input__button:hover {\n background-color: var(--biel-input-button-hover-bg-color);\n}\n\n.biel-input__button:disabled {\n background-color: var(--biel-input-button-hover-bg-color);\n cursor: not-allowed;\n}","import { Component, h, State, Event, EventEmitter, Prop, Element } from '@stencil/core';\n\n@Component({\n tag: 'biel-input',\n styleUrl: 'biel-input.css',\n shadow: true\n})\nexport class BielInput {\n\n @State() userInput: string = '';\n @Event() messageSent: EventEmitter<string>;\n @Event() textareaHeightChanged: EventEmitter<number>;\n\n @Prop() placeholderText: string = 'Type your message';\n @Prop() sendButtonText: string = 'Send';\n @Prop() isDisabled: boolean = false;\n\n @Element() el: HTMLElement;\n\n handleInputChange(event) {\n this.userInput = event.target.value;\n this.adjustTextareaHeight();\n }\n\n handleSendMessage() {\n if (this.userInput.trim()) {\n this.messageSent.emit(this.userInput);\n this.userInput = '';\n this.resetTextareaHeight();\n }\n }\n\n handleKeyPress(event) {\n if (event.key === 'Enter' && !event.shiftKey && !this.isDisabled) {\n event.preventDefault();\n this.handleSendMessage();\n }\n }\n\n getCSSVariable(element: HTMLElement, variableName: string): string {\n return getComputedStyle(element).getPropertyValue(variableName);\n }\n\n adjustTextareaHeight() {\n const textarea = this.el.shadowRoot.querySelector('textarea');\n const minHeight = this.getCSSVariable(textarea, 'min-height');\n const maxHeight = parseInt(this.getCSSVariable(textarea, 'max-height'));\n const padding = parseInt(this.getCSSVariable(textarea, 'padding')) * 2;\n\n const previousHeight = parseInt(this.getCSSVariable(textarea, 'height'));\n textarea.style.height = minHeight;\n const newHeight = Math.min(textarea.scrollHeight - padding, maxHeight);\n textarea.style.height = `${newHeight}px`;\n textarea.style.overflowY = newHeight >= maxHeight ? 'visible' : 'hidden';\n\n if (newHeight !== previousHeight) {\n this.textareaHeightChanged.emit(newHeight - previousHeight);\n }\n }\n\n resetTextareaHeight() {\n const textarea = this.el.shadowRoot.querySelector('textarea');\n const minHeight = parseInt(this.getCSSVariable(textarea, 'min-height'));\n const previousHeight = parseInt(this.getCSSVariable(textarea, 'height'));\n textarea.style.height = `${minHeight}px`;\n textarea.style.overflowY = 'hidden';\n this.textareaHeightChanged.emit(minHeight - previousHeight);\n }\n\n render() {\n return (\n <div class=\"biel-input-container\">\n <textarea\n class=\"biel-input__textarea\"\n placeholder={this.placeholderText}\n value={this.userInput}\n onInput={(event) => this.handleInputChange(event)}\n onKeyPress={(event) => this.handleKeyPress(event)}\n ></textarea>\n <button\n class=\"biel-input__button\"\n onClick={() => this.handleSendMessage()}\n disabled={this.isDisabled}\n >\n {this.sendButtonText}\n </button>\n </div>\n );\n }\n}"],"version":3}
|