@revenexx/cover 0.2.34 → 0.2.35

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@revenexx/cover",
3
- "version": "0.2.34",
3
+ "version": "0.2.35",
4
4
  "description": "Cover \u2014 revenexx design system for Nuxt. Distributed as a Nuxt layer: generic UI components, theming tokens and stores shared by the demo shop, custom storefronts and the Blokkli theme.",
5
5
  "type": "module",
6
6
  "main": "./nuxt.config.ts",
@@ -753,6 +753,31 @@ export function renderLiveAttributeValue(
753
753
  * the row out, which is the difference between a German word on an English
754
754
  * page and no answer at all.
755
755
  */
756
+ /**
757
+ * Attributes the product page renders somewhere of its own, so the
758
+ * specification table must not print them a second time.
759
+ *
760
+ * Both are projected out of the locale bucket into the document's own fields —
761
+ * `attribute:locale.name` and `attribute:locale.description` in the products
762
+ * app's `search.json` — and the page reads them from there: `name` is the
763
+ * heading, `description` is the description block above this table. Since the
764
+ * table renders `attribute:locale.*` wholesale, the same two values arrived
765
+ * again as rows, so a product page carried its own name twice and its whole
766
+ * description twice, the second time inside a table of technical data.
767
+ *
768
+ * Deliberately not `short_description`: nothing else on the page renders it,
769
+ * so hiding it here would not stop a repetition, it would drop a value the
770
+ * catalogue maintains. The rule is "this is already on the page", not "this is
771
+ * prose rather than a measurement".
772
+ *
773
+ * By attribute code rather than by the `hidden` flag, because the flag is a
774
+ * property of the attribute (an internal, a media key) while this is a
775
+ * property of the PAGE: the same attribute is the right thing to show in a
776
+ * listing facet or an export, and only this one table is the place it would be
777
+ * a repetition.
778
+ */
779
+ const PAGE_RENDERS_ITSELF = new Set(["name", "description"]);
780
+
756
781
  function mergeLocalizedAttrs(
757
782
  common: Record<string, unknown>,
758
783
  localized: Record<string, unknown>,
@@ -797,6 +822,7 @@ async function buildSpecRows(
797
822
  // `""` and would otherwise render as a row with no value at all.
798
823
  if (Array.isArray(value) && value.length === 0) return false;
799
824
  if (key === "image" || key === logoAttribute) return false;
825
+ if (PAGE_RENDERS_ITSELF.has(key)) return false;
800
826
  return !meta[key]?.hidden;
801
827
  })
802
828
  .map(([key, value]) => {