@griddo/cx 1.57.0 → 1.57.4

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/gatsby-browser.js CHANGED
@@ -1,16 +1,11 @@
1
- import { Page } from './src/components/Page';
1
+ import PageElement from './src/components/PageElement';
2
+
3
+ export const wrapPageElement = PageElement;
2
4
 
3
- export const wrapPageElement = Page;
4
5
  const measurableHeaderSelector = '.griddo-header';
5
6
 
6
7
  export const onRouteUpdate = ({ location }) => {
7
- if (
8
- !window ||
9
- !document ||
10
- !location ||
11
- !location.hash
12
- )
13
- return;
8
+ if (!window || !document || !location || !location.hash) return;
14
9
 
15
10
  const headerHeight =
16
11
  document.querySelector(measurableHeaderSelector)?.offsetHeight || 0;
package/gatsby-node.js CHANGED
@@ -32,7 +32,7 @@ const componentsVersion = getComponentsVersion();
32
32
  // -----------------------------------------------------------------------------
33
33
  // Component System alias
34
34
  // -----------------------------------------------------------------------------
35
- exports.onCreateWebpackConfig = ({ actions, loaders, getConfig }) => {
35
+ exports.onCreateWebpackConfig = ({ actions, plugins, loaders, getConfig }) => {
36
36
  if (isComponentLibraryEnv) {
37
37
  const config = getConfig();
38
38
  config.module.rules = [
@@ -53,7 +53,13 @@ exports.onCreateWebpackConfig = ({ actions, loaders, getConfig }) => {
53
53
  }
54
54
 
55
55
  // Add component-system aliases to Webpack's Resolve:
56
- actions.setWebpackConfig({ resolve: { alias: projectAliases } });
56
+ actions.setWebpackConfig({
57
+ resolve: {
58
+ fallback: { path: require.resolve('path-browserify') },
59
+ alias: projectAliases,
60
+ },
61
+ plugins: [plugins.provide({ process: 'process/browser' })],
62
+ });
57
63
  };
58
64
 
59
65
  // -----------------------------------------------------------------------------
package/gatsby-ssr.js CHANGED
@@ -1,10 +1,10 @@
1
1
  // Gatsby SSR API
2
2
  // https://www.gatsbyjs.com/docs/reference/config-files/gatsby-ssr/
3
3
 
4
- import { Page } from './src/components/Page';
4
+ import { PageElement } from './src/components/PageElement';
5
5
  import { onRenderBody as onRenderBodyFromClient } from 'components';
6
6
 
7
- export const wrapPageElement = Page;
7
+ export const wrapPageElement = PageElement;
8
8
 
9
9
  export const onRenderBody = ({
10
10
  setHeadComponents,
@@ -23,10 +23,10 @@ export const onRenderBody = ({
23
23
  bodyProps,
24
24
  } = onRenderBodyFromClient || {};
25
25
 
26
- setHeadComponents(headComponents);
27
- setPreBodyComponents(preBodyComponents);
28
- setPostBodyComponents(postBodyComponents);
29
- setHtmlAttributes(htmlAttributes);
30
- setBodyAttributes(bodyAttributes);
31
- setBodyProps(bodyProps);
26
+ headComponents && setHeadComponents(headComponents);
27
+ preBodyComponents && setPreBodyComponents(preBodyComponents);
28
+ postBodyComponents && setPostBodyComponents(postBodyComponents);
29
+ htmlAttributes && setHtmlAttributes(htmlAttributes);
30
+ bodyAttributes && setBodyAttributes(bodyAttributes);
31
+ bodyProps && setBodyProps(bodyProps);
32
32
  };
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.57.0",
4
+ "version": "1.57.4",
5
5
  "authors": [
6
6
  "Álvaro Sánchez' <alvaro.sanches@secuoyas.com>",
7
7
  "Carlos Torres <carlos.torres@secuoyas.com>",
@@ -33,6 +33,7 @@
33
33
  "@babel/plugin-proposal-class-properties": "^7.7.4",
34
34
  "@babel/preset-env": "^7.14.5",
35
35
  "@babel/preset-react": "^7.14.5",
36
+ "@babel/preset-typescript": "^7.16.5",
36
37
  "@svgr/webpack": "^5.5.0",
37
38
  "babel-loader": "^8.0.6",
38
39
  "babel-plugin-styled-components": "^1.10.7",
@@ -44,24 +45,26 @@
44
45
  "dotenv": "^8.1.0",
45
46
  "find-up": "^5.0.0",
46
47
  "fs-extra": "^9.0.1",
47
- "gatsby": "^2.4.0",
48
+ "gatsby": "^3.0.0",
48
49
  "gatsby-plugin-canonical-urls": "2.1.6",
49
- "gatsby-plugin-catch-links": "^2.0.0",
50
+ "gatsby-plugin-catch-links": "^3.0.0",
50
51
  "gatsby-plugin-force-trailing-slashes": "^1.0.4",
51
- "gatsby-plugin-no-sourcemaps": "2.2.0",
52
+ "gatsby-plugin-no-sourcemaps": "^3.0.0",
52
53
  "gatsby-plugin-polyfill-io": "1.1.0",
53
- "gatsby-plugin-react-helmet": "3.6.0",
54
+ "gatsby-plugin-react-helmet": "^4.0.0",
54
55
  "gatsby-plugin-react-svg": "^3.0.1",
55
56
  "gatsby-plugin-remove-generator": "^1.1.0",
56
- "gatsby-plugin-styled-components": "3.3.0",
57
+ "gatsby-plugin-styled-components": "^4.0.0",
57
58
  "gatsby-plugin-svgr": "2.1.0",
58
59
  "js2xmlparser": "^4.0.1",
59
60
  "opn": "^6.0.0",
61
+ "path-browserify": "^1.0.1",
60
62
  "pkg-dir": "^5.0.0",
63
+ "process": "^0.11.10",
61
64
  "react-helmet": "^6.0.0"
62
65
  },
63
66
  "devDependencies": {
64
- "@griddo/eslint-config-back": "^1.57.0",
67
+ "@griddo/eslint-config-back": "^1.57.4",
65
68
  "eslint": "^7.5.0",
66
69
  "eslint-plugin-node": "^11.1.0",
67
70
  "eslint-plugin-react": "7.14.3",
@@ -93,5 +96,5 @@
93
96
  "publishConfig": {
94
97
  "access": "public"
95
98
  },
96
- "gitHead": "fe9a8f9481f35021584d79706fd7020c8c87b685"
99
+ "gitHead": "142f38a14e1fa2d555929fc3751f534513238db3"
97
100
  }
@@ -1,11 +1,10 @@
1
- import React from 'react';
1
+ import * as React from 'react';
2
2
  import { providers, translations, cloudinaryDefaults } from 'components';
3
-
4
3
  import { Link } from 'gatsby';
5
4
 
6
5
  const { SiteProvider } = providers;
7
6
 
8
- export const Page = props => {
7
+ export default function Page(props) {
9
8
  const {
10
9
  element,
11
10
  props: {
@@ -22,7 +21,7 @@ export const Page = props => {
22
21
  },
23
22
  } = props;
24
23
 
25
- const mappedTheme = !!theme ? theme : 'default-theme';
24
+ const mappedTheme = !theme ? theme : 'default-theme';
26
25
 
27
26
  return (
28
27
  <SiteProvider
@@ -51,4 +50,4 @@ export const Page = props => {
51
50
  {element}
52
51
  </SiteProvider>
53
52
  );
54
- };
53
+ }
@@ -1,8 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import Seo from './seo';
3
3
  import { core, components, templates } from 'components';
4
-
5
- const { Page } = core;
4
+ const { Page: RenderGriddoPage } = core;
6
5
 
7
6
  export default data => {
8
7
  const {
@@ -24,7 +23,6 @@ export default data => {
24
23
 
25
24
  return (
26
25
  <>
27
- {/* PAGE SEO */}
28
26
  <Seo
29
27
  siteMetadata={siteMetadata}
30
28
  openGraph={openGraph}
@@ -38,8 +36,32 @@ export default data => {
38
36
  showBasicMetaRobots={showBasicMetaRobots}
39
37
  />
40
38
 
41
- {/* PAGE CONTENT */}
42
- <Page
39
+ {/*
40
+
41
+ El componente Page de @griddo/core se encarga de renderizar header,
42
+ footer y los módulos mediante un bucle interno.
43
+
44
+ +---------------------------+ --> +---------------------------+
45
+ | header | | <SiteProvider/> |
46
+ +---------------------------+ --> | <PageProvider/> |
47
+ | template{} | | <Header/> |
48
+ | -> section 0 -> modules[] | --> | |
49
+ | -> section n -> modules[] | | <HeroSection/> |
50
+ +---------------------------+ --> | <Module/> |
51
+ | footer | | |
52
+ +---------------------------+ --> | <MainSection/> |
53
+ | <Module/> |
54
+ | <Module/> |
55
+ | <Module/> |
56
+ | <Module/> |
57
+ | |
58
+ | <Footer/> |
59
+ | <PageProvider/> |
60
+ | <SiteProvider/> |
61
+ +---------------------------+
62
+
63
+ */}
64
+ <RenderGriddoPage
43
65
  content={content}
44
66
  header={header}
45
67
  footer={footer}