@vuu-ui/vuu-codemirror 3.4.1 → 3.5.0-beta.1
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/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "3.
|
|
2
|
+
"version": "3.5.0-beta.1",
|
|
3
3
|
"author": "heswell",
|
|
4
4
|
"main": "./src/index.js",
|
|
5
5
|
"license": "Apache-2.0",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"lezer-generate:column": "lezer-generator --output ./src/column-expression-input/column-language-parser/generated/column-parser.js ./src/column-expression-input/column-language-parser/grammar/column.grammar"
|
|
11
11
|
},
|
|
12
12
|
"devDependencies": {
|
|
13
|
-
"@vuu-ui/vuu-table-types": "3.
|
|
13
|
+
"@vuu-ui/vuu-table-types": "3.5.0-beta.1"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"@codemirror/autocomplete": "^6.4.2",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"@codemirror/language": "^6.6.0",
|
|
19
19
|
"@codemirror/state": "^6.2.0",
|
|
20
20
|
"@codemirror/view": "^6.9.3",
|
|
21
|
-
"@vuu-ui/vuu-utils": "3.
|
|
21
|
+
"@vuu-ui/vuu-utils": "3.5.0-beta.1",
|
|
22
22
|
"@lezer/common": "1.2.3",
|
|
23
23
|
"@lezer/highlight": "^1.1.3"
|
|
24
24
|
},
|
package/src/suggestion-utils.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AnnotationType } from "@codemirror/state";
|
|
2
|
-
import { isNumericColumn } from "@vuu-ui/vuu-utils";
|
|
2
|
+
import { isNumericColumn, isTemporalColumn } from "@vuu-ui/vuu-utils";
|
|
3
3
|
const NO_OPTIONS = {};
|
|
4
4
|
const applyWithCursorMove = ()=>(view, completion, from)=>{
|
|
5
5
|
const annotation = new AnnotationType();
|
|
@@ -96,7 +96,7 @@ const numericOperators = [
|
|
|
96
96
|
}
|
|
97
97
|
];
|
|
98
98
|
const getRelationalOperators = (column)=>{
|
|
99
|
-
if (void 0 === column || isNumericColumn(column)) return numericOperators;
|
|
99
|
+
if (void 0 === column || isNumericColumn(column) || isTemporalColumn(column)) return numericOperators;
|
|
100
100
|
return equalityOperators;
|
|
101
101
|
};
|
|
102
102
|
const getNamePrompt = (entity)=>{
|
package/types/src/index.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { autocompletion, closeBrackets, Completion, CompletionContext, CompletionSource, startCompletion } from "@codemirror/autocomplete";
|
|
2
|
-
import { defaultKeymap, history, historyKeymap } from "@codemirror/commands";
|
|
3
|
-
import { defaultHighlightStyle, ensureSyntaxTree, HighlightStyle, LanguageSupport, LRLanguage, syntaxHighlighting, syntaxTree } from "@codemirror/language";
|
|
4
|
-
import { AnnotationType, EditorState, Extension } from "@codemirror/state";
|
|
5
|
-
import type { KeyBinding } from "@codemirror/view";
|
|
6
|
-
import { drawSelection, EditorView, highlightSpecialChars, keymap } from "@codemirror/view";
|
|
7
|
-
import type { SyntaxNode } from "@lezer/common";
|
|
8
|
-
import { Tree } from "@lezer/common";
|
|
9
|
-
import { styleTags, tags } from "@lezer/highlight";
|
|
10
|
-
export * from "./codemirror-basic-setup";
|
|
11
|
-
export * from "./parser-utils";
|
|
12
|
-
export * from "./suggestion-utils";
|
|
13
|
-
export { autocompletion, closeBrackets, startCompletion };
|
|
14
|
-
export type { Completion, CompletionContext, CompletionSource };
|
|
15
|
-
export { defaultKeymap, history, historyKeymap };
|
|
16
|
-
export { defaultHighlightStyle, ensureSyntaxTree, HighlightStyle, LanguageSupport, LRLanguage, syntaxHighlighting, syntaxTree, };
|
|
17
|
-
export { AnnotationType, EditorState };
|
|
18
|
-
export type { Extension };
|
|
19
|
-
export { drawSelection, EditorView, highlightSpecialChars, KeyBinding, keymap };
|
|
20
|
-
export { styleTags, tags };
|
|
21
|
-
export { SyntaxNode, Tree };
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { EditorState } from "@codemirror/state";
|
|
2
|
-
import type { SyntaxNode } from "@lezer/common";
|
|
3
|
-
export declare const getValue: (node: SyntaxNode, state: EditorState) => string;
|
|
4
|
-
export declare const getNodeByName: (node: SyntaxNode, state: EditorState, nodeName?: string) => string | undefined;
|
|
5
|
-
export declare const getPreviousNode: (node: SyntaxNode) => SyntaxNode | null;
|
|
6
|
-
export declare const getNamedParentNode: (node: SyntaxNode) => SyntaxNode | null;
|
|
7
|
-
export declare const getPreviousNamedNode: (node: SyntaxNode) => SyntaxNode | null;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { Completion } from "@codemirror/autocomplete";
|
|
2
|
-
import type { ColumnDescriptor } from "@vuu-ui/vuu-table-types";
|
|
3
|
-
export interface VuuCompletion extends Completion {
|
|
4
|
-
isIllustration?: boolean;
|
|
5
|
-
}
|
|
6
|
-
export type CompletionOptions = {
|
|
7
|
-
moveCursorToEnd?: boolean;
|
|
8
|
-
prefix?: string;
|
|
9
|
-
quoted?: boolean;
|
|
10
|
-
suffix?: string;
|
|
11
|
-
isIllustration?: boolean;
|
|
12
|
-
};
|
|
13
|
-
export declare const toSuggestions: (values: string[], options?: CompletionOptions) => VuuCompletion[];
|
|
14
|
-
export declare const asNameSuggestion: {
|
|
15
|
-
label: string;
|
|
16
|
-
apply: string;
|
|
17
|
-
boost: number;
|
|
18
|
-
};
|
|
19
|
-
export declare const booleanJoinSuggestions: Completion[];
|
|
20
|
-
export declare const equalityOperators: Completion[];
|
|
21
|
-
export declare const stringOperators: Completion[];
|
|
22
|
-
export declare const numericOperators: Completion[];
|
|
23
|
-
export declare const getRelationalOperators: (column?: ColumnDescriptor) => Completion[];
|
|
24
|
-
export declare const getNamePrompt: (entity?: string) => {
|
|
25
|
-
label: string;
|
|
26
|
-
boost: number;
|
|
27
|
-
}[];
|