@salesforce/webapp-template-base-react-app-experimental 1.53.0 → 1.53.2
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 +10 -0
- package/package.json +2 -2
- package/src/force-app/main/default/webapplications/base-react-app/package.json +1 -1
- package/src/force-app/main/default/webapplications/base-react-app/src/appLayout.tsx +75 -3
- package/src/force-app/main/default/webapplications/base-react-app/package-lock.json +0 -14373
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,16 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [1.53.2](https://github.com/salesforce-experience-platform-emu/webapps/compare/v1.53.1...v1.53.2) (2026-02-25)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- move ACC from layout embed to route-based page approach ([#156](https://github.com/salesforce-experience-platform-emu/webapps/issues/156)) ([b778f44](https://github.com/salesforce-experience-platform-emu/webapps/commit/b778f44a7897fbf0914d7b1ebb36079c0b2d70fd))
|
|
11
|
+
|
|
12
|
+
## [1.53.1](https://github.com/salesforce-experience-platform-emu/webapps/compare/v1.53.0...v1.53.1) (2026-02-25)
|
|
13
|
+
|
|
14
|
+
**Note:** Version bump only for package @salesforce/webapp-template-base-react-app-experimental
|
|
15
|
+
|
|
6
16
|
# [1.53.0](https://github.com/salesforce-experience-platform-emu/webapps/compare/v1.52.1...v1.53.0) (2026-02-24)
|
|
7
17
|
|
|
8
18
|
**Note:** Version bump only for package @salesforce/webapp-template-base-react-app-experimental
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/webapp-template-base-react-app-experimental",
|
|
3
|
-
"version": "1.53.
|
|
3
|
+
"version": "1.53.2",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -15,5 +15,5 @@
|
|
|
15
15
|
"test:coverage": "npm run test",
|
|
16
16
|
"test:e2e": "cd src/force-app/main/default/webapplications/base-react-app && rm -rf node_modules && npm ci && npx playwright install chromium && npm run build:e2e && npx playwright test"
|
|
17
17
|
},
|
|
18
|
-
"gitHead": "
|
|
18
|
+
"gitHead": "8866eb09bf1e24f023333d1ecc491a1e1a6c8904"
|
|
19
19
|
}
|
|
@@ -1,10 +1,82 @@
|
|
|
1
|
-
import { Outlet } from 'react-router';
|
|
2
|
-
import
|
|
1
|
+
import { Outlet, Link, useLocation } from 'react-router';
|
|
2
|
+
import { getAllRoutes } from './router-utils';
|
|
3
|
+
import { useState } from 'react';
|
|
3
4
|
|
|
4
5
|
export default function AppLayout() {
|
|
6
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
7
|
+
const location = useLocation();
|
|
8
|
+
|
|
9
|
+
const isActive = (path: string) => location.pathname === path;
|
|
10
|
+
|
|
11
|
+
const toggleMenu = () => setIsOpen(!isOpen);
|
|
12
|
+
|
|
13
|
+
const navigationRoutes: { path: string; label: string }[] = getAllRoutes()
|
|
14
|
+
.filter(
|
|
15
|
+
route =>
|
|
16
|
+
route.handle?.showInNavigation === true &&
|
|
17
|
+
route.fullPath !== undefined &&
|
|
18
|
+
route.handle?.label !== undefined
|
|
19
|
+
)
|
|
20
|
+
.map(
|
|
21
|
+
route =>
|
|
22
|
+
({
|
|
23
|
+
path: route.fullPath,
|
|
24
|
+
label: route.handle?.label,
|
|
25
|
+
}) as { path: string; label: string }
|
|
26
|
+
);
|
|
27
|
+
|
|
5
28
|
return (
|
|
6
29
|
<>
|
|
7
|
-
<
|
|
30
|
+
<nav className="bg-white border-b border-gray-200">
|
|
31
|
+
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
|
|
32
|
+
<div className="flex justify-between items-center h-16">
|
|
33
|
+
<Link to="/" className="text-xl font-semibold text-gray-900">
|
|
34
|
+
React App
|
|
35
|
+
</Link>
|
|
36
|
+
<button
|
|
37
|
+
onClick={toggleMenu}
|
|
38
|
+
className="p-2 rounded-md text-gray-700 hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-blue-500"
|
|
39
|
+
aria-label="Toggle menu"
|
|
40
|
+
>
|
|
41
|
+
<div className="w-6 h-6 flex flex-col justify-center space-y-1.5">
|
|
42
|
+
<span
|
|
43
|
+
className={`block h-0.5 w-6 bg-current transition-all ${
|
|
44
|
+
isOpen ? 'rotate-45 translate-y-2' : ''
|
|
45
|
+
}`}
|
|
46
|
+
/>
|
|
47
|
+
<span
|
|
48
|
+
className={`block h-0.5 w-6 bg-current transition-all ${isOpen ? 'opacity-0' : ''}`}
|
|
49
|
+
/>
|
|
50
|
+
<span
|
|
51
|
+
className={`block h-0.5 w-6 bg-current transition-all ${
|
|
52
|
+
isOpen ? '-rotate-45 -translate-y-2' : ''
|
|
53
|
+
}`}
|
|
54
|
+
/>
|
|
55
|
+
</div>
|
|
56
|
+
</button>
|
|
57
|
+
</div>
|
|
58
|
+
{isOpen && (
|
|
59
|
+
<div className="pb-4">
|
|
60
|
+
<div className="flex flex-col space-y-2">
|
|
61
|
+
{navigationRoutes.map(item => (
|
|
62
|
+
<Link
|
|
63
|
+
key={item.path}
|
|
64
|
+
to={item.path}
|
|
65
|
+
onClick={() => setIsOpen(false)}
|
|
66
|
+
className={`px-3 py-2 rounded-md text-sm font-medium transition-colors ${
|
|
67
|
+
isActive(item.path)
|
|
68
|
+
? 'bg-blue-100 text-blue-700'
|
|
69
|
+
: 'text-gray-700 hover:bg-gray-100'
|
|
70
|
+
}`}
|
|
71
|
+
>
|
|
72
|
+
{item.label}
|
|
73
|
+
</Link>
|
|
74
|
+
))}
|
|
75
|
+
</div>
|
|
76
|
+
</div>
|
|
77
|
+
)}
|
|
78
|
+
</div>
|
|
79
|
+
</nav>
|
|
8
80
|
<Outlet />
|
|
9
81
|
</>
|
|
10
82
|
);
|