@openfin/workspace-platform 45.1.19 → 45.2.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.
@@ -1,7 +1,7 @@
1
1
  import type OpenFin from '@openfin/core';
2
2
  import { App } from '../../../client-api/src/shapes';
3
3
  import { SearchProvider } from '../../../client-api-platform/src/shapes';
4
- import type { LaunchAppRequest, SearchSitesRequest, SearchSitesResponse, Site } from '../shapes';
4
+ import type { ContentSortRequest, LaunchAppRequest, SearchSitesRequest, SearchSitesResponse, Site } from '../shapes';
5
5
  /**
6
6
  * Launch the app described by an App Directory entry.
7
7
  * @param app the app directory entry.
@@ -19,7 +19,8 @@ export declare function getSearchProviders(payload: {
19
19
  }): Promise<SearchProvider[]>;
20
20
  export declare function getCuratedContent(payload: {
21
21
  identity: OpenFin.Identity;
22
+ req?: ContentSortRequest;
22
23
  }): Promise<Site[]>;
23
- export declare function getRecentlyVisited(payload: {
24
- identity: OpenFin.Identity;
24
+ export declare function getRecentlyVisited(payload: ContentSortRequest & {
25
+ identity?: OpenFin.Identity;
25
26
  }): Promise<App[]>;
@@ -10,5 +10,7 @@ export declare function getLanguageResourcesInternal(): {
10
10
  * initLanguage()
11
11
  * @param language - optional - ISO language code. Built-in languages are always accepted.
12
12
  * Any language code defined in the external `translation-override.json` is also accepted.
13
+ * @param languagePacksApiUrl - optional i18next-http-backend loadPath. When set,
14
+ * HTTP language packs are used instead of the bundled locale JSON.
13
15
  */
14
- export default function initLanguage(language?: Locale): Promise<void>;
16
+ export default function initLanguage(language?: Locale, languagePacksApiUrl?: string): Promise<void>;
@@ -1 +1,2 @@
1
1
  import '@common/test/fin-mocks';
2
+ import '@common/test/logger-mock';
@@ -1,2 +1,3 @@
1
1
  import { OpenFin } from '@openfin/core';
2
+ export declare const INTERNAL_VIEW_PROCESS_AFFINITY = "eb-internal-ui";
2
3
  export declare const createNonLayoutViewComponents: (isEnterprise: boolean, overrideOptions: OpenFin.PlatformWindowCreationOptions) => Promise<void[]>;
@@ -0,0 +1 @@
1
+ import '@common/test/fin-mocks';
@@ -1,8 +1,9 @@
1
1
  import type OpenFin from '@openfin/core';
2
+ import type { BrowserCreateViewRequest } from '../../../../client-api-platform/src/shapes';
2
3
  type DefaultViewOptions = Partial<OpenFin.MutableViewOptions> & {
3
4
  downloadShelf?: OpenFin.ConstWindowOptions['downloadShelf'];
4
5
  hotkeys?: OpenFin.ViewOptions['hotkeys'];
5
6
  };
6
7
  export declare const DEFAULT_VIEW_OPTIONS: DefaultViewOptions;
7
- export declare function applyViewDefaults(options: Partial<OpenFin.ViewOptions>, initViewOptions?: Partial<OpenFin.ViewOptions>): Promise<any>;
8
+ export declare function applyViewDefaults(options: Partial<BrowserCreateViewRequest>, initViewOptions?: Partial<BrowserCreateViewRequest>): Promise<any>;
8
9
  export {};
@@ -658,13 +658,23 @@ export interface BrowserWorkspacePlatformWindowOptions {
658
658
  */
659
659
  title?: WindowTitle | string;
660
660
  /**
661
- * Landing page that shows up when you add a new tab from the plus button that exists in the tabstrip.
662
- * 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.
661
+ * URL used for new-tab actions: the plus button in the tabstrip, the new-tab hotkey, and the
662
+ * "New tab" context menu entry.
663
+ *
664
+ * If you do not provide a newTabUrl, then the plus button in the tabstrip will not be shown and
665
+ * users cannot create a new empty tab.
666
+ *
667
+ * This does not control a newly created window's initial content; that comes from `pages`.
663
668
  */
664
669
  newTabUrl?: string;
665
670
  /**
666
- * Landing page that shows up when you add a new page from the plus button that exists in the window frame where the page selector is shown.
667
- * If you do not provide a newPageUrl, then the new Page plus button will not be shown and you cannot create a new empty Page or Window.
671
+ * URL used for new-page and new-window actions.
672
+ *
673
+ * If you do not provide a newPageUrl, then the new Page plus button will not be shown and you
674
+ * cannot create a new empty Page or Window.
675
+ *
676
+ * This does not automatically control a newly created window's initial content; a caller of
677
+ * `Browser.createWindow` must include a page using this URL in `pages`.
668
678
  */
669
679
  newPageUrl?: string;
670
680
  toolbarOptions?: ToolbarOptions;
@@ -2234,6 +2244,10 @@ export interface WorkspacePlatformInitConfig {
2234
2244
  * external `translation-override.json` (configured via `translationOverridesUrl`) is
2235
2245
  * also accepted.
2236
2246
  *
2247
+ * When `languagePacksApiUrl` is set, i18next loads packs over HTTP from that
2248
+ * i18next-http-backend `loadPath` (e.g. `${origin}/platform/api/localization/{{lng}}/{{ns}}.json`)
2249
+ * instead of the bundled locale JSON. Omit it to keep the built-in packs.
2250
+ *
2237
2251
  * @example
2238
2252
  * ```ts
2239
2253
  * await WorkspacePlatform.init({
@@ -2250,6 +2264,11 @@ export interface WorkspacePlatformInitConfig {
2250
2264
  */
2251
2265
  language?: {
2252
2266
  initialLanguage?: Locale;
2267
+ /**
2268
+ * i18next-http-backend loadPath. When provided, HTTP language packs are used
2269
+ * even if the manifest did not inject `languagePacksApiUrl`.
2270
+ */
2271
+ languagePacksApiUrl?: string;
2253
2272
  };
2254
2273
  /**
2255
2274
  * Override workspace platform behavior
@@ -2497,9 +2516,28 @@ export interface BrowserInitConfig {
2497
2516
  /** Default options when creating a new page. If `iconUrl`, `unsavedIconUrl`, `panels` or `closeButton` are not defined when creating a page, setting will default to `defaultPageOptions`. */
2498
2517
  defaultPageOptions?: Pick<Page, 'iconUrl' | 'unsavedIconUrl' | 'closeButton' | 'panels'>;
2499
2518
  /**
2500
- * The default options when creating a new browser window. Any option not included in WorkspacePlatform.getCurrentSync().Browser.createView(options) call will default to the value provided in this field.
2519
+ * The default options when creating a new view. Any option not included in WorkspacePlatform.getCurrentSync().Browser.createView(options) call will default to the value provided in this field.
2520
+ *
2521
+ * @example
2522
+ * ```ts
2523
+ * import * as WorkspacePlatform from '@openfin/workspace-platform';
2524
+ *
2525
+ * await WorkspacePlatform.init({
2526
+ * browser: {
2527
+ * defaultViewOptions: {
2528
+ * workspacePlatform: {
2529
+ * browserNavigationButtons: {
2530
+ * back: true,
2531
+ * forward: true,
2532
+ * reload: true
2533
+ * }
2534
+ * }
2535
+ * }
2536
+ * }
2537
+ * });
2538
+ * ```
2501
2539
  */
2502
- defaultViewOptions?: Partial<OpenFin.ViewOptions>;
2540
+ defaultViewOptions?: Partial<BrowserCreateViewRequest>;
2503
2541
  /**
2504
2542
  * The platform title. UI friendly title for the platform in browser.
2505
2543
  */
@@ -0,0 +1,37 @@
1
+ export declare enum Flag {
2
+ WorkspaceStorefrontEnabled = "WorkspaceStorefrontEnabled",
3
+ SentryEnabled = "SentryEnabled",
4
+ WorkspaceDockEnabled = "WorkspaceDockEnabled",
5
+ WorkspaceHomeEnabled = "WorkspaceHomeEnabled",
6
+ DevDebug = "DevDebug",
7
+ HttpLanguagePacksEnabled = "HttpLanguagePacksEnabled"
8
+ }
9
+ export type WorkspaceFlags = Record<Flag, boolean>;
10
+ export declare const flags: Partial<WorkspaceFlags>;
11
+ /**
12
+ * Initialize flags from overrides. This should be called early in the application lifecycle.
13
+ * This is a no-op if flags have already been initialized.
14
+ */
15
+ export declare const initializeFlags: () => Promise<void>;
16
+ /**
17
+ * Flag Interface --
18
+ *
19
+ * @example Enabled / Disabled Closures
20
+ * flag(
21
+ * 'feature',
22
+ * () => 'Enabled Feature',
23
+ * () => 'Disabled Feature'
24
+ * );
25
+ *
26
+ * @example Enabled only
27
+ * flag('feature', myFeatureFunc);
28
+ *
29
+ * @example Boolean
30
+ * flag('feature');
31
+ */
32
+ export declare function flag<EnabledReturn, DisabledReturn>(flagName: Flag, cbEnabled?: () => EnabledReturn, cbDisabled?: () => DisabledReturn): EnabledReturn | DisabledReturn | boolean;
33
+ declare global {
34
+ interface Window {
35
+ __WORKSPACE_FLAGS__: typeof flags;
36
+ }
37
+ }
@@ -0,0 +1,7 @@
1
+ import { type Resource } from 'i18next';
2
+ /**
3
+ * All seven statically bundled locale dictionaries. Loaded only on the flag-off
4
+ * (legacy) path so the http regime does not pull non-English packs into the
5
+ * main common chunk.
6
+ */
7
+ export declare const bundledResources: Resource;
@@ -1,6 +1,21 @@
1
1
  import i18next, { type Resource } from 'i18next';
2
2
  import { Locale } from '../../../client-api-platform/src/shapes';
3
- declare function initI18next(language?: Locale): Promise<void>;
3
+ export type LanguagePacksRegime = 'http' | 'legacy';
4
+ export declare const HTTP_BACKEND_REQUEST_OPTIONS: RequestInit;
5
+ export declare const resolveLanguagePacksRegime: (httpFlagEnabled: boolean, languagePacksApiUrl?: string) => LanguagePacksRegime;
6
+ export declare const getHttpBackendOptions: (loadPath: string) => {
7
+ loadPath: string;
8
+ requestOptions: RequestInit;
9
+ };
10
+ /**
11
+ * Overlay OFD's canonical en-US pack on the bootstrap stub.
12
+ * Fire-and-forget: first paint and the logo menu must not wait on this GET.
13
+ */
14
+ export declare const overlayEnglishFromHttpBackend: () => void;
15
+ export type InitI18nextOptions = {
16
+ languagePacksApiUrl?: string;
17
+ };
18
+ declare function initI18next(language?: Locale, options?: InitI18nextOptions): Promise<void>;
4
19
  export declare const setLanguageInI18next: (locale: Locale) => Promise<void>;
5
20
  declare const t: import("i18next").TFunction<["translation", ...string[]], undefined>;
6
21
  export { initI18next, i18next, t, type Resource };
@@ -16,6 +16,16 @@ export interface Overrides {
16
16
  disableOpenFinAnalytics: boolean;
17
17
  analyticsEndpoint: string;
18
18
  translationOverridesUrl: string;
19
+ /**
20
+ * i18next-http-backend loadPath injected when org `languagePacks.enabled` is on
21
+ * (e.g. `${base}/platform/api/localization/{{lng}}/{{ns}}.json`).
22
+ */
23
+ languagePacksApiUrl: string;
24
+ /**
25
+ * BCP-47 tags shown in the Language submenu. This is the org Active set
26
+ * (HERE defaults and/or admin-uploaded packs), not only bundled client languages.
27
+ */
28
+ activeLanguages: string[];
19
29
  /**
20
30
  * WRK-4846
21
31
  * This property is internal but is being temporarily exposed for Wells Fargo.
@@ -264,8 +264,6 @@ export type AddDefaultPagePayload = {
264
264
  identity: OpenFin.Identity;
265
265
  /** The page to attach. */
266
266
  page: PageWithUpdatableRuntimeAttribs;
267
- /** The newPageUrl provided. */
268
- newPageUrl: string;
269
267
  };
270
268
  export type AddPagePayload = {
271
269
  /** The OF window identity to attach the pages to. */
@@ -0,0 +1,47 @@
1
+ import type OpenFin from '@openfin/core';
2
+ export declare const ENTERPRISE_COLOR_CHANNELS: {
3
+ readonly 'fdc3.channel.1': {
4
+ readonly name: "Channel 1";
5
+ readonly color: "red";
6
+ readonly glyph: "1";
7
+ };
8
+ readonly 'fdc3.channel.2': {
9
+ readonly name: "Channel 2";
10
+ readonly color: "orange";
11
+ readonly glyph: "2";
12
+ };
13
+ readonly 'fdc3.channel.3': {
14
+ readonly name: "Channel 3";
15
+ readonly color: "yellow";
16
+ readonly glyph: "3";
17
+ };
18
+ readonly 'fdc3.channel.4': {
19
+ readonly name: "Channel 4";
20
+ readonly color: "green";
21
+ readonly glyph: "4";
22
+ };
23
+ readonly 'fdc3.channel.5': {
24
+ readonly name: "Channel 5";
25
+ readonly color: "cyan";
26
+ readonly glyph: "5";
27
+ };
28
+ readonly 'fdc3.channel.6': {
29
+ readonly name: "Channel 6";
30
+ readonly color: "blue";
31
+ readonly glyph: "6";
32
+ };
33
+ readonly 'fdc3.channel.7': {
34
+ readonly name: "Channel 7";
35
+ readonly color: "magenta";
36
+ readonly glyph: "7";
37
+ };
38
+ readonly 'fdc3.channel.8': {
39
+ readonly name: "Channel 8";
40
+ readonly color: "purple";
41
+ readonly glyph: "8";
42
+ };
43
+ };
44
+ export declare const normalizeColorChannelId: (colorChannelId: string) => string | undefined;
45
+ export declare const areColorChannelIdsEqual: (firstColorChannelId: string, secondColorChannelId: string) => boolean;
46
+ export declare const getContextGroupDisplayName: (contextGroup: OpenFin.ContextGroupInfo) => string;
47
+ export declare const getContextGroupCssColor: (contextGroup: OpenFin.ContextGroupInfo) => string;
@@ -0,0 +1,5 @@
1
+ export type EnabledLocale = {
2
+ tag: string;
3
+ displayName: string;
4
+ };
5
+ export declare const getEnabledLocales: () => Promise<EnabledLocale[]>;
@@ -9,7 +9,6 @@ export declare const isEnterpriseBrowserPlatform: (browserInitOptions: BrowserIn
9
9
  export declare function formatUrl(url: string): string;
10
10
  export declare const getIsEnterpriseBrowser: (id?: OpenFin.Identity) => Promise<boolean>;
11
11
  export declare const isLandingPage: (url: string) => boolean;
12
- export declare const isLandingPageOrEmpty: (url: string) => boolean;
13
12
  export declare const isDefaultEnterpriseView: (viewIdentity: OpenFin.Identity) => boolean;
14
13
  export declare const getAICompanionViewIdentity: (browserIdentity?: OpenFin.Identity) => {
15
14
  uuid: string;
@@ -100,6 +100,9 @@ export declare const downloads: () => {
100
100
  export declare const appearance: () => {
101
101
  label: string;
102
102
  };
103
+ export declare const language: () => {
104
+ label: string;
105
+ };
103
106
  export declare const getSavedWorkspaceContextMenuOptions: (activeWorkspace: Workspace, savedWorkspaces: Pick<Workspace, "workspaceId" | "title">[], contextMenuOptionType: GlobalContextMenuOptionType) => {
104
107
  label: string;
105
108
  type: MenuItemType;
@@ -119,4 +122,13 @@ export declare const getAppearanceContextMenuOptions: () => Promise<{
119
122
  scheme: WP.ColorSchemeOptionType;
120
123
  };
121
124
  }[]>;
125
+ export declare const getLanguageContextMenuOptions: () => Promise<{
126
+ label: string;
127
+ type: MenuItemType;
128
+ checked: boolean;
129
+ data: {
130
+ type: WP.EnterpriseMainContextMenuOptionType;
131
+ locale: string;
132
+ };
133
+ }[]>;
122
134
  export declare const getGlobalContextMenuTemplate: (winIdentity: OpenFin.Identity, selectedViews?: OpenFin.Identity[]) => Promise<GlobalContextMenuItemTemplate[]>;
@@ -3,14 +3,19 @@ interface LandingPageUrls {
3
3
  newPageUrl: string | false;
4
4
  newTabUrl: string | false;
5
5
  }
6
+ /**
7
+ * Which window option supplies the landing URL: `newTabUrl` for a new tab, `newPageUrl` for a new
8
+ * page or window. Enterprise Browser presents pages as tabs, so both go through page creation.
9
+ */
10
+ export type NewLandingPageUrlSource = 'newTab' | 'newPage';
6
11
  export declare const getLandingPageUrls: (winIdentity?: OpenFin.Identity) => Promise<LandingPageUrls>;
7
12
  export declare const checkHasNewTabUrl: () => Promise<boolean>;
8
13
  export declare const getNewLandingTabViewOptions: (target: OpenFin.Identity) => Promise<OpenFin.PlatformViewCreationOptions>;
9
14
  /**
10
15
  * Makes a new landing page.
11
16
  *
12
- * If winIdentity is specified, it uses the newPageUrl defined by the browser window options.
13
- * Otherwise, if the platform is Enterprise, it will use the landing page URL.
17
+ * If winIdentity is specified, it uses the URL defined by the browser window options for the given
18
+ * `urlSource`. Otherwise, if the platform is Enterprise, it will use the landing page URL.
14
19
  */
15
- export declare const makeNewLandingPage: (winIdentity?: OpenFin.Identity) => Promise<import("client-api-platform").PageWithUpdatableRuntimeAttribs>;
20
+ export declare const makeNewLandingPage: (winIdentity?: OpenFin.Identity, urlSource?: NewLandingPageUrlSource) => Promise<import("client-api-platform").PageWithUpdatableRuntimeAttribs>;
16
21
  export {};
@@ -1,7 +1,7 @@
1
1
  import type OpenFin from '@openfin/core';
2
2
  import { WindowIdentity } from '../../../common/src/utils/window';
3
3
  import type { PagePinnedState } from '../../../common/src/api/pages/shapes';
4
- import { AttachedPage, PageLayout } from '../../../client-api-platform/src/shapes';
4
+ import { AttachedPage, BrowserCreateViewRequest, PageLayout } from '../../../client-api-platform/src/shapes';
5
5
  export type LayoutDOMEventType =
6
6
  /**
7
7
  * Fired when a tab is created in a container. (Emmitted by ??)
@@ -90,7 +90,7 @@ export declare const generateViewNameAndIdentifierNameIfNotExists: <T extends {
90
90
  * @param layout The Layout to be cloned
91
91
  * @returns A Promise resolving to a copy of the layout with view options converted
92
92
  */
93
- export declare const cloneLayoutAndConvertViewOptions: (layout: PageLayout, initViewOptions?: Partial<OpenFin.ViewOptions>) => Promise<PageLayout>;
93
+ export declare const cloneLayoutAndConvertViewOptions: (layout: PageLayout, initViewOptions?: Partial<BrowserCreateViewRequest>) => Promise<PageLayout>;
94
94
  export declare const cloneViewComponentWithoutName: (componentState: any) => any;
95
95
  /**
96
96
  * Deep clones a layout and removes generated view names.
@@ -6,6 +6,7 @@ declare enum LocalStorageKey {
6
6
  NewTabPageSort = "NewTabPageSort",
7
7
  DockPosition = "DockPosition",
8
8
  SelectedColorScheme = "SelectedColorScheme",
9
+ SelectedLanguage = "SelectedLanguage",
9
10
  ThemePaletteSheet = "ThemePaletteSheet",
10
11
  HasMovedStore = "HasMovedStore",
11
12
  PageDragState = "BrowserPageDragState",
@@ -171,8 +171,5 @@ export type SearchMenuChannelResponse = {
171
171
  } | {
172
172
  type: 'single-provider-results-announcement';
173
173
  message: string;
174
- } | {
175
- /** Landing page was clicked. Chrome collapses search if view-focused never arrived. */
176
- type: 'page-clicked';
177
174
  };
178
175
  export {};
@@ -13,18 +13,18 @@
13
13
  "issuer": "common/src/utils/layout.ts"
14
14
  }
15
15
  ],
16
- "title-case": [
16
+ "lodash.clonedeep": [
17
17
  {
18
18
  "type": "explicit",
19
- "version": "3.0.3",
19
+ "version": "4.5.0",
20
20
  "packageName": "common/package.json",
21
- "issuer": "common/src/utils/color-linking.ts"
21
+ "issuer": "common/src/utils/layout.ts"
22
22
  }
23
23
  ],
24
24
  "react-i18next": [
25
25
  {
26
26
  "type": "explicit",
27
- "version": "15.4.0",
27
+ "version": "^17.0.11",
28
28
  "packageName": "common/package.json",
29
29
  "issuer": "common/src/api/i18next.ts"
30
30
  }
@@ -32,25 +32,25 @@
32
32
  "i18next": [
33
33
  {
34
34
  "type": "explicit",
35
- "version": "^23.7.16",
35
+ "version": "^26.3.6",
36
36
  "packageName": "common/package.json",
37
37
  "issuer": "common/src/api/i18next.ts"
38
38
  }
39
39
  ],
40
- "lodash.clonedeep": [
40
+ "i18next-http-backend": [
41
41
  {
42
42
  "type": "explicit",
43
- "version": "4.5.0",
43
+ "version": "^4.0.0",
44
44
  "packageName": "common/package.json",
45
- "issuer": "common/src/utils/layout.ts"
45
+ "issuer": "common/src/api/i18next.ts"
46
46
  }
47
47
  ],
48
48
  "dexie": [
49
49
  {
50
50
  "type": "explicit",
51
51
  "version": "^4.0.11",
52
- "packageName": "client-api-platform/package.json",
53
- "issuer": "client-api-platform/src/api/dock/idb.ts"
52
+ "packageName": "common/package.json",
53
+ "issuer": "common/src/api/pages/idb.ts"
54
54
  },
55
55
  {
56
56
  "type": "root-implicit",
@@ -61,8 +61,8 @@
61
61
  {
62
62
  "type": "explicit",
63
63
  "version": "^4.0.11",
64
- "packageName": "common/package.json",
65
- "issuer": "common/src/api/pages/idb.ts"
64
+ "packageName": "client-api-platform/package.json",
65
+ "issuer": "client-api-platform/src/api/dock/idb.ts"
66
66
  },
67
67
  {
68
68
  "type": "explicit",
@@ -70,5 +70,13 @@
70
70
  "packageName": "common/package.json",
71
71
  "issuer": "common/src/utils/create-and-migrate-ibd-store.ts"
72
72
  }
73
+ ],
74
+ "title-case": [
75
+ {
76
+ "type": "explicit",
77
+ "version": "3.0.3",
78
+ "packageName": "common/package.json",
79
+ "issuer": "common/src/utils/color-channels.ts"
80
+ }
73
81
  ]
74
82
  }