@grafana/k6-test-builder 0.3.1-alpha.0 → 0.3.2

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/README.md CHANGED
@@ -1,20 +1 @@
1
- # Getting Started with k6-test-builder
2
-
3
- This package is published to the Github npm registry [Working with the npm registry](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-npm-registry).
4
-
5
- ## Available Scripts
6
-
7
- In the project directory, you can run:
8
-
9
- ### `npm run build`
10
-
11
- Builds the app for production to the `dist` folder.\
12
-
13
- Your app is ready to be deployed!
14
-
15
- See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
16
-
17
- ## Publish NPM package
18
-
19
- 1. Open [NPM bump version workflow](https://github.com/grafana/k6-test-builder/actions/workflows/npm-bump-version.yml)
20
- 2. Select "Run workflow" and choose semantic version
1
+ This package is a UI component used by Grafana and is not intended for public use.
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { ChangeEventHandler, FocusEventHandler, AnchorHTMLAttributes, ReactNode, ElementType, ReactElement, FunctionComponent } from "react";
2
- import { ThemeOptions } from "@material-ui/core/styles/createTheme";
1
+ import { FocusEventHandler, AnchorHTMLAttributes, ReactNode, ElementType, ReactElement, FunctionComponent } from "react";
3
2
  import { InvalidArchiveError } from "har-to-k6";
3
+ import { ThemeOptions } from "@material-ui/core/styles/createTheme";
4
4
  /** @todo move this type */
5
5
  interface K6LoadZone {
6
6
  k6_load_zone_id: string;
@@ -276,10 +276,11 @@ interface ConstrainedRange {
276
276
  value: string;
277
277
  }
278
278
  declare const CONSTRAINED_RANGE_BODY = "CONSTRAINED_RANGE_BODY";
279
- type ScriptEditorMode = 'test' | 'scenario';
279
+ type ScriptEditorMode = 'test' | 'scenario' | 'body.json' | 'body.text';
280
+ type ValueChangeHandler = (value: string) => void;
280
281
  /** @todo Create interface that fits cloud app and plugin */
281
282
  export interface ScriptEditorProps {
282
- mode?: ScriptEditorMode;
283
+ mode: ScriptEditorMode;
283
284
  scenario?: ScriptScenarioConfig;
284
285
  imports?: string[];
285
286
  filename?: string;
@@ -288,17 +289,19 @@ export interface ScriptEditorProps {
288
289
  value: string;
289
290
  template?: string;
290
291
  constrainedRanges?: ConstrainedRange[];
291
- onChange?: ChangeEventHandler<HTMLTextAreaElement> | ConstrainedRangeChange;
292
- onBodyChange?: (value: string) => void;
292
+ onChange?: ValueChangeHandler;
293
+ onBodyChange?: ConstrainedRangeChange;
293
294
  onBlur?: FocusEventHandler<HTMLTextAreaElement>;
294
295
  error?: Error;
295
296
  readOnly?: boolean;
296
297
  onImportsChange?: (imports: string[]) => void;
298
+ nodeId?: string;
297
299
  }
298
300
  interface DocsLinkProps extends Omit<AnchorHTMLAttributes<HTMLAnchorElement>, 'href'> {
299
301
  article: DocsArticleLink;
300
302
  children: ReactNode;
301
303
  }
304
+ declare const TestBuilderIcon: () => JSX.Element;
302
305
  interface StagesVirtualizationComponentProps {
303
306
  startValue?: number;
304
307
  stages: RampingStage[];
@@ -311,12 +314,6 @@ interface TestBuilderInternalContextProviderProps {
311
314
  children?: ReactNode;
312
315
  }
313
316
  export function TestBuilderInternalContextProvider({ children, }: TestBuilderInternalContextProviderProps): JSX.Element;
314
- interface MuiThemeProviderProps {
315
- children: ReactNode;
316
- inherit?: boolean;
317
- theme?: ThemeOptions;
318
- }
319
- export function TestBuilderThemeProvider({ children, theme: _theme }: MuiThemeProviderProps): JSX.Element;
320
317
  declare function getTestBuilderTest(): Promise<[TestBuilderTest & {
321
318
  script: string;
322
319
  }, Error | InvalidArchiveError | undefined]>;
@@ -334,8 +331,10 @@ interface TestBuilderStandaloneProps {
334
331
  onViewChange?: (view: string) => void;
335
332
  StagesVirtualizationComponent?: (props: StagesVirtualizationComponentProps) => ReactElement;
336
333
  ScriptEditorComponent?: (props: ScriptEditorProps) => ReactElement;
334
+ TestBuilderIconComponent?: typeof TestBuilderIcon;
335
+ readonlyScriptScenarios?: boolean;
337
336
  }
338
- export function TestBuilder({ loading, saving, k6Test, hasCloudExecution, availableLoadZones, DocsLinkComponent, onViewChange, StagesVirtualizationComponent, ScriptEditorComponent, }: TestBuilderStandaloneProps): JSX.Element;
337
+ export function TestBuilder({ loading, saving, k6Test, hasCloudExecution, availableLoadZones, DocsLinkComponent, onViewChange, StagesVirtualizationComponent, ScriptEditorComponent, TestBuilderIconComponent, readonlyScriptScenarios, }: TestBuilderStandaloneProps): JSX.Element;
339
338
  interface TestMetaInformationProps {
340
339
  className?: string;
341
340
  }
@@ -349,6 +348,12 @@ export const StatusBar: FunctionComponent<{
349
348
  className?: string;
350
349
  }>;
351
350
  export function useTestBuilderName(): [string, (name: string) => void];
351
+ interface MuiThemeProviderProps {
352
+ children: ReactNode;
353
+ inherit?: boolean;
354
+ theme?: ThemeOptions;
355
+ }
356
+ export function TestBuilderThemeProvider({ children, theme: _theme }: MuiThemeProviderProps): JSX.Element;
352
357
  declare const grafanaThemeDark: {
353
358
  name: string;
354
359
  isDark: boolean;