@schandlergarcia/sf-web-components 1.9.10 → 1.9.11
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/README.md
CHANGED
|
@@ -286,9 +286,9 @@ npm install
|
|
|
286
286
|
npm run build
|
|
287
287
|
```
|
|
288
288
|
|
|
289
|
-
### Reset Command Center (
|
|
289
|
+
### Reset Command Center (All Apps)
|
|
290
290
|
|
|
291
|
-
|
|
291
|
+
This script resets any app back to the blank dashboard baseline state:
|
|
292
292
|
|
|
293
293
|
```bash
|
|
294
294
|
# This script resets the command center to the blank dashboard template
|
|
@@ -298,6 +298,14 @@ npm run reset:command-center
|
|
|
298
298
|
bash node_modules/@schandlergarcia/sf-web-components/scripts/reset-command-center.sh
|
|
299
299
|
```
|
|
300
300
|
|
|
301
|
+
**What it does:**
|
|
302
|
+
- Removes custom dashboard pages
|
|
303
|
+
- Restalls BlankDashboard.tsx with EmptyState
|
|
304
|
+
- Resets CommandCenter.tsx (preserves theme mode)
|
|
305
|
+
- Updates Home.tsx to search interface
|
|
306
|
+
- Resets routes to baseline configuration
|
|
307
|
+
- Preserves: component library, authentication, all dependencies
|
|
308
|
+
|
|
301
309
|
---
|
|
302
310
|
|
|
303
311
|
## Troubleshooting
|
package/package.json
CHANGED
package/scripts/postinstall.mjs
CHANGED
|
@@ -105,6 +105,35 @@ if (fs.existsSync(sourceWorkspaceDir)) {
|
|
|
105
105
|
console.log(` ✓ Copied ${workspaceFilesCopied} workspace files\n`);
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
+
// Copy workspace templates (CommandCenter, etc.)
|
|
109
|
+
const workspaceTemplatesDir = path.join(packageRoot, 'src/templates/workspace');
|
|
110
|
+
if (fs.existsSync(workspaceTemplatesDir)) {
|
|
111
|
+
if (!fs.existsSync(targetWorkspaceDir)) {
|
|
112
|
+
fs.mkdirSync(targetWorkspaceDir, { recursive: true });
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
const workspaceTemplates = fs.readdirSync(workspaceTemplatesDir).filter(f => f.endsWith('.template'));
|
|
116
|
+
let workspaceTemplatesCopied = 0;
|
|
117
|
+
|
|
118
|
+
for (const template of workspaceTemplates) {
|
|
119
|
+
const sourcePath = path.join(workspaceTemplatesDir, template);
|
|
120
|
+
const targetFileName = template.replace('.template', '');
|
|
121
|
+
const targetPath = path.join(targetWorkspaceDir, targetFileName);
|
|
122
|
+
|
|
123
|
+
try {
|
|
124
|
+
const content = fs.readFileSync(sourcePath, 'utf-8');
|
|
125
|
+
fs.writeFileSync(targetPath, content, 'utf-8');
|
|
126
|
+
workspaceTemplatesCopied++;
|
|
127
|
+
} catch (error) {
|
|
128
|
+
console.error(` ✗ Failed to copy ${targetFileName}: ${error.message}`);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
if (workspaceTemplatesCopied > 0) {
|
|
133
|
+
console.log(` ✓ Copied ${workspaceTemplatesCopied} workspace template files\n`);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
108
137
|
// Copy pages directory (sample pages, etc.)
|
|
109
138
|
const sourcePagesDir = path.join(packageRoot, 'src/components/pages');
|
|
110
139
|
const targetComponentPagesDir = path.join(cwd, 'src/components/pages');
|
|
@@ -218,4 +247,5 @@ console.log('\n📊 Summary:');
|
|
|
218
247
|
console.log(` - Copied ${componentsCopied} UI components`);
|
|
219
248
|
console.log(` - Updated ${filesUpdated} files`);
|
|
220
249
|
console.log(` - Installed ${templatesInstalled} page templates`);
|
|
250
|
+
console.log(` - Installed CommandCenter.tsx for dashboard management`);
|
|
221
251
|
console.log('\n✅ Setup complete! UI components are now local for optimal Tailwind scanning\n');
|
|
@@ -37,8 +37,9 @@ echo ""
|
|
|
37
37
|
echo "→ Removing custom dashboards…"
|
|
38
38
|
|
|
39
39
|
removed=0
|
|
40
|
-
for f in src/
|
|
41
|
-
|
|
40
|
+
for f in src/pages/*Dashboard*.tsx src/pages/*Dashboard*.jsx; do
|
|
41
|
+
# Don't remove BlankDashboard
|
|
42
|
+
if [ -f "$f" ] && [[ "$(basename "$f")" != "BlankDashboard"* ]]; then
|
|
42
43
|
rm "$f"
|
|
43
44
|
echo " ✓ Removed $(basename "$f")"
|
|
44
45
|
removed=$((removed + 1))
|
|
@@ -52,11 +53,10 @@ echo ""
|
|
|
52
53
|
|
|
53
54
|
# ── 2. Write the blank starter dashboard ────────────────────────────────────
|
|
54
55
|
|
|
55
|
-
BLANK="src/
|
|
56
|
+
BLANK="src/pages/BlankDashboard.tsx"
|
|
56
57
|
echo "→ Creating ${BLANK}..."
|
|
57
58
|
|
|
58
59
|
cat > "$BLANK" << 'DASHBOARD_EOF'
|
|
59
|
-
import React from "react";
|
|
60
60
|
import { RocketLaunchIcon } from "@heroicons/react/24/outline";
|
|
61
61
|
import { EmptyState } from "@/components/library";
|
|
62
62
|
|
|
@@ -80,9 +80,12 @@ echo ""
|
|
|
80
80
|
# ── 3. Update CommandCenter.tsx to use BlankDashboard ────────────────────────
|
|
81
81
|
# Preserves theme initialMode if previously customized.
|
|
82
82
|
|
|
83
|
-
WRAPPER="src/components/
|
|
83
|
+
WRAPPER="src/components/workspace/CommandCenter.tsx"
|
|
84
84
|
echo "→ Updating ${WRAPPER}..."
|
|
85
85
|
|
|
86
|
+
# Create workspace directory if it doesn't exist
|
|
87
|
+
mkdir -p "src/components/workspace"
|
|
88
|
+
|
|
86
89
|
# Extract existing initialMode from AppThemeProvider (default: "light")
|
|
87
90
|
THEME_MODE="light"
|
|
88
91
|
if [ -f "$WRAPPER" ]; then
|
|
@@ -96,19 +99,17 @@ fi
|
|
|
96
99
|
cat > "$WRAPPER" << WRAPPER_EOF
|
|
97
100
|
import AppThemeProvider from "@/components/library/theme/AppThemeProvider";
|
|
98
101
|
import DataModeProvider from "@/components/library/data/DataModeProvider";
|
|
99
|
-
import {
|
|
100
|
-
import BlankDashboard from "
|
|
102
|
+
import { Toaster } from "sonner";
|
|
103
|
+
import BlankDashboard from "../../pages/BlankDashboard";
|
|
101
104
|
|
|
102
105
|
export default function CommandCenter() {
|
|
103
106
|
return (
|
|
104
|
-
<
|
|
105
|
-
<
|
|
106
|
-
<
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
</AppThemeProvider>
|
|
111
|
-
</div>
|
|
107
|
+
<AppThemeProvider initialMode="${THEME_MODE}">
|
|
108
|
+
<DataModeProvider initialMode="sample">
|
|
109
|
+
<BlankDashboard />
|
|
110
|
+
<Toaster position="bottom-right" />
|
|
111
|
+
</DataModeProvider>
|
|
112
|
+
</AppThemeProvider>
|
|
112
113
|
);
|
|
113
114
|
}
|
|
114
115
|
WRAPPER_EOF
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import AppThemeProvider from "@/components/library/theme/AppThemeProvider";
|
|
2
|
+
import DataModeProvider from "@/components/library/data/DataModeProvider";
|
|
3
|
+
import { Toaster } from "sonner";
|
|
4
|
+
import BlankDashboard from "../pages/BlankDashboard";
|
|
5
|
+
|
|
6
|
+
export default function CommandCenter() {
|
|
7
|
+
return (
|
|
8
|
+
<AppThemeProvider initialMode="light">
|
|
9
|
+
<DataModeProvider initialMode="sample">
|
|
10
|
+
<BlankDashboard />
|
|
11
|
+
<Toaster position="bottom-right" />
|
|
12
|
+
</DataModeProvider>
|
|
13
|
+
</AppThemeProvider>
|
|
14
|
+
);
|
|
15
|
+
}
|