@openfin/core 32.75.3 → 32.75.5

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openfin/core",
3
- "version": "32.75.3",
3
+ "version": "32.75.5",
4
4
  "license": "SEE LICENSE IN LICENSE.MD",
5
5
  "main": "./src/mock.js",
6
6
  "types": "./src/mock.d.ts",
package/src/OpenFin.d.ts CHANGED
@@ -435,6 +435,11 @@ export type ViewVisibilityOptions = {
435
435
  * Visibility state of a window.
436
436
  */
437
437
  export type WindowState = 'maximized' | 'minimized' | 'normal';
438
+ /**
439
+ * Autoplay policy to apply to content in the window, can be
440
+ * `no-user-gesture-required`, `user-gesture-required`,
441
+ * `document-user-activation-required`. Defaults to `no-user-gesture-required`.
442
+ */
438
443
  export type AutoplayPolicyOptions = 'no-user-gesture-required' | 'user-gesture-required' | 'document-user-activation-required';
439
444
  /**
440
445
  * Window options that cannot be changed after creation.
@@ -452,6 +457,11 @@ export type ConstWindowOptions = {
452
457
  * @deprecated use `icon` instead.
453
458
  */
454
459
  applicationIcon: string;
460
+ /**
461
+ * Autoplay policy to apply to content in the window, can be
462
+ * `no-user-gesture-required`, `user-gesture-required`,
463
+ * `document-user-activation-required`. Defaults to `no-user-gesture-required`.
464
+ */
455
465
  autoplayPolicy: AutoplayPolicyOptions;
456
466
  /**
457
467
  * Automatically show the window when it is created.
@@ -1268,6 +1278,11 @@ export type ConstViewOptions = {
1268
1278
  * Enable keyboard shortcuts for devtools, zoom, reload, and reload ignoring cache.
1269
1279
  */
1270
1280
  accelerator?: Partial<Accelerator>;
1281
+ /**
1282
+ * Autoplay policy to apply to content in the window, can be
1283
+ * `no-user-gesture-required`, `user-gesture-required`,
1284
+ * `document-user-activation-required`. Defaults to `no-user-gesture-required`.
1285
+ */
1271
1286
  autoplayPolicy: AutoplayPolicyOptions;
1272
1287
  };
1273
1288
  export type ViewState = ViewCreationOptions & {
@@ -55,6 +55,11 @@ type ViewEvent = OpenFin.ViewEvent;
55
55
  * @property {boolean} [api.iframe.crossOriginInjection=false] Controls if the `fin` API object is present for cross origin iframes.
56
56
  * @property {boolean} [api.iframe.sameOriginInjection=true] Controls if the `fin` API object is present for same origin iframes.
57
57
  *
58
+ * @property {string} [autoplayPolicy="no-user-gesture-required"]
59
+ * Autoplay policy to apply to content in the window, can be
60
+ * `no-user-gesture-required`, `user-gesture-required`,
61
+ * `document-user-activation-required`. Defaults to `no-user-gesture-required`.
62
+ *
58
63
  * @property {object} [autoResize] AutoResize options
59
64
  *
60
65
  * @property {object} [bounds] initial bounds given relative to the window.
@@ -65,6 +65,11 @@ const window_1 = require("../window");
65
65
  * @property {boolean} [api.iframe.crossOriginInjection=false] Controls if the `fin` API object is present for cross origin iframes.
66
66
  * @property {boolean} [api.iframe.sameOriginInjection=true] Controls if the `fin` API object is present for same origin iframes.
67
67
  *
68
+ * @property {string} [autoplayPolicy="no-user-gesture-required"]
69
+ * Autoplay policy to apply to content in the window, can be
70
+ * `no-user-gesture-required`, `user-gesture-required`,
71
+ * `document-user-activation-required`. Defaults to `no-user-gesture-required`.
72
+ *
68
73
  * @property {object} [autoResize] AutoResize options
69
74
  *
70
75
  * @property {object} [bounds] initial bounds given relative to the window.
@@ -134,6 +134,11 @@ import { WebContents } from '../webcontents/main';
134
134
  * The aspect ratio of width to height to enforce for the window. If this value is equal to or less than zero,
135
135
  * an aspect ratio will not be enforced.
136
136
  *
137
+ * @property {string} [autoplayPolicy="no-user-gesture-required"]
138
+ * Autoplay policy to apply to content in the window, can be
139
+ * `no-user-gesture-required`, `user-gesture-required`,
140
+ * `document-user-activation-required`. Defaults to `no-user-gesture-required`.
141
+ *
137
142
  * @property {boolean} [autoShow=true]
138
143
  * A flag to automatically show the window when it is created.
139
144
  *
@@ -141,6 +141,11 @@ const view_1 = require("../view");
141
141
  * The aspect ratio of width to height to enforce for the window. If this value is equal to or less than zero,
142
142
  * an aspect ratio will not be enforced.
143
143
  *
144
+ * @property {string} [autoplayPolicy="no-user-gesture-required"]
145
+ * Autoplay policy to apply to content in the window, can be
146
+ * `no-user-gesture-required`, `user-gesture-required`,
147
+ * `document-user-activation-required`. Defaults to `no-user-gesture-required`.
148
+ *
144
149
  * @property {boolean} [autoShow=true]
145
150
  * A flag to automatically show the window when it is created.
146
151
  *
@@ -1,31 +0,0 @@
1
- import type * as OpenFin from '../OpenFin';
2
- import { Transport } from '../transport/transport';
3
- import { NewConnectConfig } from '../transport/wire';
4
- import { BrowserEnvironment } from './browser';
5
- import { ChildContentOptions, Environment } from './environment';
6
- type EntityType = OpenFin.EntityType;
7
- export default class OpenFinEnvironment extends BrowserEnvironment implements Environment {
8
- #private;
9
- private raiseEventAsync;
10
- childViews: boolean;
11
- constructor();
12
- getDefaultChannelOptions(): {
13
- create: OpenFin.ChannelCreateOptions;
14
- connect: OpenFin.ChannelConnectOptions;
15
- };
16
- initLayout(_fin: OpenFin.Fin<OpenFin.EntityType>, wire: Transport, options: OpenFin.InitLayoutOptions): Promise<OpenFin.Layout>;
17
- initPlatform(_fin: OpenFin.Fin<OpenFin.EntityType>, options?: OpenFin.InitPlatformOptions): ReturnType<OpenFin.Fin['Platform']['init']>;
18
- observeBounds(element: Element, onChange: (bounds: DOMRect) => void | Promise<void>): () => void;
19
- writeToken: (path: string, token: string) => Promise<string>;
20
- retrievePort: (config: NewConnectConfig) => Promise<number>;
21
- getNextMessageId: () => any;
22
- createChildContent: ({ options, entityType }: ChildContentOptions) => Promise<unknown>;
23
- private normalizeOptions;
24
- private resolveUrl;
25
- getWebWindow: (identity: OpenFin.Identity) => globalThis.Window;
26
- getCurrentEntityIdentity: () => OpenFin.EntityInfo;
27
- getCurrentEntityType: () => EntityType;
28
- raiseEvent: (eventName: string, eventArgs: any) => void;
29
- whenReady(): Promise<void>;
30
- }
31
- export {};
@@ -1,100 +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 _OpenFinEnvironment_ready;
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- const transport_errors_1 = require("../transport/transport-errors");
16
- const browser_1 = require("./browser");
17
- const bounds_observer_1 = require("../api/platform/renderer/utils/bounds-observer");
18
- // Inherits the following BrowserEnvironment methods: getRtcPeer, getRandomId, getUrl, getWsConstructor.
19
- class OpenFinEnvironment extends browser_1.BrowserEnvironment {
20
- constructor() {
21
- super();
22
- _OpenFinEnvironment_ready.set(this, void 0);
23
- this.writeToken = (path, token) => {
24
- throw new transport_errors_1.NotImplementedError('Not Implemented');
25
- };
26
- this.retrievePort = (config) => {
27
- throw new transport_errors_1.NotImplementedError('Not Implemented');
28
- };
29
- this.getNextMessageId = () => {
30
- return fin.desktop.getUuid();
31
- };
32
- // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
33
- this.createChildContent = async ({ options, entityType }) => {
34
- const opts = this.normalizeOptions(options);
35
- return new Promise((y, n) => fin.__internal_.createChildContent({ entityType, options: opts }, y, n));
36
- };
37
- this.normalizeOptions = (options) => {
38
- const { uuid: parentUuid } = fin.__internal_.initialOptions;
39
- const opts = JSON.parse(JSON.stringify(options));
40
- const ABOUT_BLANK = 'about:blank';
41
- opts.uuid = opts.uuid || parentUuid;
42
- opts.url = opts.url || ABOUT_BLANK;
43
- if (opts.url !== ABOUT_BLANK) {
44
- opts.url = this.resolveUrl(opts.url);
45
- }
46
- return opts;
47
- };
48
- this.getWebWindow = (identity) => {
49
- return fin.__internal_.getWebWindow(identity.name);
50
- };
51
- this.getCurrentEntityIdentity = () => {
52
- return fin.__internal_.entityInfo;
53
- };
54
- this.getCurrentEntityType = () => {
55
- return this.getCurrentEntityIdentity().entityType || 'unknown';
56
- };
57
- this.raiseEvent = (eventName, eventArgs) => {
58
- this.raiseEventAsync(eventName, eventArgs);
59
- };
60
- this.raiseEventAsync = fin.__internal_.raiseEventAsync;
61
- delete fin.__internal_.raiseEventAsync;
62
- this.childViews = fin.__internal_.childViews;
63
- __classPrivateFieldSet(this, _OpenFinEnvironment_ready, new Promise((resolve) => {
64
- fin.desktop.main(resolve);
65
- }), "f");
66
- }
67
- getDefaultChannelOptions() {
68
- var _a, _b;
69
- return {
70
- create: {},
71
- connect: {},
72
- ...((_b = (_a = fin.__internal_.initialOptions.experimental) === null || _a === void 0 ? void 0 : _a.defaultChannelOptions) !== null && _b !== void 0 ? _b : {})
73
- };
74
- }
75
- async initLayout(_fin, wire, options) {
76
- const { initLayout } = await Promise.resolve().then(() => require(
77
- /* webpackChunkName: 'layout' */
78
- '../api/platform/renderer/init-layout'));
79
- return initLayout(_fin, wire, options);
80
- }
81
- async initPlatform(_fin, options) {
82
- const { initPlatformProvider } = await Promise.resolve().then(() => require(
83
- /* webpackChunkName: 'provider' */
84
- '../api/platform/renderer/init-platform-provider'));
85
- return initPlatformProvider(this, _fin, options);
86
- }
87
- observeBounds(element, onChange) {
88
- return (0, bounds_observer_1.observeBounds)(element, onChange);
89
- }
90
- // eslint-disable-next-line class-methods-use-this
91
- resolveUrl(url) {
92
- const newUrl = new URL(url, location.href);
93
- return newUrl.href;
94
- }
95
- whenReady() {
96
- return __classPrivateFieldGet(this, _OpenFinEnvironment_ready, "f");
97
- }
98
- }
99
- exports.default = OpenFinEnvironment;
100
- _OpenFinEnvironment_ready = new WeakMap();