@blotoutio/providers-shop-gpt-sdk 1.22.1 → 1.22.2

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
@@ -5887,6 +5887,19 @@ if (!customElements.get('bt-card-wrapper')) {
5887
5887
 
5888
5888
  const TWLitElement$3 = TW(i$1);
5889
5889
  class ProductItem extends TWLitElement$3 {
5890
+ constructor() {
5891
+ super(...arguments);
5892
+ this.isStylesheetInjected = false;
5893
+ }
5894
+ connectedCallback() {
5895
+ super.connectedCallback();
5896
+ if (!this.isStylesheetInjected && this.css) {
5897
+ const sheet = new CSSStyleSheet();
5898
+ sheet.replaceSync(this.css);
5899
+ this.shadowRoot.adoptedStyleSheets.push(sheet);
5900
+ this.isStylesheetInjected = true;
5901
+ }
5902
+ }
5890
5903
  getLocalPrice(price) {
5891
5904
  if (!this.siteCurrency) {
5892
5905
  return price;
@@ -6036,6 +6049,10 @@ __decorate([
6036
6049
  n$1({ type: String }),
6037
6050
  __metadata("design:type", String)
6038
6051
  ], ProductItem.prototype, "viewType", void 0);
6052
+ __decorate([
6053
+ n$1({ type: String }),
6054
+ __metadata("design:type", String)
6055
+ ], ProductItem.prototype, "css", void 0);
6039
6056
  if (!customElements.get('product-item')) {
6040
6057
  customElements.define('product-item', ProductItem);
6041
6058
  }
@@ -6208,6 +6225,7 @@ class ProductsList extends i$1 {
6208
6225
  .userId=${this.userId}
6209
6226
  .viewType=${this.viewType}
6210
6227
  .metafieldDisplayName=${this.metafieldDisplayName}
6228
+ .css=${this.css}
6211
6229
  ></product-item>
6212
6230
  </div>
6213
6231
  `)}
@@ -6257,6 +6275,10 @@ __decorate([
6257
6275
  n$1({ type: String }),
6258
6276
  __metadata("design:type", String)
6259
6277
  ], ProductsList.prototype, "userId", void 0);
6278
+ __decorate([
6279
+ n$1({ type: String }),
6280
+ __metadata("design:type", String)
6281
+ ], ProductsList.prototype, "css", void 0);
6260
6282
  __decorate([
6261
6283
  r$1(),
6262
6284
  __metadata("design:type", Object)
@@ -6327,6 +6349,7 @@ class ProductsSection extends i$1 {
6327
6349
  .rank=${1}
6328
6350
  .userId=${this.userId}
6329
6351
  .metafieldDisplayName=${this.metafieldDisplayName}
6352
+ .css=${this.css}
6330
6353
  ></product-item>
6331
6354
  </div>
6332
6355
  <span class="line"></span>
@@ -6340,6 +6363,7 @@ class ProductsSection extends i$1 {
6340
6363
  .viewType=${'overlay'}
6341
6364
  .userId=${this.userId}
6342
6365
  .metafieldDisplayName=${this.metafieldDisplayName}
6366
+ .css=${this.css}
6343
6367
  ></products-list>
6344
6368
  </div>
6345
6369
  `;
@@ -7957,6 +7981,7 @@ class ChatSection extends i$1 {
7957
7981
  .rank=${1}
7958
7982
  .userId=${this.userId}
7959
7983
  .metafieldDisplayName=${this.metafieldDisplayName}
7984
+ .css=${this.css}
7960
7985
  @product-rendered=${() => {
7961
7986
  // Scroll to show the product
7962
7987
  this.scrollToBottom();
@@ -9373,6 +9398,7 @@ class PopupView extends TWLitElement$1 {
9373
9398
  .viewType=${this.viewType}
9374
9399
  .userId=${this.userId}
9375
9400
  .metafieldDisplayName=${this.metafieldDisplayName}
9401
+ .css=${this.css}
9376
9402
  @products-rendered=${() => {
9377
9403
  this.scrollToBottom();
9378
9404
  }}
package/index.js CHANGED
@@ -5888,6 +5888,19 @@ var ProvidersShopGptSdk = (function () {
5888
5888
 
5889
5889
  const TWLitElement$3 = TW(i$1);
5890
5890
  class ProductItem extends TWLitElement$3 {
5891
+ constructor() {
5892
+ super(...arguments);
5893
+ this.isStylesheetInjected = false;
5894
+ }
5895
+ connectedCallback() {
5896
+ super.connectedCallback();
5897
+ if (!this.isStylesheetInjected && this.css) {
5898
+ const sheet = new CSSStyleSheet();
5899
+ sheet.replaceSync(this.css);
5900
+ this.shadowRoot.adoptedStyleSheets.push(sheet);
5901
+ this.isStylesheetInjected = true;
5902
+ }
5903
+ }
5891
5904
  getLocalPrice(price) {
5892
5905
  if (!this.siteCurrency) {
5893
5906
  return price;
@@ -6037,6 +6050,10 @@ var ProvidersShopGptSdk = (function () {
6037
6050
  n$1({ type: String }),
6038
6051
  __metadata("design:type", String)
6039
6052
  ], ProductItem.prototype, "viewType", void 0);
6053
+ __decorate([
6054
+ n$1({ type: String }),
6055
+ __metadata("design:type", String)
6056
+ ], ProductItem.prototype, "css", void 0);
6040
6057
  if (!customElements.get('product-item')) {
6041
6058
  customElements.define('product-item', ProductItem);
6042
6059
  }
@@ -6209,6 +6226,7 @@ var ProvidersShopGptSdk = (function () {
6209
6226
  .userId=${this.userId}
6210
6227
  .viewType=${this.viewType}
6211
6228
  .metafieldDisplayName=${this.metafieldDisplayName}
6229
+ .css=${this.css}
6212
6230
  ></product-item>
6213
6231
  </div>
6214
6232
  `)}
@@ -6258,6 +6276,10 @@ var ProvidersShopGptSdk = (function () {
6258
6276
  n$1({ type: String }),
6259
6277
  __metadata("design:type", String)
6260
6278
  ], ProductsList.prototype, "userId", void 0);
6279
+ __decorate([
6280
+ n$1({ type: String }),
6281
+ __metadata("design:type", String)
6282
+ ], ProductsList.prototype, "css", void 0);
6261
6283
  __decorate([
6262
6284
  r$1(),
6263
6285
  __metadata("design:type", Object)
@@ -6328,6 +6350,7 @@ var ProvidersShopGptSdk = (function () {
6328
6350
  .rank=${1}
6329
6351
  .userId=${this.userId}
6330
6352
  .metafieldDisplayName=${this.metafieldDisplayName}
6353
+ .css=${this.css}
6331
6354
  ></product-item>
6332
6355
  </div>
6333
6356
  <span class="line"></span>
@@ -6341,6 +6364,7 @@ var ProvidersShopGptSdk = (function () {
6341
6364
  .viewType=${'overlay'}
6342
6365
  .userId=${this.userId}
6343
6366
  .metafieldDisplayName=${this.metafieldDisplayName}
6367
+ .css=${this.css}
6344
6368
  ></products-list>
6345
6369
  </div>
6346
6370
  `;
@@ -7958,6 +7982,7 @@ ${this.comment ? this.comment : E}</textarea
7958
7982
  .rank=${1}
7959
7983
  .userId=${this.userId}
7960
7984
  .metafieldDisplayName=${this.metafieldDisplayName}
7985
+ .css=${this.css}
7961
7986
  @product-rendered=${() => {
7962
7987
  // Scroll to show the product
7963
7988
  this.scrollToBottom();
@@ -9374,6 +9399,7 @@ ${this.comment ? this.comment : E}</textarea
9374
9399
  .viewType=${this.viewType}
9375
9400
  .userId=${this.userId}
9376
9401
  .metafieldDisplayName=${this.metafieldDisplayName}
9402
+ .css=${this.css}
9377
9403
  @products-rendered=${() => {
9378
9404
  this.scrollToBottom();
9379
9405
  }}
package/index.mjs CHANGED
@@ -5885,6 +5885,19 @@ if (!customElements.get('bt-card-wrapper')) {
5885
5885
 
5886
5886
  const TWLitElement$3 = TW(i$1);
5887
5887
  class ProductItem extends TWLitElement$3 {
5888
+ constructor() {
5889
+ super(...arguments);
5890
+ this.isStylesheetInjected = false;
5891
+ }
5892
+ connectedCallback() {
5893
+ super.connectedCallback();
5894
+ if (!this.isStylesheetInjected && this.css) {
5895
+ const sheet = new CSSStyleSheet();
5896
+ sheet.replaceSync(this.css);
5897
+ this.shadowRoot.adoptedStyleSheets.push(sheet);
5898
+ this.isStylesheetInjected = true;
5899
+ }
5900
+ }
5888
5901
  getLocalPrice(price) {
5889
5902
  if (!this.siteCurrency) {
5890
5903
  return price;
@@ -6034,6 +6047,10 @@ __decorate([
6034
6047
  n$1({ type: String }),
6035
6048
  __metadata("design:type", String)
6036
6049
  ], ProductItem.prototype, "viewType", void 0);
6050
+ __decorate([
6051
+ n$1({ type: String }),
6052
+ __metadata("design:type", String)
6053
+ ], ProductItem.prototype, "css", void 0);
6037
6054
  if (!customElements.get('product-item')) {
6038
6055
  customElements.define('product-item', ProductItem);
6039
6056
  }
@@ -6206,6 +6223,7 @@ class ProductsList extends i$1 {
6206
6223
  .userId=${this.userId}
6207
6224
  .viewType=${this.viewType}
6208
6225
  .metafieldDisplayName=${this.metafieldDisplayName}
6226
+ .css=${this.css}
6209
6227
  ></product-item>
6210
6228
  </div>
6211
6229
  `)}
@@ -6255,6 +6273,10 @@ __decorate([
6255
6273
  n$1({ type: String }),
6256
6274
  __metadata("design:type", String)
6257
6275
  ], ProductsList.prototype, "userId", void 0);
6276
+ __decorate([
6277
+ n$1({ type: String }),
6278
+ __metadata("design:type", String)
6279
+ ], ProductsList.prototype, "css", void 0);
6258
6280
  __decorate([
6259
6281
  r$1(),
6260
6282
  __metadata("design:type", Object)
@@ -6325,6 +6347,7 @@ class ProductsSection extends i$1 {
6325
6347
  .rank=${1}
6326
6348
  .userId=${this.userId}
6327
6349
  .metafieldDisplayName=${this.metafieldDisplayName}
6350
+ .css=${this.css}
6328
6351
  ></product-item>
6329
6352
  </div>
6330
6353
  <span class="line"></span>
@@ -6338,6 +6361,7 @@ class ProductsSection extends i$1 {
6338
6361
  .viewType=${'overlay'}
6339
6362
  .userId=${this.userId}
6340
6363
  .metafieldDisplayName=${this.metafieldDisplayName}
6364
+ .css=${this.css}
6341
6365
  ></products-list>
6342
6366
  </div>
6343
6367
  `;
@@ -7955,6 +7979,7 @@ class ChatSection extends i$1 {
7955
7979
  .rank=${1}
7956
7980
  .userId=${this.userId}
7957
7981
  .metafieldDisplayName=${this.metafieldDisplayName}
7982
+ .css=${this.css}
7958
7983
  @product-rendered=${() => {
7959
7984
  // Scroll to show the product
7960
7985
  this.scrollToBottom();
@@ -9371,6 +9396,7 @@ class PopupView extends TWLitElement$1 {
9371
9396
  .viewType=${this.viewType}
9372
9397
  .userId=${this.userId}
9373
9398
  .metafieldDisplayName=${this.metafieldDisplayName}
9399
+ .css=${this.css}
9374
9400
  @products-rendered=${() => {
9375
9401
  this.scrollToBottom();
9376
9402
  }}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blotoutio/providers-shop-gpt-sdk",
3
- "version": "1.22.1",
3
+ "version": "1.22.2",
4
4
  "description": "Shop GPT SDK for EdgeTag",
5
5
  "author": "Blotout",
6
6
  "license": "MIT",