@ws-ui/localization-editor 1.11.12-rc2 → 1.11.12-rc3

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,11 +1,13 @@
1
1
  import { FC } from 'react';
2
2
  import { ITab, T4DComponent } from '@ws-ui/shared';
3
- import { TLanguageDetails } from '../types/i18n';
3
+ import { TLanguageDetails, TI18nFile } from '../types/i18n';
4
4
  interface IStandaloneProps {
5
5
  tabs?: ITab[];
6
6
  i18nCurrent?: string;
7
+ initialValue?: TI18nFile;
7
8
  onTabsChange?: (tabs: ITab[]) => void;
8
9
  onI18nCurrentChange?: (current: string) => void;
10
+ onChange?: (i18n: TI18nFile) => void;
9
11
  userComponents?: Record<string, T4DComponent<any>>;
10
12
  buildResolver?: Record<string, T4DComponent<any>>;
11
13
  supportedLanguages?: TLanguageDetails[];
@@ -1,7 +1,7 @@
1
1
  import { Dispatch, FC, ReactNode } from 'react';
2
2
  import { IModal, ITab, ModalCloseReason, T4DComponent } from '@ws-ui/shared';
3
3
  import { IEditorStateAdapter } from '../types';
4
- import { TLanguageDetails } from '../../types/i18n';
4
+ import { TLanguageDetails, TI18nFile } from '../../types/i18n';
5
5
  interface IModalsState {
6
6
  list: IModal[];
7
7
  }
@@ -45,10 +45,12 @@ export interface IReducerAdapterProps {
45
45
  children: ReactNode;
46
46
  tabs?: ITab[];
47
47
  i18nCurrent?: string;
48
+ initialI18nFile?: TI18nFile;
48
49
  }
49
50
  interface IReducerValue {
50
51
  state: IReducerState;
51
52
  dispatch: Dispatch<ReducerAction>;
53
+ initialI18nFile: TI18nFile | undefined;
52
54
  }
53
55
  export declare const EditorStateContext: import('react').Context<IReducerValue | null>;
54
56
  export declare const getDefaultInitialState: (tabs: ITab[], i18nCurrent: string) => IReducerState;
@@ -1,5 +1,5 @@
1
1
  import { IOpenModalPayload, IOpenModalReturnValue, ITab, T4DComponent } from '@ws-ui/shared';
2
- import { TLanguageDetails } from '../types/i18n';
2
+ import { TLanguageDetails, TI18nFile } from '../types/i18n';
3
3
  export interface IEditorStateAdapter {
4
4
  getTabs(): ITab[];
5
5
  getI18nCurrent(): string;
@@ -9,6 +9,7 @@ export interface IEditorStateAdapter {
9
9
  getUserComponents?(): Record<string, T4DComponent<any>>;
10
10
  buildResolver?: Record<string, T4DComponent<any>>;
11
11
  getSupportedLanguages(isInsideStudio: boolean): Promise<TLanguageDetails[]>;
12
+ fetchI18nFile(): Promise<TI18nFile>;
12
13
  actions: {
13
14
  openModal(config: IOpenModalPayload): Promise<IOpenModalReturnValue>;
14
15
  setTabs(tabs: ITab[]): void;