@genesislcap/foundation-fdc3 14.199.3-alpha-40ecfcd.0 → 14.200.0-FUI-2127.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. package/dist/dts/fdc3-channel-event.d.ts.map +1 -1
  2. package/dist/dts/fdc3.d.ts +57 -1
  3. package/dist/dts/fdc3.d.ts.map +1 -1
  4. package/dist/dts/index.d.ts +6 -0
  5. package/dist/dts/index.d.ts.map +1 -1
  6. package/dist/dts/notifications/interop-notifications-listener.d.ts.map +1 -1
  7. package/dist/dts/util/fdc3-context-listener.d.ts +8 -338
  8. package/dist/dts/util/fdc3-context-listener.d.ts.map +1 -1
  9. package/dist/dts/util/{fdc3-listener.d.ts → fdc3-intent-listener.d.ts} +7 -20
  10. package/dist/dts/util/fdc3-intent-listener.d.ts.map +1 -0
  11. package/dist/dts/util/fdc3-system-channel-listener.d.ts +348 -0
  12. package/dist/dts/util/fdc3-system-channel-listener.d.ts.map +1 -0
  13. package/dist/dts/util/index.d.ts +0 -1
  14. package/dist/dts/util/index.d.ts.map +1 -1
  15. package/dist/esm/fdc3-channel-event.js +6 -1
  16. package/dist/esm/fdc3.js +99 -16
  17. package/dist/esm/index.js +1 -0
  18. package/dist/esm/util/fdc3-context-listener.js +10 -30
  19. package/dist/esm/util/fdc3-intent-listener.js +48 -0
  20. package/dist/esm/util/fdc3-system-channel-listener.js +55 -0
  21. package/dist/esm/util/index.js +0 -1
  22. package/dist/foundation-fdc3.api.json +384 -0
  23. package/dist/foundation-fdc3.d.ts +57 -358
  24. package/docs/api/foundation-fdc3.fdc3.addsystemchannellistener.md +25 -0
  25. package/docs/api/foundation-fdc3.fdc3.broadcastoncurrentchannel.md +25 -0
  26. package/docs/api/foundation-fdc3.fdc3.currentchannel_.md +13 -0
  27. package/docs/api/foundation-fdc3.fdc3.handlechannelcurrentcontext.md +26 -0
  28. package/docs/api/foundation-fdc3.fdc3.isinteropfdc3.md +13 -0
  29. package/docs/api/foundation-fdc3.fdc3.isready_.md +13 -0
  30. package/docs/api/foundation-fdc3.fdc3.md +7 -0
  31. package/docs/api/foundation-fdc3.fdc3.raiseintentforcontext.md +26 -0
  32. package/docs/api-report.md +22 -34
  33. package/package.json +17 -15
  34. package/test/fdc3.mock.ts +13 -9
  35. package/dist/dts/util/fdc3-listener.d.ts.map +0 -1
  36. package/dist/esm/util/fdc3-listener.js +0 -55
@@ -20,19 +20,10 @@ import { IOConnectDesktop } from '@interopio/desktop';
20
20
  import { LayoutCacheContainer } from '@genesislcap/foundation-utils';
21
21
  import { NotificationDataRow } from '@genesislcap/foundation-notifications';
22
22
  import { NotificationListener } from '@genesislcap/foundation-ui';
23
+ import { Observable } from 'rxjs';
23
24
  import { OverrideFoundationElementDefinition } from '@microsoft/fast-foundation';
24
25
  import { ViewTemplate } from '@microsoft/fast-element';
25
26
 
26
- // @alpha
27
- export interface ChannelConfig {
28
- // (undocumented)
29
- callback: (any: any) => void;
30
- // (undocumented)
31
- channelName: string;
32
- // (undocumented)
33
- channelType: string;
34
- }
35
-
36
27
  // Warning: (ae-internal-missing-underscore) The name "DefaultFDC3" should be prefixed with an underscore because the declaration is marked as @internal
37
28
  //
38
29
  // @internal
@@ -43,10 +34,16 @@ export class DefaultFDC3 implements FDC3 {
43
34
  // (undocumented)
44
35
  addIntentListeners(listeners: Map<FDC3Intents, FDC3ContextHandler>): void;
45
36
  // (undocumented)
37
+ addSystemChannelListener(channelType: string, callback: (any: any) => void): Promise<void>;
38
+ // (undocumented)
46
39
  broadcastOnChannel(channelName: string, type: string, payload: any): Promise<void>;
47
40
  // (undocumented)
48
41
  broadcastOnChannelEventHandler(channelName: string, type: string): Promise<(e: any) => Promise<void>>;
49
42
  // (undocumented)
43
+ broadcastOnCurrentChannel(payload: any, type?: string): Promise<void>;
44
+ // (undocumented)
45
+ currentChannel$: Observable<Channel>;
46
+ // (undocumented)
50
47
  findIntent(intent: FDC3Intents, context?: FDC3Context): Promise<FDC3AppIntent>;
51
48
  // (undocumented)
52
49
  findIntentsByContext(context: FDC3Context): Promise<FDC3AppIntent[]>;
@@ -55,11 +52,19 @@ export class DefaultFDC3 implements FDC3 {
55
52
  // (undocumented)
56
53
  getOrCreateChannel(channelId: string): Promise<FDC3Channel>;
57
54
  // (undocumented)
55
+ handleChannelCurrentContext(channel: Channel | FDC3Channel, contextType: string, listenerCallback: (FDC3Context: any) => any): Promise<void>;
56
+ // (undocumented)
57
+ isInteropFdc3: () => boolean;
58
+ // (undocumented)
59
+ isReady$: Observable<true>;
60
+ // (undocumented)
58
61
  isReady: boolean;
59
62
  // (undocumented)
60
63
  joinChannel(channelId: string): Promise<void>;
61
64
  // (undocumented)
62
65
  raiseIntent(context: FDC3Context, intent?: FDC3Intents): Promise<FDC3IntentResolution>;
66
+ // (undocumented)
67
+ raiseIntentForContext(context: FDC3Context): Promise<FDC3IntentResolution>;
63
68
  }
64
69
 
65
70
  // Warning: (ae-internal-mixed-release-tag) Mixed release tags are not allowed for "FDC3" because one of its declarations is marked as @internal
@@ -68,15 +73,22 @@ export class DefaultFDC3 implements FDC3 {
68
73
  export interface FDC3 {
69
74
  addChannelListener(channelName: string, channelType: string, callback: (any: any) => void): Promise<Channel>;
70
75
  addIntentListeners(listeners: Map<FDC3Intents, FDC3ContextHandler>): void;
76
+ addSystemChannelListener(channelType: string, callback: (any: any) => void): Promise<void>;
71
77
  broadcastOnChannel(channelName: string, type: string, payload: any): Promise<void>;
72
78
  broadcastOnChannelEventHandler(channelName: string, type: string): Promise<(e: any) => Promise<void>>;
79
+ broadcastOnCurrentChannel(payload: any, type?: string): Promise<void>;
80
+ currentChannel$: Observable<FDC3Channel>;
73
81
  findIntent(intent: FDC3Intents, context?: FDC3Context): Promise<FDC3AppIntent>;
74
82
  findIntentsByContext(context: FDC3Context): Promise<FDC3AppIntent[]>;
75
83
  getCurrentChannel(): Promise<Channel>;
76
84
  getOrCreateChannel(channelId: string): Promise<FDC3Channel>;
85
+ handleChannelCurrentContext(channel: Channel | FDC3Channel, contextType: string, listenerCallback: (FDC3Context: any) => any): Promise<void>;
86
+ isInteropFdc3: () => boolean;
87
+ isReady$: Observable<true>;
77
88
  isReady: boolean;
78
89
  joinChannel(channelId: string): Promise<void>;
79
90
  raiseIntent(context: FDC3Context, intent?: FDC3Intents): Promise<FDC3IntentResolution>;
91
+ raiseIntentForContext(context: FDC3Context): Promise<FDC3IntentResolution>;
80
92
  }
81
93
 
82
94
  // @internal
@@ -127,22 +139,6 @@ export interface FDC3IntentResolution extends IntentResolution {
127
139
  // @public (undocumented)
128
140
  export type FDC3Intents = Intents;
129
141
 
130
- // Warning: (ae-forgotten-export) The symbol "Fdc3Listener_base" needs to be exported by the entry point index.d.ts
131
- //
132
- // @alpha
133
- export class Fdc3Listener extends Fdc3Listener_base {
134
- // (undocumented)
135
- channelConfig: ChannelConfig[];
136
- // (undocumented)
137
- connectedCallback(): void;
138
- // (undocumented)
139
- deepClone(): Node;
140
- // (undocumented)
141
- fdc3: FDC3;
142
- // (undocumented)
143
- intentConfig: IntentConfig[];
144
- }
145
-
146
142
  // Warning: (ae-forgotten-export) The symbol "Fdc3RaiseIntent_base" needs to be exported by the entry point index.d.ts
147
143
  //
148
144
  // @alpha
@@ -165,14 +161,6 @@ export class Fdc3RaiseIntent extends Fdc3RaiseIntent_base {
165
161
  mappingFunction: (any: any) => any;
166
162
  }
167
163
 
168
- // @alpha
169
- export interface IntentConfig {
170
- // (undocumented)
171
- callback: (any: any) => void;
172
- // (undocumented)
173
- intent: string;
174
- }
175
-
176
164
  // @public
177
165
  export const interopFoundationNotificationListener: (overrideDefinition?: OverrideFoundationElementDefinition< {
178
166
  baseName: string;
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.199.3-alpha-40ecfcd.0",
4
+ "version": "14.200.0-FUI-2127.3",
5
5
  "sideEffects": false,
6
6
  "license": "SEE LICENSE IN license.txt",
7
7
  "main": "dist/esm/index.js",
@@ -59,25 +59,27 @@
59
59
  }
60
60
  },
61
61
  "devDependencies": {
62
- "@genesislcap/foundation-testing": "14.199.3-alpha-40ecfcd.0",
63
- "@genesislcap/genx": "14.199.3-alpha-40ecfcd.0",
64
- "@genesislcap/rollup-builder": "14.199.3-alpha-40ecfcd.0",
65
- "@genesislcap/ts-builder": "14.199.3-alpha-40ecfcd.0",
66
- "@genesislcap/uvu-playwright-builder": "14.199.3-alpha-40ecfcd.0",
67
- "@genesislcap/vite-builder": "14.199.3-alpha-40ecfcd.0",
68
- "@genesislcap/webpack-builder": "14.199.3-alpha-40ecfcd.0",
69
- "rimraf": "^5.0.0"
62
+ "@genesislcap/foundation-testing": "14.200.0-FUI-2127.3",
63
+ "@genesislcap/genx": "14.200.0-FUI-2127.3",
64
+ "@genesislcap/rollup-builder": "14.200.0-FUI-2127.3",
65
+ "@genesislcap/ts-builder": "14.200.0-FUI-2127.3",
66
+ "@genesislcap/uvu-playwright-builder": "14.200.0-FUI-2127.3",
67
+ "@genesislcap/vite-builder": "14.200.0-FUI-2127.3",
68
+ "@genesislcap/webpack-builder": "14.200.0-FUI-2127.3",
69
+ "rimraf": "^5.0.0",
70
+ "sinon": "^17.0.1"
70
71
  },
71
72
  "dependencies": {
72
73
  "@finos/fdc3": "^1.2.0",
73
- "@genesislcap/foundation-logger": "14.199.3-alpha-40ecfcd.0",
74
- "@genesislcap/foundation-notifications": "14.199.3-alpha-40ecfcd.0",
75
- "@genesislcap/foundation-ui": "14.199.3-alpha-40ecfcd.0",
76
- "@genesislcap/foundation-utils": "14.199.3-alpha-40ecfcd.0",
77
- "@genesislcap/web-core": "14.199.3-alpha-40ecfcd.0",
74
+ "@genesislcap/foundation-logger": "14.200.0-FUI-2127.3",
75
+ "@genesislcap/foundation-notifications": "14.200.0-FUI-2127.3",
76
+ "@genesislcap/foundation-ui": "14.200.0-FUI-2127.3",
77
+ "@genesislcap/foundation-utils": "14.200.0-FUI-2127.3",
78
+ "@genesislcap/web-core": "14.200.0-FUI-2127.3",
78
79
  "@interopio/desktop": "^6.3.1",
79
80
  "@microsoft/fast-element": "^1.12.0",
80
81
  "@microsoft/fast-foundation": "^2.49.4",
82
+ "rxjs": "^7.5.4",
81
83
  "tslib": "^2.3.1"
82
84
  },
83
85
  "repository": {
@@ -88,5 +90,5 @@
88
90
  "publishConfig": {
89
91
  "access": "public"
90
92
  },
91
- "gitHead": "149c12e480fefd02669c2c830f01c9eb7190e2aa"
93
+ "gitHead": "b29e581ae1cc6e2acdaec752de35ddeb6262894d"
92
94
  }
package/test/fdc3.mock.ts CHANGED
@@ -4,21 +4,25 @@ export const mockFdc3 = () => {
4
4
  if (!('fdc3' in window)) {
5
5
  const broadcast = sinon.stub();
6
6
  const addContextListener = sinon.stub();
7
+ const channel = {
8
+ getCurrentContext: async () => ({}),
9
+ broadcast,
10
+ addContextListener,
11
+ };
12
+
7
13
  window.fdc3 = {
8
14
  broadcast,
15
+ channel,
9
16
  addContextListener,
10
- getOrCreateChannel: sinon.stub().returns({
11
- broadcast,
12
- addContextListener,
13
- }),
17
+ findIntent: sinon.spy(),
18
+ findIntentsByContext: sinon.spy(),
19
+ getOrCreateChannel: sinon.stub().returns(channel),
14
20
  getInfo: () => ({ fdc3Version: '2.1', provider: 'FINOS' }),
21
+ joinChannel: sinon.spy(),
15
22
  raiseIntent: sinon.stub(),
16
23
  raiseIntentForContext: sinon.stub(),
17
- addIntentListener: (intent, callback) => {
18
- return sinon.fake.returns({
19
- fireIntent: (value) => callback(value),
20
- });
21
- },
24
+ addIntentListener: sinon.spy(),
25
+ getCurrentChannel: sinon.stub().returns(channel),
22
26
  };
23
27
  }
24
28
  };
@@ -1 +0,0 @@
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;AACzE,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAE/B;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,CAAC,GAAG,KAAA,KAAK,IAAI,CAAC;CACzB;AAED;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,CAAC,GAAG,KAAA,KAAK,IAAI,CAAC;CACzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAED;;;GAGG;AACH,qBAGa,YAAa,SAAQ,iBAAiC;IAC3D,IAAI,EAAE,IAAI,CAAC;IAEjB,YAAY,EAAE,YAAY,EAAE,CAAM;IAElC,aAAa,EAAE,aAAa,EAAE,CAAM;IAE3B,SAAS,IAAI,IAAI;IA0B1B,iBAAiB;CAYlB"}
@@ -1,55 +0,0 @@
1
- import { __decorate } from "tslib";
2
- import { LifecycleMixin } from '@genesislcap/foundation-utils';
3
- import { customElement, FoundationElement } from '@genesislcap/web-core';
4
- import { FDC3 } from '../fdc3';
5
- /**
6
- * fdc3-listener
7
- * @alpha
8
- */
9
- let Fdc3Listener = class Fdc3Listener extends LifecycleMixin(FoundationElement) {
10
- constructor() {
11
- super(...arguments);
12
- this.intentConfig = [];
13
- this.channelConfig = [];
14
- }
15
- deepClone() {
16
- const copy = super.deepClone();
17
- if (this.intentConfig) {
18
- copy.intentConfig = this.intentConfig.map((c) => {
19
- const copyConfig = Object.assign({}, c);
20
- if (c.callback) {
21
- copyConfig.callback = c.callback.bind(this);
22
- }
23
- return copyConfig;
24
- });
25
- }
26
- if (this.channelConfig) {
27
- copy.channelConfig = this.channelConfig.map((c) => {
28
- const copyConfig = Object.assign({}, c);
29
- if (c.callback) {
30
- copyConfig.callback = c.callback.bind(this);
31
- }
32
- return copyConfig;
33
- });
34
- }
35
- return copy;
36
- }
37
- connectedCallback() {
38
- super.connectedCallback();
39
- if (window.fdc3) {
40
- const listeners = new Map();
41
- this.intentConfig.forEach((intent) => listeners.set(intent.intent, intent.callback));
42
- this.fdc3.addIntentListeners(listeners);
43
- this.channelConfig.forEach((c) => this.fdc3.addChannelListener(c.channelName, c.channelType, c.callback));
44
- }
45
- }
46
- };
47
- __decorate([
48
- FDC3
49
- ], Fdc3Listener.prototype, "fdc3", void 0);
50
- Fdc3Listener = __decorate([
51
- customElement({
52
- name: 'fdc3-listener',
53
- })
54
- ], Fdc3Listener);
55
- export { Fdc3Listener };