@malloydata/malloy-explorer 0.0.278-dev250515234639 → 0.0.282-dev250527225235

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.
@@ -4,8 +4,10 @@ import { SearchValueMapResult } from '../contexts/QueryEditorContext';
4
4
  export interface MalloyExplorerProviderProps {
5
5
  source: Malloy.SourceInfo;
6
6
  query?: Malloy.Query;
7
- setQuery?: (query: Malloy.Query | undefined) => void;
7
+ onQueryChange?: (query: Malloy.Query | undefined) => void;
8
+ focusedNestViewPath: string[];
9
+ onFocusedNestViewPathChange: (path: string[]) => void;
8
10
  children: ReactNode | ReactNode[];
9
11
  topValues?: SearchValueMapResult[];
10
12
  }
11
- export declare function MalloyExplorerProvider({ source, query, setQuery, children, topValues, }: MalloyExplorerProviderProps): import("react/jsx-runtime").JSX.Element;
13
+ export declare function MalloyExplorerProvider({ source, query, onQueryChange, focusedNestViewPath, onFocusedNestViewPathChange, children, topValues, }: MalloyExplorerProviderProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,18 @@
1
+ import { ReactNode } from 'react';
2
+ import { ASTQuery, ASTView } from '@malloydata/malloy-query-builder';
3
+ interface MalloyQueryFocus {
4
+ focusMainView: () => void;
5
+ isMainViewFocused: boolean;
6
+ focusNestView: (path: string[]) => void;
7
+ isNestViewFocused: (path: string[]) => boolean;
8
+ focusedNestView: ASTView | null;
9
+ }
10
+ interface MalloyQueryFocusProviderProps {
11
+ rootQuery: ASTQuery | undefined;
12
+ focusedNestViewPath: string[];
13
+ onFocusedNestViewPathChange: (path: string[]) => void;
14
+ children: ReactNode | ReactNode[];
15
+ }
16
+ export declare function MalloyQueryFocusProvider({ rootQuery, focusedNestViewPath, onFocusedNestViewPathChange, children, }: MalloyQueryFocusProviderProps): import("react/jsx-runtime").JSX.Element;
17
+ export declare function useQueryFocus(): MalloyQueryFocus;
18
+ export {};
@@ -0,0 +1,7 @@
1
+ import { ASTNestViewOperation } from '@malloydata/malloy-query-builder';
2
+ import React from 'react';
3
+ export interface FocusableViewProps {
4
+ children: React.ReactNode | React.ReactNode[];
5
+ nest?: ASTNestViewOperation;
6
+ }
7
+ export declare function FocusableView({ children, nest }: FocusableViewProps): import("react/jsx-runtime").JSX.Element;
@@ -2,7 +2,11 @@ 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
4
  isGroupByAllowed: boolean;
5
+ groupByDisabledReason: string;
5
6
  isAggregateAllowed: boolean;
7
+ aggregateDisabledReason: string;
6
8
  isFilterAllowed: boolean;
9
+ filterDisabledReason: string;
7
10
  isOrderByAllowed: boolean;
11
+ orderByDisabledReason: string;
8
12
  };
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const NestViewPathContext: React.Context<string[]>;
@@ -1,12 +1,16 @@
1
1
  import * as Malloy from '@malloydata/malloy-interfaces';
2
2
  import { ASTSegmentViewDefinition, ParsedFilter } from '@malloydata/malloy-query-builder';
3
3
  import { ViewParent } from './fields';
4
+ export declare function toFullName(path: string[] | undefined, name: string): string;
4
5
  export declare function segmentHasLimit(segment: ASTSegmentViewDefinition): boolean;
5
6
  export declare function segmentHasOrderBy(segment: ASTSegmentViewDefinition, name: string): boolean;
7
+ export declare function segmentHasOrderBySourceField(segment: ASTSegmentViewDefinition, path: string[] | undefined, name: string): boolean;
8
+ export declare function segmentHasFieldInOutputSpace(segment: ASTSegmentViewDefinition, path: string[], name: string): boolean;
6
9
  export declare function segmentNestNo(segment: ASTSegmentViewDefinition, name?: string): number;
7
10
  export declare function addGroupBy(view: ViewParent, field: Malloy.FieldInfo, path: string[]): void;
8
11
  export declare function addAggregate(view: ViewParent, field: Malloy.FieldInfo, path: string[]): void;
9
12
  export declare function addNest(view: ViewParent, field: Malloy.FieldInfo): void;
13
+ export declare function addOrderByFromSource(view: ViewParent, path: string[], name: string, direction?: Malloy.OrderByDirection): void;
10
14
  export declare function addOrderBy(view: ViewParent, field: Malloy.FieldInfo, direction?: Malloy.OrderByDirection): void;
11
15
  export declare function addFilter(view: ViewParent, field: Malloy.FieldInfo, path: string[], filter: ParsedFilter): void;
12
16
  export declare function getSegmentIfPresent(parent: ViewParent): ASTSegmentViewDefinition | undefined;
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import * as Malloy from '@malloydata/malloy-interfaces';
3
- import { ASTQuery, ASTView } from '@malloydata/malloy-query-builder';
3
+ import { ASTQuery } from '@malloydata/malloy-query-builder';
4
4
  export interface SearchValueMapResult {
5
5
  fieldName: string;
6
6
  cardinality: number;
@@ -15,19 +15,8 @@ export interface QueryEditorContextProps {
15
15
  /** Query object to represent current state at the root level */
16
16
  rootQuery?: ASTQuery;
17
17
  /** Provide to allow editing of the query */
18
- setQuery?: (rootQuery: Malloy.Query | undefined) => void;
18
+ setQuery?: (query: Malloy.Query | undefined) => void;
19
19
  topValues?: SearchValueMapResult[];
20
- /** Currently focused nest query panel element */
21
- currentNestQueryPanel?: HTMLElement | null;
22
- /** Callback function for when the current focused nest query panel changes */
23
- onCurrentNestQueryPanelChange?: (panel: HTMLElement | null) => void;
24
- /** Nest view object corresponding to current focused nest query panel */
25
- currentNestView?: ASTView | null;
26
- /**
27
- * Callback function for when the nest view object
28
- * corresponding to current focused nest query panel changes
29
- */
30
- onCurrentNestViewChange?: (view: ASTView | null) => void;
31
20
  }
32
21
  /**
33
22
  * 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.278-dev250515234639",
3
+ "version": "0.0.282-dev250527225235",
4
4
  "description": "Malloy visual query builder",
5
5
  "main": "dist/cjs/index.cjs",
6
6
  "types": "dist/types/index.d.ts",
@@ -8,9 +8,11 @@
8
8
  "exports": {
9
9
  ".": {
10
10
  "import": {
11
+ "types": "./dist/types/index.d.ts",
11
12
  "default": "./dist/esm/index.js"
12
13
  },
13
14
  "require": {
15
+ "types": "./dist/types/index.d.ts",
14
16
  "default": "./dist/cjs/index.cjs"
15
17
  }
16
18
  },
@@ -106,15 +108,16 @@
106
108
  "postcss": "^8.5.3",
107
109
  "ts-jest": "^29.3.2",
108
110
  "tsx": "^4.19.3",
111
+ "typescript": "^5.8.3",
109
112
  "vite": "^6.1.0",
110
113
  "vite-plugin-svgr": "^4.3.0"
111
114
  },
112
115
  "peerDependencies": {
113
- "@malloydata/malloy-filter": ">= 0.0.278",
114
- "@malloydata/malloy-interfaces": ">= 0.0.278",
115
- "@malloydata/malloy-query-builder": ">= 0.0.278",
116
- "@malloydata/malloy-tag": ">= 0.0.278",
117
- "@malloydata/render": ">= 0.0.278",
116
+ "@malloydata/malloy-filter": ">= 0.0.282",
117
+ "@malloydata/malloy-interfaces": ">= 0.0.282",
118
+ "@malloydata/malloy-query-builder": ">= 0.0.282",
119
+ "@malloydata/malloy-tag": ">= 0.0.282",
120
+ "@malloydata/render": ">= 0.0.282",
118
121
  "react": ">= 19.0.0",
119
122
  "react-dom": ">= 19.0.0"
120
123
  }