@jay-framework/wix-stores-v1 0.19.5 → 0.19.6

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.js CHANGED
@@ -450,6 +450,33 @@ function mapVariants(product) {
450
450
  inventoryStatus: variant.stock?.inStock ? StockStatus.IN_STOCK : StockStatus.OUT_OF_STOCK
451
451
  }));
452
452
  }
453
+ function mapSeoHeadTags(product, seoData) {
454
+ const headTags = (seoData?.tags || []).map((tag) => ({
455
+ tag: tag.type || "meta",
456
+ attrs: Object.fromEntries(Object.entries(tag.props || {}).map(([key, value]) => [key, value])),
457
+ children: tag.children || void 0
458
+ }));
459
+ if (!headTags.some((t) => t.tag === "title") && product.name) {
460
+ headTags.push({ tag: "title", children: product.name });
461
+ }
462
+ if (!headTags.some((t) => t.tag === "meta" && t.attrs?.name === "description") && product.description) {
463
+ headTags.push({
464
+ tag: "meta",
465
+ attrs: { name: "description", content: product.description }
466
+ });
467
+ }
468
+ const keywords = seoData?.settings?.keywords;
469
+ if (keywords?.length) {
470
+ const terms = keywords.map((k) => k.term).filter(Boolean);
471
+ if (terms.length) {
472
+ headTags.push({
473
+ tag: "meta",
474
+ attrs: { name: "keywords", content: terms.join(", ") }
475
+ });
476
+ }
477
+ }
478
+ return headTags;
479
+ }
453
480
  async function* loadProductParams([wixStores]) {
454
481
  try {
455
482
  let result = await wixStores.products.queryProducts().find();
@@ -494,6 +521,7 @@ async function renderSlowlyChanging$3(props, wixStores) {
494
521
  // V1 doesn't have modifiers in same format
495
522
  seoData: { tags: [], settings: { preventAutoRedirect: false, keywords: [] } }
496
523
  },
524
+ headTags: mapSeoHeadTags(product, product.seoData),
497
525
  carryForward: {
498
526
  productId: product._id || "",
499
527
  mediaGallery: mapMedia(product),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jay-framework/wix-stores-v1",
3
- "version": "0.19.5",
3
+ "version": "0.19.6",
4
4
  "type": "module",
5
5
  "description": "Wix Stores Catalog V1 API client for Jay Framework",
6
6
  "license": "Apache-2.0",
@@ -35,16 +35,16 @@
35
35
  "test": ":"
36
36
  },
37
37
  "dependencies": {
38
- "@jay-framework/component": "^0.19.5",
39
- "@jay-framework/fullstack-component": "^0.19.5",
40
- "@jay-framework/reactive": "^0.19.5",
41
- "@jay-framework/runtime": "^0.19.5",
42
- "@jay-framework/secure": "^0.19.5",
43
- "@jay-framework/stack-client-runtime": "^0.19.5",
44
- "@jay-framework/stack-server-runtime": "^0.19.5",
45
- "@jay-framework/wix-cart": "^0.19.5",
46
- "@jay-framework/wix-server-client": "^0.19.5",
47
- "@jay-framework/wix-utils": "^0.19.5",
38
+ "@jay-framework/component": "^0.19.6",
39
+ "@jay-framework/fullstack-component": "^0.19.6",
40
+ "@jay-framework/reactive": "^0.19.6",
41
+ "@jay-framework/runtime": "^0.19.6",
42
+ "@jay-framework/secure": "^0.19.6",
43
+ "@jay-framework/stack-client-runtime": "^0.19.6",
44
+ "@jay-framework/stack-server-runtime": "^0.19.6",
45
+ "@jay-framework/wix-cart": "^0.19.6",
46
+ "@jay-framework/wix-server-client": "^0.19.6",
47
+ "@jay-framework/wix-utils": "^0.19.6",
48
48
  "@wix/sdk": "^1.21.5",
49
49
  "@wix/sdk-runtime": "^1.0.11",
50
50
  "@wix/stores": "^1.0.742"
@@ -53,9 +53,9 @@
53
53
  "@babel/core": "^7.23.7",
54
54
  "@babel/preset-env": "^7.23.8",
55
55
  "@babel/preset-typescript": "^7.23.3",
56
- "@jay-framework/compiler-jay-stack": "^0.19.5",
57
- "@jay-framework/jay-cli": "^0.19.5",
58
- "@jay-framework/vite-plugin": "^0.19.5",
56
+ "@jay-framework/compiler-jay-stack": "^0.19.6",
57
+ "@jay-framework/jay-cli": "^0.19.6",
58
+ "@jay-framework/vite-plugin": "^0.19.6",
59
59
  "nodemon": "^3.0.3",
60
60
  "rimraf": "^5.0.5",
61
61
  "tslib": "^2.6.2",
package/plugin.yaml CHANGED
@@ -6,6 +6,9 @@ contracts:
6
6
  contract: product-page.jay-contract
7
7
  component: productPage
8
8
  description: Complete headless product page with server-side rendering (Catalog V1)
9
+ headTags:
10
+ - title
11
+ - meta:description
9
12
  - name: product-search
10
13
  contract: product-search.jay-contract
11
14
  component: productSearch