@malloydata/malloy-explorer 0.0.257-dev250410160631 → 0.0.257-dev250417005958

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/QueryPanel/QueryActionBar.flow.js +0 -3
  2. package/@flowtypes/components/QueryPanel/QueryEditor.flow.js +3 -3
  3. package/@flowtypes/components/ResultPanel/ResultPanel.flow.js +6 -1
  4. package/@flowtypes/components/ResultPanel/SubmittedQuery.flow.js +11 -2
  5. package/@flowtypes/components/SourcePanel/SourcePanel.flow.js +3 -9
  6. package/babel.config.mjs +1 -0
  7. package/dist/cjs/index.cjs +6437 -5609
  8. package/dist/cjs/index.cjs.map +1 -1
  9. package/dist/esm/index.js +6439 -5611
  10. package/dist/esm/index.js.map +1 -1
  11. package/dist/malloy-explorer.css +410 -392
  12. package/dist/types/components/QueryPanel/AddMenu/AddAggregate.d.ts +4 -3
  13. package/dist/types/components/QueryPanel/AddMenu/AddEmptyNest.d.ts +4 -3
  14. package/dist/types/components/QueryPanel/AddMenu/AddFieldItem.d.ts +6 -5
  15. package/dist/types/components/QueryPanel/AddMenu/AddGroupBy.d.ts +4 -3
  16. package/dist/types/components/QueryPanel/AddMenu/AddLimit.d.ts +4 -3
  17. package/dist/types/components/QueryPanel/AddMenu/AddMenu.d.ts +3 -2
  18. package/dist/types/components/QueryPanel/AddMenu/AddOrderBy.d.ts +4 -3
  19. package/dist/types/components/QueryPanel/AddMenu/AddView.d.ts +4 -4
  20. package/dist/types/components/QueryPanel/AddMenu/AddWhere.d.ts +4 -3
  21. package/dist/types/components/QueryPanel/AddMenu/FieldList.d.ts +6 -5
  22. package/dist/types/components/QueryPanel/AddMenu/FieldMenu.d.ts +6 -5
  23. package/dist/types/components/QueryPanel/AddMenu/ValueList.d.ts +4 -1
  24. package/dist/types/components/QueryPanel/Operations.d.ts +3 -1
  25. package/dist/types/components/QueryPanel/QueryActionBar.d.ts +1 -4
  26. package/dist/types/components/QueryPanel/QueryEditor.d.ts +1 -1
  27. package/dist/types/components/QueryPanel/QueryPanel.d.ts +1 -5
  28. package/dist/types/components/QueryPanel/ViewDefinition.d.ts +3 -1
  29. package/dist/types/components/QueryPanel/operations/AggregateOperations.d.ts +4 -3
  30. package/dist/types/components/QueryPanel/operations/FilterOperations.d.ts +6 -0
  31. package/dist/types/components/QueryPanel/operations/GroupByOperations.d.ts +4 -3
  32. package/dist/types/components/QueryPanel/operations/LimitOperation.d.ts +1 -2
  33. package/dist/types/components/QueryPanel/operations/NestOperation.d.ts +1 -2
  34. package/dist/types/components/QueryPanel/operations/OperationActionTitle.d.ts +4 -3
  35. package/dist/types/components/QueryPanel/operations/OrderByOperations.d.ts +1 -2
  36. package/dist/types/components/ResultPanel/DebugPane.d.ts +11 -0
  37. package/dist/types/components/ResultPanel/ResultPanel.d.ts +2 -0
  38. package/dist/types/components/ResultPanel/SubmittedQuery.d.ts +13 -2
  39. package/dist/types/components/SourcePanel/AddFieldDropdownMenu.d.ts +7 -8
  40. package/dist/types/components/SourcePanel/FieldTokenWithActions.d.ts +1 -1
  41. package/dist/types/components/SourcePanel/NestFieldDropdownMenu.d.ts +3 -3
  42. package/dist/types/components/SourcePanel/OperationDropdownMenuItems.d.ts +3 -3
  43. package/dist/types/components/SourcePanel/SourcePanel.d.ts +1 -7
  44. package/dist/types/components/SourcePanel/hooks/useOperations.d.ts +2 -2
  45. package/dist/types/components/filters/BooleanFilterCore.d.ts +7 -0
  46. package/dist/types/components/filters/{DateTimeFilterToken.d.ts → DateTimeFilterCore.d.ts} +3 -4
  47. package/dist/types/components/filters/FilterDialog.d.ts +10 -0
  48. package/dist/types/components/filters/{NumberFilterToken.d.ts → NumberFilterCore.d.ts} +2 -4
  49. package/dist/types/components/filters/PillInput.d.ts +1 -1
  50. package/dist/types/components/filters/StringFilterCore.d.ts +14 -0
  51. package/dist/types/components/filters/hooks/useFilterModal.d.ts +24 -0
  52. package/dist/types/components/filters/hooks/useFilterPopup.d.ts +8 -0
  53. package/dist/types/components/filters/styles.d.ts +22 -0
  54. package/dist/types/components/primitives/Button.d.ts +6 -1
  55. package/dist/types/components/primitives/CollapsibleListItem.d.ts +5 -1
  56. package/dist/types/components/primitives/DropdownMenu.d.ts +8 -3
  57. package/dist/types/components/primitives/HoverText.d.ts +12 -0
  58. package/dist/types/components/primitives/colors.stylex.d.ts +1 -0
  59. package/dist/types/components/primitives/styles.d.ts +8 -0
  60. package/dist/types/components/utils/annotations.d.ts +2 -0
  61. package/dist/types/components/utils/fields.d.ts +6 -0
  62. package/dist/types/components/utils/segment.d.ts +2 -0
  63. package/dist/types/contexts/QueryEditorContext.d.ts +2 -0
  64. package/package.json +9 -9
  65. package/dist/types/components/QueryPanel/operations/WhereOperations.d.ts +0 -7
  66. package/dist/types/components/filters/BooleanFilterToken.d.ts +0 -11
  67. package/dist/types/components/filters/StringFilterToken.d.ts +0 -14
  68. package/dist/types/types/error.d.ts +0 -8
@@ -12,5 +12,9 @@ export interface CollapsibleListItemProps {
12
12
  * The children items to render.
13
13
  */
14
14
  children: React.ReactNode[];
15
+ /**
16
+ * Sets the initial expansion state of the collapsible list item.
17
+ */
18
+ isInitiallyExpanded?: boolean;
15
19
  }
16
- export default function CollapsibleListItem({ label, sublabel, children, }: CollapsibleListItemProps): import("react/jsx-runtime").JSX.Element;
20
+ export default function CollapsibleListItem({ label, sublabel, children, isInitiallyExpanded, }: CollapsibleListItemProps): import("react/jsx-runtime").JSX.Element;
@@ -1,20 +1,25 @@
1
1
  import * as React from 'react';
2
2
  import { ReactElement } from 'react';
3
3
  import { IconType } from '.';
4
- type Modifiers = Pick<React.MouseEvent, 'altKey' | 'ctrlKey' | 'metaKey' | 'shiftKey'>;
5
4
  type DropdownMenuChild = React.ReactElement<DropdownMenuItemProps, typeof DropdownMenuItem> | React.ReactElement<DropdownSubMenuItemProps, typeof DropdownSubMenuItem> | React.ReactElement<DropdownMenuLabelProps, typeof DropdownMenuLabel>;
6
5
  interface DropdownMenuProps {
7
6
  trigger: ReactElement;
8
7
  tooltip?: string | ReactElement;
9
8
  onOpenChange?: (open: boolean) => void;
10
9
  children: DropdownMenuChild | DropdownMenuChild[];
10
+ tooltipProps?: {
11
+ align?: 'start' | 'center' | 'end';
12
+ side?: 'top' | 'bottom' | 'left' | 'right';
13
+ alignOffset?: number;
14
+ sideOffset?: number;
15
+ };
11
16
  }
12
- export declare function DropdownMenu({ trigger, tooltip, onOpenChange, children, }: DropdownMenuProps): import("react/jsx-runtime").JSX.Element;
17
+ export declare function DropdownMenu({ trigger, tooltip, onOpenChange, children, tooltipProps, }: DropdownMenuProps): import("react/jsx-runtime").JSX.Element;
13
18
  interface DropdownMenuItemProps {
14
19
  icon?: IconType;
15
20
  label: string;
16
21
  sublabel?: string;
17
- onClick?: (modifiers: Modifiers) => void;
22
+ onClick?: (event: React.MouseEvent) => void;
18
23
  disabled?: boolean;
19
24
  }
20
25
  export declare function DropdownMenuItem({ icon, label, sublabel, onClick, disabled, }: DropdownMenuItemProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,12 @@
1
+ interface HoverTextProps {
2
+ text: string;
3
+ align?: 'start' | 'center' | 'end';
4
+ side?: 'top' | 'bottom' | 'left' | 'right';
5
+ }
6
+ /**
7
+ * Displays tooltip if text is truncated.
8
+ * Works in hovered parent.
9
+ * Works with formatted text.
10
+ */
11
+ export declare function HoverText({ text, align, side, }: HoverTextProps): import("react/jsx-runtime").JSX.Element;
12
+ export {};
@@ -10,6 +10,7 @@ export declare const backgroundColors: import("@stylexjs/stylex").VarGroup<Reado
10
10
  negativeDeemphasized: string;
11
11
  divider: string;
12
12
  token: string;
13
+ tooltip: string;
13
14
  }>, symbol>;
14
15
  export declare const textColors: import("@stylexjs/stylex").VarGroup<Readonly<{
15
16
  primary: string;
@@ -71,4 +71,12 @@ export declare const fontStyles: Readonly<{
71
71
  readonly lineHeight: import("@stylexjs/stylex/lib/StyleXTypes").StyleXClassNameFor<"lineHeight", "16px">;
72
72
  readonly letterSpacing: import("@stylexjs/stylex/lib/StyleXTypes").StyleXClassNameFor<"letterSpacing", "-0.24px">;
73
73
  }>;
74
+ readonly tooltipText: Readonly<{
75
+ readonly fontFamily: import("@stylexjs/stylex/lib/StyleXTypes").StyleXClassNameFor<"fontFamily", "SF Pro Text, -apple-system, system-ui, sans-serif">;
76
+ readonly color: import("@stylexjs/stylex/lib/StyleXTypes").StyleXClassNameFor<"color", "rgba(221, 226, 232, 1)">;
77
+ readonly fontSize: import("@stylexjs/stylex/lib/StyleXTypes").StyleXClassNameFor<"fontSize", "14px">;
78
+ readonly fontStyle: import("@stylexjs/stylex/lib/StyleXTypes").StyleXClassNameFor<"fontStyle", "normal">;
79
+ readonly fontWeight: import("@stylexjs/stylex/lib/StyleXTypes").StyleXClassNameFor<"fontWeight", 400>;
80
+ readonly lineHeight: import("@stylexjs/stylex/lib/StyleXTypes").StyleXClassNameFor<"lineHeight", "20px">;
81
+ }>;
74
82
  }>;
@@ -0,0 +1,2 @@
1
+ import * as Malloy from '@malloydata/malloy-interfaces';
2
+ export declare const getDescriptionAnnotation: (annotations: Array<Malloy.Annotation>) => string | undefined;
@@ -1,4 +1,6 @@
1
1
  import * as Malloy from '@malloydata/malloy-interfaces';
2
+ import { ASTArrowQueryDefinition, ASTView } from '@malloydata/malloy-query-builder';
3
+ export type ViewParent = ASTArrowQueryDefinition | ASTView;
2
4
  /**
3
5
  *
4
6
  * @param field
@@ -7,3 +9,7 @@ import * as Malloy from '@malloydata/malloy-interfaces';
7
9
  export declare function sortFieldInfoOrder(field: Malloy.FieldInfo): 0 | 1 | 2 | 3;
8
10
  export declare function sortFieldInfos(fields: Malloy.FieldInfo[]): Malloy.FieldInfo[];
9
11
  export declare function isIndexView(field: Malloy.FieldInfoWithView): boolean;
12
+ export declare function getViewDefinition(parent: ViewParent): import("@malloydata/malloy-query-builder").ASTViewDefinition;
13
+ export declare function getInputSchemaFromViewParent(parent: ViewParent): Malloy.Schema;
14
+ export declare function viewParentHasField(parent: ViewParent, field: Malloy.FieldInfo, path: string[]): boolean;
15
+ export declare function viewParentDoesNotHaveField(parent: ViewParent, field: Malloy.FieldInfo, path: string[]): boolean;
@@ -1,6 +1,8 @@
1
1
  import * as Malloy from '@malloydata/malloy-interfaces';
2
2
  import { ASTQuery, ASTSegmentViewDefinition } from '@malloydata/malloy-query-builder';
3
+ import { ViewParent } from './fields';
3
4
  export declare function segmentHasLimit(segment: ASTSegmentViewDefinition): boolean;
4
5
  export declare function segmentHasOrderBy(segment: ASTSegmentViewDefinition, name: string): boolean;
5
6
  export declare function segmentNestNo(segment: ASTSegmentViewDefinition, name?: string): number;
6
7
  export declare function addGroupBy(rootQuery: ASTQuery, segment: ASTSegmentViewDefinition, field: Malloy.FieldInfo, path: string[], setQuery?: (query: Malloy.Query) => void): void;
8
+ export declare function getSegmentIfPresent(parent: ViewParent): ASTSegmentViewDefinition | undefined;
@@ -1,6 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import * as Malloy from '@malloydata/malloy-interfaces';
3
3
  import { ASTQuery } from '@malloydata/malloy-query-builder';
4
+ import { OpenFilterModalCallback } from '../components/filters/hooks/useFilterModal';
4
5
  export interface SearchValueMapResult {
5
6
  fieldName: string;
6
7
  cardinality: number;
@@ -17,6 +18,7 @@ export interface QueryEditorContextProps {
17
18
  /** Provide to allow editing of the query */
18
19
  setQuery?: (rootQuery: Malloy.Query | undefined) => void;
19
20
  topValues?: SearchValueMapResult[];
21
+ openFilterModal: OpenFilterModalCallback;
20
22
  }
21
23
  /**
22
24
  * 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.257-dev250410160631",
3
+ "version": "0.0.257-dev250417005958",
4
4
  "description": "Malloy visual query builder",
5
5
  "main": "dist/cjs/index.cjs",
6
6
  "types": "dist/types/index.d.ts",
@@ -67,8 +67,8 @@
67
67
  "@stylexjs/stylex": "^0.10.1",
68
68
  "assert": "^2.1.0",
69
69
  "moment": "^2.30.1",
70
- "react": "^19.0.0",
71
- "react-dom": "^19.0.0"
70
+ "react": ">= 19.0.0",
71
+ "react-dom": ">= 19.0.0"
72
72
  },
73
73
  "devDependencies": {
74
74
  "@babel/preset-react": "^7.26.3",
@@ -98,12 +98,12 @@
98
98
  "vite-plugin-svgr": "^4.3.0"
99
99
  },
100
100
  "peerDependencies": {
101
+ "@malloydata/malloy-filter": "0.0.261",
102
+ "@malloydata/malloy-interfaces": "0.0.261",
103
+ "@malloydata/malloy-query-builder": "0.0.261",
104
+ "@malloydata/malloy-tag": "0.0.261",
105
+ "@malloydata/render": "0.0.261",
101
106
  "react": ">= 19.0.0",
102
- "react-dom": ">= 19.0.0",
103
- "@malloydata/malloy-filter": ">= 0.0.257",
104
- "@malloydata/malloy-interfaces": ">= 0.0.257",
105
- "@malloydata/malloy-query-builder": ">= 0.0.257",
106
- "@malloydata/malloy-tag": ">= 0.0.257",
107
- "@malloydata/render": ">= 0.0.257"
107
+ "react-dom": ">= 19.0.0"
108
108
  }
109
109
  }
@@ -1,7 +0,0 @@
1
- import { ASTQuery, ASTSegmentViewDefinition, ASTWhereViewOperation } from '@malloydata/malloy-query-builder';
2
- export interface WhereOperationsProps {
3
- rootQuery: ASTQuery;
4
- segment: ASTSegmentViewDefinition;
5
- wheres: ASTWhereViewOperation[];
6
- }
7
- export declare function WhereOperations({ rootQuery, wheres }: WhereOperationsProps): import("react/jsx-runtime").JSX.Element | null;
@@ -1,11 +0,0 @@
1
- import * as React from 'react';
2
- import * as Malloy from '@malloydata/malloy-interfaces';
3
- import { BooleanFilter } from '@malloydata/malloy-filter';
4
- export type BooleanFilterType = 'is_true' | 'is_false' | 'is_null' | 'is_not_null' | 'is_false_or_null';
5
- interface BooleanFilterTokenProps {
6
- fieldInfo: Malloy.FieldInfoWithDimension | Malloy.FieldInfoWithMeasure;
7
- filter: BooleanFilter;
8
- setFilter: (filter: BooleanFilter) => void;
9
- }
10
- export declare const BooleanFilterToken: React.FC<BooleanFilterTokenProps>;
11
- export {};
@@ -1,14 +0,0 @@
1
- import * as React from 'react';
2
- import * as Malloy from '@malloydata/malloy-interfaces';
3
- import { Null, StringCondition, StringEmpty, StringFilter, StringMatch } from '@malloydata/malloy-filter';
4
- type StringFilterType = 'is_equal_to' | 'starts_with' | 'ends_with' | 'contains' | 'matches' | 'is_blank' | 'is_null' | 'is_not_equal_to' | 'does_not_start_with' | 'does_not_end_with' | 'does_not_contain' | 'does_not_match' | 'is_not_blank' | 'is_not_null';
5
- type BasicStringFilter = StringCondition | StringMatch | Null | StringEmpty;
6
- export interface StringFilterBuilderProps {
7
- fieldInfo: Malloy.FieldInfoWithDimension | Malloy.FieldInfoWithMeasure;
8
- filter: StringFilter | null;
9
- path: string[];
10
- setFilter: (filter: StringFilter) => void;
11
- }
12
- export declare const StringFilterToken: React.FC<StringFilterBuilderProps>;
13
- export declare function stringFilterChangeType(filter: StringFilter, type: StringFilterType): BasicStringFilter;
14
- export {};
@@ -1,8 +0,0 @@
1
- export type SeverityLevel = 'INFO' | 'DEBUG' | 'WARN' | 'ERROR' | 'FATAL';
2
- export type ExplorerError = {
3
- severity: SeverityLevel;
4
- title: string;
5
- description?: string;
6
- content?: string;
7
- customRenderer?: React.ReactNode;
8
- };