create-plasmic-app 0.0.47 → 0.0.48

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.
@@ -13,7 +13,7 @@ import {
13
13
  InitOptions,
14
14
  ComponentRenderData,`)}
15
15
  } from "@plasmicapp/loader-gatsby";
16
- import { graphql } from "gatsby";
16
+ import { graphql${file_utils_1.ifTs(ts, ", PageProps")} } from "gatsby";
17
17
  import { initPlasmicLoaderWithRegistrations } from "../plasmic-init";
18
18
 
19
19
  export const query = graphql\`
@@ -23,14 +23,14 @@ export const query = graphql\`
23
23
  }
24
24
  \`;
25
25
 
26
- ${file_utils_1.ifTs(ts, `interface PlasmicGatsbyPageProps {
26
+ ${file_utils_1.ifTs(ts, `interface PlasmicGatsbyPageProps extends PageProps {
27
27
  data: {
28
28
  plasmicOptions: InitOptions
29
29
  plasmicComponents: ComponentRenderData
30
30
  }
31
31
  }
32
32
  `)}
33
- const PlasmicGatsbyPage = ({ data }${file_utils_1.ifTs(ts, ": PlasmicGatsbyPageProps")}) => {
33
+ const PlasmicGatsbyPage = ({ data, location }${file_utils_1.ifTs(ts, ": PlasmicGatsbyPageProps")}) => {
34
34
  const {
35
35
  plasmicComponents,
36
36
  plasmicOptions,
@@ -41,6 +41,8 @@ const PlasmicGatsbyPage = ({ data }${file_utils_1.ifTs(ts, ": PlasmicGatsbyPageP
41
41
  <PlasmicRootProvider
42
42
  loader={initPlasmicLoaderWithRegistrations(plasmicOptions)}
43
43
  prefetchedData={plasmicComponents}
44
+ pageParams={pageMeta.params}
45
+ pageQuery={Object.fromEntries(new URLSearchParams(location.search))}
44
46
  >
45
47
  <Helmet>
46
48
  {pageMetadata?.title && <title>{pageMetadata.title}</title>}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-plasmic-app",
3
- "version": "0.0.47",
3
+ "version": "0.0.48",
4
4
  "description": "Create Plasmic-powered React apps",
5
5
  "main": "./dist/lib.js",
6
6
  "types": "./dist/lib.d.ts",
@@ -15,7 +15,7 @@ import {
15
15
  ComponentRenderData,`
16
16
  )}
17
17
  } from "@plasmicapp/loader-gatsby";
18
- import { graphql } from "gatsby";
18
+ import { graphql${ifTs(ts, ", PageProps")} } from "gatsby";
19
19
  import { initPlasmicLoaderWithRegistrations } from "../plasmic-init";
20
20
 
21
21
  export const query = graphql\`
@@ -27,7 +27,7 @@ export const query = graphql\`
27
27
 
28
28
  ${ifTs(
29
29
  ts,
30
- `interface PlasmicGatsbyPageProps {
30
+ `interface PlasmicGatsbyPageProps extends PageProps {
31
31
  data: {
32
32
  plasmicOptions: InitOptions
33
33
  plasmicComponents: ComponentRenderData
@@ -35,7 +35,10 @@ ${ifTs(
35
35
  }
36
36
  `
37
37
  )}
38
- const PlasmicGatsbyPage = ({ data }${ifTs(ts, ": PlasmicGatsbyPageProps")}) => {
38
+ const PlasmicGatsbyPage = ({ data, location }${ifTs(
39
+ ts,
40
+ ": PlasmicGatsbyPageProps"
41
+ )}) => {
39
42
  const {
40
43
  plasmicComponents,
41
44
  plasmicOptions,
@@ -46,6 +49,8 @@ const PlasmicGatsbyPage = ({ data }${ifTs(ts, ": PlasmicGatsbyPageProps")}) => {
46
49
  <PlasmicRootProvider
47
50
  loader={initPlasmicLoaderWithRegistrations(plasmicOptions)}
48
51
  prefetchedData={plasmicComponents}
52
+ pageParams={pageMeta.params}
53
+ pageQuery={Object.fromEntries(new URLSearchParams(location.search))}
49
54
  >
50
55
  <Helmet>
51
56
  {pageMetadata?.title && <title>{pageMetadata.title}</title>}