@genesislcap/foundation-fdc3 14.192.2-fdc3-enhancements.7 → 14.192.2-fdc3-enhancements.8
Sign up to get free protection for your applications and to get access to all the features.
@@ -6,7 +6,7 @@ import { FDC3 } from '../fdc3';
|
|
6
6
|
*/
|
7
7
|
export interface IntentConfig {
|
8
8
|
intent: string;
|
9
|
-
callback: (
|
9
|
+
callback: (FDC3Context: any) => void;
|
10
10
|
}
|
11
11
|
/**
|
12
12
|
* fdc3-listener listen channel config
|
@@ -15,7 +15,7 @@ export interface IntentConfig {
|
|
15
15
|
export interface ChannelConfig {
|
16
16
|
channelName?: string;
|
17
17
|
channelType: string;
|
18
|
-
callback: (
|
18
|
+
callback: (FDC3Context: any) => void;
|
19
19
|
}
|
20
20
|
declare const Fdc3Listener_base: (new (...args: any[]) => {
|
21
21
|
"__#1@#_container": import("@genesislcap/foundation-utils").FoundationLayoutContainer | import("@genesislcap/foundation-utils").LayoutCacheContainer | import("@genesislcap/foundation-utils").DOMContainer;
|
@@ -354,6 +354,7 @@ export declare class Fdc3Listener extends Fdc3Listener_base {
|
|
354
354
|
deepClone(): Node;
|
355
355
|
connectedCallback(): void;
|
356
356
|
disconnectedCallback(): void;
|
357
|
+
private handleChanelCurrentContext;
|
357
358
|
}
|
358
359
|
export {};
|
359
360
|
//# sourceMappingURL=fdc3-listener.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"fdc3-listener.d.ts","sourceRoot":"","sources":["../../../src/util/fdc3-listener.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"fdc3-listener.d.ts","sourceRoot":"","sources":["../../../src/util/fdc3-listener.ts"],"names":[],"mappings":"AACA,OAAO,EAAiB,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAEzE,OAAO,EAAE,IAAI,EAAe,MAAM,SAAS,CAAC;AAE5C;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,CAAC,WAAW,KAAA,KAAK,IAAI,CAAC;CACjC;AAED;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,CAAC,WAAW,KAAA,KAAK,IAAI,CAAC;CACjC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAED;;;GAGG;AACH,qBAGa,YAAa,SAAQ,iBAAiC;IAC3D,IAAI,EAAE,IAAI,CAAC;IAEjB,YAAY,EAAE,YAAY,EAAE,CAAM;IAElC,aAAa,EAAE,aAAa,EAAE,CAAM;IAEpC,OAAO,CAAC,mBAAmB,CAAsB;IAExC,SAAS,IAAI,IAAI;IA0B1B,iBAAiB;IAuBjB,oBAAoB;YAKN,0BAA0B;CAUzC"}
|
@@ -1,5 +1,4 @@
|
|
1
1
|
import { __awaiter, __decorate } from "tslib";
|
2
|
-
import { getOrCreateChannel } from '@finos/fdc3';
|
3
2
|
import { LifecycleMixin } from '@genesislcap/foundation-utils';
|
4
3
|
import { customElement, FoundationElement } from '@genesislcap/web-core';
|
5
4
|
import { Subscription } from 'rxjs';
|
@@ -45,7 +44,8 @@ let Fdc3Listener = class Fdc3Listener extends LifecycleMixin(FoundationElement)
|
|
45
44
|
this.fdc3.addIntentListeners(listeners);
|
46
45
|
this.channelConfig.forEach((c) => __awaiter(this, void 0, void 0, function* () {
|
47
46
|
if (c.channelName) {
|
48
|
-
const channel = yield getOrCreateChannel(c.channelName);
|
47
|
+
const channel = yield this.fdc3.getOrCreateChannel(c.channelName);
|
48
|
+
this.handleChanelCurrentContext(channel, c.channelType, c.callback);
|
49
49
|
this.fdc3.addChannelListener(channel, c.channelType, c.callback);
|
50
50
|
}
|
51
51
|
else {
|
@@ -60,6 +60,14 @@ let Fdc3Listener = class Fdc3Listener extends LifecycleMixin(FoundationElement)
|
|
60
60
|
this.channelSubscription.unsubscribe();
|
61
61
|
super.disconnectedCallback();
|
62
62
|
}
|
63
|
+
handleChanelCurrentContext(channel, contextType, listenerCallback) {
|
64
|
+
return __awaiter(this, void 0, void 0, function* () {
|
65
|
+
const currentContextValue = yield channel.getCurrentContext(contextType);
|
66
|
+
if (currentContextValue) {
|
67
|
+
listenerCallback(currentContextValue);
|
68
|
+
}
|
69
|
+
});
|
70
|
+
}
|
63
71
|
};
|
64
72
|
__decorate([
|
65
73
|
FDC3
|
@@ -25,7 +25,7 @@ import { ViewTemplate } from '@microsoft/fast-element';
|
|
25
25
|
export declare interface ChannelConfig {
|
26
26
|
channelName?: string;
|
27
27
|
channelType: string;
|
28
|
-
callback: (
|
28
|
+
callback: (FDC3Context: any) => void;
|
29
29
|
}
|
30
30
|
|
31
31
|
/**
|
@@ -544,6 +544,7 @@ export declare class Fdc3Listener extends Fdc3Listener_base {
|
|
544
544
|
deepClone(): Node;
|
545
545
|
connectedCallback(): void;
|
546
546
|
disconnectedCallback(): void;
|
547
|
+
private handleChanelCurrentContext;
|
547
548
|
}
|
548
549
|
|
549
550
|
declare const Fdc3Listener_base: (new (...args: any[]) => {
|
@@ -1220,7 +1221,7 @@ declare const Fdc3RaiseIntent_base: (new (...args: any[]) => {
|
|
1220
1221
|
*/
|
1221
1222
|
export declare interface IntentConfig {
|
1222
1223
|
intent: string;
|
1223
|
-
callback: (
|
1224
|
+
callback: (FDC3Context: any) => void;
|
1224
1225
|
}
|
1225
1226
|
|
1226
1227
|
/**
|
package/docs/api-report.md
CHANGED
@@ -27,7 +27,7 @@ import { ViewTemplate } from '@microsoft/fast-element';
|
|
27
27
|
// @alpha
|
28
28
|
export interface ChannelConfig {
|
29
29
|
// (undocumented)
|
30
|
-
callback: (
|
30
|
+
callback: (FDC3Context: any) => void;
|
31
31
|
// (undocumented)
|
32
32
|
channelName?: string;
|
33
33
|
// (undocumented)
|
@@ -180,7 +180,7 @@ export class Fdc3RaiseIntent extends Fdc3RaiseIntent_base {
|
|
180
180
|
// @alpha
|
181
181
|
export interface IntentConfig {
|
182
182
|
// (undocumented)
|
183
|
-
callback: (
|
183
|
+
callback: (FDC3Context: any) => void;
|
184
184
|
// (undocumented)
|
185
185
|
intent: string;
|
186
186
|
}
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@genesislcap/foundation-fdc3",
|
3
3
|
"description": "Genesis Foundation FDC3",
|
4
|
-
"version": "14.192.2-fdc3-enhancements.
|
4
|
+
"version": "14.192.2-fdc3-enhancements.8",
|
5
5
|
"sideEffects": false,
|
6
6
|
"license": "SEE LICENSE IN license.txt",
|
7
7
|
"main": "dist/esm/index.js",
|
@@ -59,22 +59,22 @@
|
|
59
59
|
}
|
60
60
|
},
|
61
61
|
"devDependencies": {
|
62
|
-
"@genesislcap/foundation-testing": "14.192.2-fdc3-enhancements.
|
63
|
-
"@genesislcap/genx": "14.192.2-fdc3-enhancements.
|
64
|
-
"@genesislcap/rollup-builder": "14.192.2-fdc3-enhancements.
|
65
|
-
"@genesislcap/ts-builder": "14.192.2-fdc3-enhancements.
|
66
|
-
"@genesislcap/uvu-playwright-builder": "14.192.2-fdc3-enhancements.
|
67
|
-
"@genesislcap/vite-builder": "14.192.2-fdc3-enhancements.
|
68
|
-
"@genesislcap/webpack-builder": "14.192.2-fdc3-enhancements.
|
62
|
+
"@genesislcap/foundation-testing": "14.192.2-fdc3-enhancements.8",
|
63
|
+
"@genesislcap/genx": "14.192.2-fdc3-enhancements.8",
|
64
|
+
"@genesislcap/rollup-builder": "14.192.2-fdc3-enhancements.8",
|
65
|
+
"@genesislcap/ts-builder": "14.192.2-fdc3-enhancements.8",
|
66
|
+
"@genesislcap/uvu-playwright-builder": "14.192.2-fdc3-enhancements.8",
|
67
|
+
"@genesislcap/vite-builder": "14.192.2-fdc3-enhancements.8",
|
68
|
+
"@genesislcap/webpack-builder": "14.192.2-fdc3-enhancements.8",
|
69
69
|
"rimraf": "^5.0.0"
|
70
70
|
},
|
71
71
|
"dependencies": {
|
72
72
|
"@finos/fdc3": "^1.2.0",
|
73
|
-
"@genesislcap/foundation-logger": "14.192.2-fdc3-enhancements.
|
74
|
-
"@genesislcap/foundation-notifications": "14.192.2-fdc3-enhancements.
|
75
|
-
"@genesislcap/foundation-ui": "14.192.2-fdc3-enhancements.
|
76
|
-
"@genesislcap/foundation-utils": "14.192.2-fdc3-enhancements.
|
77
|
-
"@genesislcap/web-core": "14.192.2-fdc3-enhancements.
|
73
|
+
"@genesislcap/foundation-logger": "14.192.2-fdc3-enhancements.8",
|
74
|
+
"@genesislcap/foundation-notifications": "14.192.2-fdc3-enhancements.8",
|
75
|
+
"@genesislcap/foundation-ui": "14.192.2-fdc3-enhancements.8",
|
76
|
+
"@genesislcap/foundation-utils": "14.192.2-fdc3-enhancements.8",
|
77
|
+
"@genesislcap/web-core": "14.192.2-fdc3-enhancements.8",
|
78
78
|
"@interopio/desktop": "^6.3.1",
|
79
79
|
"@microsoft/fast-element": "^1.12.0",
|
80
80
|
"@microsoft/fast-foundation": "^2.49.4",
|
@@ -89,5 +89,5 @@
|
|
89
89
|
"publishConfig": {
|
90
90
|
"access": "public"
|
91
91
|
},
|
92
|
-
"gitHead": "
|
92
|
+
"gitHead": "776c37eed88ca757d62b83f1370068f99d5e77db"
|
93
93
|
}
|
package/test/fdc3.mock.ts
CHANGED
@@ -4,12 +4,18 @@ export const mockFdc3 = () => {
|
|
4
4
|
if (!('fdc3' in window)) {
|
5
5
|
const broadcast = sinon.stub();
|
6
6
|
const addContextListener = sinon.stub();
|
7
|
-
const
|
7
|
+
const getCurrentContext = sinon.stub();
|
8
|
+
const channel = sinon.stub().returns({
|
9
|
+
getCurrentContext: async () => ({}),
|
10
|
+
broadcast,
|
11
|
+
addContextListener,
|
12
|
+
});
|
8
13
|
window.fdc3 = {
|
9
14
|
broadcast,
|
10
15
|
channel,
|
11
16
|
addContextListener,
|
12
17
|
getOrCreateChannel: sinon.stub().returns({
|
18
|
+
getCurrentContext,
|
13
19
|
broadcast,
|
14
20
|
addContextListener,
|
15
21
|
}),
|