@genesislcap/blank-app-seed 5.8.1 → 5.9.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/.genx/package.json
CHANGED
package/.genx/versions.json
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [5.9.0](https://github.com/genesiscommunitysuccess/blank-app-seed/compare/v5.8.1...v5.9.0) (2026-03-03)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* PBC version consistency and render timing + 8.15 update [FUI-0](https://github.com/genesiscommunitysuccess/blank-app-seed/issues/0) (#552) 93db030
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* PBC render timing [FUI-0](https://github.com/genesiscommunitysuccess/blank-app-seed/issues/0) 413bd3f
|
|
14
|
+
|
|
3
15
|
## [5.8.1](https://github.com/genesiscommunitysuccess/blank-app-seed/compare/v5.8.0...v5.8.1) (2026-02-13)
|
|
4
16
|
|
|
5
17
|
|
|
@@ -13,6 +13,14 @@ import { useRoutesContext } from '../../store/RoutesContext';
|
|
|
13
13
|
import { useDocumentTitle } from '../../utils/useDocumentTitle';
|
|
14
14
|
import { AUTH_PATH } from '../../config';
|
|
15
15
|
import { LOGOUT_URL } from '@genesislcap/foundation-utils';
|
|
16
|
+
import type { AppTargetId } from '@genesislcap/foundation-shell/app';
|
|
17
|
+
|
|
18
|
+
// Stable target arrays so PBCElementsRenderer effect doesn't re-run on every parent re-render
|
|
19
|
+
const TARGET_LAYOUT_START: AppTargetId = ['layout-start'];
|
|
20
|
+
const TARGET_HEADER_NAV: AppTargetId = ['header', 'nav-start', 'nav-end'];
|
|
21
|
+
const TARGET_CONTENT_START: AppTargetId = ['content-start'];
|
|
22
|
+
const TARGET_CONTENT: AppTargetId = ['content', 'content-end'];
|
|
23
|
+
const TARGET_LAYOUT_END: AppTargetId = ['layout', 'layout-end'];
|
|
16
24
|
|
|
17
25
|
interface DefaultLayoutProps {}
|
|
18
26
|
|
|
@@ -62,7 +70,7 @@ const DefaultLayout: React.FC<DefaultLayoutProps> = () => {
|
|
|
62
70
|
|
|
63
71
|
return (
|
|
64
72
|
<rapid-design-system-provider ref={designSystemProviderRef} class={className}>
|
|
65
|
-
<PBCElementsRenderer target={
|
|
73
|
+
<PBCElementsRenderer target={TARGET_LAYOUT_START} />
|
|
66
74
|
<foundation-header
|
|
67
75
|
{{#if headerLogoSrc}}
|
|
68
76
|
logo-src="{{headerLogoSrc}}"
|
|
@@ -77,14 +85,14 @@ const DefaultLayout: React.FC<DefaultLayoutProps> = () => {
|
|
|
77
85
|
routeNavItems={navItems}
|
|
78
86
|
navigateTo={(path: string) => navigate(path)}
|
|
79
87
|
>
|
|
80
|
-
<PBCElementsRenderer target={
|
|
88
|
+
<PBCElementsRenderer target={TARGET_HEADER_NAV} />
|
|
81
89
|
</foundation-header>
|
|
82
90
|
<section className={styles['content']}>
|
|
83
|
-
<PBCElementsRenderer target={
|
|
91
|
+
<PBCElementsRenderer target={TARGET_CONTENT_START} />
|
|
84
92
|
<Outlet />
|
|
85
|
-
<PBCElementsRenderer target={
|
|
93
|
+
<PBCElementsRenderer target={TARGET_CONTENT} />
|
|
86
94
|
</section>
|
|
87
|
-
<PBCElementsRenderer target={
|
|
95
|
+
<PBCElementsRenderer target={TARGET_LAYOUT_END} />
|
|
88
96
|
</rapid-design-system-provider>
|
|
89
97
|
);
|
|
90
98
|
};
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import { useEffect, useRef } from 'react';
|
|
1
|
+
import { useEffect, useRef, useState } from 'react';
|
|
2
2
|
import { AppElementPredicate, AppTargetId } from '@genesislcap/foundation-shell/app';
|
|
3
3
|
import { customEventFactory, getTargetElements } from './utils';
|
|
4
|
+
import { DI } from '@genesislcap/web-core';
|
|
5
|
+
import { Connect } from '@genesislcap/foundation-comms';
|
|
6
|
+
|
|
7
|
+
const ALWAYS_TRUE_PREDICATE: AppElementPredicate = () => true;
|
|
4
8
|
|
|
5
9
|
interface PBCElementsRendererProps {
|
|
6
10
|
target: AppTargetId;
|
|
@@ -11,30 +15,41 @@ interface PBCContainerElement extends HTMLDivElement {
|
|
|
11
15
|
$emit: (type: string, detail: any) => void;
|
|
12
16
|
}
|
|
13
17
|
|
|
14
|
-
const PBCElementsRenderer = ({ target = [], predicate =
|
|
18
|
+
const PBCElementsRenderer = ({ target = [], predicate = ALWAYS_TRUE_PREDICATE }: PBCElementsRendererProps) => {
|
|
15
19
|
const containerRef = useRef<PBCContainerElement>(null);
|
|
20
|
+
const [isConnected, setIsConnected] = useState(false);
|
|
21
|
+
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
const connect = DI.getOrCreateDOMContainer().get(Connect);
|
|
24
|
+
setIsConnected(connect.isConnected);
|
|
25
|
+
const isConnected$ = (connect as { isConnected$?: { subscribe: (cb: (v: boolean) => void) => { unsubscribe: () => void } } })
|
|
26
|
+
?.isConnected$;
|
|
27
|
+
const sub = isConnected$?.subscribe((connected: boolean) => setIsConnected(connected));
|
|
28
|
+
return () => sub?.unsubscribe?.();
|
|
29
|
+
}, []);
|
|
16
30
|
|
|
17
31
|
useEffect(() => {
|
|
18
32
|
if (containerRef.current) {
|
|
19
33
|
containerRef.current.$emit = (type, detail) => {
|
|
20
|
-
containerRef.current
|
|
21
|
-
}
|
|
34
|
+
containerRef.current?.dispatchEvent(customEventFactory(type, detail));
|
|
35
|
+
};
|
|
22
36
|
}
|
|
23
37
|
}, []);
|
|
24
38
|
|
|
25
39
|
useEffect(() => {
|
|
40
|
+
if (!isConnected) return;
|
|
26
41
|
if (containerRef.current) {
|
|
27
42
|
containerRef.current.replaceChildren();
|
|
28
43
|
}
|
|
29
44
|
const templates = getTargetElements(target, predicate);
|
|
30
45
|
templates.forEach((currentTemplate: any) => {
|
|
31
|
-
if (containerRef.current) {
|
|
46
|
+
if (containerRef.current && currentTemplate) {
|
|
32
47
|
currentTemplate.render(containerRef.current, containerRef.current);
|
|
33
48
|
}
|
|
34
49
|
});
|
|
35
|
-
}, [target, predicate]);
|
|
50
|
+
}, [target, predicate, isConnected]);
|
|
36
51
|
|
|
37
52
|
return (<div ref={containerRef} className="container"></div>);
|
|
38
53
|
};
|
|
39
54
|
|
|
40
|
-
export default PBCElementsRenderer;
|
|
55
|
+
export default PBCElementsRenderer;
|