ydb-embedded-ui 6.0.1 → 6.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (134) hide show
  1. package/dist/components/CriticalActionDialog/CriticalActionDialog.scss +0 -2
  2. package/dist/components/DateRange/DateRange.scss +7 -0
  3. package/dist/components/NodeHostWrapper/NodeHostWrapper.js +1 -1
  4. package/dist/components/NodeHostWrapper/NodeHostWrapper.scss +0 -6
  5. package/dist/components/QueryResultTable/QueryResultTable.d.ts +2 -2
  6. package/dist/components/QueryResultTable/QueryResultTable.js +2 -1
  7. package/dist/components/QueryResultTable/QueryResultTable.scss +1 -0
  8. package/dist/components/ResizeableDataTable/ResizeableDataTable.d.ts +7 -0
  9. package/dist/components/ResizeableDataTable/ResizeableDataTable.js +14 -0
  10. package/dist/components/ResizeableDataTable/ResizeableDataTable.scss +8 -0
  11. package/dist/components/VirtualTable/ResizeHandler.d.ts +8 -0
  12. package/dist/components/VirtualTable/ResizeHandler.js +62 -0
  13. package/dist/components/VirtualTable/ResizeableVirtualTable.d.ts +6 -0
  14. package/dist/components/VirtualTable/ResizeableVirtualTable.js +16 -0
  15. package/dist/components/VirtualTable/TableHead.d.ts +3 -3
  16. package/dist/components/VirtualTable/TableHead.js +16 -31
  17. package/dist/components/VirtualTable/VirtualTable.d.ts +2 -4
  18. package/dist/components/VirtualTable/VirtualTable.scss +24 -4
  19. package/dist/components/VirtualTable/types.d.ts +3 -0
  20. package/dist/components/VirtualTable/utils.d.ts +2 -0
  21. package/dist/components/VirtualTable/utils.js +21 -0
  22. package/dist/containers/ClusterModeGuard/ClusterModeGuard.js +1 -1
  23. package/dist/containers/Clusters/Clusters.js +3 -2
  24. package/dist/containers/Clusters/Clusters.scss +5 -0
  25. package/dist/containers/Clusters/columns.d.ts +1 -0
  26. package/dist/containers/Clusters/columns.js +4 -3
  27. package/dist/containers/Nodes/Nodes.js +4 -4
  28. package/dist/containers/Nodes/Nodes.scss +0 -5
  29. package/dist/containers/Nodes/VirtualNodes.js +4 -6
  30. package/dist/containers/Nodes/getNodesColumns.d.ts +1 -0
  31. package/dist/containers/Nodes/getNodesColumns.js +9 -1
  32. package/dist/containers/PDiskPage/PDiskGroups.js +3 -3
  33. package/dist/containers/PDiskPage/PDiskPage.js +6 -1
  34. package/dist/containers/Storage/Storage.scss +0 -4
  35. package/dist/containers/Storage/StorageGroups/StorageGroups.js +3 -3
  36. package/dist/containers/Storage/StorageGroups/VirtualStorageGroups.js +3 -3
  37. package/dist/containers/Storage/StorageGroups/getStorageGroupsColumns.d.ts +3 -0
  38. package/dist/containers/Storage/StorageGroups/getStorageGroupsColumns.js +7 -3
  39. package/dist/containers/Storage/StorageNodes/StorageNodes.js +3 -3
  40. package/dist/containers/Storage/StorageNodes/VirtualStorageNodes.js +3 -3
  41. package/dist/containers/Storage/StorageNodes/getStorageNodesColumns.d.ts +3 -0
  42. package/dist/containers/Storage/StorageNodes/getStorageNodesColumns.js +2 -0
  43. package/dist/containers/Tablet/Tablet.scss +0 -4
  44. package/dist/containers/Tablet/TabletTable/TabletTable.js +5 -3
  45. package/dist/containers/Tenant/Acl/Acl.js +3 -2
  46. package/dist/containers/Tenant/Acl/Acl.scss +0 -6
  47. package/dist/containers/Tenant/Diagnostics/Consumers/Consumers.js +3 -3
  48. package/dist/containers/Tenant/Diagnostics/Consumers/Consumers.scss +2 -0
  49. package/dist/containers/Tenant/Diagnostics/Consumers/columns/columns.d.ts +1 -0
  50. package/dist/containers/Tenant/Diagnostics/Consumers/columns/columns.js +2 -0
  51. package/dist/containers/Tenant/Diagnostics/HotKeys/HotKeys.js +5 -4
  52. package/dist/containers/Tenant/Diagnostics/HotKeys/HotKeys.scss +1 -5
  53. package/dist/containers/Tenant/Diagnostics/Partitions/Partitions.js +8 -4
  54. package/dist/containers/Tenant/Diagnostics/Partitions/Partitions.scss +2 -0
  55. package/dist/containers/Tenant/Diagnostics/Partitions/PartitionsControls/PartitionsControls.js +1 -1
  56. package/dist/containers/Tenant/Diagnostics/Partitions/columns/Columns.scss +0 -8
  57. package/dist/containers/Tenant/Diagnostics/Partitions/columns/columns.d.ts +1 -0
  58. package/dist/containers/Tenant/Diagnostics/Partitions/columns/columns.js +11 -4
  59. package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TopNodesByCpu.js +2 -2
  60. package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TopNodesByLoad.js +2 -2
  61. package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TopQueries.js +3 -2
  62. package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TopShards.js +2 -2
  63. package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantMemory/TopNodesByMemory.js +2 -2
  64. package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantOverview.scss +3 -7
  65. package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantOverviewTableLayout.d.ts +2 -2
  66. package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantOverviewTableLayout.js +2 -2
  67. package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantStorage/TopGroups.js +2 -2
  68. package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantStorage/TopTables.js +4 -2
  69. package/dist/containers/Tenant/Diagnostics/TopQueries/TopQueries.js +8 -11
  70. package/dist/containers/Tenant/Diagnostics/TopQueries/TopQueries.scss +2 -24
  71. package/dist/containers/Tenant/Diagnostics/TopQueries/getTopQueriesColumns.d.ts +1 -0
  72. package/dist/containers/Tenant/Diagnostics/TopQueries/getTopQueriesColumns.js +7 -0
  73. package/dist/containers/Tenant/Diagnostics/TopShards/Filters/Filters.d.ts +1 -2
  74. package/dist/containers/Tenant/Diagnostics/TopShards/Filters/Filters.js +3 -4
  75. package/dist/containers/Tenant/Diagnostics/TopShards/TopShards.d.ts +0 -1
  76. package/dist/containers/Tenant/Diagnostics/TopShards/TopShards.js +8 -10
  77. package/dist/containers/Tenant/Diagnostics/TopShards/TopShards.scss +4 -15
  78. package/dist/containers/Tenant/Diagnostics/TopShards/getTopShardsColumns.d.ts +1 -0
  79. package/dist/containers/Tenant/Diagnostics/TopShards/getTopShardsColumns.js +5 -0
  80. package/dist/containers/Tenant/ObjectSummary/ObjectSummary.js +1 -1
  81. package/dist/containers/Tenant/ObjectSummary/ObjectSummary.scss +0 -6
  82. package/dist/containers/Tenant/Query/ExecuteResult/ExecuteResult.scss +1 -21
  83. package/dist/containers/Tenant/Query/ExplainResult/ExplainResult.js +4 -4
  84. package/dist/containers/Tenant/Query/ExplainResult/utils.d.ts +0 -3
  85. package/dist/containers/Tenant/Query/ExplainResult/utils.js +0 -34
  86. package/dist/containers/Tenant/Query/Preview/Preview.scss +6 -3
  87. package/dist/containers/Tenant/Query/QueriesHistory/QueriesHistory.js +4 -2
  88. package/dist/containers/Tenant/Query/QueriesHistory/QueriesHistory.scss +0 -1
  89. package/dist/containers/Tenant/Query/QueryEditor/QueryEditor.js +2 -1
  90. package/dist/containers/Tenant/Query/QueryEditor/helpers.js +5 -3
  91. package/dist/containers/Tenant/Query/SavedQueries/SavedQueries.js +4 -1
  92. package/dist/containers/Tenant/Query/SavedQueries/SavedQueries.scss +0 -1
  93. package/dist/containers/Tenant/Schema/SchemaViewer/SchemaViewer.d.ts +1 -2
  94. package/dist/containers/Tenant/Schema/SchemaViewer/SchemaViewer.js +4 -3
  95. package/dist/containers/Tenant/Schema/SchemaViewer/helpers.d.ts +1 -0
  96. package/dist/containers/Tenant/Schema/SchemaViewer/helpers.js +4 -2
  97. package/dist/containers/Tenant/Tenant.js +1 -1
  98. package/dist/containers/Tenants/Tenants.js +8 -3
  99. package/dist/containers/Tenants/Tenants.scss +13 -5
  100. package/dist/containers/UserSettings/i18n/en.json +2 -0
  101. package/dist/containers/UserSettings/i18n/index.d.ts +1 -1
  102. package/dist/containers/UserSettings/settings.d.ts +1 -0
  103. package/dist/containers/UserSettings/settings.js +7 -2
  104. package/dist/containers/Versions/GroupedNodesTree/GroupedNodesTree.scss +0 -2
  105. package/dist/containers/Versions/NodesTable/NodesTable.js +14 -9
  106. package/dist/services/api.d.ts +9 -1
  107. package/dist/services/api.js +5 -0
  108. package/dist/services/settings.js +2 -1
  109. package/dist/styles/mixins.scss +0 -47
  110. package/dist/types/api/autocomplete.d.ts +21 -0
  111. package/dist/types/api/autocomplete.js +1 -0
  112. package/dist/types/api/restartPDisk.d.ts +4 -0
  113. package/dist/types/api/restartPDisk.js +1 -0
  114. package/dist/utils/constants.d.ts +26 -10
  115. package/dist/utils/constants.js +1 -0
  116. package/dist/utils/hooks/useTableResize.d.ts +2 -7
  117. package/dist/utils/hooks/useTableResize.js +12 -24
  118. package/dist/utils/monaco/index.js +2 -0
  119. package/dist/utils/monaco/{yqlSuggestions → yql}/constants.d.ts +1 -0
  120. package/dist/utils/monaco/{yqlSuggestions → yql}/constants.js +1 -0
  121. package/dist/utils/monaco/{yqlSuggestions → yql}/generateSuggestions.d.ts +3 -3
  122. package/dist/utils/monaco/{yqlSuggestions → yql}/generateSuggestions.js +124 -64
  123. package/dist/utils/monaco/yql/registerLanguage.d.ts +1 -0
  124. package/dist/utils/monaco/yql/registerLanguage.js +8 -0
  125. package/dist/utils/monaco/{yqlSuggestions/registerCompletionItemProvider.js → yql/yql.completionItemProvider.js} +3 -2
  126. package/dist/utils/monaco/yql/yql.d.ts +7 -0
  127. package/dist/utils/monaco/yql/yql.js +180 -0
  128. package/dist/utils/monaco/yql/yql.keywords.d.ts +3 -0
  129. package/dist/utils/monaco/yql/yql.keywords.js +3 -0
  130. package/dist/utils/monaco/{yqlSuggestions → yql}/yqlSuggestions.js +14 -7
  131. package/package.json +12 -12
  132. package/dist/containers/Tenant/Diagnostics/TopShards/Filters/Filters.scss +0 -8
  133. /package/dist/utils/monaco/{yqlSuggestions/registerCompletionItemProvider.d.ts → yql/yql.completionItemProvider.d.ts} +0 -0
  134. /package/dist/utils/monaco/{yqlSuggestions → yql}/yqlSuggestions.d.ts +0 -0
@@ -0,0 +1,180 @@
1
+ import { builtinFunctions, keywords, typeKeywords } from './yql.keywords';
2
+ export const conf = {
3
+ comments: {
4
+ lineComment: '--',
5
+ blockComment: ['/*', '*/'],
6
+ },
7
+ brackets: [
8
+ ['{', '}'],
9
+ ['[', ']'],
10
+ ['(', ')'],
11
+ ],
12
+ autoClosingPairs: [
13
+ { open: '{', close: '}' },
14
+ { open: '[', close: ']' },
15
+ { open: '(', close: ')' },
16
+ { open: '"', close: '"' },
17
+ { open: "'", close: "'" },
18
+ { open: '`', close: '`' },
19
+ ],
20
+ surroundingPairs: [
21
+ { open: '{', close: '}' },
22
+ { open: '[', close: ']' },
23
+ { open: '(', close: ')' },
24
+ { open: '"', close: '"' },
25
+ { open: "'", close: "'" },
26
+ { open: '`', close: '`' },
27
+ ],
28
+ wordPattern: /(-?\d*\.\d\w*)|([^`~!@#%^&*()\-=+[{\]}\\|;:'",./?\s]+)/g,
29
+ };
30
+ export function getLanguage({ ansi = false, } = {}) {
31
+ return {
32
+ defaultToken: 'text',
33
+ ignoreCase: true,
34
+ brackets: [
35
+ { open: '[', close: ']', token: 'delimiter.square' },
36
+ { open: '(', close: ')', token: 'delimiter.parenthesis' },
37
+ { open: '{', close: '}', token: 'delimiter.curly' },
38
+ ],
39
+ keywords,
40
+ typeKeywords,
41
+ constants: ['true', 'false'],
42
+ builtinFunctions,
43
+ operators: [
44
+ '+',
45
+ '-',
46
+ '/',
47
+ '//',
48
+ '%',
49
+ '<@>',
50
+ '@>',
51
+ '<@',
52
+ '&',
53
+ '^',
54
+ '~',
55
+ '<',
56
+ '>',
57
+ '<=',
58
+ '>=',
59
+ '=>',
60
+ '==',
61
+ '!=',
62
+ '<>',
63
+ '=',
64
+ ],
65
+ symbols: /[=><!~?:&|+\-*/^%]+/,
66
+ escapes: /\\(?:[abfnrtv\\"'`]|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,
67
+ variables: /[a-zA-Z_]\w*/,
68
+ tokenizer: {
69
+ root: [
70
+ { include: '@whitespace' },
71
+ { include: '@comments' },
72
+ { include: '@numbers' },
73
+ { include: '@tablePath' },
74
+ { include: '@strings' },
75
+ // support function
76
+ [/(@variables)::(@variables)/, 'support.function'],
77
+ [/[;,.]/, 'delimiter'],
78
+ [/[(){}[\]]/, '@brackets'],
79
+ // identifiers and keywords
80
+ [
81
+ /@?[a-zA-Z_$]\w*/,
82
+ {
83
+ cases: {
84
+ '@keywords': 'keyword',
85
+ '@typeKeywords': 'keyword.type',
86
+ '@constants': 'constant.yql',
87
+ '@builtinFunctions': 'constant.other.color',
88
+ '[$@][a-zA-Z_]\\w*': 'variable',
89
+ '@default': 'identifier',
90
+ },
91
+ },
92
+ ],
93
+ [
94
+ /@symbols/,
95
+ {
96
+ cases: {
97
+ '@operators': 'operator.sql',
98
+ '@default': '',
99
+ },
100
+ },
101
+ ],
102
+ ],
103
+ whitespace: [[/\s+/, 'white']],
104
+ comments: [
105
+ [/--.*/, 'comment'],
106
+ [/\/\*/, { token: 'comment.quote', next: ansi ? '@commentAnsi' : '@comment' }],
107
+ ],
108
+ comment: [
109
+ [/[^*/]+/, 'comment'],
110
+ [/\*\//, { token: 'comment.quote', next: '@pop' }],
111
+ [/./, 'comment'],
112
+ ],
113
+ commentAnsi: [
114
+ [/\/\*/, { token: 'comment.quote', next: '@comment' }],
115
+ [/[^*/]+/, 'comment'],
116
+ [/\*\//, { token: 'comment.quote', next: '@pop' }],
117
+ [/./, 'comment'],
118
+ ],
119
+ numbers: [
120
+ [/[+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?f?\b/, 'number.float'],
121
+ [/[+-]?(?:\d+|0b[01]+|0o[0-8]+|0x[\da-f]+)(?:u?[lst]?)?\b/, 'number'],
122
+ ],
123
+ strings: [
124
+ [/'/, { token: 'string', next: ansi ? '@stringAnsiSingle' : '@stringSingle' }],
125
+ [/"/, { token: 'string', next: ansi ? '@stringAnsiDouble' : '@stringDouble' }],
126
+ [/[@]{2}/, { token: 'string', next: '@multilineString' }],
127
+ ],
128
+ stringSingle: [
129
+ [/[^\\']+/, 'string'],
130
+ [/@escapes/, 'string.escape'],
131
+ [/\\./, 'string.escape.invalid'],
132
+ [/'[uyj]?/, { token: 'string', next: '@pop' }],
133
+ ],
134
+ stringAnsiSingle: [
135
+ [/[^']+/, 'string'],
136
+ [/''/, 'string'],
137
+ [/'[uyj]?/, { token: 'string', next: '@pop' }],
138
+ ],
139
+ stringDouble: [
140
+ [/[^\\"]+/, 'string'],
141
+ [/@escapes/, 'string.escape'],
142
+ [/\\./, 'string.escape.invalid'],
143
+ [/"[uyj]?/, { token: 'string', next: '@pop' }],
144
+ ],
145
+ stringAnsiDouble: [
146
+ [/[^"]+/, 'string'],
147
+ [/""/, 'string'],
148
+ [/"[uyj]?/, { token: 'string', next: '@pop' }],
149
+ ],
150
+ multilineString: [
151
+ [
152
+ /#py/,
153
+ { token: 'string.python', nextEmbedded: 'python', next: '@embedded', goBack: 3 },
154
+ ],
155
+ [
156
+ /\/\/js/,
157
+ { token: 'string.js', nextEmbedded: 'javascript', next: '@embedded', goBack: 4 },
158
+ ],
159
+ [/[^@]+/, 'string'],
160
+ [/[@]{4}/, 'string'],
161
+ [/[@]{2}[uyj]?/, { token: 'string', next: '@pop' }],
162
+ [/./, 'string'],
163
+ ],
164
+ embedded: [
165
+ [
166
+ /([^@]|^)([@]{4})*[@]{2}([@]([^@]|$)|[^@]|$)/,
167
+ { token: '@rematch', next: '@pop', nextEmbedded: '@pop' },
168
+ ],
169
+ ],
170
+ tablePath: [[/((`)?[\w/]+\2\s*\.\s*)?`/, { token: 'string.tablepath', next: '@table' }]],
171
+ table: [
172
+ [/[^\\`]+/, 'string.tablepath'],
173
+ [/``/, 'string.tablepath'],
174
+ [/@escapes/, 'string.escape.tablepath'],
175
+ [/\\./, 'string.escape.invalid.tablepath'],
176
+ [/`/, { token: 'string.tablepath', next: '@pop' }],
177
+ ],
178
+ },
179
+ };
180
+ }
@@ -0,0 +1,3 @@
1
+ export declare const keywords: string[];
2
+ export declare const typeKeywords: string[];
3
+ export declare const builtinFunctions: string[];
@@ -0,0 +1,3 @@
1
+ export const keywords = '$row|$rows|action|all|and|any|as|asc|assume|begin|bernoulli|between|by|case|columns|commit|compact|create|cross|cube|declare|define|delete|desc|dict|discard|distinct|do|drop|else|empty_action|end|erase|evaluate|exclusion|exists|export|flatten|for|from|full|group|grouping|having|if|ignore|ilike|import|in|inner|insert|into|is|join|left|like|limit|list|match|not|null|nulls|offset|on|only|optional|or|order|over|partition|pragma|presort|process|reduce|regexp|repeatable|replace|respect|result|return|right|rlike|rollup|sample|schema|select|semi|set|sets|stream|subquery|table|tablesample|then|truncate|union|update|upsert|use|using|values|view|when|where|window|with|without|xor'.split('|');
2
+ export const typeKeywords = 'bool|date|datetime|decimal|double|float|int16|int32|int64|int8|interval|json|string|timestamp|tzdate|tzdatetime|tztimestamp|uint16|uint32|uint64|uint8|utf8|uuid|yson'.split('|');
3
+ export const builtinFunctions = 'abs|aggregate_by|aggregate_list|aggregate_list_distinct|agg_list|agg_list_distinct|as_table|avg|avg_if|adaptivedistancehistogram|adaptivewardhistogram|adaptiveweighthistogram|addmember|addtimezone|aggregateflatten|aggregatetransforminput|aggregatetransformoutput|aggregationfactory|asatom|asdict|asdictstrict|asenum|aslist|asliststrict|asset|assetstrict|asstruct|astagged|astuple|asvariant|atomcode|bitcast|bit_and|bit_or|bit_xor|bool_and|bool_or|bool_xor|bottom|bottom_by|blockwardhistogram|blockweighthistogram|cast|coalesce|concat|concat_strict|correlation|count|count_if|covariance|covariance_population|covariance_sample|callableargument|callableargumenttype|callableresulttype|callabletype|callabletypecomponents|callabletypehandle|choosemembers|combinemembers|countdistinctestimate|currentauthenticateduser|currentoperationid|currentoperationsharedid|currenttzdate|currenttzdatetime|currenttztimestamp|currentutcdate|currentutcdatetime|currentutctimestamp|dense_rank|datatype|datatypecomponents|datatypehandle|dictaggregate|dictcontains|dictcreate|dicthasitems|dictitems|dictkeytype|dictkeys|dictlength|dictlookup|dictpayloadtype|dictpayloads|dicttype|dicttypecomponents|dicttypehandle|each|each_strict|emptydicttype|emptydicttypehandle|emptylisttype|emptylisttypehandle|endswith|ensure|ensureconvertibleto|ensuretype|enum|evaluateatom|evaluatecode|evaluateexpr|evaluatetype|expandstruct|filter|filter_strict|find|first_value|folder|filecontent|filepath|flattenmembers|forceremovemember|forceremovemembers|forcerenamemembers|forcespreadmembers|formatcode|formattype|frombytes|funccode|greatest|grouping|gathermembers|generictype|histogram|hll|hyperloglog|if|if_strict|instanceof|json_exists|json_query|json_value|jointablerow|just|lag|last_value|lead|least|len|length|like|likely|like_strict|lambdaargumentscount|lambdacode|linearhistogram|listaggregate|listall|listany|listavg|listcode|listcollect|listconcat|listcreate|listdistinct|listenumerate|listextend|listextendstrict|listextract|listfilter|listflatmap|listflatten|listfromrange|listhas|listhasitems|listhead|listindexof|listitemtype|listlast|listlength|listmap|listmax|listmin|listnotnull|listreplicate|listreverse|listskip|listskipwhile|listskipwhileinclusive|listsort|listsortasc|listsortdesc|listsum|listtake|listtakewhile|listtakewhileinclusive|listtype|listtypehandle|listunionall|listuniq|listzip|listzipall|loghistogram|logarithmichistogram|max|max_by|max_of|median|min|min_by|min_of|mode|multi_aggregate_by|nanvl|nvl|nothing|nulltype|nulltypehandle|optionalitemtype|optionaltype|optionaltypehandle|percentile|parsefile|parsetype|parsetypehandle|pickle|quotecode|range|range_strict|rank|regexp|regexp_strict|rfind|row_number|random|randomnumber|randomuuid|removemember|removemembers|removetimezone|renamemembers|replacemember|reprcode|resourcetype|resourcetypehandle|resourcetypetag|some|stddev|stddev_population|stddev_sample|substring|sum|sum_if|sessionstart|sessionwindow|setcreate|setdifference|setincludes|setintersection|setisdisjoint|setsymmetricdifference|setunion|spreadmembers|stablepickle|startswith|staticmap|streamitemtype|streamtype|streamtypehandle|structmembertype|structmembers|structtypecomponents|structtypehandle|subqueryextend|subqueryextendfor|subquerymerge|subquerymergefor|subqueryunionall|subqueryunionallfor|subqueryunionmerge|subqueryunionmergefor|top|topfreq|top_by|tablename|tablepath|tablerecordindex|tablerow|taggedtype|taggedtypecomponents|taggedtypehandle|tobytes|todict|tomultidict|toset|tosorteddict|tosortedmultidict|trymember|tupleelementtype|tupletype|tupletypecomponents|tupletypehandle|typehandle|typekind|typeof|udaf|unittype|unpickle|untag|unwrap|variance|variance_population|variance_sample|variant|varianttype|varianttypehandle|variantunderlyingtype|voidtype|voidtypehandle|way|worldcode'.split('|');
@@ -1,18 +1,24 @@
1
1
  import { generateAggregateFunctionsSuggestion, generateColumnAliasesSuggestion, generateColumnsSuggestion, generateEntitiesSuggestion, generateKeywordsSuggestion, generatePragmasSuggestion, generateSimpleFunctionsSuggestion, generateSimpleTypesSuggestion, generateTableFunctionsSuggestion, generateUdfSuggestion, generateWindowFunctionsSuggestion, } from './generateSuggestions';
2
2
  export function createProvideSuggestionsFunction(database) {
3
3
  return async (model, monacoCursorPosition, _context, _token) => {
4
- const cursorPosition = {
5
- line: monacoCursorPosition.lineNumber,
6
- column: monacoCursorPosition.column,
7
- };
8
4
  const rangeToInsertSuggestion = getRangeToInsertSuggestion(model, monacoCursorPosition);
9
- const suggestions = await getSuggestions(model, cursorPosition, rangeToInsertSuggestion, database);
5
+ const suggestions = await getSuggestions(model, monacoCursorPosition, rangeToInsertSuggestion, database);
10
6
  return { suggestions };
11
7
  };
12
8
  }
9
+ function getEntityNameAtCursor(model, cursorPosition) {
10
+ var _a, _b, _c, _d;
11
+ const prevWord = model.findPreviousMatch('\\s(`?[^\\s]*)', cursorPosition, true, false, null, true);
12
+ const nextWord = model.findNextMatch('([^\\s]*)`?', cursorPosition, true, false, null, true);
13
+ return `${(_b = (_a = prevWord === null || prevWord === void 0 ? void 0 : prevWord.matches) === null || _a === void 0 ? void 0 : _a[1]) !== null && _b !== void 0 ? _b : ''}${(_d = (_c = nextWord === null || nextWord === void 0 ? void 0 : nextWord.matches) === null || _c === void 0 ? void 0 : _c[1]) !== null && _d !== void 0 ? _d : ''}`;
14
+ }
13
15
  async function getSuggestions(model, cursorPosition, rangeToInsertSuggestion, database) {
14
16
  const { parseYqlQuery } = await import('@gravity-ui/websql-autocomplete');
15
- const parseResult = parseYqlQuery(model.getValue(), cursorPosition);
17
+ const cursorForParsing = {
18
+ line: cursorPosition.lineNumber,
19
+ column: cursorPosition.column,
20
+ };
21
+ const parseResult = parseYqlQuery(model.getValue(), cursorForParsing);
16
22
  let entitiesSuggestions = [];
17
23
  let functionsSuggestions = [];
18
24
  let aggregateFunctionsSuggestions = [];
@@ -22,7 +28,8 @@ async function getSuggestions(model, cursorPosition, rangeToInsertSuggestion, da
22
28
  let simpleTypesSuggestions = [];
23
29
  let pragmasSuggestions = [];
24
30
  if (parseResult.suggestEntity) {
25
- entitiesSuggestions = await generateEntitiesSuggestion(rangeToInsertSuggestion);
31
+ const entityNamePrefix = getEntityNameAtCursor(model, cursorPosition);
32
+ entitiesSuggestions = await generateEntitiesSuggestion(rangeToInsertSuggestion, parseResult.suggestEntity, database, entityNamePrefix);
26
33
  }
27
34
  if (parseResult.suggestFunctions) {
28
35
  functionsSuggestions = await generateSimpleFunctionsSuggestion(rangeToInsertSuggestion);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ydb-embedded-ui",
3
- "version": "6.0.1",
3
+ "version": "6.2.0",
4
4
  "files": [
5
5
  "dist"
6
6
  ],
@@ -12,16 +12,16 @@
12
12
  "dependencies": {
13
13
  "@bem-react/classname": "^1.6.0",
14
14
  "@gravity-ui/axios-wrapper": "^1.4.1",
15
- "@gravity-ui/chartkit": "^5.3.0",
16
- "@gravity-ui/components": "^3.4.1",
17
- "@gravity-ui/date-utils": "^2.2.0",
18
- "@gravity-ui/i18n": "^1.4.0",
15
+ "@gravity-ui/chartkit": "^5.5.0",
16
+ "@gravity-ui/components": "^3.6.0",
17
+ "@gravity-ui/date-utils": "^2.4.0",
18
+ "@gravity-ui/i18n": "^1.5.0",
19
19
  "@gravity-ui/icons": "^2.9.1",
20
- "@gravity-ui/navigation": "^2.7.0",
21
- "@gravity-ui/paranoid": "^1.4.1",
22
- "@gravity-ui/react-data-table": "^2.0.1",
23
- "@gravity-ui/uikit": "^6.10.2",
24
- "@gravity-ui/websql-autocomplete": "^8.0.2",
20
+ "@gravity-ui/navigation": "^2.10.0",
21
+ "@gravity-ui/paranoid": "^2.0.1",
22
+ "@gravity-ui/react-data-table": "^2.1.1",
23
+ "@gravity-ui/uikit": "^6.15.0",
24
+ "@gravity-ui/websql-autocomplete": "^8.1.0",
25
25
  "@reduxjs/toolkit": "^2.2.3",
26
26
  "axios": "^1.6.8",
27
27
  "colord": "^2.9.3",
@@ -70,7 +70,7 @@
70
70
  "prepublishOnly": "npm run package",
71
71
  "typecheck": "tsc --noEmit",
72
72
  "prepare": "husky",
73
- "test:e2e:install": "npx playwright install --with-deps chromium",
73
+ "test:e2e:install": "npx playwright install --with-deps",
74
74
  "test:e2e": "npx playwright test --config=playwright.config.ts"
75
75
  },
76
76
  "lint-staged": {
@@ -122,7 +122,7 @@
122
122
  "devDependencies": {
123
123
  "@commitlint/cli": "^19.2.1",
124
124
  "@commitlint/config-conventional": "^19.1.0",
125
- "@gravity-ui/eslint-config": "^3.1.1",
125
+ "@gravity-ui/eslint-config": "^3.2.0",
126
126
  "@gravity-ui/prettier-config": "^1.1.0",
127
127
  "@gravity-ui/stylelint-config": "^4.0.1",
128
128
  "@gravity-ui/tsconfig": "^1.0.0",
@@ -1,8 +0,0 @@
1
- .top-shards {
2
- &__filters {
3
- display: flex;
4
- flex-wrap: wrap;
5
- align-items: baseline;
6
- gap: 16px;
7
- }
8
- }