All Downloads are FREE. Search and download functionalities are using the official Maven repository.

web-interface.assets.b6fe2bb5-7854.c4ce1f92650264e67bcf.js.map Maven / Gradle / Ivy

{"version":3,"file":"b6fe2bb5-7854.c4ce1f92650264e67bcf.js","mappings":"gUAuBA,QAAeA,EAAf,GC4KA,SA/KwBC,EAAAA,EAAAA,SAAOD,GAAWE,OAAM,kBAAmC,CAEjFC,MAF8C,EAAGC,SAGjDC,SAH8C,EAAaF,MAI3DG,QAJ8C,EAAoBA,YAA/C,sEAAGL,EAKpB,gBAAGI,EAAH,EAAGA,SAAUC,EAAb,EAAaA,QAASC,EAAtB,EAAsBA,SAAUC,EAAhC,EAAgCA,MAAhC,OAA4CC,EAAAA,EAAAA,KAA3C,CAAD,0nEAEEH,EAAU,WAAH,OAAcA,EAAd,iBAAuC,GAG5BD,EAASK,OAAOC,MAAMC,WACjCP,EAASQ,MAAMC,iBAAiBT,EAASK,OAAOC,MAAMC,WAAY,OACvDP,EAASK,OAAOK,QAAQC,MAAxB,QAIMX,EAASK,OAAOC,MAAMC,WAIhCP,EAASK,OAAOC,MAAMC,WAC3BP,EAASQ,MAAMC,iBAAiBT,EAASK,OAAOC,MAAMC,WAAY,OAK7DP,EAASK,OAAOC,MAAMC,WAI3BP,EAASK,OAAOO,KAAK,IACnBV,EAAW,OAAS,QAIpBC,EAAQ,QAAU,OAIfH,EAASK,OAAOK,QAAQG,SAAxB,QAIAb,EAASK,OAAOK,QAAQI,QASxBd,EAASK,OAAOC,MAAMC,WAIhBP,EAASK,OAAOC,MAAMC,WAItBP,EAASK,OAAOO,KAAK,IAIhCZ,EAASK,OAAOC,MAAMC,WAQtBP,EAASK,OAAOK,QAAQK,QAIxBf,EAASK,OAAOK,QAAQM,OAAOC,KAS/BjB,EAASK,OAAOK,QAAQQ,KAAKC,OAI7BnB,EAASK,OAAOK,QAAhB,QAIAV,EAASQ,MAAMY,cAAcpB,EAASK,OAAOgB,MAAMN,SACxCf,EAASK,OAAOgB,MAAMN,QAIjCf,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AOmF,IAAAA,OACPxE,QAASwE,IAAAA,IACTnD,YAAamD,IAAAA,KACbiD,SAAUjD,IAAAA,KAAAA,YAGZ4C,EAAW3C,aAAe,CACxBxD,UAAW,GACXoG,iBAAkBL,EAClBM,kBAAkB,EAClBpG,WAAOwD,EACPvD,YAAQuD,EACRtD,cAAUsD,EACVT,YAAQS,EACR9D,YAAa,GACbqE,aAASP,EACTM,eAAWN,EACXrF,MAAO,GACPW,aAAS0E,EACTrD,iBAAaqD,GAGf,W,cChPAyF,IAAIC,OAAO,2BAA4B,CAAC,UAAW,UAAW,SAAU,gBAAgB,SAACC,EAAUC,SAEjGA,QAAQC,QAAS,EAEjBD,QAAQE,SAAW,iBAGPH,EAAS,cAEjBI,gBAAgBH,QAAQI,QAASJ,QAAQE","sources":["webpack://graylog-web-interface/./src/views/components/searchbar/queryinput/ace.ts","webpack://graylog-web-interface/./src/views/components/searchbar/queryinput/StyledAceEditor.jsx","webpack://graylog-web-interface/./src/views/components/searchbar/queryinput/BasicQueryInput.tsx","webpack://graylog-web-interface/./src/views/components/searchbar/SearchBarAutocompletions.ts","webpack://graylog-web-interface/./src/views/components/searchbar/queryinput/QueryInput.tsx","webpack://graylog-web-interface/./src/views/components/searchbar/queryinput/ace-queryinput.js"],"sourcesContent":["/*\n * Copyright (C) 2020 Graylog, Inc.\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the Server Side Public License, version 1,\n * as published by MongoDB, Inc.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * Server Side Public License for more details.\n *\n * You should have received a copy of the Server Side Public License\n * along with this program. If not, see\n * .\n */\nimport AceEditor from 'react-ace';\n\nimport './ace-queryinput';\nimport 'ace-builds/src-noconflict/ext-language_tools';\nimport 'ace-builds/src-noconflict/mode-lucene';\nimport 'ace-builds/webpack-resolver';\n\nexport default AceEditor;\n","/*\n * Copyright (C) 2020 Graylog, Inc.\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the Server Side Public License, version 1,\n * as published by MongoDB, Inc.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * Server Side Public License for more details.\n *\n * You should have received a copy of the Server Side Public License\n * along with this program. If not, see\n * .\n */\nimport styled, { css } from 'styled-components';\n\nimport AceEditor from './ace';\n\nconst StyledAceEditor = styled(AceEditor).attrs(({ aceTheme, theme, $height }) => ({\n  // NOTE: After setting the prop we need to swap them back so AceEditor uses the proper styles\n  theme: aceTheme, /* stylelint-disable-line */\n  $scTheme: theme,\n  $height,\n}))(({ $scTheme, $height, disabled, value }) => css`\n  &.ace-queryinput {\n    ${$height ? `height: ${$height}px !important` : ''};\n    min-height: 34px;\n    width: 100% !important;\n    background-color: ${$scTheme.colors.input.background};\n    color: ${$scTheme.utils.contrastingColor($scTheme.colors.input.background, 'AAA')};\n    border: 1px solid ${$scTheme.colors.variant.light.default};\n    border-radius: 4px;\n\n    &.ace_multiselect .ace_selection.ace_start {\n      box-shadow: 0 0 3px 0 ${$scTheme.colors.input.background};\n    }\n\n    .ace_gutter {\n      background: ${$scTheme.colors.input.background};\n      color: ${$scTheme.utils.contrastingColor($scTheme.colors.input.background, 'AAA')};\n    }\n\n    .ace_print-margin {\n      width: 1px;\n      background: ${$scTheme.colors.input.background};\n    }\n\n    .ace_cursor {\n      color: ${$scTheme.colors.gray[50]};\n      display: ${disabled ? 'none' : 'block'} !important;\n    }\n\n    .ace_hidden-cursors {\n      display: ${value ? 'block' : 'none'};\n    }\n\n    .ace_marker-layer .ace_selection {\n      background: ${$scTheme.colors.variant.lightest.default};\n    }\n\n    .ace_marker-layer .ace_step {\n      background: ${$scTheme.colors.variant.warning};\n    }\n\n    .ace_marker-layer .ace_bracket {\n      margin: -1px 0 0 -1px;\n      border: none;\n    }\n\n    .ace_marker-layer .ace_active-line {\n      background: ${$scTheme.colors.input.background};\n    }\n\n    .ace_gutter-active-line {\n      background-color: ${$scTheme.colors.input.background};\n    }\n\n    .ace_marker-layer .ace_selected-word {\n      border: 1px solid ${$scTheme.colors.gray[80]};\n    }\n\n    .ace_invisible {\n      color: ${$scTheme.colors.input.background};\n    }\n\n    .ace_keyword,\n    .ace_meta,\n    .ace_storage,\n    .ace_storage.ace_type,\n    .ace_support.ace_type {\n      color: ${$scTheme.colors.variant.primary};\n    }\n\n    .ace_keyword.ace_operator {\n      color: ${$scTheme.colors.variant.darker.info};\n    }\n\n    .ace_constant.ace_character,\n    .ace_constant.ace_language,\n    .ace_constant.ace_numeric,\n    .ace_keyword.ace_other.ace_unit,\n    .ace_support.ace_constant,\n    .ace_variable.ace_parameter {\n      color: ${$scTheme.colors.variant.dark.danger};\n    }\n\n    .ace_constant.ace_other {\n      color: ${$scTheme.colors.variant.default};\n    }\n\n    .ace_invalid {\n      color: ${$scTheme.utils.readableColor($scTheme.colors.brand.primary)};\n      background-color: ${$scTheme.colors.brand.primary};\n    }\n\n    .ace_invalid.ace_deprecated {\n      color: ${$scTheme.utils.readableColor($scTheme.colors.brand.primary)};\n      background-color: ${$scTheme.colors.variant.dark.primary};\n    }\n\n    .ace_fold {\n      background-color: ${$scTheme.colors.variant.info};\n      border-color: ${$scTheme.utils.contrastingColor($scTheme.colors.input.background, 'AAA')};\n    }\n\n    .ace_entity.ace_name.ace_function,\n    .ace_support.ace_function,\n    .ace_variable,\n    .ace_term {\n      color: ${$scTheme.colors.variant.info};\n    }\n\n    .ace_support.ace_class,\n    .ace_support.ace_type {\n      color: ${$scTheme.colors.variant.dark.warning};\n    }\n\n    .ace_heading,\n    .ace_markup.ace_heading,\n    .ace_string {\n      color: ${$scTheme.colors.variant.dark.success};\n    }\n\n    .ace_entity.ace_name.ace_tag,\n    .ace_entity.ace_other.ace_attribute-name,\n    .ace_meta.ace_tag,\n    .ace_string.ace_regexp,\n    .ace_variable {\n      color: ${$scTheme.colors.brand.primary};\n    }\n\n    .ace_comment {\n      color: ${$scTheme.colors.gray[60]};\n    }\n\n    .ace_indent-guide {\n      background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bdu3f/BwAlfgctduB85QAAAABJRU5ErkJggg==) right repeat-y;\n    }\n\n    .ace_placeholder {\n      left: 0;\n      right: 0;\n      padding: 0;\n      margin-top: 6px;\n      margin-left: 6px;\n      transform: none;\n      opacity: 1;\n      z-index: auto !important;\n      font-family: inherit !important;\n      font-size: ${$scTheme.fonts.size.body};\n      color: ${$scTheme.colors.input.placeholder};\n      text-overflow: ellipsis;\n      max-width: 100%;\n      overflow: hidden;\n    }\n\n    .ace_marker {\n      border-bottom: 2px dashed;\n      position: absolute;\n      border-radius: 0;\n      margin-top: 1px;\n    }\n\n    .ace_marker.ace_validation_error {\n      border-color: ${$scTheme.colors.variant.danger};\n    }\n\n    .ace_marker.ace_validation_warning {\n      border-color: ${$scTheme.colors.variant.dark.warning};\n    }\n  }\n`);\n\nexport default StyledAceEditor;\n","/*\n * Copyright (C) 2020 Graylog, Inc.\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the Server Side Public License, version 1,\n * as published by MongoDB, Inc.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * Server Side Public License for more details.\n *\n * You should have received a copy of the Server Side Public License\n * along with this program. If not, see\n * .\n */\nimport * as React from 'react';\nimport { forwardRef, useMemo, useCallback } from 'react';\nimport PropTypes from 'prop-types';\nimport { useTheme } from 'styled-components';\n\nimport type { QueryValidationState } from 'views/components/searchbar/queryvalidation/types';\n\nimport StyledAceEditor from './StyledAceEditor';\nimport type { Editor } from './ace-types';\n\nexport type BaseProps = {\n  className?: string\n  error?: QueryValidationState,\n  height?: number,\n  maxLines?: number,\n  onLoad?: (editor: Editor) => void,\n  placeholder?: string,\n  value: string,\n  warning?: QueryValidationState,\n  wrapEnabled?: boolean,\n};\n\ntype EnabledInputProps = BaseProps & {\n  disabled: false,\n  enableAutocompletion?: boolean,\n  onBlur?: (query: string) => void,\n  onChange: (query: string) => Promise,\n  onExecute: (editor: Editor) => void,\n};\ntype DisabledInputProps = BaseProps & { disabled: true };\ntype Props = EnabledInputProps | DisabledInputProps\n\nconst isEnabledInput = (props: Props): props is EnabledInputProps => !props.disabled;\nconst isDisabledInput = (props: Props): props is DisabledInputProps => props.disabled;\n\nconst getMarkers = (errors: QueryValidationState | undefined, warnings: QueryValidationState | undefined) => {\n  const markerClassName = 'ace_marker';\n  const createMarkers = (explanations = [], className = '') => explanations.map(({\n    beginLine,\n    beginColumn,\n    endLine,\n    endColumn,\n  }) => ({\n    startRow: beginLine,\n    startCol: beginColumn,\n    endRow: endLine,\n    endCol: endColumn,\n    type: 'background',\n    className,\n  }));\n\n  return [\n    ...createMarkers(errors?.explanations, `${markerClassName} ace_validation_error`),\n    ...createMarkers(warnings?.explanations, `${markerClassName} ace_validation_warning`),\n  ];\n};\n\n// Basic query input component which is being implemented by the `QueryInput` component.\n// This is just a very basic query input which can be implemented for example to display a read only query.\nconst BasicQueryInput = forwardRef((props, ref) => {\n  const {\n    className,\n    disabled,\n    error,\n    height,\n    maxLines,\n    placeholder,\n    value,\n    warning,\n    wrapEnabled,\n    onLoad,\n  } = props;\n  const theme = useTheme();\n  const markers = useMemo(() => getMarkers(error, warning), [error, warning]);\n  const _onLoad = useCallback((editor) => {\n    if (editor) {\n      editor.renderer.setScrollMargin(6, 5);\n      editor.renderer.setPadding(12);\n      onLoad?.(editor);\n    }\n  }, [onLoad]);\n\n  const commonProps = {\n    $height: height,\n    aceTheme: 'ace-queryinput', // NOTE: is usually just `theme` but we need that prop for styled-components\n    className,\n    disabled,\n    editorProps: { $blockScrolling: Infinity, selectionStyle: 'line' },\n    fontSize: theme.fonts.size.large,\n    highlightActiveLine: false,\n    markers,\n    maxLines,\n    minLines: 1,\n    mode: 'lucene',\n    name: 'QueryEditor',\n    placeholder,\n    readOnly: disabled,\n    ref,\n    setOptions: { indentedSoftWrap: false },\n    showGutter: false,\n    showPrintMargin: false,\n    value,\n    wrapEnabled,\n    onLoad: _onLoad,\n  };\n\n  if (isDisabledInput(props)) {\n    return ;\n  }\n\n  if (isEnabledInput(props)) {\n    const {\n      onBlur,\n      onChange,\n      onExecute,\n      enableAutocompletion,\n    } = props;\n\n    return (\n      \n    );\n  }\n\n  return null;\n});\n\nBasicQueryInput.propTypes = {\n  className: PropTypes.string,\n  // @ts-ignore\n  disabled: PropTypes.bool,\n  enableAutocompletion: PropTypes.bool,\n  error: PropTypes.any,\n  height: PropTypes.number,\n  maxLines: PropTypes.number,\n  onBlur: PropTypes.func,\n  onChange: PropTypes.func,\n  onExecute: PropTypes.func,\n  onLoad: PropTypes.func,\n  placeholder: PropTypes.string,\n  value: PropTypes.string,\n  warning: PropTypes.any,\n  wrapEnabled: PropTypes.bool,\n};\n\nBasicQueryInput.defaultProps = {\n  className: '',\n  disabled: false,\n  enableAutocompletion: false,\n  error: undefined,\n  height: undefined,\n  maxLines: 4,\n  onBlur: undefined,\n  onChange: undefined,\n  onExecute: undefined,\n  onLoad: undefined,\n  placeholder: '',\n  value: '',\n  warning: undefined,\n  wrapEnabled: true,\n};\n\nexport default BasicQueryInput;\n","/*\n * Copyright (C) 2020 Graylog, Inc.\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the Server Side Public License, version 1,\n * as published by MongoDB, Inc.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * Server Side Public License for more details.\n *\n * You should have received a copy of the Server Side Public License\n * along with this program. If not, see\n * .\n */\nimport { sortBy, uniqBy } from 'lodash';\n\nimport type { TimeRange, NoTimeRangeOverride } from 'views/logic/queries/Query';\nimport type FieldTypeMapping from 'views/logic/fieldtypes/FieldTypeMapping';\n\nimport type {\n  Editor,\n  ResultsCallback,\n  Session,\n  Position,\n  CompletionResult,\n  AutoCompleter,\n  Token,\n  Line,\n} from './queryinput/ace-types';\n\nexport type FieldTypes = { all: FieldIndex, query: FieldIndex };\ntype FieldIndex = { [fieldName: string]: FieldTypeMapping };\n\nexport type CompleterContext = Readonly<{\n  currentToken: Token | undefined | null,\n  lastToken: Token | undefined | null,\n  prefix: string,\n  tokens: Array,\n  currentTokenIdx: number,\n  timeRange?: TimeRange | NoTimeRangeOverride,\n  streams?: Array\n  fieldTypes?: FieldTypes,\n}>;\n\nexport interface Completer {\n  getCompletions(context: CompleterContext): Array | Promise>;\n  shouldShowCompletions?: (currentLine: number, lines: Array>) => boolean;\n}\n\nconst onCompleterError = (error: Error) => {\n  // eslint-disable-next-line no-console\n  console.warn('Exception thrown in completer: ', error);\n};\n\nexport default class SearchBarAutoCompletions implements AutoCompleter {\n  private readonly completers: Array;\n\n  private readonly timeRange: TimeRange | NoTimeRangeOverride | undefined;\n\n  private readonly streams: Array;\n\n  private readonly fieldTypes: FieldTypes;\n\n  constructor(completers: Array, timeRange: TimeRange | NoTimeRangeOverride | undefined, streams: Array, fieldTypes: FieldTypes) {\n    this.completers = completers;\n    this.timeRange = timeRange;\n    this.streams = streams;\n    this.fieldTypes = fieldTypes;\n  }\n\n  getCompletions = async (editor: Editor, session: Session, pos: Position, prefix: string, callback: ResultsCallback) => {\n    const tokens = editor.session.getTokens(pos.row);\n    const currentToken = editor.session.getTokenAt(pos.row, pos.column);\n    const currentTokenIdx = tokens.findIndex((t) => (t === currentToken));\n\n    const lastToken: Token | undefined | null = currentTokenIdx > 0 ? tokens[currentTokenIdx - 1] : null;\n\n    const results = await Promise.all(\n      this.completers\n        .map(async (completer) => {\n          try {\n            return await completer.getCompletions({ currentToken, lastToken, prefix, tokens, currentTokenIdx, timeRange: this.timeRange, streams: this.streams, fieldTypes: this.fieldTypes });\n          } catch (e) {\n            onCompleterError(e);\n          }\n\n          return [];\n        }),\n    );\n    const uniqResults = uniqBy(sortBy(results.flat(), ['score', 'name']), 'name');\n\n    callback(null, uniqResults);\n  };\n\n  shouldShowCompletions = (currentLine: number, lines: Array>) => {\n    return this.completers.some((completer) => {\n      if (typeof completer.shouldShowCompletions === 'function') {\n        try {\n          return completer.shouldShowCompletions(currentLine, lines);\n        } catch (e) {\n          onCompleterError(e);\n        }\n      }\n\n      return false;\n    });\n  };\n}\n","/*\n * Copyright (C) 2020 Graylog, Inc.\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the Server Side Public License, version 1,\n * as published by MongoDB, Inc.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * Server Side Public License for more details.\n *\n * You should have received a copy of the Server Side Public License\n * along with this program. If not, see\n * .\n */\nimport * as React from 'react';\nimport { useCallback, useMemo, useContext, useRef } from 'react';\nimport PropTypes from 'prop-types';\nimport { isEmpty } from 'lodash';\nimport type { FormikErrors } from 'formik';\n\nimport UserPreferencesContext from 'contexts/UserPreferencesContext';\nimport type { TimeRange, NoTimeRangeOverride } from 'views/logic/queries/Query';\nimport QueryValidationActions from 'views/actions/QueryValidationActions';\nimport type { QueryValidationState } from 'views/components/searchbar/queryvalidation/types';\nimport useFieldTypes from 'views/logic/fieldtypes/useFieldTypes';\nimport { DEFAULT_TIMERANGE } from 'views/Constants';\nimport { isNoTimeRangeOverride } from 'views/typeGuards/timeRange';\nimport usePluginEntities from 'views/logic/usePluginEntities';\n\nimport type { AutoCompleter, Editor } from './ace-types';\nimport type { BaseProps } from './BasicQueryInput';\nimport BaseQueryInput from './BasicQueryInput';\n\nimport SearchBarAutoCompletions from '../SearchBarAutocompletions';\nimport type { Completer, FieldTypes } from '../SearchBarAutocompletions';\n\nconst defaultCompleterFactory = (...args: ConstructorParameters) => new SearchBarAutoCompletions(...args);\n\nconst displayValidationErrors = () => {\n  QueryValidationActions.displayValidationErrors();\n};\n\nconst handleExecution = ({\n  editor,\n  onExecute,\n  value,\n  error,\n  disableExecution,\n  isValidating,\n  validate,\n}: {\n  editor: Editor,\n  onExecute: (query: string) => void,\n  value: string,\n  error: QueryValidationState | undefined,\n  disableExecution: boolean,\n  isValidating: boolean,\n  validate: () => Promise>,\n}) => {\n  const execute = () => {\n    if (editor?.completer && editor.completer.popup) {\n      editor.completer.popup.hide();\n    }\n\n    onExecute(value);\n  };\n\n  if (isValidating) {\n    validate().then((errors) => {\n      if (isEmpty(errors)) {\n        execute();\n      } else {\n        displayValidationErrors();\n      }\n    });\n\n    return;\n  }\n\n  if (error) {\n    displayValidationErrors();\n  }\n\n  if (disableExecution || error) {\n    return;\n  }\n\n  execute();\n};\n\n// This function takes care of all editor configuration options, which do not rely on external data.\n// It will only run once, on mount, which is important for e.g. the event listeners.\nconst _onLoadEditor = (editor, isInitialTokenizerUpdate: React.MutableRefObject) => {\n  if (editor) {\n    editor.commands.removeCommands(['find', 'indent', 'outdent']);\n\n    editor.session.on('tokenizerUpdate', (input, { bgTokenizer: { currentLine, lines } }) => {\n      if (!isInitialTokenizerUpdate.current) {\n        editor.completers.forEach((completer) => {\n          if (completer?.shouldShowCompletions(currentLine, lines)) {\n            editor.execCommand('startAutocomplete');\n          }\n        });\n      }\n\n      if (isInitialTokenizerUpdate.current) {\n        // eslint-disable-next-line no-param-reassign\n        isInitialTokenizerUpdate.current = false;\n      }\n    });\n\n    editor.renderer.setScrollMargin(6, 5);\n    editor.renderer.setPadding(12);\n  }\n};\n\n// This function takes care of updating the editor config on every render.\n// This is necessary for configuration options which rely on external data.\n// Unfortunately it is not possible to configure for example the command once\n// with the `onLoad` or `commands` prop, because the reference for the related function will be outdated.\nconst _updateEditorConfiguration = (node, completer, onExecute) => {\n  const editor = node && node.editor;\n\n  if (editor) {\n    editor.commands.addCommand({\n      name: 'Execute',\n      bindKey: { win: 'Enter', mac: 'Enter' },\n      exec: onExecute,\n    });\n\n    editor.completers = [completer];\n  }\n};\n\nconst useCompleter = ({ streams, timeRange, completerFactory }: Pick) => {\n  const completers = usePluginEntities('views.completers') ?? [];\n  const { data: queryFields } = useFieldTypes(streams, isNoTimeRangeOverride(timeRange) ? DEFAULT_TIMERANGE : timeRange);\n  const { data: allFields } = useFieldTypes([], DEFAULT_TIMERANGE);\n  const fieldTypes = useMemo(() => {\n    const queryFieldsByName = Object.fromEntries((queryFields ?? []).map((field) => [field.name, field]));\n    const allFieldsByName = Object.fromEntries((allFields ?? []).map((field) => [field.name, field]));\n\n    return { all: allFieldsByName, query: queryFieldsByName };\n  }, [allFields, queryFields]);\n\n  // eslint-disable-next-line react-hooks/exhaustive-deps\n  return useMemo(() => completerFactory(completers, timeRange, streams, fieldTypes), [completerFactory, timeRange, streams, fieldTypes]);\n};\n\ntype Props = BaseProps & {\n  completerFactory?: (\n    completers: Array,\n    timeRange: TimeRange | NoTimeRangeOverride | undefined,\n    streams: Array,\n    fieldTypes: FieldTypes,\n  ) => AutoCompleter,\n  disableExecution?: boolean,\n  isValidating?: boolean,\n  onBlur?: (query: string) => void,\n  onChange: (query: string) => Promise,\n  onExecute: (query: string) => void,\n  streams?: Array | undefined,\n  timeRange?: TimeRange | NoTimeRangeOverride | undefined,\n  validate: () => Promise>,\n};\n\nconst QueryInput = ({\n  className,\n  completerFactory = defaultCompleterFactory,\n  disableExecution,\n  error,\n  height,\n  isValidating,\n  maxLines,\n  onBlur,\n  onChange,\n  onExecute: onExecuteProp,\n  placeholder,\n  streams,\n  timeRange,\n  value,\n  validate,\n  warning,\n  wrapEnabled,\n}: Props) => {\n  const isInitialTokenizerUpdate = useRef(true);\n  const { enableSmartSearch } = useContext(UserPreferencesContext);\n  const completer = useCompleter({ streams, timeRange, completerFactory });\n  const onLoadEditor = useCallback((editor: Editor) => _onLoadEditor(editor, isInitialTokenizerUpdate), []);\n  const onExecute = useCallback((editor: Editor) => handleExecution({\n    editor,\n    onExecute: onExecuteProp,\n    value,\n    error,\n    disableExecution,\n    isValidating,\n    validate,\n  }), [onExecuteProp, value, error, disableExecution, isValidating, validate]);\n  const updateEditorConfiguration = useCallback((node) => _updateEditorConfiguration(node, completer, onExecute), [onExecute, completer]);\n\n  return (\n    \n  );\n};\n\nQueryInput.propTypes = {\n  className: PropTypes.string,\n  completerFactory: PropTypes.func,\n  disableExecution: PropTypes.bool,\n  error: PropTypes.any,\n  height: PropTypes.number,\n  isValidating: PropTypes.bool.isRequired,\n  maxLines: PropTypes.number,\n  onBlur: PropTypes.func,\n  onChange: PropTypes.func.isRequired,\n  onExecute: PropTypes.func.isRequired,\n  placeholder: PropTypes.string,\n  streams: PropTypes.array,\n  timeRange: PropTypes.object,\n  value: PropTypes.string,\n  warning: PropTypes.any,\n  wrapEnabled: PropTypes.bool,\n  validate: PropTypes.func.isRequired,\n};\n\nQueryInput.defaultProps = {\n  className: '',\n  completerFactory: defaultCompleterFactory,\n  disableExecution: false,\n  error: undefined,\n  height: undefined,\n  maxLines: undefined,\n  onBlur: undefined,\n  placeholder: '',\n  streams: undefined,\n  timeRange: undefined,\n  value: '',\n  warning: undefined,\n  wrapEnabled: undefined,\n};\n\nexport default QueryInput;\n","/*\n * Copyright (C) 2020 Graylog, Inc.\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the Server Side Public License, version 1,\n * as published by MongoDB, Inc.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * Server Side Public License for more details.\n *\n * You should have received a copy of the Server Side Public License\n * along with this program. If not, see\n * .\n */\n// eslint-disable-next-line no-undef\nace.define('ace/theme/ace-queryinput', ['require', 'exports', 'module', 'ace/lib/dom'], (acequire, exports) => {\n  /* eslint-disable no-param-reassign */\n  exports.isDark = false;\n\n  exports.cssClass = 'ace-queryinput';\n  /* eslint-enable no-param-reassign */\n\n  const dom = acequire('../lib/dom');\n\n  dom.importCssString(exports.cssText, exports.cssClass);\n});\n"],"names":["AceEditor","styled","attrs","theme","aceTheme","$scTheme","$height","disabled","value","css","colors","input","background","utils","contrastingColor","variant","light","gray","lightest","warning","primary","darker","info","dark","danger","readableColor","brand","success","fonts","size","body","placeholder","BasicQueryInput","forwardRef","props","ref","className","error","height","maxLines","wrapEnabled","onLoad","useTheme","markers","useMemo","warnings","markerClassName","createMarkers","map","startRow","beginLine","startCol","beginColumn","endRow","endLine","endCol","endColumn","type","errors","explanations","_onLoad","useCallback","editor","renderer","setScrollMargin","setPadding","commonProps","editorProps","$blockScrolling","Infinity","selectionStyle","fontSize","large","highlightActiveLine","minLines","mode","name","readOnly","setOptions","indentedSoftWrap","showGutter","showPrintMargin","isDisabledInput","isEnabledInput","onBlur","onChange","onExecute","enableAutocompletion","enableBasicAutocompletion","enableLiveAutocompletion","propTypes","PropTypes","defaultProps","undefined","onCompleterError","console","warn","SearchBarAutoCompletions","completers","timeRange","streams","fieldTypes","session","pos","prefix","callback","tokens","getTokens","row","currentToken","getTokenAt","column","currentTokenIdx","findIndex","t","lastToken","Promise","all","completer","getCompletions","this","results","uniqResults","uniqBy","sortBy","flat","currentLine","lines","some","shouldShowCompletions","e","defaultCompleterFactory","args","displayValidationErrors","QueryValidationActions","QueryInput","completerFactory","disableExecution","isValidating","onExecuteProp","validate","isInitialTokenizerUpdate","useRef","enableSmartSearch","useContext","UserPreferencesContext","usePluginEntities","queryFields","useFieldTypes","isNoTimeRangeOverride","DEFAULT_TIMERANGE","data","allFields","queryFieldsByName","Object","fromEntries","field","query","useCompleter","onLoadEditor","commands","removeCommands","on","bgTokenizer","current","forEach","execCommand","_onLoadEditor","execute","popup","hide","then","isEmpty","handleExecution","updateEditorConfiguration","node","addCommand","bindKey","win","mac","exec","_updateEditorConfiguration","ace","define","acequire","exports","isDark","cssClass","importCssString","cssText"],"sourceRoot":""}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy