@genesislcap/blank-app-seed 3.11.0 → 3.11.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/.genx/package.json +1 -1
- package/.genx/versions.json +1 -1
- package/CHANGELOG.md +14 -0
- package/client/package.json +1 -1
- package/client/src/utils/fdc3.ts +32 -78
- package/package.json +1 -1
package/.genx/package.json
CHANGED
package/.genx/versions.json
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [3.11.2](https://github.com/genesiscommunitysuccess/blank-app-seed/compare/v3.11.1...v3.11.2) (2024-05-29)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* adding foundation-fdc3 - GENC-292 (#239) fb1676d
|
|
9
|
+
|
|
10
|
+
## [3.11.1](https://github.com/genesiscommunitysuccess/blank-app-seed/compare/v3.11.0...v3.11.1) (2024-05-29)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* various Rapid fixes [PSD-9](https://github.com/genesiscommunitysuccess/blank-app-seed/issues/9) (#238) 771f414
|
|
16
|
+
|
|
3
17
|
## [3.11.0](https://github.com/genesiscommunitysuccess/blank-app-seed/compare/v3.10.8...v3.11.0) (2024-05-29)
|
|
4
18
|
|
|
5
19
|
|
package/client/package.json
CHANGED
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
},
|
|
90
90
|
"dependencies": {
|
|
91
91
|
{{#if FDC3.includeDependencies}}
|
|
92
|
-
"@
|
|
92
|
+
"@genesislcap/foundation-fdc3": "{{versions.UI}}",
|
|
93
93
|
{{/if}}
|
|
94
94
|
"@genesislcap/foundation-comms": "{{versions.UI}}",
|
|
95
95
|
"@genesislcap/foundation-entity-management": "{{versions.UI}}",
|
package/client/src/utils/fdc3.ts
CHANGED
|
@@ -1,78 +1,32 @@
|
|
|
1
|
-
{{#if FDC3.includeDependencies}}
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
callback: (result: any) => void,
|
|
34
|
-
): Promise<void> => {
|
|
35
|
-
const channel = await getOrCreateChannel(channelName);
|
|
36
|
-
channel.addContextListener(type, (result) => callback(result));
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
export const doRaiseIntent = async (intent: string, type: string, context: any): Promise<void> => {
|
|
40
|
-
const message = {
|
|
41
|
-
type,
|
|
42
|
-
id: context,
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
const result = await raiseIntent(intent, message);
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
export const listenForIntent = async (
|
|
49
|
-
intent: string,
|
|
50
|
-
callback: (result: any) => void,
|
|
51
|
-
): Promise<void> => {
|
|
52
|
-
addIntentListener(intent, (result) => callback(result));
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
export const stripOutBigInt = (object: any): any => {
|
|
56
|
-
|
|
57
|
-
object = { ...object };
|
|
58
|
-
|
|
59
|
-
Object.keys(object).forEach(key => {
|
|
60
|
-
if (typeof object[key] === 'bigint') {
|
|
61
|
-
delete object[key]
|
|
62
|
-
} else if (typeof object[key] === 'object') {
|
|
63
|
-
object[key] = stripOutBigInt(object[key]);
|
|
64
|
-
}
|
|
65
|
-
})
|
|
66
|
-
|
|
67
|
-
return object;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
export const sendEventOnChannel = (channelName: string, type: string) => {
|
|
71
|
-
return async (e: any) => {
|
|
72
|
-
// check for ag-grid-specific events, fall back to standard events
|
|
73
|
-
const payload = e.data || e.detail;
|
|
74
|
-
const sanitised = stripOutBigInt(payload);
|
|
75
|
-
sendMessageOnChannel(channelName, type, sanitised);
|
|
76
|
-
};
|
|
77
|
-
};
|
|
78
|
-
{{/if}}
|
|
1
|
+
{{#if FDC3.includeDependencies}}
|
|
2
|
+
import { DefaultFDC3 } from '@genesislcap/foundation-fdc3';
|
|
3
|
+
|
|
4
|
+
{{/if}}
|
|
5
|
+
export const isFDC3 = (): boolean => !!(window as any).fdc3;
|
|
6
|
+
{{#if FDC3.includeDependencies}}
|
|
7
|
+
const fdc3Service = new DefaultFDC3();
|
|
8
|
+
|
|
9
|
+
export const onFDC3Ready = async (FDC3ReadyCb: () => any): Promise<void> => {
|
|
10
|
+
isFDC3()
|
|
11
|
+
? await FDC3ReadyCb()
|
|
12
|
+
: window.addEventListener('fdc3Ready', async () => {
|
|
13
|
+
await FDC3ReadyCb();
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export const listenToChannel = async (
|
|
18
|
+
channelName: string,
|
|
19
|
+
type: string,
|
|
20
|
+
callback: (result: any) => void,
|
|
21
|
+
): Promise<void> => {
|
|
22
|
+
fdc3Service.addChannelListener(channelName, type, callback);
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export const sendEventOnChannel = (channelName: string, type: string) => {
|
|
26
|
+
return async (e: any) => {
|
|
27
|
+
// check for ag-grid-specific events, fall back to standard events
|
|
28
|
+
const payload = e.data || e.detail;
|
|
29
|
+
await fdc3Service.broadcastOnChannel(channelName, type, payload);
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
{{/if}}
|