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

web-interface.assets.57e33c6c-77.11b9f72925818240e61d.js.map Maven / Gradle / Ivy

There is a newer version: 6.0.2
Show newest version
{"version":3,"sources":["webpack:///./src/views/components/searchbar/queryinput/ace.ts","webpack:///./src/views/components/searchbar/queryinput/StyledAceEditor.jsx","webpack:///./src/views/components/searchbar/SearchBarAutocompletions.ts","webpack:///./src/views/components/searchbar/QueryInput.tsx","webpack:///./src/views/components/searchbar/queryinput/ace-queryinput.js"],"names":["AceEditor","StyledAceEditor","styled","attrs","theme","aceTheme","$scTheme","$height","disabled","css","colors","input","background","utils","contrastingColor","gray","variant","lightest","warning","primary","darker","info","dark","danger","readableColor","brand","success","SearchBarAutoCompletions","completers","editor","session","pos","prefix","callback","completer","autoSelect","tokens","getTokens","row","currentToken","getTokenAt","column","currentTokenIdx","findIndex","t","lastToken","results","map","getCompletions","e","console","warn","reduce","acc","cur","uniqBy","sortBy","this","defaultCompleterFactory","QueryInput","className","completerFactory","height","onBlur","onChange","onExecute","placeholder","value","useMemo","_onExecute","useCallback","popup","hide","editorRef","node","commands","addCommand","name","bindKey","win","mac","exec","removeCommands","style","display","data-testid","UserPreferencesContext","Consumer","enableSmartSearch","mode","ref","readOnly","showGutter","showPrintMargin","highlightActiveLine","minLines","maxLines","enableBasicAutocompletion","enableLiveAutocompletion","editorProps","$blockScrolling","Infinity","selectionStyle","fontSize","fonts","size","large","propTypes","PropTypes","string","func","array","bool","number","isRequired","themePropTypes","defaultProps","undefined","withPluginEntities","withTheme","ace","define","acequire","exports","isDark","cssClass","importCssString","cssText"],"mappings":"wPAuBeA,G,wDAAAA,EAAf,GC+IeC,EAlJSC,kBAAOF,GAAWG,OAAM,kBAA0B,CAExEC,MAF8C,EAAGC,SAGjDC,SAH8C,EAAaF,UAAxC,sEAAGF,EAIpB,gBAAGI,EAAH,EAAGA,SAAH,IAAaC,eAAb,MAAuB,GAAvB,EAA2BC,EAA3B,EAA2BA,SAA3B,OAA0CC,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,UAAS,gBAAWA,GAAauB,MAAO,CAAEC,QAAS,QAAUC,cAAY,eAC5E,gBAACC,EAAA,EAAuBC,SAAxB,MACG,oBAAGC,yBAAH,gBACC,gBAAC,EAAD,CAAiBC,KAAK,SACLjF,SAAUA,EACVH,SAAS,iBACTqF,IAAKjB,EACLkB,SAAUnF,EACVuD,OAAQA,EACRC,SAAUA,EACVG,MAAOA,EACPU,KAAK,cACLe,YAAY,EACZC,iBAAiB,EACjBC,qBAAqB,EACrBC,SAAU,EACVC,SAAU,EACVC,0BAA2BT,EAC3BU,yBAA0BV,EAC1BW,YAAa,CACXC,gBAAiBC,IACjBC,eAAgB,QAElBC,SAAUnG,EAAMoG,MAAMC,KAAKC,MAC3BxC,YAAaA,EACb3D,QAASuD,SAOpCH,EAAWgD,UAAY,CACrB/C,UAAWgD,IAAUC,OACrBhD,iBAAkB+C,IAAUE,KAC5BlF,WAAYgF,IAAUG,MACtBvG,SAAUoG,IAAUI,KACpBlD,OAAQ8C,IAAUK,OAClBlD,OAAQ6C,IAAUE,KAClB9C,SAAU4C,IAAUE,KAAKI,WACzBjD,UAAW2C,IAAUE,KAAKI,WAC1BhD,YAAa0C,IAAUC,OACvBzG,MAAO+G,IAAeD,WACtB/C,MAAOyC,IAAUC,QAGnBlD,EAAWyD,aAAe,CACxBxD,UAAW,GACXC,iBAAkBH,EAClB9B,WAAY,GACZpB,UAAU,EACVsD,YAAQuD,EACRtD,OAAQ,aACRG,YAAa,GACbC,MAAO,IAGMmD,sBAAmBC,oBAAU5D,GAAa,CAAE/B,WAAY,sB,+BC5HvE4F,IAAIC,OAAO,2BAA4B,CAAC,UAAW,UAAW,SAAU,gBAAgB,SAACC,EAAUC,SAEjGA,QAAQC,QAAS,EAEjBD,QAAQE,SAAW,iBAGPH,EAAS,cAEjBI,gBAAgBH,QAAQI,QAASJ,QAAQE","file":"57e33c6c-77.11b9f72925818240e61d.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 }) => ({\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}))(({ $scTheme, $height = 34, disabled }) => css`\n  &.ace-queryinput {\n    height: ${$height}px !important;\n    width: 100% !important;\n    background-color: ${$scTheme.colors.input.background};\n    color: ${$scTheme.utils.contrastingColor($scTheme.colors.input.background, 'AAA')};\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_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_content,\n    .ace_placeholder {\n      top: 6px;\n      padding: 0 !important;\n    }\n\n    .ace_placeholder {\n      font-family: inherit !important;\n      z-index: auto !important;\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 { sortBy, uniqBy } from 'lodash';\n\nimport type { Editor, ResultsCallback, Session, Position, CompletionResult, AutoCompleter, Token } from './ace-types';\n\nexport interface Completer {\n  getCompletions(currentToken: Token | undefined | null, lastToken: Token | undefined | null, prefix: string, tokens: Array, currentTokenIdx: number): Array;\n}\n\nexport default class SearchBarAutoCompletions implements AutoCompleter {\n  completers: Array;\n\n  constructor(completers: Array = []) {\n    this.completers = completers;\n  }\n\n  getCompletions = (editor: Editor, session: Session, pos: Position, prefix: string, callback: ResultsCallback) => {\n    // eslint-disable-next-line no-param-reassign\n    editor.completer.autoSelect = false;\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 = this.completers\n      .map((completer) => {\n        try {\n          return completer.getCompletions(currentToken, lastToken, prefix, tokens, currentTokenIdx);\n        } catch (e) {\n          // eslint-disable-next-line no-console\n          console.warn('Exception thrown in completer: ', e);\n        }\n\n        return [];\n      })\n      .reduce((acc, cur) => [...acc, ...cur], []);\n\n    const uniqResults = uniqBy(sortBy(results, ['score', 'name']), 'name');\n\n    callback(null, uniqResults);\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 } from 'react';\nimport { withTheme, DefaultTheme } from 'styled-components';\nimport PropTypes from 'prop-types';\n\nimport { themePropTypes } from 'theme';\nimport withPluginEntities from 'views/logic/withPluginEntities';\nimport UserPreferencesContext from 'contexts/UserPreferencesContext';\n\nimport type { AutoCompleter, Editor } from './ace-types';\nimport StyledAceEditor from './queryinput/StyledAceEditor';\nimport SearchBarAutoCompletions from './SearchBarAutocompletions';\nimport type { Completer } from './SearchBarAutocompletions';\n\ntype Props = {\n  className?: string\n  completerFactory: (completers: Array) => AutoCompleter,\n  completers: Array,\n  disabled?: boolean,\n  height?: number,\n  onBlur?: (query: string) => void,\n  onChange: (query: string) => Promise,\n  onExecute: (query: string) => void,\n  placeholder?: string,\n  theme: DefaultTheme,\n  value: string,\n};\n\nconst defaultCompleterFactory = (completers) => new SearchBarAutoCompletions(completers);\n\nconst QueryInput = ({\n  className,\n  completerFactory = defaultCompleterFactory,\n  completers,\n  disabled,\n  height,\n  onBlur,\n  onChange,\n  onExecute,\n  placeholder,\n  theme,\n  value,\n}: Props) => {\n  const completer = useMemo(() => completerFactory(completers), [completerFactory, completers]);\n  const _onExecute = useCallback((editor: Editor) => {\n    if (editor.completer && editor.completer.popup) {\n      editor.completer.popup.hide();\n    }\n\n    onExecute(value);\n  }, [onExecute, value]);\n\n  const editorRef = useCallback((node) => {\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.commands.removeCommands(['indent', 'outdent']);\n      editor.completers = [completer];\n    }\n  }, [completer, _onExecute]);\n\n  return (\n    
\n \n {({ enableSmartSearch = true }) => (\n \n )}\n \n
\n );\n};\n\nQueryInput.propTypes = {\n className: PropTypes.string,\n completerFactory: PropTypes.func,\n completers: PropTypes.array,\n disabled: PropTypes.bool,\n height: PropTypes.number,\n onBlur: PropTypes.func,\n onChange: PropTypes.func.isRequired,\n onExecute: PropTypes.func.isRequired,\n placeholder: PropTypes.string,\n theme: themePropTypes.isRequired,\n value: PropTypes.string,\n};\n\nQueryInput.defaultProps = {\n className: '',\n completerFactory: defaultCompleterFactory,\n completers: [],\n disabled: false,\n height: undefined,\n onBlur: () => {},\n placeholder: '',\n value: '',\n};\n\nexport default withPluginEntities(withTheme(QueryInput), { completers: 'views.completers' });\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"],"sourceRoot":""}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy