@ws-ui/settings-editor 1.11.12-rc1
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/dist/Editor.d.ts +8 -0
- package/dist/GUISettings.d.ts +6 -0
- package/dist/JSONSettings.d.ts +7 -0
- package/dist/Standalone/index.d.ts +10 -0
- package/dist/adapter/index.d.ts +7 -0
- package/dist/adapter/provider.d.ts +8 -0
- package/dist/adapter/reducer/adapter.d.ts +65 -0
- package/dist/adapter/redux/adapter.d.ts +2 -0
- package/dist/adapter/types.d.ts +26 -0
- package/dist/components/IconSelect/index.d.ts +17 -0
- package/dist/components/NumberField/index.d.ts +11 -0
- package/dist/components/RadioIconsGroup.d.ts +18 -0
- package/dist/components/Switch/index.d.ts +10 -0
- package/dist/components/WebformSelector/index.d.ts +10 -0
- package/dist/components/WebformSelector/methodSelectorStyles.d.ts +7 -0
- package/dist/index.cjs.js +53 -0
- package/dist/index.cjs.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.es.js +8849 -0
- package/dist/index.es.js.map +1 -0
- package/dist/main.d.ts +0 -0
- package/dist/settings-editor.css +1 -0
- package/package.json +48 -0
package/dist/Editor.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { ICreateNewFilePayload, ISettingsState } from '@ws-ui/shared';
|
|
3
|
+
export interface IStandaloneProps {
|
|
4
|
+
path?: string;
|
|
5
|
+
initialValue?: Partial<ISettingsState>;
|
|
6
|
+
onChange?: (preferences: Partial<ISettingsState>) => void;
|
|
7
|
+
onFetchFolderContentWithoutExpanding?: (path: string) => Promise<unknown> | unknown;
|
|
8
|
+
onCreateNewFileAndOpen?: (payload: ICreateNewFilePayload) => Promise<unknown> | unknown;
|
|
9
|
+
}
|
|
10
|
+
export declare const Standalone: FC<IStandaloneProps>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
import { ISettingsEditorStateAdapter } from './types';
|
|
3
|
+
export interface ISettingsEditorStateAdapterProviderProps {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
adapter: ISettingsEditorStateAdapter;
|
|
6
|
+
}
|
|
7
|
+
export declare const EditorStateAdapterProvider: FC<ISettingsEditorStateAdapterProviderProps>;
|
|
8
|
+
export declare function useSettingsEditorStateAdapter(): ISettingsEditorStateAdapter;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { Dispatch, FC, ReactNode } from 'react';
|
|
2
|
+
import { ICreateNewFilePayload, IOpenModalPayload, IOpenModalReturnValue, ITreeItem, ISettingsState, TSettingPath } from '@ws-ui/shared';
|
|
3
|
+
import { ISettingsEditorStateAdapter } from '../types';
|
|
4
|
+
type TWebform = {
|
|
5
|
+
name: string;
|
|
6
|
+
};
|
|
7
|
+
interface IReducerState {
|
|
8
|
+
tabPath: string | null;
|
|
9
|
+
preferences: Partial<ISettingsState>;
|
|
10
|
+
qodly: boolean;
|
|
11
|
+
explorer: ITreeItem[];
|
|
12
|
+
webforms: TWebform[];
|
|
13
|
+
}
|
|
14
|
+
type ReducerAction = {
|
|
15
|
+
type: 'SET_TAB_PATH';
|
|
16
|
+
payload: string | null;
|
|
17
|
+
} | {
|
|
18
|
+
type: 'SET_PREFERENCES';
|
|
19
|
+
payload: Partial<ISettingsState>;
|
|
20
|
+
} | {
|
|
21
|
+
type: 'SET_QODLY';
|
|
22
|
+
payload: boolean;
|
|
23
|
+
} | {
|
|
24
|
+
type: 'SET_EXPLORER';
|
|
25
|
+
payload: ITreeItem[];
|
|
26
|
+
} | {
|
|
27
|
+
type: 'SET_WEBFORMS';
|
|
28
|
+
payload: TWebform[];
|
|
29
|
+
} | {
|
|
30
|
+
type: 'SET_SETTING';
|
|
31
|
+
payload: {
|
|
32
|
+
path: TSettingPath;
|
|
33
|
+
settingsKey: string;
|
|
34
|
+
value: unknown;
|
|
35
|
+
};
|
|
36
|
+
} | {
|
|
37
|
+
type: 'SET_SETTINGS_AS_TEXT';
|
|
38
|
+
payload: {
|
|
39
|
+
path: TSettingPath;
|
|
40
|
+
settings: Record<string, unknown>;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
interface IExternalActions {
|
|
44
|
+
onFetchFolderContentWithoutExpanding?: (path: string) => Promise<unknown> | unknown;
|
|
45
|
+
onCreateNewFileAndOpen?: (payload: ICreateNewFilePayload) => Promise<unknown> | unknown;
|
|
46
|
+
onOpenModal?: (config: IOpenModalPayload) => Promise<IOpenModalReturnValue> | IOpenModalReturnValue;
|
|
47
|
+
}
|
|
48
|
+
interface IReducerValue {
|
|
49
|
+
state: IReducerState;
|
|
50
|
+
dispatch: Dispatch<ReducerAction>;
|
|
51
|
+
externalActions: IExternalActions;
|
|
52
|
+
}
|
|
53
|
+
export interface IReducerAdapterProps extends IExternalActions {
|
|
54
|
+
children: ReactNode;
|
|
55
|
+
tabPath?: string | null;
|
|
56
|
+
preferences?: Partial<ISettingsState>;
|
|
57
|
+
qodly?: boolean;
|
|
58
|
+
explorer?: ITreeItem[];
|
|
59
|
+
webforms?: TWebform[];
|
|
60
|
+
onChange?: (preferences: Partial<ISettingsState>) => void;
|
|
61
|
+
}
|
|
62
|
+
export declare const EditorStateContext: import('react').Context<IReducerValue | null>;
|
|
63
|
+
export declare const ReducerAdapterProvider: FC<IReducerAdapterProps>;
|
|
64
|
+
export declare function useReducerAdapter(tabPath?: string | null): ISettingsEditorStateAdapter;
|
|
65
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ICreateNewFilePayload, IOpenModalPayload, IOpenModalReturnValue, ITreeItem, ISettingsState, TSettingPath } from '@ws-ui/shared';
|
|
2
|
+
export interface ISettingsEditorStateAdapter {
|
|
3
|
+
getTabPath(): string | null;
|
|
4
|
+
getPreferences(): Partial<ISettingsState>;
|
|
5
|
+
getQodly(): boolean;
|
|
6
|
+
getFeatureFlag(name: string): boolean;
|
|
7
|
+
getExplorer(): ITreeItem[];
|
|
8
|
+
getWebForms(): {
|
|
9
|
+
name: string;
|
|
10
|
+
}[];
|
|
11
|
+
findNodeByPath(path: string): ITreeItem | null;
|
|
12
|
+
actions: {
|
|
13
|
+
setSetting(payload: {
|
|
14
|
+
path: TSettingPath;
|
|
15
|
+
settingsKey: string;
|
|
16
|
+
value: unknown;
|
|
17
|
+
}): void;
|
|
18
|
+
setSettingsAsText(payload: {
|
|
19
|
+
path: TSettingPath;
|
|
20
|
+
settings: Record<string, unknown>;
|
|
21
|
+
}): void;
|
|
22
|
+
fetchFolderContentWithoutExpanding(path: string): Promise<unknown>;
|
|
23
|
+
createNewFileAndOpen(payload: ICreateNewFilePayload): Promise<unknown>;
|
|
24
|
+
openModal(config: IOpenModalPayload): Promise<IOpenModalReturnValue>;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { TSettingPath } from '@ws-ui/shared';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
interface IIconOption {
|
|
4
|
+
value: any;
|
|
5
|
+
icon: React.FC<any>;
|
|
6
|
+
tooltip: string;
|
|
7
|
+
}
|
|
8
|
+
interface ISettingsIconSelectProps {
|
|
9
|
+
icon: React.FC<any>;
|
|
10
|
+
label: string;
|
|
11
|
+
path: TSettingPath;
|
|
12
|
+
settingsKey: string;
|
|
13
|
+
title: string;
|
|
14
|
+
options: IIconOption[];
|
|
15
|
+
}
|
|
16
|
+
declare const SettingsIconSelect: React.FC<ISettingsIconSelectProps>;
|
|
17
|
+
export default SettingsIconSelect;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TSettingPath } from '@ws-ui/shared';
|
|
2
|
+
import { FC } from 'react';
|
|
3
|
+
interface ISettingsNumberInputProps {
|
|
4
|
+
icon: FC<any>;
|
|
5
|
+
label: string;
|
|
6
|
+
path: TSettingPath;
|
|
7
|
+
settingsKey: string;
|
|
8
|
+
title: string;
|
|
9
|
+
}
|
|
10
|
+
declare const SettingsNumberField: FC<ISettingsNumberInputProps>;
|
|
11
|
+
export default SettingsNumberField;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
type TRadioValue = string | number;
|
|
3
|
+
interface IOption {
|
|
4
|
+
value: TRadioValue;
|
|
5
|
+
icon: React.FC<any>;
|
|
6
|
+
tooltip?: string;
|
|
7
|
+
onClick?: (val: TRadioValue) => void;
|
|
8
|
+
}
|
|
9
|
+
interface IRadioIconsGroupProps {
|
|
10
|
+
name?: string;
|
|
11
|
+
value?: TRadioValue;
|
|
12
|
+
defaultValue?: TRadioValue;
|
|
13
|
+
options: IOption[];
|
|
14
|
+
onChange?: (val: TRadioValue) => void;
|
|
15
|
+
setTouched?: (touched: boolean) => void;
|
|
16
|
+
}
|
|
17
|
+
export declare const RadioIconsGroup: React.FC<IRadioIconsGroupProps>;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { TSettingPath } from '@ws-ui/shared';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
interface ISettingsSwitchProps {
|
|
4
|
+
icon: React.FC<any>;
|
|
5
|
+
label: string;
|
|
6
|
+
path: TSettingPath;
|
|
7
|
+
settingsKey: string;
|
|
8
|
+
}
|
|
9
|
+
declare const SettingsSwitch: React.FC<ISettingsSwitchProps>;
|
|
10
|
+
export default SettingsSwitch;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { TSettingPath } from '@ws-ui/shared';
|
|
2
|
+
import { FC } from 'react';
|
|
3
|
+
interface ISettingsWebformSelectorProps {
|
|
4
|
+
icon: React.FC<any>;
|
|
5
|
+
label: string;
|
|
6
|
+
path: TSettingPath;
|
|
7
|
+
settingsKey: string;
|
|
8
|
+
}
|
|
9
|
+
declare const SettingsWebformSelector: FC<ISettingsWebformSelectorProps>;
|
|
10
|
+
export default SettingsWebformSelector;
|