@websolutespa/bom-mixer-hooks 1.9.2 → 1.9.3

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/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # @websolutespa/bom-mixer-hooks
2
2
 
3
+ ## 1.9.3
4
+
5
+ ### Patch Changes
6
+
7
+ - 0c7f05f: Modified: useMetaData canonical
8
+ - Updated dependencies [0c7f05f]
9
+ - Updated dependencies [0c7f05f]
10
+ - @websolutespa/bom-mixer-models@1.10.1
11
+ - @websolutespa/bom-core@1.8.23
12
+
3
13
  ## 1.9.2
4
14
 
5
15
  ### Patch Changes
package/dist/index.js CHANGED
@@ -1536,9 +1536,13 @@ function MetaDataProvider({ children, metaData }) {
1536
1536
  const description = (0, import_html_to_text.convert)(((_b = page.meta) == null ? void 0 : _b.description) || page.abstract || "");
1537
1537
  const media = ((_c = page.meta) == null ? void 0 : _c.image) || page.media;
1538
1538
  const image = media ? (0, import_bom_mixer_models.resolveHref)(media.src || media.url) : brand.logo;
1539
- const canonical = (0, import_bom_mixer_models.resolveHref)(page.href);
1539
+ let canonical = (0, import_bom_mixer_models.resolveHref)(page.href);
1540
1540
  const queryIndex = router.asPath.indexOf("?");
1541
- const url = `${canonical}${queryIndex !== -1 ? router.asPath.substring(queryIndex) : ""}`;
1541
+ const query = queryIndex !== -1 ? router.asPath.substring(queryIndex) : "";
1542
+ if (query.match(/^\?pagination\[page\]=(\d+)$/) && query !== "?pagination[page]=1") {
1543
+ canonical = `${canonical}${query}`;
1544
+ }
1545
+ const url = `${canonical}${query}`;
1542
1546
  const alternates = (0, import_react26.useMemo)(() => {
1543
1547
  const alternates2 = [];
1544
1548
  page.alternates.forEach((alternate) => {
@@ -1615,6 +1619,12 @@ function MetaDataProvider({ children, metaData }) {
1615
1619
  },
1616
1620
  url: brand.url
1617
1621
  /*
1622
+ description,
1623
+ founder,
1624
+ foundingDate,
1625
+ numberOfEmployees,
1626
+ */
1627
+ /*
1618
1628
  foundingDate: '2020-01-01',
1619
1629
  numberOfEmployees: {
1620
1630
  '@type': 'QuantitativeValue',
package/dist/index.mjs CHANGED
@@ -1381,9 +1381,13 @@ function MetaDataProvider({ children, metaData }) {
1381
1381
  const description = htmlToText(((_b = page.meta) == null ? void 0 : _b.description) || page.abstract || "");
1382
1382
  const media = ((_c = page.meta) == null ? void 0 : _c.image) || page.media;
1383
1383
  const image = media ? resolveHref(media.src || media.url) : brand.logo;
1384
- const canonical = resolveHref(page.href);
1384
+ let canonical = resolveHref(page.href);
1385
1385
  const queryIndex = router.asPath.indexOf("?");
1386
- const url = `${canonical}${queryIndex !== -1 ? router.asPath.substring(queryIndex) : ""}`;
1386
+ const query = queryIndex !== -1 ? router.asPath.substring(queryIndex) : "";
1387
+ if (query.match(/^\?pagination\[page\]=(\d+)$/) && query !== "?pagination[page]=1") {
1388
+ canonical = `${canonical}${query}`;
1389
+ }
1390
+ const url = `${canonical}${query}`;
1387
1391
  const alternates = useMemo5(() => {
1388
1392
  const alternates2 = [];
1389
1393
  page.alternates.forEach((alternate) => {
@@ -1460,6 +1464,12 @@ function MetaDataProvider({ children, metaData }) {
1460
1464
  },
1461
1465
  url: brand.url
1462
1466
  /*
1467
+ description,
1468
+ founder,
1469
+ foundingDate,
1470
+ numberOfEmployees,
1471
+ */
1472
+ /*
1463
1473
  foundingDate: '2020-01-01',
1464
1474
  numberOfEmployees: {
1465
1475
  '@type': 'QuantitativeValue',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@websolutespa/bom-mixer-hooks",
3
- "version": "1.9.2",
3
+ "version": "1.9.3",
4
4
  "description": "Mixer Hooks module of the BOM Repository",
5
5
  "keywords": [
6
6
  "bom",
@@ -48,9 +48,14 @@ function MetaDataProvider({ children, metaData }: {
48
48
  const description = htmlToText(page.meta?.description || page.abstract || '');
49
49
  const media = ((page.meta as { image: IMedia } | undefined)?.image || page.media);
50
50
  const image = media ? resolveHref(media.src || media.url) : brand.logo;
51
- const canonical = resolveHref(page.href);
51
+ let canonical = resolveHref(page.href);
52
52
  const queryIndex = router.asPath.indexOf('?');
53
- const url = `${canonical}${queryIndex !== -1 ? router.asPath.substring(queryIndex) : ''}`;
53
+ const query = queryIndex !== -1 ? router.asPath.substring(queryIndex) : '';
54
+ if (query.match(/^\?pagination\[page\]=(\d+)$/) && query !== '?pagination[page]=1') {
55
+ canonical = `${canonical}${query}`;
56
+ // title = `${title} - ${query.replace('?pagination[page]=','')}`;
57
+ }
58
+ const url = `${canonical}${query}`;
54
59
  const alternates = useMemo(() => {
55
60
  const alternates: IAlternate[] = [];
56
61
  page.alternates.forEach((alternate: IRoute) => {
@@ -127,6 +132,12 @@ function MetaDataProvider({ children, metaData }: {
127
132
  },
128
133
  url: brand.url,
129
134
  /*
135
+ description,
136
+ founder,
137
+ foundingDate,
138
+ numberOfEmployees,
139
+ */
140
+ /*
130
141
  foundingDate: '2020-01-01',
131
142
  numberOfEmployees: {
132
143
  '@type': 'QuantitativeValue',