@openfin/core 43.100.103 → 43.100.105

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/out/stub.js CHANGED
@@ -5179,6 +5179,38 @@ function requireInstance () {
5179
5179
  return undefined;
5180
5180
  }
5181
5181
  }
5182
+ /**
5183
+ * Displays the download bubble UI. If an anchor is provided, the bubble
5184
+ * will be positioned according to the specified rectangle and anchor point.
5185
+ *
5186
+ * @param {OpenFin.Anchor} options
5187
+ * Anchor configuration used to position the download bubble. This includes
5188
+ * the bounding rectangle and the anchor location within that rectangle.
5189
+ *
5190
+ * @returns {Promise<void>}
5191
+ * A promise that resolves once the request to show the download bubble
5192
+ * has been processed.
5193
+ */
5194
+ async showDownloadBubble(options) {
5195
+ return this.wire.sendAction('show-download-bubble', { ...this.identity, options }).then(() => undefined);
5196
+ }
5197
+ /**
5198
+ * Updates the anchor used for positioning the download bubble. This allows
5199
+ * moving the bubble reactively—for example, in response to window resizes,
5200
+ * layout changes, or DOM element repositioning.
5201
+ *
5202
+ * @param {OpenFin.Anchor} options
5203
+ * New anchor configuration describing the updated position and anchor
5204
+ * location for the download bubble.
5205
+ *
5206
+ * @returns {Promise<void>}
5207
+ * A promise that resolves once the anchor update has been applied.
5208
+ */
5209
+ async updateDownloadBubbleAnchor(options) {
5210
+ return this.wire
5211
+ .sendAction('update-download-bubble-anchor', { ...this.identity, options })
5212
+ .then(() => undefined);
5213
+ }
5182
5214
  }
5183
5215
  Instance$7._Window = _Window;
5184
5216
  return Instance$7;
@@ -6264,14 +6296,15 @@ class System extends base_1$m.EmitterBase {
6264
6296
  * Writes the passed message into both the log file and the console.
6265
6297
  * @param level The log level for the entry. Can be either "info", "warning" or "error"
6266
6298
  * @param message The log message text
6299
+ * @param target.type Optional. The the log stream this message will be sent to, defaults to 'debug.log'. Specify 'app.log' to log to the app log of the sending View / Window. Note, when using `app.log`, it will always log to app.log irrespective of the `enableAppLogging` setting for the sender. This is particularly useful if you wish to log certain things from a View / Window but ignore generic console logs.
6267
6300
  *
6268
6301
  * @example
6269
6302
  * ```js
6270
- * fin.System.log("info", "An example log message").then(() => console.log('Log info message')).catch(err => console.log(err));
6303
+ * fin.System.log("info", "An example log message", { type: 'debug.log' }).then(() => console.log('Log info message')).catch(err => console.log(err));
6271
6304
  * ```
6272
6305
  */
6273
- log(level, message) {
6274
- return this.wire.sendAction('write-to-log', { level, message }).then(() => undefined);
6306
+ log(level, message, { type = 'debug.log' } = {}) {
6307
+ return this.wire.sendAction('write-to-log', { level, message, target: { type } }).then(() => undefined);
6275
6308
  }
6276
6309
  /**
6277
6310
  * Opens the passed URL in the default web browser.
@@ -7287,6 +7320,88 @@ class System extends base_1$m.EmitterBase {
7287
7320
  async serveAsset(options) {
7288
7321
  return (await this.wire.sendAction('serve-asset', { options })).payload.data;
7289
7322
  }
7323
+ /**
7324
+ * Get's the native theme preferences for the current runtime.
7325
+ * Prefer css media-queries wherever possible, but this can be useful to see if the system setting has been overridden.
7326
+ * See @link OpenFin.NativeTheme for more information.
7327
+ * @example Theme selector menu
7328
+ * ```ts
7329
+ async function handleThemeMenu(e: React.MouseEvent<HTMLDivElement>) {
7330
+ const currentTheme = await fin.System.getThemePreferences();
7331
+ const result = await (fin.me as OpenFin.Window).showPopupMenu({
7332
+ x: e.clientX,
7333
+ y: e.clientY,
7334
+ template: [
7335
+ {
7336
+ label: 'Light',
7337
+ type: 'checkbox',
7338
+ checked: currentTheme.themeSource === 'light',
7339
+ data: { themeSource: 'light' } as const
7340
+ },
7341
+ {
7342
+ label: 'Dark',
7343
+ type: 'checkbox',
7344
+ checked: currentTheme.themeSource === 'dark',
7345
+ data: { themeSource: 'dark' } as const
7346
+ },
7347
+ {
7348
+ label: 'System',
7349
+ type: 'checkbox',
7350
+ checked: currentTheme.themeSource === 'system',
7351
+ data: { themeSource: 'system' } as const
7352
+ }
7353
+ ]
7354
+ });
7355
+ if (result.result === 'clicked') {
7356
+ await fin.System.setThemePreferences(result.data);
7357
+ }
7358
+ }
7359
+ ```
7360
+ */
7361
+ async getThemePreferences() {
7362
+ return (await this.wire.sendAction('get-theme-preferences')).payload.data;
7363
+ }
7364
+ /**
7365
+ * Sets the native theme preferences for the current runtime.
7366
+ * Can be used to force runtime-wide light or dark mode.
7367
+ * @important Due to this impacting all applications on a runtime, this method is only usable if a security realm has been set.
7368
+ * @example Theme selector menu
7369
+ * ```ts
7370
+ async function handleThemeMenu(e: React.MouseEvent<HTMLDivElement>) {
7371
+ const currentTheme = await fin.System.getThemePreferences();
7372
+ const result = await (fin.me as OpenFin.Window).showPopupMenu({
7373
+ x: e.clientX,
7374
+ y: e.clientY,
7375
+ template: [
7376
+ {
7377
+ label: 'Light',
7378
+ type: 'checkbox',
7379
+ checked: currentTheme.themeSource === 'light',
7380
+ data: { themeSource: 'light' } as const
7381
+ },
7382
+ {
7383
+ label: 'Dark',
7384
+ type: 'checkbox',
7385
+ checked: currentTheme.themeSource === 'dark',
7386
+ data: { themeSource: 'dark' } as const
7387
+ },
7388
+ {
7389
+ label: 'System',
7390
+ type: 'checkbox',
7391
+ checked: currentTheme.themeSource === 'system',
7392
+ data: { themeSource: 'system' } as const
7393
+ }
7394
+ ]
7395
+ });
7396
+ if (result.result === 'clicked') {
7397
+ await fin.System.setThemePreferences(result.data);
7398
+ }
7399
+ }
7400
+ ```
7401
+ */
7402
+ async setThemePreferences(preferences) {
7403
+ return (await this.wire.sendAction('set-theme-preferences', { preferences })).payload.data;
7404
+ }
7290
7405
  /**
7291
7406
  * Launches the Log Uploader. Full documentation can be found [here](https://resources.here.io/docs/core/develop/debug/log-uploader/).
7292
7407
  * @experimental
@@ -7294,6 +7409,21 @@ class System extends base_1$m.EmitterBase {
7294
7409
  async launchLogUploader(options) {
7295
7410
  return (await this.wire.sendAction('launch-log-uploader', { options })).payload.data;
7296
7411
  }
7412
+ /**
7413
+ * Overrides original Chromium theme color providers matching key (currently except high contrast ones). Only colors passed in the map will be overridden.
7414
+ * @param overrides - Array of ColorProviderOverrides objects
7415
+ */
7416
+ async setThemePalette(themePalette) {
7417
+ return (await this.wire.sendAction('set-theme-palette', { themePalette })).payload.data;
7418
+ }
7419
+ /**
7420
+ * Retrieves currently used color overrides
7421
+ * @returns Array of ColorProviderOverrides objects
7422
+ */
7423
+ async getThemePalette() {
7424
+ const { payload } = await this.wire.sendAction('get-theme-palette');
7425
+ return payload.data;
7426
+ }
7297
7427
  }
7298
7428
  system.System = System;
7299
7429
 
@@ -11688,7 +11818,7 @@ class LayoutNode {
11688
11818
  * Known Issue: If the number of views to add overflows the tab-container, the added views will be set as active
11689
11819
  * during each render, and then placed at the front of the tab-stack, while the underlying order of tabs will remain unchanged.
11690
11820
  * This means the views you pass to createAdjacentStack() may not render in the order given by the array.
11691
- * Until fixed, this problem can be avoided only if your window is wide enough to fit creating all the views in the tabstack.
11821
+ * Note: This issue does not occur when using `tabOverflowBehavior: 'scroll'` in the layout configuration.
11692
11822
  *
11693
11823
  * @param views The views that will populate the new TabStack.
11694
11824
  * @param options Additional options that control new TabStack creation.
@@ -11824,6 +11954,7 @@ class TabStack extends LayoutNode {
11824
11954
  * and rendered at the front of the tab-stack, while the underlying order of tabs will remain unchanged.
11825
11955
  * If that happens and then getViews() is called, it will return the identities in a different order than
11826
11956
  * than the currently rendered tab order.
11957
+ * Note: This issue does not occur when using `tabOverflowBehavior: 'scroll'` in the layout configuration.
11827
11958
  *
11828
11959
  *
11829
11960
  * @throws If the {@link TabStack} has been destroyed.
@@ -11848,6 +11979,7 @@ class TabStack extends LayoutNode {
11848
11979
  *
11849
11980
  * @remarks Known Issue: If adding a view overflows the tab-container, the added view will be set as active
11850
11981
  * and rendered at the front of the tab-stack, while the underlying order of tabs will remain unchanged.
11982
+ * Note: This issue does not occur when using `tabOverflowBehavior: 'scroll'` in the layout configuration.
11851
11983
  *
11852
11984
  * @param view The identity of an existing view to add, or options to create a view.
11853
11985
  * @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)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openfin/core",
3
- "version": "43.100.103",
3
+ "version": "43.100.105",
4
4
  "description": "The core renderer entry point of OpenFin",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "main": "out/stub.js",