create-plasmic-app 0.0.92 → 0.0.93
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/package.json +2 -2
- package/src/nextjs/nextjs.ts +5 -24
- package/src/nextjs/templates/pages-loader/catchall-page.ts +1 -1
- package/.tool-versions +0 -1
package/cpa-out/nextjs-pages-codegen-ts/components/plasmic/create_plasmic_app/PlasmicButton.tsx
CHANGED
|
@@ -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
|
-
import * as pp from "@plasmicapp/react-web";
|
|
24
20
|
import {
|
|
25
|
-
|
|
26
|
-
classNames,
|
|
27
|
-
wrapWithClassName,
|
|
28
|
-
createPlasmicElementProxy,
|
|
29
|
-
makeFragment,
|
|
21
|
+
Flex as Flex__,
|
|
30
22
|
MultiChoiceArg,
|
|
23
|
+
PlasmicDataSourceContextProvider as PlasmicDataSourceContextProvider__,
|
|
24
|
+
PlasmicIcon as PlasmicIcon__,
|
|
25
|
+
PlasmicImg as PlasmicImg__,
|
|
26
|
+
PlasmicLink as PlasmicLink__,
|
|
27
|
+
PlasmicPageGuard as PlasmicPageGuard__,
|
|
31
28
|
SingleBooleanChoiceArg,
|
|
32
29
|
SingleChoiceArg,
|
|
33
|
-
|
|
34
|
-
omit,
|
|
35
|
-
useTrigger,
|
|
30
|
+
Stack as Stack__,
|
|
36
31
|
StrictProps,
|
|
32
|
+
Trans as Trans__,
|
|
33
|
+
classNames,
|
|
34
|
+
createPlasmicElementProxy,
|
|
37
35
|
deriveRenderOpts,
|
|
38
|
-
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
|
|
39
55
|
} from "@plasmicapp/react-web";
|
|
56
|
+
import {
|
|
57
|
+
DataCtxReader as DataCtxReader__,
|
|
58
|
+
useDataEnv,
|
|
59
|
+
useGlobalActions
|
|
60
|
+
} from "@plasmicapp/react-web/lib/host";
|
|
61
|
+
|
|
62
|
+
import * as pp from "@plasmicapp/react-web";
|
|
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 "./PlasmicButton.module.css"; // plasmic-import: TQcvW_pSKi3/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 PlasmicButton__VariantMembers = {
|
|
50
75
|
showStartIcon: "showStartIcon";
|
|
51
76
|
showEndIcon: "showEndIcon";
|
|
@@ -104,23 +129,26 @@ export type PlasmicButton__ArgsType = {
|
|
|
104
129
|
startIcon?: React.ReactNode;
|
|
105
130
|
endIcon?: React.ReactNode;
|
|
106
131
|
link?: string;
|
|
132
|
+
submitsForm?: boolean;
|
|
107
133
|
};
|
|
108
134
|
type ArgPropType = keyof PlasmicButton__ArgsType;
|
|
109
135
|
export const PlasmicButton__ArgProps = new Array<ArgPropType>(
|
|
110
136
|
"children",
|
|
111
137
|
"startIcon",
|
|
112
138
|
"endIcon",
|
|
113
|
-
"link"
|
|
139
|
+
"link",
|
|
140
|
+
"submitsForm"
|
|
114
141
|
);
|
|
115
142
|
|
|
116
143
|
export type PlasmicButton__OverridesType = {
|
|
117
|
-
root?:
|
|
118
|
-
startIconContainer?:
|
|
119
|
-
contentContainer?:
|
|
120
|
-
endIconContainer?:
|
|
144
|
+
root?: Flex__<"button">;
|
|
145
|
+
startIconContainer?: Flex__<"div">;
|
|
146
|
+
contentContainer?: Flex__<"div">;
|
|
147
|
+
endIconContainer?: Flex__<"div">;
|
|
121
148
|
};
|
|
122
149
|
|
|
123
150
|
export interface DefaultButtonProps extends pp.BaseButtonProps {
|
|
151
|
+
submitsForm?: boolean;
|
|
124
152
|
shape?: SingleChoiceArg<"rounded" | "round" | "sharp">;
|
|
125
153
|
size?: SingleChoiceArg<"compact" | "minimal">;
|
|
126
154
|
color?: SingleChoiceArg<
|
|
@@ -140,13 +168,7 @@ export interface DefaultButtonProps extends pp.BaseButtonProps {
|
|
|
140
168
|
>;
|
|
141
169
|
}
|
|
142
170
|
|
|
143
|
-
const
|
|
144
|
-
globalThis.__PlasmicWrapUserFunction ?? ((loc, fn) => fn());
|
|
145
|
-
const __wrapUserPromise =
|
|
146
|
-
globalThis.__PlasmicWrapUserPromise ??
|
|
147
|
-
(async (loc, promise) => {
|
|
148
|
-
return await promise;
|
|
149
|
-
});
|
|
171
|
+
const $$ = {};
|
|
150
172
|
|
|
151
173
|
function useNextRouter() {
|
|
152
174
|
try {
|
|
@@ -162,74 +184,75 @@ function PlasmicButton__RenderFunc(props: {
|
|
|
162
184
|
forNode?: string;
|
|
163
185
|
}) {
|
|
164
186
|
const { variants, overrides, forNode } = props;
|
|
165
|
-
const __nextRouter = useNextRouter();
|
|
166
187
|
|
|
167
|
-
const
|
|
168
|
-
|
|
188
|
+
const args = React.useMemo(
|
|
189
|
+
() =>
|
|
190
|
+
Object.assign(
|
|
191
|
+
{},
|
|
192
|
+
Object.fromEntries(
|
|
193
|
+
Object.entries(props.args).filter(([_, v]) => v !== undefined)
|
|
194
|
+
)
|
|
195
|
+
),
|
|
196
|
+
[props.args]
|
|
197
|
+
);
|
|
169
198
|
|
|
170
199
|
const $props = {
|
|
171
200
|
...args,
|
|
172
201
|
...variants
|
|
173
202
|
};
|
|
203
|
+
|
|
204
|
+
const __nextRouter = useNextRouter();
|
|
205
|
+
const $ctx = useDataEnv?.() || {};
|
|
174
206
|
const refsRef = React.useRef({});
|
|
175
207
|
const $refs = refsRef.current;
|
|
176
208
|
|
|
177
|
-
const
|
|
178
|
-
const [$queries, setDollarQueries] = React.useState({});
|
|
179
|
-
const stateSpecs = React.useMemo(
|
|
209
|
+
const stateSpecs: Parameters<typeof useDollarState>[0] = React.useMemo(
|
|
180
210
|
() => [
|
|
181
211
|
{
|
|
182
212
|
path: "showStartIcon",
|
|
183
213
|
type: "private",
|
|
184
214
|
variableType: "variant",
|
|
185
|
-
initFunc:
|
|
186
|
-
? ({ $props, $state, $queries, $ctx }) => $props.showStartIcon
|
|
187
|
-
: undefined
|
|
215
|
+
initFunc: ({ $props, $state, $queries, $ctx }) => $props.showStartIcon
|
|
188
216
|
},
|
|
189
217
|
{
|
|
190
218
|
path: "showEndIcon",
|
|
191
219
|
type: "private",
|
|
192
220
|
variableType: "variant",
|
|
193
|
-
initFunc:
|
|
194
|
-
? ({ $props, $state, $queries, $ctx }) => $props.showEndIcon
|
|
195
|
-
: undefined
|
|
221
|
+
initFunc: ({ $props, $state, $queries, $ctx }) => $props.showEndIcon
|
|
196
222
|
},
|
|
197
223
|
{
|
|
198
224
|
path: "isDisabled",
|
|
199
225
|
type: "private",
|
|
200
226
|
variableType: "variant",
|
|
201
|
-
initFunc:
|
|
202
|
-
? ({ $props, $state, $queries, $ctx }) => $props.isDisabled
|
|
203
|
-
: undefined
|
|
227
|
+
initFunc: ({ $props, $state, $queries, $ctx }) => $props.isDisabled
|
|
204
228
|
},
|
|
205
229
|
{
|
|
206
230
|
path: "shape",
|
|
207
231
|
type: "private",
|
|
208
232
|
variableType: "variant",
|
|
209
|
-
initFunc:
|
|
210
|
-
? ({ $props, $state, $queries, $ctx }) => $props.shape
|
|
211
|
-
: undefined
|
|
233
|
+
initFunc: ({ $props, $state, $queries, $ctx }) => $props.shape
|
|
212
234
|
},
|
|
213
235
|
{
|
|
214
236
|
path: "size",
|
|
215
237
|
type: "private",
|
|
216
238
|
variableType: "variant",
|
|
217
|
-
initFunc:
|
|
218
|
-
? ({ $props, $state, $queries, $ctx }) => $props.size
|
|
219
|
-
: undefined
|
|
239
|
+
initFunc: ({ $props, $state, $queries, $ctx }) => $props.size
|
|
220
240
|
},
|
|
221
241
|
{
|
|
222
242
|
path: "color",
|
|
223
243
|
type: "private",
|
|
224
244
|
variableType: "variant",
|
|
225
|
-
initFunc:
|
|
226
|
-
? ({ $props, $state, $queries, $ctx }) => $props.color
|
|
227
|
-
: undefined
|
|
245
|
+
initFunc: ({ $props, $state, $queries, $ctx }) => $props.color
|
|
228
246
|
}
|
|
229
247
|
],
|
|
230
|
-
[$props, $ctx]
|
|
248
|
+
[$props, $ctx, $refs]
|
|
231
249
|
);
|
|
232
|
-
const $state =
|
|
250
|
+
const $state = useDollarState(stateSpecs, {
|
|
251
|
+
$props,
|
|
252
|
+
$ctx,
|
|
253
|
+
$queries: {},
|
|
254
|
+
$refs
|
|
255
|
+
});
|
|
233
256
|
|
|
234
257
|
const [isRootFocusVisibleWithin, triggerRootFocusVisibleWithinProps] =
|
|
235
258
|
useTrigger("useFocusVisibleWithin", {
|
|
@@ -240,7 +263,7 @@ function PlasmicButton__RenderFunc(props: {
|
|
|
240
263
|
};
|
|
241
264
|
|
|
242
265
|
return (
|
|
243
|
-
<
|
|
266
|
+
<Stack__
|
|
244
267
|
as={"button"}
|
|
245
268
|
data-plasmic-name={"root"}
|
|
246
269
|
data-plasmic-override={overrides.root}
|
|
@@ -253,6 +276,7 @@ function PlasmicButton__RenderFunc(props: {
|
|
|
253
276
|
projectcss.root_reset,
|
|
254
277
|
projectcss.plasmic_default_styles,
|
|
255
278
|
projectcss.plasmic_mixins,
|
|
279
|
+
projectcss.plasmic_tokens,
|
|
256
280
|
sty.root,
|
|
257
281
|
{
|
|
258
282
|
[sty.root___focusVisibleWithin]: triggers.focusVisibleWithin_root,
|
|
@@ -334,9 +358,9 @@ function PlasmicButton__RenderFunc(props: {
|
|
|
334
358
|
)
|
|
335
359
|
})}
|
|
336
360
|
>
|
|
337
|
-
{
|
|
361
|
+
{renderPlasmicSlot({
|
|
338
362
|
defaultContents: (
|
|
339
|
-
<
|
|
363
|
+
<CheckSvgIcon
|
|
340
364
|
className={classNames(projectcss.all, sty.svg__s6Xxe)}
|
|
341
365
|
role={"img"}
|
|
342
366
|
/>
|
|
@@ -403,7 +427,6 @@ function PlasmicButton__RenderFunc(props: {
|
|
|
403
427
|
})}
|
|
404
428
|
</div>
|
|
405
429
|
) : null}
|
|
406
|
-
|
|
407
430
|
<div
|
|
408
431
|
data-plasmic-name={"contentContainer"}
|
|
409
432
|
data-plasmic-override={overrides.contentContainer}
|
|
@@ -427,7 +450,7 @@ function PlasmicButton__RenderFunc(props: {
|
|
|
427
450
|
)
|
|
428
451
|
})}
|
|
429
452
|
>
|
|
430
|
-
{
|
|
453
|
+
{renderPlasmicSlot({
|
|
431
454
|
defaultContents: "Button",
|
|
432
455
|
value: args.children,
|
|
433
456
|
className: classNames(sty.slotTargetChildren, {
|
|
@@ -529,7 +552,6 @@ function PlasmicButton__RenderFunc(props: {
|
|
|
529
552
|
})
|
|
530
553
|
})}
|
|
531
554
|
</div>
|
|
532
|
-
|
|
533
555
|
{(hasVariant($state, "showEndIcon", "showEndIcon") ? true : false) ? (
|
|
534
556
|
<div
|
|
535
557
|
data-plasmic-name={"endIconContainer"}
|
|
@@ -552,7 +574,7 @@ function PlasmicButton__RenderFunc(props: {
|
|
|
552
574
|
)
|
|
553
575
|
})}
|
|
554
576
|
>
|
|
555
|
-
{
|
|
577
|
+
{renderPlasmicSlot({
|
|
556
578
|
defaultContents: (
|
|
557
579
|
<IconIcon
|
|
558
580
|
className={classNames(projectcss.all, sty.svg__liJa)}
|
|
@@ -616,11 +638,11 @@ function PlasmicButton__RenderFunc(props: {
|
|
|
616
638
|
})}
|
|
617
639
|
</div>
|
|
618
640
|
) : null}
|
|
619
|
-
</
|
|
641
|
+
</Stack__>
|
|
620
642
|
) as React.ReactElement | null;
|
|
621
643
|
}
|
|
622
644
|
|
|
623
|
-
function useBehavior<P extends pp.
|
|
645
|
+
function useBehavior<P extends pp.PlumeButtonProps>(
|
|
624
646
|
props: P,
|
|
625
647
|
ref: pp.ButtonRef
|
|
626
648
|
) {
|
|
@@ -641,9 +663,8 @@ function useBehavior<P extends pp.BaseButtonProps>(
|
|
|
641
663
|
},
|
|
642
664
|
ref
|
|
643
665
|
);
|
|
644
|
-
|
|
645
666
|
if (b.plasmicProps.overrides.root.as === "a") {
|
|
646
|
-
b.plasmicProps.overrides.root.as =
|
|
667
|
+
b.plasmicProps.overrides.root.as = PlasmicLink__;
|
|
647
668
|
b.plasmicProps.overrides.root.props.component = Link;
|
|
648
669
|
b.plasmicProps.overrides.root.props.platform = "nextjs";
|
|
649
670
|
}
|
|
@@ -700,7 +721,7 @@ function makeNodeComponent<NodeName extends NodeNameType>(nodeName: NodeName) {
|
|
|
700
721
|
() =>
|
|
701
722
|
deriveRenderOpts(props, {
|
|
702
723
|
name: nodeName,
|
|
703
|
-
descendantNames:
|
|
724
|
+
descendantNames: PlasmicDescendants[nodeName],
|
|
704
725
|
internalArgPropNames: PlasmicButton__ArgProps,
|
|
705
726
|
internalVariantPropNames: PlasmicButton__VariantProps
|
|
706
727
|
}),
|
package/cpa-out/nextjs-pages-codegen-ts/components/plasmic/create_plasmic_app/PlasmicDynamicPage.tsx
CHANGED
|
@@ -17,32 +17,57 @@ 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
|
|
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 "./PlasmicDynamicPage.module.css"; // plasmic-import: AO44A-w7hh/css
|
|
45
68
|
|
|
69
|
+
createPlasmicElementProxy;
|
|
70
|
+
|
|
46
71
|
export type PlasmicDynamicPage__VariantMembers = {};
|
|
47
72
|
export type PlasmicDynamicPage__VariantsArgs = {};
|
|
48
73
|
type VariantPropType = keyof PlasmicDynamicPage__VariantsArgs;
|
|
@@ -53,21 +78,15 @@ type ArgPropType = keyof PlasmicDynamicPage__ArgsType;
|
|
|
53
78
|
export const PlasmicDynamicPage__ArgProps = new Array<ArgPropType>();
|
|
54
79
|
|
|
55
80
|
export type PlasmicDynamicPage__OverridesType = {
|
|
56
|
-
root?:
|
|
57
|
-
section?:
|
|
58
|
-
h1?:
|
|
59
|
-
randomDynamicPageButton?:
|
|
81
|
+
root?: Flex__<"div">;
|
|
82
|
+
section?: Flex__<"section">;
|
|
83
|
+
h1?: Flex__<"h1">;
|
|
84
|
+
randomDynamicPageButton?: Flex__<typeof RandomDynamicPageButton>;
|
|
60
85
|
};
|
|
61
86
|
|
|
62
87
|
export interface DefaultDynamicPageProps {}
|
|
63
88
|
|
|
64
|
-
const
|
|
65
|
-
globalThis.__PlasmicWrapUserFunction ?? ((loc, fn) => fn());
|
|
66
|
-
const __wrapUserPromise =
|
|
67
|
-
globalThis.__PlasmicWrapUserPromise ??
|
|
68
|
-
(async (loc, promise) => {
|
|
69
|
-
return await promise;
|
|
70
|
-
});
|
|
89
|
+
const $$ = {};
|
|
71
90
|
|
|
72
91
|
function useNextRouter() {
|
|
73
92
|
try {
|
|
@@ -83,21 +102,28 @@ function PlasmicDynamicPage__RenderFunc(props: {
|
|
|
83
102
|
forNode?: string;
|
|
84
103
|
}) {
|
|
85
104
|
const { variants, overrides, forNode } = props;
|
|
86
|
-
const __nextRouter = useNextRouter();
|
|
87
105
|
|
|
88
|
-
const
|
|
89
|
-
|
|
106
|
+
const args = React.useMemo(
|
|
107
|
+
() =>
|
|
108
|
+
Object.assign(
|
|
109
|
+
{},
|
|
110
|
+
Object.fromEntries(
|
|
111
|
+
Object.entries(props.args).filter(([_, v]) => v !== undefined)
|
|
112
|
+
)
|
|
113
|
+
),
|
|
114
|
+
[props.args]
|
|
115
|
+
);
|
|
90
116
|
|
|
91
117
|
const $props = {
|
|
92
118
|
...args,
|
|
93
119
|
...variants
|
|
94
120
|
};
|
|
121
|
+
|
|
122
|
+
const __nextRouter = useNextRouter();
|
|
123
|
+
const $ctx = useDataEnv?.() || {};
|
|
95
124
|
const refsRef = React.useRef({});
|
|
96
125
|
const $refs = refsRef.current;
|
|
97
126
|
|
|
98
|
-
const currentUser = p.useCurrentUser?.() || {};
|
|
99
|
-
const [$queries, setDollarQueries] = React.useState({});
|
|
100
|
-
|
|
101
127
|
return (
|
|
102
128
|
<React.Fragment>
|
|
103
129
|
<Head></Head>
|
|
@@ -119,10 +145,11 @@ function PlasmicDynamicPage__RenderFunc(props: {
|
|
|
119
145
|
projectcss.root_reset,
|
|
120
146
|
projectcss.plasmic_default_styles,
|
|
121
147
|
projectcss.plasmic_mixins,
|
|
148
|
+
projectcss.plasmic_tokens,
|
|
122
149
|
sty.root
|
|
123
150
|
)}
|
|
124
151
|
>
|
|
125
|
-
<
|
|
152
|
+
<Stack__
|
|
126
153
|
as={"section"}
|
|
127
154
|
data-plasmic-name={"section"}
|
|
128
155
|
data-plasmic-override={overrides.section}
|
|
@@ -139,18 +166,22 @@ function PlasmicDynamicPage__RenderFunc(props: {
|
|
|
139
166
|
sty.h1
|
|
140
167
|
)}
|
|
141
168
|
>
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
169
|
+
<React.Fragment>
|
|
170
|
+
{(() => {
|
|
171
|
+
try {
|
|
172
|
+
return $ctx.params.slug;
|
|
173
|
+
} catch (e) {
|
|
174
|
+
if (
|
|
175
|
+
e instanceof TypeError ||
|
|
176
|
+
e?.plasmicType === "PlasmicUndefinedDataError"
|
|
177
|
+
) {
|
|
178
|
+
return "Page 1";
|
|
179
|
+
}
|
|
180
|
+
throw e;
|
|
148
181
|
}
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
})()}
|
|
182
|
+
})()}
|
|
183
|
+
</React.Fragment>
|
|
152
184
|
</h1>
|
|
153
|
-
|
|
154
185
|
<RandomDynamicPageButton
|
|
155
186
|
data-plasmic-name={"randomDynamicPageButton"}
|
|
156
187
|
data-plasmic-override={overrides.randomDynamicPageButton}
|
|
@@ -159,7 +190,7 @@ function PlasmicDynamicPage__RenderFunc(props: {
|
|
|
159
190
|
sty.randomDynamicPageButton
|
|
160
191
|
)}
|
|
161
192
|
/>
|
|
162
|
-
</
|
|
193
|
+
</Stack__>
|
|
163
194
|
</div>
|
|
164
195
|
</div>
|
|
165
196
|
</React.Fragment>
|
|
@@ -216,7 +247,7 @@ function makeNodeComponent<NodeName extends NodeNameType>(nodeName: NodeName) {
|
|
|
216
247
|
() =>
|
|
217
248
|
deriveRenderOpts(props, {
|
|
218
249
|
name: nodeName,
|
|
219
|
-
descendantNames:
|
|
250
|
+
descendantNames: PlasmicDescendants[nodeName],
|
|
220
251
|
internalArgPropNames: PlasmicDynamicPage__ArgProps,
|
|
221
252
|
internalVariantPropNames: PlasmicDynamicPage__VariantProps
|
|
222
253
|
}),
|
|
@@ -4,26 +4,14 @@
|
|
|
4
4
|
/* prettier-ignore-start */
|
|
5
5
|
|
|
6
6
|
import * as React from "react";
|
|
7
|
-
import
|
|
7
|
+
import { createUseScreenVariants } from "@plasmicapp/react-web";
|
|
8
8
|
|
|
9
9
|
export type ScreenValue = "desktopOnly";
|
|
10
10
|
export const ScreenContext = React.createContext<ScreenValue[] | undefined>(
|
|
11
11
|
"PLEASE_RENDER_INSIDE_PROVIDER" as any
|
|
12
12
|
);
|
|
13
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, {
|
|
14
|
+
export const useScreenVariants = createUseScreenVariants(true, {
|
|
27
15
|
desktopOnly: "(min-width:768px)",
|
|
28
16
|
});
|
|
29
17
|
|