create-plasmic-app 0.0.133 → 0.0.135

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 (76) hide show
  1. package/cpa-out/nextjs-app-codegen-js/app/dynamic/[slug]/page-client.jsx +7 -0
  2. package/cpa-out/nextjs-app-codegen-js/app/dynamic/[slug]/page.jsx +45 -0
  3. package/cpa-out/nextjs-app-codegen-js/app/layout.js +28 -0
  4. package/cpa-out/nextjs-app-codegen-js/app/layout.jsx +17 -0
  5. package/cpa-out/nextjs-app-codegen-js/app/page-client.jsx +7 -0
  6. package/cpa-out/nextjs-app-codegen-js/app/page.jsx +45 -0
  7. package/cpa-out/nextjs-app-codegen-js/app/plasmic-host/page.jsx +15 -0
  8. package/cpa-out/nextjs-app-codegen-js/components/Button.jsx +11 -0
  9. package/cpa-out/nextjs-app-codegen-js/components/RandomDynamicPageButton.jsx +24 -0
  10. package/cpa-out/nextjs-app-codegen-js/components/plasmic/create_plasmic_app/PlasmicButton.jsx +595 -0
  11. package/cpa-out/nextjs-app-codegen-js/components/plasmic/create_plasmic_app/PlasmicDynamicPage.jsx +216 -0
  12. package/cpa-out/nextjs-app-codegen-js/components/plasmic/create_plasmic_app/PlasmicDynamicPageServer.jsx +56 -0
  13. package/cpa-out/nextjs-app-codegen-js/components/plasmic/create_plasmic_app/PlasmicGlobalVariant__Screen.jsx +26 -0
  14. package/cpa-out/nextjs-app-codegen-js/components/plasmic/create_plasmic_app/PlasmicHomepage.jsx +251 -0
  15. package/cpa-out/nextjs-app-codegen-js/components/plasmic/create_plasmic_app/PlasmicHomepageServer.jsx +56 -0
  16. package/cpa-out/nextjs-app-codegen-js/components/plasmic/create_plasmic_app/PlasmicRandomDynamicPageButton.jsx +159 -0
  17. package/cpa-out/nextjs-app-codegen-js/components/plasmic/create_plasmic_app/PlasmicStyleTokensProvider.jsx +15 -0
  18. package/cpa-out/nextjs-app-codegen-js/components/plasmic/create_plasmic_app/icons/PlasmicIcon__CheckSvg.jsx +39 -0
  19. package/cpa-out/nextjs-app-codegen-js/components/plasmic/create_plasmic_app/icons/PlasmicIcon__Icon.jsx +37 -0
  20. package/cpa-out/nextjs-app-codegen-js/components/plasmic/create_plasmic_app/plasmic.jsx +11 -0
  21. package/cpa-out/nextjs-app-codegen-js/package.json +22 -0
  22. package/cpa-out/nextjs-app-codegen-js/plasmic.json +148 -0
  23. package/cpa-out/nextjs-app-codegen-ts/app/dynamic/[slug]/page-client.tsx +11 -0
  24. package/cpa-out/nextjs-app-codegen-ts/app/dynamic/[slug]/page.tsx +57 -0
  25. package/cpa-out/nextjs-app-codegen-ts/app/layout.tsx +19 -0
  26. package/cpa-out/nextjs-app-codegen-ts/app/page-client.tsx +11 -0
  27. package/cpa-out/nextjs-app-codegen-ts/app/page.tsx +54 -0
  28. package/cpa-out/nextjs-app-codegen-ts/app/plasmic-host/page.tsx +15 -0
  29. package/cpa-out/nextjs-app-codegen-ts/components/Button.tsx +35 -0
  30. package/cpa-out/nextjs-app-codegen-ts/components/RandomDynamicPageButton.tsx +44 -0
  31. package/cpa-out/nextjs-app-codegen-ts/components/plasmic/create_plasmic_app/PlasmicButton.tsx +776 -0
  32. package/cpa-out/nextjs-app-codegen-ts/components/plasmic/create_plasmic_app/PlasmicDynamicPage.tsx +329 -0
  33. package/cpa-out/nextjs-app-codegen-ts/components/plasmic/create_plasmic_app/PlasmicDynamicPageServer.tsx +77 -0
  34. package/cpa-out/nextjs-app-codegen-ts/components/plasmic/create_plasmic_app/PlasmicGlobalVariant__Screen.tsx +30 -0
  35. package/cpa-out/nextjs-app-codegen-ts/components/plasmic/create_plasmic_app/PlasmicHomepage.tsx +366 -0
  36. package/cpa-out/nextjs-app-codegen-ts/components/plasmic/create_plasmic_app/PlasmicHomepageServer.tsx +75 -0
  37. package/cpa-out/nextjs-app-codegen-ts/components/plasmic/create_plasmic_app/PlasmicRandomDynamicPageButton.tsx +274 -0
  38. package/cpa-out/nextjs-app-codegen-ts/components/plasmic/create_plasmic_app/PlasmicStyleTokensProvider.tsx +19 -0
  39. package/cpa-out/nextjs-app-codegen-ts/components/plasmic/create_plasmic_app/icons/PlasmicIcon__CheckSvg.tsx +44 -0
  40. package/cpa-out/nextjs-app-codegen-ts/components/plasmic/create_plasmic_app/icons/PlasmicIcon__Icon.tsx +41 -0
  41. package/cpa-out/nextjs-app-codegen-ts/components/plasmic/create_plasmic_app/plasmic.tsx +14 -0
  42. package/cpa-out/nextjs-app-codegen-ts/package.json +26 -0
  43. package/cpa-out/nextjs-app-codegen-ts/plasmic.json +148 -0
  44. package/cpa-out/nextjs-app-codegen-ts/tsconfig.json +26 -0
  45. package/cpa-out/nextjs-app-loader-js/app/[[...catchall]]/page.jsx +80 -0
  46. package/cpa-out/nextjs-app-loader-js/app/layout.js +28 -0
  47. package/cpa-out/nextjs-app-loader-js/app/plasmic-host/page.jsx +6 -0
  48. package/cpa-out/nextjs-app-loader-js/plasmic-init-client.jsx +65 -0
  49. package/cpa-out/nextjs-app-loader-js/plasmic-init.js +5 -10
  50. package/cpa-out/nextjs-app-loader-ts/app/[[...catchall]]/page.tsx +85 -0
  51. package/cpa-out/nextjs-app-loader-ts/app/layout.tsx +33 -0
  52. package/cpa-out/nextjs-app-loader-ts/app/plasmic-host/page.tsx +6 -0
  53. package/cpa-out/nextjs-app-loader-ts/plasmic-init-client.tsx +65 -0
  54. package/cpa-out/nextjs-app-loader-ts/plasmic-init.ts +5 -10
  55. package/cpa-out/nextjs-app-loader-ts/tsconfig.json +6 -1
  56. package/dist/index.js +31 -30
  57. package/dist/nextjs/nextjs.js +37 -11
  58. package/dist/nextjs/templates/app-codegen/layout.d.ts +2 -0
  59. package/dist/nextjs/templates/app-codegen/layout.js +27 -0
  60. package/dist/nextjs/templates/app-loader/catchall-page.js +63 -38
  61. package/dist/nextjs/templates/app-loader/plasmic-init-client.js +1 -1
  62. package/dist/nextjs/templates/app-loader/plasmic-init.js +4 -0
  63. package/package.json +2 -2
  64. package/run-cpa.ts +8 -9
  65. package/src/index.ts +31 -36
  66. package/src/nextjs/nextjs.ts +67 -28
  67. package/src/nextjs/templates/app-codegen/layout.ts +28 -0
  68. package/src/nextjs/templates/app-loader/catchall-page.ts +80 -43
  69. package/src/nextjs/templates/app-loader/plasmic-init-client.ts +1 -1
  70. package/src/nextjs/templates/app-loader/plasmic-init.ts +4 -0
  71. package/cpa-out/nextjs-app-loader-js/pages/[[...catchall]].jsx +0 -68
  72. package/cpa-out/nextjs-app-loader-js/pages/api/hello.js +0 -5
  73. package/cpa-out/nextjs-app-loader-js/pages/plasmic-host.jsx +0 -7
  74. package/cpa-out/nextjs-app-loader-ts/pages/[[...catchall]].tsx +0 -72
  75. package/cpa-out/nextjs-app-loader-ts/pages/api/hello.ts +0 -13
  76. package/cpa-out/nextjs-app-loader-ts/pages/plasmic-host.tsx +0 -7
@@ -0,0 +1,7 @@
1
+ "use client";
2
+ import * as React from "react";
3
+ import { PlasmicDynamicPage } from "../../../components/plasmic/create_plasmic_app/PlasmicDynamicPage"; // plasmic-import: AO44A-w7hh/render
4
+
5
+ export function ClientDynamicPage(props) {
6
+ return <PlasmicDynamicPage {...props} />;
7
+ }
@@ -0,0 +1,45 @@
1
+ // This is a skeleton starter React page generated by Plasmic.
2
+ // This file is owned by you, feel free to edit as you see fit.
3
+ import * as React from "react";
4
+ import { PageParamsProvider as PageParamsProvider__ } from "@plasmicapp/host";
5
+ import {
6
+ PlasmicDynamicPageServer,
7
+ makeAppRouterPageCtx,
8
+ generateDynamicMetadata
9
+ } from "../../../components/plasmic/create_plasmic_app/PlasmicDynamicPageServer";
10
+
11
+ export async function generateMetadata({ params, searchParams }, parent) {
12
+ const ctx = await makeAppRouterPageCtx({ params, searchParams });
13
+ const metadata = generateDynamicMetadata({}, ctx);
14
+ return { ...(await parent), ...metadata };
15
+ }
16
+
17
+ async function DynamicPage({ params, searchParams }) {
18
+ // Use PlasmicDynamicPage to render this component as it was
19
+ // designed in Plasmic, by activating the appropriate variants,
20
+ // attaching the appropriate event handlers, etc. You
21
+ // can also install whatever React hooks you need here to manage state or
22
+ // fetch data.
23
+ //
24
+ // Props you can pass into PlasmicDynamicPage are:
25
+ // 1. Variants you want to activate,
26
+ // 2. Contents for slots you want to fill,
27
+ // 3. Overrides for any named node in the component to attach behavior and data,
28
+ // 4. Props to set on the root node.
29
+ //
30
+ // By default, PlasmicDynamicPage is wrapped by your project's global
31
+ // variant context providers. These wrappers may be moved to
32
+ // Next.js Custom App component
33
+ // (https://nextjs.org/docs/advanced-features/custom-app).
34
+ return (
35
+ <PageParamsProvider__
36
+ route="/dynamic/[slug]"
37
+ params={await params}
38
+ query={await searchParams}
39
+ >
40
+ <PlasmicDynamicPageServer />
41
+ </PageParamsProvider__>
42
+ );
43
+ }
44
+
45
+ export default DynamicPage;
@@ -0,0 +1,28 @@
1
+ import localFont from "next/font/local";
2
+ import "./globals.css";
3
+
4
+ const geistSans = localFont({
5
+ src: "./fonts/GeistVF.woff",
6
+ variable: "--font-geist-sans",
7
+ weight: "100 900",
8
+ });
9
+ const geistMono = localFont({
10
+ src: "./fonts/GeistMonoVF.woff",
11
+ variable: "--font-geist-mono",
12
+ weight: "100 900",
13
+ });
14
+
15
+ export const metadata = {
16
+ title: "Create Next App",
17
+ description: "Generated by create next app",
18
+ };
19
+
20
+ export default function RootLayout({ children }) {
21
+ return (
22
+ <html lang="en">
23
+ <body className={`${geistSans.variable} ${geistMono.variable}`}>
24
+ {children}
25
+ </body>
26
+ </html>
27
+ );
28
+ }
@@ -0,0 +1,17 @@
1
+ import '@/app/globals.css'
2
+ import { PlasmicRootProvider } from "@plasmicapp/react-web";
3
+ import Link from "next/link";
4
+
5
+ export default function RootLayout({
6
+ children,
7
+ }) {
8
+ return (
9
+ <html lang="en">
10
+ <body>
11
+ <PlasmicRootProvider Link={Link}>
12
+ {children}
13
+ </PlasmicRootProvider>
14
+ </body>
15
+ </html>
16
+ );
17
+ }
@@ -0,0 +1,7 @@
1
+ "use client";
2
+ import * as React from "react";
3
+ import { PlasmicHomepage } from "../components/plasmic/create_plasmic_app/PlasmicHomepage"; // plasmic-import: 6uuAAE1jiCew/render
4
+
5
+ export function ClientHomepage(props) {
6
+ return <PlasmicHomepage {...props} />;
7
+ }
@@ -0,0 +1,45 @@
1
+ // This is a skeleton starter React page generated by Plasmic.
2
+ // This file is owned by you, feel free to edit as you see fit.
3
+ import * as React from "react";
4
+ import { PageParamsProvider as PageParamsProvider__ } from "@plasmicapp/host";
5
+ import {
6
+ PlasmicHomepageServer,
7
+ makeAppRouterPageCtx,
8
+ generateDynamicMetadata
9
+ } from "../components/plasmic/create_plasmic_app/PlasmicHomepageServer";
10
+
11
+ export async function generateMetadata({ params, searchParams }, parent) {
12
+ const ctx = await makeAppRouterPageCtx({ params, searchParams });
13
+ const metadata = generateDynamicMetadata({}, ctx);
14
+ return { ...(await parent), ...metadata };
15
+ }
16
+
17
+ async function Homepage({ params, searchParams }) {
18
+ // Use PlasmicHomepage to render this component as it was
19
+ // designed in Plasmic, by activating the appropriate variants,
20
+ // attaching the appropriate event handlers, etc. You
21
+ // can also install whatever React hooks you need here to manage state or
22
+ // fetch data.
23
+ //
24
+ // Props you can pass into PlasmicHomepage are:
25
+ // 1. Variants you want to activate,
26
+ // 2. Contents for slots you want to fill,
27
+ // 3. Overrides for any named node in the component to attach behavior and data,
28
+ // 4. Props to set on the root node.
29
+ //
30
+ // By default, PlasmicHomepage is wrapped by your project's global
31
+ // variant context providers. These wrappers may be moved to
32
+ // Next.js Custom App component
33
+ // (https://nextjs.org/docs/advanced-features/custom-app).
34
+ return (
35
+ <PageParamsProvider__
36
+ route="/"
37
+ params={await params}
38
+ query={await searchParams}
39
+ >
40
+ <PlasmicHomepageServer />
41
+ </PageParamsProvider__>
42
+ );
43
+ }
44
+
45
+ export default Homepage;
@@ -0,0 +1,15 @@
1
+ import * as React from 'react';
2
+ import { PlasmicCanvasHost, registerComponent } from '@plasmicapp/react-web/lib/host';
3
+
4
+ // You can register any code components that you want to use here; see
5
+ // https://docs.plasmic.app/learn/code-components-ref/
6
+ // And configure your Plasmic project to use the host url pointing at
7
+ // the /plasmic-host page of your nextjs app (for example,
8
+ // http://localhost:3000/plasmic-host). See
9
+ // https://docs.plasmic.app/learn/app-hosting/#set-a-plasmic-project-to-use-your-app-host
10
+
11
+ // registerComponent(...)
12
+
13
+ export default function PlasmicHost() {
14
+ return <PlasmicCanvasHost />;
15
+ }
@@ -0,0 +1,11 @@
1
+ import * as React from "react";
2
+ import { PlasmicButton } from "./plasmic/create_plasmic_app/PlasmicButton";
3
+
4
+ function Button_(props, ref) {
5
+ const { plasmicProps } = PlasmicButton.useBehavior(props, ref);
6
+ return <PlasmicButton {...plasmicProps} />;
7
+ }
8
+
9
+ const Button = React.forwardRef(Button_);
10
+
11
+ export default Object.assign(Button, { __plumeType: "button" });
@@ -0,0 +1,24 @@
1
+ // This is a skeleton starter React component generated by Plasmic.
2
+ // This file is owned by you, feel free to edit as you see fit.
3
+ import * as React from "react";
4
+ import { PlasmicRandomDynamicPageButton } from "./plasmic/create_plasmic_app/PlasmicRandomDynamicPageButton";
5
+
6
+ function RandomDynamicPageButton(props) {
7
+ // Use PlasmicRandomDynamicPageButton to render this component as it was
8
+ // designed in Plasmic, by activating the appropriate variants,
9
+ // attaching the appropriate event handlers, etc. You
10
+ // can also install whatever React hooks you need here to manage state or
11
+ // fetch data.
12
+ //
13
+ // Props you can pass into PlasmicRandomDynamicPageButton are:
14
+ // 1. Variants you want to activate,
15
+ // 2. Contents for slots you want to fill,
16
+ // 3. Overrides for any named node in the component to attach behavior and data,
17
+ // 4. Props to set on the root node.
18
+ //
19
+ // By default, we are just piping all RandomDynamicPageButtonProps here, but feel free
20
+ // to do whatever works for you.
21
+ return <PlasmicRandomDynamicPageButton {...props} />;
22
+ }
23
+
24
+ export default RandomDynamicPageButton;