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

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.
@@ -4,8 +4,10 @@ import { TLanguageDetails } from '../types/i18n';
4
4
  interface IStandaloneProps {
5
5
  tabs?: ITab[];
6
6
  i18nCurrent?: string;
7
+ initialValue?: string;
7
8
  onTabsChange?: (tabs: ITab[]) => void;
8
9
  onI18nCurrentChange?: (current: string) => void;
10
+ onChange?: (value: string) => 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 | string;
48
49
  }
49
50
  interface IReducerValue {
50
51
  state: IReducerState;
51
52
  dispatch: Dispatch<ReducerAction>;
53
+ initialI18nFile: TI18nFile | string | 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;
@@ -1 +1 @@
1
- {"version":3,"file":"common.cjs.js","sources":["../src/common.ts"],"sourcesContent":["export const LOCALIZATION_EDITOR_SCOPE_CLASS = 'localization-editor-scope';\r\n"],"names":["LOCALIZATION_EDITOR_SCOPE_CLASS"],"mappings":"gFAAO,MAAMA,EAAkC"}
1
+ {"version":3,"file":"common.cjs.js","sources":["../src/common.ts"],"sourcesContent":["export const LOCALIZATION_EDITOR_SCOPE_CLASS = 'localization-editor-scope';\n"],"names":["LOCALIZATION_EDITOR_SCOPE_CLASS"],"mappings":"gFAAO,MAAMA,EAAkC"}
@@ -1 +1 @@
1
- {"version":3,"file":"common.es.js","sources":["../src/common.ts"],"sourcesContent":["export const LOCALIZATION_EDITOR_SCOPE_CLASS = 'localization-editor-scope';\r\n"],"names":["LOCALIZATION_EDITOR_SCOPE_CLASS"],"mappings":"AAAO,MAAMA,IAAkC;"}
1
+ {"version":3,"file":"common.es.js","sources":["../src/common.ts"],"sourcesContent":["export const LOCALIZATION_EDITOR_SCOPE_CLASS = 'localization-editor-scope';\n"],"names":["LOCALIZATION_EDITOR_SCOPE_CLASS"],"mappings":"AAAO,MAAMA,IAAkC;"}
@@ -1,85 +1,85 @@
1
- declare const _default: {
2
- "title": "Export i18n",
3
- "description": "Schema for i18n export format. Must have webforms, i18n, or both.",
4
- "type": "object",
5
- "additionalProperties": false,
6
- "properties": {
7
- "webforms": {
8
- "type": "object",
9
- "description": "Webform names to their component localizations",
10
- "additionalProperties": {
11
- "$ref": "#/definitions/webformComponents"
12
- }
13
- },
14
- "i18n": {
15
- "type": "object",
16
- "description": "Shared i18n keys and their localized values",
17
- "additionalProperties": {
18
- "$ref": "#/definitions/i18nKeys"
19
- }
20
- }
21
- },
22
- "anyOf": [{ "required": ["webforms"] }, { "required": ["i18n"] }],
23
- "definitions": {
24
- "webformComponents": {
25
- "type": "object",
26
- "description": "Component ID to component localization entry",
27
- "additionalProperties": {
28
- "$ref": "#/definitions/componentEntry"
29
- }
30
- },
31
- "componentEntry": {
32
- "type": "object",
33
- "required": ["resolverName", "props"],
34
- "additionalProperties": false,
35
- "properties": {
36
- "resolverName": {
37
- "type": "string",
38
- "description": "Name of the component resolver (e.g. Button)"
39
- },
40
- "props": {
41
- "type": "array",
42
- "description": "Localized prop entries",
43
- "items": {
44
- "$ref": "#/definitions/propLocalization"
45
- }
46
- }
47
- }
48
- },
49
- "propLocalization": {
50
- "type": "object",
51
- "required": ["__dataPath", "__default"],
52
- "properties": {
53
- "__dataPath": {
54
- "type": "string",
55
- "description": "Path to the prop (e.g. text)"
56
- },
57
- "__default": {
58
- "type": "string",
59
- "description": "Default value for the prop"
60
- }
61
- },
62
- "additionalProperties": {
63
- "type": "string",
64
- "description": "Locale code to localized string (e.g. fr, en)"
65
- }
66
- },
67
- "i18nKeys": {
68
- "type": "object",
69
- "required": ["default"],
70
- "properties": {
71
- "default": {
72
- "type": "string",
73
- "description": "Default value"
74
- }
75
- },
76
- "additionalProperties": {
77
- "type": "string",
78
- "description": "Locale code to localized string (e.g. fr, en)"
79
- }
80
- }
81
- }
82
- }
1
+ declare const _default: {
2
+ "title": "Export i18n",
3
+ "description": "Schema for i18n export format. Must have webforms, i18n, or both.",
4
+ "type": "object",
5
+ "additionalProperties": false,
6
+ "properties": {
7
+ "webforms": {
8
+ "type": "object",
9
+ "description": "Webform names to their component localizations",
10
+ "additionalProperties": {
11
+ "$ref": "#/definitions/webformComponents"
12
+ }
13
+ },
14
+ "i18n": {
15
+ "type": "object",
16
+ "description": "Shared i18n keys and their localized values",
17
+ "additionalProperties": {
18
+ "$ref": "#/definitions/i18nKeys"
19
+ }
20
+ }
21
+ },
22
+ "anyOf": [{ "required": ["webforms"] }, { "required": ["i18n"] }],
23
+ "definitions": {
24
+ "webformComponents": {
25
+ "type": "object",
26
+ "description": "Component ID to component localization entry",
27
+ "additionalProperties": {
28
+ "$ref": "#/definitions/componentEntry"
29
+ }
30
+ },
31
+ "componentEntry": {
32
+ "type": "object",
33
+ "required": ["resolverName", "props"],
34
+ "additionalProperties": false,
35
+ "properties": {
36
+ "resolverName": {
37
+ "type": "string",
38
+ "description": "Name of the component resolver (e.g. Button)"
39
+ },
40
+ "props": {
41
+ "type": "array",
42
+ "description": "Localized prop entries",
43
+ "items": {
44
+ "$ref": "#/definitions/propLocalization"
45
+ }
46
+ }
47
+ }
48
+ },
49
+ "propLocalization": {
50
+ "type": "object",
51
+ "required": ["__dataPath", "__default"],
52
+ "properties": {
53
+ "__dataPath": {
54
+ "type": "string",
55
+ "description": "Path to the prop (e.g. text)"
56
+ },
57
+ "__default": {
58
+ "type": "string",
59
+ "description": "Default value for the prop"
60
+ }
61
+ },
62
+ "additionalProperties": {
63
+ "type": "string",
64
+ "description": "Locale code to localized string (e.g. fr, en)"
65
+ }
66
+ },
67
+ "i18nKeys": {
68
+ "type": "object",
69
+ "required": ["default"],
70
+ "properties": {
71
+ "default": {
72
+ "type": "string",
73
+ "description": "Default value"
74
+ }
75
+ },
76
+ "additionalProperties": {
77
+ "type": "string",
78
+ "description": "Locale code to localized string (e.g. fr, en)"
79
+ }
80
+ }
81
+ }
82
+ }
83
83
  ;
84
84
 
85
85
  export default _default;