@inappstory/slide-api 0.0.26 → 0.0.28

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/dist/index.cjs CHANGED
@@ -15977,6 +15977,8 @@ class WidgetProducts extends WidgetBase {
15977
15977
  localData: {},
15978
15978
  };
15979
15979
  static widgetClassName = "narrative-element-products";
15980
+ themeName;
15981
+ baseThemeName;
15980
15982
  captionView;
15981
15983
  linkTarget = [];
15982
15984
  msgNetworkError;
@@ -15997,6 +15999,15 @@ class WidgetProducts extends WidgetBase {
15997
15999
  catch (e) {
15998
16000
  console.error(e);
15999
16001
  }
16002
+ const themeClasses = Array.from(this.element.classList).filter(item => item.startsWith("theme-") || item.startsWith("base-theme-"));
16003
+ themeClasses.forEach(item => {
16004
+ if (item.startsWith("theme-") && this.themeName == null) {
16005
+ this.themeName = item;
16006
+ }
16007
+ if (item.startsWith("base-theme-") && this.baseThemeName == null) {
16008
+ this.baseThemeName = item;
16009
+ }
16010
+ });
16000
16011
  this.isScreenSupportsTouch = isScreenSupportsTouch(this.env);
16001
16012
  this.msgNetworkError = getTagData(this.element, "msgNetworkError");
16002
16013
  this.msgServiceError = getTagData(this.element, "msgServiceError");
@@ -16310,7 +16321,10 @@ class WidgetProducts extends WidgetBase {
16310
16321
  }
16311
16322
  const card = document.createElement("div");
16312
16323
  card.classList.add("ias-products-card");
16313
- card.onclick = () => {
16324
+ card.onclick = e => {
16325
+ // prevent click in SDK (slide/story navigation)
16326
+ e.stopPropagation();
16327
+ e.preventDefault();
16314
16328
  this._statEventWidgetCardClick(offer);
16315
16329
  if (offer.url) {
16316
16330
  this.sdkApi.openUrl(offer.url);
@@ -16372,6 +16386,12 @@ class WidgetProducts extends WidgetBase {
16372
16386
  createProductsView(offers, onClose) {
16373
16387
  const containerView = document.createElement("div");
16374
16388
  containerView.classList.add("ias-products-container-view");
16389
+ if (this.baseThemeName) {
16390
+ containerView.classList.add(this.baseThemeName);
16391
+ }
16392
+ if (this.themeName) {
16393
+ containerView.classList.add(this.themeName);
16394
+ }
16375
16395
  containerView.dir = this.layoutDirection;
16376
16396
  const backdropView = document.createElement("div");
16377
16397
  backdropView.classList.add("ias-products-container-backdrop-view");