@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
|
@@ -30,11 +30,11 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
30
30
|
// context-product-by-slug.ts
|
|
31
31
|
var context_product_by_slug_exports = {};
|
|
32
32
|
__export(context_product_by_slug_exports, {
|
|
33
|
-
NO_PRODUCT_SLUG_ERROR: () =>
|
|
34
|
-
ProductBySlugContextProvider: () =>
|
|
35
|
-
default: () =>
|
|
36
|
-
injectAccessTokenGetter: () =>
|
|
37
|
-
useProductBySlugContext: () =>
|
|
33
|
+
NO_PRODUCT_SLUG_ERROR: () => nu,
|
|
34
|
+
ProductBySlugContextProvider: () => au,
|
|
35
|
+
default: () => au,
|
|
36
|
+
injectAccessTokenGetter: () => ou,
|
|
37
|
+
useProductBySlugContext: () => ru
|
|
38
38
|
});
|
|
39
39
|
module.exports = __toCommonJS(context_product_by_slug_exports);
|
|
40
40
|
|
|
@@ -3399,7 +3399,15 @@ function zl(t2) {
|
|
|
3399
3399
|
}
|
|
3400
3400
|
zl.displayName = `StandaloneProductContextProvider`;
|
|
3401
3401
|
var Bl = q(`@wix/site-service-warmup-data`);
|
|
3402
|
-
|
|
3402
|
+
function Vl() {
|
|
3403
|
+
let e2 = (0, import_services_manager_react.useGetService)(), t2 = (0, import_services_manager_react.useService)(Zc), n2;
|
|
3404
|
+
try {
|
|
3405
|
+
n2 = e2(Qc);
|
|
3406
|
+
} catch {
|
|
3407
|
+
}
|
|
3408
|
+
return n2?.multilingualEnabled && n2.currentLocale?.languageCode || t2.language;
|
|
3409
|
+
}
|
|
3410
|
+
async function Hl(e2, t2, n2) {
|
|
3403
3411
|
let r2 = typeof window > `u`;
|
|
3404
3412
|
if (!r2 && e2) try {
|
|
3405
3413
|
let n3 = await e2.get(t2);
|
|
@@ -3413,73 +3421,73 @@ async function Vl(e2, t2, n2) {
|
|
|
3413
3421
|
}
|
|
3414
3422
|
return i2;
|
|
3415
3423
|
}
|
|
3416
|
-
function
|
|
3417
|
-
let
|
|
3418
|
-
|
|
3424
|
+
function Ul(e2, t2) {
|
|
3425
|
+
let r2 = (0, import_services_manager_react.useGetService)(), i2 = Vl();
|
|
3426
|
+
return (0, import_react.useMemo)(() => {
|
|
3427
|
+
let n2;
|
|
3419
3428
|
try {
|
|
3420
|
-
|
|
3429
|
+
n2 = r2(Bl);
|
|
3421
3430
|
} catch {
|
|
3422
|
-
|
|
3431
|
+
n2 = null;
|
|
3423
3432
|
}
|
|
3424
|
-
return
|
|
3425
|
-
});
|
|
3426
|
-
return r2;
|
|
3433
|
+
return Hl(n2, `${e2}:${i2}`, t2);
|
|
3434
|
+
}, [i2]);
|
|
3427
3435
|
}
|
|
3428
|
-
async function
|
|
3436
|
+
async function Wl() {
|
|
3429
3437
|
return (await si().eq(`defaultLocation`, true).find()).items?.[0]?._id ?? void 0;
|
|
3430
3438
|
}
|
|
3431
|
-
async function
|
|
3439
|
+
async function Gl() {
|
|
3432
3440
|
try {
|
|
3433
3441
|
return (await oa()).settings?.collectionStates?.some((e2) => e2.appId === `215238eb-22a5-4c36-9e7b-e7c08025e04e` && e2.collectingRequests) ?? false;
|
|
3434
3442
|
} catch {
|
|
3435
3443
|
return false;
|
|
3436
3444
|
}
|
|
3437
3445
|
}
|
|
3438
|
-
function
|
|
3446
|
+
function Kl(e2) {
|
|
3439
3447
|
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 }));
|
|
3440
3448
|
}
|
|
3441
|
-
async function
|
|
3442
|
-
return
|
|
3449
|
+
async function ql(e2, t2) {
|
|
3450
|
+
return Kl((await kr().eq(`productId`, e2).eq(`locationId`, t2).find()).items ?? []);
|
|
3443
3451
|
}
|
|
3444
|
-
async function
|
|
3445
|
-
let [t2, n2, r2] = await Promise.all([e2(),
|
|
3452
|
+
async function Jl(e2) {
|
|
3453
|
+
let [t2, n2, r2] = await Promise.all([e2(), Wl(), Gl()]), { product: i2 } = t2;
|
|
3446
3454
|
if (!n2) throw Error(`Location not found`);
|
|
3447
|
-
let [a2, o2] = await Promise.all([
|
|
3455
|
+
let [a2, o2] = await Promise.all([ql(i2.id, n2), i2.productGroupId ? Dl(i2.productGroupId) : void 0]);
|
|
3448
3456
|
return { ...t2, productGroup: o2, inventoryItems: a2, isBackInStockEnabled: r2 };
|
|
3449
3457
|
}
|
|
3450
|
-
function
|
|
3451
|
-
return
|
|
3458
|
+
function Yl(e2, t2) {
|
|
3459
|
+
return Ul(`wixstores-storefront-builder:product-data:${e2}`, () => Jl(t2));
|
|
3452
3460
|
}
|
|
3453
|
-
var
|
|
3461
|
+
var Xl = function(e2) {
|
|
3454
3462
|
return e2.PRODUCT_BY_SLUG = `product-by-slug`, e2.PRODUCT_BY_ID = `product-by-id`, e2.PRODUCT_ITEM = `product-item`, e2;
|
|
3455
3463
|
}({});
|
|
3456
|
-
function
|
|
3464
|
+
function Zl() {
|
|
3457
3465
|
let e2 = (0, import_services_manager_react.useService)(ja);
|
|
3458
|
-
return
|
|
3466
|
+
return Ql(new URL(e2.currentUrl));
|
|
3459
3467
|
}
|
|
3460
|
-
function
|
|
3468
|
+
function Ql(e2) {
|
|
3461
3469
|
return e2.pathname.split(`/`).filter(Boolean).at(-1) || void 0;
|
|
3462
3470
|
}
|
|
3463
|
-
var
|
|
3464
|
-
var
|
|
3465
|
-
function
|
|
3466
|
-
let t2 = (0, import_services_manager_react.useService)(
|
|
3471
|
+
var $l = q(`seo/seo-service`);
|
|
3472
|
+
var eu = q(`@wix/site-service-rendering-context`);
|
|
3473
|
+
function tu(e2) {
|
|
3474
|
+
let t2 = (0, import_services_manager_react.useService)($l), { SSR: n2 } = (0, import_services_manager_react.useService)(eu), i2 = (0, import_react.useRef)(false);
|
|
3467
3475
|
!i2.current && e2.id && n2 && (i2.current = true, t2.setSeoEntity({ itemType: `STORES_PRODUCT`, seoData: e2.seoData ?? {}, itemData: { product: e2 } }).catch(() => {
|
|
3468
3476
|
}));
|
|
3469
3477
|
}
|
|
3470
|
-
var
|
|
3471
|
-
function
|
|
3478
|
+
var nu = `No product slug is available for the product context`;
|
|
3479
|
+
function ru() {
|
|
3472
3480
|
return (0, import_product_context_provider.useProductContext)();
|
|
3473
3481
|
}
|
|
3474
|
-
function
|
|
3482
|
+
function iu({ productPromise: e2 }) {
|
|
3475
3483
|
let { seoProduct: t2 } = kn(e2);
|
|
3476
|
-
return
|
|
3484
|
+
return tu(t2), null;
|
|
3477
3485
|
}
|
|
3478
|
-
function
|
|
3479
|
-
let t2 =
|
|
3480
|
-
return (0, import_jsx_runtime.jsxs)(zl, { productPromise: n2, source:
|
|
3486
|
+
function au({ children: e2 }) {
|
|
3487
|
+
let t2 = Zl(), n2 = Yl(`slug:${t2}`, () => t2 ? Gi(t2) : Promise.reject(Error(nu)));
|
|
3488
|
+
return (0, import_jsx_runtime.jsxs)(zl, { productPromise: n2, source: Xl.PRODUCT_BY_SLUG, children: [(0, import_jsx_runtime.jsx)(iu, { productPromise: n2 }), e2] });
|
|
3481
3489
|
}
|
|
3482
|
-
var
|
|
3490
|
+
var ou = On(`b276b552-68b9-4936-98d5-fbe43c0bd257`);
|
|
3483
3491
|
// Annotate the CommonJS export names for ESM import in node:
|
|
3484
3492
|
0 && (module.exports = {
|
|
3485
3493
|
NO_PRODUCT_SLUG_ERROR,
|