@fc-components/monaco-editor 0.1.15 → 0.1.16

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.
@@ -6,7 +6,6 @@ import { promLanguageDefinition } from 'monaco-promql';
6
6
  import { parser, LabelMatchers, VectorSelector, PromQL, FunctionCallBody, StringLiteral, UnquotedLabelMatcher, BinaryExpr, NumberDurationLiteralInDurationContext, MatrixSelector, GroupingLabels, AggregateModifier, AggregateExpr, Identifier, LabelName, MatchOp, EqlSingle, EqlRegex, Neq, NeqRegex } from '@fc-components/lezer-metricsql';
7
7
  import { v4 } from 'uuid';
8
8
  import { css } from '@emotion/css';
9
- import UFuzzy from '@leeoniya/ufuzzy';
10
9
 
11
10
  function _arrayLikeToArray(r, a) {
12
11
  (null == a || a > r.length) && (a = r.length);
@@ -1487,24 +1486,23 @@ function notEmpty(value) {
1487
1486
  return value !== null && value !== undefined;
1488
1487
  }
1489
1488
 
1490
- var metricNamesSearchClient = /*#__PURE__*/new UFuzzy({
1491
- intraMode: 1
1492
- });
1489
+ // const metricNamesSearchClient = new UFuzzy({ intraMode: 1 });
1493
1490
  // we order items like: history, functions, metrics
1494
1491
  function getAllMetricNamesCompletions(dataProvider) {
1495
1492
  var metricNames = dataProvider.getAllMetricNames();
1496
- if (metricNames.length > dataProvider.metricNamesSuggestionLimit) {
1497
- var monacoSettings = dataProvider.monacoSettings;
1498
- monacoSettings.enableAutocompleteSuggestionsUpdate();
1499
- if (monacoSettings.inputInRange) {
1500
- var _metricNamesSearchCli, _metricNamesSearchCli2;
1501
- metricNames = (_metricNamesSearchCli = (_metricNamesSearchCli2 = metricNamesSearchClient.filter(metricNames, monacoSettings.inputInRange)) == null ? void 0 : _metricNamesSearchCli2.slice(0, dataProvider.metricNamesSuggestionLimit).map(function (idx) {
1502
- return metricNames[idx];
1503
- })) != null ? _metricNamesSearchCli : [];
1504
- } else {
1505
- metricNames = metricNames.slice(0, dataProvider.metricNamesSuggestionLimit);
1506
- }
1507
- }
1493
+ // if (metricNames.length > dataProvider.metricNamesSuggestionLimit) {
1494
+ // const { monacoSettings } = dataProvider;
1495
+ // monacoSettings.enableAutocompleteSuggestionsUpdate();
1496
+ // if (monacoSettings.inputInRange) {
1497
+ // metricNames =
1498
+ // metricNamesSearchClient
1499
+ // .filter(metricNames, monacoSettings.inputInRange)
1500
+ // ?.slice(0, dataProvider.metricNamesSuggestionLimit)
1501
+ // .map((idx) => metricNames[idx]) ?? [];
1502
+ // } else {
1503
+ // metricNames = metricNames.slice(0, dataProvider.metricNamesSuggestionLimit);
1504
+ // }
1505
+ // }
1508
1506
  return dataProvider.metricNamesToMetrics(metricNames).map(function (metric) {
1509
1507
  return {
1510
1508
  type: 'METRIC_NAME',
@@ -1728,7 +1726,7 @@ function _getLabelValues() {
1728
1726
  }
1729
1727
  return _context6.a(3, 7);
1730
1728
  case 6:
1731
- if (key === labelName) {
1729
+ if (key === labelName && value) {
1732
1730
  labelValues.add(value);
1733
1731
  }
1734
1732
  case 7: