create-plasmic-app 0.0.91 → 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.
Files changed (50) hide show
  1. package/cpa-out/nextjs-app-loader-js/pages/[[...catchall]].jsx +68 -0
  2. package/cpa-out/nextjs-app-loader-js/pages/api/hello.js +5 -0
  3. package/cpa-out/nextjs-app-loader-js/pages/plasmic-host.jsx +7 -0
  4. package/cpa-out/nextjs-app-loader-ts/pages/[[...catchall]].tsx +72 -0
  5. package/cpa-out/nextjs-app-loader-ts/pages/api/hello.ts +13 -0
  6. package/cpa-out/nextjs-app-loader-ts/pages/plasmic-host.tsx +7 -0
  7. package/cpa-out/nextjs-pages-codegen-js/components/Button.jsx +1 -3
  8. package/cpa-out/nextjs-pages-codegen-js/components/plasmic/create_plasmic_app/PlasmicButton.jsx +50 -98
  9. package/cpa-out/nextjs-pages-codegen-js/components/plasmic/create_plasmic_app/PlasmicDynamicPage.jsx +36 -30
  10. package/cpa-out/nextjs-pages-codegen-js/components/plasmic/create_plasmic_app/PlasmicGlobalVariant__Screen.jsx +2 -14
  11. package/cpa-out/nextjs-pages-codegen-js/components/plasmic/create_plasmic_app/PlasmicHomepage.jsx +25 -25
  12. package/cpa-out/nextjs-pages-codegen-js/components/plasmic/create_plasmic_app/PlasmicRandomDynamicPageButton.jsx +45 -59
  13. package/cpa-out/nextjs-pages-codegen-js/components/plasmic/create_plasmic_app/icons/PlasmicIcon__Checksvg.jsx +2 -2
  14. package/cpa-out/nextjs-pages-codegen-js/package.json +9 -7
  15. package/cpa-out/nextjs-pages-codegen-js/pages/api/hello.js +1 -1
  16. package/cpa-out/nextjs-pages-codegen-js/pages/dynamic/[slug].jsx +4 -3
  17. package/cpa-out/nextjs-pages-codegen-js/pages/index.jsx +4 -3
  18. package/cpa-out/nextjs-pages-codegen-js/plasmic.json +14 -8
  19. package/cpa-out/nextjs-pages-codegen-ts/components/Button.tsx +4 -5
  20. package/cpa-out/nextjs-pages-codegen-ts/components/plasmic/create_plasmic_app/PlasmicButton.tsx +86 -65
  21. package/cpa-out/nextjs-pages-codegen-ts/components/plasmic/create_plasmic_app/PlasmicDynamicPage.tsx +74 -43
  22. package/cpa-out/nextjs-pages-codegen-ts/components/plasmic/create_plasmic_app/PlasmicGlobalVariant__Screen.tsx +2 -14
  23. package/cpa-out/nextjs-pages-codegen-ts/components/plasmic/create_plasmic_app/PlasmicHomepage.tsx +63 -37
  24. package/cpa-out/nextjs-pages-codegen-ts/components/plasmic/create_plasmic_app/PlasmicRandomDynamicPageButton.tsx +84 -71
  25. package/cpa-out/nextjs-pages-codegen-ts/components/plasmic/create_plasmic_app/icons/PlasmicIcon__Checksvg.tsx +3 -3
  26. package/cpa-out/nextjs-pages-codegen-ts/package.json +13 -11
  27. package/cpa-out/nextjs-pages-codegen-ts/pages/api/hello.ts +5 -5
  28. package/cpa-out/nextjs-pages-codegen-ts/pages/dynamic/[slug].tsx +4 -4
  29. package/cpa-out/nextjs-pages-codegen-ts/pages/index.tsx +4 -4
  30. package/cpa-out/nextjs-pages-codegen-ts/plasmic.json +14 -8
  31. package/cpa-out/nextjs-pages-codegen-ts/tsconfig.json +1 -3
  32. package/cpa-out/nextjs-pages-loader-js/package.json +8 -6
  33. package/cpa-out/nextjs-pages-loader-js/pages/[[...catchall]].jsx +2 -0
  34. package/cpa-out/nextjs-pages-loader-js/pages/api/hello.js +1 -1
  35. package/cpa-out/nextjs-pages-loader-ts/package.json +12 -10
  36. package/cpa-out/nextjs-pages-loader-ts/pages/[[...catchall]].tsx +3 -1
  37. package/cpa-out/nextjs-pages-loader-ts/pages/api/hello.ts +5 -5
  38. package/cpa-out/nextjs-pages-loader-ts/tsconfig.json +1 -3
  39. package/dist/nextjs/nextjs.js +5 -23
  40. package/dist/nextjs/templates/pages-loader/catchall-page.js +1 -1
  41. package/package.json +2 -2
  42. package/src/nextjs/nextjs.ts +5 -24
  43. package/src/nextjs/templates/pages-loader/catchall-page.ts +1 -1
  44. package/.tool-versions +0 -1
  45. package/cpa-out/nextjs-app-loader-js/next.config.js +0 -13
  46. package/cpa-out/nextjs-app-loader-ts/next.config.js +0 -13
  47. package/cpa-out/nextjs-pages-codegen-js/next.config.js +0 -10
  48. package/cpa-out/nextjs-pages-codegen-ts/next.config.js +0 -10
  49. package/cpa-out/nextjs-pages-loader-js/next.config.js +0 -10
  50. package/cpa-out/nextjs-pages-loader-ts/next.config.js +0 -10
@@ -11,22 +11,27 @@
11
11
  import * as React from "react";
12
12
  import Link from "next/link";
13
13
  import { useRouter } from "next/router";
14
- import * as p from "@plasmicapp/react-web";
15
- import * as ph from "@plasmicapp/react-web/lib/host";
16
- import * as pp from "@plasmicapp/react-web";
17
14
  import {
18
- hasVariant,
15
+ PlasmicLink as PlasmicLink__,
16
+ Stack as Stack__,
19
17
  classNames,
20
18
  createPlasmicElementProxy,
21
- useTrigger,
22
- deriveRenderOpts
19
+ deriveRenderOpts,
20
+ hasVariant,
21
+ renderPlasmicSlot,
22
+ useDollarState,
23
+ useTrigger
23
24
  } from "@plasmicapp/react-web";
25
+ import { useDataEnv } from "@plasmicapp/react-web/lib/host";
26
+ import * as pp from "@plasmicapp/react-web";
24
27
  import "@plasmicapp/react-web/lib/plasmic.css";
25
- import projectcss from "./plasmic_create_plasmic_app.module.css"; // plasmic-import: 47tFXWjN2C4NyHFGGpaYQ3/projectcss
28
+ import projectcss from "./plasmic.module.css"; // plasmic-import: 47tFXWjN2C4NyHFGGpaYQ3/projectcss
26
29
  import sty from "./PlasmicButton.module.css"; // plasmic-import: TQcvW_pSKi3/css
27
- import ChecksvgIcon from "./icons/PlasmicIcon__Checksvg"; // plasmic-import: gj-_D7n31Ho/icon
30
+ import CheckSvgIcon from "./icons/PlasmicIcon__CheckSvg"; // plasmic-import: gj-_D7n31Ho/icon
28
31
  import IconIcon from "./icons/PlasmicIcon__Icon"; // plasmic-import: 6PNxx3YMyDQ/icon
29
32
 
33
+ createPlasmicElementProxy;
34
+
30
35
  export const PlasmicButton__VariantProps = new Array(
31
36
  "showStartIcon",
32
37
  "showEndIcon",
@@ -40,17 +45,11 @@ export const PlasmicButton__ArgProps = new Array(
40
45
  "children",
41
46
  "startIcon",
42
47
  "endIcon",
43
- "link"
48
+ "link",
49
+ "submitsForm"
44
50
  );
45
51
 
46
- const __wrapUserFunction =
47
- globalThis.__PlasmicWrapUserFunction ?? ((loc, fn) => fn());
48
-
49
- const __wrapUserPromise =
50
- globalThis.__PlasmicWrapUserPromise ??
51
- (async (loc, promise) => {
52
- return await promise;
53
- });
52
+ const $$ = {};
54
53
 
55
54
  function useNextRouter() {
56
55
  try {
@@ -61,73 +60,72 @@ function useNextRouter() {
61
60
 
62
61
  function PlasmicButton__RenderFunc(props) {
63
62
  const { variants, overrides, forNode } = props;
64
- const __nextRouter = useNextRouter();
65
- const $ctx = ph.useDataEnv?.() || {};
66
- const args = React.useMemo(() => Object.assign({}, props.args), [props.args]);
63
+ const args = React.useMemo(
64
+ () =>
65
+ Object.assign(
66
+ {},
67
+ Object.fromEntries(
68
+ Object.entries(props.args).filter(([_, v]) => v !== undefined)
69
+ )
70
+ ),
71
+ [props.args]
72
+ );
67
73
  const $props = {
68
74
  ...args,
69
75
  ...variants
70
76
  };
77
+ const __nextRouter = useNextRouter();
78
+ const $ctx = useDataEnv?.() || {};
71
79
  const refsRef = React.useRef({});
72
80
  const $refs = refsRef.current;
73
- const currentUser = p.useCurrentUser?.() || {};
74
- const [$queries, setDollarQueries] = React.useState({});
75
81
  const stateSpecs = React.useMemo(
76
82
  () => [
77
83
  {
78
84
  path: "showStartIcon",
79
85
  type: "private",
80
86
  variableType: "variant",
81
- initFunc: true
82
- ? ({ $props, $state, $queries, $ctx }) => $props.showStartIcon
83
- : undefined
87
+ initFunc: ({ $props, $state, $queries, $ctx }) => $props.showStartIcon
84
88
  },
85
89
  {
86
90
  path: "showEndIcon",
87
91
  type: "private",
88
92
  variableType: "variant",
89
- initFunc: true
90
- ? ({ $props, $state, $queries, $ctx }) => $props.showEndIcon
91
- : undefined
93
+ initFunc: ({ $props, $state, $queries, $ctx }) => $props.showEndIcon
92
94
  },
93
95
  {
94
96
  path: "isDisabled",
95
97
  type: "private",
96
98
  variableType: "variant",
97
- initFunc: true
98
- ? ({ $props, $state, $queries, $ctx }) => $props.isDisabled
99
- : undefined
99
+ initFunc: ({ $props, $state, $queries, $ctx }) => $props.isDisabled
100
100
  },
101
101
  {
102
102
  path: "shape",
103
103
  type: "private",
104
104
  variableType: "variant",
105
- initFunc: true
106
- ? ({ $props, $state, $queries, $ctx }) => $props.shape
107
- : undefined
105
+ initFunc: ({ $props, $state, $queries, $ctx }) => $props.shape
108
106
  },
109
107
  {
110
108
  path: "size",
111
109
  type: "private",
112
110
  variableType: "variant",
113
- initFunc: true
114
- ? ({ $props, $state, $queries, $ctx }) => $props.size
115
- : undefined
111
+ initFunc: ({ $props, $state, $queries, $ctx }) => $props.size
116
112
  },
117
113
  {
118
114
  path: "color",
119
115
  type: "private",
120
116
  variableType: "variant",
121
- initFunc: true
122
- ? ({ $props, $state, $queries, $ctx }) => $props.color
123
- : undefined
117
+ initFunc: ({ $props, $state, $queries, $ctx }) => $props.color
124
118
  }
125
119
  ],
126
120
 
127
- [$props, $ctx]
121
+ [$props, $ctx, $refs]
128
122
  );
129
-
130
- const $state = p.useDollarState(stateSpecs, { $props, $ctx, $queries });
123
+ const $state = useDollarState(stateSpecs, {
124
+ $props,
125
+ $ctx,
126
+ $queries: {},
127
+ $refs
128
+ });
131
129
  const [isRootFocusVisibleWithin, triggerRootFocusVisibleWithinProps] =
132
130
  useTrigger("useFocusVisibleWithin", {
133
131
  isTextInput: false
@@ -136,7 +134,7 @@ function PlasmicButton__RenderFunc(props) {
136
134
  focusVisibleWithin_root: isRootFocusVisibleWithin
137
135
  };
138
136
  return (
139
- <p.Stack
137
+ <Stack__
140
138
  as={"button"}
141
139
  data-plasmic-name={"root"}
142
140
  data-plasmic-override={overrides.root}
@@ -149,6 +147,7 @@ function PlasmicButton__RenderFunc(props) {
149
147
  projectcss.root_reset,
150
148
  projectcss.plasmic_default_styles,
151
149
  projectcss.plasmic_mixins,
150
+ projectcss.plasmic_tokens,
152
151
  sty.root,
153
152
  {
154
153
  [sty.root___focusVisibleWithin]: triggers.focusVisibleWithin_root,
@@ -186,7 +185,6 @@ function PlasmicButton__RenderFunc(props) {
186
185
  "showEndIcon",
187
186
  "showEndIcon"
188
187
  ),
189
-
190
188
  [sty.rootshowEndIcon_shape_rounded]:
191
189
  hasVariant($state, "showEndIcon", "showEndIcon") &&
192
190
  hasVariant($state, "shape", "rounded"),
@@ -202,7 +200,6 @@ function PlasmicButton__RenderFunc(props) {
202
200
  "showStartIcon",
203
201
  "showStartIcon"
204
202
  ),
205
-
206
203
  [sty.rootsize_compact]: hasVariant($state, "size", "compact"),
207
204
  [sty.rootsize_compact_showStartIcon]:
208
205
  hasVariant($state, "size", "compact") &&
@@ -222,7 +219,6 @@ function PlasmicButton__RenderFunc(props) {
222
219
  "color",
223
220
  "blue"
224
221
  ),
225
-
226
222
  [sty.startIconContainershape_rounded_showStartIcon]:
227
223
  hasVariant($state, "shape", "rounded") &&
228
224
  hasVariant($state, "showStartIcon", "showStartIcon"),
@@ -233,9 +229,9 @@ function PlasmicButton__RenderFunc(props) {
233
229
  )
234
230
  })}
235
231
  >
236
- {p.renderPlasmicSlot({
232
+ {renderPlasmicSlot({
237
233
  defaultContents: (
238
- <ChecksvgIcon
234
+ <CheckSvgIcon
239
235
  className={classNames(projectcss.all, sty.svg__s6Xxe)}
240
236
  role={"img"}
241
237
  />
@@ -248,61 +244,51 @@ function PlasmicButton__RenderFunc(props) {
248
244
  "color",
249
245
  "blue"
250
246
  ),
251
-
252
247
  [sty.slotTargetStartIconcolor_clear]: hasVariant(
253
248
  $state,
254
249
  "color",
255
250
  "clear"
256
251
  ),
257
-
258
252
  [sty.slotTargetStartIconcolor_link]: hasVariant(
259
253
  $state,
260
254
  "color",
261
255
  "link"
262
256
  ),
263
-
264
257
  [sty.slotTargetStartIconcolor_softBlue]: hasVariant(
265
258
  $state,
266
259
  "color",
267
260
  "softBlue"
268
261
  ),
269
-
270
262
  [sty.slotTargetStartIconcolor_softGreen]: hasVariant(
271
263
  $state,
272
264
  "color",
273
265
  "softGreen"
274
266
  ),
275
-
276
267
  [sty.slotTargetStartIconcolor_softRed]: hasVariant(
277
268
  $state,
278
269
  "color",
279
270
  "softRed"
280
271
  ),
281
-
282
272
  [sty.slotTargetStartIconcolor_softSand]: hasVariant(
283
273
  $state,
284
274
  "color",
285
275
  "softSand"
286
276
  ),
287
-
288
277
  [sty.slotTargetStartIconcolor_softYellow]: hasVariant(
289
278
  $state,
290
279
  "color",
291
280
  "softYellow"
292
281
  ),
293
-
294
282
  [sty.slotTargetStartIconcolor_white]: hasVariant(
295
283
  $state,
296
284
  "color",
297
285
  "white"
298
286
  ),
299
-
300
287
  [sty.slotTargetStartIconcolor_yellow]: hasVariant(
301
288
  $state,
302
289
  "color",
303
290
  "yellow"
304
291
  ),
305
-
306
292
  [sty.slotTargetStartIconshowStartIcon]: hasVariant(
307
293
  $state,
308
294
  "showStartIcon",
@@ -312,7 +298,6 @@ function PlasmicButton__RenderFunc(props) {
312
298
  })}
313
299
  </div>
314
300
  ) : null}
315
-
316
301
  <div
317
302
  data-plasmic-name={"contentContainer"}
318
303
  data-plasmic-override={overrides.contentContainer}
@@ -324,13 +309,11 @@ function PlasmicButton__RenderFunc(props) {
324
309
  "isDisabled",
325
310
  "isDisabled"
326
311
  ),
327
-
328
312
  [sty.contentContainershape_rounded]: hasVariant(
329
313
  $state,
330
314
  "shape",
331
315
  "rounded"
332
316
  ),
333
-
334
317
  [sty.contentContainershowEndIcon]: hasVariant(
335
318
  $state,
336
319
  "showEndIcon",
@@ -338,7 +321,7 @@ function PlasmicButton__RenderFunc(props) {
338
321
  )
339
322
  })}
340
323
  >
341
- {p.renderPlasmicSlot({
324
+ {renderPlasmicSlot({
342
325
  defaultContents: "Button",
343
326
  value: args.children,
344
327
  className: classNames(sty.slotTargetChildren, {
@@ -349,25 +332,21 @@ function PlasmicButton__RenderFunc(props) {
349
332
  "color",
350
333
  "blue"
351
334
  ),
352
-
353
335
  [sty.slotTargetChildrencolor_clear]: hasVariant(
354
336
  $state,
355
337
  "color",
356
338
  "clear"
357
339
  ),
358
-
359
340
  [sty.slotTargetChildrencolor_green]: hasVariant(
360
341
  $state,
361
342
  "color",
362
343
  "green"
363
344
  ),
364
-
365
345
  [sty.slotTargetChildrencolor_link]: hasVariant(
366
346
  $state,
367
347
  "color",
368
348
  "link"
369
349
  ),
370
-
371
350
  [sty.slotTargetChildrencolor_link_size_minimal]:
372
351
  hasVariant($state, "color", "link") &&
373
352
  hasVariant($state, "size", "minimal"),
@@ -376,79 +355,66 @@ function PlasmicButton__RenderFunc(props) {
376
355
  "color",
377
356
  "red"
378
357
  ),
379
-
380
358
  [sty.slotTargetChildrencolor_sand]: hasVariant(
381
359
  $state,
382
360
  "color",
383
361
  "sand"
384
362
  ),
385
-
386
363
  [sty.slotTargetChildrencolor_softBlue]: hasVariant(
387
364
  $state,
388
365
  "color",
389
366
  "softBlue"
390
367
  ),
391
-
392
368
  [sty.slotTargetChildrencolor_softGreen]: hasVariant(
393
369
  $state,
394
370
  "color",
395
371
  "softGreen"
396
372
  ),
397
-
398
373
  [sty.slotTargetChildrencolor_softRed]: hasVariant(
399
374
  $state,
400
375
  "color",
401
376
  "softRed"
402
377
  ),
403
-
404
378
  [sty.slotTargetChildrencolor_softSand]: hasVariant(
405
379
  $state,
406
380
  "color",
407
381
  "softSand"
408
382
  ),
409
-
410
383
  [sty.slotTargetChildrencolor_softYellow]: hasVariant(
411
384
  $state,
412
385
  "color",
413
386
  "softYellow"
414
387
  ),
415
-
416
388
  [sty.slotTargetChildrencolor_white]: hasVariant(
417
389
  $state,
418
390
  "color",
419
391
  "white"
420
392
  ),
421
-
422
393
  [sty.slotTargetChildrencolor_yellow]: hasVariant(
423
394
  $state,
424
395
  "color",
425
396
  "yellow"
426
397
  ),
427
-
428
398
  [sty.slotTargetChildrenisDisabled]: hasVariant(
429
399
  $state,
430
400
  "isDisabled",
431
401
  "isDisabled"
432
402
  ),
433
-
434
403
  [sty.slotTargetChildrenshape_rounded]: hasVariant(
435
404
  $state,
436
405
  "shape",
437
406
  "rounded"
438
407
  ),
439
-
440
408
  [sty.slotTargetChildrenshowEndIcon]: hasVariant(
441
409
  $state,
442
410
  "showEndIcon",
443
411
  "showEndIcon"
444
412
  ),
445
-
446
413
  [sty.slotTargetChildrenshowStartIcon]: hasVariant(
447
414
  $state,
448
415
  "showStartIcon",
449
416
  "showStartIcon"
450
417
  ),
451
-
452
418
  [sty.slotTargetChildrensize_minimal]: hasVariant(
453
419
  $state,
454
420
  "size",
@@ -457,7 +423,6 @@ function PlasmicButton__RenderFunc(props) {
457
423
  })
458
424
  })}
459
425
  </div>
460
-
461
426
  {(hasVariant($state, "showEndIcon", "showEndIcon") ? true : false) ? (
462
427
  <div
463
428
  data-plasmic-name={"endIconContainer"}
@@ -468,13 +433,11 @@ function PlasmicButton__RenderFunc(props) {
468
433
  "color",
469
434
  "white"
470
435
  ),
471
-
472
436
  [sty.endIconContainercolor_yellow]: hasVariant(
473
437
  $state,
474
438
  "color",
475
439
  "yellow"
476
440
  ),
477
-
478
441
  [sty.endIconContainershowEndIcon]: hasVariant(
479
442
  $state,
480
443
  "showEndIcon",
@@ -482,7 +445,7 @@ function PlasmicButton__RenderFunc(props) {
482
445
  )
483
446
  })}
484
447
  >
485
- {p.renderPlasmicSlot({
448
+ {renderPlasmicSlot({
486
449
  defaultContents: (
487
450
  <IconIcon
488
451
  className={classNames(projectcss.all, sty.svg__liJa)}
@@ -497,55 +460,46 @@ function PlasmicButton__RenderFunc(props) {
497
460
  "color",
498
461
  "clear"
499
462
  ),
500
-
501
463
  [sty.slotTargetEndIconcolor_link]: hasVariant(
502
464
  $state,
503
465
  "color",
504
466
  "link"
505
467
  ),
506
-
507
468
  [sty.slotTargetEndIconcolor_softBlue]: hasVariant(
508
469
  $state,
509
470
  "color",
510
471
  "softBlue"
511
472
  ),
512
-
513
473
  [sty.slotTargetEndIconcolor_softGreen]: hasVariant(
514
474
  $state,
515
475
  "color",
516
476
  "softGreen"
517
477
  ),
518
-
519
478
  [sty.slotTargetEndIconcolor_softRed]: hasVariant(
520
479
  $state,
521
480
  "color",
522
481
  "softRed"
523
482
  ),
524
-
525
483
  [sty.slotTargetEndIconcolor_softSand]: hasVariant(
526
484
  $state,
527
485
  "color",
528
486
  "softSand"
529
487
  ),
530
-
531
488
  [sty.slotTargetEndIconcolor_softYellow]: hasVariant(
532
489
  $state,
533
490
  "color",
534
491
  "softYellow"
535
492
  ),
536
-
537
493
  [sty.slotTargetEndIconcolor_white]: hasVariant(
538
494
  $state,
539
495
  "color",
540
496
  "white"
541
497
  ),
542
-
543
498
  [sty.slotTargetEndIconcolor_yellow]: hasVariant(
544
499
  $state,
545
500
  "color",
546
501
  "yellow"
547
502
  ),
548
-
549
503
  [sty.slotTargetEndIconshowEndIcon]: hasVariant(
550
504
  $state,
551
505
  "showEndIcon",
@@ -555,7 +509,7 @@ function PlasmicButton__RenderFunc(props) {
555
509
  })}
556
510
  </div>
557
511
  ) : null}
558
- </p.Stack>
512
+ </Stack__>
559
513
  );
560
514
  }
561
515
 
@@ -577,9 +531,8 @@ function useBehavior(props, ref) {
577
531
  },
578
532
  ref
579
533
  );
580
-
581
534
  if (b.plasmicProps.overrides.root.as === "a") {
582
- b.plasmicProps.overrides.root.as = p.PlasmicLink;
535
+ b.plasmicProps.overrides.root.as = PlasmicLink__;
583
536
  b.plasmicProps.overrides.root.props.component = Link;
584
537
  b.plasmicProps.overrides.root.props.platform = "nextjs";
585
538
  }
@@ -599,13 +552,12 @@ function makeNodeComponent(nodeName) {
599
552
  () =>
600
553
  deriveRenderOpts(props, {
601
554
  name: nodeName,
602
- descendantNames: [...PlasmicDescendants[nodeName]],
555
+ descendantNames: PlasmicDescendants[nodeName],
603
556
  internalArgPropNames: PlasmicButton__ArgProps,
604
557
  internalVariantPropNames: PlasmicButton__VariantProps
605
558
  }),
606
559
  [props, nodeName]
607
560
  );
608
-
609
561
  return PlasmicButton__RenderFunc({
610
562
  variants,
611
563
  args,
@@ -11,30 +11,25 @@
11
11
  import * as React from "react";
12
12
  import Head from "next/head";
13
13
  import { useRouter } from "next/router";
14
- import * as p from "@plasmicapp/react-web";
15
- import * as ph from "@plasmicapp/react-web/lib/host";
16
14
  import {
15
+ Stack as Stack__,
17
16
  classNames,
18
17
  createPlasmicElementProxy,
19
18
  deriveRenderOpts
20
19
  } from "@plasmicapp/react-web";
20
+ import { useDataEnv } from "@plasmicapp/react-web/lib/host";
21
21
  import RandomDynamicPageButton from "../../RandomDynamicPageButton"; // plasmic-import: Q23H1_1M_P/component
22
22
  import "@plasmicapp/react-web/lib/plasmic.css";
23
- import projectcss from "./plasmic_create_plasmic_app.module.css"; // plasmic-import: 47tFXWjN2C4NyHFGGpaYQ3/projectcss
23
+ import projectcss from "./plasmic.module.css"; // plasmic-import: 47tFXWjN2C4NyHFGGpaYQ3/projectcss
24
24
  import sty from "./PlasmicDynamicPage.module.css"; // plasmic-import: AO44A-w7hh/css
25
25
 
26
+ createPlasmicElementProxy;
27
+
26
28
  export const PlasmicDynamicPage__VariantProps = new Array();
27
29
 
28
30
  export const PlasmicDynamicPage__ArgProps = new Array();
29
31
 
30
- const __wrapUserFunction =
31
- globalThis.__PlasmicWrapUserFunction ?? ((loc, fn) => fn());
32
-
33
- const __wrapUserPromise =
34
- globalThis.__PlasmicWrapUserPromise ??
35
- (async (loc, promise) => {
36
- return await promise;
37
- });
32
+ const $$ = {};
38
33
 
39
34
  function useNextRouter() {
40
35
  try {
@@ -45,17 +40,24 @@ function useNextRouter() {
45
40
 
46
41
  function PlasmicDynamicPage__RenderFunc(props) {
47
42
  const { variants, overrides, forNode } = props;
48
- const __nextRouter = useNextRouter();
49
- const $ctx = ph.useDataEnv?.() || {};
50
- const args = React.useMemo(() => Object.assign({}, props.args), [props.args]);
43
+ const args = React.useMemo(
44
+ () =>
45
+ Object.assign(
46
+ {},
47
+ Object.fromEntries(
48
+ Object.entries(props.args).filter(([_, v]) => v !== undefined)
49
+ )
50
+ ),
51
+ [props.args]
52
+ );
51
53
  const $props = {
52
54
  ...args,
53
55
  ...variants
54
56
  };
57
+ const __nextRouter = useNextRouter();
58
+ const $ctx = useDataEnv?.() || {};
55
59
  const refsRef = React.useRef({});
56
60
  const $refs = refsRef.current;
57
- const currentUser = p.useCurrentUser?.() || {};
58
- const [$queries, setDollarQueries] = React.useState({});
59
61
  return (
60
62
  <React.Fragment>
61
63
  <Head></Head>
@@ -77,10 +79,11 @@ function PlasmicDynamicPage__RenderFunc(props) {
77
79
  projectcss.root_reset,
78
80
  projectcss.plasmic_default_styles,
79
81
  projectcss.plasmic_mixins,
82
+ projectcss.plasmic_tokens,
80
83
  sty.root
81
84
  )}
82
85
  >
83
- <p.Stack
86
+ <Stack__
84
87
  as={"section"}
85
88
  data-plasmic-name={"section"}
86
89
  data-plasmic-override={overrides.section}
@@ -97,18 +100,22 @@ function PlasmicDynamicPage__RenderFunc(props) {
97
100
  sty.h1
98
101
  )}
99
102
  >
100
- {(() => {
101
- try {
102
- return $ctx.params.slug;
103
- } catch (e) {
104
- if (e instanceof TypeError) {
105
- return "Page 1";
103
+ <React.Fragment>
104
+ {(() => {
105
+ try {
106
+ return $ctx.params.slug;
107
+ } catch (e) {
108
+ if (
109
+ e instanceof TypeError ||
110
+ e?.plasmicType === "PlasmicUndefinedDataError"
111
+ ) {
112
+ return "Page 1";
113
+ }
114
+ throw e;
106
115
  }
107
- throw e;
108
- }
109
- })()}
116
+ })()}
117
+ </React.Fragment>
110
118
  </h1>
111
-
112
119
  <RandomDynamicPageButton
113
120
  data-plasmic-name={"randomDynamicPageButton"}
114
121
  data-plasmic-override={overrides.randomDynamicPageButton}
@@ -117,7 +124,7 @@ function PlasmicDynamicPage__RenderFunc(props) {
117
124
  sty.randomDynamicPageButton
118
125
  )}
119
126
  />
120
- </p.Stack>
127
+ </Stack__>
121
128
  </div>
122
129
  </div>
123
130
  </React.Fragment>
@@ -137,13 +144,12 @@ function makeNodeComponent(nodeName) {
137
144
  () =>
138
145
  deriveRenderOpts(props, {
139
146
  name: nodeName,
140
- descendantNames: [...PlasmicDescendants[nodeName]],
147
+ descendantNames: PlasmicDescendants[nodeName],
141
148
  internalArgPropNames: PlasmicDynamicPage__ArgProps,
142
149
  internalVariantPropNames: PlasmicDynamicPage__VariantProps
143
150
  }),
144
151
  [props, nodeName]
145
152
  );
146
-
147
153
  return PlasmicDynamicPage__RenderFunc({
148
154
  variants,
149
155
  args,
@@ -3,25 +3,13 @@
3
3
  /* tslint:disable */
4
4
  /* prettier-ignore-start */
5
5
  import * as React from "react";
6
- import * as p from "@plasmicapp/react-web";
6
+ import { createUseScreenVariants } from "@plasmicapp/react-web";
7
7
 
8
8
  export const ScreenContext = React.createContext(
9
9
  "PLEASE_RENDER_INSIDE_PROVIDER"
10
10
  );
11
- /**
12
- * @deprecated Plasmic now uses a custom hook for Screen variants, which is
13
- * automatically included in your components. Please remove this provider
14
- * from your code.
15
- */
16
11
 
17
- export function ScreenVariantProvider(props) {
18
- console.warn(
19
- "DEPRECATED: Plasmic now uses a custom hook for Screen variants, which is automatically included in your components. Please remove this provider from your code."
20
- );
21
- return props.children;
22
- }
23
-
24
- export const useScreenVariants = p.createUseScreenVariants(true, {
12
+ export const useScreenVariants = createUseScreenVariants(true, {
25
13
  desktopOnly: "(min-width:768px)",
26
14
  });
27
15