@papercraneai/cli 1.6.0 → 1.7.0-beta.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/bin/papercrane.js
CHANGED
|
@@ -581,6 +581,7 @@ import { useEffect, useState } from 'react'
|
|
|
581
581
|
import * as actions from './action'
|
|
582
582
|
import { Card, CardHeader, CardTitle, CardContent } from '@/components/ui/card'
|
|
583
583
|
import { ChartContainer, ChartTooltip, ChartTooltipContent, type ChartConfig } from '@/components/ui/chart'
|
|
584
|
+
import { DashboardGrid } from '@/components/dashboard-grid'
|
|
584
585
|
import { BarChart, Bar, XAxis, YAxis } from 'recharts'
|
|
585
586
|
|
|
586
587
|
// Use semantic chart colors: var(--chart-1) through var(--chart-5)
|
|
@@ -603,22 +604,28 @@ export default function MyDashboard() {
|
|
|
603
604
|
return (
|
|
604
605
|
<div className="min-h-screen p-6 bg-background text-foreground">
|
|
605
606
|
<h1 className="text-2xl font-bold mb-6">My Dashboard</h1>
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
<
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
607
|
+
<DashboardGrid cols={4} rowHeight={140} gap={16}>
|
|
608
|
+
<Card id="metric-card" className="col-start-1 col-span-2 row-start-1 row-span-1 bg-card border-border">
|
|
609
|
+
<CardHeader><CardTitle className="text-muted-foreground">Metric</CardTitle></CardHeader>
|
|
610
|
+
<CardContent>
|
|
611
|
+
<p className="text-2xl font-bold">1,234</p>
|
|
612
|
+
<span className="text-green-500 text-sm">↑ 12%</span>
|
|
613
|
+
</CardContent>
|
|
614
|
+
</Card>
|
|
615
|
+
<Card id="chart-card" className="col-start-1 col-span-4 row-start-2 row-span-2 bg-card border-border">
|
|
616
|
+
<CardHeader><CardTitle className="text-muted-foreground">Chart Title</CardTitle></CardHeader>
|
|
617
|
+
<CardContent>
|
|
618
|
+
<ChartContainer config={chartConfig} className="h-[300px] w-full">
|
|
619
|
+
<BarChart data={data}>
|
|
620
|
+
<XAxis dataKey="name" stroke="var(--muted-foreground)" />
|
|
621
|
+
<YAxis stroke="var(--muted-foreground)" />
|
|
622
|
+
<ChartTooltip content={<ChartTooltipContent />} />
|
|
623
|
+
<Bar dataKey="value" fill="var(--color-value)" />
|
|
624
|
+
</BarChart>
|
|
625
|
+
</ChartContainer>
|
|
626
|
+
</CardContent>
|
|
627
|
+
</Card>
|
|
628
|
+
</DashboardGrid>
|
|
622
629
|
</div>
|
|
623
630
|
)
|
|
624
631
|
}`)}
|
|
@@ -636,6 +643,18 @@ Use these Tailwind classes for theme-aware colors:
|
|
|
636
643
|
${chalk.green('Axis/Labels:')} var(--muted-foreground) for XAxis/YAxis stroke
|
|
637
644
|
`);
|
|
638
645
|
|
|
646
|
+
console.log(chalk.bold('DASHBOARD GRID LAYOUT'));
|
|
647
|
+
console.log(chalk.dim('─'.repeat(60)));
|
|
648
|
+
console.log(`
|
|
649
|
+
${chalk.green('✅')} Wrap dashboard widgets in ${chalk.cyan('<DashboardGrid cols={4} rowHeight={140} gap={16}>')} — required for layout editing and data inspection
|
|
650
|
+
${chalk.green('✅')} Give each child a unique ${chalk.cyan('id')} attribute (e.g. id="revenue-chart") — required for drag, resize, delete, and inspect
|
|
651
|
+
${chalk.green('✅')} Add grid placement classes: ${chalk.cyan('col-start-N col-span-N row-start-N row-span-N')}
|
|
652
|
+
${chalk.green('✅')} Default grid is 4 columns. col-start: 1-4, col-span: 1-4, row-start: 1+, row-span: 1+ (users can expand beyond 4 via layout editor)
|
|
653
|
+
${chalk.red('❌')} Do NOT use responsive grid classes (grid-cols-2 md:grid-cols-4)
|
|
654
|
+
${chalk.red('❌')} Do NOT use sm:/md:/lg: breakpoint prefixes on grid placement classes
|
|
655
|
+
${chalk.dim(' Header/title sections above DashboardGrid are fine as plain divs')}
|
|
656
|
+
`);
|
|
657
|
+
|
|
639
658
|
console.log(chalk.bold('AVAILABLE COMPONENTS'));
|
|
640
659
|
console.log(chalk.dim('─'.repeat(60)));
|
|
641
660
|
console.log(`
|
|
@@ -643,10 +662,17 @@ Use these Tailwind classes for theme-aware colors:
|
|
|
643
662
|
Card, CardHeader, CardTitle, CardContent, CardDescription
|
|
644
663
|
Button, Input, Select, Table, Badge, Tabs
|
|
645
664
|
|
|
665
|
+
${chalk.green('Layout:')}
|
|
666
|
+
DashboardGrid (from @/components/dashboard-grid)
|
|
667
|
+
|
|
646
668
|
${chalk.green('Chart Components:')}
|
|
647
669
|
ChartContainer, ChartTooltip, ChartTooltipContent (from @/components/ui/chart)
|
|
648
670
|
BarChart, LineChart, AreaChart, PieChart (from recharts)
|
|
649
671
|
XAxis, YAxis, Bar, Line, Area, Pie, Cell
|
|
672
|
+
|
|
673
|
+
${chalk.green('Map Components:')}
|
|
674
|
+
ComposableMap, Geographies, Geography, Marker, ZoomableGroup (from react-simple-maps)
|
|
675
|
+
GeoJSON URL: https://cdn.jsdelivr.net/npm/world-atlas@2/countries-110m.json
|
|
650
676
|
`);
|
|
651
677
|
|
|
652
678
|
console.log(chalk.bold('QUICK START'));
|
|
@@ -15,8 +15,7 @@ export function CommandListener() {
|
|
|
15
15
|
|
|
16
16
|
async function init() {
|
|
17
17
|
try {
|
|
18
|
-
const
|
|
19
|
-
const mod = await import(/* turbopackIgnore: true */ pkg)
|
|
18
|
+
const mod = await import("@papercrane/dashboard-grid/plugin")
|
|
20
19
|
if (!cancelled && mod.createCommandHandler) {
|
|
21
20
|
handlerRef.current = mod.createCommandHandler()
|
|
22
21
|
}
|
|
@@ -10,7 +10,8 @@ interface DashboardGridProps {
|
|
|
10
10
|
className?: string
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
//
|
|
13
|
+
// Load the DashboardGrid plugin for edit mode, resize, delete, and inspect features.
|
|
14
|
+
// Falls back to a plain CSS grid when the plugin is not installed.
|
|
14
15
|
let pluginGrid: React.ComponentType<DashboardGridProps> | null = null
|
|
15
16
|
let pluginLoaded = false
|
|
16
17
|
|
|
@@ -23,8 +24,7 @@ export function DashboardGrid(props: DashboardGridProps) {
|
|
|
23
24
|
|
|
24
25
|
async function loadPlugin() {
|
|
25
26
|
try {
|
|
26
|
-
const
|
|
27
|
-
const mod = await import(pkg)
|
|
27
|
+
const mod = await import("@papercrane/dashboard-grid/plugin")
|
|
28
28
|
if (mod.createPlugin) {
|
|
29
29
|
const plugin = mod.createPlugin()
|
|
30
30
|
pluginGrid = plugin.DashboardGrid
|
package/lib/dev-server.js
CHANGED
|
@@ -332,7 +332,7 @@ export async function generateScaffolding(workspaceDir) {
|
|
|
332
332
|
const nextConfigPath = path.join(workspaceDir, 'next.config.mjs');
|
|
333
333
|
const nextConfig = `/** @type {import('next').NextConfig} */
|
|
334
334
|
const nextConfig = {
|
|
335
|
-
transpilePackages: ['@papercraneai/cli'],
|
|
335
|
+
transpilePackages: ['@papercraneai/cli', '@papercrane/dashboard-grid'],
|
|
336
336
|
turbopack: {
|
|
337
337
|
root: ${JSON.stringify(workspaceDir)},
|
|
338
338
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@papercraneai/cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0-beta.0",
|
|
4
4
|
"description": "CLI tool for managing OAuth credentials for LLM integrations",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -93,5 +93,11 @@
|
|
|
93
93
|
"typescript": "^5",
|
|
94
94
|
"vaul": "^1.1.2",
|
|
95
95
|
"zod": "^4.1.13"
|
|
96
|
+
},
|
|
97
|
+
"overrides": {
|
|
98
|
+
"react-simple-maps": {
|
|
99
|
+
"react": "$react",
|
|
100
|
+
"react-dom": "$react-dom"
|
|
101
|
+
}
|
|
96
102
|
}
|
|
97
103
|
}
|