@openfin/core 45.101.1 → 45.102.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.
@@ -0,0 +1,71 @@
1
+ export declare type DefaultColorChannelId = keyof typeof defaultColorChannels;
2
+
3
+ /**
4
+ * The default FDC3 user channels advertised by the Interop Broker.
5
+ */
6
+ export declare const defaultColorChannels: {
7
+ readonly 'fdc3.channel.1': {
8
+ readonly name: "Channel 1";
9
+ readonly color: "red";
10
+ readonly glyph: "1";
11
+ };
12
+ readonly 'fdc3.channel.2': {
13
+ readonly name: "Channel 2";
14
+ readonly color: "orange";
15
+ readonly glyph: "2";
16
+ };
17
+ readonly 'fdc3.channel.3': {
18
+ readonly name: "Channel 3";
19
+ readonly color: "yellow";
20
+ readonly glyph: "3";
21
+ };
22
+ readonly 'fdc3.channel.4': {
23
+ readonly name: "Channel 4";
24
+ readonly color: "green";
25
+ readonly glyph: "4";
26
+ };
27
+ readonly 'fdc3.channel.5': {
28
+ readonly name: "Channel 5";
29
+ readonly color: "cyan";
30
+ readonly glyph: "5";
31
+ };
32
+ readonly 'fdc3.channel.6': {
33
+ readonly name: "Channel 6";
34
+ readonly color: "blue";
35
+ readonly glyph: "6";
36
+ };
37
+ readonly 'fdc3.channel.7': {
38
+ readonly name: "Channel 7";
39
+ readonly color: "magenta";
40
+ readonly glyph: "7";
41
+ };
42
+ readonly 'fdc3.channel.8': {
43
+ readonly name: "Channel 8";
44
+ readonly color: "purple";
45
+ readonly glyph: "8";
46
+ };
47
+ };
48
+
49
+ declare type LegacyColorChannelId = keyof typeof legacyColorChannelIds;
50
+
51
+ declare const legacyColorChannelIds: {
52
+ readonly red: "fdc3.channel.1";
53
+ readonly orange: "fdc3.channel.2";
54
+ readonly yellow: "fdc3.channel.3";
55
+ readonly green: "fdc3.channel.4";
56
+ readonly teal: "fdc3.channel.5";
57
+ readonly blue: "fdc3.channel.6";
58
+ readonly pink: "fdc3.channel.7";
59
+ readonly indigo: "fdc3.channel.8";
60
+ readonly purple: "fdc3.channel.8";
61
+ };
62
+
63
+ /**
64
+ * Converts a legacy color-named channel ID to its canonical FDC3 user-channel ID.
65
+ * The removed legacy gray channel resolves to no channel.
66
+ */
67
+ export declare function normalizeColorChannelId<T extends string>(colorChannelId: T): NormalizedColorChannelId<T>;
68
+
69
+ declare type NormalizedColorChannelId<T extends string> = string extends T ? string | undefined : T extends 'gray' ? undefined : T extends LegacyColorChannelId ? (typeof legacyColorChannelIds)[T] : T;
70
+
71
+ export { }
@@ -0,0 +1,43 @@
1
+ 'use strict';
2
+
3
+ /**
4
+ * The default FDC3 user channels advertised by the Interop Broker.
5
+ */
6
+ const defaultColorChannels = {
7
+ 'fdc3.channel.1': { name: 'Channel 1', color: 'red', glyph: '1' },
8
+ 'fdc3.channel.2': { name: 'Channel 2', color: 'orange', glyph: '2' },
9
+ 'fdc3.channel.3': { name: 'Channel 3', color: 'yellow', glyph: '3' },
10
+ 'fdc3.channel.4': { name: 'Channel 4', color: 'green', glyph: '4' },
11
+ 'fdc3.channel.5': { name: 'Channel 5', color: 'cyan', glyph: '5' },
12
+ 'fdc3.channel.6': { name: 'Channel 6', color: 'blue', glyph: '6' },
13
+ 'fdc3.channel.7': { name: 'Channel 7', color: 'magenta', glyph: '7' },
14
+ 'fdc3.channel.8': { name: 'Channel 8', color: 'purple', glyph: '8' }
15
+ };
16
+ const legacyColorChannelIds = {
17
+ red: 'fdc3.channel.1',
18
+ orange: 'fdc3.channel.2',
19
+ yellow: 'fdc3.channel.3',
20
+ green: 'fdc3.channel.4',
21
+ teal: 'fdc3.channel.5',
22
+ blue: 'fdc3.channel.6',
23
+ pink: 'fdc3.channel.7',
24
+ // Legacy indigo (workspace) and purple (core) intentionally converge on the same FDC3 purple channel.
25
+ indigo: 'fdc3.channel.8',
26
+ purple: 'fdc3.channel.8'
27
+ };
28
+ /**
29
+ * Converts a legacy color-named channel ID to its canonical FDC3 user-channel ID.
30
+ * The removed legacy gray channel resolves to no channel.
31
+ */
32
+ function normalizeColorChannelId(colorChannelId) {
33
+ if (colorChannelId === 'gray') {
34
+ return undefined;
35
+ }
36
+ if (Object.prototype.hasOwnProperty.call(legacyColorChannelIds, colorChannelId)) {
37
+ return legacyColorChannelIds[colorChannelId];
38
+ }
39
+ return colorChannelId;
40
+ }
41
+
42
+ exports.defaultColorChannels = defaultColorChannels;
43
+ exports.normalizeColorChannelId = normalizeColorChannelId;
@@ -0,0 +1,40 @@
1
+ /**
2
+ * The default FDC3 user channels advertised by the Interop Broker.
3
+ */
4
+ const defaultColorChannels = {
5
+ 'fdc3.channel.1': { name: 'Channel 1', color: 'red', glyph: '1' },
6
+ 'fdc3.channel.2': { name: 'Channel 2', color: 'orange', glyph: '2' },
7
+ 'fdc3.channel.3': { name: 'Channel 3', color: 'yellow', glyph: '3' },
8
+ 'fdc3.channel.4': { name: 'Channel 4', color: 'green', glyph: '4' },
9
+ 'fdc3.channel.5': { name: 'Channel 5', color: 'cyan', glyph: '5' },
10
+ 'fdc3.channel.6': { name: 'Channel 6', color: 'blue', glyph: '6' },
11
+ 'fdc3.channel.7': { name: 'Channel 7', color: 'magenta', glyph: '7' },
12
+ 'fdc3.channel.8': { name: 'Channel 8', color: 'purple', glyph: '8' }
13
+ };
14
+ const legacyColorChannelIds = {
15
+ red: 'fdc3.channel.1',
16
+ orange: 'fdc3.channel.2',
17
+ yellow: 'fdc3.channel.3',
18
+ green: 'fdc3.channel.4',
19
+ teal: 'fdc3.channel.5',
20
+ blue: 'fdc3.channel.6',
21
+ pink: 'fdc3.channel.7',
22
+ // Legacy indigo (workspace) and purple (core) intentionally converge on the same FDC3 purple channel.
23
+ indigo: 'fdc3.channel.8',
24
+ purple: 'fdc3.channel.8'
25
+ };
26
+ /**
27
+ * Converts a legacy color-named channel ID to its canonical FDC3 user-channel ID.
28
+ * The removed legacy gray channel resolves to no channel.
29
+ */
30
+ function normalizeColorChannelId(colorChannelId) {
31
+ if (colorChannelId === 'gray') {
32
+ return undefined;
33
+ }
34
+ if (Object.prototype.hasOwnProperty.call(legacyColorChannelIds, colorChannelId)) {
35
+ return legacyColorChannelIds[colorChannelId];
36
+ }
37
+ return colorChannelId;
38
+ }
39
+
40
+ export { defaultColorChannels, normalizeColorChannelId };
@@ -2000,6 +2000,8 @@ declare type BeginUserBoundsChangingEvent = UserBoundsChangeEvent & {
2000
2000
  type: 'begin-user-bounds-changing';
2001
2001
  };
2002
2002
 
2003
+ declare type BFCacheRestoreListener = () => void | Promise<void>;
2004
+
2003
2005
  /**
2004
2006
  * A rule prescribing content creation that should be blocked.
2005
2007
  *
@@ -5387,6 +5389,16 @@ declare interface Environment {
5387
5389
  resolveLayout(layoutManager: OpenFin_2.LayoutManager<OpenFin_2.LayoutSnapshot>, layoutIdentity: OpenFin_2.LayoutIdentity): Promise<any>;
5388
5390
  initPlatform(fin: OpenFin_2.Fin<OpenFin_2.EntityType>, ...args: Parameters<OpenFin_2.Fin['Platform']['init']>): ReturnType<OpenFin_2.Fin['Platform']['init']>;
5389
5391
  observeBounds(element: Element, onChange: (bounds: DOMRect) => Promise<void> | void): () => void;
5392
+ /**
5393
+ * Registers a listener invoked when the current page has been restored from the
5394
+ * browser's back/forward cache. Stateful APIs (e.g. channels) use this to re-establish
5395
+ * connections that were torn down while the page was cached.
5396
+ *
5397
+ * No-op in environments that cannot be bfcached.
5398
+ *
5399
+ * @returns a function that unregisters the listener.
5400
+ */
5401
+ onBFCacheRestore(listener: BFCacheRestoreListener): () => void;
5390
5402
  writeToken(path: string, token: string): Promise<string>;
5391
5403
  retrievePort(config: NewConnectConfig): Promise<number>;
5392
5404
  getNextMessageId(): any;
@@ -2000,6 +2000,8 @@ declare type BeginUserBoundsChangingEvent = UserBoundsChangeEvent & {
2000
2000
  type: 'begin-user-bounds-changing';
2001
2001
  };
2002
2002
 
2003
+ declare type BFCacheRestoreListener = () => void | Promise<void>;
2004
+
2003
2005
  /**
2004
2006
  * A rule prescribing content creation that should be blocked.
2005
2007
  *
@@ -5387,6 +5389,16 @@ declare interface Environment {
5387
5389
  resolveLayout(layoutManager: OpenFin_2.LayoutManager<OpenFin_2.LayoutSnapshot>, layoutIdentity: OpenFin_2.LayoutIdentity): Promise<any>;
5388
5390
  initPlatform(fin: OpenFin_2.Fin<OpenFin_2.EntityType>, ...args: Parameters<OpenFin_2.Fin['Platform']['init']>): ReturnType<OpenFin_2.Fin['Platform']['init']>;
5389
5391
  observeBounds(element: Element, onChange: (bounds: DOMRect) => Promise<void> | void): () => void;
5392
+ /**
5393
+ * Registers a listener invoked when the current page has been restored from the
5394
+ * browser's back/forward cache. Stateful APIs (e.g. channels) use this to re-establish
5395
+ * connections that were torn down while the page was cached.
5396
+ *
5397
+ * No-op in environments that cannot be bfcached.
5398
+ *
5399
+ * @returns a function that unregisters the listener.
5400
+ */
5401
+ onBFCacheRestore(listener: BFCacheRestoreListener): () => void;
5390
5402
  writeToken(path: string, token: string): Promise<string>;
5391
5403
  retrievePort(config: NewConnectConfig): Promise<number>;
5392
5404
  getNextMessageId(): any;
@@ -0,0 +1,71 @@
1
+ export declare type DefaultColorChannelId = keyof typeof defaultColorChannels;
2
+
3
+ /**
4
+ * The default FDC3 user channels advertised by the Interop Broker.
5
+ */
6
+ export declare const defaultColorChannels: {
7
+ readonly 'fdc3.channel.1': {
8
+ readonly name: "Channel 1";
9
+ readonly color: "red";
10
+ readonly glyph: "1";
11
+ };
12
+ readonly 'fdc3.channel.2': {
13
+ readonly name: "Channel 2";
14
+ readonly color: "orange";
15
+ readonly glyph: "2";
16
+ };
17
+ readonly 'fdc3.channel.3': {
18
+ readonly name: "Channel 3";
19
+ readonly color: "yellow";
20
+ readonly glyph: "3";
21
+ };
22
+ readonly 'fdc3.channel.4': {
23
+ readonly name: "Channel 4";
24
+ readonly color: "green";
25
+ readonly glyph: "4";
26
+ };
27
+ readonly 'fdc3.channel.5': {
28
+ readonly name: "Channel 5";
29
+ readonly color: "cyan";
30
+ readonly glyph: "5";
31
+ };
32
+ readonly 'fdc3.channel.6': {
33
+ readonly name: "Channel 6";
34
+ readonly color: "blue";
35
+ readonly glyph: "6";
36
+ };
37
+ readonly 'fdc3.channel.7': {
38
+ readonly name: "Channel 7";
39
+ readonly color: "magenta";
40
+ readonly glyph: "7";
41
+ };
42
+ readonly 'fdc3.channel.8': {
43
+ readonly name: "Channel 8";
44
+ readonly color: "purple";
45
+ readonly glyph: "8";
46
+ };
47
+ };
48
+
49
+ declare type LegacyColorChannelId = keyof typeof legacyColorChannelIds;
50
+
51
+ declare const legacyColorChannelIds: {
52
+ readonly red: "fdc3.channel.1";
53
+ readonly orange: "fdc3.channel.2";
54
+ readonly yellow: "fdc3.channel.3";
55
+ readonly green: "fdc3.channel.4";
56
+ readonly teal: "fdc3.channel.5";
57
+ readonly blue: "fdc3.channel.6";
58
+ readonly pink: "fdc3.channel.7";
59
+ readonly indigo: "fdc3.channel.8";
60
+ readonly purple: "fdc3.channel.8";
61
+ };
62
+
63
+ /**
64
+ * Converts a legacy color-named channel ID to its canonical FDC3 user-channel ID.
65
+ * The removed legacy gray channel resolves to no channel.
66
+ */
67
+ export declare function normalizeColorChannelId<T extends string>(colorChannelId: T): NormalizedColorChannelId<T>;
68
+
69
+ declare type NormalizedColorChannelId<T extends string> = string extends T ? string | undefined : T extends 'gray' ? undefined : T extends LegacyColorChannelId ? (typeof legacyColorChannelIds)[T] : T;
70
+
71
+ export { }
@@ -0,0 +1,71 @@
1
+ export declare type DefaultColorChannelId = keyof typeof defaultColorChannels;
2
+
3
+ /**
4
+ * The default FDC3 user channels advertised by the Interop Broker.
5
+ */
6
+ export declare const defaultColorChannels: {
7
+ readonly 'fdc3.channel.1': {
8
+ readonly name: "Channel 1";
9
+ readonly color: "red";
10
+ readonly glyph: "1";
11
+ };
12
+ readonly 'fdc3.channel.2': {
13
+ readonly name: "Channel 2";
14
+ readonly color: "orange";
15
+ readonly glyph: "2";
16
+ };
17
+ readonly 'fdc3.channel.3': {
18
+ readonly name: "Channel 3";
19
+ readonly color: "yellow";
20
+ readonly glyph: "3";
21
+ };
22
+ readonly 'fdc3.channel.4': {
23
+ readonly name: "Channel 4";
24
+ readonly color: "green";
25
+ readonly glyph: "4";
26
+ };
27
+ readonly 'fdc3.channel.5': {
28
+ readonly name: "Channel 5";
29
+ readonly color: "cyan";
30
+ readonly glyph: "5";
31
+ };
32
+ readonly 'fdc3.channel.6': {
33
+ readonly name: "Channel 6";
34
+ readonly color: "blue";
35
+ readonly glyph: "6";
36
+ };
37
+ readonly 'fdc3.channel.7': {
38
+ readonly name: "Channel 7";
39
+ readonly color: "magenta";
40
+ readonly glyph: "7";
41
+ };
42
+ readonly 'fdc3.channel.8': {
43
+ readonly name: "Channel 8";
44
+ readonly color: "purple";
45
+ readonly glyph: "8";
46
+ };
47
+ };
48
+
49
+ declare type LegacyColorChannelId = keyof typeof legacyColorChannelIds;
50
+
51
+ declare const legacyColorChannelIds: {
52
+ readonly red: "fdc3.channel.1";
53
+ readonly orange: "fdc3.channel.2";
54
+ readonly yellow: "fdc3.channel.3";
55
+ readonly green: "fdc3.channel.4";
56
+ readonly teal: "fdc3.channel.5";
57
+ readonly blue: "fdc3.channel.6";
58
+ readonly pink: "fdc3.channel.7";
59
+ readonly indigo: "fdc3.channel.8";
60
+ readonly purple: "fdc3.channel.8";
61
+ };
62
+
63
+ /**
64
+ * Converts a legacy color-named channel ID to its canonical FDC3 user-channel ID.
65
+ * The removed legacy gray channel resolves to no channel.
66
+ */
67
+ export declare function normalizeColorChannelId<T extends string>(colorChannelId: T): NormalizedColorChannelId<T>;
68
+
69
+ declare type NormalizedColorChannelId<T extends string> = string extends T ? string | undefined : T extends 'gray' ? undefined : T extends LegacyColorChannelId ? (typeof legacyColorChannelIds)[T] : T;
70
+
71
+ export { }
@@ -0,0 +1,71 @@
1
+ export declare type DefaultColorChannelId = keyof typeof defaultColorChannels;
2
+
3
+ /**
4
+ * The default FDC3 user channels advertised by the Interop Broker.
5
+ */
6
+ export declare const defaultColorChannels: {
7
+ readonly 'fdc3.channel.1': {
8
+ readonly name: "Channel 1";
9
+ readonly color: "red";
10
+ readonly glyph: "1";
11
+ };
12
+ readonly 'fdc3.channel.2': {
13
+ readonly name: "Channel 2";
14
+ readonly color: "orange";
15
+ readonly glyph: "2";
16
+ };
17
+ readonly 'fdc3.channel.3': {
18
+ readonly name: "Channel 3";
19
+ readonly color: "yellow";
20
+ readonly glyph: "3";
21
+ };
22
+ readonly 'fdc3.channel.4': {
23
+ readonly name: "Channel 4";
24
+ readonly color: "green";
25
+ readonly glyph: "4";
26
+ };
27
+ readonly 'fdc3.channel.5': {
28
+ readonly name: "Channel 5";
29
+ readonly color: "cyan";
30
+ readonly glyph: "5";
31
+ };
32
+ readonly 'fdc3.channel.6': {
33
+ readonly name: "Channel 6";
34
+ readonly color: "blue";
35
+ readonly glyph: "6";
36
+ };
37
+ readonly 'fdc3.channel.7': {
38
+ readonly name: "Channel 7";
39
+ readonly color: "magenta";
40
+ readonly glyph: "7";
41
+ };
42
+ readonly 'fdc3.channel.8': {
43
+ readonly name: "Channel 8";
44
+ readonly color: "purple";
45
+ readonly glyph: "8";
46
+ };
47
+ };
48
+
49
+ declare type LegacyColorChannelId = keyof typeof legacyColorChannelIds;
50
+
51
+ declare const legacyColorChannelIds: {
52
+ readonly red: "fdc3.channel.1";
53
+ readonly orange: "fdc3.channel.2";
54
+ readonly yellow: "fdc3.channel.3";
55
+ readonly green: "fdc3.channel.4";
56
+ readonly teal: "fdc3.channel.5";
57
+ readonly blue: "fdc3.channel.6";
58
+ readonly pink: "fdc3.channel.7";
59
+ readonly indigo: "fdc3.channel.8";
60
+ readonly purple: "fdc3.channel.8";
61
+ };
62
+
63
+ /**
64
+ * Converts a legacy color-named channel ID to its canonical FDC3 user-channel ID.
65
+ * The removed legacy gray channel resolves to no channel.
66
+ */
67
+ export declare function normalizeColorChannelId<T extends string>(colorChannelId: T): NormalizedColorChannelId<T>;
68
+
69
+ declare type NormalizedColorChannelId<T extends string> = string extends T ? string | undefined : T extends 'gray' ? undefined : T extends LegacyColorChannelId ? (typeof legacyColorChannelIds)[T] : T;
70
+
71
+ export { }
@@ -2000,6 +2000,8 @@ declare type BeginUserBoundsChangingEvent = UserBoundsChangeEvent & {
2000
2000
  type: 'begin-user-bounds-changing';
2001
2001
  };
2002
2002
 
2003
+ declare type BFCacheRestoreListener = () => void | Promise<void>;
2004
+
2003
2005
  /**
2004
2006
  * A rule prescribing content creation that should be blocked.
2005
2007
  *
@@ -5387,6 +5389,16 @@ declare interface Environment {
5387
5389
  resolveLayout(layoutManager: OpenFin_2.LayoutManager<OpenFin_2.LayoutSnapshot>, layoutIdentity: OpenFin_2.LayoutIdentity): Promise<any>;
5388
5390
  initPlatform(fin: OpenFin_2.Fin<OpenFin_2.EntityType>, ...args: Parameters<OpenFin_2.Fin['Platform']['init']>): ReturnType<OpenFin_2.Fin['Platform']['init']>;
5389
5391
  observeBounds(element: Element, onChange: (bounds: DOMRect) => Promise<void> | void): () => void;
5392
+ /**
5393
+ * Registers a listener invoked when the current page has been restored from the
5394
+ * browser's back/forward cache. Stateful APIs (e.g. channels) use this to re-establish
5395
+ * connections that were torn down while the page was cached.
5396
+ *
5397
+ * No-op in environments that cannot be bfcached.
5398
+ *
5399
+ * @returns a function that unregisters the listener.
5400
+ */
5401
+ onBFCacheRestore(listener: BFCacheRestoreListener): () => void;
5390
5402
  writeToken(path: string, token: string): Promise<string>;
5391
5403
  retrievePort(config: NewConnectConfig): Promise<number>;
5392
5404
  getNextMessageId(): any;
package/out/stub.d.ts CHANGED
@@ -2032,6 +2032,8 @@ declare type BeginUserBoundsChangingEvent = UserBoundsChangeEvent & {
2032
2032
  type: 'begin-user-bounds-changing';
2033
2033
  };
2034
2034
 
2035
+ declare type BFCacheRestoreListener = () => void | Promise<void>;
2036
+
2035
2037
  /**
2036
2038
  * A rule prescribing content creation that should be blocked.
2037
2039
  *
@@ -5498,6 +5500,16 @@ declare interface Environment {
5498
5500
  resolveLayout(layoutManager: OpenFin_2.LayoutManager<OpenFin_2.LayoutSnapshot>, layoutIdentity: OpenFin_2.LayoutIdentity): Promise<any>;
5499
5501
  initPlatform(fin: OpenFin_2.Fin<OpenFin_2.EntityType>, ...args: Parameters<OpenFin_2.Fin['Platform']['init']>): ReturnType<OpenFin_2.Fin['Platform']['init']>;
5500
5502
  observeBounds(element: Element, onChange: (bounds: DOMRect) => Promise<void> | void): () => void;
5503
+ /**
5504
+ * Registers a listener invoked when the current page has been restored from the
5505
+ * browser's back/forward cache. Stateful APIs (e.g. channels) use this to re-establish
5506
+ * connections that were torn down while the page was cached.
5507
+ *
5508
+ * No-op in environments that cannot be bfcached.
5509
+ *
5510
+ * @returns a function that unregisters the listener.
5511
+ */
5512
+ onBFCacheRestore(listener: BFCacheRestoreListener): () => void;
5501
5513
  writeToken(path: string, token: string): Promise<string>;
5502
5514
  retrievePort(config: NewConnectConfig): Promise<number>;
5503
5515
  getNextMessageId(): any;
package/out/stub.js CHANGED
@@ -17134,6 +17134,15 @@ class Transport extends events.EventEmitter {
17134
17134
  const { uuid, name } = config;
17135
17135
  const entityType = this.environment.getCurrentEntityType();
17136
17136
  this.me = getBaseMe(entityType, uuid, name);
17137
+ // Registered here rather than per-caller so that a restoration is logged exactly once,
17138
+ // however many parts of the adapter go on to subscribe.
17139
+ this.environment.onBFCacheRestore(async () => {
17140
+ await this.sendAction('write-to-log', {
17141
+ level: 'verbose',
17142
+ message: `Page restored from the back/forward cache for ${uuid}/${name}`,
17143
+ target: {}
17144
+ });
17145
+ });
17137
17146
  }
17138
17147
  getFin() {
17139
17148
  if (!__classPrivateFieldGet(this, _Transport_fin, "f")) {
@@ -17376,6 +17385,11 @@ class StubEnvironment {
17376
17385
  observeBounds() {
17377
17386
  throw new Error(environmentUnsupportedMessage);
17378
17387
  }
17388
+ onBFCacheRestore(listener) {
17389
+ // Deliberately not throwing: callers register unconditionally, including from the
17390
+ // Transport constructor, which the stub environment has to survive.
17391
+ return () => undefined;
17392
+ }
17379
17393
  writeToken(path, token) {
17380
17394
  throw new Error(environmentUnsupportedMessage);
17381
17395
  }
package/out/stub.mjs CHANGED
@@ -1,5 +1,6 @@
1
1
  import { EventEmitter } from 'events';
2
2
  import { isEqual } from 'es-toolkit';
3
+ import { defaultColorChannels, normalizeColorChannelId } from './color-channels.mjs';
3
4
 
4
5
  /**
5
6
  * Namespace for events that can be emitted by an {@link OpenFin.Application}. Includes events
@@ -13122,45 +13123,6 @@ class PrivateChannelProvider {
13122
13123
  }
13123
13124
  }
13124
13125
 
13125
- /**
13126
- * The default FDC3 user channels advertised by the Interop Broker.
13127
- */
13128
- const defaultColorChannels = {
13129
- 'fdc3.channel.1': { name: 'Channel 1', color: 'red', glyph: '1' },
13130
- 'fdc3.channel.2': { name: 'Channel 2', color: 'orange', glyph: '2' },
13131
- 'fdc3.channel.3': { name: 'Channel 3', color: 'yellow', glyph: '3' },
13132
- 'fdc3.channel.4': { name: 'Channel 4', color: 'green', glyph: '4' },
13133
- 'fdc3.channel.5': { name: 'Channel 5', color: 'cyan', glyph: '5' },
13134
- 'fdc3.channel.6': { name: 'Channel 6', color: 'blue', glyph: '6' },
13135
- 'fdc3.channel.7': { name: 'Channel 7', color: 'magenta', glyph: '7' },
13136
- 'fdc3.channel.8': { name: 'Channel 8', color: 'purple', glyph: '8' }
13137
- };
13138
- const legacyColorChannelIds = {
13139
- red: 'fdc3.channel.1',
13140
- orange: 'fdc3.channel.2',
13141
- yellow: 'fdc3.channel.3',
13142
- green: 'fdc3.channel.4',
13143
- teal: 'fdc3.channel.5',
13144
- blue: 'fdc3.channel.6',
13145
- pink: 'fdc3.channel.7',
13146
- // Legacy indigo (workspace) and purple (core) intentionally converge on the same FDC3 purple channel.
13147
- indigo: 'fdc3.channel.8',
13148
- purple: 'fdc3.channel.8'
13149
- };
13150
- /**
13151
- * Converts a legacy color-named channel ID to its canonical FDC3 user-channel ID.
13152
- * The removed legacy gray channel resolves to no channel.
13153
- */
13154
- function normalizeColorChannelId(colorChannelId) {
13155
- if (colorChannelId === 'gray') {
13156
- return undefined;
13157
- }
13158
- if (Object.prototype.hasOwnProperty.call(legacyColorChannelIds, colorChannelId)) {
13159
- return legacyColorChannelIds[colorChannelId];
13160
- }
13161
- return colorChannelId;
13162
- }
13163
-
13164
13126
  var __classPrivateFieldSet$9 = (undefined && undefined.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
13165
13127
  if (kind === "m") throw new TypeError("Private method is not writable");
13166
13128
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
@@ -17130,6 +17092,15 @@ class Transport extends EventEmitter {
17130
17092
  const { uuid, name } = config;
17131
17093
  const entityType = this.environment.getCurrentEntityType();
17132
17094
  this.me = getBaseMe(entityType, uuid, name);
17095
+ // Registered here rather than per-caller so that a restoration is logged exactly once,
17096
+ // however many parts of the adapter go on to subscribe.
17097
+ this.environment.onBFCacheRestore(async () => {
17098
+ await this.sendAction('write-to-log', {
17099
+ level: 'verbose',
17100
+ message: `Page restored from the back/forward cache for ${uuid}/${name}`,
17101
+ target: {}
17102
+ });
17103
+ });
17133
17104
  }
17134
17105
  getFin() {
17135
17106
  if (!__classPrivateFieldGet(this, _Transport_fin, "f")) {
@@ -17372,6 +17343,11 @@ class StubEnvironment {
17372
17343
  observeBounds() {
17373
17344
  throw new Error(environmentUnsupportedMessage);
17374
17345
  }
17346
+ onBFCacheRestore(listener) {
17347
+ // Deliberately not throwing: callers register unconditionally, including from the
17348
+ // Transport constructor, which the stub environment has to survive.
17349
+ return () => undefined;
17350
+ }
17375
17351
  writeToken(path, token) {
17376
17352
  throw new Error(environmentUnsupportedMessage);
17377
17353
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openfin/core",
3
- "version": "45.101.1",
3
+ "version": "45.102.2",
4
4
  "description": "The core renderer entry point of OpenFin",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "main": "out/stub.js",
@@ -11,6 +11,11 @@
11
11
  "import": "./out/stub.mjs",
12
12
  "default": "./out/stub.js"
13
13
  },
14
+ "./color-channels": {
15
+ "types": "./out/color-channels.d.ts",
16
+ "import": "./out/color-channels.mjs",
17
+ "default": "./out/color-channels.js"
18
+ },
14
19
  "./OpenFin": {
15
20
  "types": "./OpenFin.d.ts"
16
21
  },