@blotoutio/providers-shop-gpt-sdk 1.19.0 → 1.20.0

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/index.cjs.js CHANGED
@@ -1907,6 +1907,8 @@ const productItemStyles = i$4 `
1907
1907
  font-family: 'Inter', sans-serif;
1908
1908
  font-size: 16px;
1909
1909
  font-weight: 400;
1910
+ display: flex;
1911
+ height: 100%;
1910
1912
 
1911
1913
  p {
1912
1914
  margin: 0;
@@ -1922,6 +1924,7 @@ const productItemStyles = i$4 `
1922
1924
  gap: 16px;
1923
1925
  cursor: pointer;
1924
1926
  text-decoration: none;
1927
+ flex-grow: 1;
1925
1928
 
1926
1929
  img {
1927
1930
  width: 160px;
@@ -1951,6 +1954,10 @@ const productItemStyles = i$4 `
1951
1954
  }
1952
1955
  }
1953
1956
 
1957
+ .product-info {
1958
+ min-height: 40px;
1959
+ }
1960
+
1954
1961
  .product-name {
1955
1962
  display: -webkit-box;
1956
1963
  max-width: 100%;
@@ -5923,7 +5930,7 @@ class ProductItem extends TWLitElement$3 {
5923
5930
  >
5924
5931
  <img src=${this.product.image.url} alt=${this.product.image.alt} />
5925
5932
  <div class="content">
5926
- <div>
5933
+ <div class="product-info">
5927
5934
  <p
5928
5935
  class="product-name text-slate-800 text-xs font-semibold"
5929
5936
  title=${this.product.title}
@@ -6009,6 +6016,8 @@ const productsListStyles = i$4 `
6009
6016
  flex: 0 0 176px;
6010
6017
  container-type: inline-size;
6011
6018
  container-name: productContainer;
6019
+ display: flex;
6020
+ flex-direction: column;
6012
6021
  }
6013
6022
 
6014
6023
  .products {
@@ -8579,6 +8588,35 @@ const chatSectionStyles = i$4 `
8579
8588
  margin-top: 20px;
8580
8589
  }
8581
8590
 
8591
+ .chat-form textarea.chat-textarea {
8592
+ flex: 1;
8593
+ padding: 10px 38px 12px 38px;
8594
+ font-weight: 500;
8595
+ font-size: 16px;
8596
+ line-height: 20px;
8597
+ color: #201d2f;
8598
+
8599
+ background: #fff;
8600
+ border-radius: 6px;
8601
+ border: 0.5px solid #bbbbce;
8602
+ box-shadow: 0px 4px 10px 0px #0000000d;
8603
+
8604
+ resize: none;
8605
+ overflow: hidden;
8606
+ min-height: 40px;
8607
+ max-height: 160px;
8608
+
8609
+ &:focus {
8610
+ outline-width: 0;
8611
+ }
8612
+
8613
+ &::placeholder {
8614
+ font-weight: 400;
8615
+ font-size: 14px;
8616
+ color: #94a3b8;
8617
+ }
8618
+ }
8619
+
8582
8620
  ${scrollBarStyles}
8583
8621
  `;
8584
8622
 
@@ -8982,9 +9020,14 @@ class PopupView extends TWLitElement$1 {
8982
9020
  }));
8983
9021
  }
8984
9022
  async onSubmit(e) {
8985
- var _a;
8986
9023
  e.preventDefault();
8987
- const message = (_a = this.userQuery) === null || _a === void 0 ? void 0 : _a.trim();
9024
+ const message = this.userQuery;
9025
+ if (!message) {
9026
+ return;
9027
+ }
9028
+ if (this.chatTextareaElement) {
9029
+ this.chatTextareaElement.style.height = 'auto';
9030
+ }
8988
9031
  this.userQuery = '';
8989
9032
  await this.processMessage(e, message, false);
8990
9033
  }
@@ -9165,7 +9208,13 @@ class PopupView extends TWLitElement$1 {
9165
9208
  if (message.sender === 'bot') {
9166
9209
  return this.botMessage(message, index);
9167
9210
  }
9168
- return x ` <div class="message user">${message.message}</div> `;
9211
+ return x `
9212
+ <div class="message user">
9213
+ ${message.message
9214
+ .split('\n')
9215
+ .map((line) => x `<div>${line.trim() === '' ? x `<br />` : line}</div>`)}
9216
+ </div>
9217
+ `;
9169
9218
  })}
9170
9219
  </div>
9171
9220
  `;
@@ -9377,12 +9426,24 @@ class PopupView extends TWLitElement$1 {
9377
9426
  ${this.chatWindow()}
9378
9427
  <form class="chat-form" @submit=${this.onSubmit}>
9379
9428
  <span class="sparkles-icon"> ${sparklesSharp} </span>
9380
- <input
9381
- type="text"
9429
+ <textarea
9430
+ class="chat-textarea"
9382
9431
  .value=${this.userQuery}
9383
- @input=${(e) => (this.userQuery = e.target.value)}
9432
+ rows="1"
9384
9433
  placeholder="What are you looking for?"
9385
- />
9434
+ @input=${(e) => {
9435
+ const target = e.target;
9436
+ target.style.height = 'auto';
9437
+ target.style.height = `${target.scrollHeight}px`;
9438
+ this.userQuery = target.value;
9439
+ }}
9440
+ @keydown=${(e) => {
9441
+ if (e.key === 'Enter' && !e.shiftKey) {
9442
+ e.preventDefault();
9443
+ this.onSubmit(e);
9444
+ }
9445
+ }}
9446
+ ></textarea>
9386
9447
  <button
9387
9448
  class="btn send-btn"
9388
9449
  type="submit"
@@ -9532,6 +9593,10 @@ __decorate([
9532
9593
  e$3('.chat-window'),
9533
9594
  __metadata("design:type", Object)
9534
9595
  ], PopupView.prototype, "chatWindowElement", void 0);
9596
+ __decorate([
9597
+ e$3('.chat-textarea'),
9598
+ __metadata("design:type", Object)
9599
+ ], PopupView.prototype, "chatTextareaElement", void 0);
9535
9600
  __decorate([
9536
9601
  r$1(),
9537
9602
  __metadata("design:type", Object)
package/index.js CHANGED
@@ -1908,6 +1908,8 @@ var ProvidersShopGptSdk = (function () {
1908
1908
  font-family: 'Inter', sans-serif;
1909
1909
  font-size: 16px;
1910
1910
  font-weight: 400;
1911
+ display: flex;
1912
+ height: 100%;
1911
1913
 
1912
1914
  p {
1913
1915
  margin: 0;
@@ -1923,6 +1925,7 @@ var ProvidersShopGptSdk = (function () {
1923
1925
  gap: 16px;
1924
1926
  cursor: pointer;
1925
1927
  text-decoration: none;
1928
+ flex-grow: 1;
1926
1929
 
1927
1930
  img {
1928
1931
  width: 160px;
@@ -1952,6 +1955,10 @@ var ProvidersShopGptSdk = (function () {
1952
1955
  }
1953
1956
  }
1954
1957
 
1958
+ .product-info {
1959
+ min-height: 40px;
1960
+ }
1961
+
1955
1962
  .product-name {
1956
1963
  display: -webkit-box;
1957
1964
  max-width: 100%;
@@ -5924,7 +5931,7 @@ var ProvidersShopGptSdk = (function () {
5924
5931
  >
5925
5932
  <img src=${this.product.image.url} alt=${this.product.image.alt} />
5926
5933
  <div class="content">
5927
- <div>
5934
+ <div class="product-info">
5928
5935
  <p
5929
5936
  class="product-name text-slate-800 text-xs font-semibold"
5930
5937
  title=${this.product.title}
@@ -6010,6 +6017,8 @@ var ProvidersShopGptSdk = (function () {
6010
6017
  flex: 0 0 176px;
6011
6018
  container-type: inline-size;
6012
6019
  container-name: productContainer;
6020
+ display: flex;
6021
+ flex-direction: column;
6013
6022
  }
6014
6023
 
6015
6024
  .products {
@@ -8580,6 +8589,35 @@ ${this.comment ? this.comment : E}</textarea
8580
8589
  margin-top: 20px;
8581
8590
  }
8582
8591
 
8592
+ .chat-form textarea.chat-textarea {
8593
+ flex: 1;
8594
+ padding: 10px 38px 12px 38px;
8595
+ font-weight: 500;
8596
+ font-size: 16px;
8597
+ line-height: 20px;
8598
+ color: #201d2f;
8599
+
8600
+ background: #fff;
8601
+ border-radius: 6px;
8602
+ border: 0.5px solid #bbbbce;
8603
+ box-shadow: 0px 4px 10px 0px #0000000d;
8604
+
8605
+ resize: none;
8606
+ overflow: hidden;
8607
+ min-height: 40px;
8608
+ max-height: 160px;
8609
+
8610
+ &:focus {
8611
+ outline-width: 0;
8612
+ }
8613
+
8614
+ &::placeholder {
8615
+ font-weight: 400;
8616
+ font-size: 14px;
8617
+ color: #94a3b8;
8618
+ }
8619
+ }
8620
+
8583
8621
  ${scrollBarStyles}
8584
8622
  `;
8585
8623
 
@@ -8983,9 +9021,14 @@ ${this.comment ? this.comment : E}</textarea
8983
9021
  }));
8984
9022
  }
8985
9023
  async onSubmit(e) {
8986
- var _a;
8987
9024
  e.preventDefault();
8988
- const message = (_a = this.userQuery) === null || _a === void 0 ? void 0 : _a.trim();
9025
+ const message = this.userQuery;
9026
+ if (!message) {
9027
+ return;
9028
+ }
9029
+ if (this.chatTextareaElement) {
9030
+ this.chatTextareaElement.style.height = 'auto';
9031
+ }
8989
9032
  this.userQuery = '';
8990
9033
  await this.processMessage(e, message, false);
8991
9034
  }
@@ -9166,7 +9209,13 @@ ${this.comment ? this.comment : E}</textarea
9166
9209
  if (message.sender === 'bot') {
9167
9210
  return this.botMessage(message, index);
9168
9211
  }
9169
- return x ` <div class="message user">${message.message}</div> `;
9212
+ return x `
9213
+ <div class="message user">
9214
+ ${message.message
9215
+ .split('\n')
9216
+ .map((line) => x `<div>${line.trim() === '' ? x `<br />` : line}</div>`)}
9217
+ </div>
9218
+ `;
9170
9219
  })}
9171
9220
  </div>
9172
9221
  `;
@@ -9378,12 +9427,24 @@ ${this.comment ? this.comment : E}</textarea
9378
9427
  ${this.chatWindow()}
9379
9428
  <form class="chat-form" @submit=${this.onSubmit}>
9380
9429
  <span class="sparkles-icon"> ${sparklesSharp} </span>
9381
- <input
9382
- type="text"
9430
+ <textarea
9431
+ class="chat-textarea"
9383
9432
  .value=${this.userQuery}
9384
- @input=${(e) => (this.userQuery = e.target.value)}
9433
+ rows="1"
9385
9434
  placeholder="What are you looking for?"
9386
- />
9435
+ @input=${(e) => {
9436
+ const target = e.target;
9437
+ target.style.height = 'auto';
9438
+ target.style.height = `${target.scrollHeight}px`;
9439
+ this.userQuery = target.value;
9440
+ }}
9441
+ @keydown=${(e) => {
9442
+ if (e.key === 'Enter' && !e.shiftKey) {
9443
+ e.preventDefault();
9444
+ this.onSubmit(e);
9445
+ }
9446
+ }}
9447
+ ></textarea>
9387
9448
  <button
9388
9449
  class="btn send-btn"
9389
9450
  type="submit"
@@ -9533,6 +9594,10 @@ ${this.comment ? this.comment : E}</textarea
9533
9594
  e$3('.chat-window'),
9534
9595
  __metadata("design:type", Object)
9535
9596
  ], PopupView.prototype, "chatWindowElement", void 0);
9597
+ __decorate([
9598
+ e$3('.chat-textarea'),
9599
+ __metadata("design:type", Object)
9600
+ ], PopupView.prototype, "chatTextareaElement", void 0);
9536
9601
  __decorate([
9537
9602
  r$1(),
9538
9603
  __metadata("design:type", Object)
package/index.mjs CHANGED
@@ -1905,6 +1905,8 @@ const productItemStyles = i$4 `
1905
1905
  font-family: 'Inter', sans-serif;
1906
1906
  font-size: 16px;
1907
1907
  font-weight: 400;
1908
+ display: flex;
1909
+ height: 100%;
1908
1910
 
1909
1911
  p {
1910
1912
  margin: 0;
@@ -1920,6 +1922,7 @@ const productItemStyles = i$4 `
1920
1922
  gap: 16px;
1921
1923
  cursor: pointer;
1922
1924
  text-decoration: none;
1925
+ flex-grow: 1;
1923
1926
 
1924
1927
  img {
1925
1928
  width: 160px;
@@ -1949,6 +1952,10 @@ const productItemStyles = i$4 `
1949
1952
  }
1950
1953
  }
1951
1954
 
1955
+ .product-info {
1956
+ min-height: 40px;
1957
+ }
1958
+
1952
1959
  .product-name {
1953
1960
  display: -webkit-box;
1954
1961
  max-width: 100%;
@@ -5921,7 +5928,7 @@ class ProductItem extends TWLitElement$3 {
5921
5928
  >
5922
5929
  <img src=${this.product.image.url} alt=${this.product.image.alt} />
5923
5930
  <div class="content">
5924
- <div>
5931
+ <div class="product-info">
5925
5932
  <p
5926
5933
  class="product-name text-slate-800 text-xs font-semibold"
5927
5934
  title=${this.product.title}
@@ -6007,6 +6014,8 @@ const productsListStyles = i$4 `
6007
6014
  flex: 0 0 176px;
6008
6015
  container-type: inline-size;
6009
6016
  container-name: productContainer;
6017
+ display: flex;
6018
+ flex-direction: column;
6010
6019
  }
6011
6020
 
6012
6021
  .products {
@@ -8577,6 +8586,35 @@ const chatSectionStyles = i$4 `
8577
8586
  margin-top: 20px;
8578
8587
  }
8579
8588
 
8589
+ .chat-form textarea.chat-textarea {
8590
+ flex: 1;
8591
+ padding: 10px 38px 12px 38px;
8592
+ font-weight: 500;
8593
+ font-size: 16px;
8594
+ line-height: 20px;
8595
+ color: #201d2f;
8596
+
8597
+ background: #fff;
8598
+ border-radius: 6px;
8599
+ border: 0.5px solid #bbbbce;
8600
+ box-shadow: 0px 4px 10px 0px #0000000d;
8601
+
8602
+ resize: none;
8603
+ overflow: hidden;
8604
+ min-height: 40px;
8605
+ max-height: 160px;
8606
+
8607
+ &:focus {
8608
+ outline-width: 0;
8609
+ }
8610
+
8611
+ &::placeholder {
8612
+ font-weight: 400;
8613
+ font-size: 14px;
8614
+ color: #94a3b8;
8615
+ }
8616
+ }
8617
+
8580
8618
  ${scrollBarStyles}
8581
8619
  `;
8582
8620
 
@@ -8980,9 +9018,14 @@ class PopupView extends TWLitElement$1 {
8980
9018
  }));
8981
9019
  }
8982
9020
  async onSubmit(e) {
8983
- var _a;
8984
9021
  e.preventDefault();
8985
- const message = (_a = this.userQuery) === null || _a === void 0 ? void 0 : _a.trim();
9022
+ const message = this.userQuery;
9023
+ if (!message) {
9024
+ return;
9025
+ }
9026
+ if (this.chatTextareaElement) {
9027
+ this.chatTextareaElement.style.height = 'auto';
9028
+ }
8986
9029
  this.userQuery = '';
8987
9030
  await this.processMessage(e, message, false);
8988
9031
  }
@@ -9163,7 +9206,13 @@ class PopupView extends TWLitElement$1 {
9163
9206
  if (message.sender === 'bot') {
9164
9207
  return this.botMessage(message, index);
9165
9208
  }
9166
- return x ` <div class="message user">${message.message}</div> `;
9209
+ return x `
9210
+ <div class="message user">
9211
+ ${message.message
9212
+ .split('\n')
9213
+ .map((line) => x `<div>${line.trim() === '' ? x `<br />` : line}</div>`)}
9214
+ </div>
9215
+ `;
9167
9216
  })}
9168
9217
  </div>
9169
9218
  `;
@@ -9375,12 +9424,24 @@ class PopupView extends TWLitElement$1 {
9375
9424
  ${this.chatWindow()}
9376
9425
  <form class="chat-form" @submit=${this.onSubmit}>
9377
9426
  <span class="sparkles-icon"> ${sparklesSharp} </span>
9378
- <input
9379
- type="text"
9427
+ <textarea
9428
+ class="chat-textarea"
9380
9429
  .value=${this.userQuery}
9381
- @input=${(e) => (this.userQuery = e.target.value)}
9430
+ rows="1"
9382
9431
  placeholder="What are you looking for?"
9383
- />
9432
+ @input=${(e) => {
9433
+ const target = e.target;
9434
+ target.style.height = 'auto';
9435
+ target.style.height = `${target.scrollHeight}px`;
9436
+ this.userQuery = target.value;
9437
+ }}
9438
+ @keydown=${(e) => {
9439
+ if (e.key === 'Enter' && !e.shiftKey) {
9440
+ e.preventDefault();
9441
+ this.onSubmit(e);
9442
+ }
9443
+ }}
9444
+ ></textarea>
9384
9445
  <button
9385
9446
  class="btn send-btn"
9386
9447
  type="submit"
@@ -9530,6 +9591,10 @@ __decorate([
9530
9591
  e$3('.chat-window'),
9531
9592
  __metadata("design:type", Object)
9532
9593
  ], PopupView.prototype, "chatWindowElement", void 0);
9594
+ __decorate([
9595
+ e$3('.chat-textarea'),
9596
+ __metadata("design:type", Object)
9597
+ ], PopupView.prototype, "chatTextareaElement", void 0);
9533
9598
  __decorate([
9534
9599
  r$1(),
9535
9600
  __metadata("design:type", Object)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blotoutio/providers-shop-gpt-sdk",
3
- "version": "1.19.0",
3
+ "version": "1.20.0",
4
4
  "description": "Shop GPT SDK for EdgeTag",
5
5
  "author": "Blotout",
6
6
  "license": "MIT",