create-plasmic-app 0.0.136 → 0.0.138

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 (54) hide show
  1. package/cpa-out/gatsby-codegen-js/package.json +1 -1
  2. package/cpa-out/gatsby-codegen-js/src/components/plasmic/create_plasmic_app/PlasmicDynamicPage.jsx +3 -2
  3. package/cpa-out/gatsby-codegen-js/src/components/plasmic/create_plasmic_app/PlasmicHomepage.jsx +3 -2
  4. package/cpa-out/gatsby-codegen-ts/package.json +1 -1
  5. package/cpa-out/gatsby-codegen-ts/src/components/plasmic/create_plasmic_app/PlasmicDynamicPage.tsx +12 -4
  6. package/cpa-out/gatsby-codegen-ts/src/components/plasmic/create_plasmic_app/PlasmicHomepage.tsx +12 -4
  7. package/cpa-out/gatsby-loader-js/package.json +1 -1
  8. package/cpa-out/gatsby-loader-ts/package.json +1 -1
  9. package/cpa-out/nextjs-app-codegen-js/components/plasmic/create_plasmic_app/PlasmicDynamicPage.jsx +4 -11
  10. package/cpa-out/nextjs-app-codegen-js/components/plasmic/create_plasmic_app/PlasmicDynamicPageServer.jsx +1 -1
  11. package/cpa-out/nextjs-app-codegen-js/components/plasmic/create_plasmic_app/PlasmicHomepage.jsx +4 -11
  12. package/cpa-out/nextjs-app-codegen-js/components/plasmic/create_plasmic_app/PlasmicHomepageServer.jsx +1 -1
  13. package/cpa-out/nextjs-app-codegen-js/package.json +1 -1
  14. package/cpa-out/nextjs-app-codegen-ts/components/plasmic/create_plasmic_app/PlasmicDynamicPage.tsx +6 -12
  15. package/cpa-out/nextjs-app-codegen-ts/components/plasmic/create_plasmic_app/PlasmicDynamicPageServer.tsx +10 -5
  16. package/cpa-out/nextjs-app-codegen-ts/components/plasmic/create_plasmic_app/PlasmicHomepage.tsx +6 -12
  17. package/cpa-out/nextjs-app-codegen-ts/components/plasmic/create_plasmic_app/PlasmicHomepageServer.tsx +10 -3
  18. package/cpa-out/nextjs-app-codegen-ts/package.json +1 -1
  19. package/cpa-out/nextjs-app-loader-js/package.json +1 -1
  20. package/cpa-out/nextjs-app-loader-js/plasmic-init.js +5 -4
  21. package/cpa-out/nextjs-app-loader-ts/package.json +1 -1
  22. package/cpa-out/nextjs-app-loader-ts/plasmic-init.ts +5 -4
  23. package/cpa-out/nextjs-pages-codegen-js/components/plasmic/create_plasmic_app/PlasmicDynamicPage.jsx +3 -2
  24. package/cpa-out/nextjs-pages-codegen-js/components/plasmic/create_plasmic_app/PlasmicHomepage.jsx +3 -2
  25. package/cpa-out/nextjs-pages-codegen-js/package.json +1 -1
  26. package/cpa-out/nextjs-pages-codegen-ts/components/plasmic/create_plasmic_app/PlasmicDynamicPage.tsx +13 -5
  27. package/cpa-out/nextjs-pages-codegen-ts/components/plasmic/create_plasmic_app/PlasmicHomepage.tsx +13 -5
  28. package/cpa-out/nextjs-pages-codegen-ts/package.json +1 -1
  29. package/cpa-out/nextjs-pages-loader-js/package.json +1 -1
  30. package/cpa-out/nextjs-pages-loader-js/plasmic-init.js +6 -1
  31. package/cpa-out/nextjs-pages-loader-ts/package.json +1 -1
  32. package/cpa-out/nextjs-pages-loader-ts/plasmic-init.ts +6 -1
  33. package/cpa-out/react-codegen-js/eslint.config.js +19 -10
  34. package/cpa-out/react-codegen-js/package.json +13 -12
  35. package/cpa-out/react-codegen-js/src/components/plasmic/create_plasmic_app/PlasmicDynamicPage.jsx +3 -2
  36. package/cpa-out/react-codegen-js/src/components/plasmic/create_plasmic_app/PlasmicHomepage.jsx +3 -2
  37. package/cpa-out/react-codegen-ts/eslint.config.js +15 -10
  38. package/cpa-out/react-codegen-ts/package.json +14 -15
  39. package/cpa-out/react-codegen-ts/src/components/plasmic/create_plasmic_app/PlasmicDynamicPage.tsx +12 -4
  40. package/cpa-out/react-codegen-ts/src/components/plasmic/create_plasmic_app/PlasmicHomepage.tsx +12 -4
  41. package/cpa-out/react-codegen-ts/src/vite-env.d.ts +1 -0
  42. package/cpa-out/tanstack-codegen-ts/package.json +18 -11
  43. package/cpa-out/tanstack-codegen-ts/src/components/Footer.tsx +44 -0
  44. package/cpa-out/tanstack-codegen-ts/src/components/Header.tsx +78 -0
  45. package/cpa-out/tanstack-codegen-ts/src/components/ThemeToggle.tsx +81 -0
  46. package/cpa-out/tanstack-codegen-ts/src/components/plasmic/create_plasmic_app/PlasmicDynamicPage.tsx +12 -4
  47. package/cpa-out/tanstack-codegen-ts/src/components/plasmic/create_plasmic_app/PlasmicHomepage.tsx +12 -4
  48. package/cpa-out/tanstack-codegen-ts/src/main.tsx +0 -1
  49. package/cpa-out/tanstack-codegen-ts/tsconfig.json +1 -0
  50. package/dist/nextjs/templates/app-loader/plasmic-init.js +5 -4
  51. package/dist/nextjs/templates/pages-loader/plasmic-init.js +6 -1
  52. package/package.json +2 -2
  53. package/src/nextjs/templates/app-loader/plasmic-init.ts +5 -4
  54. package/src/nextjs/templates/pages-loader/plasmic-init.ts +6 -1
@@ -1,18 +1,13 @@
1
1
  import js from '@eslint/js'
2
2
  import globals from 'globals'
3
+ import react from 'eslint-plugin-react'
3
4
  import reactHooks from 'eslint-plugin-react-hooks'
4
5
  import reactRefresh from 'eslint-plugin-react-refresh'
5
- import { defineConfig, globalIgnores } from 'eslint/config'
6
6
 
7
- export default defineConfig([
8
- globalIgnores(['dist']),
7
+ export default [
8
+ { ignores: ['dist'] },
9
9
  {
10
10
  files: ['**/*.{js,jsx}'],
11
- extends: [
12
- js.configs.recommended,
13
- reactHooks.configs.flat.recommended,
14
- reactRefresh.configs.vite,
15
- ],
16
11
  languageOptions: {
17
12
  ecmaVersion: 2020,
18
13
  globals: globals.browser,
@@ -22,8 +17,22 @@ export default defineConfig([
22
17
  sourceType: 'module',
23
18
  },
24
19
  },
20
+ settings: { react: { version: '18.3' } },
21
+ plugins: {
22
+ react,
23
+ 'react-hooks': reactHooks,
24
+ 'react-refresh': reactRefresh,
25
+ },
25
26
  rules: {
26
- 'no-unused-vars': ['error', { varsIgnorePattern: '^[A-Z_]' }],
27
+ ...js.configs.recommended.rules,
28
+ ...react.configs.recommended.rules,
29
+ ...react.configs['jsx-runtime'].rules,
30
+ ...reactHooks.configs.recommended.rules,
31
+ 'react/jsx-no-target-blank': 'off',
32
+ 'react-refresh/only-export-components': [
33
+ 'warn',
34
+ { allowConstantExport: true },
35
+ ],
27
36
  },
28
37
  },
29
- ])
38
+ ]
@@ -11,19 +11,20 @@
11
11
  },
12
12
  "dependencies": {
13
13
  "@plasmicapp/cli": "^0.1.359",
14
- "@plasmicapp/react-web": "^0.2.422",
15
- "react": "^19.2.0",
16
- "react-dom": "^19.2.0"
14
+ "@plasmicapp/react-web": "^0.2.425",
15
+ "react": "^18.3.1",
16
+ "react-dom": "^18.3.1"
17
17
  },
18
18
  "devDependencies": {
19
- "@eslint/js": "^9.39.1",
20
- "@types/react": "^19.2.7",
21
- "@types/react-dom": "^19.2.3",
22
- "@vitejs/plugin-react": "^5.1.1",
23
- "eslint": "^9.39.1",
24
- "eslint-plugin-react-hooks": "^7.0.1",
25
- "eslint-plugin-react-refresh": "^0.4.24",
26
- "globals": "^16.5.0",
27
- "vite": "^7.3.1"
19
+ "@eslint/js": "^9.13.0",
20
+ "@types/react": "^18.3.12",
21
+ "@types/react-dom": "^18.3.1",
22
+ "@vitejs/plugin-react": "^4.3.3",
23
+ "eslint": "^9.13.0",
24
+ "eslint-plugin-react": "^7.37.2",
25
+ "eslint-plugin-react-hooks": "^5.0.0",
26
+ "eslint-plugin-react-refresh": "^0.4.14",
27
+ "globals": "^15.11.0",
28
+ "vite": "^5.4.10"
28
29
  }
29
30
  }
@@ -182,9 +182,10 @@ export const PlasmicDynamicPage = Object.assign(
182
182
  internalVariantProps: PlasmicDynamicPage__VariantProps,
183
183
  internalArgProps: PlasmicDynamicPage__ArgProps,
184
184
  pageMetadata: generateDynamicMetadata(wrapQueriesWithLoadingProxy({}), {
185
+ pageRoute: "/dynamic/[slug]",
185
186
  pagePath: "/dynamic/[slug]",
186
- searchParams: {},
187
- params: {}
187
+ params: {},
188
+ query: {}
188
189
  })
189
190
  }
190
191
  );
@@ -217,9 +217,10 @@ export const PlasmicHomepage = Object.assign(
217
217
  internalVariantProps: PlasmicHomepage__VariantProps,
218
218
  internalArgProps: PlasmicHomepage__ArgProps,
219
219
  pageMetadata: generateDynamicMetadata(wrapQueriesWithLoadingProxy({}), {
220
+ pageRoute: "/",
220
221
  pagePath: "/",
221
- searchParams: {},
222
- params: {}
222
+ params: {},
223
+ query: {}
223
224
  })
224
225
  }
225
226
  );
@@ -3,21 +3,26 @@ import globals from 'globals'
3
3
  import reactHooks from 'eslint-plugin-react-hooks'
4
4
  import reactRefresh from 'eslint-plugin-react-refresh'
5
5
  import tseslint from 'typescript-eslint'
6
- import { defineConfig, globalIgnores } from 'eslint/config'
7
6
 
8
- export default defineConfig([
9
- globalIgnores(['dist']),
7
+ export default tseslint.config(
8
+ { ignores: ['dist'] },
10
9
  {
10
+ extends: [js.configs.recommended, ...tseslint.configs.recommended],
11
11
  files: ['**/*.{ts,tsx}'],
12
- extends: [
13
- js.configs.recommended,
14
- tseslint.configs.recommended,
15
- reactHooks.configs.flat.recommended,
16
- reactRefresh.configs.vite,
17
- ],
18
12
  languageOptions: {
19
13
  ecmaVersion: 2020,
20
14
  globals: globals.browser,
21
15
  },
16
+ plugins: {
17
+ 'react-hooks': reactHooks,
18
+ 'react-refresh': reactRefresh,
19
+ },
20
+ rules: {
21
+ ...reactHooks.configs.recommended.rules,
22
+ 'react-refresh/only-export-components': [
23
+ 'warn',
24
+ { allowConstantExport: true },
25
+ ],
26
+ },
22
27
  },
23
- ])
28
+ )
@@ -11,22 +11,21 @@
11
11
  },
12
12
  "dependencies": {
13
13
  "@plasmicapp/cli": "^0.1.359",
14
- "@plasmicapp/react-web": "^0.2.422",
15
- "react": "^19.2.0",
16
- "react-dom": "^19.2.0"
14
+ "@plasmicapp/react-web": "^0.2.425",
15
+ "react": "^18.3.1",
16
+ "react-dom": "^18.3.1"
17
17
  },
18
18
  "devDependencies": {
19
- "@eslint/js": "^9.39.1",
20
- "@types/node": "^24.10.1",
21
- "@types/react": "^19.2.7",
22
- "@types/react-dom": "^19.2.3",
23
- "@vitejs/plugin-react": "^5.1.1",
24
- "eslint": "^9.39.1",
25
- "eslint-plugin-react-hooks": "^7.0.1",
26
- "eslint-plugin-react-refresh": "^0.4.24",
27
- "globals": "^16.5.0",
28
- "typescript": "~5.9.3",
29
- "typescript-eslint": "^8.48.0",
30
- "vite": "^7.3.1"
19
+ "@eslint/js": "^9.13.0",
20
+ "@types/react": "^18.3.12",
21
+ "@types/react-dom": "^18.3.1",
22
+ "@vitejs/plugin-react": "^4.3.3",
23
+ "eslint": "^9.13.0",
24
+ "eslint-plugin-react-hooks": "^5.0.0",
25
+ "eslint-plugin-react-refresh": "^0.4.14",
26
+ "globals": "^15.11.0",
27
+ "typescript": "~5.6.2",
28
+ "typescript-eslint": "^8.11.0",
29
+ "vite": "^5.4.10"
31
30
  }
32
31
  }
@@ -79,11 +79,18 @@ function wrapQueriesWithLoadingProxy($q: any): any {
79
79
  });
80
80
  }
81
81
 
82
- export function generateDynamicMetadata($q: any, $ctx: any) {
82
+ export type PageCtx = {
83
+ pageRoute: string;
84
+ pagePath: string;
85
+ params: Record<string, string | string[] | undefined>;
86
+ query: Record<string, string | string[] | undefined>;
87
+ };
88
+
89
+ export function generateDynamicMetadata($q: any, $ctx: PageCtx) {
83
90
  return {
84
91
  openGraph: {},
85
92
  twitter: {
86
- card: "summary"
93
+ card: "summary" as const
87
94
  }
88
95
  };
89
96
  }
@@ -292,9 +299,10 @@ export const PlasmicDynamicPage = Object.assign(
292
299
  internalArgProps: PlasmicDynamicPage__ArgProps,
293
300
 
294
301
  pageMetadata: generateDynamicMetadata(wrapQueriesWithLoadingProxy({}), {
302
+ pageRoute: "/dynamic/[slug]",
295
303
  pagePath: "/dynamic/[slug]",
296
- searchParams: {},
297
- params: {}
304
+ params: {},
305
+ query: {}
298
306
  })
299
307
  }
300
308
  );
@@ -80,11 +80,18 @@ function wrapQueriesWithLoadingProxy($q: any): any {
80
80
  });
81
81
  }
82
82
 
83
- export function generateDynamicMetadata($q: any, $ctx: any) {
83
+ export type PageCtx = {
84
+ pageRoute: string;
85
+ pagePath: string;
86
+ params: Record<string, string | string[] | undefined>;
87
+ query: Record<string, string | string[] | undefined>;
88
+ };
89
+
90
+ export function generateDynamicMetadata($q: any, $ctx: PageCtx) {
84
91
  return {
85
92
  openGraph: {},
86
93
  twitter: {
87
- card: "summary"
94
+ card: "summary" as const
88
95
  }
89
96
  };
90
97
  }
@@ -329,9 +336,10 @@ export const PlasmicHomepage = Object.assign(
329
336
  internalArgProps: PlasmicHomepage__ArgProps,
330
337
 
331
338
  pageMetadata: generateDynamicMetadata(wrapQueriesWithLoadingProxy({}), {
339
+ pageRoute: "/",
332
340
  pagePath: "/",
333
- searchParams: {},
334
- params: {}
341
+ params: {},
342
+ query: {}
335
343
  })
336
344
  }
337
345
  );
@@ -0,0 +1 @@
1
+ /// <reference types="vite/client" />
@@ -13,12 +13,12 @@
13
13
  },
14
14
  "dependencies": {
15
15
  "@plasmicapp/cli": "^0.1.359",
16
- "@plasmicapp/react-web": "^0.2.422",
16
+ "@plasmicapp/react-web": "^0.2.425",
17
17
  "@tailwindcss/vite": "^4.1.18",
18
- "@tanstack/react-devtools": "^0.7.0",
18
+ "@tanstack/react-devtools": "latest",
19
19
  "@tanstack/react-query": "^5.90.21",
20
- "@tanstack/react-router": "^1.132.0",
21
- "@tanstack/react-router-devtools": "^1.132.0",
20
+ "@tanstack/react-router": "latest",
21
+ "@tanstack/react-router-devtools": "latest",
22
22
  "@tanstack/router-plugin": "^1.132.0",
23
23
  "lucide-react": "^0.545.0",
24
24
  "react": "^19.2.0",
@@ -26,18 +26,25 @@
26
26
  "tailwindcss": "^4.1.18"
27
27
  },
28
28
  "devDependencies": {
29
- "@tanstack/devtools-vite": "^0.3.11",
30
- "@tanstack/router-plugin": "^1.132.0",
31
- "@testing-library/dom": "^10.4.0",
32
- "@testing-library/react": "^16.2.0",
29
+ "@tailwindcss/typography": "^0.5.16",
30
+ "@tanstack/devtools-vite": "latest",
31
+ "@tanstack/router-plugin": "latest",
32
+ "@testing-library/dom": "^10.4.1",
33
+ "@testing-library/react": "^16.3.0",
33
34
  "@types/node": "^22.10.2",
34
35
  "@types/react": "^19.2.0",
35
36
  "@types/react-dom": "^19.2.0",
36
- "@vitejs/plugin-react": "^5.0.4",
37
- "jsdom": "^27.0.0",
37
+ "@vitejs/plugin-react": "^5.1.4",
38
+ "jsdom": "^28.1.0",
38
39
  "typescript": "^5.7.2",
39
- "vite": "^7.1.7",
40
+ "vite": "^7.3.1",
40
41
  "vite-tsconfig-paths": "^5.1.4",
41
42
  "vitest": "^3.0.5"
43
+ },
44
+ "pnpm": {
45
+ "onlyBuiltDependencies": [
46
+ "esbuild",
47
+ "lightningcss"
48
+ ]
42
49
  }
43
50
  }
@@ -0,0 +1,44 @@
1
+ export default function Footer() {
2
+ const year = new Date().getFullYear()
3
+
4
+ return (
5
+ <footer className="mt-20 border-t border-[var(--line)] px-4 pb-14 pt-10 text-[var(--sea-ink-soft)]">
6
+ <div className="page-wrap flex flex-col items-center justify-between gap-4 text-center sm:flex-row sm:text-left">
7
+ <p className="m-0 text-sm">
8
+ &copy; {year} Your name here. All rights reserved.
9
+ </p>
10
+ <p className="island-kicker m-0">Built with TanStack Start</p>
11
+ </div>
12
+ <div className="mt-4 flex justify-center gap-4">
13
+ <a
14
+ href="https://x.com/tan_stack"
15
+ target="_blank"
16
+ rel="noreferrer"
17
+ className="rounded-xl p-2 text-[var(--sea-ink-soft)] transition hover:bg-[var(--link-bg-hover)] hover:text-[var(--sea-ink)]"
18
+ >
19
+ <span className="sr-only">Follow TanStack on X</span>
20
+ <svg viewBox="0 0 16 16" aria-hidden="true" width="32" height="32">
21
+ <path
22
+ fill="currentColor"
23
+ d="M12.6 1h2.2L10 6.48 15.64 15h-4.41L7.78 9.82 3.23 15H1l5.14-5.84L.72 1h4.52l3.12 4.73L12.6 1zm-.77 12.67h1.22L4.57 2.26H3.26l8.57 11.41z"
24
+ />
25
+ </svg>
26
+ </a>
27
+ <a
28
+ href="https://github.com/TanStack"
29
+ target="_blank"
30
+ rel="noreferrer"
31
+ className="rounded-xl p-2 text-[var(--sea-ink-soft)] transition hover:bg-[var(--link-bg-hover)] hover:text-[var(--sea-ink)]"
32
+ >
33
+ <span className="sr-only">Go to TanStack GitHub</span>
34
+ <svg viewBox="0 0 16 16" aria-hidden="true" width="32" height="32">
35
+ <path
36
+ fill="currentColor"
37
+ d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.012 8.012 0 0 0 16 8c0-4.42-3.58-8-8-8z"
38
+ />
39
+ </svg>
40
+ </a>
41
+ </div>
42
+ </footer>
43
+ )
44
+ }
@@ -0,0 +1,78 @@
1
+ import { Link } from '@tanstack/react-router'
2
+ import ThemeToggle from './ThemeToggle'
3
+
4
+ export default function Header() {
5
+ return (
6
+ <header className="sticky top-0 z-50 border-b border-[var(--line)] bg-[var(--header-bg)] px-4 backdrop-blur-lg">
7
+ <nav className="page-wrap flex flex-wrap items-center gap-x-3 gap-y-2 py-3 sm:py-4">
8
+ <h2 className="m-0 flex-shrink-0 text-base font-semibold tracking-tight">
9
+ <Link
10
+ to="/"
11
+ className="inline-flex items-center gap-2 rounded-full border border-[var(--chip-line)] bg-[var(--chip-bg)] px-3 py-1.5 text-sm text-[var(--sea-ink)] no-underline shadow-[0_8px_24px_rgba(30,90,72,0.08)] sm:px-4 sm:py-2"
12
+ >
13
+ <span className="h-2 w-2 rounded-full bg-[linear-gradient(90deg,#56c6be,#7ed3bf)]" />
14
+ TanStack Start
15
+ </Link>
16
+ </h2>
17
+
18
+ <div className="ml-auto flex items-center gap-1.5 sm:ml-0 sm:gap-2">
19
+ <a
20
+ href="https://x.com/tan_stack"
21
+ target="_blank"
22
+ rel="noreferrer"
23
+ className="hidden rounded-xl p-2 text-[var(--sea-ink-soft)] transition hover:bg-[var(--link-bg-hover)] hover:text-[var(--sea-ink)] sm:block"
24
+ >
25
+ <span className="sr-only">Follow TanStack on X</span>
26
+ <svg viewBox="0 0 16 16" aria-hidden="true" width="24" height="24">
27
+ <path
28
+ fill="currentColor"
29
+ d="M12.6 1h2.2L10 6.48 15.64 15h-4.41L7.78 9.82 3.23 15H1l5.14-5.84L.72 1h4.52l3.12 4.73L12.6 1zm-.77 12.67h1.22L4.57 2.26H3.26l8.57 11.41z"
30
+ />
31
+ </svg>
32
+ </a>
33
+ <a
34
+ href="https://github.com/TanStack"
35
+ target="_blank"
36
+ rel="noreferrer"
37
+ className="hidden rounded-xl p-2 text-[var(--sea-ink-soft)] transition hover:bg-[var(--link-bg-hover)] hover:text-[var(--sea-ink)] sm:block"
38
+ >
39
+ <span className="sr-only">Go to TanStack GitHub</span>
40
+ <svg viewBox="0 0 16 16" aria-hidden="true" width="24" height="24">
41
+ <path
42
+ fill="currentColor"
43
+ d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.012 8.012 0 0 0 16 8c0-4.42-3.58-8-8-8z"
44
+ />
45
+ </svg>
46
+ </a>
47
+
48
+ <ThemeToggle />
49
+ </div>
50
+
51
+ <div className="order-3 flex w-full flex-wrap items-center gap-x-4 gap-y-1 pb-1 text-sm font-semibold sm:order-2 sm:w-auto sm:flex-nowrap sm:pb-0">
52
+ <Link
53
+ to="/"
54
+ className="nav-link"
55
+ activeProps={{ className: 'nav-link is-active' }}
56
+ >
57
+ Home
58
+ </Link>
59
+ <Link
60
+ to="/about"
61
+ className="nav-link"
62
+ activeProps={{ className: 'nav-link is-active' }}
63
+ >
64
+ About
65
+ </Link>
66
+ <a
67
+ href="https://tanstack.com/start/latest/docs/framework/react/overview"
68
+ className="nav-link"
69
+ target="_blank"
70
+ rel="noreferrer"
71
+ >
72
+ Docs
73
+ </a>
74
+ </div>
75
+ </nav>
76
+ </header>
77
+ )
78
+ }
@@ -0,0 +1,81 @@
1
+ import { useEffect, useState } from 'react'
2
+
3
+ type ThemeMode = 'light' | 'dark' | 'auto'
4
+
5
+ function getInitialMode(): ThemeMode {
6
+ if (typeof window === 'undefined') {
7
+ return 'auto'
8
+ }
9
+
10
+ const stored = window.localStorage.getItem('theme')
11
+ if (stored === 'light' || stored === 'dark' || stored === 'auto') {
12
+ return stored
13
+ }
14
+
15
+ return 'auto'
16
+ }
17
+
18
+ function applyThemeMode(mode: ThemeMode) {
19
+ const prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches
20
+ const resolved = mode === 'auto' ? (prefersDark ? 'dark' : 'light') : mode
21
+
22
+ document.documentElement.classList.remove('light', 'dark')
23
+ document.documentElement.classList.add(resolved)
24
+
25
+ if (mode === 'auto') {
26
+ document.documentElement.removeAttribute('data-theme')
27
+ } else {
28
+ document.documentElement.setAttribute('data-theme', mode)
29
+ }
30
+
31
+ document.documentElement.style.colorScheme = resolved
32
+ }
33
+
34
+ export default function ThemeToggle() {
35
+ const [mode, setMode] = useState<ThemeMode>('auto')
36
+
37
+ useEffect(() => {
38
+ const initialMode = getInitialMode()
39
+ setMode(initialMode)
40
+ applyThemeMode(initialMode)
41
+ }, [])
42
+
43
+ useEffect(() => {
44
+ if (mode !== 'auto') {
45
+ return
46
+ }
47
+
48
+ const media = window.matchMedia('(prefers-color-scheme: dark)')
49
+ const onChange = () => applyThemeMode('auto')
50
+
51
+ media.addEventListener('change', onChange)
52
+ return () => {
53
+ media.removeEventListener('change', onChange)
54
+ }
55
+ }, [mode])
56
+
57
+ function toggleMode() {
58
+ const nextMode: ThemeMode =
59
+ mode === 'light' ? 'dark' : mode === 'dark' ? 'auto' : 'light'
60
+ setMode(nextMode)
61
+ applyThemeMode(nextMode)
62
+ window.localStorage.setItem('theme', nextMode)
63
+ }
64
+
65
+ const label =
66
+ mode === 'auto'
67
+ ? 'Theme mode: auto (system). Click to switch to light mode.'
68
+ : `Theme mode: ${mode}. Click to switch mode.`
69
+
70
+ return (
71
+ <button
72
+ type="button"
73
+ onClick={toggleMode}
74
+ aria-label={label}
75
+ title={label}
76
+ className="rounded-full border border-[var(--chip-line)] bg-[var(--chip-bg)] px-3 py-1.5 text-sm font-semibold text-[var(--sea-ink)] shadow-[0_8px_22px_rgba(30,90,72,0.08)] transition hover:-translate-y-0.5"
77
+ >
78
+ {mode === 'auto' ? 'Auto' : mode === 'dark' ? 'Dark' : 'Light'}
79
+ </button>
80
+ )
81
+ }
@@ -83,11 +83,18 @@ function wrapQueriesWithLoadingProxy($q: any): any {
83
83
  });
84
84
  }
85
85
 
86
- export function generateDynamicMetadata($q: any, $ctx: any) {
86
+ export type PageCtx = {
87
+ pageRoute: string;
88
+ pagePath: string;
89
+ params: Record<string, string | string[] | undefined>;
90
+ query: Record<string, string | string[] | undefined>;
91
+ };
92
+
93
+ export function generateDynamicMetadata($q: any, $ctx: PageCtx) {
87
94
  return {
88
95
  openGraph: {},
89
96
  twitter: {
90
- card: "summary"
97
+ card: "summary" as const
91
98
  }
92
99
  };
93
100
  }
@@ -313,9 +320,10 @@ export const PlasmicDynamicPage = Object.assign(
313
320
  internalArgProps: PlasmicDynamicPage__ArgProps,
314
321
 
315
322
  pageMetadata: generateDynamicMetadata(wrapQueriesWithLoadingProxy({}), {
323
+ pageRoute: "/dynamic/[slug]",
316
324
  pagePath: "/dynamic/[slug]",
317
- searchParams: {},
318
- params: {}
325
+ params: {},
326
+ query: {}
319
327
  })
320
328
  }
321
329
  );
@@ -84,11 +84,18 @@ function wrapQueriesWithLoadingProxy($q: any): any {
84
84
  });
85
85
  }
86
86
 
87
- export function generateDynamicMetadata($q: any, $ctx: any) {
87
+ export type PageCtx = {
88
+ pageRoute: string;
89
+ pagePath: string;
90
+ params: Record<string, string | string[] | undefined>;
91
+ query: Record<string, string | string[] | undefined>;
92
+ };
93
+
94
+ export function generateDynamicMetadata($q: any, $ctx: PageCtx) {
88
95
  return {
89
96
  openGraph: {},
90
97
  twitter: {
91
- card: "summary"
98
+ card: "summary" as const
92
99
  }
93
100
  };
94
101
  }
@@ -351,9 +358,10 @@ export const PlasmicHomepage = Object.assign(
351
358
  internalArgProps: PlasmicHomepage__ArgProps,
352
359
 
353
360
  pageMetadata: generateDynamicMetadata(wrapQueriesWithLoadingProxy({}), {
361
+ pageRoute: "/",
354
362
  pagePath: "/",
355
- searchParams: {},
356
- params: {}
363
+ params: {},
364
+ query: {}
357
365
  })
358
366
  }
359
367
  );
@@ -1,4 +1,3 @@
1
- import React from 'react'
2
1
  import ReactDOM from 'react-dom/client'
3
2
  import { RouterProvider, createRouter } from '@tanstack/react-router'
4
3
  import { routeTree } from './routeTree.gen'
@@ -6,6 +6,7 @@
6
6
  "module": "ESNext",
7
7
  "baseUrl": ".",
8
8
  "paths": {
9
+ "#/*": ["./src/*"],
9
10
  "@/*": ["./src/*"]
10
11
  },
11
12
  "lib": ["ES2022", "DOM", "DOM.Iterable"],
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.makePlasmicInit_app_loader = void 0;
4
4
  function makePlasmicInit_app_loader(projectId, projectApiToken) {
5
5
  return `import { initPlasmicLoader } from "@plasmicapp/loader-nextjs/react-server-conditional";
6
- import * as NextNavigation from "next/navigation";
7
6
 
8
7
  export const PLASMIC = initPlasmicLoader({
9
8
  projects: [
@@ -12,15 +11,17 @@ export const PLASMIC = initPlasmicLoader({
12
11
  token: "${projectApiToken}",
13
12
  },
14
13
  ],
14
+ platformOptions: {
15
+ nextjs: {
16
+ appDir: true,
17
+ },
18
+ },
15
19
 
16
20
  // By default Plasmic will use the last published version of your project.
17
21
  // For development, you can set preview to true, which will use the unpublished
18
22
  // project, allowing you to see your designs without publishing. Please
19
23
  // only use this for development, as this is significantly slower.
20
24
  preview: false,
21
-
22
- // Needed for Next.js app router support.
23
- nextNavigation: NextNavigation,
24
25
  });
25
26
  `;
26
27
  }
@@ -11,7 +11,12 @@ export const PLASMIC = initPlasmicLoader({
11
11
  token: "${projectApiToken}",
12
12
  },
13
13
  ],
14
-
14
+ platformOptions: {
15
+ nextjs: {
16
+ appDir: false,
17
+ }
18
+ },
19
+
15
20
  // By default Plasmic will use the last published version of your project.
16
21
  // For development, you can set preview to true, which will use the unpublished
17
22
  // project, allowing you to see your designs without publishing. Please
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-plasmic-app",
3
- "version": "0.0.136",
3
+ "version": "0.0.138",
4
4
  "description": "Create Plasmic-powered React apps",
5
5
  "main": "./dist/lib.js",
6
6
  "types": "./dist/lib.d.ts",
@@ -47,5 +47,5 @@
47
47
  "validate-npm-package-name": "^3.0.0",
48
48
  "yargs": "^16.2.0"
49
49
  },
50
- "gitHead": "1b5025833480c30a67137ad81b8008c4719b1730"
50
+ "gitHead": "cf4b7bfc318b5360730e4e080925370e37870858"
51
51
  }