@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
@@ -0,0 +1,18 @@
1
+ export interface SearchValueMapResult {
2
+ fieldName: string;
3
+ cardinality: number;
4
+ values: {
5
+ fieldValue: string | null;
6
+ weight: number;
7
+ }[];
8
+ }
9
+ interface TopValuesContextProps {
10
+ topValues?: SearchValueMapResult[];
11
+ }
12
+ export declare const TopValuesContext: import("react").Context<TopValuesContextProps>;
13
+ /**
14
+ * A layer of indirection should we ever decide to optimize
15
+ * this behavior
16
+ */
17
+ export declare function useTopValues(): SearchValueMapResult[] | undefined;
18
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@malloydata/malloy-explorer",
3
- "version": "0.0.295-dev250710213205",
3
+ "version": "0.0.299-dev250808170326",
4
4
  "description": "Malloy visual query builder",
5
5
  "main": "dist/cjs/index.cjs",
6
6
  "types": "dist/types/index.d.ts",
@@ -82,8 +82,8 @@
82
82
  "@babel/preset-typescript": "^7.27.1",
83
83
  "@eslint/compat": "^1.2.7",
84
84
  "@eslint/js": "^9.21.0",
85
- "@malloydata/db-duckdb": "^0.0.295",
86
- "@malloydata/malloy": "^0.0.295",
85
+ "@malloydata/db-duckdb": "^0.0.299",
86
+ "@malloydata/malloy": "^0.0.299",
87
87
  "@rollup/plugin-replace": "^6.0.2",
88
88
  "@stylexjs/eslint-plugin": "^0.11.1",
89
89
  "@stylexjs/postcss-plugin": "^0.11.1",
@@ -115,11 +115,11 @@
115
115
  "vite-plugin-svgr": "^4.3.0"
116
116
  },
117
117
  "peerDependencies": {
118
- "@malloydata/malloy-filter": ">=0.0.295",
119
- "@malloydata/malloy-interfaces": ">=0.0.295",
120
- "@malloydata/malloy-query-builder": ">=0.0.295",
121
- "@malloydata/malloy-tag": ">=0.0.295",
122
- "@malloydata/render": ">=0.0.295",
118
+ "@malloydata/malloy-filter": "^0.0.299",
119
+ "@malloydata/malloy-interfaces": "^0.0.299",
120
+ "@malloydata/malloy-query-builder": "^0.0.299",
121
+ "@malloydata/malloy-tag": "^0.0.299",
122
+ "@malloydata/render": "^0.0.299",
123
123
  "react": ">=19.0.0",
124
124
  "react-dom": ">=19.0.0"
125
125
  }
package/.editorconfig DELETED
@@ -1,8 +0,0 @@
1
- root = true
2
-
3
- [*]
4
- indent_style = space
5
- indent_size = 2
6
- end_of_line = lf
7
- charset = utf-8
8
- insert_final_newline = true
@@ -1,28 +0,0 @@
1
- name: npmjs.com Pre-release
2
-
3
- on: [workflow_dispatch]
4
-
5
- jobs:
6
- test:
7
- uses: './.github/workflows/test.yaml'
8
-
9
- npm-prerelease:
10
- needs:
11
- - test
12
- runs-on: ubuntu-latest
13
- steps:
14
- - uses: actions/checkout@v4
15
- - name: Use Node.js
16
- uses: actions/setup-node@v4
17
- with:
18
- node-version: 20.x
19
- - name: npm install, build, and publish
20
- run: |
21
- npm ci --loglevel error
22
- PRERELEASE=$(date +%y%m%d%H%M%S)
23
- VERSION=$(jq -r .version ./package.json)-dev$PRERELEASE
24
- npm version --no-git-tag-version $VERSION
25
- npm publish --access=public
26
- env:
27
- CI: true
28
- NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
@@ -1,26 +0,0 @@
1
- name: Test
2
-
3
- on:
4
- workflow_call:
5
- pull_request:
6
- push:
7
- branches:
8
- - main
9
-
10
- jobs:
11
- test-all:
12
- runs-on: ubuntu-latest
13
-
14
- steps:
15
- - uses: actions/checkout@v4
16
- - name: Use Node.js
17
- uses: actions/setup-node@v4
18
- with:
19
- node-version: 20.x
20
- - name: Install
21
- run: npm ci --loglevel error
22
- - name: Build and Test
23
- run: |
24
- npm run build
25
- npm run lint
26
- npm run test
package/.gitmodules DELETED
@@ -1,3 +0,0 @@
1
- [submodule "malloy-samples"]
2
- path = malloy-samples
3
- url = git@github.com:malloydata/malloy-samples
package/.node-version DELETED
@@ -1 +0,0 @@
1
- 20.18.1
package/.prettierrc.js DELETED
@@ -1,8 +0,0 @@
1
- // eslint-disable-next-line no-undef
2
- module.exports = {
3
- arrowParens: 'avoid',
4
- bracketSpacing: false,
5
- semi: true,
6
- singleQuote: true,
7
- trailingComma: 'es5',
8
- };
@@ -1,6 +0,0 @@
1
- {
2
- "recommendations": [
3
- "dbaeumer.vscode-eslint",
4
- "esbenp.prettier-vscode"
5
- ]
6
- }
package/babel.config.cjs DELETED
@@ -1,49 +0,0 @@
1
- /**
2
- * Copyright (c) Meta Platforms, Inc. and affiliates.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- *
7
- *
8
- */
9
-
10
- module.exports = {
11
- presets: [
12
- ['@babel/preset-typescript'],
13
- ['@babel/preset-react', {runtime: 'automatic'}],
14
- ],
15
- plugins: [
16
- ['@babel/plugin-syntax-typescript', {isTSX: true}],
17
- [
18
- '@stylexjs/babel-plugin',
19
- {
20
- dev: process.env.NODE_ENV === 'development',
21
- runtimeInjection: false,
22
- genConditionalClasses: true,
23
- treeshakeCompensation: true,
24
- unstable_moduleResolution: {
25
- type: 'commonJS',
26
- rootDir: __dirname,
27
- },
28
- classNamePrefix: process.env.NODE_ENV === 'development' ? 'x' : 'mly',
29
- },
30
- ],
31
- ],
32
- env: {
33
- test: {
34
- presets: ['@babel/preset-env'],
35
- plugins: [
36
- [
37
- '@stylexjs/babel-plugin',
38
- {
39
- runtimeInjection: false,
40
- unstable_moduleResolution: {
41
- type: 'commonJS',
42
- rootDir: __dirname,
43
- },
44
- },
45
- ],
46
- ],
47
- },
48
- },
49
- };
package/eslint.config.mjs DELETED
@@ -1,150 +0,0 @@
1
- import {fixupConfigRules, fixupPluginRules} from '@eslint/compat';
2
- import typescriptEslint from '@typescript-eslint/eslint-plugin';
3
- import stylexEslint from '@stylexjs/eslint-plugin';
4
- import jest from 'eslint-plugin-jest';
5
- import prettier from 'eslint-plugin-prettier';
6
- import react from 'eslint-plugin-react';
7
- import reactHooks from 'eslint-plugin-react-hooks';
8
- import tsParser from '@typescript-eslint/parser';
9
- import globals, {fileURLToPath} from 'node:url';
10
- import path from 'node:path';
11
- import js from '@eslint/js';
12
- import {FlatCompat} from '@eslint/eslintrc';
13
-
14
- const __filename = fileURLToPath(import.meta.url);
15
- const __dirname = path.dirname(__filename);
16
- const compat = new FlatCompat({
17
- baseDirectory: __dirname,
18
- recommendedConfig: js.configs.recommended,
19
- allConfig: js.configs.all,
20
- });
21
-
22
- export default [
23
- {
24
- ignores: [
25
- '**/*.d.ts',
26
- '**/@flowtypes',
27
- '**/flow',
28
- '**/node_modules/',
29
- '**/dist/',
30
- '**/build/',
31
- '**/malloy-samples/',
32
- 'babel.config.cjs',
33
- ],
34
- },
35
- ...fixupConfigRules(
36
- compat.extends(
37
- 'eslint:recommended',
38
- 'plugin:@typescript-eslint/eslint-recommended',
39
- 'plugin:@typescript-eslint/recommended',
40
- 'prettier',
41
- 'plugin:jest/recommended',
42
- 'plugin:prettier/recommended',
43
- 'plugin:react/recommended',
44
- 'plugin:react-hooks/recommended'
45
- )
46
- ),
47
- {
48
- plugins: {
49
- '@typescript-eslint': fixupPluginRules(typescriptEslint),
50
- jest: fixupPluginRules(jest),
51
- prettier: fixupPluginRules(prettier),
52
- '@stylexjs': fixupPluginRules(stylexEslint),
53
- react: fixupPluginRules(react),
54
- 'react-hooks': fixupPluginRules(reactHooks),
55
- },
56
-
57
- settings: {
58
- react: {
59
- version: 'detect',
60
- },
61
- },
62
-
63
- rules: {
64
- 'array-callback-return': 'error',
65
- 'consistent-return': 'error',
66
-
67
- 'no-console': [
68
- 'error',
69
- {
70
- allow: ['debug', 'info', 'warn', 'error'],
71
- },
72
- ],
73
-
74
- 'prettier/prettier': 'error',
75
- 'sort-keys': 'off',
76
- 'no-duplicate-imports': 'error',
77
-
78
- 'no-restricted-imports': [
79
- 'error',
80
- {
81
- patterns: ['@malloydata/malloy/src/*'],
82
-
83
- paths: [
84
- {
85
- name: 'lodash',
86
- message: 'Import [module] from lodash/[module] instead',
87
- },
88
- ],
89
- },
90
- ],
91
-
92
- 'no-throw-literal': 'error',
93
-
94
- '@typescript-eslint/consistent-type-imports': 'off',
95
- '@typescript-eslint/no-empty-function': 'off',
96
- '@typescript-eslint/no-non-null-assertion': 'off',
97
-
98
- '@typescript-eslint/no-unused-vars': [
99
- 'error',
100
- {
101
- argsIgnorePattern: '^_',
102
- varsIgnorePattern: '^_',
103
- },
104
- ],
105
-
106
- '@typescript-eslint/parameter-properties': [
107
- 'error',
108
- {
109
- prefer: 'parameter-property',
110
- },
111
- ],
112
- },
113
- },
114
- {
115
- files: ['**/*.tsx?'],
116
-
117
- languageOptions: {
118
- parser: tsParser,
119
- ecmaVersion: 5,
120
- sourceType: 'script',
121
-
122
- parserOptions: {
123
- warnOnUnsupportedTypeScriptVersion: false,
124
- project: ['./tsconfig.json'],
125
- },
126
- },
127
-
128
- rules: {
129
- '@typescript-eslint/no-floating-promises': 'error',
130
- },
131
- },
132
- {
133
- files: ['scripts/**'],
134
-
135
- rules: {
136
- 'node/no-unpublished-import': 'off',
137
- 'no-console': 'off',
138
- 'no-process-exit': 'off',
139
- },
140
- },
141
- {
142
- files: ['**/*.spec.tsx?'],
143
-
144
- languageOptions: {
145
- globals: {
146
- ...globals.jest,
147
- },
148
- },
149
- },
150
- ];
package/index.html DELETED
@@ -1,19 +0,0 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <title>Malloy Explorer Dev</title>
5
- </head>
6
- <body>
7
- <div>
8
- <ul>
9
- <li><a href="/dev/explorer.html">Malloy Explorer</a></li>
10
- <ul>
11
- <li><a href="/dev/source.html">Source Panel</a></li>
12
- <li><a href="/dev/query.html">Query Panel</a></li>
13
- <li><a href="/dev/result.html">Result Panel</a></li>
14
- <li><a href="/dev/primitives.html">Primitive Components</a></li>
15
- </ul>
16
- </ul>
17
- </div>
18
- </body>
19
- </html>
package/jest.config.ts DELETED
@@ -1,27 +0,0 @@
1
- /*
2
- * Copyright (c) Meta Platforms, Inc. and affiliates.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- */
7
-
8
- module.exports = {
9
- setupFilesAfterEnv: ['<rootDir>/src/test/jest.setup.ts'],
10
- moduleFileExtensions: ['js', 'jsx', 'ts', 'tsx'],
11
- testMatch: ['**/?(*.)spec.(ts|js)?(x)'],
12
- testPathIgnorePatterns: ['/node_modules/', '/dist/', '/dev/', '/src/test/'],
13
- transform: {
14
- '^.+\\.tsx?$': ['babel-jest'],
15
- },
16
- testTimeout: 100000,
17
- verbose: true,
18
- testEnvironment: 'jsdom',
19
- collectCoverage: true,
20
- coverageReporters: ['lcov', 'html'],
21
- collectCoverageFrom: ['<rootDir>/src/**/*.(ts|tsx)', '!**/*.stylex.ts'],
22
- preset: 'ts-jest',
23
- moduleNameMapper: {
24
- uuid: require.resolve('uuid'),
25
- '\\.svg\\?react$': '<rootDir>/src/test/SvgMock.tsx',
26
- },
27
- };
@@ -1,20 +0,0 @@
1
- /**
2
- * Copyright (c) Meta Platforms, Inc. and affiliates.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- *
7
- *
8
- */
9
-
10
- import babelConfig from './babel.config.cjs';
11
-
12
- export default {
13
- plugins: {
14
- '@stylexjs/postcss-plugin': {
15
- include: ['src/**/*.{js,jsx,ts,tsx}'],
16
- useCSSLayers: true,
17
- babelConfig,
18
- },
19
- },
20
- };
package/vite.config.mts DELETED
@@ -1,69 +0,0 @@
1
- import {defineConfig} from 'vite';
2
- import {resolve} from 'path';
3
-
4
- import replace from '@rollup/plugin-replace';
5
- import react from '@vitejs/plugin-react';
6
- import svgr from 'vite-plugin-svgr';
7
- import babelConfig from './babel.config.cjs';
8
-
9
- export default defineConfig({
10
- plugins: [
11
- svgr(),
12
- react({babel: babelConfig}),
13
- replace({
14
- 'Object.defineProperty(exports, "__esModule", { value: true });':
15
- 'Object.defineProperty(typeof exports !== \'undefined\' ? exports : {}, "__esModule", { value: true });',
16
- delimiters: ['\n', '\n'],
17
- preventAssignment: true,
18
- }),
19
- ],
20
- build: {
21
- lib: {
22
- entry: resolve(__dirname, 'src/index.ts'),
23
- formats: ['es', 'cjs'],
24
- fileName: format => {
25
- if (format === 'cjs') return 'cjs/[name].cjs';
26
- return 'esm/[name].js';
27
- },
28
- name: 'index',
29
- },
30
- rollupOptions: {
31
- preserveSymlinks: true,
32
- external: [
33
- 'react',
34
- 'react-dom',
35
- 'react/jsx-runtime',
36
- '@malloydata/db-duckdb/wasm',
37
- '@malloydata/malloy',
38
- '@malloydata/malloy-tag',
39
- '@malloydata/malloy-filter',
40
- '@malloydata/malloy-interfaces',
41
- '@malloydata/malloy-query-builder',
42
- '@malloydata/render',
43
- ],
44
- output: {
45
- manualChunks: _id => {
46
- return 'index';
47
- },
48
- },
49
- },
50
- minify: false,
51
- sourcemap: true,
52
- },
53
- define: {
54
- 'process.env': {},
55
- },
56
- optimizeDeps: {
57
- force: true,
58
- include: [
59
- '@malloydata/db-duckdb/wasm',
60
- '@malloydata/render',
61
- '@malloydata/malloy',
62
- '@malloydata/malloy-tag',
63
- '@malloydata/malloy-filter',
64
- '@malloydata/malloy-interfaces',
65
- '@malloydata/malloy-query-builder',
66
- ],
67
- exclude: ['@mapbox/node-pre-gyp'],
68
- },
69
- });