@inappstory/slide-api 0.0.25 → 0.0.27
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 +25 -5
- 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 +25 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
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");
|
|
@@ -16034,7 +16045,7 @@ class WidgetProducts extends WidgetBase {
|
|
|
16034
16045
|
...this.statisticEventBaseFieldsShortForm,
|
|
16035
16046
|
wi: this.elementId,
|
|
16036
16047
|
wl: captionViewText,
|
|
16037
|
-
wv: this.linkTarget,
|
|
16048
|
+
wv: JSON.stringify(this.linkTarget),
|
|
16038
16049
|
}, {
|
|
16039
16050
|
...this.statisticEventBaseFieldsShortForm,
|
|
16040
16051
|
widget_id: this.elementId,
|
|
@@ -16055,8 +16066,8 @@ class WidgetProducts extends WidgetBase {
|
|
|
16055
16066
|
...this.statisticEventBaseFieldsShortForm,
|
|
16056
16067
|
wi: this.elementId,
|
|
16057
16068
|
wl: captionViewText,
|
|
16058
|
-
wv: this.linkTarget,
|
|
16059
|
-
wit: offers.map(item => item.offerId),
|
|
16069
|
+
wv: JSON.stringify(this.linkTarget),
|
|
16070
|
+
wit: JSON.stringify(offers.map(item => item.offerId)),
|
|
16060
16071
|
}, {
|
|
16061
16072
|
...this.statisticEventBaseFieldsShortForm,
|
|
16062
16073
|
widget_id: this.elementId,
|
|
@@ -16273,14 +16284,15 @@ class WidgetProducts extends WidgetBase {
|
|
|
16273
16284
|
const figure = document.createElement("div");
|
|
16274
16285
|
figure.classList.add("ias-products-card-figure");
|
|
16275
16286
|
if (offer.coverUrl) {
|
|
16276
|
-
// todo preload coverImage by fetch, save to offer.coverUrl via createUrl (add revoke)
|
|
16277
|
-
// if cannot fetch - skip caching
|
|
16278
16287
|
const image = document.createElement("img");
|
|
16279
16288
|
image.classList.add("ias-products-card-figure-image");
|
|
16280
16289
|
image.alt = offer.name ?? "";
|
|
16281
16290
|
image.src = offer.coverUrl;
|
|
16282
16291
|
figure.appendChild(image);
|
|
16283
16292
|
}
|
|
16293
|
+
const imageMask = document.createElement("div");
|
|
16294
|
+
imageMask.classList.add("ias-products-card-figure-image-mask");
|
|
16295
|
+
figure.appendChild(imageMask);
|
|
16284
16296
|
// const subTitle = document.createElement("div");
|
|
16285
16297
|
// subTitle.classList.add("ias-products-card-subtitle");
|
|
16286
16298
|
// subTitle.innerText = offer.description ?? "";
|
|
@@ -16371,6 +16383,12 @@ class WidgetProducts extends WidgetBase {
|
|
|
16371
16383
|
createProductsView(offers, onClose) {
|
|
16372
16384
|
const containerView = document.createElement("div");
|
|
16373
16385
|
containerView.classList.add("ias-products-container-view");
|
|
16386
|
+
if (this.baseThemeName) {
|
|
16387
|
+
containerView.classList.add(this.baseThemeName);
|
|
16388
|
+
}
|
|
16389
|
+
if (this.themeName) {
|
|
16390
|
+
containerView.classList.add(this.themeName);
|
|
16391
|
+
}
|
|
16374
16392
|
containerView.dir = this.layoutDirection;
|
|
16375
16393
|
const backdropView = document.createElement("div");
|
|
16376
16394
|
backdropView.classList.add("ias-products-container-backdrop-view");
|
|
@@ -16391,8 +16409,10 @@ class WidgetProducts extends WidgetBase {
|
|
|
16391
16409
|
e.stopPropagation();
|
|
16392
16410
|
onClose();
|
|
16393
16411
|
};
|
|
16412
|
+
const divider = document.createElement("div");
|
|
16394
16413
|
backgroundView.appendChild(scrollView);
|
|
16395
16414
|
backgroundView.appendChild(closeButton);
|
|
16415
|
+
backgroundView.appendChild(divider);
|
|
16396
16416
|
containerView.appendChild(backdropView);
|
|
16397
16417
|
containerView.appendChild(backgroundView);
|
|
16398
16418
|
return containerView;
|