create-plasmic-app 0.0.92 → 0.0.94
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-loader-js/pages/[[...catchall]].jsx +68 -0
- package/cpa-out/nextjs-app-loader-js/pages/api/hello.js +5 -0
- package/cpa-out/nextjs-app-loader-js/pages/plasmic-host.jsx +7 -0
- package/cpa-out/nextjs-app-loader-ts/pages/[[...catchall]].tsx +72 -0
- package/cpa-out/nextjs-app-loader-ts/pages/api/hello.ts +13 -0
- package/cpa-out/nextjs-app-loader-ts/pages/plasmic-host.tsx +7 -0
- package/cpa-out/nextjs-pages-codegen-js/components/Button.jsx +1 -3
- package/cpa-out/nextjs-pages-codegen-js/components/plasmic/create_plasmic_app/PlasmicButton.jsx +50 -98
- package/cpa-out/nextjs-pages-codegen-js/components/plasmic/create_plasmic_app/PlasmicDynamicPage.jsx +36 -30
- package/cpa-out/nextjs-pages-codegen-js/components/plasmic/create_plasmic_app/PlasmicGlobalVariant__Screen.jsx +2 -14
- package/cpa-out/nextjs-pages-codegen-js/components/plasmic/create_plasmic_app/PlasmicHomepage.jsx +25 -25
- package/cpa-out/nextjs-pages-codegen-js/components/plasmic/create_plasmic_app/PlasmicRandomDynamicPageButton.jsx +45 -59
- package/cpa-out/nextjs-pages-codegen-js/components/plasmic/create_plasmic_app/icons/PlasmicIcon__Checksvg.jsx +2 -2
- package/cpa-out/nextjs-pages-codegen-js/package.json +9 -7
- package/cpa-out/nextjs-pages-codegen-js/pages/api/hello.js +1 -1
- package/cpa-out/nextjs-pages-codegen-js/pages/dynamic/[slug].jsx +4 -3
- package/cpa-out/nextjs-pages-codegen-js/pages/index.jsx +4 -3
- package/cpa-out/nextjs-pages-codegen-js/plasmic.json +14 -8
- package/cpa-out/nextjs-pages-codegen-ts/components/Button.tsx +4 -5
- package/cpa-out/nextjs-pages-codegen-ts/components/plasmic/create_plasmic_app/PlasmicButton.tsx +86 -65
- package/cpa-out/nextjs-pages-codegen-ts/components/plasmic/create_plasmic_app/PlasmicDynamicPage.tsx +74 -43
- package/cpa-out/nextjs-pages-codegen-ts/components/plasmic/create_plasmic_app/PlasmicGlobalVariant__Screen.tsx +2 -14
- package/cpa-out/nextjs-pages-codegen-ts/components/plasmic/create_plasmic_app/PlasmicHomepage.tsx +63 -37
- package/cpa-out/nextjs-pages-codegen-ts/components/plasmic/create_plasmic_app/PlasmicRandomDynamicPageButton.tsx +84 -71
- package/cpa-out/nextjs-pages-codegen-ts/components/plasmic/create_plasmic_app/icons/PlasmicIcon__Checksvg.tsx +3 -3
- package/cpa-out/nextjs-pages-codegen-ts/package.json +13 -11
- package/cpa-out/nextjs-pages-codegen-ts/pages/api/hello.ts +5 -5
- package/cpa-out/nextjs-pages-codegen-ts/pages/dynamic/[slug].tsx +4 -4
- package/cpa-out/nextjs-pages-codegen-ts/pages/index.tsx +4 -4
- package/cpa-out/nextjs-pages-codegen-ts/plasmic.json +14 -8
- package/cpa-out/nextjs-pages-codegen-ts/tsconfig.json +1 -3
- package/cpa-out/nextjs-pages-loader-js/package.json +8 -6
- package/cpa-out/nextjs-pages-loader-js/pages/[[...catchall]].jsx +2 -0
- package/cpa-out/nextjs-pages-loader-js/pages/api/hello.js +1 -1
- package/cpa-out/nextjs-pages-loader-ts/package.json +12 -10
- package/cpa-out/nextjs-pages-loader-ts/pages/[[...catchall]].tsx +2 -0
- package/cpa-out/nextjs-pages-loader-ts/pages/api/hello.ts +5 -5
- package/cpa-out/nextjs-pages-loader-ts/tsconfig.json +1 -3
- package/dist/nextjs/nextjs.js +5 -23
- package/dist/nextjs/templates/pages-loader/catchall-page.js +1 -1
- package/dist/utils/npm-utils.js +1 -1
- package/package.json +2 -2
- package/src/nextjs/nextjs.ts +5 -24
- package/src/nextjs/templates/pages-loader/catchall-page.ts +1 -1
- package/src/utils/npm-utils.ts +1 -1
- package/.tool-versions +0 -1
package/cpa-out/nextjs-pages-codegen-ts/components/plasmic/create_plasmic_app/PlasmicHomepage.tsx
CHANGED
|
@@ -17,34 +17,60 @@ import Head from "next/head";
|
|
|
17
17
|
import Link, { LinkProps } from "next/link";
|
|
18
18
|
import { useRouter } from "next/router";
|
|
19
19
|
|
|
20
|
-
import * as p from "@plasmicapp/react-web";
|
|
21
|
-
import * as ph from "@plasmicapp/react-web/lib/host";
|
|
22
|
-
|
|
23
20
|
import {
|
|
24
|
-
|
|
25
|
-
classNames,
|
|
26
|
-
wrapWithClassName,
|
|
27
|
-
createPlasmicElementProxy,
|
|
28
|
-
makeFragment,
|
|
21
|
+
Flex as Flex__,
|
|
29
22
|
MultiChoiceArg,
|
|
23
|
+
PlasmicDataSourceContextProvider as PlasmicDataSourceContextProvider__,
|
|
24
|
+
PlasmicIcon as PlasmicIcon__,
|
|
25
|
+
PlasmicImg as PlasmicImg__,
|
|
26
|
+
PlasmicLink as PlasmicLink__,
|
|
27
|
+
PlasmicPageGuard as PlasmicPageGuard__,
|
|
30
28
|
SingleBooleanChoiceArg,
|
|
31
29
|
SingleChoiceArg,
|
|
32
|
-
|
|
33
|
-
omit,
|
|
34
|
-
useTrigger,
|
|
30
|
+
Stack as Stack__,
|
|
35
31
|
StrictProps,
|
|
32
|
+
Trans as Trans__,
|
|
33
|
+
classNames,
|
|
34
|
+
createPlasmicElementProxy,
|
|
36
35
|
deriveRenderOpts,
|
|
37
|
-
ensureGlobalVariants
|
|
36
|
+
ensureGlobalVariants,
|
|
37
|
+
generateOnMutateForSpec,
|
|
38
|
+
generateStateOnChangeProp,
|
|
39
|
+
generateStateOnChangePropForCodeComponents,
|
|
40
|
+
generateStateValueProp,
|
|
41
|
+
get as $stateGet,
|
|
42
|
+
hasVariant,
|
|
43
|
+
initializeCodeComponentStates,
|
|
44
|
+
initializePlasmicStates,
|
|
45
|
+
makeFragment,
|
|
46
|
+
omit,
|
|
47
|
+
pick,
|
|
48
|
+
renderPlasmicSlot,
|
|
49
|
+
set as $stateSet,
|
|
50
|
+
useCurrentUser,
|
|
51
|
+
useDollarState,
|
|
52
|
+
usePlasmicTranslator,
|
|
53
|
+
useTrigger,
|
|
54
|
+
wrapWithClassName
|
|
38
55
|
} from "@plasmicapp/react-web";
|
|
56
|
+
import {
|
|
57
|
+
DataCtxReader as DataCtxReader__,
|
|
58
|
+
useDataEnv,
|
|
59
|
+
useGlobalActions
|
|
60
|
+
} from "@plasmicapp/react-web/lib/host";
|
|
61
|
+
|
|
39
62
|
import RandomDynamicPageButton from "../../RandomDynamicPageButton"; // plasmic-import: Q23H1_1M_P/component
|
|
63
|
+
import { Fetcher } from "@plasmicapp/react-web/lib/data-sources";
|
|
40
64
|
|
|
41
65
|
import { useScreenVariants as useScreenVariantsscBjPxgdxdzbv } from "./PlasmicGlobalVariant__Screen"; // plasmic-import: SCBjPXGDXDZBV/globalVariant
|
|
42
66
|
|
|
43
67
|
import "@plasmicapp/react-web/lib/plasmic.css";
|
|
44
68
|
|
|
45
|
-
import projectcss from "./
|
|
69
|
+
import projectcss from "./plasmic.module.css"; // plasmic-import: 47tFXWjN2C4NyHFGGpaYQ3/projectcss
|
|
46
70
|
import sty from "./PlasmicHomepage.module.css"; // plasmic-import: 6uuAAE1jiCew/css
|
|
47
71
|
|
|
72
|
+
createPlasmicElementProxy;
|
|
73
|
+
|
|
48
74
|
export type PlasmicHomepage__VariantMembers = {};
|
|
49
75
|
export type PlasmicHomepage__VariantsArgs = {};
|
|
50
76
|
type VariantPropType = keyof PlasmicHomepage__VariantsArgs;
|
|
@@ -55,22 +81,16 @@ type ArgPropType = keyof PlasmicHomepage__ArgsType;
|
|
|
55
81
|
export const PlasmicHomepage__ArgProps = new Array<ArgPropType>();
|
|
56
82
|
|
|
57
83
|
export type PlasmicHomepage__OverridesType = {
|
|
58
|
-
root?:
|
|
59
|
-
section?:
|
|
60
|
-
h1?:
|
|
61
|
-
text?:
|
|
62
|
-
randomDynamicPageButton?:
|
|
84
|
+
root?: Flex__<"div">;
|
|
85
|
+
section?: Flex__<"section">;
|
|
86
|
+
h1?: Flex__<"h1">;
|
|
87
|
+
text?: Flex__<"div">;
|
|
88
|
+
randomDynamicPageButton?: Flex__<typeof RandomDynamicPageButton>;
|
|
63
89
|
};
|
|
64
90
|
|
|
65
91
|
export interface DefaultHomepageProps {}
|
|
66
92
|
|
|
67
|
-
const
|
|
68
|
-
globalThis.__PlasmicWrapUserFunction ?? ((loc, fn) => fn());
|
|
69
|
-
const __wrapUserPromise =
|
|
70
|
-
globalThis.__PlasmicWrapUserPromise ??
|
|
71
|
-
(async (loc, promise) => {
|
|
72
|
-
return await promise;
|
|
73
|
-
});
|
|
93
|
+
const $$ = {};
|
|
74
94
|
|
|
75
95
|
function useNextRouter() {
|
|
76
96
|
try {
|
|
@@ -86,21 +106,28 @@ function PlasmicHomepage__RenderFunc(props: {
|
|
|
86
106
|
forNode?: string;
|
|
87
107
|
}) {
|
|
88
108
|
const { variants, overrides, forNode } = props;
|
|
89
|
-
const __nextRouter = useNextRouter();
|
|
90
109
|
|
|
91
|
-
const
|
|
92
|
-
|
|
110
|
+
const args = React.useMemo(
|
|
111
|
+
() =>
|
|
112
|
+
Object.assign(
|
|
113
|
+
{},
|
|
114
|
+
Object.fromEntries(
|
|
115
|
+
Object.entries(props.args).filter(([_, v]) => v !== undefined)
|
|
116
|
+
)
|
|
117
|
+
),
|
|
118
|
+
[props.args]
|
|
119
|
+
);
|
|
93
120
|
|
|
94
121
|
const $props = {
|
|
95
122
|
...args,
|
|
96
123
|
...variants
|
|
97
124
|
};
|
|
125
|
+
|
|
126
|
+
const __nextRouter = useNextRouter();
|
|
127
|
+
const $ctx = useDataEnv?.() || {};
|
|
98
128
|
const refsRef = React.useRef({});
|
|
99
129
|
const $refs = refsRef.current;
|
|
100
130
|
|
|
101
|
-
const currentUser = p.useCurrentUser?.() || {};
|
|
102
|
-
const [$queries, setDollarQueries] = React.useState({});
|
|
103
|
-
|
|
104
131
|
const globalVariants = ensureGlobalVariants({
|
|
105
132
|
screen: useScreenVariantsscBjPxgdxdzbv()
|
|
106
133
|
});
|
|
@@ -126,10 +153,11 @@ function PlasmicHomepage__RenderFunc(props: {
|
|
|
126
153
|
projectcss.root_reset,
|
|
127
154
|
projectcss.plasmic_default_styles,
|
|
128
155
|
projectcss.plasmic_mixins,
|
|
156
|
+
projectcss.plasmic_tokens,
|
|
129
157
|
sty.root
|
|
130
158
|
)}
|
|
131
159
|
>
|
|
132
|
-
<
|
|
160
|
+
<Stack__
|
|
133
161
|
as={"section"}
|
|
134
162
|
data-plasmic-name={"section"}
|
|
135
163
|
data-plasmic-override={overrides.section}
|
|
@@ -148,7 +176,6 @@ function PlasmicHomepage__RenderFunc(props: {
|
|
|
148
176
|
>
|
|
149
177
|
{"create-plasmic-app"}
|
|
150
178
|
</h1>
|
|
151
|
-
|
|
152
179
|
<div
|
|
153
180
|
data-plasmic-name={"text"}
|
|
154
181
|
data-plasmic-override={overrides.text}
|
|
@@ -176,7 +203,7 @@ function PlasmicHomepage__RenderFunc(props: {
|
|
|
176
203
|
<React.Fragment>
|
|
177
204
|
<React.Fragment>
|
|
178
205
|
{
|
|
179
|
-
"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
|
|
206
|
+
"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 "
|
|
180
207
|
}
|
|
181
208
|
</React.Fragment>
|
|
182
209
|
<span
|
|
@@ -193,7 +220,6 @@ function PlasmicHomepage__RenderFunc(props: {
|
|
|
193
220
|
</React.Fragment>
|
|
194
221
|
)}
|
|
195
222
|
</div>
|
|
196
|
-
|
|
197
223
|
<RandomDynamicPageButton
|
|
198
224
|
data-plasmic-name={"randomDynamicPageButton"}
|
|
199
225
|
data-plasmic-override={overrides.randomDynamicPageButton}
|
|
@@ -202,7 +228,7 @@ function PlasmicHomepage__RenderFunc(props: {
|
|
|
202
228
|
sty.randomDynamicPageButton
|
|
203
229
|
)}
|
|
204
230
|
/>
|
|
205
|
-
</
|
|
231
|
+
</Stack__>
|
|
206
232
|
</div>
|
|
207
233
|
</div>
|
|
208
234
|
</React.Fragment>
|
|
@@ -261,7 +287,7 @@ function makeNodeComponent<NodeName extends NodeNameType>(nodeName: NodeName) {
|
|
|
261
287
|
() =>
|
|
262
288
|
deriveRenderOpts(props, {
|
|
263
289
|
name: nodeName,
|
|
264
|
-
descendantNames:
|
|
290
|
+
descendantNames: PlasmicDescendants[nodeName],
|
|
265
291
|
internalArgPropNames: PlasmicHomepage__ArgProps,
|
|
266
292
|
internalVariantPropNames: PlasmicHomepage__VariantProps
|
|
267
293
|
}),
|
|
@@ -17,35 +17,60 @@ import Head from "next/head";
|
|
|
17
17
|
import Link, { LinkProps } from "next/link";
|
|
18
18
|
import { useRouter } from "next/router";
|
|
19
19
|
|
|
20
|
-
import * as p from "@plasmicapp/react-web";
|
|
21
|
-
import * as ph from "@plasmicapp/react-web/lib/host";
|
|
22
|
-
|
|
23
20
|
import {
|
|
24
|
-
|
|
25
|
-
classNames,
|
|
26
|
-
wrapWithClassName,
|
|
27
|
-
createPlasmicElementProxy,
|
|
28
|
-
makeFragment,
|
|
21
|
+
Flex as Flex__,
|
|
29
22
|
MultiChoiceArg,
|
|
23
|
+
PlasmicDataSourceContextProvider as PlasmicDataSourceContextProvider__,
|
|
24
|
+
PlasmicIcon as PlasmicIcon__,
|
|
25
|
+
PlasmicImg as PlasmicImg__,
|
|
26
|
+
PlasmicLink as PlasmicLink__,
|
|
27
|
+
PlasmicPageGuard as PlasmicPageGuard__,
|
|
30
28
|
SingleBooleanChoiceArg,
|
|
31
29
|
SingleChoiceArg,
|
|
32
|
-
|
|
33
|
-
omit,
|
|
34
|
-
useTrigger,
|
|
30
|
+
Stack as Stack__,
|
|
35
31
|
StrictProps,
|
|
32
|
+
Trans as Trans__,
|
|
33
|
+
classNames,
|
|
34
|
+
createPlasmicElementProxy,
|
|
36
35
|
deriveRenderOpts,
|
|
37
|
-
ensureGlobalVariants
|
|
36
|
+
ensureGlobalVariants,
|
|
37
|
+
generateOnMutateForSpec,
|
|
38
|
+
generateStateOnChangeProp,
|
|
39
|
+
generateStateOnChangePropForCodeComponents,
|
|
40
|
+
generateStateValueProp,
|
|
41
|
+
get as $stateGet,
|
|
42
|
+
hasVariant,
|
|
43
|
+
initializeCodeComponentStates,
|
|
44
|
+
initializePlasmicStates,
|
|
45
|
+
makeFragment,
|
|
46
|
+
omit,
|
|
47
|
+
pick,
|
|
48
|
+
renderPlasmicSlot,
|
|
49
|
+
set as $stateSet,
|
|
50
|
+
useCurrentUser,
|
|
51
|
+
useDollarState,
|
|
52
|
+
usePlasmicTranslator,
|
|
53
|
+
useTrigger,
|
|
54
|
+
wrapWithClassName
|
|
38
55
|
} from "@plasmicapp/react-web";
|
|
56
|
+
import {
|
|
57
|
+
DataCtxReader as DataCtxReader__,
|
|
58
|
+
useDataEnv,
|
|
59
|
+
useGlobalActions
|
|
60
|
+
} from "@plasmicapp/react-web/lib/host";
|
|
61
|
+
|
|
39
62
|
import Button from "../../Button"; // plasmic-import: TQcvW_pSKi3/component
|
|
40
63
|
|
|
41
64
|
import "@plasmicapp/react-web/lib/plasmic.css";
|
|
42
65
|
|
|
43
|
-
import projectcss from "./
|
|
66
|
+
import projectcss from "./plasmic.module.css"; // plasmic-import: 47tFXWjN2C4NyHFGGpaYQ3/projectcss
|
|
44
67
|
import sty from "./PlasmicRandomDynamicPageButton.module.css"; // plasmic-import: Q23H1_1M_P/css
|
|
45
68
|
|
|
46
|
-
import
|
|
69
|
+
import CheckSvgIcon from "./icons/PlasmicIcon__CheckSvg"; // plasmic-import: gj-_D7n31Ho/icon
|
|
47
70
|
import IconIcon from "./icons/PlasmicIcon__Icon"; // plasmic-import: 6PNxx3YMyDQ/icon
|
|
48
71
|
|
|
72
|
+
createPlasmicElementProxy;
|
|
73
|
+
|
|
49
74
|
export type PlasmicRandomDynamicPageButton__VariantMembers = {};
|
|
50
75
|
export type PlasmicRandomDynamicPageButton__VariantsArgs = {};
|
|
51
76
|
type VariantPropType = keyof PlasmicRandomDynamicPageButton__VariantsArgs;
|
|
@@ -58,20 +83,14 @@ export const PlasmicRandomDynamicPageButton__ArgProps =
|
|
|
58
83
|
new Array<ArgPropType>();
|
|
59
84
|
|
|
60
85
|
export type PlasmicRandomDynamicPageButton__OverridesType = {
|
|
61
|
-
root?:
|
|
86
|
+
root?: Flex__<typeof Button>;
|
|
62
87
|
};
|
|
63
88
|
|
|
64
89
|
export interface DefaultRandomDynamicPageButtonProps {
|
|
65
90
|
className?: string;
|
|
66
91
|
}
|
|
67
92
|
|
|
68
|
-
const
|
|
69
|
-
globalThis.__PlasmicWrapUserFunction ?? ((loc, fn) => fn());
|
|
70
|
-
const __wrapUserPromise =
|
|
71
|
-
globalThis.__PlasmicWrapUserPromise ??
|
|
72
|
-
(async (loc, promise) => {
|
|
73
|
-
return await promise;
|
|
74
|
-
});
|
|
93
|
+
const $$ = {};
|
|
75
94
|
|
|
76
95
|
function useNextRouter() {
|
|
77
96
|
try {
|
|
@@ -87,21 +106,28 @@ function PlasmicRandomDynamicPageButton__RenderFunc(props: {
|
|
|
87
106
|
forNode?: string;
|
|
88
107
|
}) {
|
|
89
108
|
const { variants, overrides, forNode } = props;
|
|
90
|
-
const __nextRouter = useNextRouter();
|
|
91
109
|
|
|
92
|
-
const
|
|
93
|
-
|
|
110
|
+
const args = React.useMemo(
|
|
111
|
+
() =>
|
|
112
|
+
Object.assign(
|
|
113
|
+
{},
|
|
114
|
+
Object.fromEntries(
|
|
115
|
+
Object.entries(props.args).filter(([_, v]) => v !== undefined)
|
|
116
|
+
)
|
|
117
|
+
),
|
|
118
|
+
[props.args]
|
|
119
|
+
);
|
|
94
120
|
|
|
95
121
|
const $props = {
|
|
96
122
|
...args,
|
|
97
123
|
...variants
|
|
98
124
|
};
|
|
125
|
+
|
|
126
|
+
const __nextRouter = useNextRouter();
|
|
127
|
+
const $ctx = useDataEnv?.() || {};
|
|
99
128
|
const refsRef = React.useRef({});
|
|
100
129
|
const $refs = refsRef.current;
|
|
101
130
|
|
|
102
|
-
const currentUser = p.useCurrentUser?.() || {};
|
|
103
|
-
const [$queries, setDollarQueries] = React.useState({});
|
|
104
|
-
|
|
105
131
|
return (
|
|
106
132
|
<Button
|
|
107
133
|
data-plasmic-name={"root"}
|
|
@@ -111,60 +137,47 @@ function PlasmicRandomDynamicPageButton__RenderFunc(props: {
|
|
|
111
137
|
className={classNames("__wab_instance", sty.root)}
|
|
112
138
|
onClick={async event => {
|
|
113
139
|
const $steps = {};
|
|
140
|
+
|
|
114
141
|
$steps["goToDynamicPage"] = true
|
|
115
142
|
? (() => {
|
|
116
143
|
const actionArgs = {
|
|
117
|
-
destination:
|
|
118
|
-
{
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
if (e instanceof TypeError) {
|
|
131
|
-
return "value";
|
|
132
|
-
}
|
|
133
|
-
throw e;
|
|
134
|
-
}
|
|
135
|
-
})()}`
|
|
136
|
-
)
|
|
144
|
+
destination: `/dynamic/${(() => {
|
|
145
|
+
try {
|
|
146
|
+
return Math.random().toString(36).slice(2);
|
|
147
|
+
} catch (e) {
|
|
148
|
+
if (
|
|
149
|
+
e instanceof TypeError ||
|
|
150
|
+
e?.plasmicType === "PlasmicUndefinedDataError"
|
|
151
|
+
) {
|
|
152
|
+
return "value";
|
|
153
|
+
}
|
|
154
|
+
throw e;
|
|
155
|
+
}
|
|
156
|
+
})()}`
|
|
137
157
|
};
|
|
138
|
-
return
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
);
|
|
158
|
+
return (({ destination }) => {
|
|
159
|
+
if (
|
|
160
|
+
typeof destination === "string" &&
|
|
161
|
+
destination.startsWith("#")
|
|
162
|
+
) {
|
|
163
|
+
document
|
|
164
|
+
.getElementById(destination.substr(1))
|
|
165
|
+
.scrollIntoView({ behavior: "smooth" });
|
|
166
|
+
} else {
|
|
167
|
+
__nextRouter?.push(destination);
|
|
168
|
+
}
|
|
169
|
+
})?.apply(null, [actionArgs]);
|
|
151
170
|
})()
|
|
152
171
|
: undefined;
|
|
153
172
|
if (
|
|
173
|
+
$steps["goToDynamicPage"] != null &&
|
|
154
174
|
typeof $steps["goToDynamicPage"] === "object" &&
|
|
155
175
|
typeof $steps["goToDynamicPage"].then === "function"
|
|
156
176
|
) {
|
|
157
|
-
$steps["goToDynamicPage"] = await
|
|
158
|
-
{
|
|
159
|
-
type: "InteractionLoc",
|
|
160
|
-
actionName: "navigation",
|
|
161
|
-
interactionUuid: "9Y3jL0zxjA",
|
|
162
|
-
componentUuid: "Q23H1_1M_P"
|
|
163
|
-
},
|
|
164
|
-
$steps["goToDynamicPage"]
|
|
165
|
-
);
|
|
177
|
+
$steps["goToDynamicPage"] = await $steps["goToDynamicPage"];
|
|
166
178
|
}
|
|
167
179
|
}}
|
|
180
|
+
submitsForm={true}
|
|
168
181
|
>
|
|
169
182
|
{"Random Dynamic Page"}
|
|
170
183
|
</Button>
|
|
@@ -215,7 +228,7 @@ function makeNodeComponent<NodeName extends NodeNameType>(nodeName: NodeName) {
|
|
|
215
228
|
() =>
|
|
216
229
|
deriveRenderOpts(props, {
|
|
217
230
|
name: nodeName,
|
|
218
|
-
descendantNames:
|
|
231
|
+
descendantNames: PlasmicDescendants[nodeName],
|
|
219
232
|
internalArgPropNames: PlasmicRandomDynamicPageButton__ArgProps,
|
|
220
233
|
internalVariantPropNames: PlasmicRandomDynamicPageButton__VariantProps
|
|
221
234
|
}),
|
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
import React from "react";
|
|
6
6
|
import { classNames } from "@plasmicapp/react-web";
|
|
7
7
|
|
|
8
|
-
export type
|
|
8
|
+
export type CheckSvgIconProps = React.ComponentProps<"svg"> & {
|
|
9
9
|
title?: string;
|
|
10
10
|
};
|
|
11
11
|
|
|
12
|
-
export function
|
|
12
|
+
export function CheckSvgIcon(props: CheckSvgIconProps) {
|
|
13
13
|
const { className, style, title, ...restProps } = props;
|
|
14
14
|
return (
|
|
15
15
|
<svg
|
|
@@ -40,5 +40,5 @@ export function ChecksvgIcon(props: ChecksvgIconProps) {
|
|
|
40
40
|
);
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
export default
|
|
43
|
+
export default CheckSvgIcon;
|
|
44
44
|
/* prettier-ignore-end */
|
|
@@ -9,16 +9,18 @@
|
|
|
9
9
|
"lint": "next lint"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@plasmicapp/cli": "^0.1.
|
|
13
|
-
"@plasmicapp/react-web": "^0.2.
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
"
|
|
20
|
-
"react": "18
|
|
21
|
-
"react-dom": "18
|
|
22
|
-
"
|
|
12
|
+
"@plasmicapp/cli": "^0.1.331",
|
|
13
|
+
"@plasmicapp/react-web": "^0.2.353",
|
|
14
|
+
"next": "14.2.15",
|
|
15
|
+
"react": "^18",
|
|
16
|
+
"react-dom": "^18"
|
|
17
|
+
},
|
|
18
|
+
"devDependencies": {
|
|
19
|
+
"@types/node": "^20",
|
|
20
|
+
"@types/react": "^18",
|
|
21
|
+
"@types/react-dom": "^18",
|
|
22
|
+
"eslint": "^8",
|
|
23
|
+
"eslint-config-next": "14.2.15",
|
|
24
|
+
"typescript": "^5"
|
|
23
25
|
}
|
|
24
26
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
// Next.js API route support: https://nextjs.org/docs/api-routes/introduction
|
|
2
|
-
import type { NextApiRequest, NextApiResponse } from
|
|
2
|
+
import type { NextApiRequest, NextApiResponse } from "next";
|
|
3
3
|
|
|
4
4
|
type Data = {
|
|
5
|
-
name: string
|
|
6
|
-
}
|
|
5
|
+
name: string;
|
|
6
|
+
};
|
|
7
7
|
|
|
8
8
|
export default function handler(
|
|
9
9
|
req: NextApiRequest,
|
|
10
|
-
res: NextApiResponse<Data
|
|
10
|
+
res: NextApiResponse<Data>,
|
|
11
11
|
) {
|
|
12
|
-
res.status(200).json({ name:
|
|
12
|
+
res.status(200).json({ name: "John Doe" });
|
|
13
13
|
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
// This is a skeleton starter React page generated by Plasmic.
|
|
2
2
|
// This file is owned by you, feel free to edit as you see fit.
|
|
3
3
|
import * as React from "react";
|
|
4
|
-
import
|
|
4
|
+
import { PageParamsProvider as PageParamsProvider__ } from "@plasmicapp/react-web/lib/host";
|
|
5
5
|
|
|
6
|
-
import { ScreenVariantProvider } from "../../components/plasmic/create_plasmic_app/PlasmicGlobalVariant__Screen";
|
|
7
6
|
import { PlasmicDynamicPage } from "../../components/plasmic/create_plasmic_app/PlasmicDynamicPage";
|
|
8
7
|
import { useRouter } from "next/router";
|
|
9
8
|
|
|
@@ -25,12 +24,13 @@ function DynamicPage() {
|
|
|
25
24
|
// Next.js Custom App component
|
|
26
25
|
// (https://nextjs.org/docs/advanced-features/custom-app).
|
|
27
26
|
return (
|
|
28
|
-
<
|
|
27
|
+
<PageParamsProvider__
|
|
28
|
+
route={useRouter()?.pathname}
|
|
29
29
|
params={useRouter()?.query}
|
|
30
30
|
query={useRouter()?.query}
|
|
31
31
|
>
|
|
32
32
|
<PlasmicDynamicPage />
|
|
33
|
-
</
|
|
33
|
+
</PageParamsProvider__>
|
|
34
34
|
);
|
|
35
35
|
}
|
|
36
36
|
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
// This is a skeleton starter React page generated by Plasmic.
|
|
2
2
|
// This file is owned by you, feel free to edit as you see fit.
|
|
3
3
|
import * as React from "react";
|
|
4
|
-
import
|
|
4
|
+
import { PageParamsProvider as PageParamsProvider__ } from "@plasmicapp/react-web/lib/host";
|
|
5
5
|
|
|
6
|
-
import { ScreenVariantProvider } from "../components/plasmic/create_plasmic_app/PlasmicGlobalVariant__Screen";
|
|
7
6
|
import { PlasmicHomepage } from "../components/plasmic/create_plasmic_app/PlasmicHomepage";
|
|
8
7
|
import { useRouter } from "next/router";
|
|
9
8
|
|
|
@@ -25,12 +24,13 @@ function Homepage() {
|
|
|
25
24
|
// Next.js Custom App component
|
|
26
25
|
// (https://nextjs.org/docs/advanced-features/custom-app).
|
|
27
26
|
return (
|
|
28
|
-
<
|
|
27
|
+
<PageParamsProvider__
|
|
28
|
+
route={useRouter()?.pathname}
|
|
29
29
|
params={useRouter()?.query}
|
|
30
30
|
query={useRouter()?.query}
|
|
31
31
|
>
|
|
32
32
|
<PlasmicHomepage />
|
|
33
|
-
</
|
|
33
|
+
</PageParamsProvider__>
|
|
34
34
|
);
|
|
35
35
|
}
|
|
36
36
|
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"projectApiToken": "7BRFratDxPLMGZHnd2grV5QP6mlHcZ1AK3BJSIeh7xzUlHgWh25XpgXvUaKAqHXFMXQQuzpADqboibF6nqNWQ",
|
|
27
27
|
"projectName": "create-plasmic-app",
|
|
28
28
|
"version": "latest",
|
|
29
|
-
"cssFilePath": "plasmic/create_plasmic_app/
|
|
29
|
+
"cssFilePath": "plasmic/create_plasmic_app/plasmic.module.css",
|
|
30
30
|
"components": [
|
|
31
31
|
{
|
|
32
32
|
"id": "6uuAAE1jiCew",
|
|
@@ -39,7 +39,8 @@
|
|
|
39
39
|
},
|
|
40
40
|
"cssFilePath": "plasmic/create_plasmic_app/PlasmicHomepage.module.css",
|
|
41
41
|
"scheme": "blackbox",
|
|
42
|
-
"componentType": "page"
|
|
42
|
+
"componentType": "page",
|
|
43
|
+
"path": "/"
|
|
43
44
|
},
|
|
44
45
|
{
|
|
45
46
|
"id": "AO44A-w7hh",
|
|
@@ -52,7 +53,8 @@
|
|
|
52
53
|
},
|
|
53
54
|
"cssFilePath": "plasmic/create_plasmic_app/PlasmicDynamicPage.module.css",
|
|
54
55
|
"scheme": "blackbox",
|
|
55
|
-
"componentType": "page"
|
|
56
|
+
"componentType": "page",
|
|
57
|
+
"path": "/dynamic/[slug]"
|
|
56
58
|
},
|
|
57
59
|
{
|
|
58
60
|
"id": "TQcvW_pSKi3",
|
|
@@ -85,8 +87,8 @@
|
|
|
85
87
|
"icons": [
|
|
86
88
|
{
|
|
87
89
|
"id": "gj-_D7n31Ho",
|
|
88
|
-
"name": "
|
|
89
|
-
"moduleFilePath": "plasmic/create_plasmic_app/icons/
|
|
90
|
+
"name": "CheckSvgIcon",
|
|
91
|
+
"moduleFilePath": "plasmic/create_plasmic_app/icons/PlasmicIcon__CheckSvg.tsx"
|
|
90
92
|
},
|
|
91
93
|
{
|
|
92
94
|
"id": "6PNxx3YMyDQ",
|
|
@@ -97,18 +99,22 @@
|
|
|
97
99
|
"images": [],
|
|
98
100
|
"indirect": false,
|
|
99
101
|
"globalContextsFilePath": "",
|
|
102
|
+
"splitsProviderFilePath": "",
|
|
100
103
|
"codeComponents": [
|
|
101
104
|
{
|
|
102
105
|
"id": "P6aGdYWZ2R",
|
|
103
106
|
"name": "PlasmicHead",
|
|
107
|
+
"displayName": "hostless-plasmic-head",
|
|
104
108
|
"componentImportPath": "@plasmicapp/react-web"
|
|
105
109
|
},
|
|
106
110
|
{
|
|
107
111
|
"id": "8G2A-uTjGa",
|
|
108
112
|
"name": "Fetcher",
|
|
113
|
+
"displayName": "plasmic-data-source-fetcher",
|
|
109
114
|
"componentImportPath": "@plasmicapp/react-web/lib/data-sources"
|
|
110
115
|
}
|
|
111
|
-
]
|
|
116
|
+
],
|
|
117
|
+
"customFunctions": []
|
|
112
118
|
}
|
|
113
119
|
],
|
|
114
120
|
"globalVariants": {
|
|
@@ -125,6 +131,6 @@
|
|
|
125
131
|
"nextjsConfig": {
|
|
126
132
|
"pagesDir": "../pages"
|
|
127
133
|
},
|
|
128
|
-
"cliVersion": "0.1.
|
|
129
|
-
"$schema": "https://unpkg.com/@plasmicapp/cli@0.1.
|
|
134
|
+
"cliVersion": "0.1.331",
|
|
135
|
+
"$schema": "https://unpkg.com/@plasmicapp/cli@0.1.331/dist/plasmic.schema.json"
|
|
130
136
|
}
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
|
-
"target": "es5",
|
|
4
3
|
"lib": ["dom", "dom.iterable", "esnext"],
|
|
5
4
|
"allowJs": true,
|
|
6
5
|
"skipLibCheck": true,
|
|
7
6
|
"strict": true,
|
|
8
|
-
"forceConsistentCasingInFileNames": true,
|
|
9
7
|
"noEmit": true,
|
|
10
8
|
"esModuleInterop": true,
|
|
11
9
|
"module": "esnext",
|
|
12
|
-
"moduleResolution": "
|
|
10
|
+
"moduleResolution": "bundler",
|
|
13
11
|
"resolveJsonModule": true,
|
|
14
12
|
"isolatedModules": true,
|
|
15
13
|
"jsx": "preserve",
|
|
@@ -9,11 +9,13 @@
|
|
|
9
9
|
"lint": "next lint"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@plasmicapp/loader-nextjs": "^1.0.
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
"@plasmicapp/loader-nextjs": "^1.0.406",
|
|
13
|
+
"next": "14.2.15",
|
|
14
|
+
"react": "^18",
|
|
15
|
+
"react-dom": "^18"
|
|
16
|
+
},
|
|
17
|
+
"devDependencies": {
|
|
18
|
+
"eslint": "^8",
|
|
19
|
+
"eslint-config-next": "14.2.15"
|
|
18
20
|
}
|
|
19
21
|
}
|
|
@@ -22,6 +22,7 @@ export default function PlasmicLoaderPage(props) {
|
|
|
22
22
|
loader={PLASMIC}
|
|
23
23
|
prefetchedData={plasmicData}
|
|
24
24
|
prefetchedQueryData={queryCache}
|
|
25
|
+
pageRoute={pageMeta.path}
|
|
25
26
|
pageParams={pageMeta.params}
|
|
26
27
|
pageQuery={router.query}
|
|
27
28
|
>
|
|
@@ -44,6 +45,7 @@ export const getStaticProps = async (context) => {
|
|
|
44
45
|
<PlasmicRootProvider
|
|
45
46
|
loader={PLASMIC}
|
|
46
47
|
prefetchedData={plasmicData}
|
|
48
|
+
pageRoute={pageMeta.path}
|
|
47
49
|
pageParams={pageMeta.params}
|
|
48
50
|
>
|
|
49
51
|
<PlasmicComponent component={pageMeta.displayName} />
|