@malloydata/malloy-explorer 0.0.295-dev250710213205 → 0.0.299-dev250808170326

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.
Files changed (68) hide show
  1. package/@flowtypes/components/MalloyExplorerProvider.flow.js +1 -1
  2. package/dist/cjs/index.cjs +1163 -573
  3. package/dist/cjs/index.cjs.map +1 -1
  4. package/dist/esm/index.js +1130 -540
  5. package/dist/esm/index.js.map +1 -1
  6. package/dist/malloy-explorer.css +1 -2
  7. package/dist/types/components/FieldToken.d.ts +5 -1
  8. package/dist/types/components/MalloyExplorerProvider.d.ts +1 -1
  9. package/dist/types/components/QueryPanel/AddMenu/AddAggregate.d.ts +1 -3
  10. package/dist/types/components/QueryPanel/AddMenu/AddEmptyNest.d.ts +1 -3
  11. package/dist/types/components/QueryPanel/AddMenu/AddGroupBy.d.ts +1 -3
  12. package/dist/types/components/QueryPanel/AddMenu/AddLimit.d.ts +1 -3
  13. package/dist/types/components/QueryPanel/AddMenu/AddMenu.d.ts +1 -3
  14. package/dist/types/components/QueryPanel/AddMenu/AddOrderBy.d.ts +1 -3
  15. package/dist/types/components/QueryPanel/AddMenu/AddView.d.ts +1 -3
  16. package/dist/types/components/QueryPanel/AddMenu/AddWhere.d.ts +0 -2
  17. package/dist/types/components/QueryPanel/Operations.d.ts +2 -3
  18. package/dist/types/components/QueryPanel/Parameters.d.ts +3 -3
  19. package/dist/types/components/QueryPanel/Query.d.ts +3 -4
  20. package/dist/types/components/QueryPanel/Source.d.ts +3 -3
  21. package/dist/types/components/QueryPanel/View.d.ts +2 -3
  22. package/dist/types/components/QueryPanel/ViewDefinition.d.ts +2 -3
  23. package/dist/types/components/QueryPanel/Visualization.d.ts +1 -2
  24. package/dist/types/components/QueryPanel/VizEditor/VizEditor.d.ts +1 -2
  25. package/dist/types/components/QueryPanel/VizEditor/VizEditorDialog.d.ts +1 -2
  26. package/dist/types/components/QueryPanel/VizEditor/VizEditorPopover.d.ts +1 -2
  27. package/dist/types/components/QueryPanel/VizEditor/styles.d.ts +3 -0
  28. package/dist/types/components/QueryPanel/VizEditor/utils.d.ts +3 -0
  29. package/dist/types/components/QueryPanel/operations/AggregateOperations.d.ts +3 -4
  30. package/dist/types/components/QueryPanel/operations/DrillOperations.d.ts +1 -2
  31. package/dist/types/components/QueryPanel/operations/FilterOperations.d.ts +2 -3
  32. package/dist/types/components/QueryPanel/operations/GroupByOperations.d.ts +2 -3
  33. package/dist/types/components/QueryPanel/operations/LimitOperation.d.ts +2 -3
  34. package/dist/types/components/QueryPanel/operations/NestOperation.d.ts +3 -5
  35. package/dist/types/components/QueryPanel/operations/OperationActionTitle.d.ts +0 -2
  36. package/dist/types/components/QueryPanel/operations/OrderByOperations.d.ts +2 -3
  37. package/dist/types/components/QueryPanel/operations/RenameDialog.d.ts +3 -4
  38. package/dist/types/components/QueryPanel/operations/SortableOperations.d.ts +3 -4
  39. package/dist/types/components/ResultPanel/DownloadButton.d.ts +6 -0
  40. package/dist/types/components/SourcePanel/FieldGroupList.d.ts +3 -1
  41. package/dist/types/components/SourcePanel/FieldTokenWithActions.d.ts +3 -2
  42. package/dist/types/components/SourcePanel/SearchResultList.d.ts +3 -1
  43. package/dist/types/components/SourcePanel/hooks/useOperations.d.ts +0 -4
  44. package/dist/types/components/primitives/DropdownMenu.d.ts +1 -1
  45. package/dist/types/components/primitives/utils/icon.d.ts +6 -0
  46. package/dist/types/components/utils/axis.d.ts +10 -0
  47. package/dist/types/components/utils/download.d.ts +44 -0
  48. package/dist/types/components/utils/download.spec.d.ts +1 -0
  49. package/dist/types/components/utils/icon.d.ts +3 -3
  50. package/dist/types/components/utils/segment.d.ts +1 -0
  51. package/dist/types/contexts/QueryEditorContext.d.ts +1 -10
  52. package/dist/types/hooks/useQueryBuilder.d.ts +2 -2
  53. package/dist/types/hooks/useQueryUpdate.d.ts +10 -0
  54. package/dist/types/hooks/useTopValues.d.ts +18 -0
  55. package/package.json +8 -8
  56. package/.editorconfig +0 -8
  57. package/.github/workflows/prerelease.yaml +0 -28
  58. package/.github/workflows/test.yaml +0 -26
  59. package/.gitmodules +0 -3
  60. package/.node-version +0 -1
  61. package/.prettierrc.js +0 -8
  62. package/.vscode/extensions.json +0 -6
  63. package/babel.config.cjs +0 -49
  64. package/eslint.config.mjs +0 -150
  65. package/index.html +0 -19
  66. package/jest.config.ts +0 -27
  67. package/postcss.config.mjs +0 -20
  68. package/vite.config.mts +0 -69
@@ -33,7 +33,6 @@
33
33
  .mlyy280wj{--mly1ojyoay:var(--mlyndhcph)}
34
34
  .mly7ouyw2{--mly5m5edj:var(--mly1i3blw4)}
35
35
  .mlym9y5t7{--mlynfhokh:block}
36
- .mly28fmrt{--mlynfhokh:none}
37
36
  .mly1bo1i26{--mlyri8z08:0}
38
37
  .mly1ae5hkt{--mlyvpnzvp:block}
39
38
  .mly11ogjb6{--mlyvpnzvp:none}
@@ -52,7 +51,6 @@
52
51
  .mly1dsjhx:disabled{--mlyxo3nik:var(--mly1gq6bli)}
53
52
  .mlyiv1q3g:disabled{--mlyxo3nik:var(--mlywh4rgx)}
54
53
  .mly1u5txqc:hover{--mly1by112x:.3}
55
- .mly1x0xcia:hover{--mlynfhokh:block}
56
54
  .mly1fzkygm:hover{--mlyri8z08:.3}
57
55
  .mly1g9of4s:hover{--mlyvpnzvp:block}
58
56
  .mly157rht3:hover{--mlyvpnzvp:inline-flex}
@@ -186,6 +184,7 @@
186
184
  @layer priority4{
187
185
  .mly1ua5tub{-webkit-box-orient:vertical}
188
186
  .mly1gzmk7r{-webkit-line-clamp:3}
187
+ .mlyc26acl{align-content:center}
189
188
  .mly6s0dn4{align-items:center}
190
189
  .mlypqajaz{align-items:end}
191
190
  .mly1cy8zhl{align-items:flex-start}
@@ -14,6 +14,10 @@ interface FieldTokenProps extends React.ComponentProps<typeof Token> {
14
14
  * The controlled visible state of the hover actions.
15
15
  */
16
16
  hoverActionsVisible?: boolean;
17
+ /**
18
+ * Optional sibling elements to render before the hover actions.
19
+ */
20
+ additionalSiblings?: React.ReactNode;
17
21
  }
18
- export default function FieldToken({ field, hoverActions, hoverActionsVisible, ...props }: FieldTokenProps): import("react/jsx-runtime").JSX.Element;
22
+ export default function FieldToken({ field, additionalSiblings, hoverActions, hoverActionsVisible, ...props }: FieldTokenProps): import("react/jsx-runtime").JSX.Element;
19
23
  export {};
@@ -1,7 +1,7 @@
1
1
  import { ReactNode } from 'react';
2
2
  import * as Malloy from '@malloydata/malloy-interfaces';
3
3
  import type { DrillData } from '@malloydata/render';
4
- import { SearchValueMapResult } from '../contexts/QueryEditorContext';
4
+ import { SearchValueMapResult } from '../hooks/useTopValues';
5
5
  export interface MalloyExplorerProviderProps {
6
6
  source: Malloy.SourceInfo;
7
7
  query?: Malloy.Query;
@@ -1,8 +1,6 @@
1
- import { ASTQuery } from '@malloydata/malloy-query-builder';
2
1
  import { ViewParent } from '../../utils/fields';
3
2
  export interface AddAggregateProps {
4
- rootQuery: ASTQuery;
5
3
  view: ViewParent;
6
4
  search: string;
7
5
  }
8
- export declare function AddAggregate({ rootQuery, view, search }: AddAggregateProps): import("react/jsx-runtime").JSX.Element;
6
+ export declare function AddAggregate({ view, search }: AddAggregateProps): import("react/jsx-runtime").JSX.Element;
@@ -1,7 +1,5 @@
1
- import { ASTQuery } from '@malloydata/malloy-query-builder';
2
1
  import { ViewParent } from '../../utils/fields';
3
2
  export interface AddEmptyNestProps {
4
- rootQuery: ASTQuery;
5
3
  view: ViewParent;
6
4
  }
7
- export declare function AddEmptyNest({ rootQuery, view }: AddEmptyNestProps): import("react/jsx-runtime").JSX.Element;
5
+ export declare function AddEmptyNest({ view }: AddEmptyNestProps): import("react/jsx-runtime").JSX.Element;
@@ -1,8 +1,6 @@
1
- import { ASTQuery } from '@malloydata/malloy-query-builder';
2
1
  import { ViewParent } from '../../utils/fields';
3
2
  export interface AddGroupByProps {
4
- rootQuery: ASTQuery;
5
3
  view: ViewParent;
6
4
  search: string;
7
5
  }
8
- export declare function AddGroupBy({ rootQuery, view, search }: AddGroupByProps): import("react/jsx-runtime").JSX.Element;
6
+ export declare function AddGroupBy({ view, search }: AddGroupByProps): import("react/jsx-runtime").JSX.Element;
@@ -1,7 +1,5 @@
1
- import { ASTQuery } from '@malloydata/malloy-query-builder';
2
1
  import { ViewParent } from '../../utils/fields';
3
2
  export interface AddLimitProps {
4
- rootQuery: ASTQuery;
5
3
  view: ViewParent;
6
4
  }
7
- export declare function AddLimit({ rootQuery, view }: AddLimitProps): import("react/jsx-runtime").JSX.Element;
5
+ export declare function AddLimit({ view }: AddLimitProps): import("react/jsx-runtime").JSX.Element;
@@ -1,7 +1,5 @@
1
- import { ASTQuery } from '@malloydata/malloy-query-builder';
2
1
  import { ViewParent } from '../../utils/fields';
3
2
  export interface AddMenuProps {
4
- rootQuery: ASTQuery;
5
3
  view: ViewParent;
6
4
  }
7
- export declare function AddMenu({ rootQuery, view }: AddMenuProps): import("react/jsx-runtime").JSX.Element;
5
+ export declare function AddMenu({ view }: AddMenuProps): import("react/jsx-runtime").JSX.Element;
@@ -1,8 +1,6 @@
1
- import { ASTQuery } from '@malloydata/malloy-query-builder';
2
1
  import { ViewParent } from '../../utils/fields';
3
2
  export interface AddEmptyNestProps {
4
- rootQuery: ASTQuery;
5
3
  view: ViewParent;
6
4
  search: string;
7
5
  }
8
- export declare function AddOrderBy({ rootQuery, view, search }: AddEmptyNestProps): import("react/jsx-runtime").JSX.Element;
6
+ export declare function AddOrderBy({ view, search }: AddEmptyNestProps): import("react/jsx-runtime").JSX.Element;
@@ -1,8 +1,6 @@
1
- import { ASTQuery } from '@malloydata/malloy-query-builder';
2
1
  import { ViewParent } from '../../utils/fields';
3
2
  export interface AddViewProps {
4
- rootQuery: ASTQuery;
5
3
  view: ViewParent;
6
4
  search: string;
7
5
  }
8
- export declare function AddView({ rootQuery, view, search }: AddViewProps): import("react/jsx-runtime").JSX.Element;
6
+ export declare function AddView({ view, search }: AddViewProps): import("react/jsx-runtime").JSX.Element | null;
@@ -1,7 +1,5 @@
1
- import { ASTQuery } from '@malloydata/malloy-query-builder';
2
1
  import { ViewParent } from '../../utils/fields';
3
2
  export interface AddWhereProps {
4
- rootQuery: ASTQuery;
5
3
  view: ViewParent;
6
4
  search: string;
7
5
  }
@@ -1,8 +1,7 @@
1
- import { ASTQuery, ASTViewDefinition } from '@malloydata/malloy-query-builder';
1
+ import { ASTViewDefinition } from '@malloydata/malloy-query-builder';
2
2
  import { ViewParent } from '../utils/fields';
3
3
  export interface OperationsProps {
4
- rootQuery: ASTQuery;
5
4
  view: ViewParent;
6
5
  viewDef: ASTViewDefinition;
7
6
  }
8
- export declare function Operations({ rootQuery, view, viewDef }: OperationsProps): import("react/jsx-runtime").JSX.Element | null;
7
+ export declare function Operations({ view, viewDef }: OperationsProps): import("react/jsx-runtime").JSX.Element | null;
@@ -1,8 +1,8 @@
1
- import { ASTQuery } from '@malloydata/malloy-query-builder';
1
+ import { ASTQueryDefinition } from '@malloydata/malloy-query-builder';
2
2
  /**
3
3
  * Source
4
4
  */
5
5
  export interface ParametersProps {
6
- rootQuery: ASTQuery;
6
+ definition: ASTQueryDefinition;
7
7
  }
8
- export declare function Parameters({ rootQuery }: ParametersProps): import("react/jsx-runtime").JSX.Element | null;
8
+ export declare function Parameters({ definition }: ParametersProps): import("react/jsx-runtime").JSX.Element | null;
@@ -1,8 +1,7 @@
1
1
  import * as Malloy from '@malloydata/malloy-interfaces';
2
- import { ASTQuery } from '@malloydata/malloy-query-builder';
2
+ import { ASTQueryDefinition } from '@malloydata/malloy-query-builder';
3
3
  export interface QueryProps {
4
- rootQuery: ASTQuery;
5
- query: ASTQuery;
4
+ definition: ASTQueryDefinition;
6
5
  setQuery?: (query: Malloy.Query | undefined) => void;
7
6
  }
8
- export declare function Query({ rootQuery, query, setQuery }: QueryProps): import("react/jsx-runtime").JSX.Element;
7
+ export declare function Query({ definition }: QueryProps): import("react/jsx-runtime").JSX.Element | null;
@@ -1,8 +1,8 @@
1
- import { ASTQuery } from '@malloydata/malloy-query-builder';
1
+ import { ASTQueryDefinition } from '@malloydata/malloy-query-builder';
2
2
  /**
3
3
  * Source
4
4
  */
5
5
  export interface SourceProps {
6
- rootQuery: ASTQuery;
6
+ definition: ASTQueryDefinition;
7
7
  }
8
- export declare function Source({ rootQuery }: SourceProps): import("react/jsx-runtime").JSX.Element | null;
8
+ export declare function Source({ definition }: SourceProps): import("react/jsx-runtime").JSX.Element | null;
@@ -1,6 +1,5 @@
1
- import { ASTQuery, ASTView } from '@malloydata/malloy-query-builder';
1
+ import { ASTView } from '@malloydata/malloy-query-builder';
2
2
  export interface ViewProps {
3
- rootQuery: ASTQuery;
4
3
  view: ASTView;
5
4
  }
6
- export declare function View({ rootQuery, view }: ViewProps): import("react/jsx-runtime").JSX.Element;
5
+ export declare function View({ view }: ViewProps): import("react/jsx-runtime").JSX.Element;
@@ -1,8 +1,7 @@
1
- import { ASTQuery, ASTViewDefinition } from '@malloydata/malloy-query-builder';
1
+ import { ASTViewDefinition } from '@malloydata/malloy-query-builder';
2
2
  import { ViewParent } from '../utils/fields';
3
3
  export interface ViewProps {
4
- rootQuery: ASTQuery;
5
4
  view: ViewParent;
6
5
  viewDef: ASTViewDefinition;
7
6
  }
8
- export declare function ViewDefinition({ rootQuery, view, viewDef }: ViewProps): import("react/jsx-runtime").JSX.Element;
7
+ export declare function ViewDefinition({ view, viewDef }: ViewProps): import("react/jsx-runtime").JSX.Element;
@@ -1,7 +1,6 @@
1
1
  import { ASTQuery, ASTView } from '@malloydata/malloy-query-builder';
2
2
  export interface VisualizationProps {
3
- rootQuery: ASTQuery;
4
3
  view: ASTQuery | ASTView;
5
4
  }
6
- export declare function Visualization({ rootQuery, view }: VisualizationProps): import("react/jsx-runtime").JSX.Element;
5
+ export declare function Visualization({ view }: VisualizationProps): import("react/jsx-runtime").JSX.Element;
7
6
  export declare function snakeToTitle(snake: string): string;
@@ -2,10 +2,9 @@ import { StyleXStyles } from '@stylexjs/stylex';
2
2
  import { ASTQuery, ASTView } from '@malloydata/malloy-query-builder';
3
3
  import { CoreVizPluginInstance } from '@malloydata/render';
4
4
  export interface VizEditorProps {
5
- rootQuery: ASTQuery;
6
5
  plugin: CoreVizPluginInstance;
7
6
  view: ASTQuery | ASTView;
8
7
  customStyle?: StyleXStyles;
9
8
  setOpen: (open: boolean) => void;
10
9
  }
11
- export declare function VizEditor({ rootQuery, view, plugin, setOpen }: VizEditorProps): import("react/jsx-runtime").JSX.Element;
10
+ export declare function VizEditor({ view, plugin, setOpen }: VizEditorProps): import("react/jsx-runtime").JSX.Element;
@@ -2,11 +2,10 @@ import { ASTQuery, ASTView } from '@malloydata/malloy-query-builder';
2
2
  import { CoreVizPluginInstance } from '@malloydata/render';
3
3
  import { StyleXStyles } from '@stylexjs/stylex';
4
4
  export interface VizEditorDialogProps {
5
- rootQuery: ASTQuery;
6
5
  plugin?: CoreVizPluginInstance;
7
6
  view: ASTQuery | ASTView;
8
7
  customStyle?: StyleXStyles;
9
8
  open: boolean;
10
9
  setOpen: (open: boolean) => void;
11
10
  }
12
- export declare function VizEditorDialog({ rootQuery, plugin, view, customStyle, open, setOpen, }: VizEditorDialogProps): import("react/jsx-runtime").JSX.Element | null;
11
+ export declare function VizEditorDialog({ plugin, view, customStyle, open, setOpen, }: VizEditorDialogProps): import("react/jsx-runtime").JSX.Element | null;
@@ -2,9 +2,8 @@ import { ASTQuery, ASTView } from '@malloydata/malloy-query-builder';
2
2
  import { CoreVizPluginInstance } from '@malloydata/render';
3
3
  import { StyleXStyles } from '@stylexjs/stylex';
4
4
  export interface VizEditorPopoverProps {
5
- rootQuery: ASTQuery;
6
5
  plugin: CoreVizPluginInstance;
7
6
  view: ASTQuery | ASTView;
8
7
  customStyle?: StyleXStyles;
9
8
  }
10
- export declare function VizEditorPopover({ rootQuery, plugin, view, customStyle, }: VizEditorPopoverProps): import("react/jsx-runtime").JSX.Element;
9
+ export declare function VizEditorPopover({ plugin, view, customStyle, }: VizEditorPopoverProps): import("react/jsx-runtime").JSX.Element;
@@ -10,6 +10,9 @@ export declare const styles: Readonly<{
10
10
  readonly display: import("@stylexjs/stylex/lib/StyleXTypes").StyleXClassNameFor<"display", "flex">;
11
11
  readonly justifyContent: import("@stylexjs/stylex/lib/StyleXTypes").StyleXClassNameFor<"justifyContent", "left">;
12
12
  }>;
13
+ readonly nest: Readonly<{
14
+ readonly gridColumn: import("@stylexjs/stylex/lib/StyleXTypes").StyleXClassNameFor<"gridColumn", "span 2">;
15
+ }>;
13
16
  readonly heading: Readonly<{
14
17
  readonly gridColumn: import("@stylexjs/stylex/lib/StyleXTypes").StyleXClassNameFor<"gridColumn", "span 2">;
15
18
  readonly fontWeight: import("@stylexjs/stylex/lib/StyleXTypes").StyleXClassNameFor<"fontWeight", "bold">;
@@ -0,0 +1,3 @@
1
+ export declare function setAtPath(current: Record<string, unknown>, path: string[], value: unknown): {
2
+ [x: string]: unknown;
3
+ };
@@ -1,9 +1,8 @@
1
- import { ASTAggregateViewOperation, ASTQuery, ASTSegmentViewDefinition } from '@malloydata/malloy-query-builder';
1
+ import { ASTAggregateViewOperation, ASTCalculateViewOperation, ASTSegmentViewDefinition } from '@malloydata/malloy-query-builder';
2
2
  import { ViewParent } from '../../utils/fields';
3
3
  export interface AggregateOperationsProps {
4
- rootQuery: ASTQuery;
5
4
  segment: ASTSegmentViewDefinition;
6
5
  view: ViewParent;
7
- aggregates: ASTAggregateViewOperation[];
6
+ aggregates: (ASTAggregateViewOperation | ASTCalculateViewOperation)[];
8
7
  }
9
- export declare function AggregateOperations({ rootQuery, segment, view, aggregates, }: AggregateOperationsProps): import("react/jsx-runtime").JSX.Element;
8
+ export declare function AggregateOperations({ segment, view, aggregates, }: AggregateOperationsProps): import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,5 @@
1
- import { ASTDrillViewOperation, ASTQuery } from '@malloydata/malloy-query-builder';
1
+ import { ASTDrillViewOperation } from '@malloydata/malloy-query-builder';
2
2
  export interface DrillOperationsProps {
3
- rootQuery: ASTQuery;
4
3
  drills: ASTDrillViewOperation[];
5
4
  }
6
5
  export declare function DrillOperations({ drills }: DrillOperationsProps): import("react/jsx-runtime").JSX.Element | null;
@@ -1,6 +1,5 @@
1
- import { ASTQuery, ASTWhereViewOperation, ASTHavingViewOperation } from '@malloydata/malloy-query-builder';
1
+ import { ASTWhereViewOperation, ASTHavingViewOperation } from '@malloydata/malloy-query-builder';
2
2
  export interface FilterOperationsProps {
3
- rootQuery: ASTQuery;
4
3
  filters: Array<ASTWhereViewOperation | ASTHavingViewOperation>;
5
4
  }
6
- export declare function FilterOperations({ rootQuery, filters }: FilterOperationsProps): import("react/jsx-runtime").JSX.Element | null;
5
+ export declare function FilterOperations({ filters }: FilterOperationsProps): import("react/jsx-runtime").JSX.Element | null;
@@ -1,9 +1,8 @@
1
- import { ASTGroupByViewOperation, ASTQuery, ASTSegmentViewDefinition } from '@malloydata/malloy-query-builder';
1
+ import { ASTGroupByViewOperation, ASTSegmentViewDefinition } from '@malloydata/malloy-query-builder';
2
2
  import { ViewParent } from '../../utils/fields';
3
3
  export interface GroupByOperationsProps {
4
- rootQuery: ASTQuery;
5
4
  segment: ASTSegmentViewDefinition;
6
5
  view: ViewParent;
7
6
  groupBys: ASTGroupByViewOperation[];
8
7
  }
9
- export declare function GroupByOperations({ rootQuery, segment, view, groupBys, }: GroupByOperationsProps): import("react/jsx-runtime").JSX.Element;
8
+ export declare function GroupByOperations({ segment, view, groupBys, }: GroupByOperationsProps): import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,5 @@
1
- import { ASTLimitViewOperation, ASTQuery } from '@malloydata/malloy-query-builder';
1
+ import { ASTLimitViewOperation } from '@malloydata/malloy-query-builder';
2
2
  export interface LimitOperationProps {
3
- rootQuery: ASTQuery;
4
3
  limit: ASTLimitViewOperation | undefined;
5
4
  }
6
- export declare function LimitOperation({ rootQuery, limit }: LimitOperationProps): import("react/jsx-runtime").JSX.Element | null;
5
+ export declare function LimitOperation({ limit }: LimitOperationProps): import("react/jsx-runtime").JSX.Element | null;
@@ -1,14 +1,12 @@
1
- import { ASTNestViewOperation, ASTQuery } from '@malloydata/malloy-query-builder';
1
+ import { ASTNestViewOperation } from '@malloydata/malloy-query-builder';
2
2
  import { ViewParent } from '../../utils/fields';
3
3
  export interface NestOperationsProps {
4
- rootQuery: ASTQuery;
5
4
  view: ViewParent;
6
5
  nests: ASTNestViewOperation[];
7
6
  }
8
- export declare function NestOperations({ rootQuery, view, nests }: NestOperationsProps): import("react/jsx-runtime").JSX.Element | null;
7
+ export declare function NestOperations({ view, nests }: NestOperationsProps): import("react/jsx-runtime").JSX.Element | null;
9
8
  export interface NestOperationProps {
10
- rootQuery: ASTQuery;
11
9
  view: ViewParent;
12
10
  nest: ASTNestViewOperation;
13
11
  }
14
- export declare function NestOperation({ rootQuery, view, nest }: NestOperationProps): import("react/jsx-runtime").JSX.Element;
12
+ export declare function NestOperation({ view, nest }: NestOperationProps): import("react/jsx-runtime").JSX.Element;
@@ -1,8 +1,6 @@
1
1
  import * as Malloy from '@malloydata/malloy-interfaces';
2
- import { ASTQuery } from '@malloydata/malloy-query-builder';
3
2
  import { ViewParent } from '../../utils/fields';
4
3
  export interface OperationActionTitleProps {
5
- rootQuery: ASTQuery;
6
4
  view: ViewParent;
7
5
  title: string;
8
6
  actionTitle: string;
@@ -1,6 +1,5 @@
1
- import { ASTOrderByViewOperation, ASTQuery } from '@malloydata/malloy-query-builder';
1
+ import { ASTOrderByViewOperation } from '@malloydata/malloy-query-builder';
2
2
  export interface OrderByOperationsProps {
3
- rootQuery: ASTQuery;
4
3
  orderBys: ASTOrderByViewOperation[];
5
4
  }
6
- export declare function OrderByOperations({ rootQuery, orderBys, }: OrderByOperationsProps): import("react/jsx-runtime").JSX.Element | null;
5
+ export declare function OrderByOperations({ orderBys }: OrderByOperationsProps): import("react/jsx-runtime").JSX.Element | null;
@@ -1,10 +1,9 @@
1
- import { ASTAggregateViewOperation, ASTGroupByViewOperation, ASTNestViewOperation, ASTQuery } from '@malloydata/malloy-query-builder';
1
+ import { ASTAggregateViewOperation, ASTCalculateViewOperation, ASTGroupByViewOperation, ASTNestViewOperation } from '@malloydata/malloy-query-builder';
2
2
  import { ViewParent } from '../../utils/fields';
3
3
  export interface RenameDialogProps {
4
- rootQuery: ASTQuery | undefined;
5
4
  view: ViewParent;
6
- target: ASTGroupByViewOperation | ASTAggregateViewOperation | ASTNestViewOperation | undefined;
5
+ target: ASTGroupByViewOperation | ASTAggregateViewOperation | ASTNestViewOperation | ASTCalculateViewOperation | undefined;
7
6
  open: boolean;
8
7
  setOpen: (open: boolean) => void;
9
8
  }
10
- export declare function RenameDialog({ rootQuery, view, target, open, setOpen, }: RenameDialogProps): import("react/jsx-runtime").JSX.Element | null;
9
+ export declare function RenameDialog({ view, target, open, setOpen }: RenameDialogProps): import("react/jsx-runtime").JSX.Element | null;
@@ -1,10 +1,9 @@
1
- import { ASTAggregateViewOperation, ASTGroupByViewOperation, ASTQuery, ASTSegmentViewDefinition } from '@malloydata/malloy-query-builder';
1
+ import { ASTAggregateViewOperation, ASTCalculateViewOperation, ASTGroupByViewOperation, ASTSegmentViewDefinition } from '@malloydata/malloy-query-builder';
2
2
  import { ViewParent } from '../../utils/fields';
3
3
  export interface SortableOperationsProps {
4
- rootQuery: ASTQuery;
5
4
  segment: ASTSegmentViewDefinition;
6
5
  view: ViewParent;
7
- operations: Array<ASTAggregateViewOperation | ASTGroupByViewOperation>;
6
+ operations: Array<ASTAggregateViewOperation | ASTGroupByViewOperation | ASTCalculateViewOperation>;
8
7
  kind: 'aggregate' | 'group_by';
9
8
  }
10
- export declare function SortableOperations({ rootQuery, segment, view, operations, kind, }: SortableOperationsProps): import("react/jsx-runtime").JSX.Element | null;
9
+ export declare function SortableOperations({ segment, view, operations, kind, }: SortableOperationsProps): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,6 @@
1
+ import * as Malloy from '@malloydata/malloy-interfaces';
2
+ export interface DownloadButtonProps {
3
+ result?: Malloy.Result;
4
+ name?: string;
5
+ }
6
+ export declare function DownloadButton({ name, result }: DownloadButtonProps): import("react/jsx-runtime").JSX.Element | null;
@@ -1,10 +1,12 @@
1
1
  import * as React from 'react';
2
2
  import { FieldItem } from './utils';
3
3
  import { SourceInfo } from '@malloydata/malloy-interfaces';
4
+ import { ASTQuery } from '@malloydata/malloy-query-builder';
4
5
  interface FieldGroupListProps {
6
+ rootQuery: ASTQuery;
5
7
  source: SourceInfo;
6
8
  fieldItems: FieldItem[];
7
9
  fieldGroupType: 'view' | 'measure' | 'dimension';
8
10
  }
9
- export default function FieldGroupList({ source, fieldItems, fieldGroupType, }: FieldGroupListProps): React.ReactNode;
11
+ export default function FieldGroupList({ rootQuery, source, fieldItems, fieldGroupType, }: FieldGroupListProps): React.ReactNode;
10
12
  export {};
@@ -1,9 +1,10 @@
1
1
  import * as Malloy from '@malloydata/malloy-interfaces';
2
- import { ASTArrowQueryDefinition } from '@malloydata/malloy-query-builder';
2
+ import { ASTArrowQueryDefinition, ASTQuery } from '@malloydata/malloy-query-builder';
3
3
  interface FieldTokenWithActionsProps {
4
+ rootQuery: ASTQuery;
4
5
  field: Malloy.FieldInfo;
5
6
  path: string[];
6
7
  viewDef: ASTArrowQueryDefinition;
7
8
  }
8
- export declare function FieldTokenWithActions({ field, path, viewDef, }: FieldTokenWithActionsProps): import("react/jsx-runtime").JSX.Element;
9
+ export declare function FieldTokenWithActions({ rootQuery, field, path, viewDef, }: FieldTokenWithActionsProps): import("react/jsx-runtime").JSX.Element;
9
10
  export {};
@@ -1,8 +1,10 @@
1
1
  import { FieldItem } from './utils';
2
2
  import { SourceInfo } from '@malloydata/malloy-interfaces';
3
+ import { ASTQuery } from '@malloydata/malloy-query-builder';
3
4
  interface SearchResultListProps {
5
+ rootQuery: ASTQuery;
4
6
  source: SourceInfo;
5
7
  items: FieldItem[];
6
8
  }
7
- export default function SearchResultList({ source, items, }: SearchResultListProps): import("react/jsx-runtime").JSX.Element | null;
9
+ export default function SearchResultList({ rootQuery, source, items, }: SearchResultListProps): import("react/jsx-runtime").JSX.Element | null;
8
10
  export {};
@@ -1,12 +1,8 @@
1
1
  import * as Malloy from '@malloydata/malloy-interfaces';
2
2
  import { ViewParent } from '../../utils/fields';
3
3
  export declare function useOperations(view: ViewParent, field: Malloy.FieldInfo, path: string[]): {
4
- isGroupByAllowed: boolean;
5
4
  groupByDisabledReason: string;
6
- isAggregateAllowed: boolean;
7
5
  aggregateDisabledReason: string;
8
- isFilterAllowed: boolean;
9
6
  filterDisabledReason: string;
10
- isOrderByAllowed: boolean;
11
7
  orderByDisabledReason: string;
12
8
  };
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { ReactElement } from 'react';
3
3
  import { IconType } from '.';
4
- type DropdownMenuChild = React.ReactElement<DropdownMenuItemProps, typeof DropdownMenuItem> | React.ReactElement<DropdownSubMenuItemProps, typeof DropdownSubMenuItem> | React.ReactElement<DropdownMenuLabelProps, typeof DropdownMenuLabel>;
4
+ type DropdownMenuChild = React.ReactElement<DropdownMenuItemProps, typeof DropdownMenuItem> | React.ReactElement<DropdownSubMenuItemProps, typeof DropdownSubMenuItem> | React.ReactElement<DropdownMenuLabelProps, typeof DropdownMenuLabel> | null;
5
5
  interface DropdownMenuProps {
6
6
  trigger: ReactElement;
7
7
  tooltip?: string | ReactElement;
@@ -107,6 +107,12 @@ export declare const ICON_MAP: {
107
107
  desc?: string;
108
108
  descId?: string;
109
109
  }>;
110
+ readonly download: import("react").FunctionComponent<import("react").SVGProps<SVGSVGElement> & {
111
+ title?: string;
112
+ titleId?: string;
113
+ desc?: string;
114
+ descId?: string;
115
+ }>;
110
116
  readonly aggregate: import("react").FunctionComponent<import("react").SVGProps<SVGSVGElement> & {
111
117
  title?: string;
112
118
  titleId?: string;
@@ -0,0 +1,10 @@
1
+ import type { FieldInfo, Schema } from '@malloydata/malloy-interfaces';
2
+ import { ViewParent } from './fields';
3
+ /**
4
+ * Gets the computed primary axis from the root query. Roughly follows this logic:
5
+ * - Find the first output field with the `# x` annotation
6
+ * - Otherwise find the first output field with a time or date type'
7
+ * - Otherwise, find the first output field
8
+ */
9
+ export declare const getPrimaryAxis: (view: ViewParent) => FieldInfo | undefined;
10
+ export declare const getPrimaryAxisFromSchema: (schema: Schema) => FieldInfo | undefined;
@@ -0,0 +1,44 @@
1
+ import * as Malloy from '@malloydata/malloy-interfaces';
2
+ export interface WriteStream {
3
+ write: (text: string) => void;
4
+ close: () => void;
5
+ }
6
+ export declare abstract class DataWriter {
7
+ readonly stream: WriteStream;
8
+ readonly result: Malloy.Result;
9
+ constructor(stream: WriteStream, result: Malloy.Result);
10
+ abstract process(data: AsyncIterableIterator<Malloy.DataWithRecordCell>): Promise<void>;
11
+ }
12
+ export declare class JSONWriter extends DataWriter {
13
+ process(data: AsyncIterableIterator<Malloy.DataWithRecordCell>): Promise<void>;
14
+ }
15
+ /**
16
+ * CSV writer class that handles nested data.
17
+ * This writer creates CSV using a DFS traversal of the result dataset.
18
+ * Each trivial column value is converted to a CSV of 1x1 matrix and all the
19
+ * columns are merged together to create a CSV that represents 1 QueryDataRow.
20
+ * Since this follows DFS, each non trivial data is rendered into a NxM matrix
21
+ * where N is the number of rows in the nested data and M is the number of
22
+ * columns it has.
23
+ * For any row with X number of columns, we end up with X number of NxM matrices
24
+ * where the value of N,M pair may be different for each column.
25
+ * We then merge the matrices so that we end up with a larger matrix of size
26
+ * Max(N)xSum(M) by taking one row of csv from each matrix at a time. For any
27
+ * matrix with N<Max(N), we add a row of empty CSV cells of size N.
28
+ */
29
+ export declare class CSVWriter extends DataWriter {
30
+ private readonly columnSeparator;
31
+ private readonly rowSeparator;
32
+ private readonly quoteCharacter;
33
+ private readonly includeHeader;
34
+ private readonly emptyCell;
35
+ private escape;
36
+ private stringify;
37
+ private getColWeight;
38
+ private getHeaderRow;
39
+ private mergeMatrices;
40
+ private getChildMatrix;
41
+ private getRowMatrix;
42
+ process(data: AsyncIterableIterator<Malloy.DataWithRecordCell>): Promise<void>;
43
+ }
44
+ export declare function dataIterator(result: Malloy.Result): AsyncGenerator<Malloy.CellWithRecordCell, void, unknown>;
@@ -0,0 +1 @@
1
+ export {};
@@ -1,9 +1,9 @@
1
1
  import * as Malloy from '@malloydata/malloy-interfaces';
2
2
  import { AtomicTypeType, ParameterTypeType } from '@malloydata/malloy-interfaces';
3
3
  import { IconType } from '../primitives';
4
- import { ASTQuery, ASTView } from '@malloydata/malloy-query-builder';
4
+ import { Tag } from '@malloydata/malloy-tag';
5
5
  export declare function atomicTypeToIcon(type: AtomicTypeType | ParameterTypeType): IconType;
6
- export declare function fieldKindToColor(kind: 'dimension' | 'measure' | 'join' | 'view'): "purple" | "green" | "cyan" | undefined;
6
+ export declare function fieldKindToColor(kind: 'dimension' | 'measure' | 'join' | 'view' | 'calculate'): "purple" | "green" | "cyan" | undefined;
7
7
  export declare function fieldToIcon(field: Malloy.FieldInfo): IconType;
8
8
  export declare function relationshipToIcon(relationship: Malloy.Relationship): IconType;
9
- export declare function viewToVisualizationIcon(view: ASTQuery | ASTView): IconType;
9
+ export declare function tagToVisualization(currentTag: Tag): IconType;
@@ -8,6 +8,7 @@ export declare function segmentHasOrderBySourceField(segment: ASTSegmentViewDefi
8
8
  export declare function segmentHasFieldInOutputSpace(segment: ASTSegmentViewDefinition, path: string[], name: string): boolean;
9
9
  export declare function segmentNestNo(segment: ASTSegmentViewDefinition, name?: string): number;
10
10
  export declare function addGroupBy(view: ViewParent, field: Malloy.FieldInfo, path: string[]): void;
11
+ export declare function recomputePartitionByAndPrimaryAxis(segment: ASTSegmentViewDefinition): void;
11
12
  export declare function addAggregate(view: ViewParent, field: Malloy.FieldInfo, path: string[]): void;
12
13
  export declare function addNest(view: ViewParent, field: Malloy.FieldInfo): void;
13
14
  export declare function addOrderByFromSource(view: ViewParent, path: string[], name: string, direction?: Malloy.OrderByDirection): void;
@@ -2,22 +2,13 @@ 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
- export interface SearchValueMapResult {
6
- fieldName: string;
7
- cardinality: number;
8
- values: {
9
- fieldValue: string | null;
10
- weight: number;
11
- }[];
12
- }
13
5
  export interface QueryEditorContextProps {
14
6
  /** Source object at the root level */
15
7
  source?: Malloy.SourceInfo;
16
8
  /** Query object to represent current state at the root level */
17
9
  rootQuery?: ASTQuery;
18
10
  /** Provide to allow editing of the query */
19
- setQuery?: (query: Malloy.Query | undefined) => void;
20
- topValues?: SearchValueMapResult[];
11
+ setQuery: (query: Malloy.Query | undefined) => void;
21
12
  onDrill?: ({ stableQuery, stableDrillClauses }: DrillData) => void;
22
13
  }
23
14
  /**
@@ -1,3 +1,3 @@
1
- import * as QB from '@malloydata/malloy-query-builder';
1
+ import { ASTQuery } from '@malloydata/malloy-query-builder';
2
2
  import * as Malloy from '@malloydata/malloy-interfaces';
3
- export declare function useQueryBuilder(source?: Malloy.SourceInfo, query?: Malloy.Query): QB.ASTQuery | undefined;
3
+ export declare function useQueryBuilder(source?: Malloy.SourceInfo, query?: Malloy.Query): ASTQuery | undefined;
@@ -0,0 +1,10 @@
1
+ interface UpdateQueryContextProps {
2
+ updateQuery: () => void;
3
+ }
4
+ export declare const UpdateQueryContext: import("react").Context<UpdateQueryContextProps>;
5
+ /**
6
+ * A layer of indirection should we ever decide to optimize
7
+ * this behavior
8
+ */
9
+ export declare function useUpdateQuery(): () => void;
10
+ export {};