create-plasmic-app 0.0.95 → 0.0.97
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/react-codegen-js/eslint.config.js +38 -0
- package/cpa-out/react-codegen-js/package.json +22 -32
- package/cpa-out/react-codegen-js/plasmic.json +16 -10
- package/cpa-out/react-codegen-js/src/App.jsx +1 -1
- package/cpa-out/react-codegen-js/src/components/Button.jsx +1 -3
- package/cpa-out/react-codegen-js/src/components/plasmic/create_plasmic_app/PlasmicButton.jsx +47 -96
- package/cpa-out/react-codegen-js/src/components/plasmic/create_plasmic_app/PlasmicDynamicPage.jsx +35 -29
- package/cpa-out/react-codegen-js/src/components/plasmic/create_plasmic_app/PlasmicGlobalVariant__Screen.jsx +2 -14
- package/cpa-out/react-codegen-js/src/components/plasmic/create_plasmic_app/PlasmicHomepage.jsx +24 -24
- package/cpa-out/react-codegen-js/src/components/plasmic/create_plasmic_app/PlasmicRandomDynamicPageButton.jsx +44 -58
- package/cpa-out/react-codegen-js/src/components/plasmic/create_plasmic_app/icons/PlasmicIcon__Checksvg.jsx +2 -2
- package/cpa-out/react-codegen-js/src/main.jsx +10 -0
- package/cpa-out/react-codegen-js/vite.config.js +7 -0
- package/cpa-out/react-codegen-ts/eslint.config.js +28 -0
- package/cpa-out/react-codegen-ts/package.json +23 -37
- package/cpa-out/react-codegen-ts/plasmic.json +16 -10
- package/cpa-out/react-codegen-ts/src/App.tsx +1 -1
- package/cpa-out/react-codegen-ts/src/components/Button.tsx +4 -5
- package/cpa-out/react-codegen-ts/src/components/plasmic/create_plasmic_app/PlasmicButton.tsx +84 -62
- package/cpa-out/react-codegen-ts/src/components/plasmic/create_plasmic_app/PlasmicDynamicPage.tsx +73 -44
- package/cpa-out/react-codegen-ts/src/components/plasmic/create_plasmic_app/PlasmicGlobalVariant__Screen.tsx +2 -14
- package/cpa-out/react-codegen-ts/src/components/plasmic/create_plasmic_app/PlasmicHomepage.tsx +62 -38
- package/cpa-out/react-codegen-ts/src/components/plasmic/create_plasmic_app/PlasmicRandomDynamicPageButton.tsx +83 -70
- package/cpa-out/react-codegen-ts/src/components/plasmic/create_plasmic_app/icons/PlasmicIcon__Checksvg.tsx +3 -3
- package/cpa-out/react-codegen-ts/src/main.tsx +10 -0
- package/cpa-out/react-codegen-ts/src/vite-env.d.ts +1 -0
- package/cpa-out/react-codegen-ts/tsconfig.json +4 -23
- package/cpa-out/react-codegen-ts/vite.config.ts +7 -0
- package/dist/gatsby/template.js +2 -1
- package/dist/lib.js +1 -1
- package/dist/nextjs/templates/pages-codegen/app.js +2 -1
- package/dist/react/react.js +36 -11
- package/package.json +2 -2
- package/src/gatsby/template.ts +2 -1
- package/src/lib.ts +1 -1
- package/src/nextjs/templates/pages-codegen/app.ts +2 -1
- package/src/react/react.ts +47 -16
- package/cpa-out/react-codegen-js/src/index.js +0 -17
- package/cpa-out/react-codegen-js/src/reportWebVitals.js +0 -13
- package/cpa-out/react-codegen-js/src/setupTests.js +0 -5
- package/cpa-out/react-codegen-ts/src/index.tsx +0 -19
- package/cpa-out/react-codegen-ts/src/react-app-env.d.ts +0 -1
- package/cpa-out/react-codegen-ts/src/reportWebVitals.ts +0 -15
- package/cpa-out/react-codegen-ts/src/setupTests.ts +0 -5
- package/cpa-out/react-loader-js/package.json +0 -40
- package/cpa-out/react-loader-js/plasmic.json +0 -127
- package/cpa-out/react-loader-js/src/App.jsx +0 -9
- package/cpa-out/react-loader-js/src/components/Button.jsx +0 -13
- package/cpa-out/react-loader-js/src/components/DynamicPage.jsx +0 -26
- package/cpa-out/react-loader-js/src/components/Homepage.jsx +0 -26
- package/cpa-out/react-loader-js/src/components/RandomDynamicPageButton.jsx +0 -24
- package/cpa-out/react-loader-js/src/components/plasmic/create_plasmic_app/PlasmicButton.jsx +0 -625
- package/cpa-out/react-loader-js/src/components/plasmic/create_plasmic_app/PlasmicDynamicPage.jsx +0 -166
- package/cpa-out/react-loader-js/src/components/plasmic/create_plasmic_app/PlasmicGlobalVariant__Screen.jsx +0 -29
- package/cpa-out/react-loader-js/src/components/plasmic/create_plasmic_app/PlasmicHomepage.jsx +0 -210
- package/cpa-out/react-loader-js/src/components/plasmic/create_plasmic_app/PlasmicRandomDynamicPageButton.jsx +0 -161
- package/cpa-out/react-loader-js/src/components/plasmic/create_plasmic_app/icons/PlasmicIcon__Checksvg.jsx +0 -39
- package/cpa-out/react-loader-js/src/components/plasmic/create_plasmic_app/icons/PlasmicIcon__Icon.jsx +0 -37
- package/cpa-out/react-loader-js/src/index.js +0 -17
- package/cpa-out/react-loader-js/src/reportWebVitals.js +0 -13
- package/cpa-out/react-loader-js/src/setupTests.js +0 -5
- package/cpa-out/react-loader-ts/package.json +0 -45
- package/cpa-out/react-loader-ts/plasmic.json +0 -127
- package/cpa-out/react-loader-ts/src/App.tsx +0 -9
- package/cpa-out/react-loader-ts/src/components/Button.tsx +0 -36
- package/cpa-out/react-loader-ts/src/components/DynamicPage.tsx +0 -45
- package/cpa-out/react-loader-ts/src/components/Homepage.tsx +0 -45
- package/cpa-out/react-loader-ts/src/components/RandomDynamicPageButton.tsx +0 -44
- package/cpa-out/react-loader-ts/src/components/plasmic/create_plasmic_app/PlasmicButton.tsx +0 -725
- package/cpa-out/react-loader-ts/src/components/plasmic/create_plasmic_app/PlasmicDynamicPage.tsx +0 -248
- package/cpa-out/react-loader-ts/src/components/plasmic/create_plasmic_app/PlasmicGlobalVariant__Screen.tsx +0 -31
- package/cpa-out/react-loader-ts/src/components/plasmic/create_plasmic_app/PlasmicHomepage.tsx +0 -294
- package/cpa-out/react-loader-ts/src/components/plasmic/create_plasmic_app/PlasmicRandomDynamicPageButton.tsx +0 -240
- package/cpa-out/react-loader-ts/src/components/plasmic/create_plasmic_app/icons/PlasmicIcon__Checksvg.tsx +0 -44
- package/cpa-out/react-loader-ts/src/components/plasmic/create_plasmic_app/icons/PlasmicIcon__Icon.tsx +0 -41
- package/cpa-out/react-loader-ts/src/index.tsx +0 -19
- package/cpa-out/react-loader-ts/src/react-app-env.d.ts +0 -1
- package/cpa-out/react-loader-ts/src/reportWebVitals.ts +0 -15
- package/cpa-out/react-loader-ts/src/setupTests.ts +0 -5
- package/cpa-out/react-loader-ts/tsconfig.json +0 -26
package/cpa-out/react-loader-ts/src/components/plasmic/create_plasmic_app/PlasmicDynamicPage.tsx
DELETED
|
@@ -1,248 +0,0 @@
|
|
|
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: AO44A-w7hh
|
|
13
|
-
|
|
14
|
-
import * as React from "react";
|
|
15
|
-
|
|
16
|
-
import * as p from "@plasmicapp/react-web";
|
|
17
|
-
import * as ph from "@plasmicapp/react-web/lib/host";
|
|
18
|
-
|
|
19
|
-
import {
|
|
20
|
-
hasVariant,
|
|
21
|
-
classNames,
|
|
22
|
-
wrapWithClassName,
|
|
23
|
-
createPlasmicElementProxy,
|
|
24
|
-
makeFragment,
|
|
25
|
-
MultiChoiceArg,
|
|
26
|
-
SingleBooleanChoiceArg,
|
|
27
|
-
SingleChoiceArg,
|
|
28
|
-
pick,
|
|
29
|
-
omit,
|
|
30
|
-
useTrigger,
|
|
31
|
-
StrictProps,
|
|
32
|
-
deriveRenderOpts,
|
|
33
|
-
ensureGlobalVariants
|
|
34
|
-
} from "@plasmicapp/react-web";
|
|
35
|
-
import RandomDynamicPageButton from "../../RandomDynamicPageButton"; // plasmic-import: Q23H1_1M_P/component
|
|
36
|
-
|
|
37
|
-
import "@plasmicapp/react-web/lib/plasmic.css";
|
|
38
|
-
|
|
39
|
-
import projectcss from "./plasmic_create_plasmic_app.module.css"; // plasmic-import: 47tFXWjN2C4NyHFGGpaYQ3/projectcss
|
|
40
|
-
import sty from "./PlasmicDynamicPage.module.css"; // plasmic-import: AO44A-w7hh/css
|
|
41
|
-
|
|
42
|
-
export type PlasmicDynamicPage__VariantMembers = {};
|
|
43
|
-
export type PlasmicDynamicPage__VariantsArgs = {};
|
|
44
|
-
type VariantPropType = keyof PlasmicDynamicPage__VariantsArgs;
|
|
45
|
-
export const PlasmicDynamicPage__VariantProps = new Array<VariantPropType>();
|
|
46
|
-
|
|
47
|
-
export type PlasmicDynamicPage__ArgsType = {};
|
|
48
|
-
type ArgPropType = keyof PlasmicDynamicPage__ArgsType;
|
|
49
|
-
export const PlasmicDynamicPage__ArgProps = new Array<ArgPropType>();
|
|
50
|
-
|
|
51
|
-
export type PlasmicDynamicPage__OverridesType = {
|
|
52
|
-
root?: p.Flex<"div">;
|
|
53
|
-
section?: p.Flex<"section">;
|
|
54
|
-
h1?: p.Flex<"h1">;
|
|
55
|
-
randomDynamicPageButton?: p.Flex<typeof RandomDynamicPageButton>;
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
export interface DefaultDynamicPageProps {
|
|
59
|
-
className?: string;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
const __wrapUserFunction =
|
|
63
|
-
globalThis.__PlasmicWrapUserFunction ?? ((loc, fn) => fn());
|
|
64
|
-
const __wrapUserPromise =
|
|
65
|
-
globalThis.__PlasmicWrapUserPromise ??
|
|
66
|
-
(async (loc, promise) => {
|
|
67
|
-
return await promise;
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
function PlasmicDynamicPage__RenderFunc(props: {
|
|
71
|
-
variants: PlasmicDynamicPage__VariantsArgs;
|
|
72
|
-
args: PlasmicDynamicPage__ArgsType;
|
|
73
|
-
overrides: PlasmicDynamicPage__OverridesType;
|
|
74
|
-
forNode?: string;
|
|
75
|
-
}) {
|
|
76
|
-
const { variants, overrides, forNode } = props;
|
|
77
|
-
|
|
78
|
-
const $ctx = ph.useDataEnv?.() || {};
|
|
79
|
-
const args = React.useMemo(() => Object.assign({}, props.args), [props.args]);
|
|
80
|
-
|
|
81
|
-
const $props = {
|
|
82
|
-
...args,
|
|
83
|
-
...variants
|
|
84
|
-
};
|
|
85
|
-
const refsRef = React.useRef({});
|
|
86
|
-
const $refs = refsRef.current;
|
|
87
|
-
|
|
88
|
-
const currentUser = p.useCurrentUser?.() || {};
|
|
89
|
-
const [$queries, setDollarQueries] = React.useState({});
|
|
90
|
-
|
|
91
|
-
return (
|
|
92
|
-
<React.Fragment>
|
|
93
|
-
{}
|
|
94
|
-
|
|
95
|
-
<div className={projectcss.plasmic_page_wrapper}>
|
|
96
|
-
<div
|
|
97
|
-
data-plasmic-name={"root"}
|
|
98
|
-
data-plasmic-override={overrides.root}
|
|
99
|
-
data-plasmic-root={true}
|
|
100
|
-
data-plasmic-for-node={forNode}
|
|
101
|
-
className={classNames(
|
|
102
|
-
projectcss.all,
|
|
103
|
-
projectcss.root_reset,
|
|
104
|
-
projectcss.plasmic_default_styles,
|
|
105
|
-
projectcss.plasmic_mixins,
|
|
106
|
-
sty.root
|
|
107
|
-
)}
|
|
108
|
-
>
|
|
109
|
-
<p.Stack
|
|
110
|
-
as={"section"}
|
|
111
|
-
data-plasmic-name={"section"}
|
|
112
|
-
data-plasmic-override={overrides.section}
|
|
113
|
-
hasGap={true}
|
|
114
|
-
className={classNames(projectcss.all, sty.section)}
|
|
115
|
-
>
|
|
116
|
-
<h1
|
|
117
|
-
data-plasmic-name={"h1"}
|
|
118
|
-
data-plasmic-override={overrides.h1}
|
|
119
|
-
className={classNames(
|
|
120
|
-
projectcss.all,
|
|
121
|
-
projectcss.h1,
|
|
122
|
-
projectcss.__wab_text,
|
|
123
|
-
sty.h1
|
|
124
|
-
)}
|
|
125
|
-
>
|
|
126
|
-
{(() => {
|
|
127
|
-
try {
|
|
128
|
-
return $ctx.params.slug;
|
|
129
|
-
} catch (e) {
|
|
130
|
-
if (e instanceof TypeError) {
|
|
131
|
-
return "Page 1";
|
|
132
|
-
}
|
|
133
|
-
throw e;
|
|
134
|
-
}
|
|
135
|
-
})()}
|
|
136
|
-
</h1>
|
|
137
|
-
|
|
138
|
-
<RandomDynamicPageButton
|
|
139
|
-
data-plasmic-name={"randomDynamicPageButton"}
|
|
140
|
-
data-plasmic-override={overrides.randomDynamicPageButton}
|
|
141
|
-
className={classNames(
|
|
142
|
-
"__wab_instance",
|
|
143
|
-
sty.randomDynamicPageButton
|
|
144
|
-
)}
|
|
145
|
-
/>
|
|
146
|
-
</p.Stack>
|
|
147
|
-
</div>
|
|
148
|
-
</div>
|
|
149
|
-
</React.Fragment>
|
|
150
|
-
) as React.ReactElement | null;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
const PlasmicDescendants = {
|
|
154
|
-
root: ["root", "section", "h1", "randomDynamicPageButton"],
|
|
155
|
-
section: ["section", "h1", "randomDynamicPageButton"],
|
|
156
|
-
h1: ["h1"],
|
|
157
|
-
randomDynamicPageButton: ["randomDynamicPageButton"]
|
|
158
|
-
} as const;
|
|
159
|
-
type NodeNameType = keyof typeof PlasmicDescendants;
|
|
160
|
-
type DescendantsType<T extends NodeNameType> =
|
|
161
|
-
(typeof PlasmicDescendants)[T][number];
|
|
162
|
-
type NodeDefaultElementType = {
|
|
163
|
-
root: "div";
|
|
164
|
-
section: "section";
|
|
165
|
-
h1: "h1";
|
|
166
|
-
randomDynamicPageButton: typeof RandomDynamicPageButton;
|
|
167
|
-
};
|
|
168
|
-
|
|
169
|
-
type ReservedPropsType = "variants" | "args" | "overrides";
|
|
170
|
-
type NodeOverridesType<T extends NodeNameType> = Pick<
|
|
171
|
-
PlasmicDynamicPage__OverridesType,
|
|
172
|
-
DescendantsType<T>
|
|
173
|
-
>;
|
|
174
|
-
type NodeComponentProps<T extends NodeNameType> =
|
|
175
|
-
// Explicitly specify variants, args, and overrides as objects
|
|
176
|
-
{
|
|
177
|
-
variants?: PlasmicDynamicPage__VariantsArgs;
|
|
178
|
-
args?: PlasmicDynamicPage__ArgsType;
|
|
179
|
-
overrides?: NodeOverridesType<T>;
|
|
180
|
-
} & Omit<PlasmicDynamicPage__VariantsArgs, ReservedPropsType> & // Specify variants directly as props
|
|
181
|
-
/* Specify args directly as props*/ Omit<
|
|
182
|
-
PlasmicDynamicPage__ArgsType,
|
|
183
|
-
ReservedPropsType
|
|
184
|
-
> &
|
|
185
|
-
/* Specify overrides for each element directly as props*/ Omit<
|
|
186
|
-
NodeOverridesType<T>,
|
|
187
|
-
ReservedPropsType | VariantPropType | ArgPropType
|
|
188
|
-
> &
|
|
189
|
-
/* Specify props for the root element*/ Omit<
|
|
190
|
-
Partial<React.ComponentProps<NodeDefaultElementType[T]>>,
|
|
191
|
-
ReservedPropsType | VariantPropType | ArgPropType | DescendantsType<T>
|
|
192
|
-
>;
|
|
193
|
-
|
|
194
|
-
function makeNodeComponent<NodeName extends NodeNameType>(nodeName: NodeName) {
|
|
195
|
-
type PropsType = NodeComponentProps<NodeName> & { key?: React.Key };
|
|
196
|
-
const func = function <T extends PropsType>(
|
|
197
|
-
props: T & StrictProps<T, PropsType>
|
|
198
|
-
) {
|
|
199
|
-
const { variants, args, overrides } = React.useMemo(
|
|
200
|
-
() =>
|
|
201
|
-
deriveRenderOpts(props, {
|
|
202
|
-
name: nodeName,
|
|
203
|
-
descendantNames: [...PlasmicDescendants[nodeName]],
|
|
204
|
-
internalArgPropNames: PlasmicDynamicPage__ArgProps,
|
|
205
|
-
internalVariantPropNames: PlasmicDynamicPage__VariantProps
|
|
206
|
-
}),
|
|
207
|
-
[props, nodeName]
|
|
208
|
-
);
|
|
209
|
-
return PlasmicDynamicPage__RenderFunc({
|
|
210
|
-
variants,
|
|
211
|
-
args,
|
|
212
|
-
overrides,
|
|
213
|
-
forNode: nodeName
|
|
214
|
-
});
|
|
215
|
-
};
|
|
216
|
-
if (nodeName === "root") {
|
|
217
|
-
func.displayName = "PlasmicDynamicPage";
|
|
218
|
-
} else {
|
|
219
|
-
func.displayName = `PlasmicDynamicPage.${nodeName}`;
|
|
220
|
-
}
|
|
221
|
-
return func;
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
export const PlasmicDynamicPage = Object.assign(
|
|
225
|
-
// Top-level PlasmicDynamicPage renders the root element
|
|
226
|
-
makeNodeComponent("root"),
|
|
227
|
-
{
|
|
228
|
-
// Helper components rendering sub-elements
|
|
229
|
-
section: makeNodeComponent("section"),
|
|
230
|
-
h1: makeNodeComponent("h1"),
|
|
231
|
-
randomDynamicPageButton: makeNodeComponent("randomDynamicPageButton"),
|
|
232
|
-
|
|
233
|
-
// Metadata about props expected for PlasmicDynamicPage
|
|
234
|
-
internalVariantProps: PlasmicDynamicPage__VariantProps,
|
|
235
|
-
internalArgProps: PlasmicDynamicPage__ArgProps,
|
|
236
|
-
|
|
237
|
-
// Page metadata
|
|
238
|
-
pageMetadata: {
|
|
239
|
-
title: "",
|
|
240
|
-
description: "",
|
|
241
|
-
ogImageSrc: "",
|
|
242
|
-
canonical: ""
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
);
|
|
246
|
-
|
|
247
|
-
export default PlasmicDynamicPage;
|
|
248
|
-
/* prettier-ignore-end */
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
|
-
/* eslint-disable */
|
|
3
|
-
/* tslint:disable */
|
|
4
|
-
/* prettier-ignore-start */
|
|
5
|
-
|
|
6
|
-
import * as React from "react";
|
|
7
|
-
import * as p from "@plasmicapp/react-web";
|
|
8
|
-
|
|
9
|
-
export type ScreenValue = "desktopOnly";
|
|
10
|
-
export const ScreenContext = React.createContext<ScreenValue[] | undefined>(
|
|
11
|
-
"PLEASE_RENDER_INSIDE_PROVIDER" as any
|
|
12
|
-
);
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* @deprecated Plasmic now uses a custom hook for Screen variants, which is
|
|
16
|
-
* automatically included in your components. Please remove this provider
|
|
17
|
-
* from your code.
|
|
18
|
-
*/
|
|
19
|
-
export function ScreenVariantProvider(props: React.PropsWithChildren) {
|
|
20
|
-
console.warn(
|
|
21
|
-
"DEPRECATED: Plasmic now uses a custom hook for Screen variants, which is automatically included in your components. Please remove this provider from your code."
|
|
22
|
-
);
|
|
23
|
-
return props.children;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export const useScreenVariants = p.createUseScreenVariants(true, {
|
|
27
|
-
desktopOnly: "(min-width:768px)",
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
export default ScreenContext;
|
|
31
|
-
/* prettier-ignore-end */
|
package/cpa-out/react-loader-ts/src/components/plasmic/create_plasmic_app/PlasmicHomepage.tsx
DELETED
|
@@ -1,294 +0,0 @@
|
|
|
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
|
-
|
|
14
|
-
import * as React from "react";
|
|
15
|
-
|
|
16
|
-
import * as p from "@plasmicapp/react-web";
|
|
17
|
-
import * as ph from "@plasmicapp/react-web/lib/host";
|
|
18
|
-
|
|
19
|
-
import {
|
|
20
|
-
hasVariant,
|
|
21
|
-
classNames,
|
|
22
|
-
wrapWithClassName,
|
|
23
|
-
createPlasmicElementProxy,
|
|
24
|
-
makeFragment,
|
|
25
|
-
MultiChoiceArg,
|
|
26
|
-
SingleBooleanChoiceArg,
|
|
27
|
-
SingleChoiceArg,
|
|
28
|
-
pick,
|
|
29
|
-
omit,
|
|
30
|
-
useTrigger,
|
|
31
|
-
StrictProps,
|
|
32
|
-
deriveRenderOpts,
|
|
33
|
-
ensureGlobalVariants
|
|
34
|
-
} from "@plasmicapp/react-web";
|
|
35
|
-
import RandomDynamicPageButton from "../../RandomDynamicPageButton"; // plasmic-import: Q23H1_1M_P/component
|
|
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 projectcss from "./plasmic_create_plasmic_app.module.css"; // plasmic-import: 47tFXWjN2C4NyHFGGpaYQ3/projectcss
|
|
42
|
-
import 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
|
-
randomDynamicPageButton?: p.Flex<typeof RandomDynamicPageButton>;
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
export interface DefaultHomepageProps {
|
|
62
|
-
className?: string;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
const __wrapUserFunction =
|
|
66
|
-
globalThis.__PlasmicWrapUserFunction ?? ((loc, fn) => fn());
|
|
67
|
-
const __wrapUserPromise =
|
|
68
|
-
globalThis.__PlasmicWrapUserPromise ??
|
|
69
|
-
(async (loc, promise) => {
|
|
70
|
-
return await promise;
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
function PlasmicHomepage__RenderFunc(props: {
|
|
74
|
-
variants: PlasmicHomepage__VariantsArgs;
|
|
75
|
-
args: PlasmicHomepage__ArgsType;
|
|
76
|
-
overrides: PlasmicHomepage__OverridesType;
|
|
77
|
-
forNode?: string;
|
|
78
|
-
}) {
|
|
79
|
-
const { variants, overrides, forNode } = props;
|
|
80
|
-
|
|
81
|
-
const $ctx = ph.useDataEnv?.() || {};
|
|
82
|
-
const args = React.useMemo(() => Object.assign({}, props.args), [props.args]);
|
|
83
|
-
|
|
84
|
-
const $props = {
|
|
85
|
-
...args,
|
|
86
|
-
...variants
|
|
87
|
-
};
|
|
88
|
-
const refsRef = React.useRef({});
|
|
89
|
-
const $refs = refsRef.current;
|
|
90
|
-
|
|
91
|
-
const currentUser = p.useCurrentUser?.() || {};
|
|
92
|
-
const [$queries, setDollarQueries] = React.useState({});
|
|
93
|
-
|
|
94
|
-
const globalVariants = ensureGlobalVariants({
|
|
95
|
-
screen: useScreenVariantsscBjPxgdxdzbv()
|
|
96
|
-
});
|
|
97
|
-
|
|
98
|
-
return (
|
|
99
|
-
<React.Fragment>
|
|
100
|
-
{}
|
|
101
|
-
|
|
102
|
-
<div className={projectcss.plasmic_page_wrapper}>
|
|
103
|
-
<div
|
|
104
|
-
data-plasmic-name={"root"}
|
|
105
|
-
data-plasmic-override={overrides.root}
|
|
106
|
-
data-plasmic-root={true}
|
|
107
|
-
data-plasmic-for-node={forNode}
|
|
108
|
-
className={classNames(
|
|
109
|
-
projectcss.all,
|
|
110
|
-
projectcss.root_reset,
|
|
111
|
-
projectcss.plasmic_default_styles,
|
|
112
|
-
projectcss.plasmic_mixins,
|
|
113
|
-
sty.root
|
|
114
|
-
)}
|
|
115
|
-
>
|
|
116
|
-
<p.Stack
|
|
117
|
-
as={"section"}
|
|
118
|
-
data-plasmic-name={"section"}
|
|
119
|
-
data-plasmic-override={overrides.section}
|
|
120
|
-
hasGap={true}
|
|
121
|
-
className={classNames(projectcss.all, sty.section)}
|
|
122
|
-
>
|
|
123
|
-
<h1
|
|
124
|
-
data-plasmic-name={"h1"}
|
|
125
|
-
data-plasmic-override={overrides.h1}
|
|
126
|
-
className={classNames(
|
|
127
|
-
projectcss.all,
|
|
128
|
-
projectcss.h1,
|
|
129
|
-
projectcss.__wab_text,
|
|
130
|
-
sty.h1
|
|
131
|
-
)}
|
|
132
|
-
>
|
|
133
|
-
{"create-plasmic-app"}
|
|
134
|
-
</h1>
|
|
135
|
-
|
|
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—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 "
|
|
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
|
-
|
|
181
|
-
<RandomDynamicPageButton
|
|
182
|
-
data-plasmic-name={"randomDynamicPageButton"}
|
|
183
|
-
data-plasmic-override={overrides.randomDynamicPageButton}
|
|
184
|
-
className={classNames(
|
|
185
|
-
"__wab_instance",
|
|
186
|
-
sty.randomDynamicPageButton
|
|
187
|
-
)}
|
|
188
|
-
/>
|
|
189
|
-
</p.Stack>
|
|
190
|
-
</div>
|
|
191
|
-
</div>
|
|
192
|
-
</React.Fragment>
|
|
193
|
-
) as React.ReactElement | null;
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
const PlasmicDescendants = {
|
|
197
|
-
root: ["root", "section", "h1", "text", "randomDynamicPageButton"],
|
|
198
|
-
section: ["section", "h1", "text", "randomDynamicPageButton"],
|
|
199
|
-
h1: ["h1"],
|
|
200
|
-
text: ["text"],
|
|
201
|
-
randomDynamicPageButton: ["randomDynamicPageButton"]
|
|
202
|
-
} as const;
|
|
203
|
-
type NodeNameType = keyof typeof PlasmicDescendants;
|
|
204
|
-
type DescendantsType<T extends NodeNameType> =
|
|
205
|
-
(typeof PlasmicDescendants)[T][number];
|
|
206
|
-
type NodeDefaultElementType = {
|
|
207
|
-
root: "div";
|
|
208
|
-
section: "section";
|
|
209
|
-
h1: "h1";
|
|
210
|
-
text: "div";
|
|
211
|
-
randomDynamicPageButton: typeof RandomDynamicPageButton;
|
|
212
|
-
};
|
|
213
|
-
|
|
214
|
-
type ReservedPropsType = "variants" | "args" | "overrides";
|
|
215
|
-
type NodeOverridesType<T extends NodeNameType> = Pick<
|
|
216
|
-
PlasmicHomepage__OverridesType,
|
|
217
|
-
DescendantsType<T>
|
|
218
|
-
>;
|
|
219
|
-
type NodeComponentProps<T extends NodeNameType> =
|
|
220
|
-
// Explicitly specify variants, args, and overrides as objects
|
|
221
|
-
{
|
|
222
|
-
variants?: PlasmicHomepage__VariantsArgs;
|
|
223
|
-
args?: PlasmicHomepage__ArgsType;
|
|
224
|
-
overrides?: NodeOverridesType<T>;
|
|
225
|
-
} & Omit<PlasmicHomepage__VariantsArgs, ReservedPropsType> & // Specify variants directly as props
|
|
226
|
-
/* Specify args directly as props*/ Omit<
|
|
227
|
-
PlasmicHomepage__ArgsType,
|
|
228
|
-
ReservedPropsType
|
|
229
|
-
> &
|
|
230
|
-
/* Specify overrides for each element directly as props*/ Omit<
|
|
231
|
-
NodeOverridesType<T>,
|
|
232
|
-
ReservedPropsType | VariantPropType | ArgPropType
|
|
233
|
-
> &
|
|
234
|
-
/* Specify props for the root element*/ Omit<
|
|
235
|
-
Partial<React.ComponentProps<NodeDefaultElementType[T]>>,
|
|
236
|
-
ReservedPropsType | VariantPropType | ArgPropType | DescendantsType<T>
|
|
237
|
-
>;
|
|
238
|
-
|
|
239
|
-
function makeNodeComponent<NodeName extends NodeNameType>(nodeName: NodeName) {
|
|
240
|
-
type PropsType = NodeComponentProps<NodeName> & { key?: React.Key };
|
|
241
|
-
const func = function <T extends PropsType>(
|
|
242
|
-
props: T & StrictProps<T, PropsType>
|
|
243
|
-
) {
|
|
244
|
-
const { variants, args, overrides } = React.useMemo(
|
|
245
|
-
() =>
|
|
246
|
-
deriveRenderOpts(props, {
|
|
247
|
-
name: nodeName,
|
|
248
|
-
descendantNames: [...PlasmicDescendants[nodeName]],
|
|
249
|
-
internalArgPropNames: PlasmicHomepage__ArgProps,
|
|
250
|
-
internalVariantPropNames: PlasmicHomepage__VariantProps
|
|
251
|
-
}),
|
|
252
|
-
[props, nodeName]
|
|
253
|
-
);
|
|
254
|
-
return PlasmicHomepage__RenderFunc({
|
|
255
|
-
variants,
|
|
256
|
-
args,
|
|
257
|
-
overrides,
|
|
258
|
-
forNode: nodeName
|
|
259
|
-
});
|
|
260
|
-
};
|
|
261
|
-
if (nodeName === "root") {
|
|
262
|
-
func.displayName = "PlasmicHomepage";
|
|
263
|
-
} else {
|
|
264
|
-
func.displayName = `PlasmicHomepage.${nodeName}`;
|
|
265
|
-
}
|
|
266
|
-
return func;
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
export const PlasmicHomepage = Object.assign(
|
|
270
|
-
// Top-level PlasmicHomepage renders the root element
|
|
271
|
-
makeNodeComponent("root"),
|
|
272
|
-
{
|
|
273
|
-
// Helper components rendering sub-elements
|
|
274
|
-
section: makeNodeComponent("section"),
|
|
275
|
-
h1: makeNodeComponent("h1"),
|
|
276
|
-
text: makeNodeComponent("text"),
|
|
277
|
-
randomDynamicPageButton: makeNodeComponent("randomDynamicPageButton"),
|
|
278
|
-
|
|
279
|
-
// Metadata about props expected for PlasmicHomepage
|
|
280
|
-
internalVariantProps: PlasmicHomepage__VariantProps,
|
|
281
|
-
internalArgProps: PlasmicHomepage__ArgProps,
|
|
282
|
-
|
|
283
|
-
// Page metadata
|
|
284
|
-
pageMetadata: {
|
|
285
|
-
title: "",
|
|
286
|
-
description: "",
|
|
287
|
-
ogImageSrc: "",
|
|
288
|
-
canonical: ""
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
);
|
|
292
|
-
|
|
293
|
-
export default PlasmicHomepage;
|
|
294
|
-
/* prettier-ignore-end */
|