@openfin/core 33.76.36 → 33.77.1

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.
Files changed (271) hide show
  1. package/OpenFin.d.ts +1 -1
  2. package/README.md +29 -4
  3. package/fin.d.ts +2 -2
  4. package/{src → out}/GlobalOpenFin.d.ts +1 -1
  5. package/out/mock-alpha.d.ts +16112 -0
  6. package/out/mock-beta.d.ts +16112 -0
  7. package/out/mock-public.d.ts +16112 -0
  8. package/out/mock.d.ts +16797 -0
  9. package/out/mock.js +17111 -0
  10. package/package.json +30 -23
  11. package/LICENSE +0 -13
  12. package/NOTICE +0 -16
  13. package/openfin-core-33.76.36.tgz +0 -0
  14. package/src/OpenFin.d.ts +0 -3091
  15. package/src/OpenFin.js +0 -2
  16. package/src/api/api-exposer/api-consumer.d.ts +0 -28
  17. package/src/api/api-exposer/api-consumer.js +0 -28
  18. package/src/api/api-exposer/api-exposer.d.ts +0 -35
  19. package/src/api/api-exposer/api-exposer.js +0 -38
  20. package/src/api/api-exposer/decorators.d.ts +0 -10
  21. package/src/api/api-exposer/decorators.js +0 -18
  22. package/src/api/api-exposer/index.d.ts +0 -4
  23. package/src/api/api-exposer/index.js +0 -20
  24. package/src/api/api-exposer/strategies/index.d.ts +0 -1
  25. package/src/api/api-exposer/strategies/index.js +0 -17
  26. package/src/api/api-exposer/strategies/openfin-channels/channels-consumer.d.ts +0 -14
  27. package/src/api/api-exposer/strategies/openfin-channels/channels-consumer.js +0 -20
  28. package/src/api/api-exposer/strategies/openfin-channels/channels-exposer.d.ts +0 -20
  29. package/src/api/api-exposer/strategies/openfin-channels/channels-exposer.js +0 -23
  30. package/src/api/api-exposer/strategies/openfin-channels/index.d.ts +0 -2
  31. package/src/api/api-exposer/strategies/openfin-channels/index.js +0 -18
  32. package/src/api/application/Factory.d.ts +0 -196
  33. package/src/api/application/Factory.js +0 -278
  34. package/src/api/application/Instance.d.ts +0 -692
  35. package/src/api/application/Instance.js +0 -821
  36. package/src/api/application/index.d.ts +0 -12
  37. package/src/api/application/index.js +0 -28
  38. package/src/api/base.d.ts +0 -117
  39. package/src/api/base.js +0 -246
  40. package/src/api/clipboard/index.d.ts +0 -172
  41. package/src/api/clipboard/index.js +0 -200
  42. package/src/api/events/application.d.ts +0 -158
  43. package/src/api/events/application.js +0 -14
  44. package/src/api/events/base.d.ts +0 -42
  45. package/src/api/events/base.js +0 -2
  46. package/src/api/events/channel.d.ts +0 -35
  47. package/src/api/events/channel.js +0 -7
  48. package/src/api/events/emitterMap.d.ts +0 -11
  49. package/src/api/events/emitterMap.js +0 -35
  50. package/src/api/events/eventAggregator.d.ts +0 -5
  51. package/src/api/events/eventAggregator.js +0 -35
  52. package/src/api/events/externalApplication.d.ts +0 -24
  53. package/src/api/events/externalApplication.js +0 -7
  54. package/src/api/events/frame.d.ts +0 -35
  55. package/src/api/events/frame.js +0 -2
  56. package/src/api/events/globalHotkey.d.ts +0 -25
  57. package/src/api/events/globalHotkey.js +0 -2
  58. package/src/api/events/platform.d.ts +0 -34
  59. package/src/api/events/platform.js +0 -10
  60. package/src/api/events/system.d.ts +0 -126
  61. package/src/api/events/system.js +0 -15
  62. package/src/api/events/typedEventEmitter.d.ts +0 -20
  63. package/src/api/events/typedEventEmitter.js +0 -2
  64. package/src/api/events/view.d.ts +0 -92
  65. package/src/api/events/view.js +0 -12
  66. package/src/api/events/webcontents.d.ts +0 -277
  67. package/src/api/events/webcontents.js +0 -13
  68. package/src/api/events/window.d.ts +0 -421
  69. package/src/api/events/window.js +0 -12
  70. package/src/api/external-application/Factory.d.ts +0 -34
  71. package/src/api/external-application/Factory.js +0 -47
  72. package/src/api/external-application/Instance.d.ts +0 -110
  73. package/src/api/external-application/Instance.js +0 -117
  74. package/src/api/external-application/index.d.ts +0 -12
  75. package/src/api/external-application/index.js +0 -28
  76. package/src/api/fin.d.ts +0 -54
  77. package/src/api/fin.js +0 -45
  78. package/src/api/frame/Factory.d.ts +0 -54
  79. package/src/api/frame/Factory.js +0 -86
  80. package/src/api/frame/Instance.d.ts +0 -136
  81. package/src/api/frame/Instance.js +0 -143
  82. package/src/api/frame/index.d.ts +0 -14
  83. package/src/api/frame/index.js +0 -30
  84. package/src/api/global-hotkey/index.d.ts +0 -106
  85. package/src/api/global-hotkey/index.js +0 -132
  86. package/src/api/interappbus/channel/channel.d.ts +0 -285
  87. package/src/api/interappbus/channel/channel.js +0 -334
  88. package/src/api/interappbus/channel/channels-docs.d.ts +0 -342
  89. package/src/api/interappbus/channel/channels-docs.js +0 -401
  90. package/src/api/interappbus/channel/client.d.ts +0 -117
  91. package/src/api/interappbus/channel/client.js +0 -181
  92. package/src/api/interappbus/channel/connection-manager.d.ts +0 -29
  93. package/src/api/interappbus/channel/connection-manager.js +0 -246
  94. package/src/api/interappbus/channel/index.d.ts +0 -189
  95. package/src/api/interappbus/channel/index.js +0 -333
  96. package/src/api/interappbus/channel/protocols/classic/message-receiver.d.ts +0 -13
  97. package/src/api/interappbus/channel/protocols/classic/message-receiver.js +0 -73
  98. package/src/api/interappbus/channel/protocols/classic/strategy.d.ts +0 -24
  99. package/src/api/interappbus/channel/protocols/classic/strategy.js +0 -101
  100. package/src/api/interappbus/channel/protocols/combined/strategy.d.ts +0 -20
  101. package/src/api/interappbus/channel/protocols/combined/strategy.js +0 -58
  102. package/src/api/interappbus/channel/protocols/index.d.ts +0 -47
  103. package/src/api/interappbus/channel/protocols/index.js +0 -2
  104. package/src/api/interappbus/channel/protocols/protocol-manager.d.ts +0 -10
  105. package/src/api/interappbus/channel/protocols/protocol-manager.js +0 -43
  106. package/src/api/interappbus/channel/protocols/rtc/endpoint.d.ts +0 -25
  107. package/src/api/interappbus/channel/protocols/rtc/endpoint.js +0 -141
  108. package/src/api/interappbus/channel/protocols/rtc/ice-manager.d.ts +0 -30
  109. package/src/api/interappbus/channel/protocols/rtc/ice-manager.js +0 -130
  110. package/src/api/interappbus/channel/protocols/rtc/strategy.d.ts +0 -24
  111. package/src/api/interappbus/channel/protocols/rtc/strategy.js +0 -85
  112. package/src/api/interappbus/channel/protocols/strategy-types.d.ts +0 -13
  113. package/src/api/interappbus/channel/protocols/strategy-types.js +0 -2
  114. package/src/api/interappbus/channel/protocols/strategy.d.ts +0 -17
  115. package/src/api/interappbus/channel/protocols/strategy.js +0 -2
  116. package/src/api/interappbus/channel/provider.d.ts +0 -206
  117. package/src/api/interappbus/channel/provider.js +0 -338
  118. package/src/api/interappbus/index.d.ts +0 -120
  119. package/src/api/interappbus/index.js +0 -210
  120. package/src/api/interop/Factory.d.ts +0 -57
  121. package/src/api/interop/Factory.js +0 -96
  122. package/src/api/interop/InteropBroker.d.ts +0 -665
  123. package/src/api/interop/InteropBroker.js +0 -1313
  124. package/src/api/interop/InteropClient.d.ts +0 -502
  125. package/src/api/interop/InteropClient.js +0 -683
  126. package/src/api/interop/SessionContextGroupBroker.d.ts +0 -27
  127. package/src/api/interop/SessionContextGroupBroker.js +0 -108
  128. package/src/api/interop/SessionContextGroupClient.d.ts +0 -21
  129. package/src/api/interop/SessionContextGroupClient.js +0 -86
  130. package/src/api/interop/fdc3/PrivateChannelClient.d.ts +0 -20
  131. package/src/api/interop/fdc3/PrivateChannelClient.js +0 -90
  132. package/src/api/interop/fdc3/PrivateChannelProvider.d.ts +0 -55
  133. package/src/api/interop/fdc3/PrivateChannelProvider.js +0 -276
  134. package/src/api/interop/fdc3/documentationStub.d.ts +0 -14
  135. package/src/api/interop/fdc3/documentationStub.js +0 -17
  136. package/src/api/interop/fdc3/fdc3-1.2.d.ts +0 -205
  137. package/src/api/interop/fdc3/fdc3-1.2.js +0 -435
  138. package/src/api/interop/fdc3/fdc3-2.0.d.ts +0 -298
  139. package/src/api/interop/fdc3/fdc3-2.0.js +0 -479
  140. package/src/api/interop/fdc3/fdc3.d.ts +0 -12
  141. package/src/api/interop/fdc3/fdc3.js +0 -35
  142. package/src/api/interop/fdc3/overrideCheck.d.ts +0 -4
  143. package/src/api/interop/fdc3/overrideCheck.js +0 -32
  144. package/src/api/interop/fdc3/shapes/fdc3v1.d.ts +0 -53
  145. package/src/api/interop/fdc3/shapes/fdc3v1.js +0 -4
  146. package/src/api/interop/fdc3/shapes/fdc3v2.d.ts +0 -75
  147. package/src/api/interop/fdc3/shapes/fdc3v2.js +0 -2
  148. package/src/api/interop/fdc3/utils.d.ts +0 -45
  149. package/src/api/interop/fdc3/utils.js +0 -239
  150. package/src/api/interop/fdc3/versions.d.ts +0 -1
  151. package/src/api/interop/fdc3/versions.js +0 -2
  152. package/src/api/interop/index.d.ts +0 -12
  153. package/src/api/interop/index.js +0 -28
  154. package/src/api/interop/utils.d.ts +0 -18
  155. package/src/api/interop/utils.js +0 -61
  156. package/src/api/me.d.ts +0 -40
  157. package/src/api/me.js +0 -134
  158. package/src/api/platform/Factory.d.ts +0 -171
  159. package/src/api/platform/Factory.js +0 -240
  160. package/src/api/platform/Instance.d.ts +0 -653
  161. package/src/api/platform/Instance.js +0 -834
  162. package/src/api/platform/common-utils.d.ts +0 -7
  163. package/src/api/platform/common-utils.js +0 -16
  164. package/src/api/platform/index.d.ts +0 -12
  165. package/src/api/platform/index.js +0 -28
  166. package/src/api/platform/layout/Factory.d.ts +0 -91
  167. package/src/api/platform/layout/Factory.js +0 -151
  168. package/src/api/platform/layout/Instance.d.ts +0 -192
  169. package/src/api/platform/layout/Instance.js +0 -224
  170. package/src/api/platform/layout/controllers/layout-content-cache.d.ts +0 -9
  171. package/src/api/platform/layout/controllers/layout-content-cache.js +0 -54
  172. package/src/api/platform/layout/controllers/layout-entities-controller.d.ts +0 -119
  173. package/src/api/platform/layout/controllers/layout-entities-controller.js +0 -287
  174. package/src/api/platform/layout/entities/layout-entities.d.ts +0 -427
  175. package/src/api/platform/layout/entities/layout-entities.js +0 -504
  176. package/src/api/platform/layout/entities/shapes.d.ts +0 -6
  177. package/src/api/platform/layout/entities/shapes.js +0 -2
  178. package/src/api/platform/layout/index.d.ts +0 -11
  179. package/src/api/platform/layout/index.js +0 -27
  180. package/src/api/platform/layout/layout.constants.d.ts +0 -1
  181. package/src/api/platform/layout/layout.constants.js +0 -4
  182. package/src/api/platform/layout/shapes.d.ts +0 -16
  183. package/src/api/platform/layout/shapes.js +0 -2
  184. package/src/api/platform/layout/utils/layout-traversal.d.ts +0 -4
  185. package/src/api/platform/layout/utils/layout-traversal.js +0 -65
  186. package/src/api/platform/provider.d.ts +0 -510
  187. package/src/api/platform/provider.js +0 -2
  188. package/src/api/snapshot-source/Factory.d.ts +0 -53
  189. package/src/api/snapshot-source/Factory.js +0 -81
  190. package/src/api/snapshot-source/Instance.d.ts +0 -53
  191. package/src/api/snapshot-source/Instance.js +0 -154
  192. package/src/api/snapshot-source/index.d.ts +0 -12
  193. package/src/api/snapshot-source/index.js +0 -28
  194. package/src/api/snapshot-source/utils.d.ts +0 -2
  195. package/src/api/snapshot-source/utils.js +0 -6
  196. package/src/api/system/index.d.ts +0 -1468
  197. package/src/api/system/index.js +0 -1851
  198. package/src/api/view/Factory.d.ts +0 -88
  199. package/src/api/view/Factory.js +0 -141
  200. package/src/api/view/Instance.d.ts +0 -601
  201. package/src/api/view/Instance.js +0 -671
  202. package/src/api/view/index.d.ts +0 -12
  203. package/src/api/view/index.js +0 -28
  204. package/src/api/webcontents/main.d.ts +0 -922
  205. package/src/api/webcontents/main.js +0 -1046
  206. package/src/api/window/Factory.d.ts +0 -96
  207. package/src/api/window/Factory.js +0 -142
  208. package/src/api/window/Instance.d.ts +0 -1598
  209. package/src/api/window/Instance.js +0 -1851
  210. package/src/api/window/index.d.ts +0 -14
  211. package/src/api/window/index.js +0 -30
  212. package/src/browser.d.ts +0 -10
  213. package/src/browser.js +0 -36
  214. package/src/environment/browser.d.ts +0 -29
  215. package/src/environment/browser.js +0 -60
  216. package/src/environment/environment.d.ts +0 -33
  217. package/src/environment/environment.js +0 -4
  218. package/src/environment/mockEnvironment.d.ts +0 -27
  219. package/src/environment/mockEnvironment.js +0 -61
  220. package/src/environment/node-env.d.ts +0 -29
  221. package/src/environment/node-env.js +0 -72
  222. package/src/fdc3.d.ts +0 -3
  223. package/src/fdc3.js +0 -9
  224. package/src/mock.d.ts +0 -3
  225. package/src/mock.js +0 -18
  226. package/src/namespaces.d.ts +0 -22
  227. package/src/namespaces.js +0 -26
  228. package/src/shapes/ERROR_BOX_TYPES.d.ts +0 -1
  229. package/src/shapes/ERROR_BOX_TYPES.js +0 -2
  230. package/src/shapes/WebOptions.d.ts +0 -13
  231. package/src/shapes/WebOptions.js +0 -2
  232. package/src/shapes/WindowOptions.d.ts +0 -43
  233. package/src/shapes/WindowOptions.js +0 -2
  234. package/src/shapes/protocol.d.ts +0 -204
  235. package/src/shapes/protocol.js +0 -2
  236. package/src/transport/mockWire.d.ts +0 -11
  237. package/src/transport/mockWire.js +0 -26
  238. package/src/transport/transport-errors.d.ts +0 -31
  239. package/src/transport/transport-errors.js +0 -79
  240. package/src/transport/transport.d.ts +0 -73
  241. package/src/transport/transport.js +0 -219
  242. package/src/transport/wire.d.ts +0 -77
  243. package/src/transport/wire.js +0 -36
  244. package/src/util/asyncFilter.d.ts +0 -1
  245. package/src/util/asyncFilter.js +0 -7
  246. package/src/util/channel-api-relay.d.ts +0 -13
  247. package/src/util/channel-api-relay.js +0 -47
  248. package/src/util/errors.d.ts +0 -10
  249. package/src/util/errors.js +0 -12
  250. package/src/util/exhaustive.d.ts +0 -1
  251. package/src/util/exhaustive.js +0 -7
  252. package/src/util/http.d.ts +0 -11
  253. package/src/util/http.js +0 -90
  254. package/src/util/inaccessibleObject.d.ts +0 -2
  255. package/src/util/inaccessibleObject.js +0 -49
  256. package/src/util/lazy.d.ts +0 -34
  257. package/src/util/lazy.js +0 -54
  258. package/src/util/normalize-config.d.ts +0 -3
  259. package/src/util/normalize-config.js +0 -52
  260. package/src/util/promises.d.ts +0 -5
  261. package/src/util/promises.js +0 -27
  262. package/src/util/ref-counter.d.ts +0 -7
  263. package/src/util/ref-counter.js +0 -52
  264. package/src/util/reversible-map.d.ts +0 -11
  265. package/src/util/reversible-map.js +0 -49
  266. package/src/util/runtimeVersioning.d.ts +0 -3
  267. package/src/util/runtimeVersioning.js +0 -25
  268. package/src/util/utilTypes.d.ts +0 -8
  269. package/src/util/utilTypes.js +0 -2
  270. package/src/util/validate.d.ts +0 -3
  271. package/src/util/validate.js +0 -11
@@ -1,504 +0,0 @@
1
- "use strict";
2
- var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
3
- if (kind === "m") throw new TypeError("Private method is not writable");
4
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
5
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
6
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
7
- };
8
- var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
9
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
10
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
11
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
12
- };
13
- var _a, _LayoutNode_client, _TabStack_client, _ColumnOrRow_client;
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.ColumnOrRow = exports.TabStack = exports.LayoutNode = void 0;
16
- const api_exposer_1 = require("../../../api-exposer");
17
- const channel_api_relay_1 = require("../../../../util/channel-api-relay");
18
- /*
19
- This file includes LayoutNode, ColumnOrRow and TabStack classes, which are all closely
20
- intertwined, and share members via parent abstract class LayoutNode. To prevent circular
21
- refs, we define and export all the classes here.
22
- */
23
- /**
24
- * @ignore
25
- * @internal
26
- * Supplies an ApiClient for {@link LayoutEntitiesController} and helper methods
27
- * for the entities {@link TabStack} AND {@link ColumnOrRow} to use.
28
- */
29
- class LayoutNode {
30
- /**
31
- * @internal
32
- * @ignore
33
- */
34
- constructor(client, entityId) {
35
- /**
36
- * @ignore
37
- * @internal
38
- * ApiClient for {@link LayoutEntitiesController}
39
- */
40
- _LayoutNode_client.set(this, void 0);
41
- /**
42
- * Checks if the TabStack or ColumnOrRow is the root content item
43
- *
44
- * @example
45
- * ```js
46
- * if (!fin.me.isView) {
47
- * throw new Error('Not running in a platform View.');
48
- * }
49
- *
50
- * const stack = await fin.me.getCurrentStack();
51
- * const isRoot = await stack.isRoot();
52
- * // The TabStack is root: false
53
- * console.log(`The TabStack is root: ${isRoot}`);
54
- *
55
- * // Retrieves the parent ColumnOrRow
56
- * const parent = await stack.getParent();
57
- * const parentIsRoot = await parent.isRoot();
58
- * // The parent ColumnOrRow is root: true
59
- * console.log(`The parent ColumnOrRow is root: ${parentIsRoot}`);
60
- * ```
61
- */
62
- this.isRoot = () => __classPrivateFieldGet(this, _LayoutNode_client, "f").isRoot(this.entityId);
63
- /**
64
- * Checks if the TabStack or ColumnOrRow exists
65
- *
66
- * @example
67
- * ```js
68
- * if (!fin.me.isView) {
69
- * throw new Error('Not running in a platform View.');
70
- * }
71
- *
72
- * const stack = await fin.me.getCurrentStack();
73
- * // Retrieves the parent ColumnOrRow
74
- * const columnOrRow = await stack.getParent();
75
- * let exists = await stack.exists();
76
- * // or
77
- * let exists = await columnOrRow.exists();
78
- * // The entity exists: true
79
- * console.log(`The entity exists: ${exists}`);
80
- * ```
81
- */
82
- this.exists = () => __classPrivateFieldGet(this, _LayoutNode_client, "f").exists(this.entityId);
83
- /**
84
- * Retrieves the parent of the TabStack or ColumnOrRow
85
- *
86
- * @example
87
- * ```js
88
- * if (!fin.me.isView) {
89
- * throw new Error('Not running in a platform View.');
90
- * }
91
- *
92
- * const stack = await fin.me.getCurrentStack();
93
- * // Retrieves the parent ColumnOrRow
94
- * const columnOrRow = await stack.getParent();
95
- *
96
- * // undefined if entity is the root item
97
- * let parent = await columnOrRow.getParent();
98
- * // or
99
- * let parent = await stack.getParent();
100
- * ```
101
- */
102
- this.getParent = async () => {
103
- const parent = await __classPrivateFieldGet(this, _LayoutNode_client, "f").getParent(this.entityId);
104
- if (!parent) {
105
- return undefined;
106
- }
107
- return LayoutNode.getEntity(parent, __classPrivateFieldGet(this, _LayoutNode_client, "f"));
108
- };
109
- /**
110
- * Creates a new TabStack adjacent to the given TabStack or ColumnOrRow. Inputs can be new views to create, or existing views.
111
- *
112
- * @example
113
- * ```js
114
- * if (!fin.me.isView) {
115
- * throw new Error('Not running in a platform View.');
116
- * }
117
- *
118
- * const stack = await fin.me.getCurrentStack();
119
- * const columnOrRow = await stack.getParent();
120
- *
121
- * // Create view references by supplying a 'name' and 'url'
122
- * const views = [
123
- * // if 'name' is undefined, one will be generated
124
- * // if 'url' is undefined, it will default the view URL to 'about:blank'
125
- * { name: 'google-view', url: 'http://google.com/'},
126
- * { name: 'of-developers-view', url: 'http://developers.openfin.co/'},
127
- * ];
128
- *
129
- * // Create a view beforehand to be included in the new tab stack
130
- * const outsideView = await fin.View.create({
131
- * name: 'outside-bloomberg-view',
132
- * url: 'https://bloomberg.com/',
133
- * target: fin.me.identity,
134
- * });
135
- *
136
- * // Views to add can be identities, or the reference views mentioned above
137
- * const viewsToAdd = [outsideView.identity, ...views];
138
- *
139
- * // Possible position inputs: 'right' | 'left' | 'top' | 'bottom'
140
- * let stackFrom = await columnOrRow.createAdjacentStack(viewsToAdd, { position: 'right' });
141
- * // Or
142
- * let newStack = await stack.createAdjacentStack(viewsToAdd, { position: 'right' });
143
- * console.log(`A new TabStack created to the right has ${newStack.length} views in it`);
144
- *
145
- * ```
146
- */
147
- this.createAdjacentStack = async (views, options) => {
148
- const entityId = await __classPrivateFieldGet(this, _LayoutNode_client, "f").createAdjacentStack(this.entityId, views, options);
149
- return LayoutNode.getEntity({ entityId, type: 'stack' }, __classPrivateFieldGet(this, _LayoutNode_client, "f"));
150
- };
151
- /**
152
- * Retrieves the adjacent TabStacks of the given TabStack or ColumnOrRow
153
- *
154
- * @example
155
- * ```js
156
- * if (!fin.me.isView) {
157
- * throw new Error('Not running in a platform View.');
158
- * }
159
- *
160
- * const stack = await fin.me.getCurrentStack();
161
- * const columnOrRow = await stack.getParent();
162
- * // Possible position inputs: 'right' | 'left' | 'top' | 'bottom'
163
- * let rightStacks = await columnOrRow.getAdjacentStacks('right');
164
- * let leftStacks = await columnOrRow.getAdjacentStacks('left');
165
- * // or
166
- * let rightStacks = await stack.getAdjacentStacks('right');
167
- * let leftStacks = await stack.getAdjacentStacks('left');
168
- *
169
- * console.log(`The entity has ${rightStacks.length} stacks to the right, and ${leftStacks.length} stacks to the left`);
170
- *
171
- * ```
172
- */
173
- this.getAdjacentStacks = async (edge) => {
174
- const adjacentStacks = await __classPrivateFieldGet(this, _LayoutNode_client, "f").getAdjacentStacks({
175
- targetId: this.entityId,
176
- edge
177
- });
178
- return adjacentStacks.map((stack) => LayoutNode.getEntity({
179
- type: 'stack',
180
- entityId: stack.entityId
181
- }, __classPrivateFieldGet(this, _LayoutNode_client, "f")));
182
- };
183
- __classPrivateFieldSet(this, _LayoutNode_client, client, "f");
184
- this.entityId = entityId;
185
- }
186
- }
187
- exports.LayoutNode = LayoutNode;
188
- _a = LayoutNode, _LayoutNode_client = new WeakMap();
189
- /**
190
- * @ignore
191
- * @internal
192
- * Encapsulates Api consumption of {@link LayoutEntitiesController} with a relayed dispatch
193
- * @param client
194
- * @param controllerId
195
- * @param identity
196
- * @returns a new instance of {@link LayoutEntitiesClient} with bound to the controllerId
197
- */
198
- LayoutNode.newLayoutEntitiesClient = async (client, controllerId, identity) => {
199
- const dispatch = (0, channel_api_relay_1.createRelayedDispatch)(client, identity, 'layout-relay', 'You are trying to interact with a layout component on a window that has been destroyed.');
200
- const consumer = new api_exposer_1.ApiConsumer(new api_exposer_1.ChannelsConsumer({ dispatch }));
201
- return consumer.consume({ id: controllerId });
202
- };
203
- LayoutNode.getEntity = (definition, client) => {
204
- const { entityId, type } = definition;
205
- switch (type) {
206
- case 'column':
207
- case 'row':
208
- return new ColumnOrRow(client, entityId, type);
209
- case 'stack':
210
- return new TabStack(client, entityId);
211
- default:
212
- throw new Error(`Unrecognised Layout Entity encountered ('${JSON.stringify(definition)})`);
213
- }
214
- };
215
- /**
216
- * @typedef {string} LayoutPosition
217
- * @summary Represents the position of an item in a layout relative to another. Possible values are 'top', 'bottom', 'left' and 'right'.
218
- */
219
- /**
220
- * @typedef {object} StackCreationOptions
221
- * @summary Stack creation options.
222
- * @property {LayoutPosition} [position] - The position to create the new {@link TabStack} in, relative to the given adjacent {@link TabStack}. Defaults to 'right'.
223
- */
224
- /**
225
- * @typedef {object} TabStack~AddViewOptions
226
- * @summary Options to use when adding a view to a {@link TabStack}
227
- * @property {number} [index] - Insertion index when adding the view. Defaults to 0.
228
- */
229
- /**
230
- * A TabStack is used to manage the state of a stack of tabs within an OpenFin Layout.
231
- */
232
- class TabStack extends LayoutNode {
233
- /**
234
- * Determines if this {@link TabStack} is the top level content item in the current layout.
235
- * @function isRoot
236
- * @memberof TabStack
237
- * @instance
238
- * @tutorial TabStack.isRoot
239
- * @returns Resolves true if this TabStack is the top level content item, or false if it is not.
240
- */
241
- /**
242
- * Determines if this {@link TabStack} exists.
243
- * @function exists
244
- * @instance
245
- * @memberof TabStack
246
- * @tutorial TabStack.exists
247
- * @returns Resolves true if this is the TabStack exists, or false if it has been destroyed.
248
- */
249
- /**
250
- * Retrieves the parent {@link ColumnOrRow} of this {@link TabStack}, if one exists.
251
- * @function getParent
252
- * @instance
253
- * @memberof TabStack
254
- * @tutorial TabStack.getParent
255
- * @returns is the root content item or does not exist.
256
- */
257
- /**
258
- * Returns all the adjacent stacks that share an edge with the given {@link TabStack}.
259
- * @function getAdjacentStacks
260
- * @instance
261
- * @memberof TabStack
262
- * @param {LayoutPosition} edge - Edge to check for any adjacent stacks.
263
- *
264
- * @tutorial TabStack.getAdjacentStacks
265
- */
266
- /**
267
- * Given a list of view creation options or references and a layout position, creates a {@link TabStack} adjacent to the current {@link TabStack}
268
- *
269
- * Known Issue: If the number of views to add overflows the tab-container, the added views will be set as active
270
- * during each render, and then placed at the front of the tab-stack, while the underlying order of tabs will remain unchanged.
271
- * This means the views you pass to createAdjacentStack() may not render in the order given by the array.
272
- * Until fixed, this problem can be avoided only if your window is wide enough to fit creating all the views in the tabstack.
273
- *
274
- * @function createAdjacentStack
275
- * @instance
276
- * @memberof TabStack
277
- * @param views - List of identities or view creation options of the views to include in the stack
278
- * @param options - Creation options.
279
- * @returns The created TabStack.
280
- * @tutorial TabStack.createAdjacentStack
281
- * @experimental
282
- */
283
- /** @internal */
284
- constructor(client, entityId) {
285
- super(client, entityId);
286
- /**
287
- * @internal
288
- * ApiClient for {@link LayoutEntitiesController}
289
- */
290
- _TabStack_client.set(this, void 0);
291
- /**
292
- * Type of the content item. Always stack, but useful for distinguishing between a {@link TabStack} and {@link ColumnOrRow}.
293
- */
294
- this.type = 'stack';
295
- /**
296
- * Retrieves a list of all views belonging to this {@link TabStack}.
297
- *
298
- * Known Issue: If adding a view overflows the tab-container width, the added view will be set as active
299
- * and rendered at the front of the tab-stack, while the underlying order of tabs will remain unchanged.
300
- * If that happens and then getViews() is called, it will return the identities in a different order than
301
- * than the currently rendered tab order.
302
- *
303
- *
304
- * @throws If the {@link TabStack} has been destroyed.
305
- * @example
306
- * ```js
307
- * if (!fin.me.isView) {
308
- * throw new Error('Not running in a platform View.');
309
- * }
310
- *
311
- * const stack = await fin.me.getCurrentStack();
312
- * // Alternatively, you can wrap any view and get the stack from there
313
- * // const viewFromSomewhere = fin.View.wrapSync(someView.identity);
314
- * // const stack = await viewFromSomewhere.getCurrentStack();
315
- * const views = await stack.getViews();
316
- * console.log(`Stack contains ${views.length} view(s)`);
317
- * ```
318
- * @experimental
319
- */
320
- this.getViews = () => __classPrivateFieldGet(this, _TabStack_client, "f").getStackViews(this.entityId);
321
- /**
322
- * Adds or creates a view in this {@link TabStack}.
323
- *
324
- * @remarks Known Issue: If adding a view overflows the tab-container, the added view will be set as active
325
- * and rendered at the front of the tab-stack, while the underlying order of tabs will remain unchanged.
326
- *
327
- * @param view The identity of an existing view to add, or options to create a view.
328
- * @param options Optional view options: index number used to insert the view into the stack at that index. Defaults to 0 (front of the stack)
329
- * @returns Resolves with the {@link OpenFin.Identity identity} of the added view.
330
- * @throws If the view does not exist or fails to create.
331
- * @throws If the {@link TabStack} has been destroyed.
332
- * @example
333
- * ```js
334
- * if (!fin.me.isView) {
335
- * throw new Error('Not running in a platform View.');
336
- * }
337
- *
338
- * const stack = await fin.me.getCurrentStack();
339
- * // Alternatively, you can wrap any view and get the stack from there
340
- * // const viewFromSomewhere = fin.View.wrapSync(someView.identity);
341
- * // const stack = await viewFromSomewhere.getCurrentStack();
342
- * const googleViewIdentity = await stack.addView({ name: 'google-view', url: 'http://google.com/' });
343
- * console.log('Identity of the google view just added', { googleViewIdentity });
344
- * // pass in { index: number } to set the index in the stack. Here 1 means, end of the stack (defaults to 0)
345
- * const appleViewIdentity = await stack.addView({ name: 'apple-view', url: 'http://apple.com/' }, { index: 1 });
346
- * console.log('Identity of the apple view just added', { appleViewIdentity });
347
- * ```
348
- * @experimental
349
- */
350
- this.addView = async (view, options = { index: 0 }) => __classPrivateFieldGet(this, _TabStack_client, "f").addViewToStack(this.entityId, view, options);
351
- /**
352
- * Removes a view from this {@link TabStack}.
353
- *
354
- * @remarks Throws an exception if the view identity does not exist or was already destroyed.
355
- *
356
- * @param view - Identity of the view to remove.
357
- * @throws If the view does not exist or does not belong to the stack.
358
- * @throws If the {@link TabStack} has been destroyed.
359
- *
360
- * @example
361
- * ```js
362
- * if (!fin.me.isView) {
363
- * throw new Error('Not running in a platform View.');
364
- * }
365
- *
366
- * const stack = await fin.me.getCurrentStack();
367
- * const googleViewIdentity = await stack.addView({ name: 'google-view', url: 'http://google.com/' });
368
- *
369
- * await stack.removeView(googleViewIdentity);
370
- *
371
- * try {
372
- * await stack.removeView(googleViewIdentity);
373
- * } catch (error) {
374
- * // Tried to remove a view ('google-view') which does not belong to the stack.
375
- * console.log(error);
376
- * }
377
- * ```
378
- */
379
- this.removeView = async (view) => {
380
- await __classPrivateFieldGet(this, _TabStack_client, "f").removeViewFromStack(this.entityId, view);
381
- };
382
- /**
383
- * Sets the active view of the {@link TabStack} without focusing it.
384
- * @param view - Identity of the view to activate.
385
- * @returns Promise which resolves with void once the view has been activated.
386
- * @throws If the {@link TabStack} has been destroyed.
387
- * @throws If the view does not exist.
388
- * @example
389
- * Change the active tab of a known View's TabStack:
390
- * ```js
391
- * const targetView = fin.View.wrapSync({ uuid: 'uuid', name: 'view-name' });
392
- * const stack = await targetView.getCurrentStack();
393
- * await stack.setActiveView(targetView.identity);
394
- * ```
395
- *
396
- * Set the current View as active within its TabStack:
397
- * ```js
398
- * const stack = await fin.me.getCurrentStack();
399
- * await stack.setActiveView(fin.me.identity);
400
- * ```
401
- * @experimental
402
- */
403
- this.setActiveView = async (view) => {
404
- await __classPrivateFieldGet(this, _TabStack_client, "f").setStackActiveView(this.entityId, view);
405
- };
406
- __classPrivateFieldSet(this, _TabStack_client, client, "f");
407
- }
408
- }
409
- exports.TabStack = TabStack;
410
- _TabStack_client = new WeakMap();
411
- /**
412
- * A ColumnOrRow is used to manage the state of Column and Rows within an OpenFin Layout.
413
- */
414
- class ColumnOrRow extends LayoutNode {
415
- /**
416
- * Determines if this {@link ColumnOrRow} is the top level content item in the current layout.
417
- * @function isRoot
418
- * @memberof ColumnOrRow
419
- * @instance
420
- * @tutorial ColumnOrRow.isRoot
421
- * @returns Resolves true if this TabStack is the top level content item, or false if it is not.
422
- */
423
- /**
424
- * Determines if this {@link ColumnOrRow} exists.
425
- * @function exists
426
- * @instance
427
- * @memberof ColumnOrRow
428
- * @tutorial ColumnOrRow.exists
429
- * @returns Resolves true if the TabStack exists, or false if it has been destroyed.
430
- */
431
- /**
432
- * Retrieves the parent {@link ColumnOrRow} of this {@link ColumnOrRow}, if one exists.
433
- * @function getParent
434
- * @instance
435
- * @memberof ColumnOrRow
436
- * @tutorial ColumnOrRow.getParent
437
- * @returns Promise resolving with the {@link ColumnOrRow} that contains this item, or undefined if
438
- * this {@link ColumnOrRow}does not exist or is the root content item.
439
- */
440
- /**
441
- * Returns all the adjacent stacks that share an edge with the given {@link ColumnOrRow}.
442
- * @function getAdjacentStacks
443
- * @instance
444
- * @memberof ColumnOrRow
445
- * @param {LayoutPosition} edge - Edge to check for any adjacent stacks.
446
- *
447
- * @tutorial ColumnOrRow.getAdjacentStacks
448
- */
449
- /**
450
- * Given a list of view creation options or references and a layout position, creates a {@link TabStack} adjacent to the given {@link ColumnOrRow}
451
- *
452
- * Known Issue: If the number of views to add overflows the tab-container, the added views will be set as active
453
- * during each render, and then placed at the front of the tab-stack, while the underlying order of tabs will remain unchanged.
454
- * This means the views you pass to createAdjacentStack() may not render in the order given by the array.
455
- * Until fixed, this problem can be avoided only if your window is wide enough to fit creating all the views in the tabstack.
456
- *
457
- * @function createAdjacentStack
458
- * @instance
459
- * @memberof ColumnOrRow
460
- * @param views - List of identities or view creation options of the views to include in the stack
461
- * @param options - Creation options.
462
- * @returns The created TabStack
463
- * @tutorial ColumnOrRow.createAdjacentStack
464
- * @experimental
465
- */
466
- /**
467
- * @internal
468
- */
469
- constructor(client, entityId, type) {
470
- super(client, entityId);
471
- /**
472
- * @ignore
473
- * @internal
474
- * ApiClient for {@link LayoutEntitiesController}
475
- */
476
- _ColumnOrRow_client.set(this, void 0);
477
- /**
478
- * Retrieves the content array of the ColumnOrRow
479
- *
480
- * @example
481
- * ```js
482
- * if (!fin.me.isView) {
483
- * throw new Error('Not running in a platform View.');
484
- * }
485
- *
486
- * const stack = await fin.me.getCurrentStack();
487
- * // Retrieves the parent ColumnOrRow
488
- * const columnOrRow = await stack.getParent();
489
- *
490
- * // returns [TabStack]
491
- * const contentArray = await columnOrRow.getContent();
492
- * console.log(`The ColumnOrRow has ${contentArray.length} item(s)`);
493
- * ```
494
- */
495
- this.getContent = async () => {
496
- const contentItemEntities = await __classPrivateFieldGet(this, _ColumnOrRow_client, "f").getContent(this.entityId);
497
- return contentItemEntities.map((entity) => LayoutNode.getEntity(entity, __classPrivateFieldGet(this, _ColumnOrRow_client, "f")));
498
- };
499
- __classPrivateFieldSet(this, _ColumnOrRow_client, client, "f");
500
- this.type = type;
501
- }
502
- }
503
- exports.ColumnOrRow = ColumnOrRow;
504
- _ColumnOrRow_client = new WeakMap();
@@ -1,6 +0,0 @@
1
- export type LayoutEntityTypes = Exclude<GoldenLayout.ItemType, 'component' | 'root'>;
2
- export type LayoutPosition = 'top' | 'bottom' | 'left' | 'right';
3
- export type LayoutEntityDefinition<TLayoutEntityType extends LayoutEntityTypes = LayoutEntityTypes> = {
4
- type: TLayoutEntityType;
5
- entityId: string;
6
- };
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,11 +0,0 @@
1
- /**
2
- * Entry point for the OpenFin Layout namespace.
3
- *
4
- * Because TypeDoc does not currently support multiple modules with the same name, the module alias "LayoutModule" is used for
5
- * the module containing static members of the `Layout` namespace (available under `fin.Layout`), while `Layout` documents
6
- * instances of the OpenFin `Layout` class.
7
- *
8
- * @packageDocumentation
9
- */
10
- export * from './Factory';
11
- export * from './Instance';
@@ -1,27 +0,0 @@
1
- "use strict";
2
- /**
3
- * Entry point for the OpenFin Layout namespace.
4
- *
5
- * Because TypeDoc does not currently support multiple modules with the same name, the module alias "LayoutModule" is used for
6
- * the module containing static members of the `Layout` namespace (available under `fin.Layout`), while `Layout` documents
7
- * instances of the OpenFin `Layout` class.
8
- *
9
- * @packageDocumentation
10
- */
11
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
12
- if (k2 === undefined) k2 = k;
13
- var desc = Object.getOwnPropertyDescriptor(m, k);
14
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
15
- desc = { enumerable: true, get: function() { return m[k]; } };
16
- }
17
- Object.defineProperty(o, k2, desc);
18
- }) : (function(o, m, k, k2) {
19
- if (k2 === undefined) k2 = k;
20
- o[k2] = m[k];
21
- }));
22
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
23
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
24
- };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- __exportStar(require("./Factory"), exports);
27
- __exportStar(require("./Instance"), exports);
@@ -1 +0,0 @@
1
- export declare const LAYOUT_CONTROLLER_ID = "layout-entities";
@@ -1,4 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LAYOUT_CONTROLLER_ID = void 0;
4
- exports.LAYOUT_CONTROLLER_ID = 'layout-entities';
@@ -1,16 +0,0 @@
1
- import { ApiClient } from '../../api-exposer';
2
- import type * as OpenFin from '../../../OpenFin';
3
- import { LayoutEntitiesController } from './controllers/layout-entities-controller';
4
- type LayoutPresetType = OpenFin.LayoutPresetType;
5
- export interface InitLayoutOptions {
6
- containerId?: string;
7
- }
8
- export interface PresetLayoutOptions {
9
- presetType: LayoutPresetType;
10
- }
11
- export interface DragPayload {
12
- 'view-config': OpenFin.ViewCreationOptions;
13
- 'view-identity': [string, string, string];
14
- }
15
- export type LayoutEntitiesClient = ApiClient<LayoutEntitiesController>;
16
- export {};
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,4 +0,0 @@
1
- import type * as OpenFin from '../../../../OpenFin';
2
- export declare const getAdjacentItem: (component: GoldenLayout.ContentItem, edge: OpenFin.LayoutPosition) => GoldenLayout.ContentItem | undefined;
3
- export declare const doShareEdge: (from: GoldenLayout.ContentItem, to: GoldenLayout.ContentItem, edge: OpenFin.LayoutPosition) => boolean;
4
- export declare const getAdjacentStacks: (item: GoldenLayout.ContentItem, edge: OpenFin.LayoutPosition) => GoldenLayout.ContentItem[];
@@ -1,65 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getAdjacentStacks = exports.doShareEdge = exports.getAdjacentItem = void 0;
4
- const getAdjacentItem = (component, edge) => {
5
- const { parent } = component;
6
- if (parent.isRoot) {
7
- return undefined;
8
- }
9
- const targetType = ['top', 'bottom'].includes(edge) ? 'column' : 'row';
10
- const edgeSiblingOffset = ['top', 'left'].includes(edge) ? -1 : 1;
11
- if (parent.type === targetType) {
12
- const componentIndex = parent.contentItems.indexOf(component);
13
- const targetIndex = componentIndex + edgeSiblingOffset;
14
- if (targetIndex >= 0 && targetIndex < parent.contentItems.length) {
15
- return parent.contentItems[targetIndex];
16
- }
17
- }
18
- return (0, exports.getAdjacentItem)(parent, edge);
19
- };
20
- exports.getAdjacentItem = getAdjacentItem;
21
- const doShareEdge = (from, to, edge) => {
22
- var _a, _b;
23
- const boundsFrom = (_a = from.element.get(0)) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
24
- const boundsTo = (_b = to.element.get(0)) === null || _b === void 0 ? void 0 : _b.getBoundingClientRect();
25
- if (!boundsFrom || !boundsTo) {
26
- return false;
27
- }
28
- if (['top', 'bottom'].includes(edge)) {
29
- const horizontallyOutOfBounds = boundsFrom.right < boundsTo.left || boundsFrom.left > boundsTo.right;
30
- return !horizontallyOutOfBounds;
31
- }
32
- const verticallyOutOfBounds = boundsFrom.bottom < boundsTo.top || boundsFrom.top > boundsTo.bottom;
33
- return !verticallyOutOfBounds;
34
- };
35
- exports.doShareEdge = doShareEdge;
36
- const getAdjacentStacks = (item, edge) => {
37
- const targetContainer = ['top', 'bottom'].includes(edge) ? 'row' : 'column';
38
- const findEdgeStacks = (component) => {
39
- if (component.type === 'stack') {
40
- if ((0, exports.doShareEdge)(item, component, edge)) {
41
- return [component];
42
- }
43
- return [];
44
- }
45
- if (component.type === 'root') {
46
- return [];
47
- }
48
- if (component.type === targetContainer) {
49
- return component.contentItems.map((contentItem) => findEdgeStacks(contentItem)).flat();
50
- }
51
- if (component.type !== targetContainer) {
52
- if (['top', 'right'].includes(edge)) {
53
- return findEdgeStacks(component.contentItems[component.contentItems.length - 1]);
54
- }
55
- return findEdgeStacks(component.contentItems[0]);
56
- }
57
- return [];
58
- };
59
- const edgeItem = (0, exports.getAdjacentItem)(item, edge);
60
- if (edgeItem) {
61
- return findEdgeStacks(edgeItem);
62
- }
63
- return [];
64
- };
65
- exports.getAdjacentStacks = getAdjacentStacks;