@nextsparkjs/core 0.1.0-beta.158 → 0.1.0-beta.159
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/components/dashboard/block-editor/batch-action-bar.d.ts +12 -0
- package/dist/components/dashboard/block-editor/batch-action-bar.d.ts.map +1 -0
- package/dist/components/dashboard/block-editor/batch-action-bar.js +99 -0
- package/dist/components/dashboard/block-editor/block-picker.d.ts +8 -3
- package/dist/components/dashboard/block-editor/block-picker.d.ts.map +1 -1
- package/dist/components/dashboard/block-editor/block-picker.js +5 -3
- package/dist/components/dashboard/block-editor/block-preview-canvas.d.ts +7 -3
- package/dist/components/dashboard/block-editor/block-preview-canvas.d.ts.map +1 -1
- package/dist/components/dashboard/block-editor/block-preview-canvas.js +17 -8
- package/dist/components/dashboard/block-editor/block-settings-panel.d.ts +2 -1
- package/dist/components/dashboard/block-editor/block-settings-panel.d.ts.map +1 -1
- package/dist/components/dashboard/block-editor/block-settings-panel.js +10 -1
- package/dist/components/dashboard/block-editor/builder-editor-view.d.ts.map +1 -1
- package/dist/components/dashboard/block-editor/builder-editor-view.js +190 -26
- package/dist/components/dashboard/block-editor/tree-view-node.d.ts +7 -2
- package/dist/components/dashboard/block-editor/tree-view-node.d.ts.map +1 -1
- package/dist/components/dashboard/block-editor/tree-view-node.js +16 -3
- package/dist/components/dashboard/block-editor/tree-view.d.ts +7 -2
- package/dist/components/dashboard/block-editor/tree-view.d.ts.map +1 -1
- package/dist/components/dashboard/block-editor/tree-view.js +7 -4
- package/dist/lib/blocks/clipboard.d.ts +8 -1
- package/dist/lib/blocks/clipboard.d.ts.map +1 -1
- package/dist/lib/blocks/clipboard.js +30 -8
- package/dist/messages/en/admin.json +20 -1
- package/dist/messages/en/index.d.ts +19 -0
- package/dist/messages/en/index.d.ts.map +1 -1
- package/dist/messages/es/admin.json +20 -1
- package/dist/messages/es/index.d.ts +19 -0
- package/dist/messages/es/index.d.ts.map +1 -1
- package/dist/styles/classes.json +3 -2
- package/dist/styles/ui.css +1 -1
- package/package.json +2 -2
- package/scripts/build/registry/post-build/page-generator.mjs +52 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nextsparkjs/core",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.159",
|
|
4
4
|
"description": "NextSpark - The complete SaaS framework for Next.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "NextSpark <hello@nextspark.dev>",
|
|
@@ -468,7 +468,7 @@
|
|
|
468
468
|
"tailwind-merge": "^3.3.1",
|
|
469
469
|
"uuid": "^13.0.0",
|
|
470
470
|
"zod": "^4.1.5",
|
|
471
|
-
"@nextsparkjs/testing": "0.1.0-beta.
|
|
471
|
+
"@nextsparkjs/testing": "0.1.0-beta.159"
|
|
472
472
|
},
|
|
473
473
|
"scripts": {
|
|
474
474
|
"postinstall": "node scripts/postinstall.mjs || true",
|
|
@@ -30,13 +30,61 @@ function toPascalCase(str) {
|
|
|
30
30
|
.join('')
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
+
/**
|
|
34
|
+
* Next.js route-level exports that only take effect when exported from the
|
|
35
|
+
* route file itself. If a theme template defines any of these, the generated
|
|
36
|
+
* route file MUST re-export them — otherwise Next.js silently ignores them
|
|
37
|
+
* (e.g. generateMetadata never runs so the page has no <title>/<meta>,
|
|
38
|
+
* generateStaticParams never prerenders so PPR pages stream the hero).
|
|
39
|
+
*/
|
|
40
|
+
const ROUTE_LEVEL_EXPORTS = [
|
|
41
|
+
'generateMetadata',
|
|
42
|
+
'generateStaticParams',
|
|
43
|
+
'generateViewport',
|
|
44
|
+
'metadata',
|
|
45
|
+
'viewport',
|
|
46
|
+
'revalidate',
|
|
47
|
+
'dynamic',
|
|
48
|
+
'dynamicParams',
|
|
49
|
+
'fetchCache',
|
|
50
|
+
'runtime',
|
|
51
|
+
'preferredRegion',
|
|
52
|
+
'maxDuration',
|
|
53
|
+
]
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Detect which route-level exports a template file defines, so the generated
|
|
57
|
+
* route file can re-export them.
|
|
58
|
+
*/
|
|
59
|
+
async function detectRouteLevelExports(templatePath) {
|
|
60
|
+
try {
|
|
61
|
+
const baseTemplatePath = templatePath
|
|
62
|
+
.replace('@/', rootDir + '/')
|
|
63
|
+
.replace(/\.(tsx|ts)$/, '')
|
|
64
|
+
const absoluteTemplatePath = existsSync(baseTemplatePath + '.tsx')
|
|
65
|
+
? baseTemplatePath + '.tsx'
|
|
66
|
+
: baseTemplatePath + '.ts'
|
|
67
|
+
const templateContent = await readFile(absoluteTemplatePath, 'utf8')
|
|
68
|
+
return ROUTE_LEVEL_EXPORTS.filter(name =>
|
|
69
|
+
new RegExp(`export\\s+(?:async\\s+)?(?:function|const|let|var)\\s+${name}\\b`).test(templateContent)
|
|
70
|
+
)
|
|
71
|
+
} catch {
|
|
72
|
+
return []
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
33
76
|
/**
|
|
34
77
|
* Generate content for a regular page (page.tsx, error.tsx, etc.)
|
|
35
78
|
*/
|
|
36
|
-
function generateRegularPageContent(appPath, templatePath) {
|
|
79
|
+
async function generateRegularPageContent(appPath, templatePath) {
|
|
37
80
|
// Remove .tsx/.ts extension from import path (TypeScript doesn't allow file extensions in imports)
|
|
38
81
|
const templatePathWithoutExtension = templatePath.replace(/\.(tsx|ts)$/, '')
|
|
39
82
|
|
|
83
|
+
const routeExports = await detectRouteLevelExports(templatePath)
|
|
84
|
+
const routeExportsBlock = routeExports.length > 0
|
|
85
|
+
? `\n// Re-export Next.js route-level exports from the theme template\nexport { ${routeExports.join(', ')} } from '${templatePathWithoutExtension}'\n`
|
|
86
|
+
: ''
|
|
87
|
+
|
|
40
88
|
return `/**
|
|
41
89
|
* Template page - directly imports from theme
|
|
42
90
|
* Template: ${appPath}
|
|
@@ -46,7 +94,7 @@ import TemplateComponent from '${templatePathWithoutExtension}'
|
|
|
46
94
|
|
|
47
95
|
// Direct export of the theme template (no fallback)
|
|
48
96
|
export default TemplateComponent
|
|
49
|
-
`
|
|
97
|
+
${routeExportsBlock}`
|
|
50
98
|
}
|
|
51
99
|
|
|
52
100
|
/**
|
|
@@ -324,7 +372,7 @@ export async function generateTemplatePage(template, outputPath) {
|
|
|
324
372
|
if (templateType === 'layout') {
|
|
325
373
|
content = await generateLayoutPageContent(appPath, componentName, templatePath)
|
|
326
374
|
} else {
|
|
327
|
-
content = generateRegularPageContent(appPath, templatePath)
|
|
375
|
+
content = await generateRegularPageContent(appPath, templatePath)
|
|
328
376
|
}
|
|
329
377
|
|
|
330
378
|
// Write the file
|
|
@@ -414,7 +462,7 @@ export async function generateMissingPages(templates, config = null) {
|
|
|
414
462
|
if (templateType === 'layout') {
|
|
415
463
|
expectedContent = await generateLayoutPageContent(appPath, componentName, templatePath)
|
|
416
464
|
} else {
|
|
417
|
-
expectedContent = generateRegularPageContent(appPath, templatePath)
|
|
465
|
+
expectedContent = await generateRegularPageContent(appPath, templatePath)
|
|
418
466
|
}
|
|
419
467
|
|
|
420
468
|
// Check if file exists and compare content
|