@openfin/workspace 17.2.13 → 17.4.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.
@@ -5,4 +5,4 @@ import type { LaunchAppRequest } from '../shapes';
5
5
  * @param app the app directory entry.
6
6
  * @param opts launch options.
7
7
  */
8
- export declare function launchApp({ app, target }: LaunchAppRequest): Promise<void | OpenFin.View | OpenFin.Identity | OpenFin.Platform | OpenFin.Application>;
8
+ export declare function launchApp({ app, target }: LaunchAppRequest): Promise<void | OpenFin.Identity | OpenFin.Platform | OpenFin.View | OpenFin.Application>;
@@ -1,4 +1,3 @@
1
- export declare function registerViewCleanUp(): void;
2
1
  /**
3
2
  * Cleanup browser modals.
4
3
  *
@@ -98,6 +98,20 @@ export declare const enum ColorSchemeOptionType {
98
98
  Dark = "dark",
99
99
  System = "system"
100
100
  }
101
+ /**
102
+ * Defines the title used for the browser window.
103
+ * `custom` - uses the value of `value` property
104
+ * `page-title` - uses the title of the active page
105
+ * `view-title` - uses the title of the active view
106
+ */
107
+ export type WindowTitle = {
108
+ type: 'custom';
109
+ value: string;
110
+ } | {
111
+ type: 'page-title';
112
+ } | {
113
+ type: 'view-title';
114
+ };
101
115
  /**Types of page tab context menu options, including pre-defined ones.
102
116
  * User-defined context menu items should use the value `Custom` */
103
117
  export declare enum PageTabContextMenuOptionType {
@@ -284,6 +298,10 @@ export interface UpdateAttachedPageRequest {
284
298
  /** The updated page. */
285
299
  page: Partial<PageWithUpdatableRuntimeAttribs>;
286
300
  }
301
+ export interface ReparentPageRequest {
302
+ /** The ID of the page to reparent. */
303
+ pageId: string;
304
+ }
287
305
  /**
288
306
  * Types of buttons on browser windows
289
307
  */
@@ -519,8 +537,11 @@ export interface BrowserWorkspacePlatformWindowOptions {
519
537
  pages: Page[];
520
538
  /** The favicon to display on the top left of the created browser window. */
521
539
  favicon?: string;
522
- /** A UI friendly title for the created browser window. */
523
- title?: string;
540
+ /**
541
+ * A UI friendly title for the created browser window.
542
+ * Type string for window title is deprecated, please use WindowTitle type instead.
543
+ */
544
+ title?: WindowTitle | string;
524
545
  /**
525
546
  * Landing page that shows up when you add a new tab from the plus button that exists in the tabstrip.
526
547
  * If you do not provide a newTabUrl, then the plus button in the tabstrip will not be shown and users cannot create a new empty tab.
@@ -717,6 +738,28 @@ export interface BrowserWindowModule {
717
738
  * @param page the attach page to a browser window.
718
739
  */
719
740
  addPage(page: PageWithUpdatableRuntimeAttribs): Promise<void>;
741
+ /**
742
+ * Remove an existing page from an existing browser window and reparent it to another existing browser window.
743
+ * If `multiplePagesDisabled` is `true` an error will be thrown.
744
+ *
745
+ * ```ts
746
+ * import * as WorkspacePlatform from '@openfin/workspace-platform';
747
+ *
748
+ * const workspacePlatform = WorkspacePlatform.getCurrentSync();
749
+ *
750
+ * // assume a page and multiple browser windows already exists
751
+ * const wrappedTargetWindow = workspacePlatform.Browser.wrapSync(identity)
752
+ * const reparentPageRequest = { pageId: 'my-target-page' }
753
+ * // wrap the window to which you wish to move the page and call reparentPage
754
+ * await wrappedTargetWindow.reparentPage(reparentPageRequest);
755
+ * // focus window
756
+ * await wrappedTargetWindow.openfinWindow.focus();
757
+ * // restore window if minimized
758
+ * await wrappedTargetWindow.openfinWindow.restore();
759
+ * ```
760
+ * @param req the reparent page request.
761
+ */
762
+ reparentPage(req: ReparentPageRequest): Promise<void>;
720
763
  /**
721
764
  * Remove an attached page from the browser window.
722
765
  *
@@ -843,6 +886,31 @@ export interface BrowserWindowModule {
843
886
  * @param options new window state options.
844
887
  */
845
888
  replaceWindowStateButtonOptions(options: WindowStateButtonOptions): Promise<void>;
889
+ /**
890
+ * Updates the browser window title based on the provided title object.
891
+ *
892
+ * @param title The new title object for the browser window.
893
+ *
894
+ * @example
895
+ * ```typescript
896
+ * import * as WorkspacePlatform from '@openfin/workspace-platform';
897
+ * const workspacePlatform = WorkspacePlatform.getCurrentSync();
898
+ * workspacePlatform.Browser.wrapSync(identity).updateBrowserWindowTitle({type: 'view-title'});
899
+ * ```
900
+ *
901
+ * @example
902
+ * ```typescript
903
+ * import * as WorkspacePlatform from '@openfin/workspace-platform';
904
+ * const workspacePlatform = WorkspacePlatform.getCurrentSync();
905
+ * workspacePlatform.Browser.wrapSync(identity).updateBrowserWindowTitle({type: 'custom', value: 'My Custom Title'});
906
+ * ```
907
+ *
908
+ * @typedef WindowTitle
909
+ * @type {Object}
910
+ * @property {string} type - The type of the window title ('custom', 'page-title', or 'view-title').
911
+ * @property {string} [value] - The value associated with the 'custom' type.
912
+ */
913
+ updateBrowserWindowTitle(title: WindowTitle): Promise<void>;
846
914
  /**
847
915
  * Open global context menu in the browser window. By default, this context menu appears
848
916
  * when clicking on the logo in the upper-left corner of the window.
@@ -1288,6 +1356,7 @@ export interface WorkspacePlatformModule extends OpenFin.Platform {
1288
1356
  * Launch a browser snapshot that contains windows with pages.
1289
1357
  *
1290
1358
  * @param snapshot the browser snapshot to launch or a url or filepath to retrieve a JSON snapshot.
1359
+ * @param options options for launching the snapshot.
1291
1360
  */
1292
1361
  applySnapshot(snapshot: BrowserSnapshot | string, options?: OpenFin.ApplySnapshotOptions): Promise<OpenFin.Platform>;
1293
1362
  /**
@@ -1536,7 +1605,7 @@ export interface WorkspacePlatformProvider extends OpenFin.PlatformProvider {
1536
1605
  deleteSavedWorkspace(id: string): Promise<void>;
1537
1606
  /**
1538
1607
  * Applies a workspace to the user's desktop. Makes that workspace the active workspace.
1539
- * @param applyWorkspacePayload {@link ApplyWorkspacePayload}
1608
+ * @param payload {@link ApplyWorkspacePayload}
1540
1609
  *
1541
1610
  * @returns true if the workspace was applied, false if the workspace was not applied.
1542
1611
  */
@@ -2029,6 +2098,7 @@ interface WorkspaceMetadata {
2029
2098
  }
2030
2099
  export interface Workspace {
2031
2100
  workspaceId: string;
2101
+ /** While not required, it is suggested that Workspace titles be unique. */
2032
2102
  title: string;
2033
2103
  metadata?: WorkspaceMetadata;
2034
2104
  snapshot: BrowserSnapshot;
@@ -19,6 +19,7 @@ export interface Overrides {
19
19
  analyticsEndpoint: string;
20
20
  translationOverridesUrl: string;
21
21
  }
22
+ export declare function getManifestOverrides(): Promise<Partial<Overrides>>;
22
23
  export declare function getOverrides(): Promise<Partial<Overrides>>;
23
24
  export declare const useOverrides: () => Partial<Overrides>;
24
25
  export {};
@@ -0,0 +1,13 @@
1
+ import type OpenFin from '@openfin/core';
2
+ import type { AttachedPage, Page } from '../../../../client-api-platform/src/shapes';
3
+ export interface PagesLayoutSnapshot {
4
+ layouts: {
5
+ [pageId: string]: OpenFin.LayoutOptions;
6
+ };
7
+ pages: Page[];
8
+ }
9
+ export declare const convertPagesToLayoutSnapshot: (pages: Page[]) => {
10
+ layouts: Record<string, OpenFin.LayoutOptions>;
11
+ pages: Page[];
12
+ };
13
+ export declare const convertLayoutSnapshotToPages: ({ pages, layouts }: PagesLayoutSnapshot) => AttachedPage[];
@@ -85,6 +85,9 @@ type AttachedPageMetadata = {
85
85
  panels?: ExtendedPanelConfig[];
86
86
  };
87
87
  export type AttachedPage = Page & AttachedPageMetadata;
88
+ export type ReparentAttachedPage = AttachedPage & {
89
+ multiInstanceViewBehavior?: 'reparent';
90
+ };
88
91
  export type PageWithUpdatableRuntimeAttribs = Page & Pick<AttachedPage, 'hasUnsavedChanges'>;
89
92
  export interface DetachPagesFromWindowPayload {
90
93
  /** The OF window identity to detach the pages from. */
@@ -11,7 +11,7 @@ export declare const isDocumentDefined: boolean;
11
11
  export declare const isWindowDefinedWithIndexDB: boolean;
12
12
  export declare const finUUID: string;
13
13
  export declare const finName: string;
14
- export declare const finEntityType: "" | "window" | "view";
14
+ export declare const finEntityType: "" | "view" | "window";
15
15
  export declare const isEnvLocal: boolean;
16
16
  export declare const isEnvDev: boolean;
17
17
  export declare const isEnvStaging: boolean;
@@ -63,7 +63,7 @@ export declare const addLayoutEventListener: (event: LayoutDOMEventType, listene
63
63
  /**
64
64
  * Initialize the layout for the current OF window.
65
65
  */
66
- export declare const initLayout: () => Promise<void>;
66
+ export declare const initLayoutListeners: () => Promise<void>;
67
67
  /**
68
68
  * Deep clones a layout and changes its settings to make it "locked".
69
69
  * @param layout The Layout to be locked
@@ -29,7 +29,7 @@ export declare enum AnalyticsSource {
29
29
  Dock = "Dock",
30
30
  Home = "Home",
31
31
  Notification = "Notification",
32
- Storefront = "Storefront",
32
+ Storefront = "Store",
33
33
  Platform = "Platform",
34
34
  Theming = "Theming",
35
35
  Interop = "Interop"