@dxos/react-ui-query 0.14.0 → 0.16.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.
- package/dist/lib/index.mjs +2 -1
- package/dist/lib/index.mjs.map +1 -1
- package/dist/types/src/components/QueryEditor/QueryEditor.d.ts +10 -0
- package/dist/types/src/components/QueryEditor/QueryEditor.d.ts.map +1 -1
- package/dist/types/src/components/QueryEditor/QueryEditor.stories.d.ts +1 -0
- package/dist/types/src/components/QueryEditor/QueryEditor.stories.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +18 -18
- package/src/components/QueryEditor/QueryEditor.tsx +10 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/react-ui-query",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.0",
|
|
4
4
|
"description": "Editors for ECHO queries: a query-language input and a type/tag form.",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -43,34 +43,34 @@
|
|
|
43
43
|
"@lezer/common": "^1.5.2",
|
|
44
44
|
"@lezer/highlight": "^1.2.3",
|
|
45
45
|
"json5": "^2.2.3",
|
|
46
|
-
"@dxos/echo": "0.
|
|
47
|
-
"@dxos/echo-query": "0.
|
|
48
|
-
"@dxos/keys": "0.
|
|
49
|
-
"@dxos/react-ui-attention": "0.
|
|
50
|
-
"@dxos/react-ui-editor": "0.
|
|
51
|
-
"@dxos/ui": "0.
|
|
52
|
-
"@dxos/ui-editor": "0.
|
|
46
|
+
"@dxos/echo": "0.16.0",
|
|
47
|
+
"@dxos/echo-query": "0.16.0",
|
|
48
|
+
"@dxos/keys": "0.16.0",
|
|
49
|
+
"@dxos/react-ui-attention": "0.16.0",
|
|
50
|
+
"@dxos/react-ui-editor": "0.16.0",
|
|
51
|
+
"@dxos/ui": "0.16.0",
|
|
52
|
+
"@dxos/ui-editor": "0.16.0"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"@storybook/react-vite": "^10.6.0",
|
|
56
56
|
"@types/react": "~19.2.17",
|
|
57
57
|
"@types/react-dom": "~19.2.3",
|
|
58
|
-
"effect": "4.0.
|
|
58
|
+
"effect": "4.0.4",
|
|
59
59
|
"react": "~19.2.7",
|
|
60
60
|
"react-dom": "~19.2.7",
|
|
61
|
-
"vite": "^8.
|
|
62
|
-
"@dxos/react-client": "0.
|
|
63
|
-
"@dxos/react-ui": "0.
|
|
64
|
-
"@dxos/react-ui-syntax-highlighter": "0.
|
|
65
|
-
"@dxos/types": "0.
|
|
66
|
-
"@dxos/ui-theme": "0.
|
|
61
|
+
"vite": "^8.3.4",
|
|
62
|
+
"@dxos/react-client": "0.16.0",
|
|
63
|
+
"@dxos/react-ui": "0.16.0",
|
|
64
|
+
"@dxos/react-ui-syntax-highlighter": "0.16.0",
|
|
65
|
+
"@dxos/types": "0.16.0",
|
|
66
|
+
"@dxos/ui-theme": "0.16.0"
|
|
67
67
|
},
|
|
68
68
|
"peerDependencies": {
|
|
69
|
-
"effect": "4.0.
|
|
69
|
+
"effect": "4.0.4",
|
|
70
70
|
"react": "~19.2.7",
|
|
71
71
|
"react-dom": "~19.2.7",
|
|
72
|
-
"@dxos/react-ui": "^0.
|
|
73
|
-
"@dxos/ui-theme": "^0.
|
|
72
|
+
"@dxos/react-ui": "^0.16.0",
|
|
73
|
+
"@dxos/ui-theme": "^0.16.0"
|
|
74
74
|
},
|
|
75
75
|
"publishConfig": {
|
|
76
76
|
"access": "public"
|
|
@@ -36,6 +36,11 @@ export type QueryEditorProps = Util.ThemedClassName<
|
|
|
36
36
|
* will not read.
|
|
37
37
|
*/
|
|
38
38
|
onFilterChange?: (result: BuildResult) => void;
|
|
39
|
+
/**
|
|
40
|
+
* Show the "Press '#' for commands" hint in the empty, focused editor (default true). A caller with
|
|
41
|
+
* its own placeholder turns it off, since the two otherwise render run together.
|
|
42
|
+
*/
|
|
43
|
+
commandHint?: boolean;
|
|
39
44
|
} & (CompletionOptions & Omit<EditorViewProps, 'initialValue'> & Pick<EditorMenuProviderProps, 'numItems'>)
|
|
40
45
|
>;
|
|
41
46
|
|
|
@@ -43,7 +48,10 @@ export type QueryEditorProps = Util.ThemedClassName<
|
|
|
43
48
|
* Query editor with decorations and autocomplete.
|
|
44
49
|
*/
|
|
45
50
|
export const QueryEditor = forwardRef<EditorController, QueryEditorProps>(
|
|
46
|
-
(
|
|
51
|
+
(
|
|
52
|
+
{ db, tags, value, readonly, numItems = 8, commandHint = true, onChange, onFilterChange, ...props },
|
|
53
|
+
forwardedRef,
|
|
54
|
+
) => {
|
|
47
55
|
const { t } = Hooks.useTranslation(translationKey);
|
|
48
56
|
|
|
49
57
|
const getOptions = useMemo(() => completions({ db, tags }), [db, tags]);
|
|
@@ -119,6 +127,7 @@ export const QueryEditor = forwardRef<EditorController, QueryEditorProps>(
|
|
|
119
127
|
// instead, since `:` is a completion delimiter so the word under the caret is the typename.
|
|
120
128
|
// The explicit key stays, for re-opening a dismissed menu.
|
|
121
129
|
trigger={['#']}
|
|
130
|
+
placeholder={commandHint ? undefined : false}
|
|
122
131
|
// NOT `activateOnTyping`: that opens the menu on every word character, and the popover takes
|
|
123
132
|
// focus each keystroke while returning nothing for most positions. `:` is the only delimiter
|
|
124
133
|
// with a list behind it, so the typename menu opens there and nowhere else.
|