@openfin/remote-adapter 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.
@@ -6277,6 +6277,68 @@ function requireInstance$1 () {
6277
6277
  return undefined;
6278
6278
  }
6279
6279
  }
6280
+ /**
6281
+ * Displays the download bubble UI. If an anchor is provided, the bubble
6282
+ * will be positioned according to the specified rectangle and anchor point.
6283
+ *
6284
+ * @param {OpenFin.Anchor} options
6285
+ * Anchor configuration used to position the download bubble. This includes
6286
+ * the bounding rectangle and the anchor location within that rectangle.
6287
+ *
6288
+ * @returns {Promise<void>}
6289
+ * A promise that resolves once the request to show the download bubble
6290
+ * has been processed.
6291
+ * @example
6292
+ * ```js
6293
+ * const w = fin.Window.getCurrentSync();
6294
+ * const el = document.getElementById("download-bubble-button");
6295
+ * const rect = el.getBoundingClientRect();
6296
+ * const anchor = {
6297
+ * bounds: rect,
6298
+ * location: "topRight"
6299
+ * };
6300
+ * w.showDownloadBubble(anchor);
6301
+ * ```
6302
+ */
6303
+ async showDownloadBubble(anchor) {
6304
+ return this.wire.sendAction('show-download-bubble', { ...this.identity, anchor }).then(() => undefined);
6305
+ }
6306
+ /**
6307
+ * Updates the anchor used for positioning the download bubble. This allows
6308
+ * moving the bubble reactively—for example, in response to window resizes,
6309
+ * layout changes, or DOM element repositioning.
6310
+ *
6311
+ * @param {OpenFin.Anchor} options
6312
+ * New anchor configuration describing the updated position and anchor
6313
+ * location for the download bubble.
6314
+ *
6315
+ * @returns {Promise<void>}
6316
+ * A promise that resolves once the anchor update has been applied.
6317
+ * @example
6318
+ * ```js
6319
+ * var w = fin.Window.getCurrentSync();
6320
+ * w.on('download-button-visibility-changed', (evt) => {
6321
+ * if (evt.visible) {
6322
+ * const el = document.getElementById("download-bubble-button");
6323
+ * //We show our button and get it's bounding rect
6324
+ * el.classList.remove("hidden");
6325
+ * const rect = el.getBoundingClientRect();
6326
+ * const anchor = {
6327
+ * bounds: rect,
6328
+ * location: "topRight"
6329
+ * }
6330
+ * w.updateDownloadBubbleAnchor(anchor);
6331
+ * } else {
6332
+ * //We hide our button
6333
+ * document.getElementById("download-bubble-button")?.classList.add("hidden");
6334
+ * }
6335
+ });
6336
+ */
6337
+ async updateDownloadBubbleAnchor(anchor) {
6338
+ return this.wire
6339
+ .sendAction('update-download-bubble-anchor', { ...this.identity, anchor })
6340
+ .then(() => undefined);
6341
+ }
6280
6342
  }
6281
6343
  Instance$6._Window = _Window;
6282
6344
  return Instance$6;
@@ -8734,14 +8796,15 @@ class System extends base_1$h.EmitterBase {
8734
8796
  * Writes the passed message into both the log file and the console.
8735
8797
  * @param level The log level for the entry. Can be either "info", "warning" or "error"
8736
8798
  * @param message The log message text
8799
+ * @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.
8737
8800
  *
8738
8801
  * @example
8739
8802
  * ```js
8740
- * fin.System.log("info", "An example log message").then(() => console.log('Log info message')).catch(err => console.log(err));
8803
+ * fin.System.log("info", "An example log message", { type: 'debug.log' }).then(() => console.log('Log info message')).catch(err => console.log(err));
8741
8804
  * ```
8742
8805
  */
8743
- log(level, message) {
8744
- return this.wire.sendAction('write-to-log', { level, message }).then(() => undefined);
8806
+ log(level, message, target) {
8807
+ return this.wire.sendAction('write-to-log', { level, message, target: target ?? {} }).then(() => undefined);
8745
8808
  }
8746
8809
  /**
8747
8810
  * Opens the passed URL in the default web browser.
@@ -9757,6 +9820,88 @@ class System extends base_1$h.EmitterBase {
9757
9820
  async serveAsset(options) {
9758
9821
  return (await this.wire.sendAction('serve-asset', { options })).payload.data;
9759
9822
  }
9823
+ /**
9824
+ * Get's the native theme preferences for the current runtime.
9825
+ * Prefer css media-queries wherever possible, but this can be useful to see if the system setting has been overridden.
9826
+ * See @link OpenFin.NativeTheme for more information.
9827
+ * @example Theme selector menu
9828
+ * ```ts
9829
+ async function handleThemeMenu(e: React.MouseEvent<HTMLDivElement>) {
9830
+ const currentTheme = await fin.System.getThemePreferences();
9831
+ const result = await (fin.me as OpenFin.Window).showPopupMenu({
9832
+ x: e.clientX,
9833
+ y: e.clientY,
9834
+ template: [
9835
+ {
9836
+ label: 'Light',
9837
+ type: 'checkbox',
9838
+ checked: currentTheme.themeSource === 'light',
9839
+ data: { themeSource: 'light' } as const
9840
+ },
9841
+ {
9842
+ label: 'Dark',
9843
+ type: 'checkbox',
9844
+ checked: currentTheme.themeSource === 'dark',
9845
+ data: { themeSource: 'dark' } as const
9846
+ },
9847
+ {
9848
+ label: 'System',
9849
+ type: 'checkbox',
9850
+ checked: currentTheme.themeSource === 'system',
9851
+ data: { themeSource: 'system' } as const
9852
+ }
9853
+ ]
9854
+ });
9855
+ if (result.result === 'clicked') {
9856
+ await fin.System.setThemePreferences(result.data);
9857
+ }
9858
+ }
9859
+ ```
9860
+ */
9861
+ async getThemePreferences() {
9862
+ return (await this.wire.sendAction('get-theme-preferences')).payload.data;
9863
+ }
9864
+ /**
9865
+ * Sets the native theme preferences for the current runtime.
9866
+ * Can be used to force runtime-wide light or dark mode.
9867
+ * @important Due to this impacting all applications on a runtime, this method is only usable if a security realm has been set.
9868
+ * @example Theme selector menu
9869
+ * ```ts
9870
+ async function handleThemeMenu(e: React.MouseEvent<HTMLDivElement>) {
9871
+ const currentTheme = await fin.System.getThemePreferences();
9872
+ const result = await (fin.me as OpenFin.Window).showPopupMenu({
9873
+ x: e.clientX,
9874
+ y: e.clientY,
9875
+ template: [
9876
+ {
9877
+ label: 'Light',
9878
+ type: 'checkbox',
9879
+ checked: currentTheme.themeSource === 'light',
9880
+ data: { themeSource: 'light' } as const
9881
+ },
9882
+ {
9883
+ label: 'Dark',
9884
+ type: 'checkbox',
9885
+ checked: currentTheme.themeSource === 'dark',
9886
+ data: { themeSource: 'dark' } as const
9887
+ },
9888
+ {
9889
+ label: 'System',
9890
+ type: 'checkbox',
9891
+ checked: currentTheme.themeSource === 'system',
9892
+ data: { themeSource: 'system' } as const
9893
+ }
9894
+ ]
9895
+ });
9896
+ if (result.result === 'clicked') {
9897
+ await fin.System.setThemePreferences(result.data);
9898
+ }
9899
+ }
9900
+ ```
9901
+ */
9902
+ async setThemePreferences(preferences) {
9903
+ return (await this.wire.sendAction('set-theme-preferences', { preferences })).payload.data;
9904
+ }
9760
9905
  /**
9761
9906
  * Launches the Log Uploader. Full documentation can be found [here](https://resources.here.io/docs/core/develop/debug/log-uploader/).
9762
9907
  * @experimental
@@ -9764,6 +9909,45 @@ class System extends base_1$h.EmitterBase {
9764
9909
  async launchLogUploader(options) {
9765
9910
  return (await this.wire.sendAction('launch-log-uploader', { options })).payload.data;
9766
9911
  }
9912
+ /**
9913
+ * Overrides original Chromium theme color providers matching key (currently except high contrast ones). Only colors passed in the map will be overridden.
9914
+ * @param overrides - Array of ColorProviderOverrides objects
9915
+ * @example
9916
+ * ```ts
9917
+ * await fin.System.setThemePalette([
9918
+ * {
9919
+ * colorProviderKey: { colorMode: 'light' },
9920
+ * colorsMap: {
9921
+ * kColorLabelForeground: 4278190080,
9922
+ * kColorBubbleBackground: 4293980400
9923
+ * }
9924
+ * },
9925
+ * {
9926
+ * colorProviderKey: { colorMode: 'dark' },
9927
+ * colorsMap: {
9928
+ * kColorLabelForeground: 4293980400,
9929
+ * kColorBubbleBackground: 4293980400
9930
+ * }
9931
+ * }
9932
+ * ]);
9933
+ * ```
9934
+ */
9935
+ async setThemePalette(themePalette) {
9936
+ return (await this.wire.sendAction('set-theme-palette', { themePalette })).payload.data;
9937
+ }
9938
+ /**
9939
+ * Retrieves currently used color overrides
9940
+ * @returns Array of ColorProviderOverrides objects
9941
+ * @example
9942
+ * ```ts
9943
+ * const themePalette = await fin.System.getThemePalette();
9944
+ * console.log(themePalette);
9945
+ * ```
9946
+ */
9947
+ async getThemePalette() {
9948
+ const { payload } = await this.wire.sendAction('get-theme-palette');
9949
+ return payload.data;
9950
+ }
9767
9951
  }
9768
9952
  system.System = System;
9769
9953
 
@@ -13814,7 +13998,7 @@ class LayoutNode {
13814
13998
  * Known Issue: If the number of views to add overflows the tab-container, the added views will be set as active
13815
13999
  * during each render, and then placed at the front of the tab-stack, while the underlying order of tabs will remain unchanged.
13816
14000
  * This means the views you pass to createAdjacentStack() may not render in the order given by the array.
13817
- * Until fixed, this problem can be avoided only if your window is wide enough to fit creating all the views in the tabstack.
14001
+ * Note: This issue does not occur when using `tabOverflowBehavior: 'scroll'` in the layout configuration.
13818
14002
  *
13819
14003
  * @param views The views that will populate the new TabStack.
13820
14004
  * @param options Additional options that control new TabStack creation.
@@ -13950,6 +14134,7 @@ class TabStack extends LayoutNode {
13950
14134
  * and rendered at the front of the tab-stack, while the underlying order of tabs will remain unchanged.
13951
14135
  * If that happens and then getViews() is called, it will return the identities in a different order than
13952
14136
  * than the currently rendered tab order.
14137
+ * Note: This issue does not occur when using `tabOverflowBehavior: 'scroll'` in the layout configuration.
13953
14138
  *
13954
14139
  *
13955
14140
  * @throws If the {@link TabStack} has been destroyed.
@@ -13974,6 +14159,7 @@ class TabStack extends LayoutNode {
13974
14159
  *
13975
14160
  * @remarks Known Issue: If adding a view overflows the tab-container, the added view will be set as active
13976
14161
  * and rendered at the front of the tab-stack, while the underlying order of tabs will remain unchanged.
14162
+ * Note: This issue does not occur when using `tabOverflowBehavior: 'scroll'` in the layout configuration.
13977
14163
  *
13978
14164
  * @param view The identity of an existing view to add, or options to create a view.
13979
14165
  * @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/remote-adapter",
3
- "version": "43.100.104",
3
+ "version": "43.100.106",
4
4
  "description": "Establish intermachine runtime connections using webRTC.",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "private": false,
@@ -20,6 +20,6 @@
20
20
  "author": "OpenFin",
21
21
  "dependencies": {
22
22
  "lodash": "^4.17.21",
23
- "@openfin/core": "43.100.104"
23
+ "@openfin/core": "43.100.106"
24
24
  }
25
25
  }