@schandlergarcia/sf-web-components 2.3.13 → 2.3.14
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/CHANGELOG.md +7 -0
- package/brands/engine/app/appLayout.tsx +80 -3
- package/brands/engine/app/styles/global.css +35 -36
- package/package.json +1 -1
- package/scripts/apply-brand.mjs +29 -16
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [2.3.14] - 2026-04-14
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
- **demo:engine now installs complete working state** — Synced all working project files (appLayout, routes, CommandCenter, AgentPanel, hooks, api, config, styles) into the brands/engine/app/ backup so `--demo engine` installs the full working Partner Hub with correct nav bar, Engine theme, and AgentPanel chat.
|
|
12
|
+
- **apply-brand.mjs --demo now copies styles and all top-level components** — The `--demo` command previously excluded the styles directory and only copied AgentforceConversationClient. Now it copies `app/styles/` (including Engine theme global.css), all top-level component files (AgentPanel, Data360Widget, etc.), and writes a `.brand` marker for theme-aware resets.
|
|
13
|
+
- **Fixed broken appLayout.tsx in backup** — Removed placeholder `AgentforceConversationClient` with invalid agent ID from the Engine brand backup. Restored working nav bar with dynamic route-driven navigation.
|
|
14
|
+
|
|
8
15
|
## [2.3.13] - 2026-04-14
|
|
9
16
|
|
|
10
17
|
### Changed
|
|
@@ -1,13 +1,90 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Outlet, Link, useLocation } from "react-router";
|
|
1
|
+
import { Outlet, Link, useLocation, useMatches } from "react-router";
|
|
3
2
|
import { getAllRoutes } from "./router-utils";
|
|
4
3
|
import { useState } from "react";
|
|
5
4
|
|
|
6
5
|
export default function AppLayout() {
|
|
6
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
7
|
+
const location = useLocation();
|
|
8
|
+
const matches = useMatches();
|
|
9
|
+
|
|
10
|
+
const showNavBar = matches.some(
|
|
11
|
+
(m) => (m.handle as Record<string, unknown>)?.showNavBar === true,
|
|
12
|
+
);
|
|
13
|
+
|
|
14
|
+
const isActive = (path: string) => location.pathname === path;
|
|
15
|
+
|
|
16
|
+
const toggleMenu = () => setIsOpen(!isOpen);
|
|
17
|
+
|
|
18
|
+
const navigationRoutes: { path: string; label: string }[] = getAllRoutes()
|
|
19
|
+
.filter(
|
|
20
|
+
(route) =>
|
|
21
|
+
route.handle?.showInNavigation === true &&
|
|
22
|
+
route.fullPath !== undefined &&
|
|
23
|
+
route.handle?.label !== undefined,
|
|
24
|
+
)
|
|
25
|
+
.map(
|
|
26
|
+
(route) =>
|
|
27
|
+
({
|
|
28
|
+
path: route.fullPath,
|
|
29
|
+
label: route.handle?.label,
|
|
30
|
+
}) as { path: string; label: string },
|
|
31
|
+
);
|
|
32
|
+
|
|
7
33
|
return (
|
|
8
34
|
<>
|
|
35
|
+
{showNavBar && (
|
|
36
|
+
<nav className="bg-white border-b border-gray-200">
|
|
37
|
+
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
|
|
38
|
+
<div className="flex justify-between items-center h-16">
|
|
39
|
+
<Link to="/" className="text-xl font-semibold text-gray-900">
|
|
40
|
+
Partner Hub
|
|
41
|
+
</Link>
|
|
42
|
+
<button
|
|
43
|
+
onClick={toggleMenu}
|
|
44
|
+
className="p-2 rounded-md text-gray-700 hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-blue-500"
|
|
45
|
+
aria-label="Toggle menu"
|
|
46
|
+
>
|
|
47
|
+
<div className="w-6 h-6 flex flex-col justify-center space-y-1.5">
|
|
48
|
+
<span
|
|
49
|
+
className={`block h-0.5 w-6 bg-current transition-all ${
|
|
50
|
+
isOpen ? "rotate-45 translate-y-2" : ""
|
|
51
|
+
}`}
|
|
52
|
+
/>
|
|
53
|
+
<span
|
|
54
|
+
className={`block h-0.5 w-6 bg-current transition-all ${isOpen ? "opacity-0" : ""}`}
|
|
55
|
+
/>
|
|
56
|
+
<span
|
|
57
|
+
className={`block h-0.5 w-6 bg-current transition-all ${
|
|
58
|
+
isOpen ? "-rotate-45 -translate-y-2" : ""
|
|
59
|
+
}`}
|
|
60
|
+
/>
|
|
61
|
+
</div>
|
|
62
|
+
</button>
|
|
63
|
+
</div>
|
|
64
|
+
{isOpen && (
|
|
65
|
+
<div className="pb-4">
|
|
66
|
+
<div className="flex flex-col space-y-2">
|
|
67
|
+
{navigationRoutes.map((item) => (
|
|
68
|
+
<Link
|
|
69
|
+
key={item.path}
|
|
70
|
+
to={item.path}
|
|
71
|
+
onClick={() => setIsOpen(false)}
|
|
72
|
+
className={`px-3 py-2 rounded-md text-sm font-medium transition-colors ${
|
|
73
|
+
isActive(item.path)
|
|
74
|
+
? "bg-blue-100 text-blue-700"
|
|
75
|
+
: "text-gray-700 hover:bg-gray-100"
|
|
76
|
+
}`}
|
|
77
|
+
>
|
|
78
|
+
{item.label}
|
|
79
|
+
</Link>
|
|
80
|
+
))}
|
|
81
|
+
</div>
|
|
82
|
+
</div>
|
|
83
|
+
)}
|
|
84
|
+
</div>
|
|
85
|
+
</nav>
|
|
86
|
+
)}
|
|
9
87
|
<Outlet />
|
|
10
|
-
<AgentforceConversationClient agentId="<USER_AGENT_ID_18_CHAR_0Xx...>" />
|
|
11
88
|
</>
|
|
12
89
|
);
|
|
13
90
|
}
|
|
@@ -10,42 +10,6 @@
|
|
|
10
10
|
body {
|
|
11
11
|
@apply antialiased bg-white;
|
|
12
12
|
}
|
|
13
|
-
|
|
14
|
-
/* Smooth scrolling */
|
|
15
|
-
html {
|
|
16
|
-
scroll-behavior: smooth;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
/* Custom animations */
|
|
20
|
-
@keyframes fade-in {
|
|
21
|
-
from {
|
|
22
|
-
opacity: 0;
|
|
23
|
-
transform: translateY(10px);
|
|
24
|
-
}
|
|
25
|
-
to {
|
|
26
|
-
opacity: 1;
|
|
27
|
-
transform: translateY(0);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
@keyframes slide-up {
|
|
32
|
-
from {
|
|
33
|
-
opacity: 0;
|
|
34
|
-
transform: translateY(20px);
|
|
35
|
-
}
|
|
36
|
-
to {
|
|
37
|
-
opacity: 1;
|
|
38
|
-
transform: translateY(0);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.animate-fade-in {
|
|
43
|
-
animation: fade-in 0.6s ease-out;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
.animate-slide-up {
|
|
47
|
-
animation: slide-up 0.5s ease-out;
|
|
48
|
-
}
|
|
49
13
|
}
|
|
50
14
|
|
|
51
15
|
@import 'tw-animate-css';
|
|
@@ -128,6 +92,41 @@
|
|
|
128
92
|
}
|
|
129
93
|
|
|
130
94
|
:root {
|
|
95
|
+
--dash-text: #0D1117;
|
|
96
|
+
--dash-muted: #3d4047;
|
|
97
|
+
--dash-label: #8b8d91;
|
|
98
|
+
--dash-surface: #fef9ef;
|
|
99
|
+
--dash-border: #e2c97a;
|
|
100
|
+
--dash-accent: #FFB200;
|
|
101
|
+
--dash-success: #34d399;
|
|
102
|
+
--dash-info: #67e8f9;
|
|
103
|
+
--dash-warning: #FD4B23;
|
|
104
|
+
--dash-danger: #dc2626;
|
|
105
|
+
--dash-dark: #0D1117;
|
|
106
|
+
--dash-darker: #06090d;
|
|
107
|
+
--dash-chart-1: #FFB200;
|
|
108
|
+
--dash-chart-2: #1E9D6D;
|
|
109
|
+
--dash-chart-3: #7DCBD9;
|
|
110
|
+
--dash-chart-4: #FD4B23;
|
|
111
|
+
--dash-metric-size: 3.25rem;
|
|
112
|
+
--dash-metric-sub: 2.25rem;
|
|
113
|
+
--color-dash-text: var(--dash-text);
|
|
114
|
+
--color-dash-muted: var(--dash-muted);
|
|
115
|
+
--color-dash-label: var(--dash-label);
|
|
116
|
+
--color-dash-surface: var(--dash-surface);
|
|
117
|
+
--color-dash-border: var(--dash-border);
|
|
118
|
+
--color-dash-accent: var(--dash-accent);
|
|
119
|
+
--color-dash-success: var(--dash-success);
|
|
120
|
+
--color-dash-info: var(--dash-info);
|
|
121
|
+
--color-dash-warning: var(--dash-warning);
|
|
122
|
+
--color-dash-danger: var(--dash-danger);
|
|
123
|
+
--color-dash-dark: var(--dash-dark);
|
|
124
|
+
--color-dash-darker: var(--dash-darker);
|
|
125
|
+
--color-dash-chart-1: var(--dash-chart-1);
|
|
126
|
+
--color-dash-chart-2: var(--dash-chart-2);
|
|
127
|
+
--color-dash-chart-3: var(--dash-chart-3);
|
|
128
|
+
--color-dash-chart-4: var(--dash-chart-4);
|
|
129
|
+
|
|
131
130
|
--radius: 0.625rem;
|
|
132
131
|
--background: oklch(1 0 0);
|
|
133
132
|
--foreground: oklch(0.145 0 0);
|
package/package.json
CHANGED
package/scripts/apply-brand.mjs
CHANGED
|
@@ -141,9 +141,8 @@ if (isDemo) {
|
|
|
141
141
|
console.log(`\n🚀 Installing "${brandName}" demo app...\n`);
|
|
142
142
|
let installed = 0;
|
|
143
143
|
|
|
144
|
-
// Copy the full app directory tree into src/
|
|
145
|
-
|
|
146
|
-
const appSubdirs = ['pages', 'hooks', 'api', 'config', 'features', 'components/workspace', 'components/alerts', 'components/layouts'];
|
|
144
|
+
// Copy the full app directory tree into src/ (including styles for brand theming)
|
|
145
|
+
const appSubdirs = ['pages', 'hooks', 'api', 'config', 'features', 'styles', 'components/workspace', 'components/alerts', 'components/layouts'];
|
|
147
146
|
|
|
148
147
|
for (const sub of appSubdirs) {
|
|
149
148
|
const src = path.join(appDir, sub);
|
|
@@ -157,20 +156,20 @@ if (isDemo) {
|
|
|
157
156
|
}
|
|
158
157
|
}
|
|
159
158
|
|
|
160
|
-
// Copy
|
|
161
|
-
const agentClient = path.join(appDir, 'components/AgentforceConversationClient.tsx');
|
|
162
|
-
const agentClientInherit = path.join(appDir, 'components/__inherit_AgentforceConversationClient.tsx');
|
|
159
|
+
// Copy top-level component files to src/components/
|
|
163
160
|
const componentsDir = path.join(cwd, 'src/components');
|
|
164
161
|
if (!fs.existsSync(componentsDir)) fs.mkdirSync(componentsDir, { recursive: true });
|
|
165
162
|
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
163
|
+
const componentFiles = fs.readdirSync(path.join(appDir, 'components')).filter(f =>
|
|
164
|
+
f.endsWith('.tsx') || f.endsWith('.jsx') || f.endsWith('.ts') || f.endsWith('.js')
|
|
165
|
+
);
|
|
166
|
+
for (const file of componentFiles) {
|
|
167
|
+
const src = path.join(appDir, 'components', file);
|
|
168
|
+
if (fs.statSync(src).isFile()) {
|
|
169
|
+
fs.copyFileSync(src, path.join(componentsDir, file));
|
|
170
|
+
console.log(` ✓ Installed src/components/${file}`);
|
|
171
|
+
installed++;
|
|
172
|
+
}
|
|
174
173
|
}
|
|
175
174
|
|
|
176
175
|
// Copy root-level app files (routes, appLayout, etc.)
|
|
@@ -224,9 +223,23 @@ if (isDemo) {
|
|
|
224
223
|
installed++;
|
|
225
224
|
}
|
|
226
225
|
|
|
226
|
+
// If app/styles didn't exist, apply brand colors from the brand root global.css
|
|
227
|
+
const targetCSS = path.join(cwd, 'src/styles/global.css');
|
|
228
|
+
if (!fs.existsSync(path.join(appDir, 'styles'))) {
|
|
229
|
+
const brandCSS = path.join(brandDir, 'global.css');
|
|
230
|
+
if (fs.existsSync(brandCSS)) {
|
|
231
|
+
fs.mkdirSync(path.dirname(targetCSS), { recursive: true });
|
|
232
|
+
fs.copyFileSync(brandCSS, targetCSS);
|
|
233
|
+
console.log(' ✓ Brand theme applied (global.css)');
|
|
234
|
+
installed++;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
// Write .brand marker
|
|
239
|
+
fs.writeFileSync(path.join(cwd, '.brand'), brandName + '\n', 'utf-8');
|
|
240
|
+
|
|
227
241
|
console.log(`\n✅ "${brandName}" demo app installed (${installed} files).`);
|
|
228
|
-
console.log(
|
|
229
|
-
console.log(` Run "npm run brand:${brandName}" to switch to ${brandName} colors.\n`);
|
|
242
|
+
console.log(` Brand colors applied. Run "npm run brand:reset" to revert to neutral.\n`);
|
|
230
243
|
process.exit(0);
|
|
231
244
|
}
|
|
232
245
|
|