create-ampless 0.2.0-alpha.15 → 0.2.0-alpha.17
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/dist/templates/_shared/app/(admin)/admin/mcp-tokens/page.tsx +5 -0
- package/dist/templates/_shared/app/api/admin/mcp-tokens/route.ts +6 -0
- package/dist/templates/_shared/app/api/mcp/route.ts +9 -0
- package/dist/templates/_shared/app/layout.tsx +12 -2
- package/dist/templates/_shared/package.json +8 -8
- package/package.json +1 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { admin } from '@/lib/admin'
|
|
2
|
+
import { createMcpRoute } from '@ampless/admin/api'
|
|
3
|
+
|
|
4
|
+
// `force-dynamic` keeps CloudFront from caching MCP responses. Each
|
|
5
|
+
// tool call must hit the SSR Lambda — caching would serve stale or
|
|
6
|
+
// cross-token responses.
|
|
7
|
+
export const dynamic = 'force-dynamic'
|
|
8
|
+
export const runtime = 'nodejs'
|
|
9
|
+
export const { POST } = createMcpRoute(admin)
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Metadata } from 'next'
|
|
2
2
|
import { headers } from 'next/headers'
|
|
3
3
|
import { DEFAULT_SITE_ID } from 'ampless'
|
|
4
|
+
import { validateColorScheme } from '@ampless/runtime'
|
|
4
5
|
import { Providers } from './providers'
|
|
5
6
|
import { siteMetadata } from '@/lib/seo'
|
|
6
7
|
import { loadThemeConfig, renderThemeCss } from '@/lib/theme-config'
|
|
@@ -32,9 +33,18 @@ export default async function RootLayout({ children }: { children: React.ReactNo
|
|
|
32
33
|
// system setting. Themes use `light-dark()` in their tokens.css so a
|
|
33
34
|
// single declaration covers both modes; the active `color-scheme`
|
|
34
35
|
// selects which value is rendered.
|
|
36
|
+
//
|
|
37
|
+
// The admin's theme-settings iframe preview passes the unsaved
|
|
38
|
+
// selection via `?previewColorScheme=<mode>`, which middleware
|
|
39
|
+
// forwards as `x-preview-color-scheme`. When that header is present
|
|
40
|
+
// it overrides the stored site setting so the preview updates live.
|
|
41
|
+
const previewHeader = h.get('x-preview-color-scheme')
|
|
42
|
+
const effectiveColorScheme = previewHeader
|
|
43
|
+
? validateColorScheme(previewHeader)
|
|
44
|
+
: theme.colorScheme
|
|
35
45
|
const htmlProps: { lang: string; 'data-color-scheme'?: 'light' | 'dark' } = { lang: locale }
|
|
36
|
-
if (
|
|
37
|
-
htmlProps['data-color-scheme'] =
|
|
46
|
+
if (effectiveColorScheme !== 'auto') {
|
|
47
|
+
htmlProps['data-color-scheme'] = effectiveColorScheme
|
|
38
48
|
}
|
|
39
49
|
return (
|
|
40
50
|
<html {...htmlProps}>
|
|
@@ -22,15 +22,15 @@
|
|
|
22
22
|
"@tiptap/pm": "^3.23.4",
|
|
23
23
|
"@tiptap/react": "^3.23.4",
|
|
24
24
|
"@tiptap/starter-kit": "^3.23.4",
|
|
25
|
-
"@ampless/plugin-og-image": "^0.2.0-alpha.
|
|
26
|
-
"@ampless/plugin-rss": "^0.2.0-alpha.
|
|
27
|
-
"@ampless/plugin-seo": "^0.2.0-alpha.
|
|
28
|
-
"@ampless/plugin-webhook": "^0.2.0-alpha.
|
|
29
|
-
"@ampless/admin": "^0.2.0-alpha.
|
|
30
|
-
"@ampless/backend": "^0.2.0-alpha.
|
|
31
|
-
"@ampless/runtime": "^0.2.0-alpha.
|
|
25
|
+
"@ampless/plugin-og-image": "^0.2.0-alpha.5",
|
|
26
|
+
"@ampless/plugin-rss": "^0.2.0-alpha.5",
|
|
27
|
+
"@ampless/plugin-seo": "^0.2.0-alpha.5",
|
|
28
|
+
"@ampless/plugin-webhook": "^0.2.0-alpha.5",
|
|
29
|
+
"@ampless/admin": "^0.2.0-alpha.15",
|
|
30
|
+
"@ampless/backend": "^0.2.0-alpha.7",
|
|
31
|
+
"@ampless/runtime": "^0.2.0-alpha.8",
|
|
32
32
|
"@digital-go-jp/tailwind-theme-plugin": "^0.3.4",
|
|
33
|
-
"ampless": "^0.2.0-alpha.
|
|
33
|
+
"ampless": "^0.2.0-alpha.5",
|
|
34
34
|
"aws-amplify": "^6.10.0",
|
|
35
35
|
"class-variance-authority": "^0.7.1",
|
|
36
36
|
"clsx": "^2.1.1",
|