@salla.sa/twilight-components 2.14.267 → 2.14.269
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/cjs/{app-globals-CHVPOl9V.js → app-globals-B7YAF7ga.js} +1 -1
- package/dist/cjs/{filepond-DRd4_s2v.js → filepond-D6XPg5kE.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-poster-DgrI1jkW.js → filepond-plugin-file-poster-Ca3ug6Xt.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-size-DDaoAhJ6.js → filepond-plugin-file-validate-size-DS2Mw0bF.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-type-DEDV1a3V.js → filepond-plugin-file-validate-type-i3PdqD02.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-edit-CPDGO4As.js → filepond-plugin-image-edit-BnJ1hRjZ.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-exif-orientation-BRgevbMC.js → filepond-plugin-image-exif-orientation-eA-6o0CQ.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-preview-DYGUzAm7.js → filepond-plugin-image-preview-rPJIbgJl.js} +1 -1
- package/dist/cjs/{index-C7arMWIB.js → index-CEuiWga2.js} +2 -2
- package/dist/cjs/{index-DXIo87Tk.js → index-m1BoKmuw.js} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/salla-accordion_4.cjs.entry.js +1 -1
- package/dist/cjs/salla-add-product-button_51.cjs.entry.js +35 -19
- package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
- package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
- package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
- package/dist/cjs/salla-booking-field_2.cjs.entry.js +1 -1
- package/dist/cjs/salla-cart-item-offers.cjs.entry.js +1 -1
- package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
- package/dist/cjs/salla-filters-widget.cjs.entry.js +1 -1
- package/dist/cjs/salla-filters.cjs.entry.js +1 -1
- package/dist/cjs/salla-installment.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-program.cjs.entry.js +1 -1
- package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
- package/dist/cjs/salla-notification-item.cjs.entry.js +1 -1
- package/dist/cjs/salla-notifications.cjs.entry.js +1 -1
- package/dist/cjs/salla-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-details.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
- package/dist/cjs/salla-orders.cjs.entry.js +1 -1
- package/dist/cjs/salla-payments.cjs.entry.js +1 -1
- package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
- package/dist/cjs/salla-product-options.cjs.entry.js +1 -1
- package/dist/cjs/salla-review-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-reviews-page.cjs.entry.js +1 -1
- package/dist/cjs/salla-reviews.cjs.entry.js +1 -1
- package/dist/cjs/salla-social.cjs.entry.js +1 -1
- package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-tooltip.cjs.entry.js +1 -1
- package/dist/cjs/salla-verify.cjs.entry.js +1 -1
- package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
- package/dist/cjs/twilight.cjs.js +2 -2
- package/dist/collection/components/salla-add-product-button/salla-add-product-button.js +11 -5
- package/dist/collection/components/salla-login-modal/salla-login-modal.js +15 -5
- package/dist/components/index.js +2 -2
- package/dist/components/salla-add-product-button2.js +11 -5
- package/dist/components/salla-login-modal.js +15 -5
- package/dist/esm/{app-globals-mR93fe4w.js → app-globals-iDxf7CbG.js} +1 -1
- package/dist/esm/{filepond-DjrTyRS6.js → filepond-CkstHAv8.js} +1 -1
- package/dist/esm/{filepond-plugin-file-poster-PEdA9y9p.js → filepond-plugin-file-poster-YjotDtvM.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-size-BRP8EqLj.js → filepond-plugin-file-validate-size-CfYe9saz.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-type-oap4DCYj.js → filepond-plugin-file-validate-type-D11qazvk.js} +1 -1
- package/dist/esm/{filepond-plugin-image-edit-Bvj24IHY.js → filepond-plugin-image-edit-BkSt-Ki1.js} +1 -1
- package/dist/esm/{filepond-plugin-image-exif-orientation-CGcS6jKF.js → filepond-plugin-image-exif-orientation-C2zdDQVD.js} +1 -1
- package/dist/esm/{filepond-plugin-image-preview-Bd3LP9bc.js → filepond-plugin-image-preview-CARveiMV.js} +1 -1
- package/dist/esm/{index-BSp_SAn6.js → index-CW7BJxwK.js} +2 -2
- package/dist/esm/{index-BKlB0LJo.js → index-exk9-UlL.js} +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/salla-accordion_4.entry.js +1 -1
- package/dist/esm/salla-add-product-button_51.entry.js +35 -19
- package/dist/esm/salla-advertisement.entry.js +1 -1
- package/dist/esm/salla-app-install-alert.entry.js +1 -1
- package/dist/esm/salla-apps-icons.entry.js +1 -1
- package/dist/esm/salla-booking-field_2.entry.js +1 -1
- package/dist/esm/salla-cart-item-offers.entry.js +1 -1
- package/dist/esm/salla-conditional-offer.entry.js +1 -1
- package/dist/esm/salla-contacts.entry.js +1 -1
- package/dist/esm/salla-filters-widget.entry.js +1 -1
- package/dist/esm/salla-filters.entry.js +1 -1
- package/dist/esm/salla-installment.entry.js +1 -1
- package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
- package/dist/esm/salla-loyalty-program.entry.js +1 -1
- package/dist/esm/salla-metadata.entry.js +1 -1
- package/dist/esm/salla-notification-item.entry.js +1 -1
- package/dist/esm/salla-notifications.entry.js +1 -1
- package/dist/esm/salla-offer.entry.js +1 -1
- package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
- package/dist/esm/salla-order-details.entry.js +1 -1
- package/dist/esm/salla-order-summary.entry.js +1 -1
- package/dist/esm/salla-orders.entry.js +1 -1
- package/dist/esm/salla-payments.entry.js +1 -1
- package/dist/esm/salla-price-range.entry.js +1 -1
- package/dist/esm/salla-product-options.entry.js +1 -1
- package/dist/esm/salla-review-card.entry.js +1 -1
- package/dist/esm/salla-reviews-page.entry.js +1 -1
- package/dist/esm/salla-reviews.entry.js +1 -1
- package/dist/esm/salla-social.entry.js +1 -1
- package/dist/esm/salla-tiered-offer.entry.js +1 -1
- package/dist/esm/salla-tooltip.entry.js +1 -1
- package/dist/esm/salla-verify.entry.js +1 -1
- package/dist/esm/salla-wallet.entry.js +1 -1
- package/dist/esm/twilight.js +3 -3
- package/dist/twilight/{p-072c6b64.entry.js → p-08965c8a.entry.js} +1 -1
- package/dist/twilight/{p-ba2bad24.entry.js → p-13f3603f.entry.js} +1 -1
- package/dist/twilight/{p-1d103017.entry.js → p-17277556.entry.js} +1 -1
- package/dist/twilight/{p-e5539fc7.entry.js → p-1d9eee8d.entry.js} +1 -1
- package/dist/twilight/{p-ecb77312.entry.js → p-226f53ef.entry.js} +1 -1
- package/dist/twilight/{p-89659f7a.entry.js → p-257420f8.entry.js} +1 -1
- package/dist/twilight/{p-a695e3b6.entry.js → p-2c378384.entry.js} +1 -1
- package/dist/twilight/{p-2c96cfdf.entry.js → p-2cad7c7d.entry.js} +1 -1
- package/dist/twilight/{p-8a783da7.entry.js → p-4cac426a.entry.js} +1 -1
- package/dist/twilight/{p-ad7f62eb.entry.js → p-502eb830.entry.js} +1 -1
- package/dist/twilight/{p-60a093f1.entry.js → p-5b6961cf.entry.js} +1 -1
- package/dist/twilight/{p-8d71342f.entry.js → p-6c518217.entry.js} +1 -1
- package/dist/twilight/{p-71fad6c0.entry.js → p-773aad5f.entry.js} +1 -1
- package/dist/twilight/{p-38b110ac.entry.js → p-7a78935c.entry.js} +1 -1
- package/dist/twilight/{p-0b2a463a.entry.js → p-7c32836f.entry.js} +1 -1
- package/dist/twilight/{p-431a4cd8.entry.js → p-7f7f7eea.entry.js} +1 -1
- package/dist/twilight/{p-f92480a2.entry.js → p-80851455.entry.js} +1 -1
- package/dist/twilight/{p-c4_T7k1X.js → p-B6Gr8Kqx.js} +1 -1
- package/dist/twilight/{p-BSp_SAn6.js → p-CW7BJxwK.js} +2 -2
- package/dist/twilight/{p-C9AUQgJM.js → p-D4IjJ5dP.js} +1 -1
- package/dist/twilight/{p--M0fKW6W.js → p-DICYBv-S.js} +1 -1
- package/dist/twilight/{p-Ba1RIuVG.js → p-DVpUP3Ee.js} +2 -2
- package/dist/twilight/{p-DOUOHu42.js → p-Db6gELNJ.js} +1 -1
- package/dist/twilight/{p-CsGVv0Wz.js → p-Df8sri_v.js} +1 -1
- package/dist/twilight/{p-DvCwaAfs.js → p-DuGXoJuk.js} +1 -1
- package/dist/twilight/{p-d267dd67.entry.js → p-a52a811c.entry.js} +1 -1
- package/dist/twilight/{p-5e6df0f2.entry.js → p-a875574d.entry.js} +1 -1
- package/dist/twilight/{p-33ed545b.entry.js → p-ae3ea336.entry.js} +1 -1
- package/dist/twilight/{p-c40ec87b.entry.js → p-b296aaf2.entry.js} +1 -1
- package/dist/twilight/{p-769a4f2c.entry.js → p-b753e41d.entry.js} +1 -1
- package/dist/twilight/{p-7b764c4d.entry.js → p-bfd2610a.entry.js} +1 -1
- package/dist/twilight/p-cGITsIod.js +9 -0
- package/dist/twilight/{p-8c6f935e.entry.js → p-ceb52fb8.entry.js} +1 -1
- package/dist/twilight/{p-6ae72cb1.entry.js → p-d00dcdc2.entry.js} +1 -1
- package/dist/twilight/{p-43e92061.entry.js → p-d598d23b.entry.js} +1 -1
- package/dist/twilight/p-da626246.entry.js +11 -0
- package/dist/twilight/{p-0f8564ba.entry.js → p-ddcf9b97.entry.js} +1 -1
- package/dist/twilight/{p-8cf1162f.entry.js → p-e51bf0cd.entry.js} +1 -1
- package/dist/twilight/{p-95994e91.entry.js → p-e807c9d9.entry.js} +1 -1
- package/dist/twilight/{p-a97b26d4.entry.js → p-eafec9e8.entry.js} +1 -1
- package/dist/twilight/{p-618cdb9c.entry.js → p-eba7fe7d.entry.js} +1 -1
- package/dist/twilight/{p-275e7747.entry.js → p-f3f7f09f.entry.js} +1 -1
- package/dist/twilight/{p-CfFJPXVG.js → p-t1jwrj3i.js} +1 -1
- package/dist/twilight/twilight.esm.js +1 -1
- package/dist/types/components/salla-add-product-button/salla-add-product-button.d.ts +1 -1
- package/package.json +5 -5
- package/dist/twilight/p-753c0985.entry.js +0 -11
- package/dist/twilight/p-CToUtIYp.js +0 -9
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
*/
|
|
4
4
|
'use strict';
|
|
5
5
|
|
|
6
|
-
var index = require('./index-
|
|
7
|
-
var appGlobals = require('./app-globals-
|
|
6
|
+
var index = require('./index-CEuiWga2.js');
|
|
7
|
+
var appGlobals = require('./app-globals-B7YAF7ga.js');
|
|
8
8
|
|
|
9
9
|
const defineCustomElements = async (win, options) => {
|
|
10
10
|
if (typeof window === 'undefined') return undefined;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
'use strict';
|
|
5
5
|
|
|
6
|
-
var index = require('./index-
|
|
6
|
+
var index = require('./index-CEuiWga2.js');
|
|
7
7
|
var anime_es = require('./anime.es-BqW8JHZi.js');
|
|
8
8
|
var specialDiscount = require('./special-discount-OVG_9Kf9.js');
|
|
9
9
|
var check = require('./check-CLRvuniI.js');
|
|
@@ -109,8 +109,11 @@ const SallaAddProductButton = class {
|
|
|
109
109
|
const optionsEl = document.querySelector(`salla-product-options[product-id="${this.productId}"]`);
|
|
110
110
|
if (optionsEl && typeof optionsEl.validateAndScroll === 'function') {
|
|
111
111
|
return optionsEl.validateAndScroll()
|
|
112
|
-
.then((isValid) => {
|
|
113
|
-
|
|
112
|
+
.then(async (isValid) => {
|
|
113
|
+
// Call validate hook
|
|
114
|
+
const ctx = { isValid, component: this };
|
|
115
|
+
await salla.hooks.call('salla-add-product-button', 'validate', ctx);
|
|
116
|
+
if (!ctx.isValid) {
|
|
114
117
|
this.btn?.enable();
|
|
115
118
|
return;
|
|
116
119
|
}
|
|
@@ -123,7 +126,7 @@ const SallaAddProductButton = class {
|
|
|
123
126
|
// Fallback if options component not found
|
|
124
127
|
return this._proceedAddToCart();
|
|
125
128
|
}
|
|
126
|
-
_proceedAddToCart() {
|
|
129
|
+
async _proceedAddToCart() {
|
|
127
130
|
/**
|
|
128
131
|
* by default the quick add is just an alias for add item function
|
|
129
132
|
* but its work only when the id is the only value is passed via the object
|
|
@@ -135,8 +138,9 @@ const SallaAddProductButton = class {
|
|
|
135
138
|
quantity: this.quantity,
|
|
136
139
|
endpoint: 'quickAdd'
|
|
137
140
|
}).reduce((a, [k, v]) => (v ? (a[k] = v, a) : a), {});
|
|
141
|
+
// Use the potentially modified data
|
|
138
142
|
return salla.cart.addItem(data)
|
|
139
|
-
.then(response => {
|
|
143
|
+
.then(async (response) => {
|
|
140
144
|
this.selectedOptions = [];
|
|
141
145
|
this.btn?.enable();
|
|
142
146
|
this.success.emit(response);
|
|
@@ -216,7 +220,9 @@ const SallaAddProductButton = class {
|
|
|
216
220
|
'w-full': !document.getElementById('fast-checkout-js') || ['financial_support', 'donating'].includes(this.productType) // This is a temporary fix until all themes fully support the fast checkout -- To be removed later
|
|
217
221
|
} }, index.h("salla-button", { color: this.productStatus === 'sale' ? 'primary' : 'light', type: "button", fill: this.productStatus === 'sale' ? 'solid' : 'outline', ref: el => this.btn = el, onClick: event => this.addProductToCart(event), disabled: this.productStatus !== 'sale', ...this.getBtnAttributes(), "loader-position": "center" }, index.h("slot", null)), this.showQuickBuy && !!document.getElementById('fast-checkout-js') && !['financial_support', 'donating'].includes(this.productType) ? this.miniCheckoutWidget() : ''), this.showQuickBuy && this.isApplePayActive ? index.h("salla-quick-buy", { ...this.getQuickBuyBtnAttributes() }) : '');
|
|
218
222
|
}
|
|
219
|
-
componentDidLoad() {
|
|
223
|
+
async componentDidLoad() {
|
|
224
|
+
// Register this component for hooks system, already on it logic to run componentDidLoad trigger
|
|
225
|
+
await Salla.hooks.registerComponent('salla-add-product-button', this);
|
|
220
226
|
if (!this.notifyOptionsAvailability) {
|
|
221
227
|
return;
|
|
222
228
|
}
|
|
@@ -3089,13 +3095,13 @@ const SallaFileUpload = class {
|
|
|
3089
3095
|
return;
|
|
3090
3096
|
try {
|
|
3091
3097
|
const [FilePondModule, FilePondPluginFileValidateSize, FilePondPluginImageExifOrientation, FilePondPluginImagePreview, FilePondPluginImageEdit, FilePondPluginFileValidateType, FilePondPluginFilePoster] = await Promise.all([
|
|
3092
|
-
Promise.resolve().then(function () { return require('./filepond-
|
|
3093
|
-
Promise.resolve().then(function () { return require('./filepond-plugin-file-validate-size-
|
|
3094
|
-
Promise.resolve().then(function () { return require('./filepond-plugin-image-exif-orientation-
|
|
3095
|
-
Promise.resolve().then(function () { return require('./filepond-plugin-image-preview-
|
|
3096
|
-
Promise.resolve().then(function () { return require('./filepond-plugin-image-edit-
|
|
3097
|
-
Promise.resolve().then(function () { return require('./filepond-plugin-file-validate-type-
|
|
3098
|
-
Promise.resolve().then(function () { return require('./filepond-plugin-file-poster-
|
|
3098
|
+
Promise.resolve().then(function () { return require('./filepond-D6XPg5kE.js'); }).then(function (n) { return n.filepond; }),
|
|
3099
|
+
Promise.resolve().then(function () { return require('./filepond-plugin-file-validate-size-DS2Mw0bF.js'); }).then(function (n) { return n.filepondPluginFileValidateSize; }),
|
|
3100
|
+
Promise.resolve().then(function () { return require('./filepond-plugin-image-exif-orientation-eA-6o0CQ.js'); }).then(function (n) { return n.filepondPluginImageExifOrientation; }),
|
|
3101
|
+
Promise.resolve().then(function () { return require('./filepond-plugin-image-preview-rPJIbgJl.js'); }).then(function (n) { return n.filepondPluginImagePreview; }),
|
|
3102
|
+
Promise.resolve().then(function () { return require('./filepond-plugin-image-edit-BnJ1hRjZ.js'); }).then(function (n) { return n.filepondPluginImageEdit; }),
|
|
3103
|
+
Promise.resolve().then(function () { return require('./filepond-plugin-file-validate-type-i3PdqD02.js'); }).then(function (n) { return n.filepondPluginFileValidateType; }),
|
|
3104
|
+
Promise.resolve().then(function () { return require('./filepond-plugin-file-poster-Ca3ug6Xt.js'); }).then(function (n) { return n.filepondPluginFilePoster; })
|
|
3099
3105
|
]);
|
|
3100
3106
|
this.FilePond = FilePondModule;
|
|
3101
3107
|
// Register plugins
|
|
@@ -4510,7 +4516,8 @@ const SallaLoginModal = class {
|
|
|
4510
4516
|
}
|
|
4511
4517
|
async handleIframeStorageAction(value) {
|
|
4512
4518
|
let token, cartUserId = salla.storage.get('cart.user_id');
|
|
4513
|
-
|
|
4519
|
+
let withCartReset = false;
|
|
4520
|
+
Object.entries(value).filter(item => !Salla.storage.get(item[0]))
|
|
4514
4521
|
.forEach(([key, value]) => {
|
|
4515
4522
|
salla.log('Shared storage from accounts domain', key, value);
|
|
4516
4523
|
let cleanedValue = (typeof value === 'string') ? value?.replace(/^"|"$/g, '') : value;
|
|
@@ -4518,17 +4525,26 @@ const SallaLoginModal = class {
|
|
|
4518
4525
|
if (key === 'token') {
|
|
4519
4526
|
token = cleanedValue;
|
|
4520
4527
|
}
|
|
4521
|
-
if (key === 'user' && cartUserId && cleanedValue.id !== cartUserId) {
|
|
4522
|
-
|
|
4528
|
+
if (key === 'user' && cartUserId && (cleanedValue.id !== cartUserId)) {
|
|
4529
|
+
withCartReset = true;
|
|
4523
4530
|
}
|
|
4524
4531
|
});
|
|
4525
4532
|
if (token) {
|
|
4526
4533
|
this.modal.close();
|
|
4527
|
-
|
|
4528
|
-
|
|
4534
|
+
Salla.auth.event.tokenFetched(token);
|
|
4535
|
+
try {
|
|
4536
|
+
await Salla.cart.api.assign();
|
|
4537
|
+
}
|
|
4538
|
+
catch (error) {
|
|
4539
|
+
Salla.log('Error on assign');
|
|
4540
|
+
}
|
|
4541
|
+
await Salla.cart.api.assign();
|
|
4542
|
+
withCartReset && Salla.cart.reset();
|
|
4543
|
+
!Salla.auth.api.isSessionless() && await Salla.auth.api.request('auth/jwt');
|
|
4529
4544
|
setTimeout(() => window.location.reload(), 100);
|
|
4530
4545
|
return;
|
|
4531
4546
|
}
|
|
4547
|
+
withCartReset && Salla.cart.reset();
|
|
4532
4548
|
}
|
|
4533
4549
|
sendMessageToIframe(message) {
|
|
4534
4550
|
if (!this.iframe)
|
|
@@ -10401,7 +10417,7 @@ const SallaTelInput = class {
|
|
|
10401
10417
|
if (this.TelInput)
|
|
10402
10418
|
return;
|
|
10403
10419
|
try {
|
|
10404
|
-
const telInputModule = await Promise.resolve().then(function () { return require('./index-
|
|
10420
|
+
const telInputModule = await Promise.resolve().then(function () { return require('./index-m1BoKmuw.js'); }).then(function (n) { return n.index; });
|
|
10405
10421
|
this.TelInput = telInputModule.default;
|
|
10406
10422
|
}
|
|
10407
10423
|
catch (error) {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
'use strict';
|
|
5
5
|
|
|
6
|
-
var index = require('./index-
|
|
6
|
+
var index = require('./index-CEuiWga2.js');
|
|
7
7
|
|
|
8
8
|
var BookingTime = `<!-- Generated by IcoMoon.io -->
|
|
9
9
|
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
'use strict';
|
|
5
5
|
|
|
6
|
-
var index = require('./index-
|
|
6
|
+
var index = require('./index-CEuiWga2.js');
|
|
7
7
|
|
|
8
8
|
const sallaInstallmentCss = "salla-installment:empty{display:none}#tabbyPromoWrapper{background:white;border-radius:0.375rem;transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);margin-bottom:20px;border:unset !important;font-weight:500}.salla-y #tabbyPromoWrapper{border:1px solid var(--color-grey-dark);border-radius:12px}#tabbyPromoWrapper:hover{box-shadow:0 0 rgba(0, 0, 0, 0), 0 0 rgba(0, 0, 0, 0), 5px 10px 30px rgba(43, 45, 52, 0.0509803922)}#tabbyPromoWrapper #tabbyPromo *{font-family:var(--font-main)}#tabbyPromoWrapper #tabbyPromo>div>div{max-width:none;box-shadow:none;border:none}#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet{max-width:100%;min-height:100px;padding:18px 20px;border:none !important}#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet__text,#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet__link{font-size:var(--font-sm);color:var(--color-text) !important}#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet__link{font-weight:bold}.tabby-promo-wrapper #tabby-promo{font-family:var(--font-main) !important}.tabby-promo-wrapper #tabby-promo .tabby-promo__feature-title{font-size:var(--font-md)}.tabby-promo-wrapper #tabby-promo .tabby-promo__feature-desc{font-size:var(--font-sm);line-height:20px}.tamara-product-widget{margin-bottom:20px}.tamara-product-widget,.spotii-wrapper{min-height:100px;position:relative;color:var(--main-text-color);font-size:var(--font-sm);line-height:1.25;padding:20px 20px 20px 115px !important;background:white;border-radius:0.375rem;transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);border:unset !important;font-family:inherit !important;font-weight:500}.salla-y .tamara-product-widget,.salla-y .spotii-wrapper{border-radius:12px;border:1px solid var(--color-grey-dark)}.tamara-product-widget:hover,.spotii-wrapper:hover{box-shadow:0 0 rgba(0, 0, 0, 0), 0 0 rgba(0, 0, 0, 0), 5px 10px 30px rgba(43, 45, 52, 0.0509803922)}.tamara-product-widget .spotii-logo,.spotii-wrapper .spotii-logo{float:left;margin:0 0 0 -75px}.ltr .tamara-product-widget,.ltr .spotii-wrapper{text-align:left;padding:18px 100px 18px 20px !important}.ltr .tamara-product-widget .spotii-logo,.ltr .spotii-wrapper .spotii-logo{float:right;margin:0 -75px 0 0}.ltr .tamara-product-widget .spotii-product-widget,.ltr .spotii-wrapper .spotii-product-widget{text-align:left !important}.spotii-wrapper{margin-bottom:20px}.spotii-wrapper .spotii-promo{font-size:var(--font-md)}.spotii-wrapper .spotii-product-widget{font-size:var(--font-sm) !important;margin-top:10px}.tamara-product-widget .tamara-logo{position:absolute;left:20px !important;top:35px !important;margin:0 !important;height:24px !important}.ltr .tamara-product-widget .tamara-logo{right:20px !important;left:auto !important}.tamara-product-widget span{font-family:var(--font-main);font-size:var(--font-sm);color:var(--color-text)}.tamara-product-widget span:last-child{display:block;position:relative;margin-top:8px}.tamara-popup__wrap{overflow:auto !important}.s-installment-mispay-wrapper,.s-installment-madfu-wrapper,.s-installment-emkan-wrapper,.s-installment-rajehi-wrapper{font-size:14px;text-align:right;padding:20px;gap:42px;line-height:22px;color:rgb(0, 0, 0);min-width:100%;box-sizing:border-box;position:relative;background-color:white;border-radius:10px;margin:15px 0;display:flex;transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1)}.s-installment-mispay-wrapper:hover,.s-installment-madfu-wrapper:hover,.s-installment-emkan-wrapper:hover,.s-installment-rajehi-wrapper:hover{box-shadow:0 0 rgba(0, 0, 0, 0), 0 0 rgba(0, 0, 0, 0), 5px 10px 30px rgba(43, 45, 52, 0.0509803922)}.s-installment-mispay-content,.s-installment-madfu-content,.s-installment-emkan-content,.s-installment-rajehi-content{display:flex;flex-direction:row-reverse;width:100%;justify-content:space-between;align-items:center;gap:1rem}.s-installment-mispay-content-text,.s-installment-madfu-content-text,.s-installment-emkan-content-text,.s-installment-rajehi-content-text{color:var(--main-text-color);font-size:14px;font-weight:500;margin:0 16px 0 0;width:80%;left:14px;text-align:left}.s-installment-mispay-content img,.s-installment-madfu-content img,.s-installment-emkan-content img,.s-installment-rajehi-content img{height:28px;width:70px;display:inline-block;max-height:100%;vertical-align:middle;fill:none;stroke:unset;width:auto}.rtl .s-installment-mispay-content-text,.rtl .s-installment-madfu-content-text,.rtl .s-installment-emkan-content-text,.rtl .s-installment-rajehi-content-text{right:14px;text-align:right;margin:0 0 0 16px}.rtl .s-installment-mispay-content img,.rtl .s-installment-madfu-content img,.rtl .s-installment-emkan-content img,.rtl .s-installment-rajehi-content img{left:14px !important}.ltr .s-installment-mispay-content img,.ltr .s-installment-madfu-content img,.ltr .s-installment-emkan-content img,.ltr .s-installment-rajehi-content img{right:14px !important}.s-installment-rajehi-content img{width:70px !important;height:40px !important}.s-installment-emkan-content img{height:35px !important}";
|
|
9
9
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
'use strict';
|
|
5
5
|
|
|
6
|
-
var index = require('./index-
|
|
6
|
+
var index = require('./index-CEuiWga2.js');
|
|
7
7
|
var check = require('./check-CLRvuniI.js');
|
|
8
8
|
|
|
9
9
|
var IconStar2 = ` <svg width="18" height="17" view-box="0 0 18 17" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
'use strict';
|
|
5
5
|
|
|
6
|
-
var index = require('./index-
|
|
6
|
+
var index = require('./index-CEuiWga2.js');
|
|
7
7
|
|
|
8
8
|
const sallaTooltipCss = ".s-tooltip-container{position:relative;display:inline-block}.s-tooltip-item{position:absolute;transform:translateX(-39%);background-color:#baf3e6;color:#004d5a;bottom:100%;left:50%;text-align:center;border-radius:5px;z-index:1;white-space:nowrap;opacity:0;transition:opacity 0.3s;pointer-events:none;margin:0 0 16px 8px;padding:12px;max-width:150px;width:190px;white-space:normal;opacity:1}.s-tooltip-item::after{content:\"\";position:absolute;bottom:-10px;left:50%;margin-left:-5px;border-width:5px;border-style:solid;border-color:#baf3e6 transparent transparent transparent}.s-tooltip-item:dir(ltr){transform:translateX(-72%)}";
|
|
9
9
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
'use strict';
|
|
5
5
|
|
|
6
|
-
var index = require('./index-
|
|
6
|
+
var index = require('./index-CEuiWga2.js');
|
|
7
7
|
|
|
8
8
|
const sallaWalletCss = ".s-wallet-table{min-width:100%}.s-wallet-table-balance-container{display:flex !important;align-items:center !important;justify-content:flex-start !important;gap:1rem}.s-wallet-table-balance-icon{border-radius:50%;width:52px;height:52px;font-size:25px;padding:16px 13px;background:var(--color-primary-reverse);color:var(--color-primary)}.s-wallet-table-empty-state{display:flex;flex-direction:column;align-items:center}.s-wallet-table-empty-state i{font-size:80px;margin:4rem 0 2rem;color:var(--infinte-color)}.s-wallet-table-transaction-status{padding:6px 19px !important;border-radius:20px;width:max-content;display:flex;align-items:center}.s-wallet-table-transaction-status-default{background:#fff6eb;color:#a46f29}.s-wallet-table-transaction-status-cashback{background:#effbf6;color:#00af6c}.s-wallet-table-transaction-status-refund{background:#ecf3fe;color:#5196f3}.s-wallet-table-transaction-status-purchase{background:#feecec;color:#f55157}.s-wallet-table-transaction-status-icons-success{color:#00af6c}";
|
|
9
9
|
|
package/dist/cjs/twilight.cjs.js
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
*/
|
|
4
4
|
'use strict';
|
|
5
5
|
|
|
6
|
-
var index = require('./index-
|
|
7
|
-
var appGlobals = require('./app-globals-
|
|
6
|
+
var index = require('./index-CEuiWga2.js');
|
|
7
|
+
var appGlobals = require('./app-globals-B7YAF7ga.js');
|
|
8
8
|
|
|
9
9
|
var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
|
|
10
10
|
/*
|
|
@@ -60,8 +60,11 @@ export class SallaAddProductButton {
|
|
|
60
60
|
const optionsEl = document.querySelector(`salla-product-options[product-id="${this.productId}"]`);
|
|
61
61
|
if (optionsEl && typeof optionsEl.validateAndScroll === 'function') {
|
|
62
62
|
return optionsEl.validateAndScroll()
|
|
63
|
-
.then((isValid) => {
|
|
64
|
-
|
|
63
|
+
.then(async (isValid) => {
|
|
64
|
+
// Call validate hook
|
|
65
|
+
const ctx = { isValid, component: this };
|
|
66
|
+
await salla.hooks.call('salla-add-product-button', 'validate', ctx);
|
|
67
|
+
if (!ctx.isValid) {
|
|
65
68
|
this.btn?.enable();
|
|
66
69
|
return;
|
|
67
70
|
}
|
|
@@ -74,7 +77,7 @@ export class SallaAddProductButton {
|
|
|
74
77
|
// Fallback if options component not found
|
|
75
78
|
return this._proceedAddToCart();
|
|
76
79
|
}
|
|
77
|
-
_proceedAddToCart() {
|
|
80
|
+
async _proceedAddToCart() {
|
|
78
81
|
/**
|
|
79
82
|
* by default the quick add is just an alias for add item function
|
|
80
83
|
* but its work only when the id is the only value is passed via the object
|
|
@@ -86,8 +89,9 @@ export class SallaAddProductButton {
|
|
|
86
89
|
quantity: this.quantity,
|
|
87
90
|
endpoint: 'quickAdd'
|
|
88
91
|
}).reduce((a, [k, v]) => (v ? (a[k] = v, a) : a), {});
|
|
92
|
+
// Use the potentially modified data
|
|
89
93
|
return salla.cart.addItem(data)
|
|
90
|
-
.then(response => {
|
|
94
|
+
.then(async (response) => {
|
|
91
95
|
this.selectedOptions = [];
|
|
92
96
|
this.btn?.enable();
|
|
93
97
|
this.success.emit(response);
|
|
@@ -167,7 +171,9 @@ export class SallaAddProductButton {
|
|
|
167
171
|
'w-full': !document.getElementById('fast-checkout-js') || ['financial_support', 'donating'].includes(this.productType) // This is a temporary fix until all themes fully support the fast checkout -- To be removed later
|
|
168
172
|
} }, h("salla-button", { color: this.productStatus === 'sale' ? 'primary' : 'light', type: "button", fill: this.productStatus === 'sale' ? 'solid' : 'outline', ref: el => this.btn = el, onClick: event => this.addProductToCart(event), disabled: this.productStatus !== 'sale', ...this.getBtnAttributes(), "loader-position": "center" }, h("slot", null)), this.showQuickBuy && !!document.getElementById('fast-checkout-js') && !['financial_support', 'donating'].includes(this.productType) ? this.miniCheckoutWidget() : ''), this.showQuickBuy && this.isApplePayActive ? h("salla-quick-buy", { ...this.getQuickBuyBtnAttributes() }) : '');
|
|
169
173
|
}
|
|
170
|
-
componentDidLoad() {
|
|
174
|
+
async componentDidLoad() {
|
|
175
|
+
// Register this component for hooks system, already on it logic to run componentDidLoad trigger
|
|
176
|
+
await Salla.hooks.registerComponent('salla-add-product-button', this);
|
|
171
177
|
if (!this.notifyOptionsAvailability) {
|
|
172
178
|
return;
|
|
173
179
|
}
|
|
@@ -201,7 +201,8 @@ export class SallaLoginModal {
|
|
|
201
201
|
}
|
|
202
202
|
async handleIframeStorageAction(value) {
|
|
203
203
|
let token, cartUserId = salla.storage.get('cart.user_id');
|
|
204
|
-
|
|
204
|
+
let withCartReset = false;
|
|
205
|
+
Object.entries(value).filter(item => !Salla.storage.get(item[0]))
|
|
205
206
|
.forEach(([key, value]) => {
|
|
206
207
|
salla.log('Shared storage from accounts domain', key, value);
|
|
207
208
|
let cleanedValue = (typeof value === 'string') ? value?.replace(/^"|"$/g, '') : value;
|
|
@@ -209,17 +210,26 @@ export class SallaLoginModal {
|
|
|
209
210
|
if (key === 'token') {
|
|
210
211
|
token = cleanedValue;
|
|
211
212
|
}
|
|
212
|
-
if (key === 'user' && cartUserId && cleanedValue.id !== cartUserId) {
|
|
213
|
-
|
|
213
|
+
if (key === 'user' && cartUserId && (cleanedValue.id !== cartUserId)) {
|
|
214
|
+
withCartReset = true;
|
|
214
215
|
}
|
|
215
216
|
});
|
|
216
217
|
if (token) {
|
|
217
218
|
this.modal.close();
|
|
218
|
-
|
|
219
|
-
|
|
219
|
+
Salla.auth.event.tokenFetched(token);
|
|
220
|
+
try {
|
|
221
|
+
await Salla.cart.api.assign();
|
|
222
|
+
}
|
|
223
|
+
catch (error) {
|
|
224
|
+
Salla.log('Error on assign');
|
|
225
|
+
}
|
|
226
|
+
await Salla.cart.api.assign();
|
|
227
|
+
withCartReset && Salla.cart.reset();
|
|
228
|
+
!Salla.auth.api.isSessionless() && await Salla.auth.api.request('auth/jwt');
|
|
220
229
|
setTimeout(() => window.location.reload(), 100);
|
|
221
230
|
return;
|
|
222
231
|
}
|
|
232
|
+
withCartReset && Salla.cart.reset();
|
|
223
233
|
}
|
|
224
234
|
sendMessageToIframe(message) {
|
|
225
235
|
if (!this.iframe)
|