@cmssy/cli 0.9.0 → 0.10.0
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/config.d.ts +1 -1
- package/dist/cli.js +22 -8
- package/dist/cli.js.map +1 -1
- package/dist/commands/codegen.d.ts +7 -0
- package/dist/commands/codegen.d.ts.map +1 -0
- package/dist/commands/codegen.js +133 -0
- package/dist/commands/codegen.js.map +1 -0
- package/dist/commands/dev.d.ts.map +1 -1
- package/dist/commands/dev.js +5 -2
- package/dist/commands/dev.js.map +1 -1
- package/dist/commands/init.d.ts +0 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +342 -352
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/publish.js +109 -4
- package/dist/commands/publish.js.map +1 -1
- package/dist/utils/dev-generator/api-routes/blocks.d.ts +3 -0
- package/dist/utils/dev-generator/api-routes/blocks.d.ts.map +1 -0
- package/dist/utils/dev-generator/api-routes/blocks.js +194 -0
- package/dist/utils/dev-generator/api-routes/blocks.js.map +1 -0
- package/dist/utils/dev-generator/api-routes/config.d.ts +2 -0
- package/dist/utils/dev-generator/api-routes/config.d.ts.map +1 -0
- package/dist/utils/dev-generator/api-routes/config.js +107 -0
- package/dist/utils/dev-generator/api-routes/config.js.map +1 -0
- package/dist/utils/dev-generator/api-routes/preview.d.ts +2 -0
- package/dist/utils/dev-generator/api-routes/preview.d.ts.map +1 -0
- package/dist/utils/dev-generator/api-routes/preview.js +50 -0
- package/dist/utils/dev-generator/api-routes/preview.js.map +1 -0
- package/dist/utils/dev-generator/api-routes/workspaces.d.ts +2 -0
- package/dist/utils/dev-generator/api-routes/workspaces.d.ts.map +1 -0
- package/dist/utils/dev-generator/api-routes/workspaces.js +128 -0
- package/dist/utils/dev-generator/api-routes/workspaces.js.map +1 -0
- package/dist/utils/dev-generator/helpers.d.ts +23 -0
- package/dist/utils/dev-generator/helpers.d.ts.map +1 -0
- package/dist/utils/dev-generator/helpers.js +112 -0
- package/dist/utils/dev-generator/helpers.js.map +1 -0
- package/dist/utils/dev-generator/home-page.d.ts +2 -0
- package/dist/utils/dev-generator/home-page.d.ts.map +1 -0
- package/dist/utils/dev-generator/home-page.js +643 -0
- package/dist/utils/dev-generator/home-page.js.map +1 -0
- package/dist/utils/dev-generator/index.d.ts +12 -0
- package/dist/utils/dev-generator/index.d.ts.map +1 -0
- package/dist/utils/dev-generator/index.js +53 -0
- package/dist/utils/dev-generator/index.js.map +1 -0
- package/dist/utils/dev-generator/layout.d.ts +3 -0
- package/dist/utils/dev-generator/layout.d.ts.map +1 -0
- package/dist/utils/dev-generator/layout.js +59 -0
- package/dist/utils/dev-generator/layout.js.map +1 -0
- package/dist/utils/dev-generator/next-config.d.ts +3 -0
- package/dist/utils/dev-generator/next-config.d.ts.map +1 -0
- package/dist/utils/dev-generator/next-config.js +104 -0
- package/dist/utils/dev-generator/next-config.js.map +1 -0
- package/dist/utils/dev-generator/preview-pages.d.ts +3 -0
- package/dist/utils/dev-generator/preview-pages.d.ts.map +1 -0
- package/dist/utils/dev-generator/preview-pages.js +827 -0
- package/dist/utils/dev-generator/preview-pages.js.map +1 -0
- package/dist/utils/graphql.d.ts.map +1 -1
- package/dist/utils/graphql.js +2 -0
- package/dist/utils/graphql.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,827 @@
|
|
|
1
|
+
import fs from "fs-extra";
|
|
2
|
+
import path from "path";
|
|
3
|
+
import { convertBlockTypeToSimple, convertConfigToPagesData, loadTemplateConfigSync, toPascalCase, } from "./helpers.js";
|
|
4
|
+
export function generatePreviewPages(devRoot, projectRoot, resources) {
|
|
5
|
+
for (const resource of resources) {
|
|
6
|
+
if (resource.type === "template") {
|
|
7
|
+
generateTemplatePreviewPage(devRoot, projectRoot, resource);
|
|
8
|
+
}
|
|
9
|
+
else {
|
|
10
|
+
generateBlockPreviewPage(devRoot, projectRoot, resource);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
function generateBlockPreviewPage(devRoot, projectRoot, resource) {
|
|
15
|
+
const pageDir = path.join(devRoot, "app/preview", resource.name);
|
|
16
|
+
fs.mkdirSync(pageDir, { recursive: true });
|
|
17
|
+
const blockSrcDir = path.join(projectRoot, "blocks", resource.name, "src");
|
|
18
|
+
const hasIndex = fs.existsSync(path.join(blockSrcDir, "index.tsx")) ||
|
|
19
|
+
fs.existsSync(path.join(blockSrcDir, "index.ts"));
|
|
20
|
+
const hasCss = fs.existsSync(path.join(blockSrcDir, "index.css"));
|
|
21
|
+
if (!hasIndex)
|
|
22
|
+
return;
|
|
23
|
+
const finalBlockImport = `@blocks/${resource.name}/src/index`;
|
|
24
|
+
const finalCssImport = `@blocks/${resource.name}/src/index.css`;
|
|
25
|
+
const pageContent = `"use client";
|
|
26
|
+
|
|
27
|
+
import { useState, useEffect } from "react";
|
|
28
|
+
import BlockComponent from "${finalBlockImport}";
|
|
29
|
+
${hasCss ? `import "${finalCssImport}";` : ""}
|
|
30
|
+
|
|
31
|
+
export default function ${toPascalCase(resource.name)}Preview() {
|
|
32
|
+
const [data, setData] = useState<Record<string, unknown>>({});
|
|
33
|
+
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
fetch("/api/preview/${resource.name}")
|
|
36
|
+
.then((r) => r.json())
|
|
37
|
+
.then(setData)
|
|
38
|
+
.catch(console.error);
|
|
39
|
+
}, []);
|
|
40
|
+
|
|
41
|
+
useEffect(() => {
|
|
42
|
+
function handleMessage(e: MessageEvent) {
|
|
43
|
+
if (e.data?.type === "UPDATE_PROPS") {
|
|
44
|
+
setData(e.data.props);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
window.addEventListener("message", handleMessage);
|
|
48
|
+
return () => window.removeEventListener("message", handleMessage);
|
|
49
|
+
}, []);
|
|
50
|
+
|
|
51
|
+
return (
|
|
52
|
+
<div>
|
|
53
|
+
<div style={{
|
|
54
|
+
position: "fixed", top: 0, left: 0, right: 0,
|
|
55
|
+
background: "white", borderBottom: "1px solid #e0e0e0",
|
|
56
|
+
padding: "1rem 2rem", zIndex: 1000,
|
|
57
|
+
display: "flex", justifyContent: "space-between", alignItems: "center",
|
|
58
|
+
}}>
|
|
59
|
+
<div style={{ fontSize: "1.25rem", fontWeight: 600 }}>${resource.displayName || resource.name}</div>
|
|
60
|
+
<a href="/" style={{ color: "#667eea", textDecoration: "none", fontWeight: 500 }} target="_parent">
|
|
61
|
+
← Back to Home
|
|
62
|
+
</a>
|
|
63
|
+
</div>
|
|
64
|
+
<div style={{ marginTop: "60px", minHeight: "calc(100vh - 60px)" }}>
|
|
65
|
+
<BlockComponent content={data} />
|
|
66
|
+
</div>
|
|
67
|
+
</div>
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
`;
|
|
71
|
+
fs.writeFileSync(path.join(pageDir, "page.tsx"), pageContent);
|
|
72
|
+
}
|
|
73
|
+
function generateTemplatePreviewPage(devRoot, projectRoot, resource) {
|
|
74
|
+
// Read pages data from pages.json or fall back to config.ts
|
|
75
|
+
const templateDir = path.join(projectRoot, "templates", resource.name);
|
|
76
|
+
const pagesJsonPath = path.join(templateDir, "pages.json");
|
|
77
|
+
let pagesData;
|
|
78
|
+
if (fs.existsSync(pagesJsonPath)) {
|
|
79
|
+
pagesData = JSON.parse(fs.readFileSync(pagesJsonPath, "utf-8"));
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
// No pages.json — load from config.ts and convert format
|
|
83
|
+
const config = loadTemplateConfigSync(templateDir, projectRoot);
|
|
84
|
+
if (!config || (!config.pages && !config.layoutPositions))
|
|
85
|
+
return;
|
|
86
|
+
pagesData = convertConfigToPagesData(config);
|
|
87
|
+
}
|
|
88
|
+
const pages = pagesData.pages || [];
|
|
89
|
+
const layoutPositions = pagesData.layoutPositions || {};
|
|
90
|
+
// Collect all unique block types across all pages + layoutPositions
|
|
91
|
+
const blockTypesSet = new Set();
|
|
92
|
+
for (const page of pages) {
|
|
93
|
+
for (const block of page.blocks || []) {
|
|
94
|
+
blockTypesSet.add(convertBlockTypeToSimple(block.type));
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
for (const data of Object.values(layoutPositions)) {
|
|
98
|
+
blockTypesSet.add(convertBlockTypeToSimple(data.type));
|
|
99
|
+
}
|
|
100
|
+
// Check which blocks exist in blocks/ dir with src/index.tsx
|
|
101
|
+
const blockImports = [];
|
|
102
|
+
const cssImports = [];
|
|
103
|
+
const componentMapEntries = [];
|
|
104
|
+
for (const blockName of Array.from(blockTypesSet)) {
|
|
105
|
+
const blockSrcDir = path.join(projectRoot, "blocks", blockName, "src");
|
|
106
|
+
const hasIndex = fs.existsSync(path.join(blockSrcDir, "index.tsx")) ||
|
|
107
|
+
fs.existsSync(path.join(blockSrcDir, "index.ts"));
|
|
108
|
+
const hasCss = fs.existsSync(path.join(blockSrcDir, "index.css"));
|
|
109
|
+
if (!hasIndex)
|
|
110
|
+
continue;
|
|
111
|
+
const pascalName = toPascalCase(blockName);
|
|
112
|
+
blockImports.push(`import ${pascalName} from "@blocks/${blockName}/src/index";`);
|
|
113
|
+
if (hasCss) {
|
|
114
|
+
cssImports.push(`import "@blocks/${blockName}/src/index.css";`);
|
|
115
|
+
}
|
|
116
|
+
componentMapEntries.push(` "${blockName}": ${pascalName},`);
|
|
117
|
+
}
|
|
118
|
+
// Generate [[...slug]] catch-all route
|
|
119
|
+
const pageDir = path.join(devRoot, "app/preview", resource.name, "[[...slug]]");
|
|
120
|
+
fs.mkdirSync(pageDir, { recursive: true });
|
|
121
|
+
const pageContent = `"use client";
|
|
122
|
+
|
|
123
|
+
import { useState, useEffect, useRef } from "react";
|
|
124
|
+
import { useParams, useRouter } from "next/navigation";
|
|
125
|
+
${blockImports.join("\n")}
|
|
126
|
+
${cssImports.join("\n")}
|
|
127
|
+
|
|
128
|
+
const BLOCK_COMPONENTS: Record<string, React.ComponentType<any>> = {
|
|
129
|
+
${componentMapEntries.join("\n")}
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
interface BlockData {
|
|
133
|
+
type: string;
|
|
134
|
+
content: Record<string, any>;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
interface PageData {
|
|
138
|
+
name: string;
|
|
139
|
+
slug: string;
|
|
140
|
+
blocks: BlockData[];
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
interface PagesJson {
|
|
144
|
+
layoutPositions?: Record<string, BlockData>;
|
|
145
|
+
pages: PageData[];
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
function convertBlockType(type: string): string {
|
|
149
|
+
let simple = type;
|
|
150
|
+
if (simple.includes("/")) simple = simple.split("/").pop()!;
|
|
151
|
+
if (simple.startsWith("blocks.")) simple = simple.substring(7);
|
|
152
|
+
else if (simple.startsWith("templates.")) simple = simple.substring(10);
|
|
153
|
+
return simple;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
export default function ${toPascalCase(resource.name)}TemplatePreview() {
|
|
157
|
+
const params = useParams();
|
|
158
|
+
const router = useRouter();
|
|
159
|
+
const slugParts = (params.slug as string[]) || [];
|
|
160
|
+
const currentSlug = slugParts.length > 0 ? "/" + slugParts.join("/") : "/";
|
|
161
|
+
const tabsRef = useRef<HTMLDivElement>(null);
|
|
162
|
+
const activeTabRef = useRef<HTMLButtonElement>(null);
|
|
163
|
+
|
|
164
|
+
const [pagesData, setPagesData] = useState<PagesJson | null>(null);
|
|
165
|
+
const [contentOverrides, setContentOverrides] = useState<Record<string, BlockData[]>>({});
|
|
166
|
+
const [navVisible, setNavVisible] = useState(true);
|
|
167
|
+
const [paletteOpen, setPaletteOpen] = useState(false);
|
|
168
|
+
const [paletteQuery, setPaletteQuery] = useState("");
|
|
169
|
+
const [navCollapsed, setNavCollapsed] = useState(false);
|
|
170
|
+
const paletteInputRef = useRef<HTMLInputElement>(null);
|
|
171
|
+
|
|
172
|
+
// Fetch pages data from config API
|
|
173
|
+
useEffect(() => {
|
|
174
|
+
fetch("/api/blocks/${resource.name}/config")
|
|
175
|
+
.then((r) => r.json())
|
|
176
|
+
.then((config) => {
|
|
177
|
+
if (config.pagesData) {
|
|
178
|
+
setPagesData(config.pagesData);
|
|
179
|
+
}
|
|
180
|
+
})
|
|
181
|
+
.catch(console.error);
|
|
182
|
+
}, []);
|
|
183
|
+
|
|
184
|
+
// Listen for live content updates from editor
|
|
185
|
+
useEffect(() => {
|
|
186
|
+
function handleMessage(e: MessageEvent) {
|
|
187
|
+
if (e.data?.type === "UPDATE_TEMPLATE_CONTENT") {
|
|
188
|
+
setContentOverrides((prev) => ({
|
|
189
|
+
...prev,
|
|
190
|
+
[e.data.pageSlug]: e.data.blocks,
|
|
191
|
+
}));
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
window.addEventListener("message", handleMessage);
|
|
195
|
+
return () => window.removeEventListener("message", handleMessage);
|
|
196
|
+
}, []);
|
|
197
|
+
|
|
198
|
+
// Scroll active tab into view
|
|
199
|
+
useEffect(() => {
|
|
200
|
+
if (activeTabRef.current && tabsRef.current) {
|
|
201
|
+
activeTabRef.current.scrollIntoView({ behavior: "smooth", block: "nearest", inline: "center" });
|
|
202
|
+
}
|
|
203
|
+
}, [currentSlug, pagesData]);
|
|
204
|
+
|
|
205
|
+
// Ctrl+K / Cmd+K to open palette
|
|
206
|
+
useEffect(() => {
|
|
207
|
+
function onKeyDown(e: KeyboardEvent) {
|
|
208
|
+
if ((e.metaKey || e.ctrlKey) && e.key === "k") {
|
|
209
|
+
e.preventDefault();
|
|
210
|
+
setPaletteOpen((v) => !v);
|
|
211
|
+
setPaletteQuery("");
|
|
212
|
+
}
|
|
213
|
+
if (e.key === "Escape") {
|
|
214
|
+
setPaletteOpen(false);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
window.addEventListener("keydown", onKeyDown);
|
|
218
|
+
return () => window.removeEventListener("keydown", onKeyDown);
|
|
219
|
+
}, []);
|
|
220
|
+
|
|
221
|
+
// Focus input when palette opens
|
|
222
|
+
useEffect(() => {
|
|
223
|
+
if (paletteOpen && paletteInputRef.current) {
|
|
224
|
+
paletteInputRef.current.focus();
|
|
225
|
+
}
|
|
226
|
+
}, [paletteOpen]);
|
|
227
|
+
|
|
228
|
+
// Auto-hide nav on scroll down, show on scroll up
|
|
229
|
+
useEffect(() => {
|
|
230
|
+
let lastY = 0;
|
|
231
|
+
function onScroll() {
|
|
232
|
+
const y = window.scrollY;
|
|
233
|
+
if (y > 80 && y > lastY) setNavVisible(false);
|
|
234
|
+
else setNavVisible(true);
|
|
235
|
+
lastY = y;
|
|
236
|
+
}
|
|
237
|
+
window.addEventListener("scroll", onScroll, { passive: true });
|
|
238
|
+
return () => window.removeEventListener("scroll", onScroll);
|
|
239
|
+
}, []);
|
|
240
|
+
|
|
241
|
+
if (!pagesData) {
|
|
242
|
+
return (
|
|
243
|
+
<div style={{
|
|
244
|
+
height: "100vh",
|
|
245
|
+
display: "flex",
|
|
246
|
+
alignItems: "center",
|
|
247
|
+
justifyContent: "center",
|
|
248
|
+
background: "#0a0a0a",
|
|
249
|
+
}}>
|
|
250
|
+
<div style={{ textAlign: "center" }}>
|
|
251
|
+
<div style={{
|
|
252
|
+
width: "24px",
|
|
253
|
+
height: "24px",
|
|
254
|
+
border: "2px solid rgba(255,255,255,0.1)",
|
|
255
|
+
borderTopColor: "#667eea",
|
|
256
|
+
borderRadius: "50%",
|
|
257
|
+
animation: "spin 0.8s linear infinite",
|
|
258
|
+
margin: "0 auto 16px",
|
|
259
|
+
}} />
|
|
260
|
+
<div style={{ color: "rgba(255,255,255,0.4)", fontSize: "13px", letterSpacing: "0.05em" }}>
|
|
261
|
+
Loading template...
|
|
262
|
+
</div>
|
|
263
|
+
</div>
|
|
264
|
+
<style>{\`@keyframes spin { to { transform: rotate(360deg) } }\`}</style>
|
|
265
|
+
</div>
|
|
266
|
+
);
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
// Find current page
|
|
270
|
+
const currentPage = pagesData.pages.find((p) => p.slug === currentSlug);
|
|
271
|
+
if (!currentPage) {
|
|
272
|
+
return (
|
|
273
|
+
<div style={{
|
|
274
|
+
height: "100vh",
|
|
275
|
+
display: "flex",
|
|
276
|
+
alignItems: "center",
|
|
277
|
+
justifyContent: "center",
|
|
278
|
+
background: "#fafafa",
|
|
279
|
+
}}>
|
|
280
|
+
<div style={{ textAlign: "center" }}>
|
|
281
|
+
<div style={{ fontSize: "48px", marginBottom: "12px", opacity: 0.3 }}>404</div>
|
|
282
|
+
<div style={{ color: "#666", fontSize: "14px" }}>Page not found: {currentSlug}</div>
|
|
283
|
+
<button
|
|
284
|
+
onClick={() => router.push("/preview/${resource.name}")}
|
|
285
|
+
style={{
|
|
286
|
+
marginTop: "20px",
|
|
287
|
+
padding: "8px 20px",
|
|
288
|
+
background: "#667eea",
|
|
289
|
+
color: "#fff",
|
|
290
|
+
border: "none",
|
|
291
|
+
borderRadius: "6px",
|
|
292
|
+
fontSize: "13px",
|
|
293
|
+
cursor: "pointer",
|
|
294
|
+
}}
|
|
295
|
+
>Go to homepage</button>
|
|
296
|
+
</div>
|
|
297
|
+
</div>
|
|
298
|
+
);
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
// Use overrides if available, otherwise use pages.json content
|
|
302
|
+
const pageBlocks = contentOverrides[currentSlug] || currentPage.blocks || [];
|
|
303
|
+
|
|
304
|
+
// Render header layout position
|
|
305
|
+
const headerData = pagesData.layoutPositions?.header;
|
|
306
|
+
const headerType = headerData ? convertBlockType(headerData.type) : null;
|
|
307
|
+
const HeaderComponent = headerType ? BLOCK_COMPONENTS[headerType] : null;
|
|
308
|
+
|
|
309
|
+
// Render footer layout position
|
|
310
|
+
const footerData = pagesData.layoutPositions?.footer;
|
|
311
|
+
const footerType = footerData ? convertBlockType(footerData.type) : null;
|
|
312
|
+
const FooterComponent = footerType ? BLOCK_COMPONENTS[footerType] : null;
|
|
313
|
+
|
|
314
|
+
// Render sidebar_left layout position
|
|
315
|
+
const sidebarLeftData = pagesData.layoutPositions?.sidebar_left;
|
|
316
|
+
const sidebarLeftType = sidebarLeftData ? convertBlockType(sidebarLeftData.type) : null;
|
|
317
|
+
const SidebarLeftComponent = sidebarLeftType ? BLOCK_COMPONENTS[sidebarLeftType] : null;
|
|
318
|
+
|
|
319
|
+
const navigateTo = (slug: string) => {
|
|
320
|
+
const path = slug === "/" ? "/preview/${resource.name}" : \`/preview/${resource.name}\${slug}\`;
|
|
321
|
+
router.push(path);
|
|
322
|
+
};
|
|
323
|
+
|
|
324
|
+
return (
|
|
325
|
+
<>
|
|
326
|
+
<style>{\`
|
|
327
|
+
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600&display=swap');
|
|
328
|
+
|
|
329
|
+
.cmssy-nav {
|
|
330
|
+
position: fixed;
|
|
331
|
+
top: 0;
|
|
332
|
+
left: 0;
|
|
333
|
+
right: 0;
|
|
334
|
+
z-index: 9999;
|
|
335
|
+
transform: translateY(\${navVisible ? "0" : "-100%"});
|
|
336
|
+
transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
|
337
|
+
}
|
|
338
|
+
.cmssy-nav-inner {
|
|
339
|
+
margin: 10px;
|
|
340
|
+
background: rgba(10, 10, 10, 0.92);
|
|
341
|
+
backdrop-filter: blur(20px) saturate(180%);
|
|
342
|
+
-webkit-backdrop-filter: blur(20px) saturate(180%);
|
|
343
|
+
border-radius: 14px;
|
|
344
|
+
border: 1px solid rgba(255, 255, 255, 0.08);
|
|
345
|
+
box-shadow:
|
|
346
|
+
0 8px 32px rgba(0, 0, 0, 0.4),
|
|
347
|
+
0 0 0 1px rgba(255, 255, 255, 0.05) inset;
|
|
348
|
+
padding: 8px 12px;
|
|
349
|
+
display: flex;
|
|
350
|
+
align-items: center;
|
|
351
|
+
gap: 8px;
|
|
352
|
+
font-family: 'DM Sans', -apple-system, sans-serif;
|
|
353
|
+
}
|
|
354
|
+
.cmssy-back-btn {
|
|
355
|
+
display: flex;
|
|
356
|
+
align-items: center;
|
|
357
|
+
gap: 6px;
|
|
358
|
+
padding: 6px 12px;
|
|
359
|
+
background: rgba(255, 255, 255, 0.06);
|
|
360
|
+
border: 1px solid rgba(255, 255, 255, 0.08);
|
|
361
|
+
border-radius: 8px;
|
|
362
|
+
color: rgba(255, 255, 255, 0.7);
|
|
363
|
+
font-size: 12px;
|
|
364
|
+
font-weight: 500;
|
|
365
|
+
cursor: pointer;
|
|
366
|
+
text-decoration: none;
|
|
367
|
+
white-space: nowrap;
|
|
368
|
+
transition: all 0.15s ease;
|
|
369
|
+
font-family: inherit;
|
|
370
|
+
letter-spacing: 0.01em;
|
|
371
|
+
}
|
|
372
|
+
.cmssy-back-btn:hover {
|
|
373
|
+
background: rgba(255, 255, 255, 0.12);
|
|
374
|
+
color: #fff;
|
|
375
|
+
}
|
|
376
|
+
.cmssy-divider {
|
|
377
|
+
width: 1px;
|
|
378
|
+
height: 24px;
|
|
379
|
+
background: rgba(255, 255, 255, 0.1);
|
|
380
|
+
flex-shrink: 0;
|
|
381
|
+
}
|
|
382
|
+
.cmssy-template-name {
|
|
383
|
+
font-size: 13px;
|
|
384
|
+
font-weight: 600;
|
|
385
|
+
color: #fff;
|
|
386
|
+
white-space: nowrap;
|
|
387
|
+
letter-spacing: -0.01em;
|
|
388
|
+
flex-shrink: 0;
|
|
389
|
+
}
|
|
390
|
+
.cmssy-tabs-wrapper {
|
|
391
|
+
flex: 1;
|
|
392
|
+
overflow-x: auto;
|
|
393
|
+
overflow-y: hidden;
|
|
394
|
+
scrollbar-width: none;
|
|
395
|
+
-ms-overflow-style: none;
|
|
396
|
+
mask-image: linear-gradient(to right, transparent, black 20px, black calc(100% - 20px), transparent);
|
|
397
|
+
-webkit-mask-image: linear-gradient(to right, transparent, black 20px, black calc(100% - 20px), transparent);
|
|
398
|
+
}
|
|
399
|
+
.cmssy-tabs-wrapper::-webkit-scrollbar {
|
|
400
|
+
display: none;
|
|
401
|
+
}
|
|
402
|
+
.cmssy-tabs {
|
|
403
|
+
display: flex;
|
|
404
|
+
gap: 2px;
|
|
405
|
+
padding: 0 8px;
|
|
406
|
+
}
|
|
407
|
+
.cmssy-tab {
|
|
408
|
+
padding: 5px 12px;
|
|
409
|
+
font-size: 12px;
|
|
410
|
+
font-weight: 500;
|
|
411
|
+
border: none;
|
|
412
|
+
border-radius: 7px;
|
|
413
|
+
cursor: pointer;
|
|
414
|
+
white-space: nowrap;
|
|
415
|
+
transition: all 0.15s ease;
|
|
416
|
+
font-family: inherit;
|
|
417
|
+
letter-spacing: 0.01em;
|
|
418
|
+
}
|
|
419
|
+
.cmssy-tab-inactive {
|
|
420
|
+
background: transparent;
|
|
421
|
+
color: rgba(255, 255, 255, 0.45);
|
|
422
|
+
}
|
|
423
|
+
.cmssy-tab-inactive:hover {
|
|
424
|
+
background: rgba(255, 255, 255, 0.08);
|
|
425
|
+
color: rgba(255, 255, 255, 0.8);
|
|
426
|
+
}
|
|
427
|
+
.cmssy-tab-active {
|
|
428
|
+
background: #667eea;
|
|
429
|
+
color: #fff;
|
|
430
|
+
box-shadow: 0 2px 8px rgba(102, 126, 234, 0.35);
|
|
431
|
+
}
|
|
432
|
+
.cmssy-page-count {
|
|
433
|
+
font-size: 11px;
|
|
434
|
+
font-weight: 500;
|
|
435
|
+
color: rgba(255, 255, 255, 0.3);
|
|
436
|
+
white-space: nowrap;
|
|
437
|
+
flex-shrink: 0;
|
|
438
|
+
padding-right: 4px;
|
|
439
|
+
}
|
|
440
|
+
.cmssy-collapse-btn {
|
|
441
|
+
display: flex;
|
|
442
|
+
align-items: center;
|
|
443
|
+
justify-content: center;
|
|
444
|
+
width: 28px;
|
|
445
|
+
height: 28px;
|
|
446
|
+
background: rgba(255, 255, 255, 0.06);
|
|
447
|
+
border: 1px solid rgba(255, 255, 255, 0.08);
|
|
448
|
+
border-radius: 7px;
|
|
449
|
+
color: rgba(255, 255, 255, 0.5);
|
|
450
|
+
cursor: pointer;
|
|
451
|
+
flex-shrink: 0;
|
|
452
|
+
transition: all 0.15s ease;
|
|
453
|
+
font-family: inherit;
|
|
454
|
+
}
|
|
455
|
+
.cmssy-collapse-btn:hover {
|
|
456
|
+
background: rgba(255, 255, 255, 0.12);
|
|
457
|
+
color: #fff;
|
|
458
|
+
}
|
|
459
|
+
.cmssy-nav-collapsed .cmssy-nav-inner {
|
|
460
|
+
padding: 6px 8px;
|
|
461
|
+
width: fit-content;
|
|
462
|
+
}
|
|
463
|
+
.cmssy-nav-pill {
|
|
464
|
+
display: flex;
|
|
465
|
+
align-items: center;
|
|
466
|
+
gap: 8px;
|
|
467
|
+
font-family: 'DM Sans', -apple-system, sans-serif;
|
|
468
|
+
}
|
|
469
|
+
.cmssy-nav-pill-page {
|
|
470
|
+
font-size: 12px;
|
|
471
|
+
font-weight: 500;
|
|
472
|
+
color: rgba(255, 255, 255, 0.7);
|
|
473
|
+
white-space: nowrap;
|
|
474
|
+
}
|
|
475
|
+
.cmssy-search-btn {
|
|
476
|
+
display: flex;
|
|
477
|
+
align-items: center;
|
|
478
|
+
gap: 6px;
|
|
479
|
+
padding: 5px 10px;
|
|
480
|
+
background: rgba(255, 255, 255, 0.06);
|
|
481
|
+
border: 1px solid rgba(255, 255, 255, 0.08);
|
|
482
|
+
border-radius: 7px;
|
|
483
|
+
color: rgba(255, 255, 255, 0.5);
|
|
484
|
+
font-size: 11px;
|
|
485
|
+
font-family: inherit;
|
|
486
|
+
cursor: pointer;
|
|
487
|
+
white-space: nowrap;
|
|
488
|
+
transition: all 0.15s ease;
|
|
489
|
+
flex-shrink: 0;
|
|
490
|
+
}
|
|
491
|
+
.cmssy-search-btn:hover {
|
|
492
|
+
background: rgba(255, 255, 255, 0.1);
|
|
493
|
+
color: rgba(255, 255, 255, 0.8);
|
|
494
|
+
}
|
|
495
|
+
.cmssy-search-kbd {
|
|
496
|
+
font-size: 10px;
|
|
497
|
+
padding: 1px 5px;
|
|
498
|
+
border-radius: 4px;
|
|
499
|
+
background: rgba(255, 255, 255, 0.08);
|
|
500
|
+
color: rgba(255, 255, 255, 0.35);
|
|
501
|
+
font-family: inherit;
|
|
502
|
+
}
|
|
503
|
+
.cmssy-palette-overlay {
|
|
504
|
+
position: fixed;
|
|
505
|
+
inset: 0;
|
|
506
|
+
z-index: 10000;
|
|
507
|
+
background: rgba(0, 0, 0, 0.5);
|
|
508
|
+
backdrop-filter: blur(4px);
|
|
509
|
+
display: flex;
|
|
510
|
+
align-items: flex-start;
|
|
511
|
+
justify-content: center;
|
|
512
|
+
padding-top: 20vh;
|
|
513
|
+
animation: cmssyFadeIn 0.15s ease;
|
|
514
|
+
}
|
|
515
|
+
.cmssy-palette {
|
|
516
|
+
width: 480px;
|
|
517
|
+
max-width: calc(100vw - 32px);
|
|
518
|
+
background: #1a1a1a;
|
|
519
|
+
border: 1px solid rgba(255, 255, 255, 0.1);
|
|
520
|
+
border-radius: 14px;
|
|
521
|
+
box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
|
|
522
|
+
overflow: hidden;
|
|
523
|
+
animation: cmssySlideUp 0.15s ease;
|
|
524
|
+
font-family: 'DM Sans', -apple-system, sans-serif;
|
|
525
|
+
}
|
|
526
|
+
.cmssy-palette-input-wrapper {
|
|
527
|
+
display: flex;
|
|
528
|
+
align-items: center;
|
|
529
|
+
padding: 14px 16px;
|
|
530
|
+
border-bottom: 1px solid rgba(255, 255, 255, 0.08);
|
|
531
|
+
gap: 10px;
|
|
532
|
+
}
|
|
533
|
+
.cmssy-palette-input {
|
|
534
|
+
flex: 1;
|
|
535
|
+
background: none;
|
|
536
|
+
border: none;
|
|
537
|
+
outline: none;
|
|
538
|
+
color: #fff;
|
|
539
|
+
font-size: 15px;
|
|
540
|
+
font-family: inherit;
|
|
541
|
+
letter-spacing: -0.01em;
|
|
542
|
+
}
|
|
543
|
+
.cmssy-palette-input::placeholder {
|
|
544
|
+
color: rgba(255, 255, 255, 0.3);
|
|
545
|
+
}
|
|
546
|
+
.cmssy-palette-list {
|
|
547
|
+
max-height: 340px;
|
|
548
|
+
overflow-y: auto;
|
|
549
|
+
padding: 6px;
|
|
550
|
+
scrollbar-width: thin;
|
|
551
|
+
scrollbar-color: rgba(255,255,255,0.1) transparent;
|
|
552
|
+
}
|
|
553
|
+
.cmssy-palette-item {
|
|
554
|
+
display: flex;
|
|
555
|
+
align-items: center;
|
|
556
|
+
justify-content: space-between;
|
|
557
|
+
padding: 10px 12px;
|
|
558
|
+
border-radius: 8px;
|
|
559
|
+
cursor: pointer;
|
|
560
|
+
transition: background 0.1s ease;
|
|
561
|
+
border: none;
|
|
562
|
+
background: none;
|
|
563
|
+
width: 100%;
|
|
564
|
+
text-align: left;
|
|
565
|
+
font-family: inherit;
|
|
566
|
+
}
|
|
567
|
+
.cmssy-palette-item:hover {
|
|
568
|
+
background: rgba(255, 255, 255, 0.06);
|
|
569
|
+
}
|
|
570
|
+
.cmssy-palette-item-active {
|
|
571
|
+
background: rgba(102, 126, 234, 0.15);
|
|
572
|
+
}
|
|
573
|
+
.cmssy-palette-item-active:hover {
|
|
574
|
+
background: rgba(102, 126, 234, 0.2);
|
|
575
|
+
}
|
|
576
|
+
.cmssy-palette-item-name {
|
|
577
|
+
font-size: 14px;
|
|
578
|
+
font-weight: 500;
|
|
579
|
+
color: #fff;
|
|
580
|
+
}
|
|
581
|
+
.cmssy-palette-item-slug {
|
|
582
|
+
font-size: 12px;
|
|
583
|
+
color: rgba(255, 255, 255, 0.3);
|
|
584
|
+
font-family: monospace;
|
|
585
|
+
}
|
|
586
|
+
.cmssy-palette-item-current {
|
|
587
|
+
font-size: 10px;
|
|
588
|
+
padding: 2px 8px;
|
|
589
|
+
border-radius: 4px;
|
|
590
|
+
background: #667eea;
|
|
591
|
+
color: #fff;
|
|
592
|
+
font-weight: 600;
|
|
593
|
+
letter-spacing: 0.03em;
|
|
594
|
+
}
|
|
595
|
+
.cmssy-palette-empty {
|
|
596
|
+
padding: 24px 16px;
|
|
597
|
+
text-align: center;
|
|
598
|
+
color: rgba(255, 255, 255, 0.3);
|
|
599
|
+
font-size: 13px;
|
|
600
|
+
}
|
|
601
|
+
@keyframes cmssyFadeIn {
|
|
602
|
+
from { opacity: 0; }
|
|
603
|
+
to { opacity: 1; }
|
|
604
|
+
}
|
|
605
|
+
@keyframes cmssySlideUp {
|
|
606
|
+
from { opacity: 0; transform: translateY(8px) scale(0.98); }
|
|
607
|
+
to { opacity: 1; transform: translateY(0) scale(1); }
|
|
608
|
+
}
|
|
609
|
+
\`}</style>
|
|
610
|
+
|
|
611
|
+
{/* Floating Navigation Bar */}
|
|
612
|
+
<div className={\`cmssy-nav \${navCollapsed ? "cmssy-nav-collapsed" : ""}\`}>
|
|
613
|
+
<div className="cmssy-nav-inner">
|
|
614
|
+
{navCollapsed ? (
|
|
615
|
+
<div className="cmssy-nav-pill">
|
|
616
|
+
<a href="/" className="cmssy-back-btn">
|
|
617
|
+
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
|
|
618
|
+
<polyline points="15 18 9 12 15 6" />
|
|
619
|
+
</svg>
|
|
620
|
+
Dev
|
|
621
|
+
</a>
|
|
622
|
+
<div className="cmssy-divider" />
|
|
623
|
+
<div className="cmssy-nav-pill-page">{currentPage?.name || "—"}</div>
|
|
624
|
+
<button
|
|
625
|
+
className="cmssy-search-btn"
|
|
626
|
+
onClick={() => { setPaletteOpen(true); setPaletteQuery(""); }}
|
|
627
|
+
title="Search pages (Ctrl+K)"
|
|
628
|
+
>
|
|
629
|
+
<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
|
|
630
|
+
<circle cx="11" cy="11" r="8" />
|
|
631
|
+
<line x1="21" y1="21" x2="16.65" y2="16.65" />
|
|
632
|
+
</svg>
|
|
633
|
+
<span className="cmssy-search-kbd">\u2318K</span>
|
|
634
|
+
</button>
|
|
635
|
+
<button
|
|
636
|
+
className="cmssy-collapse-btn"
|
|
637
|
+
onClick={() => setNavCollapsed(false)}
|
|
638
|
+
title="Expand navigation"
|
|
639
|
+
>
|
|
640
|
+
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
|
|
641
|
+
<polyline points="6 9 12 15 18 9" />
|
|
642
|
+
</svg>
|
|
643
|
+
</button>
|
|
644
|
+
</div>
|
|
645
|
+
) : (
|
|
646
|
+
<>
|
|
647
|
+
<a href="/" className="cmssy-back-btn">
|
|
648
|
+
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
|
|
649
|
+
<polyline points="15 18 9 12 15 6" />
|
|
650
|
+
</svg>
|
|
651
|
+
Dev
|
|
652
|
+
</a>
|
|
653
|
+
|
|
654
|
+
<div className="cmssy-divider" />
|
|
655
|
+
|
|
656
|
+
<div className="cmssy-template-name">${resource.displayName || resource.name}</div>
|
|
657
|
+
|
|
658
|
+
<div className="cmssy-divider" />
|
|
659
|
+
|
|
660
|
+
<div className="cmssy-tabs-wrapper" ref={tabsRef}>
|
|
661
|
+
<div className="cmssy-tabs">
|
|
662
|
+
{pagesData.pages.map((page) => (
|
|
663
|
+
<button
|
|
664
|
+
key={page.slug}
|
|
665
|
+
ref={page.slug === currentSlug ? activeTabRef : undefined}
|
|
666
|
+
onClick={() => navigateTo(page.slug)}
|
|
667
|
+
className={\`cmssy-tab \${page.slug === currentSlug ? "cmssy-tab-active" : "cmssy-tab-inactive"}\`}
|
|
668
|
+
>
|
|
669
|
+
{page.name}
|
|
670
|
+
</button>
|
|
671
|
+
))}
|
|
672
|
+
</div>
|
|
673
|
+
</div>
|
|
674
|
+
|
|
675
|
+
<button
|
|
676
|
+
className="cmssy-search-btn"
|
|
677
|
+
onClick={() => { setPaletteOpen(true); setPaletteQuery(""); }}
|
|
678
|
+
title="Search pages (Ctrl+K)"
|
|
679
|
+
>
|
|
680
|
+
<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
|
|
681
|
+
<circle cx="11" cy="11" r="8" />
|
|
682
|
+
<line x1="21" y1="21" x2="16.65" y2="16.65" />
|
|
683
|
+
</svg>
|
|
684
|
+
<span className="cmssy-search-kbd">\u2318K</span>
|
|
685
|
+
</button>
|
|
686
|
+
|
|
687
|
+
<button
|
|
688
|
+
className="cmssy-collapse-btn"
|
|
689
|
+
onClick={() => setNavCollapsed(true)}
|
|
690
|
+
title="Collapse navigation"
|
|
691
|
+
>
|
|
692
|
+
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
|
|
693
|
+
<polyline points="18 15 12 9 6 15" />
|
|
694
|
+
</svg>
|
|
695
|
+
</button>
|
|
696
|
+
</>
|
|
697
|
+
)}
|
|
698
|
+
</div>
|
|
699
|
+
</div>
|
|
700
|
+
|
|
701
|
+
{/* Command Palette */}
|
|
702
|
+
{paletteOpen && (
|
|
703
|
+
<div className="cmssy-palette-overlay" onClick={() => setPaletteOpen(false)}>
|
|
704
|
+
<div className="cmssy-palette" onClick={(e) => e.stopPropagation()}>
|
|
705
|
+
<div className="cmssy-palette-input-wrapper">
|
|
706
|
+
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="rgba(255,255,255,0.4)" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
|
|
707
|
+
<circle cx="11" cy="11" r="8" />
|
|
708
|
+
<line x1="21" y1="21" x2="16.65" y2="16.65" />
|
|
709
|
+
</svg>
|
|
710
|
+
<input
|
|
711
|
+
ref={paletteInputRef}
|
|
712
|
+
type="text"
|
|
713
|
+
className="cmssy-palette-input"
|
|
714
|
+
placeholder="Search pages..."
|
|
715
|
+
value={paletteQuery}
|
|
716
|
+
onChange={(e) => setPaletteQuery(e.target.value)}
|
|
717
|
+
onKeyDown={(e) => {
|
|
718
|
+
if (e.key === "Enter") {
|
|
719
|
+
const q = paletteQuery.toLowerCase();
|
|
720
|
+
const match = pagesData.pages.find(
|
|
721
|
+
(p) => p.name.toLowerCase().includes(q) || p.slug.toLowerCase().includes(q)
|
|
722
|
+
);
|
|
723
|
+
if (match) {
|
|
724
|
+
navigateTo(match.slug);
|
|
725
|
+
setPaletteOpen(false);
|
|
726
|
+
}
|
|
727
|
+
}
|
|
728
|
+
}}
|
|
729
|
+
/>
|
|
730
|
+
</div>
|
|
731
|
+
<div className="cmssy-palette-list">
|
|
732
|
+
{(() => {
|
|
733
|
+
const q = paletteQuery.toLowerCase();
|
|
734
|
+
const filtered = pagesData.pages.filter(
|
|
735
|
+
(p) => p.name.toLowerCase().includes(q) || p.slug.toLowerCase().includes(q)
|
|
736
|
+
);
|
|
737
|
+
if (filtered.length === 0) {
|
|
738
|
+
return <div className="cmssy-palette-empty">No pages match “{paletteQuery}”</div>;
|
|
739
|
+
}
|
|
740
|
+
return filtered.map((page) => (
|
|
741
|
+
<button
|
|
742
|
+
key={page.slug}
|
|
743
|
+
className={\`cmssy-palette-item \${page.slug === currentSlug ? "cmssy-palette-item-active" : ""}\`}
|
|
744
|
+
onClick={() => {
|
|
745
|
+
navigateTo(page.slug);
|
|
746
|
+
setPaletteOpen(false);
|
|
747
|
+
}}
|
|
748
|
+
>
|
|
749
|
+
<div>
|
|
750
|
+
<div className="cmssy-palette-item-name">{page.name}</div>
|
|
751
|
+
<div className="cmssy-palette-item-slug">{page.slug}</div>
|
|
752
|
+
</div>
|
|
753
|
+
{page.slug === currentSlug && (
|
|
754
|
+
<span className="cmssy-palette-item-current">Current</span>
|
|
755
|
+
)}
|
|
756
|
+
</button>
|
|
757
|
+
));
|
|
758
|
+
})()}
|
|
759
|
+
</div>
|
|
760
|
+
</div>
|
|
761
|
+
</div>
|
|
762
|
+
)}
|
|
763
|
+
|
|
764
|
+
{/* Page Content */}
|
|
765
|
+
<div>
|
|
766
|
+
{HeaderComponent && headerData && (
|
|
767
|
+
<HeaderComponent content={headerData.content || {}} />
|
|
768
|
+
)}
|
|
769
|
+
{SidebarLeftComponent && sidebarLeftData ? (
|
|
770
|
+
<div style={{ display: "grid", gridTemplateColumns: "280px 1fr", minHeight: "100vh" }}>
|
|
771
|
+
<SidebarLeftComponent content={sidebarLeftData.content || {}} />
|
|
772
|
+
<main>
|
|
773
|
+
{pageBlocks.map((block, idx) => {
|
|
774
|
+
const blockType = convertBlockType(block.type);
|
|
775
|
+
const Component = BLOCK_COMPONENTS[blockType];
|
|
776
|
+
if (!Component) {
|
|
777
|
+
return (
|
|
778
|
+
<div key={idx} style={{
|
|
779
|
+
padding: "2rem",
|
|
780
|
+
background: "#fff3cd",
|
|
781
|
+
textAlign: "center",
|
|
782
|
+
margin: "1rem",
|
|
783
|
+
borderRadius: "8px",
|
|
784
|
+
fontSize: "14px",
|
|
785
|
+
color: "#856404",
|
|
786
|
+
}}>
|
|
787
|
+
Missing block component: {blockType}
|
|
788
|
+
</div>
|
|
789
|
+
);
|
|
790
|
+
}
|
|
791
|
+
return <Component key={idx} content={block.content || {}} />;
|
|
792
|
+
})}
|
|
793
|
+
</main>
|
|
794
|
+
</div>
|
|
795
|
+
) : (
|
|
796
|
+
pageBlocks.map((block, idx) => {
|
|
797
|
+
const blockType = convertBlockType(block.type);
|
|
798
|
+
const Component = BLOCK_COMPONENTS[blockType];
|
|
799
|
+
if (!Component) {
|
|
800
|
+
return (
|
|
801
|
+
<div key={idx} style={{
|
|
802
|
+
padding: "2rem",
|
|
803
|
+
background: "#fff3cd",
|
|
804
|
+
textAlign: "center",
|
|
805
|
+
margin: "1rem",
|
|
806
|
+
borderRadius: "8px",
|
|
807
|
+
fontSize: "14px",
|
|
808
|
+
color: "#856404",
|
|
809
|
+
}}>
|
|
810
|
+
Missing block component: {blockType}
|
|
811
|
+
</div>
|
|
812
|
+
);
|
|
813
|
+
}
|
|
814
|
+
return <Component key={idx} content={block.content || {}} />;
|
|
815
|
+
})
|
|
816
|
+
)}
|
|
817
|
+
{FooterComponent && footerData && (
|
|
818
|
+
<FooterComponent content={footerData.content || {}} />
|
|
819
|
+
)}
|
|
820
|
+
</div>
|
|
821
|
+
</>
|
|
822
|
+
);
|
|
823
|
+
}
|
|
824
|
+
`;
|
|
825
|
+
fs.writeFileSync(path.join(pageDir, "page.tsx"), pageContent);
|
|
826
|
+
}
|
|
827
|
+
//# sourceMappingURL=preview-pages.js.map
|