@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 +21 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +21 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -526,6 +526,8 @@ type OfferModel = {
|
|
|
526
526
|
declare class WidgetProducts extends WidgetBase<WidgetProductsOptions> {
|
|
527
527
|
static DEFAULTS: WidgetProductsOptions;
|
|
528
528
|
static widgetClassName: string;
|
|
529
|
+
private themeName;
|
|
530
|
+
private baseThemeName;
|
|
529
531
|
private readonly captionView;
|
|
530
532
|
private readonly linkTarget;
|
|
531
533
|
private readonly msgNetworkError;
|
package/dist/index.d.ts
CHANGED
|
@@ -526,6 +526,8 @@ type OfferModel = {
|
|
|
526
526
|
declare class WidgetProducts extends WidgetBase<WidgetProductsOptions> {
|
|
527
527
|
static DEFAULTS: WidgetProductsOptions;
|
|
528
528
|
static widgetClassName: string;
|
|
529
|
+
private themeName;
|
|
530
|
+
private baseThemeName;
|
|
529
531
|
private readonly captionView;
|
|
530
532
|
private readonly linkTarget;
|
|
531
533
|
private readonly msgNetworkError;
|
package/dist/index.js
CHANGED
|
@@ -15975,6 +15975,8 @@ class WidgetProducts extends WidgetBase {
|
|
|
15975
15975
|
localData: {},
|
|
15976
15976
|
};
|
|
15977
15977
|
static widgetClassName = "narrative-element-products";
|
|
15978
|
+
themeName;
|
|
15979
|
+
baseThemeName;
|
|
15978
15980
|
captionView;
|
|
15979
15981
|
linkTarget = [];
|
|
15980
15982
|
msgNetworkError;
|
|
@@ -15995,6 +15997,15 @@ class WidgetProducts extends WidgetBase {
|
|
|
15995
15997
|
catch (e) {
|
|
15996
15998
|
console.error(e);
|
|
15997
15999
|
}
|
|
16000
|
+
const themeClasses = Array.from(this.element.classList).filter(item => item.startsWith("theme-") || item.startsWith("base-theme-"));
|
|
16001
|
+
themeClasses.forEach(item => {
|
|
16002
|
+
if (item.startsWith("theme-") && this.themeName == null) {
|
|
16003
|
+
this.themeName = item;
|
|
16004
|
+
}
|
|
16005
|
+
if (item.startsWith("base-theme-") && this.baseThemeName == null) {
|
|
16006
|
+
this.baseThemeName = item;
|
|
16007
|
+
}
|
|
16008
|
+
});
|
|
15998
16009
|
this.isScreenSupportsTouch = isScreenSupportsTouch(this.env);
|
|
15999
16010
|
this.msgNetworkError = getTagData(this.element, "msgNetworkError");
|
|
16000
16011
|
this.msgServiceError = getTagData(this.element, "msgServiceError");
|
|
@@ -16308,7 +16319,10 @@ class WidgetProducts extends WidgetBase {
|
|
|
16308
16319
|
}
|
|
16309
16320
|
const card = document.createElement("div");
|
|
16310
16321
|
card.classList.add("ias-products-card");
|
|
16311
|
-
card.onclick =
|
|
16322
|
+
card.onclick = e => {
|
|
16323
|
+
// prevent click in SDK (slide/story navigation)
|
|
16324
|
+
e.stopPropagation();
|
|
16325
|
+
e.preventDefault();
|
|
16312
16326
|
this._statEventWidgetCardClick(offer);
|
|
16313
16327
|
if (offer.url) {
|
|
16314
16328
|
this.sdkApi.openUrl(offer.url);
|
|
@@ -16370,6 +16384,12 @@ class WidgetProducts extends WidgetBase {
|
|
|
16370
16384
|
createProductsView(offers, onClose) {
|
|
16371
16385
|
const containerView = document.createElement("div");
|
|
16372
16386
|
containerView.classList.add("ias-products-container-view");
|
|
16387
|
+
if (this.baseThemeName) {
|
|
16388
|
+
containerView.classList.add(this.baseThemeName);
|
|
16389
|
+
}
|
|
16390
|
+
if (this.themeName) {
|
|
16391
|
+
containerView.classList.add(this.themeName);
|
|
16392
|
+
}
|
|
16373
16393
|
containerView.dir = this.layoutDirection;
|
|
16374
16394
|
const backdropView = document.createElement("div");
|
|
16375
16395
|
backdropView.classList.add("ias-products-container-backdrop-view");
|