@nongt/visql 0.4.1 → 0.5.0

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.
@@ -1,4 +1,4 @@
1
- import type { ComponentType, MouseEventHandler, ReactElement, ReactNode, Ref, SyntheticEvent } from 'react';
1
+ import type { ComponentType, MouseEventHandler, ReactElement, ReactNode, RefAttributes, SyntheticEvent } from 'react';
2
2
  import type { QueryBuilderTheme } from '../theme/tokens.js';
3
3
  /** The UI primitives the editor is built from. Every editor component draws
4
4
  * its buttons, inputs and pickers through these (via `useUI()`), never by
@@ -51,7 +51,6 @@ export interface ButtonProps {
51
51
  size?: UISize;
52
52
  startIcon?: ReactNode;
53
53
  className?: string;
54
- ref?: Ref<HTMLButtonElement>;
55
54
  /** The button shows a value (e.g. the AND/OR toggle): in read-only mode it
56
55
  * stays visible as an inert label instead of being hidden. */
57
56
  showsValue?: boolean;
@@ -246,8 +245,10 @@ export interface UIProviderProps {
246
245
  export interface UIComponents {
247
246
  Provider: ComponentType<UIProviderProps>;
248
247
  Tooltip: ComponentType<TooltipProps>;
249
- IconButton: ComponentType<IconButtonProps>;
250
- Button: ComponentType<ButtonProps>;
248
+ /** Forwards its ref to the DOM button (`forwardRef`): a Tooltip around
249
+ * one gives it its ref, and React 18 passes a ref no other way. */
250
+ IconButton: ComponentType<IconButtonProps & RefAttributes<HTMLButtonElement>>;
251
+ Button: ComponentType<ButtonProps & RefAttributes<HTMLButtonElement>>;
251
252
  TextField: ComponentType<TextFieldProps>;
252
253
  Select: ComponentType<SelectProps>;
253
254
  Combobox: ComboboxComponent;
@@ -1,4 +1,3 @@
1
- import { type Ref } from 'react';
2
1
  import { type FlowDirection, type FlowOrientation } from '../../core/expressionFlow.js';
3
2
  import { type ExistsOptions } from '../../core/existsMenu.js';
4
3
  import { type UnionTableOptions } from '../../core/unionTables.js';
@@ -40,8 +39,6 @@ export interface PipelineEditorProps {
40
39
  /** Called with the query every edit, undo or redo asks for. Always carries
41
40
  * the query's id — an emptied query is an EmptyQuery, never null. */
42
41
  onChange?: (query: QueryValue) => void;
43
- /** Imperative controls — see PipelineEditorHandle. */
44
- ref?: Ref<PipelineEditorHandle>;
45
42
  /** Called with validateSchema's findings whenever `schema` has problems (and
46
43
  * again with [] once they're fixed). Without it, problems are logged with
47
44
  * console.warn instead. The editor still renders either way. */
@@ -206,5 +203,5 @@ export interface PipelineEditorHandle {
206
203
  /** A spot to go to (goToIssue): a problem's path and severity — or, with
207
204
  * no severity, a place to go (Find, a peek). */
208
205
  export type GoToSpot = Pick<QueryIssue, 'pathSegments'> & Partial<Pick<QueryIssue, 'severity'>>;
209
- declare const PipelineEditor: ({ className, schema, value, defaultValue, onChange, onSchemaIssues, onIssues, showIssues, onHoverPart, sectionLabels, messages, theme, components, autoRevealNewNodes, functions, renderValueInput, readOnly, tableFilter, columnFilter, direction, fontFamily, ref, orientation, exists, subqueries, onRun, hideWarnings, typeMismatch, dialect, betweenOnText, }: PipelineEditorProps) => import("react/jsx-runtime").JSX.Element;
206
+ declare const PipelineEditor: import("react").ForwardRefExoticComponent<PipelineEditorProps & import("react").RefAttributes<PipelineEditorHandle>>;
210
207
  export default PipelineEditor;
@@ -0,0 +1,12 @@
1
+ export declare const MuiDatePicker: {
2
+ (props: import(".").DatePickerProps): import("react/jsx-runtime").JSX.Element;
3
+ displayName: string;
4
+ };
5
+ export declare const MuiDateTimePicker: {
6
+ (props: import(".").DateTimePickerProps): import("react/jsx-runtime").JSX.Element;
7
+ displayName: string;
8
+ };
9
+ export declare const MuiTimePicker: {
10
+ (props: import(".").TimePickerProps): import("react/jsx-runtime").JSX.Element;
11
+ displayName: string;
12
+ };
@@ -1,3 +1,12 @@
1
- export { default as MuiDatePicker } from './adapters/mui/MuiDatePicker.js';
2
- export { default as MuiDateTimePicker } from './adapters/mui/MuiDateTimePicker.js';
3
- export { default as MuiTimePicker } from './adapters/mui/MuiTimePicker.js';
1
+ export declare const MuiDatePicker: {
2
+ (props: import(".").DatePickerProps): import("react/jsx-runtime").JSX.Element;
3
+ displayName: string;
4
+ };
5
+ export declare const MuiDateTimePicker: {
6
+ (props: import(".").DateTimePickerProps): import("react/jsx-runtime").JSX.Element;
7
+ displayName: string;
8
+ };
9
+ export declare const MuiTimePicker: {
10
+ (props: import(".").TimePickerProps): import("react/jsx-runtime").JSX.Element;
11
+ displayName: string;
12
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nongt/visql",
3
- "version": "0.4.1",
3
+ "version": "0.5.0",
4
4
  "description": "A visual SQL query editor for React: build a whole query on a node canvas, store it as JSON, turn it into SQL.",
5
5
  "keywords": [
6
6
  "sql",
@@ -43,6 +43,10 @@
43
43
  "types": "./dist/types/mui-date-pickers.d.ts",
44
44
  "import": "./dist/mui-date-pickers.js"
45
45
  },
46
+ "./mui-date-pickers/host": {
47
+ "types": "./dist/types/mui-date-pickers-host.d.ts",
48
+ "import": "./dist/mui-date-pickers-host.js"
49
+ },
46
50
  "./fixtures": {
47
51
  "types": "./dist/types/fixtures.d.ts",
48
52
  "import": "./dist/fixtures.js"
@@ -53,22 +57,43 @@
53
57
  },
54
58
  "./style.css": "./dist/style.css"
55
59
  },
60
+ "typesVersions": {
61
+ "*": {
62
+ "core": [
63
+ "./dist/types/core-api.d.ts"
64
+ ],
65
+ "mui": [
66
+ "./dist/types/mui.d.ts"
67
+ ],
68
+ "mui-date-pickers": [
69
+ "./dist/types/mui-date-pickers.d.ts"
70
+ ],
71
+ "mui-date-pickers/host": [
72
+ "./dist/types/mui-date-pickers-host.d.ts"
73
+ ],
74
+ "fixtures": [
75
+ "./dist/types/fixtures.d.ts"
76
+ ],
77
+ "sql-import": [
78
+ "./dist/types/sql-import.d.ts"
79
+ ]
80
+ }
81
+ },
56
82
  "module": "./dist/index.js",
57
83
  "types": "./dist/types/index.d.ts",
58
84
  "dependencies": {
59
85
  "clsx": "^2.1.1"
60
86
  },
61
87
  "peerDependencies": {
62
- "@emotion/cache": "^11.14.0",
63
- "@emotion/react": "^11.14.0",
64
- "@emotion/styled": "^11.14.0",
88
+ "@emotion/cache": "^11.11.0",
89
+ "@emotion/react": "^11.11.0",
90
+ "@emotion/styled": "^11.11.0",
65
91
  "@mui/material": "^7.1.0",
66
92
  "@mui/x-date-pickers": "^8.3.1",
67
93
  "@xyflow/react": "^12.6.4",
68
- "date-fns": "^4.1.0",
69
94
  "iconoir-react": "^7.11.0",
70
- "react": "^19.1.0",
71
- "react-dom": "^19.1.0"
95
+ "react": "^18.2.0 || ^19.0.0",
96
+ "react-dom": "^18.2.0 || ^19.0.0"
72
97
  },
73
98
  "peerDependenciesMeta": {
74
99
  "@mui/material": {
@@ -85,9 +110,6 @@
85
110
  },
86
111
  "@emotion/cache": {
87
112
  "optional": true
88
- },
89
- "date-fns": {
90
- "optional": true
91
113
  }
92
114
  },
93
115
  "devDependencies": {
@@ -152,6 +174,7 @@
152
174
  "test": "vitest run",
153
175
  "test:watch": "vitest",
154
176
  "test:coverage": "vitest run --coverage",
177
+ "test:react18": "node scripts/test-react18.mjs",
155
178
  "test:e2e": "playwright test",
156
179
  "test:e2e:ui": "playwright test --ui",
157
180
  "test:e2e:coverage": "rm -rf coverage-e2e-raw && E2E_COVERAGE=true playwright test",