@openfin/workspace-platform 20.1.13 → 20.1.14
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/browser/src/hooks/usePanelBounds.d.ts +1 -1
- package/client-api-platform/src/api/app-directory.d.ts +1 -1
- package/client-api-platform/src/api/language.d.ts +3 -2
- package/client-api-platform/src/shapes.d.ts +77 -8
- package/common/src/api/i18next.d.ts +2 -2
- package/index.js +2 -2
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/workspace_platform.zip +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { PanelConfigVertical, PanelPosition } from '../../../common/src/api/pages/shapes';
|
|
2
2
|
export type CSSBounds = Partial<Record<'top' | 'right' | 'bottom' | 'left' | 'height' | 'width', string>>;
|
|
3
3
|
export declare const BookmarksPanelConfig: PanelConfigVertical;
|
|
4
|
-
export declare const usePanelBounds: (panelPosition: PanelPosition | 'Center') => Partial<Record<"
|
|
4
|
+
export declare const usePanelBounds: (panelPosition: PanelPosition | 'Center') => Partial<Record<"height" | "width" | "top" | "left" | "bottom" | "right", string>>;
|
|
@@ -6,7 +6,7 @@ import type { LaunchAppRequest, SearchSitesRequest, SearchSitesResponse, Site }
|
|
|
6
6
|
* @param app the app directory entry.
|
|
7
7
|
* @param opts launch options.
|
|
8
8
|
*/
|
|
9
|
-
export declare function launchApp({ app, target }: LaunchAppRequest): Promise<void | OpenFin.
|
|
9
|
+
export declare function launchApp({ app, target }: LaunchAppRequest): Promise<void | OpenFin.View | OpenFin.Identity | OpenFin.Platform | OpenFin.Application>;
|
|
10
10
|
export declare const enterpriseAppDirectoryChannelClient: () => Promise<OpenFin.ChannelClient>;
|
|
11
11
|
export declare function getResults(payload: {
|
|
12
12
|
req: SearchSitesRequest;
|
|
@@ -3,11 +3,12 @@ export declare function getLanguage(): Locale;
|
|
|
3
3
|
export declare const dispatchLanguageToBrowserWindows: (language: Locale) => Promise<void[]>;
|
|
4
4
|
export declare const setLanguage: (locale: Locale) => Promise<void>;
|
|
5
5
|
export declare function getLanguageResourcesInternal(): {
|
|
6
|
-
currentLanguage:
|
|
6
|
+
currentLanguage: string;
|
|
7
7
|
resources: import("i18next/typescript/options").Resource;
|
|
8
8
|
};
|
|
9
9
|
/**
|
|
10
10
|
* initLanguage()
|
|
11
|
-
* @param language - optional - ISO language code
|
|
11
|
+
* @param language - optional - ISO language code. Built-in languages are always accepted.
|
|
12
|
+
* Any language code defined in the external `translation-override.json` is also accepted.
|
|
12
13
|
*/
|
|
13
14
|
export default function initLanguage(language?: Locale): Promise<void>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type OpenFin from '@openfin/core';
|
|
2
|
-
import { IconProps
|
|
2
|
+
import type { IconProps } from '@openfin/ui-library';
|
|
3
3
|
import type { AnalyticsEvent, AnalyticsEventInternal } from '../../common/src/utils/usage-register';
|
|
4
4
|
import { CustomActionSpecifier, CustomButtonConfig } from '../../common/src/api/action';
|
|
5
5
|
import { AddDefaultPagePayload, AttachedPage, CopyPagePayload, HandlePagesAndWindowClosePayload, HandlePagesAndWindowCloseResult, HandleSaveModalOnPageClosePayload, Page, PageWithUpdatableRuntimeAttribs, SaveModalOnPageCloseResult, ShouldPageClosePayload, ShouldPageCloseResult, ViewsPreventingUnloadPayload } from '../../common/src/api/pages/shapes';
|
|
@@ -1494,9 +1494,9 @@ export interface WorkspacePlatformModule extends OpenFin.Platform {
|
|
|
1494
1494
|
*/
|
|
1495
1495
|
applyWorkspace(workspace: Workspace, options?: ApplyWorkspaceOptions): Promise<boolean>;
|
|
1496
1496
|
/**
|
|
1497
|
-
* Returns ISO language code of
|
|
1497
|
+
* Returns the ISO language code of the currently active language.
|
|
1498
1498
|
*
|
|
1499
|
-
* @returns
|
|
1499
|
+
* @returns The active language code (e.g. `'en-US'`, `'es-ES'`).
|
|
1500
1500
|
*
|
|
1501
1501
|
* @example Example of how to get the current language on Browser
|
|
1502
1502
|
*
|
|
@@ -1851,8 +1851,73 @@ export interface AnalyticsConfig {
|
|
|
1851
1851
|
*/
|
|
1852
1852
|
sendToOpenFin: boolean;
|
|
1853
1853
|
}
|
|
1854
|
-
|
|
1855
|
-
|
|
1854
|
+
/**
|
|
1855
|
+
* The built-in language codes supported by the Workspace Platform out of the box.
|
|
1856
|
+
*
|
|
1857
|
+
* @deprecated No longer used for language validation. The platform now accepts any language
|
|
1858
|
+
* code that has a resource bundle registered in i18next, including codes defined in an
|
|
1859
|
+
* external `translation-override.json`. This export will be removed in a future major version.
|
|
1860
|
+
*/
|
|
1861
|
+
export declare const SUPPORTED_LANGUAGES: string[];
|
|
1862
|
+
/**
|
|
1863
|
+
* An ISO language code accepted by the Workspace Platform.
|
|
1864
|
+
*
|
|
1865
|
+
* **Built-in languages** (supported out of the box):
|
|
1866
|
+
* - `en-US` — English (default)
|
|
1867
|
+
* - `de-DE` — German
|
|
1868
|
+
* - `ja-JP` — Japanese
|
|
1869
|
+
* - `ko-KR` — Korean
|
|
1870
|
+
* - `ru-RU` — Russian
|
|
1871
|
+
* - `zh-CN` — Chinese (Simplified)
|
|
1872
|
+
* - `zh-Hant` — Chinese (Traditional)
|
|
1873
|
+
*
|
|
1874
|
+
* **Adding custom languages** via `translationOverridesUrl`:
|
|
1875
|
+
*
|
|
1876
|
+
* Supply a `translationOverridesUrl` in your Desktop Owner Settings (DOS) or application manifest
|
|
1877
|
+
* pointing to a `translation-override.json` file. Any language code defined in that file will be
|
|
1878
|
+
* accepted at runtime in addition to the built-in list above.
|
|
1879
|
+
*
|
|
1880
|
+
* Example `translation-override.json`:
|
|
1881
|
+
* ```json
|
|
1882
|
+
* {
|
|
1883
|
+
* "x.x.x": {
|
|
1884
|
+
* "es-ES": {
|
|
1885
|
+
* "global.save": "Guardar",
|
|
1886
|
+
* "contextMenu.newWindow": "Nueva ventana"
|
|
1887
|
+
* }
|
|
1888
|
+
* }
|
|
1889
|
+
* }
|
|
1890
|
+
* ```
|
|
1891
|
+
*
|
|
1892
|
+
* The `translationOverridesUrl` can be configured in two ways:
|
|
1893
|
+
*
|
|
1894
|
+
* _Via Desktop Owner Settings_ (`dos.json` on macOS, registry on Windows):
|
|
1895
|
+
* ```json
|
|
1896
|
+
* {
|
|
1897
|
+
* "desktopSettings": {
|
|
1898
|
+
* "systemApps": {
|
|
1899
|
+
* "workspace": {
|
|
1900
|
+
* "customConfig": {
|
|
1901
|
+
* "translationOverridesUrl": "https://example.com/translation-override.json"
|
|
1902
|
+
* }
|
|
1903
|
+
* }
|
|
1904
|
+
* }
|
|
1905
|
+
* }
|
|
1906
|
+
* }
|
|
1907
|
+
* ```
|
|
1908
|
+
*
|
|
1909
|
+
* _Via the application manifest_ (under `platform.workspace`):
|
|
1910
|
+
* ```json
|
|
1911
|
+
* {
|
|
1912
|
+
* "platform": {
|
|
1913
|
+
* "workspace": {
|
|
1914
|
+
* "translationOverridesUrl": "https://example.com/translation-override.json"
|
|
1915
|
+
* }
|
|
1916
|
+
* }
|
|
1917
|
+
* }
|
|
1918
|
+
* ```
|
|
1919
|
+
*/
|
|
1920
|
+
export type Locale = string;
|
|
1856
1921
|
/**
|
|
1857
1922
|
* Configures the workspace to self-host using an asar bundle at the
|
|
1858
1923
|
* specified path.
|
|
@@ -1940,8 +2005,12 @@ export interface WorkspacePlatformInitConfig {
|
|
|
1940
2005
|
*/
|
|
1941
2006
|
theme?: CustomThemes;
|
|
1942
2007
|
/**
|
|
1943
|
-
* Set
|
|
1944
|
-
*
|
|
2008
|
+
* Set the initial language for the Browser.
|
|
2009
|
+
*
|
|
2010
|
+
* The built-in ISO language codes are `'en-US'`, `'ja-JP'`, `'zh-CN'`, `'ko-KR'`,
|
|
2011
|
+
* `'ru-RU'`, `'de-DE'`, and `'zh-Hant'`. Any additional language code defined in an
|
|
2012
|
+
* external `translation-override.json` (configured via `translationOverridesUrl`) is
|
|
2013
|
+
* also accepted.
|
|
1945
2014
|
*
|
|
1946
2015
|
* @example
|
|
1947
2016
|
* ```ts
|
|
@@ -1954,7 +2023,7 @@ export interface WorkspacePlatformInitConfig {
|
|
|
1954
2023
|
* }
|
|
1955
2024
|
* });
|
|
1956
2025
|
* ```
|
|
1957
|
-
* @default 'en-
|
|
2026
|
+
* @default 'en-US'
|
|
1958
2027
|
*
|
|
1959
2028
|
*/
|
|
1960
2029
|
language?: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import i18next, { type Resource } from 'i18next';
|
|
2
2
|
import { Locale } from '../../../client-api-platform/src/shapes';
|
|
3
|
-
declare function initI18next(language?: Locale): void
|
|
4
|
-
export declare const setLanguageInI18next: (locale: Locale) => void
|
|
3
|
+
declare function initI18next(language?: Locale): Promise<void>;
|
|
4
|
+
export declare const setLanguageInI18next: (locale: Locale) => Promise<void>;
|
|
5
5
|
declare const t: import("i18next").TFunction<["translation", ...string[]], undefined>;
|
|
6
6
|
export { initI18next, i18next, t, type Resource };
|
|
7
7
|
export { useTranslation } from 'react-i18next';
|