@harnessio/yaml-editor 0.13.0 → 0.14.0

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,7 +1,8 @@
1
+ import { EditorProps } from '@monaco-editor/react';
1
2
  import { BlameItem } from '../types/blame';
2
3
  import { ThemeDefinition } from '../types/themes';
3
4
 
4
- export interface BlameEditorProps<_> {
5
+ export interface BlameEditorProps {
5
6
  code: string;
6
7
  language: string;
7
8
  themeConfig?: {
@@ -13,5 +14,6 @@ export interface BlameEditorProps<_> {
13
14
  lineNumbersPosition?: 'left' | 'center';
14
15
  blameData: BlameItem[];
15
16
  showSeparators?: boolean;
17
+ height?: EditorProps['height'];
16
18
  }
17
- export declare function BlameEditor<T>(props: BlameEditorProps<T>): JSX.Element;
19
+ export declare function BlameEditor({ code, language, themeConfig, lineNumbersPosition, blameData, showSeparators, theme: themeFromProps, height }: BlameEditorProps): JSX.Element;
@@ -1,5 +1,6 @@
1
+ import { EditorProps } from '@monaco-editor/react';
1
2
  import { ThemeDefinition } from '../types/themes';
2
- /// <reference types="react" />
3
+
3
4
  import * as monaco from 'monaco-editor';
4
5
  export interface CodeRevision {
5
6
  code: string;
@@ -18,5 +19,6 @@ export interface CodeEditorProps<_> {
18
19
  options?: {
19
20
  readOnly?: boolean;
20
21
  };
22
+ height?: EditorProps['height'];
21
23
  }
22
- export declare function CodeEditor<T>(props: CodeEditorProps<T>): JSX.Element;
24
+ export declare function CodeEditor<T>({ codeRevision, onCodeRevisionChange, language, themeConfig, options, theme: themeFromProps, height }: CodeEditorProps<T>): JSX.Element;
@@ -1,3 +1,4 @@
1
+ import { EditorProps } from '@monaco-editor/react';
1
2
  import { ThemeDefinition } from '../types/themes';
2
3
 
3
4
  export interface CodeRevision {
@@ -17,5 +18,6 @@ export interface DiffEditorProps<_> {
17
18
  options?: {
18
19
  readOnly?: boolean;
19
20
  };
21
+ height?: EditorProps['height'];
20
22
  }
21
- export declare function CodeDiffEditor<T>(props: DiffEditorProps<T>): JSX.Element;
23
+ export declare function CodeDiffEditor<T>({ original, modified, language, themeConfig, options, theme: themeFromProps, height }: DiffEditorProps<T>): JSX.Element;
@@ -1,7 +1,6 @@
1
1
  import { InlineAction } from '../types/inline-actions';
2
2
  import { PathSelector } from '../types/selectors';
3
3
  import { ThemeDefinition } from '../types/themes';
4
- /// <reference types="react" />
5
4
  import * as monaco from 'monaco-editor';
6
5
  export interface YamlRevision {
7
6
  yaml: string;
@@ -24,10 +23,15 @@ export interface YamlEditorProps<T> {
24
23
  themes?: ThemeDefinition[];
25
24
  };
26
25
  theme?: string;
26
+ options?: monaco.editor.IStandaloneEditorConstructionOptions;
27
27
  selection?: {
28
28
  path: string;
29
29
  className: string;
30
30
  revealInCenter?: boolean;
31
31
  };
32
+ minimap?: boolean;
33
+ folding?: boolean;
34
+ animateOnUpdate?: boolean;
35
+ onAnimateEnd?: () => void;
32
36
  }
33
- export declare function YamlEditor<T>(props: YamlEditorProps<T>): JSX.Element;
37
+ export declare const YamlEditor: <T>(props: YamlEditorProps<T>) => JSX.Element;
@@ -11,5 +11,5 @@ export interface YamlEditorContextInterface {
11
11
  }) => void;
12
12
  }
13
13
  export declare const YamlEditorContext: import('react').Context<YamlEditorContextInterface>;
14
- export declare function YamlEditorContextProvider({ children }: React.PropsWithChildren): React.ReactElement;
14
+ export declare function YamlEditorContextProvider({ children }: React.PropsWithChildren<React.HTMLAttributes<HTMLElement>>): React.ReactElement;
15
15
  export declare function useYamlEditorContext(): YamlEditorContextInterface;
@@ -0,0 +1,2 @@
1
+ import * as monaco from 'monaco-editor';
2
+ export declare const MonacoCommonDefaultOptions: monaco.editor.IStandaloneDiffEditorConstructionOptions;