@wix/stores 1.0.993 → 1.0.995
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/build/cjs/context-product-by-slug.js +26 -18
- package/build/cjs/context-product-by-slug.js.map +1 -1
- package/build/es/context-product-by-slug.mjs +26 -18
- package/build/es/context-product-by-slug.mjs.map +1 -1
- package/context-runtime/context-product-by-slug/runtime.js +2 -2
- package/package.json +6 -6
|
@@ -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: () => ru,
|
|
34
|
+
ProductBySlugContextProvider: () => ou,
|
|
35
|
+
default: () => ou,
|
|
36
|
+
injectAccessTokenGetter: () => su,
|
|
37
|
+
useProductBySlugContext: () => iu
|
|
38
38
|
});
|
|
39
39
|
module.exports = __toCommonJS(context_product_by_slug_exports);
|
|
40
40
|
|
|
@@ -3466,28 +3466,36 @@ function Zl() {
|
|
|
3466
3466
|
return Ql(new URL(e2.currentUrl));
|
|
3467
3467
|
}
|
|
3468
3468
|
function Ql(e2) {
|
|
3469
|
-
|
|
3469
|
+
let t2 = e2.pathname.split(`/`).filter(Boolean).at(-1);
|
|
3470
|
+
return t2 ? $l(t2) : void 0;
|
|
3470
3471
|
}
|
|
3471
|
-
|
|
3472
|
-
|
|
3473
|
-
|
|
3474
|
-
|
|
3472
|
+
function $l(e2) {
|
|
3473
|
+
try {
|
|
3474
|
+
return decodeURIComponent(e2);
|
|
3475
|
+
} catch {
|
|
3476
|
+
return e2;
|
|
3477
|
+
}
|
|
3478
|
+
}
|
|
3479
|
+
var eu = q(`seo/seo-service`);
|
|
3480
|
+
var tu = q(`@wix/site-service-rendering-context`);
|
|
3481
|
+
function nu(e2) {
|
|
3482
|
+
let t2 = (0, import_services_manager_react.useService)(eu), { SSR: n2 } = (0, import_services_manager_react.useService)(tu), i2 = (0, import_react.useRef)(false);
|
|
3475
3483
|
!i2.current && e2.id && n2 && (i2.current = true, t2.setSeoEntity({ itemType: `STORES_PRODUCT`, seoData: e2.seoData ?? {}, itemData: { product: e2 } }).catch(() => {
|
|
3476
3484
|
}));
|
|
3477
3485
|
}
|
|
3478
|
-
var
|
|
3479
|
-
function
|
|
3486
|
+
var ru = `No product slug is available for the product context`;
|
|
3487
|
+
function iu() {
|
|
3480
3488
|
return (0, import_product_context_provider.useProductContext)();
|
|
3481
3489
|
}
|
|
3482
|
-
function
|
|
3490
|
+
function au({ productPromise: e2 }) {
|
|
3483
3491
|
let { seoProduct: t2 } = kn(e2);
|
|
3484
|
-
return
|
|
3492
|
+
return nu(t2), null;
|
|
3485
3493
|
}
|
|
3486
|
-
function
|
|
3487
|
-
let t2 = Zl(), n2 = Yl(`slug:${t2}`, () => t2 ? Gi(t2) : Promise.reject(Error(
|
|
3488
|
-
return (0, import_jsx_runtime.jsxs)(zl, { productPromise: n2, source: Xl.PRODUCT_BY_SLUG, children: [(0, import_jsx_runtime.jsx)(
|
|
3494
|
+
function ou({ children: e2 }) {
|
|
3495
|
+
let t2 = Zl(), n2 = Yl(`slug:${t2}`, () => t2 ? Gi(t2) : Promise.reject(Error(ru)));
|
|
3496
|
+
return (0, import_jsx_runtime.jsxs)(zl, { productPromise: n2, source: Xl.PRODUCT_BY_SLUG, children: [(0, import_jsx_runtime.jsx)(au, { productPromise: n2 }), e2] });
|
|
3489
3497
|
}
|
|
3490
|
-
var
|
|
3498
|
+
var su = On(`b276b552-68b9-4936-98d5-fbe43c0bd257`);
|
|
3491
3499
|
// Annotate the CommonJS export names for ESM import in node:
|
|
3492
3500
|
0 && (module.exports = {
|
|
3493
3501
|
NO_PRODUCT_SLUG_ERROR,
|