create-plasmic-app 0.0.63 → 0.0.64
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/README.internal.md +6 -2
- package/cpa-out/.gitignore +15 -0
- package/cpa-out/gatsby-codegen-js/gatsby-browser.jsx +11 -0
- package/cpa-out/gatsby-codegen-js/gatsby-config.js +9 -0
- package/cpa-out/gatsby-codegen-js/gatsby-node.js +0 -0
- package/cpa-out/gatsby-codegen-js/gatsby-ssr.jsx +11 -0
- package/cpa-out/gatsby-codegen-js/package.json +26 -0
- package/cpa-out/gatsby-codegen-js/plasmic.json +79 -0
- package/cpa-out/gatsby-codegen-js/src/components/plasmic/create_plasmic_app/PlasmicGlobalVariant__Screen.jsx +29 -0
- package/cpa-out/gatsby-codegen-js/src/components/plasmic/create_plasmic_app/PlasmicHomepage.jsx +206 -0
- package/cpa-out/gatsby-codegen-js/src/pages/404.js +4 -0
- package/cpa-out/gatsby-codegen-js/src/pages/index.jsx +39 -0
- package/cpa-out/gatsby-codegen-ts/gatsby-browser.tsx +11 -0
- package/cpa-out/gatsby-codegen-ts/gatsby-config.ts +14 -0
- package/cpa-out/gatsby-codegen-ts/gatsby-node.ts +0 -0
- package/cpa-out/gatsby-codegen-ts/gatsby-ssr.tsx +11 -0
- package/cpa-out/gatsby-codegen-ts/package.json +34 -0
- package/cpa-out/gatsby-codegen-ts/plasmic.json +79 -0
- package/cpa-out/gatsby-codegen-ts/src/components/plasmic/create_plasmic_app/PlasmicGlobalVariant__Screen.tsx +30 -0
- package/cpa-out/gatsby-codegen-ts/src/components/plasmic/create_plasmic_app/PlasmicHomepage.tsx +290 -0
- package/cpa-out/gatsby-codegen-ts/src/pages/404.js +4 -0
- package/cpa-out/gatsby-codegen-ts/src/pages/index.tsx +41 -0
- package/cpa-out/gatsby-codegen-ts/tsconfig.json +102 -0
- package/cpa-out/gatsby-loader-js/gatsby-config.js +25 -0
- package/cpa-out/gatsby-loader-js/gatsby-node.js +0 -0
- package/cpa-out/gatsby-loader-js/gatsby-ssr.jsx +44 -0
- package/cpa-out/gatsby-loader-js/package.json +24 -0
- package/cpa-out/gatsby-loader-js/src/pages/404.js +4 -0
- package/cpa-out/gatsby-loader-js/src/pages/plasmic-host.jsx +19 -0
- package/cpa-out/gatsby-loader-js/src/plasmic-init.js +18 -0
- package/cpa-out/gatsby-loader-js/src/templates/defaultPlasmicPage.jsx +44 -0
- package/cpa-out/gatsby-loader-ts/gatsby-config.ts +31 -0
- package/cpa-out/gatsby-loader-ts/gatsby-node.ts +0 -0
- package/cpa-out/gatsby-loader-ts/gatsby-ssr.tsx +44 -0
- package/cpa-out/gatsby-loader-ts/package.json +32 -0
- package/cpa-out/gatsby-loader-ts/src/pages/404.ts +4 -0
- package/cpa-out/gatsby-loader-ts/src/pages/plasmic-host.tsx +24 -0
- package/cpa-out/gatsby-loader-ts/src/plasmic-init.ts +19 -0
- package/cpa-out/gatsby-loader-ts/src/templates/defaultPlasmicPage.tsx +52 -0
- package/cpa-out/gatsby-loader-ts/tsconfig.json +102 -0
- package/cpa-out/nextjs-app-loader-js/app/[[...catchall]]/page.jsx +56 -0
- package/cpa-out/nextjs-app-loader-js/app/head.js +10 -0
- package/cpa-out/nextjs-app-loader-js/app/layout.js +14 -0
- package/cpa-out/nextjs-app-loader-js/app/plasmic-host/page.jsx +6 -0
- package/cpa-out/nextjs-app-loader-js/next.config.js +13 -0
- package/cpa-out/nextjs-app-loader-js/package.json +20 -0
- package/cpa-out/nextjs-app-loader-js/pages/api/hello.js +5 -0
- package/cpa-out/nextjs-app-loader-js/plasmic-init-client.jsx +65 -0
- package/cpa-out/nextjs-app-loader-js/plasmic-init.js +16 -0
- package/cpa-out/nextjs-app-loader-ts/app/[[...catchall]]/page.tsx +59 -0
- package/cpa-out/nextjs-app-loader-ts/app/head.tsx +10 -0
- package/cpa-out/nextjs-app-loader-ts/app/layout.tsx +18 -0
- package/cpa-out/nextjs-app-loader-ts/app/plasmic-host/page.tsx +6 -0
- package/cpa-out/nextjs-app-loader-ts/next.config.js +13 -0
- package/cpa-out/nextjs-app-loader-ts/package.json +24 -0
- package/cpa-out/nextjs-app-loader-ts/pages/api/hello.ts +13 -0
- package/cpa-out/nextjs-app-loader-ts/plasmic-init-client.tsx +65 -0
- package/cpa-out/nextjs-app-loader-ts/plasmic-init.ts +16 -0
- package/cpa-out/nextjs-app-loader-ts/tsconfig.json +29 -0
- package/cpa-out/nextjs-pages-codegen-js/components/plasmic/create_plasmic_app/PlasmicGlobalVariant__Screen.jsx +29 -0
- package/cpa-out/nextjs-pages-codegen-js/components/plasmic/create_plasmic_app/PlasmicHomepage.jsx +205 -0
- package/cpa-out/nextjs-pages-codegen-js/next.config.js +10 -0
- package/cpa-out/nextjs-pages-codegen-js/package.json +22 -0
- package/cpa-out/nextjs-pages-codegen-js/pages/_app.jsx +11 -0
- package/cpa-out/nextjs-pages-codegen-js/pages/api/hello.js +5 -0
- package/cpa-out/nextjs-pages-codegen-js/pages/index.jsx +35 -0
- package/cpa-out/nextjs-pages-codegen-js/pages/plasmic-host.jsx +15 -0
- package/cpa-out/nextjs-pages-codegen-js/plasmic.json +79 -0
- package/cpa-out/nextjs-pages-codegen-ts/components/plasmic/create_plasmic_app/PlasmicGlobalVariant__Screen.tsx +30 -0
- package/cpa-out/nextjs-pages-codegen-ts/components/plasmic/create_plasmic_app/PlasmicHomepage.tsx +287 -0
- package/cpa-out/nextjs-pages-codegen-ts/next.config.js +10 -0
- package/cpa-out/nextjs-pages-codegen-ts/package.json +26 -0
- package/cpa-out/nextjs-pages-codegen-ts/pages/_app.tsx +12 -0
- package/cpa-out/nextjs-pages-codegen-ts/pages/api/hello.ts +13 -0
- package/cpa-out/nextjs-pages-codegen-ts/pages/index.tsx +37 -0
- package/cpa-out/nextjs-pages-codegen-ts/pages/plasmic-host.tsx +15 -0
- package/cpa-out/nextjs-pages-codegen-ts/plasmic.json +79 -0
- package/cpa-out/nextjs-pages-codegen-ts/tsconfig.json +24 -0
- package/cpa-out/nextjs-pages-loader-js/next.config.js +10 -0
- package/cpa-out/nextjs-pages-loader-js/package.json +20 -0
- package/cpa-out/nextjs-pages-loader-js/pages/[[...catchall]].jsx +66 -0
- package/cpa-out/nextjs-pages-loader-js/pages/api/hello.js +5 -0
- package/cpa-out/nextjs-pages-loader-js/pages/plasmic-host.jsx +7 -0
- package/cpa-out/nextjs-pages-loader-js/plasmic-init.js +25 -0
- package/cpa-out/nextjs-pages-loader-ts/next.config.js +10 -0
- package/cpa-out/nextjs-pages-loader-ts/package.json +24 -0
- package/cpa-out/nextjs-pages-loader-ts/pages/[[...catchall]].tsx +70 -0
- package/cpa-out/nextjs-pages-loader-ts/pages/api/hello.ts +13 -0
- package/cpa-out/nextjs-pages-loader-ts/pages/plasmic-host.tsx +7 -0
- package/cpa-out/nextjs-pages-loader-ts/plasmic-init.ts +25 -0
- package/cpa-out/nextjs-pages-loader-ts/tsconfig.json +24 -0
- package/cpa-out/react-codegen-js/package.json +41 -0
- package/cpa-out/react-codegen-js/plasmic.json +76 -0
- package/cpa-out/react-codegen-js/src/App.jsx +9 -0
- package/cpa-out/react-codegen-js/src/components/Homepage.jsx +26 -0
- package/cpa-out/react-codegen-js/src/components/plasmic/create_plasmic_app/PlasmicGlobalVariant__Screen.jsx +29 -0
- package/cpa-out/react-codegen-js/src/components/plasmic/create_plasmic_app/PlasmicHomepage.jsx +196 -0
- package/cpa-out/react-codegen-js/src/index.js +17 -0
- package/cpa-out/react-codegen-js/src/reportWebVitals.js +13 -0
- package/cpa-out/react-codegen-js/src/setupTests.js +5 -0
- package/cpa-out/react-codegen-ts/package.json +46 -0
- package/cpa-out/react-codegen-ts/plasmic.json +76 -0
- package/cpa-out/react-codegen-ts/src/App.tsx +9 -0
- package/cpa-out/react-codegen-ts/src/components/Homepage.tsx +45 -0
- package/cpa-out/react-codegen-ts/src/components/plasmic/create_plasmic_app/PlasmicGlobalVariant__Screen.tsx +30 -0
- package/cpa-out/react-codegen-ts/src/components/plasmic/create_plasmic_app/PlasmicHomepage.tsx +280 -0
- package/cpa-out/react-codegen-ts/src/index.tsx +19 -0
- package/cpa-out/react-codegen-ts/src/react-app-env.d.ts +1 -0
- package/cpa-out/react-codegen-ts/src/reportWebVitals.ts +15 -0
- package/cpa-out/react-codegen-ts/src/setupTests.ts +5 -0
- package/cpa-out/react-codegen-ts/tsconfig.json +26 -0
- package/cpa-out/react-loader-js/package.json +41 -0
- package/cpa-out/react-loader-js/plasmic.json +76 -0
- package/cpa-out/react-loader-js/src/App.jsx +9 -0
- package/cpa-out/react-loader-js/src/components/Homepage.jsx +26 -0
- package/cpa-out/react-loader-js/src/components/plasmic/create_plasmic_app/PlasmicGlobalVariant__Screen.jsx +29 -0
- package/cpa-out/react-loader-js/src/components/plasmic/create_plasmic_app/PlasmicHomepage.jsx +196 -0
- package/cpa-out/react-loader-js/src/index.js +17 -0
- package/cpa-out/react-loader-js/src/reportWebVitals.js +13 -0
- package/cpa-out/react-loader-js/src/setupTests.js +5 -0
- package/cpa-out/react-loader-ts/package.json +46 -0
- package/cpa-out/react-loader-ts/plasmic.json +76 -0
- package/cpa-out/react-loader-ts/src/App.tsx +9 -0
- package/cpa-out/react-loader-ts/src/components/Homepage.tsx +45 -0
- package/cpa-out/react-loader-ts/src/components/plasmic/create_plasmic_app/PlasmicGlobalVariant__Screen.tsx +30 -0
- package/cpa-out/react-loader-ts/src/components/plasmic/create_plasmic_app/PlasmicHomepage.tsx +280 -0
- package/cpa-out/react-loader-ts/src/index.tsx +19 -0
- package/cpa-out/react-loader-ts/src/react-app-env.d.ts +1 -0
- package/cpa-out/react-loader-ts/src/reportWebVitals.ts +15 -0
- package/cpa-out/react-loader-ts/src/setupTests.ts +5 -0
- package/cpa-out/react-loader-ts/tsconfig.json +26 -0
- package/dist/gatsby/gatsby.d.ts +6 -0
- package/dist/{strategies → gatsby}/gatsby.js +26 -29
- package/dist/gatsby/template.d.ts +11 -0
- package/dist/{templates/gatsby.js → gatsby/template.js} +34 -42
- package/dist/index.d.ts +1 -1
- package/dist/index.js +57 -27
- package/dist/lib.d.ts +3 -4
- package/dist/lib.js +22 -12
- package/dist/nextjs/nextjs.d.ts +2 -0
- package/dist/nextjs/nextjs.js +155 -0
- package/dist/nextjs/templates/app-loader/catchall-page.d.ts +2 -0
- package/dist/nextjs/templates/app-loader/catchall-page.js +67 -0
- package/dist/nextjs/templates/app-loader/plasmic-host.d.ts +1 -0
- package/dist/nextjs/templates/app-loader/plasmic-host.js +13 -0
- package/dist/nextjs/templates/app-loader/plasmic-init-client.d.ts +2 -0
- package/dist/nextjs/templates/app-loader/plasmic-init-client.js +73 -0
- package/dist/nextjs/templates/app-loader/plasmic-init.d.ts +1 -0
- package/dist/nextjs/templates/app-loader/plasmic-init.js +23 -0
- package/dist/nextjs/templates/pages-codegen/app.d.ts +2 -0
- package/dist/nextjs/templates/pages-codegen/app.js +20 -0
- package/dist/nextjs/templates/pages-codegen/plasmic-host.d.ts +1 -0
- package/dist/nextjs/templates/pages-codegen/plasmic-host.js +22 -0
- package/dist/nextjs/templates/pages-loader/catchall-page.d.ts +2 -0
- package/dist/nextjs/templates/pages-loader/catchall-page.js +77 -0
- package/dist/nextjs/templates/pages-loader/plasmic-host.d.ts +1 -0
- package/dist/nextjs/templates/pages-loader/plasmic-host.js +14 -0
- package/dist/nextjs/templates/pages-loader/plasmic-init.d.ts +1 -0
- package/dist/nextjs/templates/pages-loader/plasmic-init.js +32 -0
- package/dist/react/react.d.ts +2 -0
- package/dist/{strategies → react}/react.js +10 -10
- package/dist/templates/readme.d.ts +2 -2
- package/dist/templates/readme.js +5 -4
- package/dist/templates/welcomePage.d.ts +2 -2
- package/dist/templates/welcomePage.js +5 -5
- package/dist/{strategies/common.d.ts → utils/codegen.d.ts} +0 -0
- package/dist/{strategies/common.js → utils/codegen.js} +0 -0
- package/dist/utils/file-utils.d.ts +2 -2
- package/dist/utils/file-utils.js +3 -3
- package/dist/{strategies/types.d.ts → utils/strategy.d.ts} +16 -14
- package/dist/{strategies/types.js → utils/strategy.js} +0 -0
- package/dist/utils/types.d.ts +9 -0
- package/dist/utils/types.js +7 -0
- package/package.json +4 -3
- package/run-cpa.ts +151 -0
- package/src/{strategies → gatsby}/gatsby.ts +28 -46
- package/src/{templates/gatsby.ts → gatsby/template.ts} +41 -51
- package/src/index.ts +86 -56
- package/src/lib.ts +30 -15
- package/src/nextjs/nextjs.ts +180 -0
- package/src/nextjs/templates/app-loader/catchall-page.ts +71 -0
- package/src/nextjs/templates/app-loader/plasmic-host.ts +9 -0
- package/src/nextjs/templates/app-loader/plasmic-init-client.ts +74 -0
- package/src/nextjs/templates/app-loader/plasmic-init.ts +22 -0
- package/src/nextjs/templates/pages-codegen/app.ts +24 -0
- package/src/nextjs/templates/pages-codegen/plasmic-host.ts +18 -0
- package/src/nextjs/templates/pages-loader/catchall-page.ts +81 -0
- package/src/nextjs/templates/pages-loader/plasmic-host.ts +10 -0
- package/src/nextjs/templates/pages-loader/plasmic-init.ts +31 -0
- package/src/{strategies → react}/react.ts +8 -10
- package/src/templates/readme.ts +5 -5
- package/src/templates/welcomePage.ts +6 -7
- package/src/{strategies/common.ts → utils/codegen.ts} +0 -0
- package/src/utils/file-utils.ts +4 -4
- package/src/utils/strategy.ts +48 -0
- package/src/utils/types.ts +12 -0
- package/dist/strategies/gatsby.d.ts +0 -7
- package/dist/strategies/index.d.ts +0 -2
- package/dist/strategies/index.js +0 -22
- package/dist/strategies/nextjs.d.ts +0 -3
- package/dist/strategies/nextjs.js +0 -104
- package/dist/strategies/react.d.ts +0 -3
- package/dist/templates/gatsby.d.ts +0 -11
- package/dist/templates/nextjs.d.ts +0 -5
- package/dist/templates/nextjs.js +0 -162
- package/src/strategies/index.ts +0 -21
- package/src/strategies/nextjs.ts +0 -131
- package/src/strategies/types.ts +0 -42
- package/src/templates/nextjs.ts +0 -170
package/cpa-out/gatsby-codegen-ts/src/components/plasmic/create_plasmic_app/PlasmicHomepage.tsx
ADDED
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/* tslint:disable */
|
|
4
|
+
/* prettier-ignore-start */
|
|
5
|
+
|
|
6
|
+
/** @jsxRuntime classic */
|
|
7
|
+
/** @jsx createPlasmicElementProxy */
|
|
8
|
+
/** @jsxFrag React.Fragment */
|
|
9
|
+
|
|
10
|
+
// This class is auto-generated by Plasmic; please do not edit!
|
|
11
|
+
// Plasmic Project: 47tFXWjN2C4NyHFGGpaYQ3
|
|
12
|
+
// Component: 6uuAAE1jiCew
|
|
13
|
+
import * as React from "react";
|
|
14
|
+
|
|
15
|
+
import { Link, GatsbyLinkProps as LinkProps } from "gatsby";
|
|
16
|
+
|
|
17
|
+
import * as p from "@plasmicapp/react-web";
|
|
18
|
+
import * as ph from "@plasmicapp/host";
|
|
19
|
+
|
|
20
|
+
import {
|
|
21
|
+
hasVariant,
|
|
22
|
+
classNames,
|
|
23
|
+
wrapWithClassName,
|
|
24
|
+
createPlasmicElementProxy,
|
|
25
|
+
makeFragment,
|
|
26
|
+
MultiChoiceArg,
|
|
27
|
+
SingleBooleanChoiceArg,
|
|
28
|
+
SingleChoiceArg,
|
|
29
|
+
pick,
|
|
30
|
+
omit,
|
|
31
|
+
useTrigger,
|
|
32
|
+
StrictProps,
|
|
33
|
+
deriveRenderOpts,
|
|
34
|
+
ensureGlobalVariants
|
|
35
|
+
} from "@plasmicapp/react-web";
|
|
36
|
+
|
|
37
|
+
import { useScreenVariants as useScreenVariantsscBjPxgdxdzbv } from "./PlasmicGlobalVariant__Screen"; // plasmic-import: SCBjPXGDXDZBV/globalVariant
|
|
38
|
+
|
|
39
|
+
import "@plasmicapp/react-web/lib/plasmic.css";
|
|
40
|
+
|
|
41
|
+
import * as projectcss from "./plasmic_create_plasmic_app.module.css"; // plasmic-import: 47tFXWjN2C4NyHFGGpaYQ3/projectcss
|
|
42
|
+
import * as sty from "./PlasmicHomepage.module.css"; // plasmic-import: 6uuAAE1jiCew/css
|
|
43
|
+
|
|
44
|
+
export type PlasmicHomepage__VariantMembers = {};
|
|
45
|
+
export type PlasmicHomepage__VariantsArgs = {};
|
|
46
|
+
type VariantPropType = keyof PlasmicHomepage__VariantsArgs;
|
|
47
|
+
export const PlasmicHomepage__VariantProps = new Array<VariantPropType>();
|
|
48
|
+
|
|
49
|
+
export type PlasmicHomepage__ArgsType = {};
|
|
50
|
+
type ArgPropType = keyof PlasmicHomepage__ArgsType;
|
|
51
|
+
export const PlasmicHomepage__ArgProps = new Array<ArgPropType>();
|
|
52
|
+
|
|
53
|
+
export type PlasmicHomepage__OverridesType = {
|
|
54
|
+
root?: p.Flex<"div">;
|
|
55
|
+
section?: p.Flex<"section">;
|
|
56
|
+
h1?: p.Flex<"h1">;
|
|
57
|
+
text?: p.Flex<"div">;
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export interface DefaultHomepageProps {
|
|
61
|
+
className?: string;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const __wrapUserFunction =
|
|
65
|
+
globalThis.__PlasmicWrapUserFunction ?? ((loc, fn) => fn());
|
|
66
|
+
const __wrapUserPromise =
|
|
67
|
+
globalThis.__PlasmicWrapUserPromise ??
|
|
68
|
+
(async (loc, promise) => {
|
|
69
|
+
return await promise;
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
export function Head() {
|
|
73
|
+
return <></>;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function PlasmicHomepage__RenderFunc(props: {
|
|
77
|
+
variants: PlasmicHomepage__VariantsArgs;
|
|
78
|
+
args: PlasmicHomepage__ArgsType;
|
|
79
|
+
overrides: PlasmicHomepage__OverridesType;
|
|
80
|
+
|
|
81
|
+
forNode?: string;
|
|
82
|
+
}) {
|
|
83
|
+
const { variants, overrides, forNode } = props;
|
|
84
|
+
|
|
85
|
+
const $ctx = ph.useDataEnv?.() || {};
|
|
86
|
+
const args = React.useMemo(() => Object.assign({}, props.args), [props.args]);
|
|
87
|
+
|
|
88
|
+
const $props = {
|
|
89
|
+
...args,
|
|
90
|
+
...variants
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
const currentUser = p.useCurrentUser?.() || {};
|
|
94
|
+
|
|
95
|
+
const [$queries, setDollarQueries] = React.useState({});
|
|
96
|
+
|
|
97
|
+
const globalVariants = ensureGlobalVariants({
|
|
98
|
+
screen: useScreenVariantsscBjPxgdxdzbv()
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
return (
|
|
102
|
+
<React.Fragment>
|
|
103
|
+
<style>{`
|
|
104
|
+
body {
|
|
105
|
+
margin: 0;
|
|
106
|
+
}
|
|
107
|
+
`}</style>
|
|
108
|
+
|
|
109
|
+
<div className={projectcss.plasmic_page_wrapper}>
|
|
110
|
+
<div
|
|
111
|
+
data-plasmic-name={"root"}
|
|
112
|
+
data-plasmic-override={overrides.root}
|
|
113
|
+
data-plasmic-root={true}
|
|
114
|
+
data-plasmic-for-node={forNode}
|
|
115
|
+
className={classNames(
|
|
116
|
+
projectcss.all,
|
|
117
|
+
projectcss.root_reset,
|
|
118
|
+
projectcss.plasmic_default_styles,
|
|
119
|
+
projectcss.plasmic_mixins,
|
|
120
|
+
sty.root
|
|
121
|
+
)}
|
|
122
|
+
>
|
|
123
|
+
<p.Stack
|
|
124
|
+
as={"section"}
|
|
125
|
+
data-plasmic-name={"section"}
|
|
126
|
+
data-plasmic-override={overrides.section}
|
|
127
|
+
hasGap={true}
|
|
128
|
+
className={classNames(projectcss.all, sty.section)}
|
|
129
|
+
>
|
|
130
|
+
<h1
|
|
131
|
+
data-plasmic-name={"h1"}
|
|
132
|
+
data-plasmic-override={overrides.h1}
|
|
133
|
+
className={classNames(
|
|
134
|
+
projectcss.all,
|
|
135
|
+
projectcss.h1,
|
|
136
|
+
projectcss.__wab_text,
|
|
137
|
+
sty.h1
|
|
138
|
+
)}
|
|
139
|
+
>
|
|
140
|
+
{"create-plasmic-app"}
|
|
141
|
+
</h1>
|
|
142
|
+
|
|
143
|
+
<div
|
|
144
|
+
data-plasmic-name={"text"}
|
|
145
|
+
data-plasmic-override={overrides.text}
|
|
146
|
+
className={classNames(
|
|
147
|
+
projectcss.all,
|
|
148
|
+
projectcss.__wab_text,
|
|
149
|
+
sty.text
|
|
150
|
+
)}
|
|
151
|
+
>
|
|
152
|
+
{hasVariant(globalVariants, "screen", "desktopOnly") ? (
|
|
153
|
+
<React.Fragment>
|
|
154
|
+
<React.Fragment>
|
|
155
|
+
{
|
|
156
|
+
"This project is used by run-cpa.ts in the create-plasmic-app repo.\n\nrun-cpa.ts runs create-plasmic-app for many combinations of args (e.g. nextjs + appDir + loader + typescript) to check for changes in generated files. Any changes to this project will result in lots of changes to the generated files. "
|
|
157
|
+
}
|
|
158
|
+
</React.Fragment>
|
|
159
|
+
<span
|
|
160
|
+
className={"plasmic_default__all plasmic_default__span"}
|
|
161
|
+
style={{ fontWeight: 700 }}
|
|
162
|
+
>
|
|
163
|
+
{"Therefore, please avoid changing this project."}
|
|
164
|
+
</span>
|
|
165
|
+
</React.Fragment>
|
|
166
|
+
) : (
|
|
167
|
+
<React.Fragment>
|
|
168
|
+
<React.Fragment>
|
|
169
|
+
{
|
|
170
|
+
"If you haven't already done so, go back and learn the basics by going through the Plasmic Levels tutorial.\n\nIt's always easier to start from examples! Add a new page using a template—do this from the list of pages in the top left (the gray + button).\n\nOr press the big blue + button to start dragging items into this page.\n\nIntegrate this project into your codebase—press the "
|
|
171
|
+
}
|
|
172
|
+
</React.Fragment>
|
|
173
|
+
<span
|
|
174
|
+
className={"plasmic_default__all plasmic_default__span"}
|
|
175
|
+
style={{ fontWeight: 700 }}
|
|
176
|
+
>
|
|
177
|
+
{"Code"}
|
|
178
|
+
</span>
|
|
179
|
+
<React.Fragment>
|
|
180
|
+
{
|
|
181
|
+
" button in the top right and follow the quickstart instructions.\n\nJoin our Slack community (icon in bottom left) for help any time."
|
|
182
|
+
}
|
|
183
|
+
</React.Fragment>
|
|
184
|
+
</React.Fragment>
|
|
185
|
+
)}
|
|
186
|
+
</div>
|
|
187
|
+
</p.Stack>
|
|
188
|
+
</div>
|
|
189
|
+
</div>
|
|
190
|
+
</React.Fragment>
|
|
191
|
+
) as React.ReactElement | null;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
const PlasmicDescendants = {
|
|
195
|
+
root: ["root", "section", "h1", "text"],
|
|
196
|
+
section: ["section", "h1", "text"],
|
|
197
|
+
h1: ["h1"],
|
|
198
|
+
text: ["text"]
|
|
199
|
+
} as const;
|
|
200
|
+
type NodeNameType = keyof typeof PlasmicDescendants;
|
|
201
|
+
type DescendantsType<T extends NodeNameType> =
|
|
202
|
+
(typeof PlasmicDescendants)[T][number];
|
|
203
|
+
type NodeDefaultElementType = {
|
|
204
|
+
root: "div";
|
|
205
|
+
section: "section";
|
|
206
|
+
h1: "h1";
|
|
207
|
+
text: "div";
|
|
208
|
+
};
|
|
209
|
+
|
|
210
|
+
type ReservedPropsType = "variants" | "args" | "overrides";
|
|
211
|
+
type NodeOverridesType<T extends NodeNameType> = Pick<
|
|
212
|
+
PlasmicHomepage__OverridesType,
|
|
213
|
+
DescendantsType<T>
|
|
214
|
+
>;
|
|
215
|
+
type NodeComponentProps<T extends NodeNameType> =
|
|
216
|
+
// Explicitly specify variants, args, and overrides as objects
|
|
217
|
+
{
|
|
218
|
+
variants?: PlasmicHomepage__VariantsArgs;
|
|
219
|
+
args?: PlasmicHomepage__ArgsType;
|
|
220
|
+
overrides?: NodeOverridesType<T>;
|
|
221
|
+
} & Omit<PlasmicHomepage__VariantsArgs, ReservedPropsType> & // Specify variants directly as props
|
|
222
|
+
/* Specify args directly as props*/ Omit<
|
|
223
|
+
PlasmicHomepage__ArgsType,
|
|
224
|
+
ReservedPropsType
|
|
225
|
+
> &
|
|
226
|
+
/* Specify overrides for each element directly as props*/ Omit<
|
|
227
|
+
NodeOverridesType<T>,
|
|
228
|
+
ReservedPropsType | VariantPropType | ArgPropType
|
|
229
|
+
> &
|
|
230
|
+
/* Specify props for the root element*/ Omit<
|
|
231
|
+
Partial<React.ComponentProps<NodeDefaultElementType[T]>>,
|
|
232
|
+
ReservedPropsType | VariantPropType | ArgPropType | DescendantsType<T>
|
|
233
|
+
>;
|
|
234
|
+
|
|
235
|
+
function makeNodeComponent<NodeName extends NodeNameType>(nodeName: NodeName) {
|
|
236
|
+
type PropsType = NodeComponentProps<NodeName> & { key?: React.Key };
|
|
237
|
+
const func = function <T extends PropsType>(
|
|
238
|
+
props: T & StrictProps<T, PropsType>
|
|
239
|
+
) {
|
|
240
|
+
const { variants, args, overrides } = React.useMemo(
|
|
241
|
+
() =>
|
|
242
|
+
deriveRenderOpts(props, {
|
|
243
|
+
name: nodeName,
|
|
244
|
+
descendantNames: [...PlasmicDescendants[nodeName]],
|
|
245
|
+
internalArgPropNames: PlasmicHomepage__ArgProps,
|
|
246
|
+
internalVariantPropNames: PlasmicHomepage__VariantProps
|
|
247
|
+
}),
|
|
248
|
+
[props, nodeName]
|
|
249
|
+
);
|
|
250
|
+
|
|
251
|
+
return PlasmicHomepage__RenderFunc({
|
|
252
|
+
variants,
|
|
253
|
+
args,
|
|
254
|
+
overrides,
|
|
255
|
+
forNode: nodeName
|
|
256
|
+
});
|
|
257
|
+
};
|
|
258
|
+
if (nodeName === "root") {
|
|
259
|
+
func.displayName = "PlasmicHomepage";
|
|
260
|
+
} else {
|
|
261
|
+
func.displayName = `PlasmicHomepage.${nodeName}`;
|
|
262
|
+
}
|
|
263
|
+
return func;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
export const PlasmicHomepage = Object.assign(
|
|
267
|
+
// Top-level PlasmicHomepage renders the root element
|
|
268
|
+
makeNodeComponent("root"),
|
|
269
|
+
{
|
|
270
|
+
// Helper components rendering sub-elements
|
|
271
|
+
section: makeNodeComponent("section"),
|
|
272
|
+
h1: makeNodeComponent("h1"),
|
|
273
|
+
text: makeNodeComponent("text"),
|
|
274
|
+
|
|
275
|
+
// Metadata about props expected for PlasmicHomepage
|
|
276
|
+
internalVariantProps: PlasmicHomepage__VariantProps,
|
|
277
|
+
internalArgProps: PlasmicHomepage__ArgProps,
|
|
278
|
+
|
|
279
|
+
// Page metadata
|
|
280
|
+
pageMetadata: {
|
|
281
|
+
title: "",
|
|
282
|
+
description: "",
|
|
283
|
+
ogImageSrc: "",
|
|
284
|
+
canonical: ""
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
);
|
|
288
|
+
|
|
289
|
+
export default PlasmicHomepage;
|
|
290
|
+
/* prettier-ignore-end */
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// This is a skeleton starter React page generated by Plasmic.
|
|
2
|
+
// This file is owned by you, feel free to edit as you see fit.
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import * as ph from "@plasmicapp/host";
|
|
5
|
+
|
|
6
|
+
import { ScreenVariantProvider } from "../components/plasmic/create_plasmic_app/PlasmicGlobalVariant__Screen";
|
|
7
|
+
import {
|
|
8
|
+
PlasmicHomepage,
|
|
9
|
+
Head
|
|
10
|
+
} from "../components/plasmic/create_plasmic_app/PlasmicHomepage";
|
|
11
|
+
import type { PageProps } from "gatsby";
|
|
12
|
+
export { Head };
|
|
13
|
+
|
|
14
|
+
function Homepage({ location, params }: PageProps) {
|
|
15
|
+
// Use PlasmicHomepage to render this component as it was
|
|
16
|
+
// designed in Plasmic, by activating the appropriate variants,
|
|
17
|
+
// attaching the appropriate event handlers, etc. You
|
|
18
|
+
// can also install whatever React hooks you need here to manage state or
|
|
19
|
+
// fetch data.
|
|
20
|
+
//
|
|
21
|
+
// Props you can pass into PlasmicHomepage are:
|
|
22
|
+
// 1. Variants you want to activate,
|
|
23
|
+
// 2. Contents for slots you want to fill,
|
|
24
|
+
// 3. Overrides for any named node in the component to attach behavior and data,
|
|
25
|
+
// 4. Props to set on the root node.
|
|
26
|
+
//
|
|
27
|
+
// By default, PlasmicHomepage is wrapped by your project's global
|
|
28
|
+
// variant context providers. These wrappers may be moved to
|
|
29
|
+
// Gatsby "wrapRootElement" function
|
|
30
|
+
// (https://www.gatsbyjs.com/docs/reference/config-files/gatsby-ssr#wrapRootElement).
|
|
31
|
+
return (
|
|
32
|
+
<ph.PageParamsProvider
|
|
33
|
+
params={params}
|
|
34
|
+
query={Object.fromEntries(new URLSearchParams(location.search))}
|
|
35
|
+
>
|
|
36
|
+
<PlasmicHomepage />
|
|
37
|
+
</ph.PageParamsProvider>
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export default Homepage;
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
/* Visit https://aka.ms/tsconfig.json to read more about this file */
|
|
4
|
+
|
|
5
|
+
/* Projects */
|
|
6
|
+
// "incremental": true, /* Enable incremental compilation */
|
|
7
|
+
// "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
|
|
8
|
+
// "tsBuildInfoFile": "./", /* Specify the folder for .tsbuildinfo incremental compilation files. */
|
|
9
|
+
// "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects */
|
|
10
|
+
// "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
|
|
11
|
+
// "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
|
|
12
|
+
|
|
13
|
+
/* Language and Environment */
|
|
14
|
+
"target": "esnext", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
|
|
15
|
+
"lib": ["dom", "esnext"], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
|
|
16
|
+
"jsx": "react", /* Specify what JSX code is generated. */
|
|
17
|
+
// "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */
|
|
18
|
+
// "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
|
|
19
|
+
// "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h' */
|
|
20
|
+
// "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
|
|
21
|
+
// "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using `jsx: react-jsx*`.` */
|
|
22
|
+
// "reactNamespace": "", /* Specify the object invoked for `createElement`. This only applies when targeting `react` JSX emit. */
|
|
23
|
+
// "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
|
|
24
|
+
// "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
|
|
25
|
+
|
|
26
|
+
/* Modules */
|
|
27
|
+
"module": "esnext", /* Specify what module code is generated. */
|
|
28
|
+
// "rootDir": "./", /* Specify the root folder within your source files. */
|
|
29
|
+
"moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */
|
|
30
|
+
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
|
|
31
|
+
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
|
|
32
|
+
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
|
|
33
|
+
// "typeRoots": [], /* Specify multiple folders that act like `./node_modules/@types`. */
|
|
34
|
+
// "types": [], /* Specify type package names to be included without being referenced in a source file. */
|
|
35
|
+
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
|
|
36
|
+
// "resolveJsonModule": true, /* Enable importing .json files */
|
|
37
|
+
// "noResolve": true, /* Disallow `import`s, `require`s or `<reference>`s from expanding the number of files TypeScript should add to a project. */
|
|
38
|
+
|
|
39
|
+
/* JavaScript Support */
|
|
40
|
+
// "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files. */
|
|
41
|
+
// "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
|
|
42
|
+
// "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from `node_modules`. Only applicable with `allowJs`. */
|
|
43
|
+
|
|
44
|
+
/* Emit */
|
|
45
|
+
// "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
|
|
46
|
+
// "declarationMap": true, /* Create sourcemaps for d.ts files. */
|
|
47
|
+
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
|
|
48
|
+
// "sourceMap": true, /* Create source map files for emitted JavaScript files. */
|
|
49
|
+
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If `declaration` is true, also designates a file that bundles all .d.ts output. */
|
|
50
|
+
// "outDir": "./", /* Specify an output folder for all emitted files. */
|
|
51
|
+
// "removeComments": true, /* Disable emitting comments. */
|
|
52
|
+
// "noEmit": true, /* Disable emitting files from a compilation. */
|
|
53
|
+
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
|
|
54
|
+
// "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types */
|
|
55
|
+
// "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
|
|
56
|
+
// "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
|
|
57
|
+
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
|
|
58
|
+
// "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
|
|
59
|
+
// "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
|
|
60
|
+
// "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
|
|
61
|
+
// "newLine": "crlf", /* Set the newline character for emitting files. */
|
|
62
|
+
// "stripInternal": true, /* Disable emitting declarations that have `@internal` in their JSDoc comments. */
|
|
63
|
+
// "noEmitHelpers": true, /* Disable generating custom helper functions like `__extends` in compiled output. */
|
|
64
|
+
// "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
|
|
65
|
+
// "preserveConstEnums": true, /* Disable erasing `const enum` declarations in generated code. */
|
|
66
|
+
// "declarationDir": "./", /* Specify the output directory for generated declaration files. */
|
|
67
|
+
// "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
|
|
68
|
+
|
|
69
|
+
/* Interop Constraints */
|
|
70
|
+
// "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
|
|
71
|
+
// "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
|
|
72
|
+
"esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables `allowSyntheticDefaultImports` for type compatibility. */
|
|
73
|
+
// "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
|
|
74
|
+
"forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
|
|
75
|
+
|
|
76
|
+
/* Type Checking */
|
|
77
|
+
"strict": true, /* Enable all strict type-checking options. */
|
|
78
|
+
// "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied `any` type.. */
|
|
79
|
+
// "strictNullChecks": true, /* When type checking, take into account `null` and `undefined`. */
|
|
80
|
+
// "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
|
|
81
|
+
// "strictBindCallApply": true, /* Check that the arguments for `bind`, `call`, and `apply` methods match the original function. */
|
|
82
|
+
// "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
|
|
83
|
+
// "noImplicitThis": true, /* Enable error reporting when `this` is given the type `any`. */
|
|
84
|
+
// "useUnknownInCatchVariables": true, /* Type catch clause variables as 'unknown' instead of 'any'. */
|
|
85
|
+
// "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
|
|
86
|
+
// "noUnusedLocals": true, /* Enable error reporting when a local variables aren't read. */
|
|
87
|
+
// "noUnusedParameters": true, /* Raise an error when a function parameter isn't read */
|
|
88
|
+
// "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
|
|
89
|
+
// "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
|
|
90
|
+
// "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
|
|
91
|
+
// "noUncheckedIndexedAccess": true, /* Include 'undefined' in index signature results */
|
|
92
|
+
// "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
|
|
93
|
+
// "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type */
|
|
94
|
+
// "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
|
|
95
|
+
// "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
|
|
96
|
+
|
|
97
|
+
/* Completeness */
|
|
98
|
+
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
|
|
99
|
+
"skipLibCheck": true /* Skip type checking all .d.ts files. */
|
|
100
|
+
},
|
|
101
|
+
"include": ["./src/**/*", "./gatsby-node.ts", "./gatsby-config.ts", "./plugins/**/*"]
|
|
102
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @type {import('gatsby').GatsbyConfig}
|
|
3
|
+
*/
|
|
4
|
+
module.exports = {
|
|
5
|
+
siteMetadata: {
|
|
6
|
+
siteUrl: `https://www.yourdomain.tld`,
|
|
7
|
+
},
|
|
8
|
+
plugins: [{
|
|
9
|
+
resolve: "@plasmicapp/loader-gatsby",
|
|
10
|
+
options: {
|
|
11
|
+
projects: [
|
|
12
|
+
{
|
|
13
|
+
id: "47tFXWjN2C4NyHFGGpaYQ3",
|
|
14
|
+
token: "7BRFratDxPLMGZHnd2grV5QP6mlHcZ1AK3BJSIeh7xzUlHgWh25XpgXvUaKAqHXFMXQQuzpADqboibF6nqNWQ",
|
|
15
|
+
},
|
|
16
|
+
], // An array of project ids.
|
|
17
|
+
preview: false,
|
|
18
|
+
defaultPlasmicPage: require.resolve("./src/templates/defaultPlasmicPage.jsx"),
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
resolve: "gatsby-plugin-react-helmet",
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Implement Gatsby's SSR (Server Side Rendering) APIs in this file.
|
|
3
|
+
*
|
|
4
|
+
* See: https://www.gatsbyjs.com/docs/ssr-apis/
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
const React = require("react")
|
|
8
|
+
|
|
9
|
+
const HeadComponents = [
|
|
10
|
+
<script
|
|
11
|
+
key="plasmic-hmr"
|
|
12
|
+
type="text/javascript"
|
|
13
|
+
dangerouslySetInnerHTML={{
|
|
14
|
+
__html: `
|
|
15
|
+
if (typeof window !== "undefined" && /\\/plasmic-host\\/?$/.test(window.location.pathname)) {
|
|
16
|
+
const RealEventSource = window.EventSource;
|
|
17
|
+
window.EventSource = function(url, config) {
|
|
18
|
+
if (/[^a-zA-Z]hmr($|[^a-zA-Z])/.test(url)) {
|
|
19
|
+
console.warn("Plasmic: disabled EventSource request for", url);
|
|
20
|
+
return {
|
|
21
|
+
onerror() {}, onmessage() {}, onopen() {}, close() {}
|
|
22
|
+
};
|
|
23
|
+
} else {
|
|
24
|
+
return new RealEventSource(url, config);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
`,
|
|
29
|
+
}}
|
|
30
|
+
/>
|
|
31
|
+
]
|
|
32
|
+
|
|
33
|
+
const isProduction = process.env.NODE_ENV === "production"
|
|
34
|
+
|
|
35
|
+
exports.onRenderBody = ({ pathname, setHeadComponents }) => {
|
|
36
|
+
/**
|
|
37
|
+
* We add the preamble tag script to all pages during development mode
|
|
38
|
+
* because during development all pages are dynamically rendered based
|
|
39
|
+
* on `/` route, during production we add it only in `/plasmic-host/`
|
|
40
|
+
*/
|
|
41
|
+
if (!isProduction || pathname === "/plasmic-host/") {
|
|
42
|
+
setHeadComponents(HeadComponents)
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "gatsby-loader-js",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"description": "Plasmic app for 47tFXWjN2C4NyHFGGpaYQ3",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"gatsby"
|
|
8
|
+
],
|
|
9
|
+
"scripts": {
|
|
10
|
+
"develop": "gatsby develop",
|
|
11
|
+
"start": "gatsby develop",
|
|
12
|
+
"build": "gatsby build",
|
|
13
|
+
"serve": "gatsby serve",
|
|
14
|
+
"clean": "gatsby clean"
|
|
15
|
+
},
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"@plasmicapp/loader-gatsby": "^1.0.215",
|
|
18
|
+
"gatsby": "^5.5.0",
|
|
19
|
+
"gatsby-plugin-react-helmet": "^6.5.0",
|
|
20
|
+
"react": "^18.2.0",
|
|
21
|
+
"react-dom": "^18.2.0",
|
|
22
|
+
"react-helmet": "^6.1.0"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import {
|
|
3
|
+
PlasmicCanvasHost
|
|
4
|
+
} from "@plasmicapp/loader-gatsby"
|
|
5
|
+
import { graphql } from "gatsby"
|
|
6
|
+
import { initPlasmicLoaderWithRegistrations } from "../plasmic-init"
|
|
7
|
+
|
|
8
|
+
export const query = graphql`
|
|
9
|
+
query {
|
|
10
|
+
plasmicOptions
|
|
11
|
+
}
|
|
12
|
+
`
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
export default function Host({ data }) {
|
|
16
|
+
const { plasmicOptions } = data
|
|
17
|
+
initPlasmicLoaderWithRegistrations(plasmicOptions)
|
|
18
|
+
return <PlasmicCanvasHost />
|
|
19
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import {
|
|
2
|
+
initPlasmicLoader,
|
|
3
|
+
} from "@plasmicapp/loader-gatsby";
|
|
4
|
+
|
|
5
|
+
export function initPlasmicLoaderWithRegistrations(plasmicOptions) {
|
|
6
|
+
const PLASMIC = initPlasmicLoader(plasmicOptions);
|
|
7
|
+
|
|
8
|
+
// You can register any code components that you want to use here; see
|
|
9
|
+
// https://docs.plasmic.app/learn/code-components-ref/
|
|
10
|
+
// And configure your Plasmic project to use the host url pointing at
|
|
11
|
+
// the /plasmic-host page of your nextjs app (for example,
|
|
12
|
+
// http://localhost:8000/plasmic-host). See
|
|
13
|
+
// https://docs.plasmic.app/learn/app-hosting/#set-a-plasmic-project-to-use-your-app-host
|
|
14
|
+
|
|
15
|
+
// PLASMIC.registerComponent(...);
|
|
16
|
+
|
|
17
|
+
return PLASMIC;
|
|
18
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Helmet from "react-helmet";
|
|
3
|
+
import {
|
|
4
|
+
PlasmicComponent,
|
|
5
|
+
PlasmicRootProvider,
|
|
6
|
+
} from "@plasmicapp/loader-gatsby";
|
|
7
|
+
import { graphql } from "gatsby";
|
|
8
|
+
import { initPlasmicLoaderWithRegistrations } from "../plasmic-init";
|
|
9
|
+
|
|
10
|
+
export const query = graphql`
|
|
11
|
+
query ($path: String) {
|
|
12
|
+
plasmicComponents(componentNames: [$path])
|
|
13
|
+
plasmicOptions
|
|
14
|
+
}
|
|
15
|
+
`;
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
const PlasmicGatsbyPage = ({ data, location }) => {
|
|
19
|
+
const {
|
|
20
|
+
plasmicComponents,
|
|
21
|
+
plasmicOptions,
|
|
22
|
+
} = data;
|
|
23
|
+
const pageMeta = plasmicComponents.entryCompMetas[0];
|
|
24
|
+
const pageMetadata = pageMeta.pageMetadata;
|
|
25
|
+
return (
|
|
26
|
+
<PlasmicRootProvider
|
|
27
|
+
loader={initPlasmicLoaderWithRegistrations(plasmicOptions)}
|
|
28
|
+
prefetchedData={plasmicComponents}
|
|
29
|
+
pageParams={pageMeta.params}
|
|
30
|
+
pageQuery={Object.fromEntries(new URLSearchParams(location.search))}
|
|
31
|
+
Head={Helmet}
|
|
32
|
+
>
|
|
33
|
+
<Helmet>
|
|
34
|
+
{pageMetadata?.title && <title>{pageMetadata.title}</title>}
|
|
35
|
+
{pageMetadata?.title && <meta property="og:title" content={pageMetadata.title} /> }
|
|
36
|
+
{pageMetadata?.description && <meta property="og:description" content={pageMetadata.description} />}
|
|
37
|
+
{pageMetadata?.openGraphImageUrl && <meta property="og:image" content={pageMetadata.openGraphImageUrl} />}
|
|
38
|
+
</Helmet>
|
|
39
|
+
<PlasmicComponent component={pageMeta.displayName} />
|
|
40
|
+
</PlasmicRootProvider>
|
|
41
|
+
);
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export default PlasmicGatsbyPage;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import path from "path";
|
|
2
|
+
import type { GatsbyConfig } from "gatsby"
|
|
3
|
+
|
|
4
|
+
const config: GatsbyConfig = {
|
|
5
|
+
siteMetadata: {
|
|
6
|
+
siteUrl: `https://www.yourdomain.tld`,
|
|
7
|
+
},
|
|
8
|
+
// More easily incorporate content into your pages through automatic TypeScript type generation and better GraphQL IntelliSense.
|
|
9
|
+
// If you use VSCode you can also use the GraphQL plugin
|
|
10
|
+
// Learn more at: https://gatsby.dev/graphql-typegen
|
|
11
|
+
graphqlTypegen: true,
|
|
12
|
+
plugins: [{
|
|
13
|
+
resolve: "@plasmicapp/loader-gatsby",
|
|
14
|
+
options: {
|
|
15
|
+
projects: [
|
|
16
|
+
{
|
|
17
|
+
id: "47tFXWjN2C4NyHFGGpaYQ3",
|
|
18
|
+
token: "7BRFratDxPLMGZHnd2grV5QP6mlHcZ1AK3BJSIeh7xzUlHgWh25XpgXvUaKAqHXFMXQQuzpADqboibF6nqNWQ",
|
|
19
|
+
},
|
|
20
|
+
], // An array of project ids.
|
|
21
|
+
preview: false,
|
|
22
|
+
defaultPlasmicPage: path.resolve("./src/templates/defaultPlasmicPage.tsx"),
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
resolve: "gatsby-plugin-react-helmet",
|
|
27
|
+
}
|
|
28
|
+
]
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export default config
|
|
File without changes
|