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

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 +7 -337
  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} +6 -19
  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
@@ -0,0 +1,348 @@
1
+ import { FoundationElement } from '@genesislcap/web-core';
2
+ import { FDC3 } from '../fdc3';
3
+ /**
4
+ * System channel listener config. System channels are also known as color channels
5
+ * @alpha
6
+ * @param channelType - string for the context channel type
7
+ * @param callback - function that is called if a message with a matching context is emitted
8
+ */
9
+ export interface SystemChannelListenerConfig {
10
+ channelType: string;
11
+ callback: (any: any) => void;
12
+ }
13
+ declare const Fdc3SystemChannelListener_base: (new (...args: any[]) => {
14
+ "__#1@#_container": import("@genesislcap/foundation-utils").FoundationLayoutContainer | import("@genesislcap/foundation-utils").LayoutCacheContainer | import("@genesislcap/foundation-utils").DOMContainer;
15
+ "__#1@#_latestTokenCode": string;
16
+ "__#1@#_hasFirstLoaded": boolean;
17
+ "__#1@#_cleanupTimeout": NodeJS.Timeout;
18
+ "__#1@#_shouldForceLifecycle": boolean;
19
+ cloneNode(deep?: boolean): Node;
20
+ deepClone(): Node;
21
+ readonly shouldRunDisconnect: boolean;
22
+ readonly shouldRunConnect: boolean;
23
+ "__#1@#_blockLifecycleDueToTokenChange"(lifecycleType: "connect" | "disconnect" | "reconnect"): boolean;
24
+ "__#1@#_tryFindContainingLayout"(e: Element): import("@genesislcap/foundation-utils").FoundationLayoutContainer | import("@genesislcap/foundation-utils").LayoutCacheContainer | import("@genesislcap/foundation-utils").DOMContainer;
25
+ connectedCallback(): void;
26
+ readonly $fastController: import("@microsoft/fast-element").Controller;
27
+ $emit(type: string, detail?: any, options?: Omit<CustomEventInit<any>, "detail">): boolean | void;
28
+ disconnectedCallback(): void;
29
+ attributeChangedCallback(name: string, oldValue: string, newValue: string): void;
30
+ accessKey: string;
31
+ readonly accessKeyLabel: string;
32
+ autocapitalize: string;
33
+ dir: string;
34
+ draggable: boolean;
35
+ hidden: boolean;
36
+ inert: boolean;
37
+ innerText: string;
38
+ lang: string;
39
+ readonly offsetHeight: number;
40
+ readonly offsetLeft: number;
41
+ readonly offsetParent: Element;
42
+ readonly offsetTop: number;
43
+ readonly offsetWidth: number;
44
+ outerText: string;
45
+ spellcheck: boolean;
46
+ title: string;
47
+ translate: boolean;
48
+ attachInternals(): ElementInternals;
49
+ click(): void;
50
+ addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
51
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
52
+ removeEventListener<K_1 extends keyof HTMLElementEventMap>(type: K_1, listener: (this: HTMLElement, ev: HTMLElementEventMap[K_1]) => any, options?: boolean | EventListenerOptions): void;
53
+ removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
54
+ readonly attributes: NamedNodeMap;
55
+ readonly classList: DOMTokenList;
56
+ className: string;
57
+ readonly clientHeight: number;
58
+ readonly clientLeft: number;
59
+ readonly clientTop: number;
60
+ readonly clientWidth: number;
61
+ id: string;
62
+ readonly localName: string;
63
+ readonly namespaceURI: string;
64
+ onfullscreenchange: (this: Element, ev: Event) => any;
65
+ onfullscreenerror: (this: Element, ev: Event) => any;
66
+ outerHTML: string;
67
+ readonly ownerDocument: Document;
68
+ readonly part: DOMTokenList;
69
+ readonly prefix: string;
70
+ readonly scrollHeight: number;
71
+ scrollLeft: number;
72
+ scrollTop: number;
73
+ readonly scrollWidth: number;
74
+ readonly shadowRoot: ShadowRoot;
75
+ slot: string;
76
+ readonly tagName: string;
77
+ attachShadow(init: ShadowRootInit): ShadowRoot;
78
+ closest<K_2 extends keyof HTMLElementTagNameMap>(selector: K_2): HTMLElementTagNameMap[K_2];
79
+ closest<K_3 extends keyof SVGElementTagNameMap>(selector: K_3): SVGElementTagNameMap[K_3];
80
+ closest<E extends Element = Element>(selectors: string): E;
81
+ getAttribute(qualifiedName: string): string;
82
+ getAttributeNS(namespace: string, localName: string): string;
83
+ getAttributeNames(): string[];
84
+ getAttributeNode(qualifiedName: string): Attr;
85
+ getAttributeNodeNS(namespace: string, localName: string): Attr;
86
+ getBoundingClientRect(): DOMRect;
87
+ getClientRects(): DOMRectList;
88
+ getElementsByClassName(classNames: string): HTMLCollectionOf<Element>;
89
+ getElementsByTagName<K_4 extends keyof HTMLElementTagNameMap>(qualifiedName: K_4): HTMLCollectionOf<HTMLElementTagNameMap[K_4]>;
90
+ getElementsByTagName<K_5 extends keyof SVGElementTagNameMap>(qualifiedName: K_5): HTMLCollectionOf<SVGElementTagNameMap[K_5]>;
91
+ getElementsByTagName(qualifiedName: string): HTMLCollectionOf<Element>;
92
+ getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1999/xhtml", localName: string): HTMLCollectionOf<HTMLElement>;
93
+ getElementsByTagNameNS(namespaceURI: "http://www.w3.org/2000/svg", localName: string): HTMLCollectionOf<SVGElement>;
94
+ getElementsByTagNameNS(namespace: string, localName: string): HTMLCollectionOf<Element>;
95
+ hasAttribute(qualifiedName: string): boolean;
96
+ hasAttributeNS(namespace: string, localName: string): boolean;
97
+ hasAttributes(): boolean;
98
+ hasPointerCapture(pointerId: number): boolean;
99
+ insertAdjacentElement(where: InsertPosition, element: Element): Element;
100
+ insertAdjacentHTML(position: InsertPosition, text: string): void;
101
+ insertAdjacentText(where: InsertPosition, data: string): void;
102
+ matches(selectors: string): boolean;
103
+ releasePointerCapture(pointerId: number): void;
104
+ removeAttribute(qualifiedName: string): void;
105
+ removeAttributeNS(namespace: string, localName: string): void;
106
+ removeAttributeNode(attr: Attr): Attr;
107
+ requestFullscreen(options?: FullscreenOptions): Promise<void>;
108
+ requestPointerLock(): void;
109
+ scroll(options?: ScrollToOptions): void;
110
+ scroll(x: number, y: number): void;
111
+ scrollBy(options?: ScrollToOptions): void;
112
+ scrollBy(x: number, y: number): void;
113
+ scrollIntoView(arg?: boolean | ScrollIntoViewOptions): void;
114
+ scrollTo(options?: ScrollToOptions): void;
115
+ scrollTo(x: number, y: number): void;
116
+ setAttribute(qualifiedName: string, value: string): void;
117
+ setAttributeNS(namespace: string, qualifiedName: string, value: string): void;
118
+ setAttributeNode(attr: Attr): Attr;
119
+ setAttributeNodeNS(attr: Attr): Attr;
120
+ setPointerCapture(pointerId: number): void;
121
+ toggleAttribute(qualifiedName: string, force?: boolean): boolean;
122
+ webkitMatchesSelector(selectors: string): boolean;
123
+ readonly baseURI: string;
124
+ readonly childNodes: NodeListOf<ChildNode>;
125
+ readonly firstChild: ChildNode;
126
+ readonly isConnected: boolean;
127
+ readonly lastChild: ChildNode;
128
+ readonly nextSibling: ChildNode;
129
+ readonly nodeName: string;
130
+ readonly nodeType: number;
131
+ nodeValue: string;
132
+ readonly parentElement: HTMLElement;
133
+ readonly parentNode: ParentNode;
134
+ readonly previousSibling: ChildNode;
135
+ textContent: string;
136
+ appendChild<T_1 extends Node>(node: T_1): T_1;
137
+ compareDocumentPosition(other: Node): number;
138
+ contains(other: Node): boolean;
139
+ getRootNode(options?: GetRootNodeOptions): Node;
140
+ hasChildNodes(): boolean;
141
+ insertBefore<T_2 extends Node>(node: T_2, child: Node): T_2;
142
+ isDefaultNamespace(namespace: string): boolean;
143
+ isEqualNode(otherNode: Node): boolean;
144
+ isSameNode(otherNode: Node): boolean;
145
+ lookupNamespaceURI(prefix: string): string;
146
+ lookupPrefix(namespace: string): string;
147
+ normalize(): void;
148
+ removeChild<T_3 extends Node>(child: T_3): T_3;
149
+ replaceChild<T_4 extends Node>(node: Node, child: T_4): T_4;
150
+ readonly ATTRIBUTE_NODE: number;
151
+ readonly CDATA_SECTION_NODE: number;
152
+ readonly COMMENT_NODE: number;
153
+ readonly DOCUMENT_FRAGMENT_NODE: number;
154
+ readonly DOCUMENT_NODE: number;
155
+ readonly DOCUMENT_POSITION_CONTAINED_BY: number;
156
+ readonly DOCUMENT_POSITION_CONTAINS: number;
157
+ readonly DOCUMENT_POSITION_DISCONNECTED: number;
158
+ readonly DOCUMENT_POSITION_FOLLOWING: number;
159
+ readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: number;
160
+ readonly DOCUMENT_POSITION_PRECEDING: number;
161
+ readonly DOCUMENT_TYPE_NODE: number;
162
+ readonly ELEMENT_NODE: number;
163
+ readonly ENTITY_NODE: number;
164
+ readonly ENTITY_REFERENCE_NODE: number;
165
+ readonly NOTATION_NODE: number;
166
+ readonly PROCESSING_INSTRUCTION_NODE: number;
167
+ readonly TEXT_NODE: number;
168
+ dispatchEvent(event: Event): boolean;
169
+ ariaAtomic: string;
170
+ ariaAutoComplete: string;
171
+ ariaBusy: string;
172
+ ariaChecked: string;
173
+ ariaColCount: string;
174
+ ariaColIndex: string;
175
+ ariaColIndexText: string;
176
+ ariaColSpan: string;
177
+ ariaCurrent: string;
178
+ ariaDisabled: string;
179
+ ariaExpanded: string;
180
+ ariaHasPopup: string;
181
+ ariaHidden: string;
182
+ ariaInvalid: string;
183
+ ariaKeyShortcuts: string;
184
+ ariaLabel: string;
185
+ ariaLevel: string;
186
+ ariaLive: string;
187
+ ariaModal: string;
188
+ ariaMultiLine: string;
189
+ ariaMultiSelectable: string;
190
+ ariaOrientation: string;
191
+ ariaPlaceholder: string;
192
+ ariaPosInSet: string;
193
+ ariaPressed: string;
194
+ ariaReadOnly: string;
195
+ ariaRequired: string;
196
+ ariaRoleDescription: string;
197
+ ariaRowCount: string;
198
+ ariaRowIndex: string;
199
+ ariaRowIndexText: string;
200
+ ariaRowSpan: string;
201
+ ariaSelected: string;
202
+ ariaSetSize: string;
203
+ ariaSort: string;
204
+ ariaValueMax: string;
205
+ ariaValueMin: string;
206
+ ariaValueNow: string;
207
+ ariaValueText: string;
208
+ role: string;
209
+ animate(keyframes: PropertyIndexedKeyframes | Keyframe[], options?: number | KeyframeAnimationOptions): Animation;
210
+ getAnimations(options?: GetAnimationsOptions): Animation[];
211
+ after(...nodes: (string | Node)[]): void;
212
+ before(...nodes: (string | Node)[]): void;
213
+ remove(): void;
214
+ replaceWith(...nodes: (string | Node)[]): void;
215
+ innerHTML: string;
216
+ readonly nextElementSibling: Element;
217
+ readonly previousElementSibling: Element;
218
+ readonly childElementCount: number;
219
+ readonly children: HTMLCollection;
220
+ readonly firstElementChild: Element;
221
+ readonly lastElementChild: Element;
222
+ append(...nodes: (string | Node)[]): void;
223
+ prepend(...nodes: (string | Node)[]): void;
224
+ querySelector<K_6 extends keyof HTMLElementTagNameMap>(selectors: K_6): HTMLElementTagNameMap[K_6];
225
+ querySelector<K_7 extends keyof SVGElementTagNameMap>(selectors: K_7): SVGElementTagNameMap[K_7];
226
+ querySelector<E_1 extends Element = Element>(selectors: string): E_1;
227
+ querySelectorAll<K_8 extends keyof HTMLElementTagNameMap>(selectors: K_8): NodeListOf<HTMLElementTagNameMap[K_8]>;
228
+ querySelectorAll<K_9 extends keyof SVGElementTagNameMap>(selectors: K_9): NodeListOf<SVGElementTagNameMap[K_9]>;
229
+ querySelectorAll<E_2 extends Element = Element>(selectors: string): NodeListOf<E_2>;
230
+ replaceChildren(...nodes: (string | Node)[]): void;
231
+ readonly assignedSlot: HTMLSlotElement;
232
+ oncopy: (this: DocumentAndElementEventHandlers, ev: ClipboardEvent) => any;
233
+ oncut: (this: DocumentAndElementEventHandlers, ev: ClipboardEvent) => any;
234
+ onpaste: (this: DocumentAndElementEventHandlers, ev: ClipboardEvent) => any;
235
+ readonly style: CSSStyleDeclaration;
236
+ contentEditable: string;
237
+ enterKeyHint: string;
238
+ inputMode: string;
239
+ readonly isContentEditable: boolean;
240
+ onabort: (this: GlobalEventHandlers, ev: UIEvent) => any;
241
+ onanimationcancel: (this: GlobalEventHandlers, ev: AnimationEvent) => any;
242
+ onanimationend: (this: GlobalEventHandlers, ev: AnimationEvent) => any;
243
+ onanimationiteration: (this: GlobalEventHandlers, ev: AnimationEvent) => any;
244
+ onanimationstart: (this: GlobalEventHandlers, ev: AnimationEvent) => any;
245
+ onauxclick: (this: GlobalEventHandlers, ev: MouseEvent) => any;
246
+ onbeforeinput: (this: GlobalEventHandlers, ev: InputEvent) => any;
247
+ onblur: (this: GlobalEventHandlers, ev: FocusEvent) => any;
248
+ oncancel: (this: GlobalEventHandlers, ev: Event) => any;
249
+ oncanplay: (this: GlobalEventHandlers, ev: Event) => any;
250
+ oncanplaythrough: (this: GlobalEventHandlers, ev: Event) => any;
251
+ onchange: (this: GlobalEventHandlers, ev: Event) => any;
252
+ onclick: (this: GlobalEventHandlers, ev: MouseEvent) => any;
253
+ onclose: (this: GlobalEventHandlers, ev: Event) => any;
254
+ oncontextmenu: (this: GlobalEventHandlers, ev: MouseEvent) => any;
255
+ oncuechange: (this: GlobalEventHandlers, ev: Event) => any;
256
+ ondblclick: (this: GlobalEventHandlers, ev: MouseEvent) => any;
257
+ ondrag: (this: GlobalEventHandlers, ev: DragEvent) => any;
258
+ ondragend: (this: GlobalEventHandlers, ev: DragEvent) => any;
259
+ ondragenter: (this: GlobalEventHandlers, ev: DragEvent) => any;
260
+ ondragleave: (this: GlobalEventHandlers, ev: DragEvent) => any;
261
+ ondragover: (this: GlobalEventHandlers, ev: DragEvent) => any;
262
+ ondragstart: (this: GlobalEventHandlers, ev: DragEvent) => any;
263
+ ondrop: (this: GlobalEventHandlers, ev: DragEvent) => any;
264
+ ondurationchange: (this: GlobalEventHandlers, ev: Event) => any;
265
+ onemptied: (this: GlobalEventHandlers, ev: Event) => any;
266
+ onended: (this: GlobalEventHandlers, ev: Event) => any;
267
+ onerror: OnErrorEventHandlerNonNull;
268
+ onfocus: (this: GlobalEventHandlers, ev: FocusEvent) => any;
269
+ onformdata: (this: GlobalEventHandlers, ev: FormDataEvent) => any;
270
+ ongotpointercapture: (this: GlobalEventHandlers, ev: PointerEvent) => any;
271
+ oninput: (this: GlobalEventHandlers, ev: Event) => any;
272
+ oninvalid: (this: GlobalEventHandlers, ev: Event) => any;
273
+ onkeydown: (this: GlobalEventHandlers, ev: KeyboardEvent) => any;
274
+ onkeypress: (this: GlobalEventHandlers, ev: KeyboardEvent) => any;
275
+ onkeyup: (this: GlobalEventHandlers, ev: KeyboardEvent) => any;
276
+ onload: (this: GlobalEventHandlers, ev: Event) => any;
277
+ onloadeddata: (this: GlobalEventHandlers, ev: Event) => any;
278
+ onloadedmetadata: (this: GlobalEventHandlers, ev: Event) => any;
279
+ onloadstart: (this: GlobalEventHandlers, ev: Event) => any;
280
+ onlostpointercapture: (this: GlobalEventHandlers, ev: PointerEvent) => any;
281
+ onmousedown: (this: GlobalEventHandlers, ev: MouseEvent) => any;
282
+ onmouseenter: (this: GlobalEventHandlers, ev: MouseEvent) => any;
283
+ onmouseleave: (this: GlobalEventHandlers, ev: MouseEvent) => any;
284
+ onmousemove: (this: GlobalEventHandlers, ev: MouseEvent) => any;
285
+ onmouseout: (this: GlobalEventHandlers, ev: MouseEvent) => any;
286
+ onmouseover: (this: GlobalEventHandlers, ev: MouseEvent) => any;
287
+ onmouseup: (this: GlobalEventHandlers, ev: MouseEvent) => any;
288
+ onpause: (this: GlobalEventHandlers, ev: Event) => any;
289
+ onplay: (this: GlobalEventHandlers, ev: Event) => any;
290
+ onplaying: (this: GlobalEventHandlers, ev: Event) => any;
291
+ onpointercancel: (this: GlobalEventHandlers, ev: PointerEvent) => any;
292
+ onpointerdown: (this: GlobalEventHandlers, ev: PointerEvent) => any;
293
+ onpointerenter: (this: GlobalEventHandlers, ev: PointerEvent) => any;
294
+ onpointerleave: (this: GlobalEventHandlers, ev: PointerEvent) => any;
295
+ onpointermove: (this: GlobalEventHandlers, ev: PointerEvent) => any;
296
+ onpointerout: (this: GlobalEventHandlers, ev: PointerEvent) => any;
297
+ onpointerover: (this: GlobalEventHandlers, ev: PointerEvent) => any;
298
+ onpointerup: (this: GlobalEventHandlers, ev: PointerEvent) => any;
299
+ onprogress: (this: GlobalEventHandlers, ev: ProgressEvent<EventTarget>) => any;
300
+ onratechange: (this: GlobalEventHandlers, ev: Event) => any;
301
+ onreset: (this: GlobalEventHandlers, ev: Event) => any;
302
+ onresize: (this: GlobalEventHandlers, ev: UIEvent) => any;
303
+ onscroll: (this: GlobalEventHandlers, ev: Event) => any;
304
+ onsecuritypolicyviolation: (this: GlobalEventHandlers, ev: SecurityPolicyViolationEvent) => any;
305
+ onseeked: (this: GlobalEventHandlers, ev: Event) => any;
306
+ onseeking: (this: GlobalEventHandlers, ev: Event) => any;
307
+ onselect: (this: GlobalEventHandlers, ev: Event) => any;
308
+ onselectionchange: (this: GlobalEventHandlers, ev: Event) => any;
309
+ onselectstart: (this: GlobalEventHandlers, ev: Event) => any;
310
+ onslotchange: (this: GlobalEventHandlers, ev: Event) => any;
311
+ onstalled: (this: GlobalEventHandlers, ev: Event) => any;
312
+ onsubmit: (this: GlobalEventHandlers, ev: SubmitEvent) => any;
313
+ onsuspend: (this: GlobalEventHandlers, ev: Event) => any;
314
+ ontimeupdate: (this: GlobalEventHandlers, ev: Event) => any;
315
+ ontoggle: (this: GlobalEventHandlers, ev: Event) => any;
316
+ ontouchcancel?: (this: GlobalEventHandlers, ev: TouchEvent) => any;
317
+ ontouchend?: (this: GlobalEventHandlers, ev: TouchEvent) => any;
318
+ ontouchmove?: (this: GlobalEventHandlers, ev: TouchEvent) => any;
319
+ ontouchstart?: (this: GlobalEventHandlers, ev: TouchEvent) => any;
320
+ ontransitioncancel: (this: GlobalEventHandlers, ev: TransitionEvent) => any;
321
+ ontransitionend: (this: GlobalEventHandlers, ev: TransitionEvent) => any;
322
+ ontransitionrun: (this: GlobalEventHandlers, ev: TransitionEvent) => any;
323
+ ontransitionstart: (this: GlobalEventHandlers, ev: TransitionEvent) => any;
324
+ onvolumechange: (this: GlobalEventHandlers, ev: Event) => any;
325
+ onwaiting: (this: GlobalEventHandlers, ev: Event) => any;
326
+ onwebkitanimationend: (this: GlobalEventHandlers, ev: Event) => any;
327
+ onwebkitanimationiteration: (this: GlobalEventHandlers, ev: Event) => any;
328
+ onwebkitanimationstart: (this: GlobalEventHandlers, ev: Event) => any;
329
+ onwebkittransitionend: (this: GlobalEventHandlers, ev: Event) => any;
330
+ onwheel: (this: GlobalEventHandlers, ev: WheelEvent) => any;
331
+ autofocus: boolean;
332
+ readonly dataset: DOMStringMap;
333
+ nonce?: string;
334
+ tabIndex: number;
335
+ blur(): void;
336
+ focus(options?: FocusOptions): void;
337
+ }) & typeof FoundationElement;
338
+ export declare class Fdc3SystemChannelListener extends Fdc3SystemChannelListener_base {
339
+ config: SystemChannelListenerConfig[];
340
+ fdc3: FDC3;
341
+ deepClone(): Node;
342
+ connectedCallback(): void;
343
+ private channelSub;
344
+ protected addChannelListeners(): void;
345
+ disconnectedCallback(): void;
346
+ }
347
+ export {};
348
+ //# sourceMappingURL=fdc3-system-channel-listener.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fdc3-system-channel-listener.d.ts","sourceRoot":"","sources":["../../../src/util/fdc3-system-channel-listener.ts"],"names":[],"mappings":"AACA,OAAO,EAAiB,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAEzE,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAE/B;;;;;GAKG;AACH,MAAM,WAAW,2BAA2B;IAC1C,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,CAAC,GAAG,KAAA,KAAK,IAAI,CAAC;CACzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAED,qBAGa,yBAA0B,SAAQ,8BAAiC;IAC9E,MAAM,EAAE,2BAA2B,EAAE,CAAM;IAErC,IAAI,EAAE,IAAI,CAAC;IAER,SAAS,IAAI,IAAI;IAgB1B,iBAAiB;IAUjB,OAAO,CAAC,UAAU,CAAsB;IAExC,SAAS,CAAC,mBAAmB,IAAI,IAAI;IAarC,oBAAoB;CAIrB"}
@@ -1,3 +1,2 @@
1
1
  export * from './fdc3-raise-intent';
2
- export * from './fdc3-listener';
3
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/util/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/util/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC"}
@@ -14,7 +14,12 @@ let Fdc3ChannelEvent = class Fdc3ChannelEvent extends LifecycleMixin(FoundationE
14
14
  if (this.mappingFunction && typeof this.mappingFunction === 'function') {
15
15
  payload = this.mappingFunction(payload);
16
16
  }
17
- yield this.fdc3.broadcastOnChannel(this.channelName, this.channelType, payload);
17
+ if (this.channelName) {
18
+ yield this.fdc3.broadcastOnChannel(this.channelName, this.channelType, payload);
19
+ }
20
+ else {
21
+ yield this.fdc3.broadcastOnCurrentChannel(payload, this.channelType);
22
+ }
18
23
  });
19
24
  }
20
25
  connectedCallback() {
package/dist/esm/fdc3.js CHANGED
@@ -2,9 +2,10 @@ import { __awaiter, __decorate } from "tslib";
2
2
  /**
3
3
  * See https://fdc3.finos.org/docs/fdc3-intro, and https://github.com/finos/FDC3/tree/master/src/api
4
4
  */
5
- import { addIntentListener, fdc3Ready, findIntent, findIntentsByContext, getCurrentChannel, getOrCreateChannel, getInfo, joinChannel, raiseIntent, raiseIntentForContext, versionIsAtLeast, } from '@finos/fdc3';
5
+ import { addIntentListener, fdc3Ready, findIntent, findIntentsByContext, getCurrentChannel, getOrCreateChannel, joinChannel, raiseIntent, raiseIntentForContext, } from '@finos/fdc3';
6
6
  import { observable } from '@microsoft/fast-element';
7
7
  import { DI } from '@microsoft/fast-foundation';
8
+ import { ReplaySubject } from 'rxjs';
8
9
  import { stripOutBigInt } from './util/fdc3-util';
9
10
  import { logger } from './utils';
10
11
  /**
@@ -14,14 +15,26 @@ import { logger } from './utils';
14
15
  export class DefaultFDC3 {
15
16
  constructor() {
16
17
  this.isReady = false;
17
- this.connect();
18
+ this._isReady$ = new ReplaySubject();
19
+ this.isReady$ = this._isReady$.asObservable();
20
+ this._currentChannel$ = new ReplaySubject();
21
+ this.currentChannel$ = this._currentChannel$.asObservable();
22
+ this.isInteropFdc3 = () => !!window.io;
23
+ this.init();
18
24
  }
19
- connect() {
25
+ init() {
20
26
  return __awaiter(this, void 0, void 0, function* () {
27
+ if (this.isReady) {
28
+ logger.debug('fdc3 already connected');
29
+ return;
30
+ }
21
31
  try {
22
- this.isReady = false;
23
32
  yield fdc3Ready();
33
+ this.isReady = true;
34
+ this._isReady$.next(true);
24
35
  logger.debug('fdc3 connection success');
36
+ yield this.getAndUpdateCurrentChannel();
37
+ yield this.handleInteropChannelChanges();
25
38
  }
26
39
  catch (err) {
27
40
  logger.error('fdc3 connection error', err);
@@ -43,20 +56,32 @@ export class DefaultFDC3 {
43
56
  logger.debug(`fdc3 findIntentsByContext '${context}'`);
44
57
  return findIntentsByContext(context);
45
58
  }
46
- raiseIntent(context, intent) {
47
- if (getInfo && versionIsAtLeast(getInfo(), '1.2')) {
59
+ raiseIntentForContext(context) {
60
+ return __awaiter(this, void 0, void 0, function* () {
48
61
  logger.debug(`fdc3 raiseIntentForContext '${context}'`);
49
62
  return raiseIntentForContext(context);
50
- }
63
+ });
64
+ }
65
+ raiseIntent(context, intent) {
51
66
  if (intent) {
52
67
  logger.debug(`fdc3 raiseIntent '${intent}' '${context}'`);
53
68
  return raiseIntent(intent, context);
54
69
  }
55
- logger.error(`fdc3 unable to raiseIntent using context '${context}' and intent '${intent}'.`);
70
+ else {
71
+ logger.warn(`fdc3 raiseIntent - no intent passed`);
72
+ }
56
73
  }
57
74
  joinChannel(channelId) {
58
- logger.debug(`fdc3 joinChannel '${channelId}'`);
59
- return joinChannel(channelId);
75
+ var _a;
76
+ return __awaiter(this, void 0, void 0, function* () {
77
+ logger.debug(`fdc3 joinChannel '${channelId}'`);
78
+ if (((_a = this._currentChannel) === null || _a === void 0 ? void 0 : _a.id) === channelId) {
79
+ return;
80
+ }
81
+ yield joinChannel(channelId);
82
+ yield this.getAndUpdateCurrentChannel();
83
+ return;
84
+ });
60
85
  }
61
86
  getOrCreateChannel(channelId) {
62
87
  logger.debug(`fdc3 getOrCreateChannel '${channelId}'`);
@@ -65,12 +90,15 @@ export class DefaultFDC3 {
65
90
  broadcastOnChannel(channelName, type, payload) {
66
91
  return __awaiter(this, void 0, void 0, function* () {
67
92
  const channel = yield getOrCreateChannel(channelName);
68
- payload = stripOutBigInt(payload);
69
- const m = {
70
- type,
71
- id: payload,
72
- };
73
- channel.broadcast(m);
93
+ this.broadcastMessageOnChannel(channel, payload, type);
94
+ });
95
+ }
96
+ broadcastOnCurrentChannel(payload, type) {
97
+ return __awaiter(this, void 0, void 0, function* () {
98
+ const channel = yield getCurrentChannel();
99
+ if (channel) {
100
+ this.broadcastMessageOnChannel(channel, payload, type);
101
+ }
74
102
  });
75
103
  }
76
104
  broadcastOnChannelEventHandler(channelName, type) {
@@ -90,11 +118,66 @@ export class DefaultFDC3 {
90
118
  return channel;
91
119
  });
92
120
  }
121
+ addSystemChannelListener(channelType, callback) {
122
+ return __awaiter(this, void 0, void 0, function* () {
123
+ const channel = yield getCurrentChannel();
124
+ channel.addContextListener(channelType, callback);
125
+ });
126
+ }
93
127
  getCurrentChannel() {
94
128
  return __awaiter(this, void 0, void 0, function* () {
95
129
  return getCurrentChannel();
96
130
  });
97
131
  }
132
+ handleChannelCurrentContext(channel, contextType, listenerCallback) {
133
+ return __awaiter(this, void 0, void 0, function* () {
134
+ const currentContextValue = yield channel.getCurrentContext(contextType);
135
+ if (currentContextValue) {
136
+ listenerCallback(currentContextValue);
137
+ }
138
+ });
139
+ }
140
+ broadcastMessageOnChannel(channel, payload, type) {
141
+ payload = stripOutBigInt(payload);
142
+ const context = {
143
+ type,
144
+ id: payload,
145
+ };
146
+ channel.broadcast(context);
147
+ }
148
+ getAndUpdateCurrentChannel() {
149
+ return __awaiter(this, void 0, void 0, function* () {
150
+ try {
151
+ const channel = yield getCurrentChannel();
152
+ if (channel) {
153
+ logger.debug(`fdc3 getCurrentChannel '${channel.id}'`);
154
+ this._currentChannel = channel;
155
+ this._currentChannel$.next(channel);
156
+ }
157
+ }
158
+ catch (err) {
159
+ logger.error('fdc3 getCurrentChannel error', err);
160
+ }
161
+ });
162
+ }
163
+ handleInteropChannelChanges() {
164
+ var _a, _b;
165
+ return __awaiter(this, void 0, void 0, function* () {
166
+ if (this.isInteropFdc3()) {
167
+ // Listen to changes from the io channel selector.
168
+ // This can be done on the interop container window which is outside this app scope
169
+ // Any changes made there will be emitted here and keep channel state in sync
170
+ (_b = (_a = window.io) === null || _a === void 0 ? void 0 : _a.channels) === null || _b === void 0 ? void 0 : _b.onChanged((channelColor) => __awaiter(this, void 0, void 0, function* () {
171
+ var _c, _d;
172
+ if (((_d = (_c = this._currentChannel) === null || _c === void 0 ? void 0 : _c.displayMetadata) === null || _d === void 0 ? void 0 : _d.color) === channelColor) {
173
+ return;
174
+ }
175
+ logger.debug(`fdc3 interop.io channel changed '${channelColor}'`);
176
+ yield this.getAndUpdateCurrentChannel();
177
+ }));
178
+ }
179
+ });
180
+ }
98
181
  }
99
182
  __decorate([
100
183
  observable
package/dist/esm/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ window.io = window.io || null;
1
2
  export * from './fdc3';
2
3
  export * from './fdc3-channel-event';
3
4
  export * from './util';
@@ -1,43 +1,23 @@
1
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';
2
+ import { customElement } from '@genesislcap/web-core';
3
+ import { Fdc3SystemChannelListener, } from './fdc3-system-channel-listener';
5
4
  /**
6
- * fdc3-context-listener listen to channel context
5
+ * fdc3-context-listener listen to app channel context
7
6
  * @alpha
8
7
  */
9
- let Fdc3ContextListener = class Fdc3ContextListener extends LifecycleMixin(FoundationElement) {
8
+ let Fdc3ContextListener = class Fdc3ContextListener extends Fdc3SystemChannelListener {
10
9
  constructor() {
11
10
  super(...arguments);
12
11
  this.config = [];
13
12
  }
14
- deepClone() {
15
- const copy = super.deepClone();
16
- if (this.config) {
17
- copy.config = this.config.map((c) => {
18
- const copyConfig = Object.assign({}, c);
19
- if (c.callback) {
20
- copyConfig.callback = c.callback.bind(this);
21
- }
22
- return copyConfig;
23
- });
24
- }
25
- return copy;
26
- }
27
- connectedCallback() {
28
- super.connectedCallback();
29
- if (window.fdc3) {
30
- this.config.forEach((c) => this.fdc3.addChannelListener(null, c.channelType, (message) => {
31
- if (message.type === c.channelType) {
32
- c.callback(message);
33
- }
34
- }));
35
- }
13
+ addChannelListeners() {
14
+ this.config.forEach((c) => this.fdc3.addChannelListener(null, c.channelType, (message) => {
15
+ if (message.type === c.channelType) {
16
+ c.callback(message);
17
+ }
18
+ }));
36
19
  }
37
20
  };
38
- __decorate([
39
- FDC3
40
- ], Fdc3ContextListener.prototype, "fdc3", void 0);
41
21
  Fdc3ContextListener = __decorate([
42
22
  customElement({
43
23
  name: 'fdc3-context-listener',
@@ -0,0 +1,48 @@
1
+ import { __awaiter, __decorate } from "tslib";
2
+ import { LifecycleMixin } from '@genesislcap/foundation-utils';
3
+ import { customElement, FoundationElement } from '@genesislcap/web-core';
4
+ import { first } from 'rxjs';
5
+ import { FDC3 } from '../fdc3';
6
+ let Fdc3IntentListener = class Fdc3IntentListener extends LifecycleMixin(FoundationElement) {
7
+ constructor() {
8
+ super(...arguments);
9
+ this.intentConfig = [];
10
+ }
11
+ connectedCallback() {
12
+ super.connectedCallback();
13
+ this.fdc3.isReady$.pipe(first()).subscribe(() => __awaiter(this, void 0, void 0, function* () {
14
+ if (this.intentConfig) {
15
+ this.addIntentListeners(this.intentConfig);
16
+ }
17
+ }));
18
+ }
19
+ deepClone() {
20
+ const copy = super.deepClone();
21
+ if (this.intentConfig) {
22
+ copy.intentConfig = this.intentConfig.map((c) => {
23
+ const copyConfig = Object.assign({}, c);
24
+ if (c.callback) {
25
+ copyConfig.callback = c.callback.bind(this);
26
+ }
27
+ return copyConfig;
28
+ });
29
+ }
30
+ return copy;
31
+ }
32
+ addIntentListeners(intentConfig) {
33
+ const intentListeners = intentConfig.reduce((listenerMap, intent) => {
34
+ listenerMap.set(intent.intent, intent.callback);
35
+ return listenerMap;
36
+ }, new Map());
37
+ this.fdc3.addIntentListeners(intentListeners);
38
+ }
39
+ };
40
+ __decorate([
41
+ FDC3
42
+ ], Fdc3IntentListener.prototype, "fdc3", void 0);
43
+ Fdc3IntentListener = __decorate([
44
+ customElement({
45
+ name: 'fdc3-intent-listener',
46
+ })
47
+ ], Fdc3IntentListener);
48
+ export { Fdc3IntentListener };