@wix/stores 1.0.977 → 1.0.978
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/_sdk-exports/context-category-by-id/runtime.js +2 -2
- package/_sdk-exports/context-category-by-slug/runtime.js +2 -2
- package/_sdk-exports/context-category-info/runtime.js +2 -2
- package/_sdk-exports/context-product-by-id/runtime.js +2 -2
- package/_sdk-exports/context-product-by-slug/runtime.js +2 -2
- package/_sdk-exports/context-product-item/runtime.js +2 -2
- package/build/cjs/context-category-by-id.js +218 -207
- package/build/cjs/context-category-by-id.js.map +1 -1
- package/build/cjs/context-category-by-slug.js +1202 -1191
- package/build/cjs/context-category-by-slug.js.map +1 -1
- package/build/cjs/context-category-info.js +258 -248
- package/build/cjs/context-category-info.js.map +1 -1
- package/build/cjs/context-product-by-id.js +39 -31
- package/build/cjs/context-product-by-id.js.map +1 -1
- package/build/cjs/context-product-by-slug.js +48 -40
- package/build/cjs/context-product-by-slug.js.map +1 -1
- package/build/cjs/context-product-item.js +1042 -1034
- package/build/cjs/context-product-item.js.map +1 -1
- package/build/es/context-category-by-id.mjs +218 -207
- package/build/es/context-category-by-id.mjs.map +1 -1
- package/build/es/context-category-by-slug.mjs +1202 -1191
- package/build/es/context-category-by-slug.mjs.map +1 -1
- package/build/es/context-category-info.mjs +262 -252
- package/build/es/context-category-info.mjs.map +1 -1
- package/build/es/context-product-by-id.mjs +39 -31
- package/build/es/context-product-by-id.mjs.map +1 -1
- package/build/es/context-product-by-slug.mjs +48 -40
- package/build/es/context-product-by-slug.mjs.map +1 -1
- package/build/es/context-product-item.mjs +1042 -1034
- package/build/es/context-product-item.mjs.map +1 -1
- package/package.json +2 -2
|
@@ -3353,7 +3353,15 @@ function Il(t2) {
|
|
|
3353
3353
|
}
|
|
3354
3354
|
Il.displayName = `StandaloneProductContextProvider`;
|
|
3355
3355
|
var Ll = K(`@wix/site-service-warmup-data`);
|
|
3356
|
-
|
|
3356
|
+
function Rl() {
|
|
3357
|
+
let e2 = o(), t2 = s(Jc), n2;
|
|
3358
|
+
try {
|
|
3359
|
+
n2 = e2(Yc);
|
|
3360
|
+
} catch {
|
|
3361
|
+
}
|
|
3362
|
+
return n2?.multilingualEnabled && n2.currentLocale?.languageCode || t2.language;
|
|
3363
|
+
}
|
|
3364
|
+
async function zl(e2, t2, n2) {
|
|
3357
3365
|
let r2 = typeof window > `u`;
|
|
3358
3366
|
if (!r2 && e2) try {
|
|
3359
3367
|
let n3 = await e2.get(t2);
|
|
@@ -3367,61 +3375,61 @@ async function Rl(e2, t2, n2) {
|
|
|
3367
3375
|
}
|
|
3368
3376
|
return i2;
|
|
3369
3377
|
}
|
|
3370
|
-
function
|
|
3371
|
-
let
|
|
3372
|
-
|
|
3378
|
+
function Bl(e2, t2) {
|
|
3379
|
+
let r2 = o(), i2 = Rl();
|
|
3380
|
+
return n(() => {
|
|
3381
|
+
let n2;
|
|
3373
3382
|
try {
|
|
3374
|
-
|
|
3383
|
+
n2 = r2(Ll);
|
|
3375
3384
|
} catch {
|
|
3376
|
-
|
|
3385
|
+
n2 = null;
|
|
3377
3386
|
}
|
|
3378
|
-
return
|
|
3379
|
-
});
|
|
3380
|
-
return i2;
|
|
3387
|
+
return zl(n2, `${e2}:${i2}`, t2);
|
|
3388
|
+
}, [i2]);
|
|
3381
3389
|
}
|
|
3382
|
-
async function
|
|
3390
|
+
async function Vl() {
|
|
3383
3391
|
return (await ai().eq(`defaultLocation`, true).find()).items?.[0]?._id ?? void 0;
|
|
3384
3392
|
}
|
|
3385
|
-
async function
|
|
3393
|
+
async function Hl() {
|
|
3386
3394
|
try {
|
|
3387
3395
|
return (await ia()).settings?.collectionStates?.some((e2) => e2.appId === `215238eb-22a5-4c36-9e7b-e7c08025e04e` && e2.collectingRequests) ?? false;
|
|
3388
3396
|
} catch {
|
|
3389
3397
|
return false;
|
|
3390
3398
|
}
|
|
3391
3399
|
}
|
|
3392
|
-
function
|
|
3400
|
+
function Ul(e2) {
|
|
3393
3401
|
return e2.map((e3) => ({ variantId: e3.variantId ?? ``, availabilityStatus: e3.availabilityStatus, quantity: e3.quantity ?? void 0, trackQuantity: e3.trackQuantity ?? false, preorderInfo: e3.preorderInfo ? { message: e3.preorderInfo.message ?? void 0, quantity: e3.preorderInfo.quantity ?? void 0 } : void 0 }));
|
|
3394
3402
|
}
|
|
3395
|
-
async function
|
|
3396
|
-
return
|
|
3403
|
+
async function Wl(e2, t2) {
|
|
3404
|
+
return Ul((await Dr().eq(`productId`, e2).eq(`locationId`, t2).find()).items ?? []);
|
|
3397
3405
|
}
|
|
3398
|
-
async function
|
|
3399
|
-
let [t2, n2, r2] = await Promise.all([e2(),
|
|
3406
|
+
async function Gl(e2) {
|
|
3407
|
+
let [t2, n2, r2] = await Promise.all([e2(), Vl(), Hl()]), { product: i2 } = t2;
|
|
3400
3408
|
if (!n2) throw Error(`Location not found`);
|
|
3401
|
-
let [a2, o2] = await Promise.all([
|
|
3409
|
+
let [a2, o2] = await Promise.all([Wl(i2.id, n2), i2.productGroupId ? wl(i2.productGroupId) : void 0]);
|
|
3402
3410
|
return { ...t2, productGroup: o2, inventoryItems: a2, isBackInStockEnabled: r2 };
|
|
3403
3411
|
}
|
|
3404
|
-
function
|
|
3405
|
-
return
|
|
3412
|
+
function Kl(e2, t2) {
|
|
3413
|
+
return Bl(`wixstores-storefront-builder:product-data:${e2}`, () => Gl(t2));
|
|
3406
3414
|
}
|
|
3407
|
-
var
|
|
3415
|
+
var ql = function(e2) {
|
|
3408
3416
|
return e2.PRODUCT_BY_SLUG = `product-by-slug`, e2.PRODUCT_BY_ID = `product-by-id`, e2.PRODUCT_ITEM = `product-item`, e2;
|
|
3409
3417
|
}({});
|
|
3410
|
-
function
|
|
3418
|
+
function Jl() {
|
|
3411
3419
|
return a();
|
|
3412
3420
|
}
|
|
3413
|
-
function Jl({ productId: e2, children: t2 }) {
|
|
3414
|
-
let n2 = Gl(`id:${e2}`, () => Hi(e2));
|
|
3415
|
-
return c(Il, { productPromise: n2, source: Kl.PRODUCT_BY_ID, children: t2 });
|
|
3416
|
-
}
|
|
3417
3421
|
function Yl({ productId: e2, children: t2 }) {
|
|
3418
|
-
|
|
3422
|
+
let n2 = Kl(`id:${e2}`, () => Hi(e2));
|
|
3423
|
+
return c(Il, { productPromise: n2, source: ql.PRODUCT_BY_ID, children: t2 });
|
|
3424
|
+
}
|
|
3425
|
+
function Xl({ productId: e2, children: t2 }) {
|
|
3426
|
+
return e2 ? c(Yl, { productId: e2, children: t2 }, e2) : null;
|
|
3419
3427
|
}
|
|
3420
|
-
var
|
|
3428
|
+
var Zl = Dn(`213f32a8-6f88-4024-a54b-f1264433e878`);
|
|
3421
3429
|
export {
|
|
3422
|
-
|
|
3423
|
-
|
|
3424
|
-
|
|
3425
|
-
|
|
3430
|
+
Xl as ProductByIdContextProvider,
|
|
3431
|
+
Xl as default,
|
|
3432
|
+
Zl as injectAccessTokenGetter,
|
|
3433
|
+
Jl as useProductByIdContext
|
|
3426
3434
|
};
|
|
3427
3435
|
//# sourceMappingURL=context-product-by-id.mjs.map
|