@malloydata/malloy-explorer 0.0.331-dev260103000551 → 0.0.331-dev260122023015

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.
@@ -3,6 +3,13 @@ import * as Malloy from '@malloydata/malloy-interfaces';
3
3
  import type { DrillData } from '@malloydata/render';
4
4
  import { SearchValueMapResult } from '../hooks/useTopValues';
5
5
  import { ColorTheme } from './primitives/colors.stylex';
6
+ import { SubmittedQuery } from './ResultPanel/SubmittedQuery';
7
+ export interface MalloyExplorerDownloadProps {
8
+ source: Malloy.SourceInfo;
9
+ submittedQuery: SubmittedQuery;
10
+ name: string;
11
+ format: 'json' | 'csv';
12
+ }
6
13
  export interface MalloyExplorerProviderProps {
7
14
  /** Malloy source to extend for query */
8
15
  source: Malloy.SourceInfo;
@@ -22,5 +29,6 @@ export interface MalloyExplorerProviderProps {
22
29
  /** Color overrides */
23
30
  theme?: ColorTheme;
24
31
  dark?: boolean;
32
+ onDownload?: ({ submittedQuery, name, format, }: MalloyExplorerDownloadProps) => void;
25
33
  }
26
- export declare function MalloyExplorerProvider({ source, query, onQueryChange, focusedNestViewPath, onFocusedNestViewPathChange, children, topValues, onDrill, theme, dark, }: MalloyExplorerProviderProps): import("react/jsx-runtime").JSX.Element;
34
+ export declare function MalloyExplorerProvider({ source, query, onQueryChange, focusedNestViewPath, onFocusedNestViewPathChange, children, topValues, onDrill, theme, dark, onDownload, }: MalloyExplorerProviderProps): import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,8 @@
1
1
  import * as Malloy from '@malloydata/malloy-interfaces';
2
+ import { SubmittedQuery } from '../..';
2
3
  export interface DownloadButtonProps {
3
- result?: Malloy.Result;
4
+ source: Malloy.SourceInfo;
5
+ submittedQuery?: SubmittedQuery;
4
6
  name?: string;
5
7
  }
6
- export declare function DownloadButton({ name, result }: DownloadButtonProps): import("react/jsx-runtime").JSX.Element | null;
8
+ export declare function DownloadButton({ name, source, submittedQuery, }: DownloadButtonProps): import("react/jsx-runtime").JSX.Element | null;
@@ -2,6 +2,7 @@ import * as React from 'react';
2
2
  import * as Malloy from '@malloydata/malloy-interfaces';
3
3
  import { ASTQuery } from '@malloydata/malloy-query-builder';
4
4
  import type { DrillData } from '@malloydata/render';
5
+ import { MalloyExplorerDownloadProps } from '../components/MalloyExplorerProvider';
5
6
  export interface QueryEditorContextProps {
6
7
  /** Source object at the root level */
7
8
  source: Malloy.SourceInfo;
@@ -11,6 +12,7 @@ export interface QueryEditorContextProps {
11
12
  setQuery: (query: Malloy.Query | string | undefined) => void;
12
13
  query: Malloy.Query | string | undefined;
13
14
  onDrill?: (drillData: DrillData) => void;
15
+ onDownload?: ({ submittedQuery, name, format, }: MalloyExplorerDownloadProps) => void;
14
16
  }
15
17
  /**
16
18
  * QueryEditorContext enables query editing by providing the setQuery
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@malloydata/malloy-explorer",
3
- "version": "0.0.331-dev260103000551",
3
+ "version": "0.0.331-dev260122023015",
4
4
  "description": "Malloy visual query builder",
5
5
  "main": "dist/cjs/index.cjs",
6
6
  "types": "dist/types/index.d.ts",