create-plasmic-app 0.0.133 → 0.0.134
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/cpa-out/nextjs-app-codegen-js/app/dynamic/[slug]/page-client.jsx +7 -0
- package/cpa-out/nextjs-app-codegen-js/app/dynamic/[slug]/page.jsx +45 -0
- package/cpa-out/nextjs-app-codegen-js/app/layout.js +28 -0
- package/cpa-out/nextjs-app-codegen-js/app/layout.jsx +17 -0
- package/cpa-out/nextjs-app-codegen-js/app/page-client.jsx +7 -0
- package/cpa-out/nextjs-app-codegen-js/app/page.jsx +45 -0
- package/cpa-out/nextjs-app-codegen-js/app/plasmic-host/page.jsx +15 -0
- package/cpa-out/nextjs-app-codegen-js/components/Button.jsx +11 -0
- package/cpa-out/nextjs-app-codegen-js/components/RandomDynamicPageButton.jsx +24 -0
- package/cpa-out/nextjs-app-codegen-js/components/plasmic/create_plasmic_app/PlasmicButton.jsx +595 -0
- package/cpa-out/nextjs-app-codegen-js/components/plasmic/create_plasmic_app/PlasmicDynamicPage.jsx +216 -0
- package/cpa-out/nextjs-app-codegen-js/components/plasmic/create_plasmic_app/PlasmicDynamicPageServer.jsx +56 -0
- package/cpa-out/nextjs-app-codegen-js/components/plasmic/create_plasmic_app/PlasmicGlobalVariant__Screen.jsx +26 -0
- package/cpa-out/nextjs-app-codegen-js/components/plasmic/create_plasmic_app/PlasmicHomepage.jsx +251 -0
- package/cpa-out/nextjs-app-codegen-js/components/plasmic/create_plasmic_app/PlasmicHomepageServer.jsx +56 -0
- package/cpa-out/nextjs-app-codegen-js/components/plasmic/create_plasmic_app/PlasmicRandomDynamicPageButton.jsx +159 -0
- package/cpa-out/nextjs-app-codegen-js/components/plasmic/create_plasmic_app/PlasmicStyleTokensProvider.jsx +15 -0
- package/cpa-out/nextjs-app-codegen-js/components/plasmic/create_plasmic_app/icons/PlasmicIcon__CheckSvg.jsx +39 -0
- package/cpa-out/nextjs-app-codegen-js/components/plasmic/create_plasmic_app/icons/PlasmicIcon__Icon.jsx +37 -0
- package/cpa-out/nextjs-app-codegen-js/components/plasmic/create_plasmic_app/plasmic.jsx +11 -0
- package/cpa-out/nextjs-app-codegen-js/package.json +22 -0
- package/cpa-out/nextjs-app-codegen-js/plasmic.json +148 -0
- package/cpa-out/nextjs-app-codegen-ts/app/dynamic/[slug]/page-client.tsx +11 -0
- package/cpa-out/nextjs-app-codegen-ts/app/dynamic/[slug]/page.tsx +57 -0
- package/cpa-out/nextjs-app-codegen-ts/app/layout.tsx +19 -0
- package/cpa-out/nextjs-app-codegen-ts/app/page-client.tsx +11 -0
- package/cpa-out/nextjs-app-codegen-ts/app/page.tsx +54 -0
- package/cpa-out/nextjs-app-codegen-ts/app/plasmic-host/page.tsx +15 -0
- package/cpa-out/nextjs-app-codegen-ts/components/Button.tsx +35 -0
- package/cpa-out/nextjs-app-codegen-ts/components/RandomDynamicPageButton.tsx +44 -0
- package/cpa-out/nextjs-app-codegen-ts/components/plasmic/create_plasmic_app/PlasmicButton.tsx +776 -0
- package/cpa-out/nextjs-app-codegen-ts/components/plasmic/create_plasmic_app/PlasmicDynamicPage.tsx +329 -0
- package/cpa-out/nextjs-app-codegen-ts/components/plasmic/create_plasmic_app/PlasmicDynamicPageServer.tsx +77 -0
- package/cpa-out/nextjs-app-codegen-ts/components/plasmic/create_plasmic_app/PlasmicGlobalVariant__Screen.tsx +30 -0
- package/cpa-out/nextjs-app-codegen-ts/components/plasmic/create_plasmic_app/PlasmicHomepage.tsx +366 -0
- package/cpa-out/nextjs-app-codegen-ts/components/plasmic/create_plasmic_app/PlasmicHomepageServer.tsx +75 -0
- package/cpa-out/nextjs-app-codegen-ts/components/plasmic/create_plasmic_app/PlasmicRandomDynamicPageButton.tsx +274 -0
- package/cpa-out/nextjs-app-codegen-ts/components/plasmic/create_plasmic_app/PlasmicStyleTokensProvider.tsx +19 -0
- package/cpa-out/nextjs-app-codegen-ts/components/plasmic/create_plasmic_app/icons/PlasmicIcon__CheckSvg.tsx +44 -0
- package/cpa-out/nextjs-app-codegen-ts/components/plasmic/create_plasmic_app/icons/PlasmicIcon__Icon.tsx +41 -0
- package/cpa-out/nextjs-app-codegen-ts/components/plasmic/create_plasmic_app/plasmic.tsx +14 -0
- package/cpa-out/nextjs-app-codegen-ts/package.json +26 -0
- package/cpa-out/nextjs-app-codegen-ts/plasmic.json +148 -0
- package/cpa-out/nextjs-app-codegen-ts/tsconfig.json +26 -0
- package/dist/index.js +31 -28
- package/dist/nextjs/nextjs.js +37 -11
- package/dist/nextjs/templates/app-codegen/layout.d.ts +2 -0
- package/dist/nextjs/templates/app-codegen/layout.js +27 -0
- package/package.json +2 -2
- package/run-cpa.ts +8 -9
- package/src/index.ts +31 -34
- package/src/nextjs/nextjs.ts +67 -28
- package/src/nextjs/templates/app-codegen/layout.ts +28 -0
package/cpa-out/nextjs-app-codegen-js/components/plasmic/create_plasmic_app/PlasmicDynamicPage.jsx
ADDED
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
// @ts-nocheck
|
|
4
|
+
/* prettier-ignore-start */
|
|
5
|
+
/** @jsxRuntime classic */
|
|
6
|
+
/** @jsx createPlasmicElementProxy */
|
|
7
|
+
/** @jsxFrag React.Fragment */
|
|
8
|
+
// This class is auto-generated by Plasmic; please do not edit!
|
|
9
|
+
// Plasmic Project: 47tFXWjN2C4NyHFGGpaYQ3
|
|
10
|
+
// Component: AO44A-w7hh
|
|
11
|
+
"use client";
|
|
12
|
+
import * as React from "react";
|
|
13
|
+
import Head from "next/head";
|
|
14
|
+
import { useRouter } from "next/navigation";
|
|
15
|
+
import {
|
|
16
|
+
classNames,
|
|
17
|
+
createPlasmicElementProxy,
|
|
18
|
+
deriveRenderOpts
|
|
19
|
+
} from "@plasmicapp/react-web";
|
|
20
|
+
import { useDataEnv } from "@plasmicapp/host";
|
|
21
|
+
import RandomDynamicPageButton from "../../RandomDynamicPageButton"; // plasmic-import: Q23H1_1M_P/component
|
|
22
|
+
import { _useStyleTokens } from "./PlasmicStyleTokensProvider"; // plasmic-import: 47tFXWjN2C4NyHFGGpaYQ3/styleTokensProvider
|
|
23
|
+
import "@plasmicapp/react-web/lib/plasmic.css";
|
|
24
|
+
import projectcss from "./plasmic.module.css"; // plasmic-import: 47tFXWjN2C4NyHFGGpaYQ3/projectcss
|
|
25
|
+
import sty from "./PlasmicDynamicPage.module.css"; // plasmic-import: AO44A-w7hh/css
|
|
26
|
+
|
|
27
|
+
const emptyProxy = new Proxy(() => "", {
|
|
28
|
+
get(_, prop) {
|
|
29
|
+
return prop === Symbol.toPrimitive ? () => "" : emptyProxy;
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
function wrapQueriesWithLoadingProxy($q) {
|
|
34
|
+
return new Proxy($q, {
|
|
35
|
+
get(target, queryName) {
|
|
36
|
+
const query = target[queryName];
|
|
37
|
+
return !query || query.isLoading || !query.data ? emptyProxy : query;
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export function generateDynamicMetadata($q, $ctx) {
|
|
43
|
+
return {
|
|
44
|
+
openGraph: {},
|
|
45
|
+
twitter: {
|
|
46
|
+
card: "summary"
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
createPlasmicElementProxy;
|
|
52
|
+
|
|
53
|
+
export const PlasmicDynamicPage__VariantProps = new Array();
|
|
54
|
+
|
|
55
|
+
export const PlasmicDynamicPage__ArgProps = new Array();
|
|
56
|
+
|
|
57
|
+
const $$ = {};
|
|
58
|
+
|
|
59
|
+
function useNextRouter() {
|
|
60
|
+
try {
|
|
61
|
+
return useRouter();
|
|
62
|
+
} catch {}
|
|
63
|
+
return undefined;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function PlasmicDynamicPage__RenderFunc(props) {
|
|
67
|
+
const { variants, overrides, forNode } = props;
|
|
68
|
+
const args = React.useMemo(
|
|
69
|
+
() =>
|
|
70
|
+
Object.assign(
|
|
71
|
+
{},
|
|
72
|
+
Object.fromEntries(
|
|
73
|
+
Object.entries(props.args).filter(([_, v]) => v !== undefined)
|
|
74
|
+
)
|
|
75
|
+
),
|
|
76
|
+
[props.args]
|
|
77
|
+
);
|
|
78
|
+
const $props = {
|
|
79
|
+
...args,
|
|
80
|
+
...variants
|
|
81
|
+
};
|
|
82
|
+
const __nextRouter = useNextRouter();
|
|
83
|
+
const $ctx = useDataEnv?.() || {};
|
|
84
|
+
const refsRef = React.useRef({});
|
|
85
|
+
const $refs = refsRef.current;
|
|
86
|
+
const pageMetadata = generateDynamicMetadata(
|
|
87
|
+
wrapQueriesWithLoadingProxy({}),
|
|
88
|
+
$ctx
|
|
89
|
+
);
|
|
90
|
+
const styleTokensClassNames = _useStyleTokens();
|
|
91
|
+
return (
|
|
92
|
+
<React.Fragment>
|
|
93
|
+
<Head></Head>
|
|
94
|
+
|
|
95
|
+
<style>{`
|
|
96
|
+
body {
|
|
97
|
+
margin: 0;
|
|
98
|
+
}
|
|
99
|
+
`}</style>
|
|
100
|
+
|
|
101
|
+
<div className={projectcss.plasmic_page_wrapper}>
|
|
102
|
+
<div
|
|
103
|
+
data-plasmic-name={"root"}
|
|
104
|
+
data-plasmic-override={overrides.root}
|
|
105
|
+
data-plasmic-root={true}
|
|
106
|
+
data-plasmic-for-node={forNode}
|
|
107
|
+
className={classNames(
|
|
108
|
+
projectcss.all,
|
|
109
|
+
projectcss.root_reset,
|
|
110
|
+
projectcss.plasmic_default_styles,
|
|
111
|
+
projectcss.plasmic_mixins,
|
|
112
|
+
styleTokensClassNames,
|
|
113
|
+
sty.root
|
|
114
|
+
)}
|
|
115
|
+
>
|
|
116
|
+
<section
|
|
117
|
+
data-plasmic-name={"section"}
|
|
118
|
+
data-plasmic-override={overrides.section}
|
|
119
|
+
className={classNames(projectcss.all, sty.section)}
|
|
120
|
+
>
|
|
121
|
+
<h1
|
|
122
|
+
data-plasmic-name={"h1"}
|
|
123
|
+
data-plasmic-override={overrides.h1}
|
|
124
|
+
className={classNames(
|
|
125
|
+
projectcss.all,
|
|
126
|
+
projectcss.h1,
|
|
127
|
+
projectcss.__wab_text,
|
|
128
|
+
sty.h1
|
|
129
|
+
)}
|
|
130
|
+
>
|
|
131
|
+
<React.Fragment>
|
|
132
|
+
{(() => {
|
|
133
|
+
try {
|
|
134
|
+
return $ctx.params.slug;
|
|
135
|
+
} catch (e) {
|
|
136
|
+
if (
|
|
137
|
+
e instanceof TypeError ||
|
|
138
|
+
e?.plasmicType === "PlasmicUndefinedDataError"
|
|
139
|
+
) {
|
|
140
|
+
return "Page 1";
|
|
141
|
+
}
|
|
142
|
+
throw e;
|
|
143
|
+
}
|
|
144
|
+
})()}
|
|
145
|
+
</React.Fragment>
|
|
146
|
+
</h1>
|
|
147
|
+
<RandomDynamicPageButton
|
|
148
|
+
data-plasmic-name={"randomDynamicPageButton"}
|
|
149
|
+
data-plasmic-override={overrides.randomDynamicPageButton}
|
|
150
|
+
className={classNames(
|
|
151
|
+
"__wab_instance",
|
|
152
|
+
sty.randomDynamicPageButton
|
|
153
|
+
)}
|
|
154
|
+
/>
|
|
155
|
+
</section>
|
|
156
|
+
</div>
|
|
157
|
+
</div>
|
|
158
|
+
</React.Fragment>
|
|
159
|
+
);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
const PlasmicDescendants = {
|
|
163
|
+
root: ["root", "section", "h1", "randomDynamicPageButton"],
|
|
164
|
+
section: ["section", "h1", "randomDynamicPageButton"],
|
|
165
|
+
h1: ["h1"],
|
|
166
|
+
randomDynamicPageButton: ["randomDynamicPageButton"]
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
function makeNodeComponent(nodeName) {
|
|
170
|
+
const func = function (props) {
|
|
171
|
+
const { variants, args, overrides } = React.useMemo(
|
|
172
|
+
() =>
|
|
173
|
+
deriveRenderOpts(props, {
|
|
174
|
+
name: nodeName,
|
|
175
|
+
descendantNames: PlasmicDescendants[nodeName],
|
|
176
|
+
internalArgPropNames: PlasmicDynamicPage__ArgProps,
|
|
177
|
+
internalVariantPropNames: PlasmicDynamicPage__VariantProps
|
|
178
|
+
}),
|
|
179
|
+
[props, nodeName]
|
|
180
|
+
);
|
|
181
|
+
return PlasmicDynamicPage__RenderFunc({
|
|
182
|
+
variants,
|
|
183
|
+
args,
|
|
184
|
+
overrides,
|
|
185
|
+
forNode: nodeName
|
|
186
|
+
});
|
|
187
|
+
};
|
|
188
|
+
if (nodeName === "root") {
|
|
189
|
+
func.displayName = "PlasmicDynamicPage";
|
|
190
|
+
} else {
|
|
191
|
+
func.displayName = `PlasmicDynamicPage.${nodeName}`;
|
|
192
|
+
}
|
|
193
|
+
return func;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
export const PlasmicDynamicPage = Object.assign(
|
|
197
|
+
// Top-level PlasmicDynamicPage renders the root element
|
|
198
|
+
makeNodeComponent("root"),
|
|
199
|
+
{
|
|
200
|
+
// Helper components rendering sub-elements
|
|
201
|
+
section: makeNodeComponent("section"),
|
|
202
|
+
h1: makeNodeComponent("h1"),
|
|
203
|
+
randomDynamicPageButton: makeNodeComponent("randomDynamicPageButton"),
|
|
204
|
+
// Metadata about props expected for PlasmicDynamicPage
|
|
205
|
+
internalVariantProps: PlasmicDynamicPage__VariantProps,
|
|
206
|
+
internalArgProps: PlasmicDynamicPage__ArgProps,
|
|
207
|
+
pageMetadata: generateDynamicMetadata(wrapQueriesWithLoadingProxy({}), {
|
|
208
|
+
pagePath: "/dynamic/[slug]",
|
|
209
|
+
searchParams: {},
|
|
210
|
+
params: {}
|
|
211
|
+
})
|
|
212
|
+
}
|
|
213
|
+
);
|
|
214
|
+
|
|
215
|
+
export default PlasmicDynamicPage;
|
|
216
|
+
/* prettier-ignore-end */
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
// @ts-nocheck
|
|
4
|
+
/* prettier-ignore-start */
|
|
5
|
+
// This class is auto-generated by Plasmic; please do not edit!
|
|
6
|
+
// Plasmic Project: 47tFXWjN2C4NyHFGGpaYQ3
|
|
7
|
+
// Component: AO44A-w7hh
|
|
8
|
+
import * as React from "react";
|
|
9
|
+
import { ClientDynamicPage } from "../../../app/dynamic/[slug]/page-client"; // plasmic-import: AO44A-w7hh/rscClient
|
|
10
|
+
|
|
11
|
+
const $$ = {};
|
|
12
|
+
|
|
13
|
+
export function generateDynamicMetadata($q, $ctx) {
|
|
14
|
+
return {
|
|
15
|
+
openGraph: {},
|
|
16
|
+
twitter: {
|
|
17
|
+
card: "summary"
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function mkPathFromRouteAndParams(route, params) {
|
|
23
|
+
if (!params) {
|
|
24
|
+
return route;
|
|
25
|
+
}
|
|
26
|
+
let path = route;
|
|
27
|
+
for (const [key, value] of Object.entries(params)) {
|
|
28
|
+
if (typeof value === "string") {
|
|
29
|
+
path = path.replace(`[${key}]`, value);
|
|
30
|
+
} else if (Array.isArray(value)) {
|
|
31
|
+
if (path.includes(`[[...${key}]]`)) {
|
|
32
|
+
path = path.replace(`[[...${key}]]`, value.join("/"));
|
|
33
|
+
} else if (path.includes(`[...${key}]`)) {
|
|
34
|
+
path = path.replace(`[...${key}]`, value.join("/"));
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return path;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export async function makeAppRouterPageCtx({ params, searchParams }) {
|
|
42
|
+
const pageRoute = "/dynamic/[slug]";
|
|
43
|
+
const pageParams = (await params) ?? {};
|
|
44
|
+
const pagePath = mkPathFromRouteAndParams(pageRoute, pageParams);
|
|
45
|
+
const ctx = {
|
|
46
|
+
pageRoute,
|
|
47
|
+
pagePath,
|
|
48
|
+
params: pageParams,
|
|
49
|
+
query: (await searchParams) ?? {}
|
|
50
|
+
};
|
|
51
|
+
return ctx;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export async function PlasmicDynamicPageServer(props) {
|
|
55
|
+
return <ClientDynamicPage {...props} />;
|
|
56
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
// @ts-nocheck
|
|
4
|
+
/* prettier-ignore-start */
|
|
5
|
+
"use client";
|
|
6
|
+
import * as React from "react";
|
|
7
|
+
import { createUseScreenVariants } from "@plasmicapp/react-web";
|
|
8
|
+
|
|
9
|
+
export const ScreenContext = React.createContext(
|
|
10
|
+
"PLEASE_RENDER_INSIDE_PROVIDER"
|
|
11
|
+
);
|
|
12
|
+
|
|
13
|
+
export function ScreenContextProvider(props) {
|
|
14
|
+
return (
|
|
15
|
+
<ScreenContext.Provider value={props.value}>
|
|
16
|
+
{props.children}
|
|
17
|
+
</ScreenContext.Provider>
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export const useScreenVariants = createUseScreenVariants(true, {
|
|
22
|
+
desktopOnly: "(min-width:768px)"
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
export default ScreenContext;
|
|
26
|
+
/* prettier-ignore-end */
|
package/cpa-out/nextjs-app-codegen-js/components/plasmic/create_plasmic_app/PlasmicHomepage.jsx
ADDED
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
// @ts-nocheck
|
|
4
|
+
/* prettier-ignore-start */
|
|
5
|
+
/** @jsxRuntime classic */
|
|
6
|
+
/** @jsx createPlasmicElementProxy */
|
|
7
|
+
/** @jsxFrag React.Fragment */
|
|
8
|
+
// This class is auto-generated by Plasmic; please do not edit!
|
|
9
|
+
// Plasmic Project: 47tFXWjN2C4NyHFGGpaYQ3
|
|
10
|
+
// Component: 6uuAAE1jiCew
|
|
11
|
+
"use client";
|
|
12
|
+
import * as React from "react";
|
|
13
|
+
import Head from "next/head";
|
|
14
|
+
import { useRouter } from "next/navigation";
|
|
15
|
+
import {
|
|
16
|
+
classNames,
|
|
17
|
+
createPlasmicElementProxy,
|
|
18
|
+
deriveRenderOpts,
|
|
19
|
+
hasVariant
|
|
20
|
+
} from "@plasmicapp/react-web";
|
|
21
|
+
import { useDataEnv } from "@plasmicapp/host";
|
|
22
|
+
import RandomDynamicPageButton from "../../RandomDynamicPageButton"; // plasmic-import: Q23H1_1M_P/component
|
|
23
|
+
import { _useGlobalVariants } from "./plasmic"; // plasmic-import: 47tFXWjN2C4NyHFGGpaYQ3/projectModule
|
|
24
|
+
import { _useStyleTokens } from "./PlasmicStyleTokensProvider"; // plasmic-import: 47tFXWjN2C4NyHFGGpaYQ3/styleTokensProvider
|
|
25
|
+
import "@plasmicapp/react-web/lib/plasmic.css";
|
|
26
|
+
import projectcss from "./plasmic.module.css"; // plasmic-import: 47tFXWjN2C4NyHFGGpaYQ3/projectcss
|
|
27
|
+
import sty from "./PlasmicHomepage.module.css"; // plasmic-import: 6uuAAE1jiCew/css
|
|
28
|
+
|
|
29
|
+
const emptyProxy = new Proxy(() => "", {
|
|
30
|
+
get(_, prop) {
|
|
31
|
+
return prop === Symbol.toPrimitive ? () => "" : emptyProxy;
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
function wrapQueriesWithLoadingProxy($q) {
|
|
36
|
+
return new Proxy($q, {
|
|
37
|
+
get(target, queryName) {
|
|
38
|
+
const query = target[queryName];
|
|
39
|
+
return !query || query.isLoading || !query.data ? emptyProxy : query;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export function generateDynamicMetadata($q, $ctx) {
|
|
45
|
+
return {
|
|
46
|
+
openGraph: {},
|
|
47
|
+
twitter: {
|
|
48
|
+
card: "summary"
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
createPlasmicElementProxy;
|
|
54
|
+
|
|
55
|
+
export const PlasmicHomepage__VariantProps = new Array();
|
|
56
|
+
|
|
57
|
+
export const PlasmicHomepage__ArgProps = new Array();
|
|
58
|
+
|
|
59
|
+
const $$ = {};
|
|
60
|
+
|
|
61
|
+
function useNextRouter() {
|
|
62
|
+
try {
|
|
63
|
+
return useRouter();
|
|
64
|
+
} catch {}
|
|
65
|
+
return undefined;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function PlasmicHomepage__RenderFunc(props) {
|
|
69
|
+
const { variants, overrides, forNode } = props;
|
|
70
|
+
const args = React.useMemo(
|
|
71
|
+
() =>
|
|
72
|
+
Object.assign(
|
|
73
|
+
{},
|
|
74
|
+
Object.fromEntries(
|
|
75
|
+
Object.entries(props.args).filter(([_, v]) => v !== undefined)
|
|
76
|
+
)
|
|
77
|
+
),
|
|
78
|
+
[props.args]
|
|
79
|
+
);
|
|
80
|
+
const $props = {
|
|
81
|
+
...args,
|
|
82
|
+
...variants
|
|
83
|
+
};
|
|
84
|
+
const __nextRouter = useNextRouter();
|
|
85
|
+
const $ctx = useDataEnv?.() || {};
|
|
86
|
+
const refsRef = React.useRef({});
|
|
87
|
+
const $refs = refsRef.current;
|
|
88
|
+
const globalVariants = _useGlobalVariants();
|
|
89
|
+
const pageMetadata = generateDynamicMetadata(
|
|
90
|
+
wrapQueriesWithLoadingProxy({}),
|
|
91
|
+
$ctx
|
|
92
|
+
);
|
|
93
|
+
const styleTokensClassNames = _useStyleTokens();
|
|
94
|
+
return (
|
|
95
|
+
<React.Fragment>
|
|
96
|
+
<Head></Head>
|
|
97
|
+
|
|
98
|
+
<style>{`
|
|
99
|
+
body {
|
|
100
|
+
margin: 0;
|
|
101
|
+
}
|
|
102
|
+
`}</style>
|
|
103
|
+
|
|
104
|
+
<div className={projectcss.plasmic_page_wrapper}>
|
|
105
|
+
<div
|
|
106
|
+
data-plasmic-name={"root"}
|
|
107
|
+
data-plasmic-override={overrides.root}
|
|
108
|
+
data-plasmic-root={true}
|
|
109
|
+
data-plasmic-for-node={forNode}
|
|
110
|
+
className={classNames(
|
|
111
|
+
projectcss.all,
|
|
112
|
+
projectcss.root_reset,
|
|
113
|
+
projectcss.plasmic_default_styles,
|
|
114
|
+
projectcss.plasmic_mixins,
|
|
115
|
+
styleTokensClassNames,
|
|
116
|
+
sty.root
|
|
117
|
+
)}
|
|
118
|
+
>
|
|
119
|
+
<section
|
|
120
|
+
data-plasmic-name={"section"}
|
|
121
|
+
data-plasmic-override={overrides.section}
|
|
122
|
+
className={classNames(projectcss.all, sty.section)}
|
|
123
|
+
>
|
|
124
|
+
<h1
|
|
125
|
+
data-plasmic-name={"h1"}
|
|
126
|
+
data-plasmic-override={overrides.h1}
|
|
127
|
+
className={classNames(
|
|
128
|
+
projectcss.all,
|
|
129
|
+
projectcss.h1,
|
|
130
|
+
projectcss.__wab_text,
|
|
131
|
+
sty.h1
|
|
132
|
+
)}
|
|
133
|
+
>
|
|
134
|
+
{"create-plasmic-app"}
|
|
135
|
+
</h1>
|
|
136
|
+
<div
|
|
137
|
+
data-plasmic-name={"text"}
|
|
138
|
+
data-plasmic-override={overrides.text}
|
|
139
|
+
className={classNames(
|
|
140
|
+
projectcss.all,
|
|
141
|
+
projectcss.__wab_text,
|
|
142
|
+
sty.text
|
|
143
|
+
)}
|
|
144
|
+
>
|
|
145
|
+
{hasVariant(globalVariants, "screen", "desktopOnly") ? (
|
|
146
|
+
<React.Fragment>
|
|
147
|
+
<React.Fragment>
|
|
148
|
+
{
|
|
149
|
+
"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. "
|
|
150
|
+
}
|
|
151
|
+
</React.Fragment>
|
|
152
|
+
<span
|
|
153
|
+
className={"plasmic_default__all plasmic_default__span"}
|
|
154
|
+
style={{ fontWeight: 700 }}
|
|
155
|
+
>
|
|
156
|
+
{"Therefore, please avoid changing this project."}
|
|
157
|
+
</span>
|
|
158
|
+
</React.Fragment>
|
|
159
|
+
) : (
|
|
160
|
+
<React.Fragment>
|
|
161
|
+
<React.Fragment>
|
|
162
|
+
{
|
|
163
|
+
"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\u2014do 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\u2014press the "
|
|
164
|
+
}
|
|
165
|
+
</React.Fragment>
|
|
166
|
+
<span
|
|
167
|
+
className={"plasmic_default__all plasmic_default__span"}
|
|
168
|
+
style={{ fontWeight: 700 }}
|
|
169
|
+
>
|
|
170
|
+
{"Code"}
|
|
171
|
+
</span>
|
|
172
|
+
<React.Fragment>
|
|
173
|
+
{
|
|
174
|
+
" button in the top right and follow the quickstart instructions.\n\nJoin our Slack community (icon in bottom left) for help any time."
|
|
175
|
+
}
|
|
176
|
+
</React.Fragment>
|
|
177
|
+
</React.Fragment>
|
|
178
|
+
)}
|
|
179
|
+
</div>
|
|
180
|
+
<RandomDynamicPageButton
|
|
181
|
+
data-plasmic-name={"randomDynamicPageButton"}
|
|
182
|
+
data-plasmic-override={overrides.randomDynamicPageButton}
|
|
183
|
+
className={classNames(
|
|
184
|
+
"__wab_instance",
|
|
185
|
+
sty.randomDynamicPageButton
|
|
186
|
+
)}
|
|
187
|
+
/>
|
|
188
|
+
</section>
|
|
189
|
+
</div>
|
|
190
|
+
</div>
|
|
191
|
+
</React.Fragment>
|
|
192
|
+
);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
const PlasmicDescendants = {
|
|
196
|
+
root: ["root", "section", "h1", "text", "randomDynamicPageButton"],
|
|
197
|
+
section: ["section", "h1", "text", "randomDynamicPageButton"],
|
|
198
|
+
h1: ["h1"],
|
|
199
|
+
text: ["text"],
|
|
200
|
+
randomDynamicPageButton: ["randomDynamicPageButton"]
|
|
201
|
+
};
|
|
202
|
+
|
|
203
|
+
function makeNodeComponent(nodeName) {
|
|
204
|
+
const func = function (props) {
|
|
205
|
+
const { variants, args, overrides } = React.useMemo(
|
|
206
|
+
() =>
|
|
207
|
+
deriveRenderOpts(props, {
|
|
208
|
+
name: nodeName,
|
|
209
|
+
descendantNames: PlasmicDescendants[nodeName],
|
|
210
|
+
internalArgPropNames: PlasmicHomepage__ArgProps,
|
|
211
|
+
internalVariantPropNames: PlasmicHomepage__VariantProps
|
|
212
|
+
}),
|
|
213
|
+
[props, nodeName]
|
|
214
|
+
);
|
|
215
|
+
return PlasmicHomepage__RenderFunc({
|
|
216
|
+
variants,
|
|
217
|
+
args,
|
|
218
|
+
overrides,
|
|
219
|
+
forNode: nodeName
|
|
220
|
+
});
|
|
221
|
+
};
|
|
222
|
+
if (nodeName === "root") {
|
|
223
|
+
func.displayName = "PlasmicHomepage";
|
|
224
|
+
} else {
|
|
225
|
+
func.displayName = `PlasmicHomepage.${nodeName}`;
|
|
226
|
+
}
|
|
227
|
+
return func;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
export const PlasmicHomepage = Object.assign(
|
|
231
|
+
// Top-level PlasmicHomepage renders the root element
|
|
232
|
+
makeNodeComponent("root"),
|
|
233
|
+
{
|
|
234
|
+
// Helper components rendering sub-elements
|
|
235
|
+
section: makeNodeComponent("section"),
|
|
236
|
+
h1: makeNodeComponent("h1"),
|
|
237
|
+
text: makeNodeComponent("text"),
|
|
238
|
+
randomDynamicPageButton: makeNodeComponent("randomDynamicPageButton"),
|
|
239
|
+
// Metadata about props expected for PlasmicHomepage
|
|
240
|
+
internalVariantProps: PlasmicHomepage__VariantProps,
|
|
241
|
+
internalArgProps: PlasmicHomepage__ArgProps,
|
|
242
|
+
pageMetadata: generateDynamicMetadata(wrapQueriesWithLoadingProxy({}), {
|
|
243
|
+
pagePath: "/",
|
|
244
|
+
searchParams: {},
|
|
245
|
+
params: {}
|
|
246
|
+
})
|
|
247
|
+
}
|
|
248
|
+
);
|
|
249
|
+
|
|
250
|
+
export default PlasmicHomepage;
|
|
251
|
+
/* prettier-ignore-end */
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
// @ts-nocheck
|
|
4
|
+
/* prettier-ignore-start */
|
|
5
|
+
// This class is auto-generated by Plasmic; please do not edit!
|
|
6
|
+
// Plasmic Project: 47tFXWjN2C4NyHFGGpaYQ3
|
|
7
|
+
// Component: 6uuAAE1jiCew
|
|
8
|
+
import * as React from "react";
|
|
9
|
+
import { ClientHomepage } from "../../../app/page-client"; // plasmic-import: 6uuAAE1jiCew/rscClient
|
|
10
|
+
|
|
11
|
+
const $$ = {};
|
|
12
|
+
|
|
13
|
+
export function generateDynamicMetadata($q, $ctx) {
|
|
14
|
+
return {
|
|
15
|
+
openGraph: {},
|
|
16
|
+
twitter: {
|
|
17
|
+
card: "summary"
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function mkPathFromRouteAndParams(route, params) {
|
|
23
|
+
if (!params) {
|
|
24
|
+
return route;
|
|
25
|
+
}
|
|
26
|
+
let path = route;
|
|
27
|
+
for (const [key, value] of Object.entries(params)) {
|
|
28
|
+
if (typeof value === "string") {
|
|
29
|
+
path = path.replace(`[${key}]`, value);
|
|
30
|
+
} else if (Array.isArray(value)) {
|
|
31
|
+
if (path.includes(`[[...${key}]]`)) {
|
|
32
|
+
path = path.replace(`[[...${key}]]`, value.join("/"));
|
|
33
|
+
} else if (path.includes(`[...${key}]`)) {
|
|
34
|
+
path = path.replace(`[...${key}]`, value.join("/"));
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return path;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export async function makeAppRouterPageCtx({ params, searchParams }) {
|
|
42
|
+
const pageRoute = "/";
|
|
43
|
+
const pageParams = (await params) ?? {};
|
|
44
|
+
const pagePath = mkPathFromRouteAndParams(pageRoute, pageParams);
|
|
45
|
+
const ctx = {
|
|
46
|
+
pageRoute,
|
|
47
|
+
pagePath,
|
|
48
|
+
params: pageParams,
|
|
49
|
+
query: (await searchParams) ?? {}
|
|
50
|
+
};
|
|
51
|
+
return ctx;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export async function PlasmicHomepageServer(props) {
|
|
55
|
+
return <ClientHomepage {...props} />;
|
|
56
|
+
}
|