@devtron-labs/devtron-fe-common-lib 1.7.0 → 1.7.2-beta-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.
- package/dist/@code-editor-B63wjusN.js +23583 -0
- package/dist/{@common-rjsf-DMhXJRTx.js → @common-rjsf-DnWwXM4S.js} +11 -11
- package/dist/{@framer-motion-BFqoU0Z7.js → @framer-motion-C88ROIS4.js} +70 -70
- package/dist/@monaco-editor-CVagbUeH.js +138960 -0
- package/dist/{@react-dates-Dx7AjKDr.js → @react-dates-Ct1VA7V6.js} +14 -14
- package/dist/{@react-select-BfYm_1lF.js → @react-select-qU4oRypC.js} +1 -1
- package/dist/{@react-virtualized-sticky-tree-BNk-_Tvs.js → @react-virtualized-sticky-tree-DmvoaDNw.js} +1 -1
- package/dist/@vendor-C6rSXA7p.js +22734 -0
- package/dist/Common/CodeEditor/CodeEditor.d.ts +3 -13
- package/dist/Common/CodeEditor/CodeEditor.reducer.d.ts +47 -3
- package/dist/Common/CodeEditor/index.d.ts +1 -1
- package/dist/Common/CodeEditor/types.d.ts +81 -83
- package/dist/Common/CodeEditor/utils.d.ts +3 -13
- package/dist/Common/CodeMirror/CodeEditor.d.ts +14 -0
- package/dist/Common/CodeMirror/CodeEditor.reducer.d.ts +4 -0
- package/dist/Common/CodeMirror/index.d.ts +2 -0
- package/dist/Common/CodeMirror/types.d.ts +107 -0
- package/dist/Common/CodeMirror/utils.d.ts +13 -0
- package/dist/Common/Constants.d.ts +2 -0
- package/dist/Common/InfoColorBar/InfoColourbar.d.ts +3 -0
- package/dist/Common/Types.d.ts +2 -2
- package/dist/Pages/GlobalConfigurations/DeploymentCharts/types.d.ts +6 -8
- package/dist/Shared/Components/CICDHistory/AppStatusDetailsChart.d.ts +1 -1
- package/dist/Shared/Components/CICDHistory/DeploymentHistoryConfigDiff/DeploymentHistoryDiffView.d.ts +1 -1
- package/dist/Shared/Components/CICDHistory/types.d.ts +2 -1
- package/dist/Shared/Components/FormFieldWrapper/types.d.ts +3 -27
- package/dist/Shared/Components/FormFieldWrapper/utils.d.ts +1 -2
- package/dist/Shared/Components/InfoBlock/InfoBlock.component.d.ts +3 -0
- package/dist/Shared/Components/InfoBlock/constants.d.ts +5 -0
- package/dist/Shared/Components/InfoBlock/index.d.ts +2 -0
- package/dist/Shared/Components/InfoBlock/types.d.ts +40 -0
- package/dist/Shared/Components/index.d.ts +1 -0
- package/dist/Shared/Helpers.d.ts +3 -1
- package/dist/Shared/types.d.ts +31 -0
- package/dist/Shared/validations.d.ts +1 -0
- package/dist/assets/@code-editor.css +1 -1
- package/dist/assets/@monaco-editor.css +1 -0
- package/dist/assets/codicon.ecfbfe4b.ttf +0 -0
- package/dist/index.js +675 -669
- package/package.json +7 -1
- package/dist/@code-editor-B5-sv4g7.js +0 -42310
- package/dist/@vendor-CWh7bjwl.js +0 -42519
- package/dist/assets/ic-match-case.13b7a2fa.svg +0 -19
- package/dist/assets/ic-match-word.d92addc3.svg +0 -19
- package/dist/assets/ic-replace-all-text.a87fd342.svg +0 -19
- package/dist/assets/ic-replace-text.cc5433be.svg +0 -19
- /package/dist/Common/{CodeEditor → CodeMirror}/CodeEditor.components.d.ts +0 -0
- /package/dist/Common/{CodeEditor → CodeMirror}/CodeEditor.constants.d.ts +0 -0
- /package/dist/Common/{CodeEditor → CodeMirror}/CodeEditor.context.d.ts +0 -0
- /package/dist/Common/{CodeEditor → CodeMirror}/CodeEditor.theme.d.ts +0 -0
- /package/dist/Common/{CodeEditor → CodeMirror}/CodeEditorRenderer.d.ts +0 -0
- /package/dist/Common/{CodeEditor → CodeMirror}/Extensions/findAndReplace.d.ts +0 -0
- /package/dist/Common/{CodeEditor → CodeMirror}/Extensions/index.d.ts +0 -0
- /package/dist/Common/{CodeEditor → CodeMirror}/Extensions/readOnlyTooltip.d.ts +0 -0
- /package/dist/Common/{CodeEditor → CodeMirror}/Extensions/yamlParseLinter.d.ts +0 -0
@@ -1,14 +1,4 @@
|
|
1
|
-
import {
|
2
|
-
|
3
|
-
|
4
|
-
Clipboard: () => JSX.Element;
|
5
|
-
Header: ({ children, className, hideDefaultSplitHeader }: import('./types').CodeEditorHeaderProps) => JSX.Element;
|
6
|
-
Warning: ({ className, text, children }: import('./types').CodeEditorStatusBarProps) => JSX.Element;
|
7
|
-
ErrorBar: ({ className, text, children }: import('./types').CodeEditorStatusBarProps) => JSX.Element;
|
8
|
-
Information: ({ className, children, text }: import('./types').CodeEditorStatusBarProps) => JSX.Element;
|
9
|
-
Container: ({ children, flexExpand }: {
|
10
|
-
children: import('react').ReactNode;
|
11
|
-
flexExpand?: boolean;
|
12
|
-
}) => JSX.Element;
|
13
|
-
};
|
1
|
+
import { default as React } from 'react';
|
2
|
+
import { CodeEditorComposition, CodeEditorInterface } from './types';
|
3
|
+
declare const CodeEditor: React.FC<CodeEditorInterface> & CodeEditorComposition;
|
14
4
|
export default CodeEditor;
|
@@ -1,4 +1,48 @@
|
|
1
|
-
import {
|
2
|
-
|
1
|
+
import { MODES } from '../Constants';
|
2
|
+
import { Action, CodeEditorInitialValueType, CodeEditorState } from './types';
|
3
|
+
export declare const CodeEditorReducer: (state: CodeEditorState, action: Action) => {
|
4
|
+
mode: any;
|
5
|
+
diffMode: boolean;
|
6
|
+
theme: import('./types').CodeEditorThemesKeys;
|
7
|
+
code: string;
|
8
|
+
defaultCode: string;
|
9
|
+
noParsing: boolean;
|
10
|
+
} | {
|
11
|
+
diffMode: any;
|
12
|
+
mode: MODES;
|
13
|
+
theme: import('./types').CodeEditorThemesKeys;
|
14
|
+
code: string;
|
15
|
+
defaultCode: string;
|
16
|
+
noParsing: boolean;
|
17
|
+
} | {
|
18
|
+
theme: any;
|
19
|
+
mode: MODES;
|
20
|
+
diffMode: boolean;
|
21
|
+
code: string;
|
22
|
+
defaultCode: string;
|
23
|
+
noParsing: boolean;
|
24
|
+
} | {
|
25
|
+
code: any;
|
26
|
+
mode: MODES;
|
27
|
+
diffMode: boolean;
|
28
|
+
theme: import('./types').CodeEditorThemesKeys;
|
29
|
+
defaultCode: string;
|
30
|
+
noParsing: boolean;
|
31
|
+
} | {
|
32
|
+
defaultCode: any;
|
33
|
+
mode: MODES;
|
34
|
+
diffMode: boolean;
|
35
|
+
theme: import('./types').CodeEditorThemesKeys;
|
36
|
+
code: string;
|
37
|
+
noParsing: boolean;
|
38
|
+
} | {
|
39
|
+
height: any;
|
40
|
+
mode: MODES;
|
41
|
+
diffMode: boolean;
|
42
|
+
theme: import('./types').CodeEditorThemesKeys;
|
43
|
+
code: string;
|
44
|
+
defaultCode: string;
|
45
|
+
noParsing: boolean;
|
46
|
+
};
|
3
47
|
export declare const parseValueToCode: (value: string, mode: string, tabSize: number) => string;
|
4
|
-
export declare const initialState: ({ mode, value,
|
48
|
+
export declare const initialState: ({ mode, theme, value, defaultValue, diffView, noParsing, tabSize, appTheme, }: CodeEditorInitialValueType) => CodeEditorState;
|
@@ -1,2 +1,2 @@
|
|
1
1
|
export { default as CodeEditor } from './CodeEditor';
|
2
|
-
export
|
2
|
+
export * from './types';
|
@@ -1,107 +1,105 @@
|
|
1
|
-
import { Dispatch, FunctionComponent, Key, MutableRefObject, ReactNode, SVGProps } from 'react';
|
2
|
-
import { JSONSchema7 } from 'json-schema';
|
3
|
-
import { EditorView, ReactCodeMirrorProps } from '@uiw/react-codemirror';
|
4
|
-
import { SearchQuery } from '@codemirror/search';
|
5
|
-
import { MODES } from '../Constants';
|
6
|
-
import { Never } from '../../Shared/types';
|
7
1
|
import { AppThemeType } from '../../Shared/Providers';
|
8
|
-
|
2
|
+
import { MODES } from '../Constants';
|
3
|
+
export interface InformationBarProps {
|
9
4
|
text: string;
|
10
5
|
className?: string;
|
11
|
-
children?: ReactNode;
|
6
|
+
children?: React.ReactNode;
|
12
7
|
}
|
13
|
-
export
|
14
|
-
|
15
|
-
|
16
|
-
|
8
|
+
export declare enum CodeEditorThemesKeys {
|
9
|
+
vsDarkDT = "vs-dark--dt",
|
10
|
+
vs = "vs",
|
11
|
+
networkStatusInterface = "network-status-interface"
|
17
12
|
}
|
18
|
-
|
19
|
-
value?:
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
originalValue?: ReactCodeMirrorProps['value'];
|
29
|
-
modifiedValue?: ReactCodeMirrorProps['value'];
|
30
|
-
isOriginalModifiable?: boolean;
|
31
|
-
};
|
32
|
-
type CodeEditorPropsBasedOnDiffView<DiffView extends boolean> = DiffView extends true ? CodeEditorDiffBaseProps & Never<CodeEditorBaseProps> : CodeEditorBaseProps & Never<CodeEditorDiffBaseProps>;
|
33
|
-
export type CodeEditorProps<DiffView extends boolean = false> = {
|
34
|
-
/**
|
35
|
-
* @default 450
|
36
|
-
*/
|
37
|
-
height?: 'auto' | '100%' | 'fitToParent' | number;
|
38
|
-
children?: ReactNode;
|
39
|
-
mode?: MODES;
|
13
|
+
interface CodeEditorBaseInterface {
|
14
|
+
value?: string;
|
15
|
+
lineDecorationsWidth?: number;
|
16
|
+
responseType?: string;
|
17
|
+
onChange?: (value: string, defaultValue: string) => void;
|
18
|
+
onBlur?: () => void;
|
19
|
+
onFocus?: () => void;
|
20
|
+
children?: any;
|
21
|
+
defaultValue?: string;
|
22
|
+
mode?: MODES | string;
|
40
23
|
tabSize?: number;
|
41
24
|
readOnly?: boolean;
|
42
|
-
placeholder?: string;
|
43
25
|
noParsing?: boolean;
|
26
|
+
inline?: boolean;
|
27
|
+
shebang?: string | JSX.Element;
|
28
|
+
diffView?: boolean;
|
44
29
|
loading?: boolean;
|
45
30
|
customLoader?: JSX.Element;
|
31
|
+
theme?: CodeEditorThemesKeys;
|
32
|
+
original?: string;
|
33
|
+
focus?: boolean;
|
34
|
+
validatorSchema?: any;
|
35
|
+
isKubernetes?: boolean;
|
46
36
|
cleanData?: boolean;
|
37
|
+
schemaURI?: string;
|
47
38
|
/**
|
48
|
-
* If true,
|
39
|
+
* If true, disable the in-built search of monaco editor
|
49
40
|
* @default false
|
50
41
|
*/
|
51
42
|
disableSearch?: boolean;
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
codeEditorClassName: string;
|
58
|
-
codeEditorHeight: string;
|
43
|
+
/**
|
44
|
+
* If true, Enable original value editing of monaco editor
|
45
|
+
* @default false
|
46
|
+
*/
|
47
|
+
originalEditable?: boolean;
|
59
48
|
}
|
60
|
-
export type
|
61
|
-
|
62
|
-
|
63
|
-
}
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
49
|
+
export type CodeEditorInterface = CodeEditorBaseInterface & ({
|
50
|
+
adjustEditorHeightToContent?: boolean;
|
51
|
+
height?: never;
|
52
|
+
} | {
|
53
|
+
adjustEditorHeightToContent?: never;
|
54
|
+
height?: number | string;
|
55
|
+
});
|
56
|
+
export interface CodeEditorHeaderInterface {
|
57
|
+
children?: any;
|
58
|
+
className?: string;
|
59
|
+
hideDefaultSplitHeader?: boolean;
|
68
60
|
}
|
69
|
-
export
|
70
|
-
|
71
|
-
|
61
|
+
export interface CodeEditorComposition {
|
62
|
+
Header?: React.FC<any>;
|
63
|
+
LanguageChanger?: React.FC<any>;
|
64
|
+
ThemeChanger?: React.FC<any>;
|
65
|
+
ValidationError?: React.FC<any>;
|
66
|
+
Clipboard?: React.FC<any>;
|
67
|
+
Warning?: React.FC<InformationBarProps>;
|
68
|
+
ErrorBar?: React.FC<InformationBarProps>;
|
69
|
+
Information?: React.FC<InformationBarProps>;
|
70
|
+
}
|
71
|
+
export interface CodeEditorHeaderComposition {
|
72
|
+
LanguageChanger?: React.FC<any>;
|
73
|
+
ThemeChanger?: React.FC<any>;
|
74
|
+
ValidationError?: React.FC<any>;
|
75
|
+
Clipboard?: React.FC<any>;
|
76
|
+
}
|
77
|
+
export type ActionTypes = 'changeLanguage' | 'setDiff' | 'setTheme' | 'setCode' | 'setDefaultCode' | 'setHeight';
|
78
|
+
export interface Action {
|
79
|
+
type: ActionTypes;
|
72
80
|
value: any;
|
73
81
|
}
|
74
|
-
export interface CodeEditorInitialValueType extends Pick<
|
75
|
-
|
82
|
+
export interface CodeEditorInitialValueType extends Pick<CodeEditorBaseInterface, 'theme'> {
|
83
|
+
mode: string;
|
76
84
|
diffView: boolean;
|
85
|
+
value: string;
|
86
|
+
defaultValue: string;
|
87
|
+
noParsing?: boolean;
|
88
|
+
tabSize: number;
|
89
|
+
appTheme: AppThemeType;
|
77
90
|
}
|
78
|
-
export interface CodeEditorState
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
hasCodeEditorContainer: boolean;
|
86
|
-
dispatch: Dispatch<CodeEditorPayloadType>;
|
91
|
+
export interface CodeEditorState {
|
92
|
+
mode: MODES;
|
93
|
+
diffMode: boolean;
|
94
|
+
theme: CodeEditorThemesKeys;
|
95
|
+
code: string;
|
96
|
+
defaultCode: string;
|
97
|
+
noParsing: boolean;
|
87
98
|
}
|
88
|
-
export
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
tooltipText: string;
|
99
|
+
export declare enum CodeEditorActionTypes {
|
100
|
+
reInit = "reInit",
|
101
|
+
submitLoading = "submitLoading",
|
102
|
+
overrideLoading = "overrideLoading",
|
103
|
+
success = "success"
|
94
104
|
}
|
95
|
-
export type CodeEditorRendererProps = Required<Pick<CodeEditorProps, 'loading' | 'customLoader' | 'height' | 'readOnly' | 'shebang' | 'placeholder' | 'onBlur' | 'onFocus' | 'autoFocus'>> & Required<Pick<CodeEditorDiffBaseProps, 'isOriginalModifiable'>> & {
|
96
|
-
codemirrorMergeKey: Key;
|
97
|
-
codeMirrorParentDivRef: MutableRefObject<HTMLDivElement>;
|
98
|
-
codeEditorTheme: ReactCodeMirrorProps['theme'];
|
99
|
-
isDarkTheme: boolean;
|
100
|
-
state: CodeEditorState;
|
101
|
-
handleOnChange: ReactCodeMirrorProps['onChange'];
|
102
|
-
handleLhsOnChange: ReactCodeMirrorProps['onChange'];
|
103
|
-
originalViewExtensions: ReactCodeMirrorProps['extensions'];
|
104
|
-
modifiedViewExtensions: ReactCodeMirrorProps['extensions'];
|
105
|
-
extensions: ReactCodeMirrorProps['extensions'];
|
106
|
-
};
|
107
105
|
export {};
|
@@ -1,13 +1,3 @@
|
|
1
|
-
import {
|
2
|
-
import {
|
3
|
-
|
4
|
-
export declare const getCodeEditorHeight: (height: CodeEditorProps["height"]) => GetCodeEditorHeightReturnType;
|
5
|
-
export declare const getFindReplaceToggleButtonIconClass: ({ iconType, isChecked, }: Pick<FindReplaceToggleButtonProps, "iconType" | "isChecked">) => "scb-5" | "scn-7" | "fcb-5" | "fcn-7";
|
6
|
-
export declare const getUpdatedSearchMatchesCount: (newQuery: SearchQuery, view: EditorView) => {
|
7
|
-
count: number;
|
8
|
-
current: number;
|
9
|
-
};
|
10
|
-
export declare const getFoldGutterElement: (open: boolean) => HTMLSpanElement;
|
11
|
-
export declare const getReadOnlyElement: () => HTMLDivElement;
|
12
|
-
export declare const getLanguageExtension: (mode: CodeEditorProps["mode"]) => Extension;
|
13
|
-
export declare const getValidationSchema: ({ mode, validatorSchema, schemaURI, }: Pick<CodeEditorProps, "schemaURI" | "validatorSchema" | "mode">) => Extension[];
|
1
|
+
import { AppThemeType } from '../../Shared/Providers';
|
2
|
+
import { CodeEditorInterface } from './types';
|
3
|
+
export declare const getCodeEditorThemeFromAppTheme: (editorTheme: CodeEditorInterface["theme"], appTheme: AppThemeType) => CodeEditorInterface["theme"];
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { CodeEditorProps } from './types';
|
2
|
+
declare const CodeEditor: {
|
3
|
+
<DiffView extends boolean = false>({ theme, value: propValue, originalValue, modifiedValue, isOriginalModifiable, mode, noParsing, children, tabSize, height, shebang, onChange, onOriginalValueChange, onModifiedValueChange, readOnly, placeholder, diffView, loading, customLoader, validatorSchema, schemaURI, cleanData, onBlur, onFocus, autoFocus, disableSearch, }: CodeEditorProps<DiffView>): JSX.Element;
|
4
|
+
Clipboard: () => JSX.Element;
|
5
|
+
Header: ({ children, className, hideDefaultSplitHeader }: import('./types').CodeEditorHeaderProps) => JSX.Element;
|
6
|
+
Warning: ({ className, text, children }: import('./types').CodeEditorStatusBarProps) => JSX.Element;
|
7
|
+
ErrorBar: ({ className, text, children }: import('./types').CodeEditorStatusBarProps) => JSX.Element;
|
8
|
+
Information: ({ className, children, text }: import('./types').CodeEditorStatusBarProps) => JSX.Element;
|
9
|
+
Container: ({ children, flexExpand }: {
|
10
|
+
children: import('react').ReactNode;
|
11
|
+
flexExpand?: boolean;
|
12
|
+
}) => JSX.Element;
|
13
|
+
};
|
14
|
+
export default CodeEditor;
|
@@ -0,0 +1,4 @@
|
|
1
|
+
import { CodeEditorPayloadType, CodeEditorInitialValueType, CodeEditorState } from './types';
|
2
|
+
export declare const CodeEditorReducer: (state: CodeEditorState, action: CodeEditorPayloadType) => CodeEditorState;
|
3
|
+
export declare const parseValueToCode: (value: string, mode: string, tabSize: number) => string;
|
4
|
+
export declare const initialState: ({ mode, value, lhsValue, diffView, noParsing, tabSize, }: CodeEditorInitialValueType) => CodeEditorState;
|
@@ -0,0 +1,107 @@
|
|
1
|
+
import { Dispatch, FunctionComponent, Key, MutableRefObject, ReactNode, SVGProps } from 'react';
|
2
|
+
import { JSONSchema7 } from 'json-schema';
|
3
|
+
import { EditorView, ReactCodeMirrorProps } from '@uiw/react-codemirror';
|
4
|
+
import { SearchQuery } from '@codemirror/search';
|
5
|
+
import { MODES } from '../Constants';
|
6
|
+
import { Never } from '../../Shared/types';
|
7
|
+
import { AppThemeType } from '../../Shared/Providers';
|
8
|
+
export interface CodeEditorStatusBarProps {
|
9
|
+
text: string;
|
10
|
+
className?: string;
|
11
|
+
children?: ReactNode;
|
12
|
+
}
|
13
|
+
export interface CodeEditorHeaderProps {
|
14
|
+
className?: string;
|
15
|
+
hideDefaultSplitHeader?: boolean;
|
16
|
+
children?: ReactNode;
|
17
|
+
}
|
18
|
+
type CodeEditorBaseProps = Partial<Pick<ReactCodeMirrorProps, 'onBlur' | 'onFocus' | 'autoFocus'>> & {
|
19
|
+
value?: ReactCodeMirrorProps['value'];
|
20
|
+
onChange?: (value: string) => void;
|
21
|
+
shebang?: string | JSX.Element;
|
22
|
+
validatorSchema?: JSONSchema7;
|
23
|
+
schemaURI?: string;
|
24
|
+
};
|
25
|
+
type CodeEditorDiffBaseProps = {
|
26
|
+
onOriginalValueChange?: (originalValue: string) => void;
|
27
|
+
onModifiedValueChange?: (modifiedValue: string) => void;
|
28
|
+
originalValue?: ReactCodeMirrorProps['value'];
|
29
|
+
modifiedValue?: ReactCodeMirrorProps['value'];
|
30
|
+
isOriginalModifiable?: boolean;
|
31
|
+
};
|
32
|
+
type CodeEditorPropsBasedOnDiffView<DiffView extends boolean> = DiffView extends true ? CodeEditorDiffBaseProps & Never<CodeEditorBaseProps> : CodeEditorBaseProps & Never<CodeEditorDiffBaseProps>;
|
33
|
+
export type CodeEditorProps<DiffView extends boolean = false> = {
|
34
|
+
/**
|
35
|
+
* @default 450
|
36
|
+
*/
|
37
|
+
height?: 'auto' | '100%' | 'fitToParent' | number;
|
38
|
+
children?: ReactNode;
|
39
|
+
mode?: MODES;
|
40
|
+
tabSize?: number;
|
41
|
+
readOnly?: boolean;
|
42
|
+
placeholder?: string;
|
43
|
+
noParsing?: boolean;
|
44
|
+
loading?: boolean;
|
45
|
+
customLoader?: JSX.Element;
|
46
|
+
cleanData?: boolean;
|
47
|
+
/**
|
48
|
+
* If true, disables the in-built search
|
49
|
+
* @default false
|
50
|
+
*/
|
51
|
+
disableSearch?: boolean;
|
52
|
+
diffView?: DiffView;
|
53
|
+
theme?: AppThemeType;
|
54
|
+
} & CodeEditorPropsBasedOnDiffView<DiffView>;
|
55
|
+
export interface GetCodeEditorHeightReturnType {
|
56
|
+
codeEditorParentClassName: string;
|
57
|
+
codeEditorClassName: string;
|
58
|
+
codeEditorHeight: string;
|
59
|
+
}
|
60
|
+
export type HoverTexts = {
|
61
|
+
message: string;
|
62
|
+
typeInfo: string;
|
63
|
+
};
|
64
|
+
export type FindReplaceQuery = Partial<Pick<SearchQuery, 'search' | 'wholeWord' | 'regexp' | 'replace' | 'caseSensitive'>>;
|
65
|
+
export interface FindReplaceProps {
|
66
|
+
view: EditorView;
|
67
|
+
defaultQuery: SearchQuery;
|
68
|
+
}
|
69
|
+
export type CodeEditorActionTypes = 'setDiff' | 'setCode' | 'setLhsCode';
|
70
|
+
export interface CodeEditorPayloadType {
|
71
|
+
type: CodeEditorActionTypes;
|
72
|
+
value: any;
|
73
|
+
}
|
74
|
+
export interface CodeEditorInitialValueType extends Pick<CodeEditorProps, 'value' | 'noParsing' | 'tabSize' | 'mode'> {
|
75
|
+
lhsValue: ReactCodeMirrorProps['value'];
|
76
|
+
diffView: boolean;
|
77
|
+
}
|
78
|
+
export interface CodeEditorState extends Pick<CodeEditorProps, 'noParsing'> {
|
79
|
+
code: CodeEditorProps['value'];
|
80
|
+
lhsCode: CodeEditorProps<true>['originalValue'];
|
81
|
+
diffMode: CodeEditorProps<boolean>['diffView'];
|
82
|
+
}
|
83
|
+
export interface CodeEditorContextProps extends Pick<CodeEditorProps, 'readOnly' | 'height'> {
|
84
|
+
state: CodeEditorState;
|
85
|
+
hasCodeEditorContainer: boolean;
|
86
|
+
dispatch: Dispatch<CodeEditorPayloadType>;
|
87
|
+
}
|
88
|
+
export interface FindReplaceToggleButtonProps {
|
89
|
+
isChecked: boolean;
|
90
|
+
Icon: FunctionComponent<SVGProps<SVGSVGElement>>;
|
91
|
+
onChange: (isChecked: boolean) => void;
|
92
|
+
iconType?: 'stroke' | 'fill';
|
93
|
+
tooltipText: string;
|
94
|
+
}
|
95
|
+
export type CodeEditorRendererProps = Required<Pick<CodeEditorProps, 'loading' | 'customLoader' | 'height' | 'readOnly' | 'shebang' | 'placeholder' | 'onBlur' | 'onFocus' | 'autoFocus'>> & Required<Pick<CodeEditorDiffBaseProps, 'isOriginalModifiable'>> & {
|
96
|
+
codemirrorMergeKey: Key;
|
97
|
+
codeMirrorParentDivRef: MutableRefObject<HTMLDivElement>;
|
98
|
+
codeEditorTheme: ReactCodeMirrorProps['theme'];
|
99
|
+
isDarkTheme: boolean;
|
100
|
+
state: CodeEditorState;
|
101
|
+
handleOnChange: ReactCodeMirrorProps['onChange'];
|
102
|
+
handleLhsOnChange: ReactCodeMirrorProps['onChange'];
|
103
|
+
originalViewExtensions: ReactCodeMirrorProps['extensions'];
|
104
|
+
modifiedViewExtensions: ReactCodeMirrorProps['extensions'];
|
105
|
+
extensions: ReactCodeMirrorProps['extensions'];
|
106
|
+
};
|
107
|
+
export {};
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import { SearchQuery } from '@codemirror/search';
|
2
|
+
import { EditorView, Extension } from '@uiw/react-codemirror';
|
3
|
+
import { CodeEditorProps, FindReplaceToggleButtonProps, GetCodeEditorHeightReturnType } from './types';
|
4
|
+
export declare const getCodeEditorHeight: (height: CodeEditorProps["height"]) => GetCodeEditorHeightReturnType;
|
5
|
+
export declare const getFindReplaceToggleButtonIconClass: ({ iconType, isChecked, }: Pick<FindReplaceToggleButtonProps, "iconType" | "isChecked">) => "scb-5" | "scn-7" | "fcb-5" | "fcn-7";
|
6
|
+
export declare const getUpdatedSearchMatchesCount: (newQuery: SearchQuery, view: EditorView) => {
|
7
|
+
count: number;
|
8
|
+
current: number;
|
9
|
+
};
|
10
|
+
export declare const getFoldGutterElement: (open: boolean) => HTMLSpanElement;
|
11
|
+
export declare const getReadOnlyElement: () => HTMLDivElement;
|
12
|
+
export declare const getLanguageExtension: (mode: CodeEditorProps["mode"]) => Extension;
|
13
|
+
export declare const getValidationSchema: ({ mode, validatorSchema, schemaURI, }: Pick<CodeEditorProps, "schemaURI" | "validatorSchema" | "mode">) => Extension[];
|
@@ -55,9 +55,11 @@ export declare const URLS: {
|
|
55
55
|
DEPLOYMENT_HISTORY_CONFIGURATIONS: string;
|
56
56
|
GLOBAL_CONFIG_SCOPED_VARIABLES: string;
|
57
57
|
GLOBAL_CONFIG_DEPLOYMENT_CHARTS_LIST: string;
|
58
|
+
GLOBAL_CONFIG_DEPLOYMENT_CHARTS_UPLOAD_CHART: string;
|
58
59
|
NETWORK_STATUS_INTERFACE: string;
|
59
60
|
RESOURCE_BROWSER: string;
|
60
61
|
COMPARE_CLUSTERS: string;
|
62
|
+
CONFIG_DRIFT: string;
|
61
63
|
};
|
62
64
|
export declare const ROUTES: {
|
63
65
|
APP: string;
|
@@ -1,3 +1,6 @@
|
|
1
1
|
import { InfoColourBarType } from '../Types';
|
2
|
+
/**
|
3
|
+
* @deprecated Use InfoBlock instead
|
4
|
+
*/
|
2
5
|
declare const InfoColourBar: ({ message, classname, Icon, iconClass, iconSize, renderActionButton, linkText, redirectLink, linkOnClick, linkClass, internalLink, styles, hideIcon, textConfig, }: InfoColourBarType) => JSX.Element;
|
3
6
|
export default InfoColourBar;
|
package/dist/Common/Types.d.ts
CHANGED
@@ -2,7 +2,7 @@ import { default as React, ReactNode, CSSProperties, ReactElement, MutableRefObj
|
|
2
2
|
import { TippyProps } from '@tippyjs/react';
|
3
3
|
import { UserGroupDTO } from '../Pages/GlobalConfigurations';
|
4
4
|
import { ImageComment, ReleaseTag } from './ImageTags.Types';
|
5
|
-
import { MandatoryPluginBaseStateType, RegistryType, RuntimePluginVariables, Severity, PolicyBlockInfo, TargetPlatformItemDTO } from '../Shared';
|
5
|
+
import { MandatoryPluginBaseStateType, RegistryType, RuntimePluginVariables, Severity, PolicyBlockInfo, TargetPlatformItemDTO, ComponentLayoutType } from '../Shared';
|
6
6
|
import { ACTION_STATE, DEPLOYMENT_WINDOW_TYPE, DockerConfigOverrideType, RefVariableType, SortingOrder, TaskErrorObj, VariableTypeFormat } from '.';
|
7
7
|
/**
|
8
8
|
* Generic response type object with support for overriding the result type
|
@@ -118,7 +118,7 @@ export interface GenericEmptyStateType {
|
|
118
118
|
/**
|
119
119
|
* @default 'column'
|
120
120
|
*/
|
121
|
-
layout?:
|
121
|
+
layout?: ComponentLayoutType;
|
122
122
|
contentClassName?: string;
|
123
123
|
}
|
124
124
|
export interface ErrorPageType extends Pick<GenericEmptyStateType, 'image' | 'title' | 'subTitle' | 'renderButton' | 'imageType'>, Pick<ErrorScreenManagerProps, 'reload' | 'redirectURL'> {
|
@@ -1,18 +1,16 @@
|
|
1
|
-
|
1
|
+
interface DeploymentChartInfo {
|
2
2
|
id: number;
|
3
3
|
chartDescription?: string;
|
4
4
|
isUserUploaded: boolean;
|
5
5
|
name: string;
|
6
6
|
version: string;
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
7
|
+
uploadedBy: string;
|
8
|
+
}
|
9
|
+
export type DeploymentChartListDTO = DeploymentChartInfo[];
|
10
|
+
export interface DeploymentChartVersionsType extends Pick<DeploymentChartInfo, 'id' | 'version' | 'uploadedBy' | 'isUserUploaded'> {
|
11
11
|
description: string;
|
12
12
|
}
|
13
|
-
export interface DeploymentChartType {
|
14
|
-
name: string;
|
15
|
-
isUserUploaded: boolean;
|
13
|
+
export interface DeploymentChartType extends Pick<DeploymentChartInfo, 'name'> {
|
16
14
|
versions: DeploymentChartVersionsType[];
|
17
15
|
}
|
18
16
|
export declare enum DEVTRON_DEPLOYMENT_CHART_NAMES {
|
@@ -1,3 +1,3 @@
|
|
1
1
|
import { AppStatusDetailsChartType } from './types';
|
2
|
-
declare const AppStatusDetailsChart: ({ filterRemoveHealth, showFooter,
|
2
|
+
declare const AppStatusDetailsChart: ({ filterRemoveHealth, showFooter, showConfigDriftInfo, onClose, }: AppStatusDetailsChartType) => JSX.Element;
|
3
3
|
export default AppStatusDetailsChart;
|
@@ -1,3 +1,3 @@
|
|
1
1
|
import { DeploymentTemplateHistoryType } from '../types';
|
2
|
-
declare const DeploymentHistoryDiffView: ({ currentConfiguration, baseTemplateConfiguration, previousConfigAvailable, rootClassName, }: DeploymentTemplateHistoryType) => JSX.Element;
|
2
|
+
declare const DeploymentHistoryDiffView: ({ currentConfiguration, baseTemplateConfiguration, previousConfigAvailable, rootClassName, codeEditorKey, }: DeploymentTemplateHistoryType) => JSX.Element;
|
3
3
|
export default DeploymentHistoryDiffView;
|
@@ -487,6 +487,7 @@ export interface DeploymentTemplateHistoryType {
|
|
487
487
|
baseTemplateConfiguration: DeploymentHistoryDetail;
|
488
488
|
previousConfigAvailable: boolean;
|
489
489
|
rootClassName?: string;
|
490
|
+
codeEditorKey?: string;
|
490
491
|
}
|
491
492
|
export interface DeploymentHistoryDetailRes extends ResponseType {
|
492
493
|
result?: DeploymentHistoryDetail;
|
@@ -509,7 +510,7 @@ export interface DeploymentHistorySidebarType {
|
|
509
510
|
export interface AppStatusDetailsChartType {
|
510
511
|
filterRemoveHealth?: boolean;
|
511
512
|
showFooter: boolean;
|
512
|
-
|
513
|
+
showConfigDriftInfo?: boolean;
|
513
514
|
onClose?: () => void;
|
514
515
|
}
|
515
516
|
export interface StatusFilterButtonType {
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import { ReactElement, ReactNode } from 'react';
|
2
|
+
import { BorderConfigType, ComponentLayoutType } from '../../types';
|
2
3
|
export type LabelOrAriaLabelType = {
|
3
4
|
label: ReactNode;
|
4
5
|
ariaLabel?: never;
|
@@ -18,7 +19,7 @@ export type FormFieldLabelProps = LabelOrAriaLabelType & {
|
|
18
19
|
/**
|
19
20
|
* Layout of the field
|
20
21
|
*/
|
21
|
-
layout?:
|
22
|
+
layout?: ComponentLayoutType;
|
22
23
|
};
|
23
24
|
export interface FormFieldInfoProps extends Pick<FormFieldLabelProps, 'inputId'> {
|
24
25
|
/**
|
@@ -46,30 +47,5 @@ export interface FormFieldWrapperProps extends Pick<FormFieldLabelProps, 'label'
|
|
46
47
|
*/
|
47
48
|
fullWidth?: boolean;
|
48
49
|
children: ReactElement;
|
49
|
-
borderRadiusConfig?:
|
50
|
-
/**
|
51
|
-
* If false, the top border radius is not applied
|
52
|
-
*
|
53
|
-
* @default true
|
54
|
-
*/
|
55
|
-
top?: boolean;
|
56
|
-
/**
|
57
|
-
* If false, the right border radius is not applied
|
58
|
-
*
|
59
|
-
* @default true
|
60
|
-
*/
|
61
|
-
right?: boolean;
|
62
|
-
/**
|
63
|
-
* If false, the bottom border radius is not applied
|
64
|
-
*
|
65
|
-
* @default true
|
66
|
-
*/
|
67
|
-
bottom?: boolean;
|
68
|
-
/**
|
69
|
-
* If false, the left border radius is not applied
|
70
|
-
*
|
71
|
-
* @default true
|
72
|
-
*/
|
73
|
-
left?: boolean;
|
74
|
-
};
|
50
|
+
borderRadiusConfig?: BorderConfigType;
|
75
51
|
}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { FormFieldInfoProps, FormFieldLabelProps
|
1
|
+
import { FormFieldInfoProps, FormFieldLabelProps } from './types';
|
2
2
|
export declare const getFormErrorElementId: (inputId: FormFieldLabelProps["inputId"]) => string;
|
3
3
|
export declare const getFormLabelElementId: (inputId: FormFieldLabelProps["inputId"]) => string;
|
4
4
|
export declare const getFormHelperTextElementId: (inputId: FormFieldLabelProps["inputId"]) => string;
|
@@ -15,4 +15,3 @@ export declare const getFormFieldAriaAttributes: ({ inputId, label, ariaLabel, r
|
|
15
15
|
'aria-describedby'?: string;
|
16
16
|
'aria-required': boolean;
|
17
17
|
};
|
18
|
-
export declare const getFormFieldBorderClassName: (borderRadiusConfig?: FormFieldWrapperProps["borderRadiusConfig"]) => string;
|
@@ -0,0 +1,5 @@
|
|
1
|
+
import { InfoBlockProps } from './types';
|
2
|
+
export declare const VARIANT_TO_BG_MAP: Record<InfoBlockProps['variant'], string>;
|
3
|
+
export declare const VARIANT_TO_ICON_MAP: Record<InfoBlockProps['variant'], InfoBlockProps['customIcon']>;
|
4
|
+
export declare const CONTAINER_SIZE_TO_CLASS_MAP: Record<InfoBlockProps['size'], string>;
|
5
|
+
export declare const SIZE_TO_ICON_CLASS_MAP: Record<InfoBlockProps['size'], string>;
|
@@ -0,0 +1,40 @@
|
|
1
|
+
import { ComponentSizeType } from '../../constants';
|
2
|
+
import { BorderConfigType, ComponentLayoutType } from '../../types';
|
3
|
+
import { ReactElement, ReactNode } from 'react';
|
4
|
+
import { ButtonProps } from '../Button';
|
5
|
+
export type InfoBlockProps = {
|
6
|
+
/**
|
7
|
+
* @default 'row'
|
8
|
+
*/
|
9
|
+
layout?: ComponentLayoutType;
|
10
|
+
/**
|
11
|
+
* @default 'information'
|
12
|
+
*/
|
13
|
+
variant?: 'error' | 'help' | 'information' | 'success' | 'warning';
|
14
|
+
/**
|
15
|
+
* @default ComponentSizeType.large
|
16
|
+
*/
|
17
|
+
size?: Extract<ComponentSizeType, ComponentSizeType.large | ComponentSizeType.medium>;
|
18
|
+
/**
|
19
|
+
* If given would override the default icon derived from type
|
20
|
+
*/
|
21
|
+
customIcon?: ReactElement;
|
22
|
+
buttonProps?: ButtonProps;
|
23
|
+
borderConfig?: BorderConfigType;
|
24
|
+
borderRadiusConfig?: BorderConfigType;
|
25
|
+
} & ({
|
26
|
+
/**
|
27
|
+
* If string, would apply h tag with necessary classes
|
28
|
+
*/
|
29
|
+
heading: ReactNode;
|
30
|
+
/**
|
31
|
+
* If string, would apply p tag with necessary classes
|
32
|
+
*/
|
33
|
+
description: ReactNode;
|
34
|
+
} | {
|
35
|
+
heading?: never;
|
36
|
+
description: ReactNode;
|
37
|
+
} | {
|
38
|
+
heading: ReactNode;
|
39
|
+
description?: never;
|
40
|
+
});
|