@openfin/core 43.100.104 → 43.100.106

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,68 @@ 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
+ * @example
5194
+ * ```js
5195
+ * const w = fin.Window.getCurrentSync();
5196
+ * const el = document.getElementById("download-bubble-button");
5197
+ * const rect = el.getBoundingClientRect();
5198
+ * const anchor = {
5199
+ * bounds: rect,
5200
+ * location: "topRight"
5201
+ * };
5202
+ * w.showDownloadBubble(anchor);
5203
+ * ```
5204
+ */
5205
+ async showDownloadBubble(anchor) {
5206
+ return this.wire.sendAction('show-download-bubble', { ...this.identity, anchor }).then(() => undefined);
5207
+ }
5208
+ /**
5209
+ * Updates the anchor used for positioning the download bubble. This allows
5210
+ * moving the bubble reactively—for example, in response to window resizes,
5211
+ * layout changes, or DOM element repositioning.
5212
+ *
5213
+ * @param {OpenFin.Anchor} options
5214
+ * New anchor configuration describing the updated position and anchor
5215
+ * location for the download bubble.
5216
+ *
5217
+ * @returns {Promise<void>}
5218
+ * A promise that resolves once the anchor update has been applied.
5219
+ * @example
5220
+ * ```js
5221
+ * var w = fin.Window.getCurrentSync();
5222
+ * w.on('download-button-visibility-changed', (evt) => {
5223
+ * if (evt.visible) {
5224
+ * const el = document.getElementById("download-bubble-button");
5225
+ * //We show our button and get it's bounding rect
5226
+ * el.classList.remove("hidden");
5227
+ * const rect = el.getBoundingClientRect();
5228
+ * const anchor = {
5229
+ * bounds: rect,
5230
+ * location: "topRight"
5231
+ * }
5232
+ * w.updateDownloadBubbleAnchor(anchor);
5233
+ * } else {
5234
+ * //We hide our button
5235
+ * document.getElementById("download-bubble-button")?.classList.add("hidden");
5236
+ * }
5237
+ });
5238
+ */
5239
+ async updateDownloadBubbleAnchor(anchor) {
5240
+ return this.wire
5241
+ .sendAction('update-download-bubble-anchor', { ...this.identity, anchor })
5242
+ .then(() => undefined);
5243
+ }
5182
5244
  }
5183
5245
  Instance$7._Window = _Window;
5184
5246
  return Instance$7;
@@ -6264,14 +6326,15 @@ class System extends base_1$m.EmitterBase {
6264
6326
  * Writes the passed message into both the log file and the console.
6265
6327
  * @param level The log level for the entry. Can be either "info", "warning" or "error"
6266
6328
  * @param message The log message text
6329
+ * @param target 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
6330
  *
6268
6331
  * @example
6269
6332
  * ```js
6270
- * fin.System.log("info", "An example log message").then(() => console.log('Log info message')).catch(err => console.log(err));
6333
+ * fin.System.log("info", "An example log message", { type: 'debug.log' }).then(() => console.log('Log info message')).catch(err => console.log(err));
6271
6334
  * ```
6272
6335
  */
6273
- log(level, message) {
6274
- return this.wire.sendAction('write-to-log', { level, message }).then(() => undefined);
6336
+ log(level, message, target) {
6337
+ return this.wire.sendAction('write-to-log', { level, message, target: target ?? {} }).then(() => undefined);
6275
6338
  }
6276
6339
  /**
6277
6340
  * Opens the passed URL in the default web browser.
@@ -7287,6 +7350,88 @@ class System extends base_1$m.EmitterBase {
7287
7350
  async serveAsset(options) {
7288
7351
  return (await this.wire.sendAction('serve-asset', { options })).payload.data;
7289
7352
  }
7353
+ /**
7354
+ * Get's the native theme preferences for the current runtime.
7355
+ * Prefer css media-queries wherever possible, but this can be useful to see if the system setting has been overridden.
7356
+ * See @link OpenFin.NativeTheme for more information.
7357
+ * @example Theme selector menu
7358
+ * ```ts
7359
+ async function handleThemeMenu(e: React.MouseEvent<HTMLDivElement>) {
7360
+ const currentTheme = await fin.System.getThemePreferences();
7361
+ const result = await (fin.me as OpenFin.Window).showPopupMenu({
7362
+ x: e.clientX,
7363
+ y: e.clientY,
7364
+ template: [
7365
+ {
7366
+ label: 'Light',
7367
+ type: 'checkbox',
7368
+ checked: currentTheme.themeSource === 'light',
7369
+ data: { themeSource: 'light' } as const
7370
+ },
7371
+ {
7372
+ label: 'Dark',
7373
+ type: 'checkbox',
7374
+ checked: currentTheme.themeSource === 'dark',
7375
+ data: { themeSource: 'dark' } as const
7376
+ },
7377
+ {
7378
+ label: 'System',
7379
+ type: 'checkbox',
7380
+ checked: currentTheme.themeSource === 'system',
7381
+ data: { themeSource: 'system' } as const
7382
+ }
7383
+ ]
7384
+ });
7385
+ if (result.result === 'clicked') {
7386
+ await fin.System.setThemePreferences(result.data);
7387
+ }
7388
+ }
7389
+ ```
7390
+ */
7391
+ async getThemePreferences() {
7392
+ return (await this.wire.sendAction('get-theme-preferences')).payload.data;
7393
+ }
7394
+ /**
7395
+ * Sets the native theme preferences for the current runtime.
7396
+ * Can be used to force runtime-wide light or dark mode.
7397
+ * @important Due to this impacting all applications on a runtime, this method is only usable if a security realm has been set.
7398
+ * @example Theme selector menu
7399
+ * ```ts
7400
+ async function handleThemeMenu(e: React.MouseEvent<HTMLDivElement>) {
7401
+ const currentTheme = await fin.System.getThemePreferences();
7402
+ const result = await (fin.me as OpenFin.Window).showPopupMenu({
7403
+ x: e.clientX,
7404
+ y: e.clientY,
7405
+ template: [
7406
+ {
7407
+ label: 'Light',
7408
+ type: 'checkbox',
7409
+ checked: currentTheme.themeSource === 'light',
7410
+ data: { themeSource: 'light' } as const
7411
+ },
7412
+ {
7413
+ label: 'Dark',
7414
+ type: 'checkbox',
7415
+ checked: currentTheme.themeSource === 'dark',
7416
+ data: { themeSource: 'dark' } as const
7417
+ },
7418
+ {
7419
+ label: 'System',
7420
+ type: 'checkbox',
7421
+ checked: currentTheme.themeSource === 'system',
7422
+ data: { themeSource: 'system' } as const
7423
+ }
7424
+ ]
7425
+ });
7426
+ if (result.result === 'clicked') {
7427
+ await fin.System.setThemePreferences(result.data);
7428
+ }
7429
+ }
7430
+ ```
7431
+ */
7432
+ async setThemePreferences(preferences) {
7433
+ return (await this.wire.sendAction('set-theme-preferences', { preferences })).payload.data;
7434
+ }
7290
7435
  /**
7291
7436
  * Launches the Log Uploader. Full documentation can be found [here](https://resources.here.io/docs/core/develop/debug/log-uploader/).
7292
7437
  * @experimental
@@ -7294,6 +7439,45 @@ class System extends base_1$m.EmitterBase {
7294
7439
  async launchLogUploader(options) {
7295
7440
  return (await this.wire.sendAction('launch-log-uploader', { options })).payload.data;
7296
7441
  }
7442
+ /**
7443
+ * Overrides original Chromium theme color providers matching key (currently except high contrast ones). Only colors passed in the map will be overridden.
7444
+ * @param overrides - Array of ColorProviderOverrides objects
7445
+ * @example
7446
+ * ```ts
7447
+ * await fin.System.setThemePalette([
7448
+ * {
7449
+ * colorProviderKey: { colorMode: 'light' },
7450
+ * colorsMap: {
7451
+ * kColorLabelForeground: 4278190080,
7452
+ * kColorBubbleBackground: 4293980400
7453
+ * }
7454
+ * },
7455
+ * {
7456
+ * colorProviderKey: { colorMode: 'dark' },
7457
+ * colorsMap: {
7458
+ * kColorLabelForeground: 4293980400,
7459
+ * kColorBubbleBackground: 4293980400
7460
+ * }
7461
+ * }
7462
+ * ]);
7463
+ * ```
7464
+ */
7465
+ async setThemePalette(themePalette) {
7466
+ return (await this.wire.sendAction('set-theme-palette', { themePalette })).payload.data;
7467
+ }
7468
+ /**
7469
+ * Retrieves currently used color overrides
7470
+ * @returns Array of ColorProviderOverrides objects
7471
+ * @example
7472
+ * ```ts
7473
+ * const themePalette = await fin.System.getThemePalette();
7474
+ * console.log(themePalette);
7475
+ * ```
7476
+ */
7477
+ async getThemePalette() {
7478
+ const { payload } = await this.wire.sendAction('get-theme-palette');
7479
+ return payload.data;
7480
+ }
7297
7481
  }
7298
7482
  system.System = System;
7299
7483
 
@@ -11688,7 +11872,7 @@ class LayoutNode {
11688
11872
  * Known Issue: If the number of views to add overflows the tab-container, the added views will be set as active
11689
11873
  * during each render, and then placed at the front of the tab-stack, while the underlying order of tabs will remain unchanged.
11690
11874
  * 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.
11875
+ * Note: This issue does not occur when using `tabOverflowBehavior: 'scroll'` in the layout configuration.
11692
11876
  *
11693
11877
  * @param views The views that will populate the new TabStack.
11694
11878
  * @param options Additional options that control new TabStack creation.
@@ -11824,6 +12008,7 @@ class TabStack extends LayoutNode {
11824
12008
  * and rendered at the front of the tab-stack, while the underlying order of tabs will remain unchanged.
11825
12009
  * If that happens and then getViews() is called, it will return the identities in a different order than
11826
12010
  * than the currently rendered tab order.
12011
+ * Note: This issue does not occur when using `tabOverflowBehavior: 'scroll'` in the layout configuration.
11827
12012
  *
11828
12013
  *
11829
12014
  * @throws If the {@link TabStack} has been destroyed.
@@ -11848,6 +12033,7 @@ class TabStack extends LayoutNode {
11848
12033
  *
11849
12034
  * @remarks Known Issue: If adding a view overflows the tab-container, the added view will be set as active
11850
12035
  * and rendered at the front of the tab-stack, while the underlying order of tabs will remain unchanged.
12036
+ * Note: This issue does not occur when using `tabOverflowBehavior: 'scroll'` in the layout configuration.
11851
12037
  *
11852
12038
  * @param view The identity of an existing view to add, or options to create a view.
11853
12039
  * @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.104",
3
+ "version": "43.100.106",
4
4
  "description": "The core renderer entry point of OpenFin",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "main": "out/stub.js",