@griddo/cx 1.75.240 → 1.75.242
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/index.js +1 -1
- package/package.json +3 -3
- package/src/types/pages.ts +5 -2
- package/src/utils/pages.ts +12 -9
package/build/index.js
CHANGED
|
@@ -25,7 +25,7 @@ GFS4: `),console.error(e)});z[Z]||(ws=global[Z]||[],xs(z,ws),z.close=function(e)
|
|
|
25
25
|
\u2502 Access credentials failure \u2502
|
|
26
26
|
\u2502 Check that the login details are correct in your .env file \u2502
|
|
27
27
|
\u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256F
|
|
28
|
-
`)),process.exit(1)}}},Ar=new Kn;var el=K(Yn()),tl=K(gt()),rl=K(Gt());var yp=K(gt()),Vu=K(Gt()),gp=K(gn()),Yu=K(Wu());var Ju="1.75.
|
|
28
|
+
`)),process.exit(1)}}},Ar=new Kn;var el=K(Yn()),tl=K(gt()),rl=K(Gt());var yp=K(gt()),Vu=K(Gt()),gp=K(gn()),Yu=K(Wu());var Ju="1.75.242";Vu.default.config();var vp=!!process.env.GRIDDO_BUILD_LOGS&&!!JSON.parse(process.env.GRIDDO_BUILD_LOGS)||!!process.env.LOGS&&!!JSON.parse(process.env.LOGS);function Ku(e){let t=e.length,r=e.length+2,n=" ".repeat(Math.floor((r-t)/2)),i=`\u256D${"\u2500".repeat(r)}\u256E
|
|
29
29
|
`,s=`
|
|
30
30
|
\u2570${"\u2500".repeat(r)}\u256F`,o=`\u2502${n}${e}${n}\u2502`;console.log(`${i}${o}${s}`)}function fi(e){vp&&console.info(e.replace(/(\s)\s+/g,"$1"))}function Xu(e){return new Promise(t=>setTimeout(t,e))}function Dr(e,t=3){return(e/1e3).toFixed(t)}function hi(e){return"site"in e&&e.site?e?.site:void 0}function di(...e){let t=performance.now();return e.forEach(r=>r()),Dr(performance.now()-t)}function Qu(){let e=`
|
|
31
31
|
\xB7\xB7
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@griddo/cx",
|
|
3
3
|
"description": "Griddo SSG based on Gatsby",
|
|
4
|
-
"version": "1.75.
|
|
4
|
+
"version": "1.75.242",
|
|
5
5
|
"authors": [
|
|
6
6
|
"Álvaro Sánchez' <alvaro.sanches@secuoyas.com>",
|
|
7
7
|
"Diego M. Béjar <diego.bejar@secuoyas.com>",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"react-helmet": "^6.0.0"
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
71
|
-
"@griddo/eslint-config-back": "^1.75.
|
|
71
|
+
"@griddo/eslint-config-back": "^1.75.242",
|
|
72
72
|
"@types/babel__core": "^7.20.0",
|
|
73
73
|
"@types/babel__preset-env": "^7.9.2",
|
|
74
74
|
"@types/csvtojson": "^2.0.0",
|
|
@@ -116,5 +116,5 @@
|
|
|
116
116
|
"publishConfig": {
|
|
117
117
|
"access": "public"
|
|
118
118
|
},
|
|
119
|
-
"gitHead": "
|
|
119
|
+
"gitHead": "4a7e66b02f9a25c498b48fe25327d8ee2d1c56ef"
|
|
120
120
|
}
|
package/src/types/pages.ts
CHANGED
|
@@ -144,7 +144,7 @@ export type GatsbyPageObject = {
|
|
|
144
144
|
};
|
|
145
145
|
|
|
146
146
|
// TODO: JSDoc
|
|
147
|
-
export type
|
|
147
|
+
export type MultiPageElement = {
|
|
148
148
|
component: string;
|
|
149
149
|
title: string | Required<Fields.Heading>;
|
|
150
150
|
elements: Array<Record<string, unknown>>;
|
|
@@ -152,4 +152,7 @@ export type MultiPageElements = Array<{
|
|
|
152
152
|
sectionSlug: string;
|
|
153
153
|
metaTitle: string;
|
|
154
154
|
metaDescription: string;
|
|
155
|
-
}
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
// TODO: JSDoc
|
|
158
|
+
export type MultiPageElements = Array<MultiPageElement>;
|
package/src/utils/pages.ts
CHANGED
|
@@ -4,6 +4,7 @@ import type {
|
|
|
4
4
|
GriddoListPage,
|
|
5
5
|
GriddoMultiPage,
|
|
6
6
|
GriddoSinglePage,
|
|
7
|
+
MultiPageElement,
|
|
7
8
|
MultiPageElements,
|
|
8
9
|
PageAdditionalInfo,
|
|
9
10
|
} from "../types/pages";
|
|
@@ -316,14 +317,10 @@ function createGriddoMultiPagesForGatsby(
|
|
|
316
317
|
JSON.stringify(multiPageElementsBulk)
|
|
317
318
|
);
|
|
318
319
|
|
|
319
|
-
//
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
)
|
|
324
|
-
) {
|
|
325
|
-
// @ts-expect-error ? ? ?
|
|
326
|
-
multiPageElements.push({});
|
|
320
|
+
// Si no hay un elemento sin slug, como mínimo hay que dibujar una página
|
|
321
|
+
// principal para el conjunto de páginas.
|
|
322
|
+
if (!multiPageElements.find(({ sectionSlug }) => sectionSlug === "/")) {
|
|
323
|
+
multiPageElements.push({} as MultiPageElement);
|
|
327
324
|
}
|
|
328
325
|
|
|
329
326
|
// Creates each page based on `multiPageElements` from the schema.
|
|
@@ -341,7 +338,13 @@ function createGriddoMultiPagesForGatsby(
|
|
|
341
338
|
const fullUrl = paginatedPage.fullUrl.endsWith("/")
|
|
342
339
|
? paginatedPage.fullUrl.slice(0, -1)
|
|
343
340
|
: paginatedPage.fullUrl;
|
|
344
|
-
|
|
341
|
+
|
|
342
|
+
const cleanSectionSlug = sectionSlug?.replace(/\//g, "");
|
|
343
|
+
const isRootSlug = sectionSlug === "/";
|
|
344
|
+
const rightSectionSlug = isRootSlug
|
|
345
|
+
? cleanSectionSlug
|
|
346
|
+
: cleanSectionSlug + "/";
|
|
347
|
+
|
|
345
348
|
const slash = compose.endsWith("/") ? "" : "/";
|
|
346
349
|
const newCompose = `${compose}${slash}${rightSectionSlug}`;
|
|
347
350
|
|