ydb-embedded-ui 8.2.1 → 8.3.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -50,11 +50,11 @@
50
50
  height: var(--ydb-table-cell-height) !important;
51
51
  padding: 0;
52
52
  @include mixins.text-body-2();
53
- :is(&_align_right) {
54
- text-align: right;
53
+ &_align_right {
54
+ text-align: right !important;
55
55
  }
56
- :is(&_vertical-align_top) {
57
- vertical-align: top;
56
+ &_vertical-align_top {
57
+ vertical-align: top !important;
58
58
  }
59
59
  }
60
60
  }
@@ -4,8 +4,4 @@ interface TruncatedQueryProps {
4
4
  maxQueryHeight?: number;
5
5
  }
6
6
  export declare const TruncatedQuery: ({ value, maxQueryHeight }: TruncatedQueryProps) => import("react/jsx-runtime").JSX.Element;
7
- interface OneLineQueryWithPopoverProps {
8
- value?: string;
9
- }
10
- export declare const OneLineQueryWithPopover: ({ value }: OneLineQueryWithPopoverProps) => import("react/jsx-runtime").JSX.Element;
11
7
  export {};
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import React from 'react';
3
3
  import { cn } from '../../utils/cn';
4
- import { CellWithPopover } from '../CellWithPopover/CellWithPopover';
4
+ import { YqlHighlighter } from '../YqlHighlighter/YqlHighlighter';
5
5
  import './TruncatedQuery.scss';
6
6
  const b = cn('kv-truncated-query');
7
7
  export const TruncatedQuery = ({ value = '', maxQueryHeight = 6 }) => {
@@ -10,11 +10,8 @@ export const TruncatedQuery = ({ value = '', maxQueryHeight = 6 }) => {
10
10
  if (truncated) {
11
11
  const content = lines.slice(0, maxQueryHeight).join('\n');
12
12
  const message = '\n...\nThe request was truncated. Click on the line to show the full query on the query tab';
13
- return (_jsxs(React.Fragment, { children: [_jsx("span", { className: b(), children: content }), _jsx("span", { className: b('message', { color: 'secondary' }), children: message })] }));
13
+ return (_jsxs(React.Fragment, { children: [_jsx(YqlHighlighter, { className: b(), children: content }), _jsx("span", { className: b('message', { color: 'secondary' }), children: message })] }));
14
14
  }
15
- return _jsx(React.Fragment, { children: value });
16
- };
17
- export const OneLineQueryWithPopover = ({ value = '' }) => {
18
- return (_jsx(CellWithPopover, { contentClassName: b('popover-content'), content: value, children: value }));
15
+ return _jsx(YqlHighlighter, { children: value });
19
16
  };
20
17
  //# sourceMappingURL=TruncatedQuery.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TruncatedQuery.js","sourceRoot":"","sources":["../../../src/components/TruncatedQuery/TruncatedQuery.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAC,EAAE,EAAC,MAAM,gBAAgB,CAAC;AAClC,OAAO,EAAC,eAAe,EAAC,MAAM,oCAAoC,CAAC;AAEnE,OAAO,uBAAuB,CAAC;AAE/B,MAAM,CAAC,GAAG,EAAE,CAAC,oBAAoB,CAAC,CAAC;AAOnC,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,EAAC,KAAK,GAAG,EAAE,EAAE,cAAc,GAAG,CAAC,EAAsB,EAAE,EAAE;IACpF,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAChC,MAAM,SAAS,GAAG,KAAK,CAAC,MAAM,GAAG,cAAc,CAAC;IAEhD,IAAI,SAAS,EAAE,CAAC;QACZ,MAAM,OAAO,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,cAAc,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC1D,MAAM,OAAO,GACT,6FAA6F,CAAC;QAClG,OAAO,CACH,MAAC,KAAK,CAAC,QAAQ,eACX,eAAM,SAAS,EAAE,CAAC,EAAE,YAAG,OAAO,GAAQ,EACtC,eAAM,SAAS,EAAE,CAAC,CAAC,SAAS,EAAE,EAAC,KAAK,EAAE,WAAW,EAAC,CAAC,YAAG,OAAO,GAAQ,IACxD,CACpB,CAAC;IACN,CAAC;IACD,OAAO,KAAC,KAAK,CAAC,QAAQ,cAAE,KAAK,GAAkB,CAAC;AACpD,C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O,KAAC,cAAc,cAAE,KAAK,GAAkB,CAAC;AACpD,CAAC,CAAC"}
@@ -14,12 +14,4 @@
14
14
  }
15
15
  }
16
16
  }
17
-
18
- &__popover-content {
19
- overflow: hidden;
20
-
21
- max-width: 600px;
22
-
23
- white-space: pre;
24
- }
25
17
  }
@@ -0,0 +1,6 @@
1
+ interface YqlHighlighterProps {
2
+ children: string;
3
+ className?: string;
4
+ }
5
+ export declare const YqlHighlighter: ({ children, className }: YqlHighlighterProps) => import("react/jsx-runtime").JSX.Element;
6
+ export {};
@@ -0,0 +1,13 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useThemeValue } from '@gravity-ui/uikit';
3
+ import { PrismLight as SyntaxHighlighter } from 'react-syntax-highlighter';
4
+ import { cn } from '../../utils/cn';
5
+ import { dark, light, yql } from './yql';
6
+ SyntaxHighlighter.registerLanguage('yql', yql);
7
+ const b = cn('yql-highlighter');
8
+ export const YqlHighlighter = ({ children, className }) => {
9
+ const themeValue = useThemeValue();
10
+ const isDark = themeValue === 'dark' || themeValue === 'dark-hc';
11
+ return (_jsx("div", { className: b(null, className), children: _jsx(SyntaxHighlighter, { language: "yql", style: isDark ? dark : light, children: children }) }));
12
+ };
13
+ //# sourceMappingURL=YqlHighlighter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"YqlHighlighter.js","sourceRoot":"","sources":["../../../src/components/YqlHighlighter/YqlHighlighter.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAC,UAAU,IAAI,iBAAiB,EAAC,MAAM,0BAA0B,CAAC;AAEzE,OAAO,EAAC,EAAE,EAAC,MAAM,gBAAgB,CAAC;AAElC,OAAO,EAAC,IAAI,EAAE,KAAK,EAAE,GAAG,EAAC,MAAM,OAAO,CAAC;AAEvC,iBAAiB,CAAC,gBAAgB,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;AAE/C,MAAM,CAAC,GAAG,EAAE,CAAC,iBAAiB,CAAC,CAAC;AAOhC,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,EAAC,QAAQ,EAAE,SAAS,EAAsB,EAAE,EAAE;IACzE,MAAM,UAAU,GAAG,aAAa,EAAE,CAAC;IACnC,MAAM,MAAM,GAAG,UAAU,KAAK,MAAM,IAAI,UAAU,KAAK,SAAS,CAAC;IAEjE,OAAO,CACH,cAAK,SAAS,EAAE,CAAC,CAAC,IAAI,EAAE,SAAS,CAAC,YAC9B,KAAC,iBAAiB,IAAC,QAAQ,EAAC,KAAK,EAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,YACzD,QAAQ,GACO,GAClB,CACT,CAAC;AACN,CAAC,CAAC"}