@oceanbase/ui 0.2.19 → 0.2.21

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.
Files changed (100) hide show
  1. package/dist/ui.min.js +1 -1
  2. package/es/Action/Group.d.ts +1 -1
  3. package/es/Action/Group.js +50 -41
  4. package/es/Action/Item.d.ts +2 -2
  5. package/es/Action/Item.js +32 -26
  6. package/es/Action/index.d.ts +1 -2
  7. package/es/BackgroundTaskManager/RefreshMan.js +8 -3
  8. package/es/BackgroundTaskManager/index.js +8 -4
  9. package/es/BasicLayout/Header.js +193 -140
  10. package/es/BasicLayout/index.js +149 -108
  11. package/es/BatchOperationBar/index.js +46 -29
  12. package/es/Boundary/Components/Code.js +17 -10
  13. package/es/Boundary/Components/Exception.js +46 -31
  14. package/es/Boundary/Components/Function.js +17 -10
  15. package/es/ContentWithIcon/index.js +42 -26
  16. package/es/ContentWithIcon/index.less +0 -1
  17. package/es/Dialog/Anchor.d.ts +1 -1
  18. package/es/Dialog/Anchor.js +9 -6
  19. package/es/Dialog/EventProxy.d.ts +1 -1
  20. package/es/Dialog/EventProxy.js +3 -2
  21. package/es/Dialog/index.js +129 -108
  22. package/es/Dialog/index.less +3 -1
  23. package/es/DocDialog/index.d.ts +1 -1
  24. package/es/DocDialog/index.js +8 -3
  25. package/es/FullscreenBox/index.d.ts +1 -1
  26. package/es/FullscreenBox/index.js +22 -16
  27. package/es/GraphToolbar/index.js +79 -65
  28. package/es/Highlight/DiffView/DiffCells.d.ts +2 -2
  29. package/es/Highlight/DiffView/DiffCells.js +22 -15
  30. package/es/Highlight/DiffView/index.js +49 -40
  31. package/es/Highlight/HighlightCell.d.ts +1 -1
  32. package/es/Highlight/HighlightCell.js +19 -13
  33. package/es/Highlight/JsonView.d.ts +1 -2
  34. package/es/Highlight/JsonView.js +15 -13
  35. package/es/Highlight/index.d.ts +1 -1
  36. package/es/Highlight/index.js +66 -54
  37. package/es/IconFont/index.d.ts +1 -1
  38. package/es/IconFont/index.js +9 -3
  39. package/es/LocaleDropdown/index.js +38 -26
  40. package/es/Login/ActivateForm.js +63 -50
  41. package/es/Login/LoginForm.js +115 -99
  42. package/es/Login/RegisterForm.js +78 -67
  43. package/es/Login/index.js +122 -91
  44. package/es/Lottie/index.js +2 -1
  45. package/es/NavMenu/index.d.ts +2 -2
  46. package/es/NavMenu/index.js +34 -29
  47. package/es/PageContainer/ItemRender.d.ts +1 -2
  48. package/es/PageContainer/ItemRender.js +7 -3
  49. package/es/PageContainer/index.js +13 -10
  50. package/es/Password/Content.js +55 -47
  51. package/es/Password/index.js +62 -45
  52. package/es/Ranger/QuickPicker.d.ts +1 -2
  53. package/es/Ranger/QuickPicker.js +42 -31
  54. package/es/Ranger/Ranger.js +31 -27
  55. package/es/SideTip/Dragger.d.ts +1 -1
  56. package/es/SideTip/Dragger.js +5 -3
  57. package/es/SideTip/IconLoading.d.ts +1 -2
  58. package/es/SideTip/IconLoading.js +28 -20
  59. package/es/SideTip/index.js +43 -30
  60. package/es/SideTip/index.less +4 -1
  61. package/es/TagSelect/Group.d.ts +1 -1
  62. package/es/TagSelect/Group.js +16 -11
  63. package/es/TagSelect/Item.d.ts +1 -1
  64. package/es/TagSelect/Item.js +30 -23
  65. package/es/TagSelect/style/index.d.ts +1 -1
  66. package/es/TaskGraph/Graph.js +39 -31
  67. package/es/TaskGraph/index.js +68 -57
  68. package/es/TreeSearch/index.js +36 -32
  69. package/es/Welcome/index.js +113 -83
  70. package/es/Welcome/step.js +31 -23
  71. package/es/locale/LocaleWrapper.js +3 -3
  72. package/lib/Action/Group.d.ts +1 -1
  73. package/lib/Action/Item.d.ts +2 -2
  74. package/lib/Action/index.d.ts +1 -2
  75. package/lib/ContentWithIcon/index.less +0 -1
  76. package/lib/Dialog/Anchor.d.ts +1 -1
  77. package/lib/Dialog/EventProxy.d.ts +1 -1
  78. package/lib/Dialog/EventProxy.js +12 -2
  79. package/lib/Dialog/index.less +3 -1
  80. package/lib/DocDialog/index.d.ts +1 -1
  81. package/lib/FullscreenBox/index.d.ts +1 -1
  82. package/lib/FullscreenBox/index.js +76 -74
  83. package/lib/Highlight/DiffView/DiffCells.d.ts +2 -2
  84. package/lib/Highlight/DiffView/index.js +1 -1
  85. package/lib/Highlight/HighlightCell.d.ts +1 -1
  86. package/lib/Highlight/JsonView.d.ts +1 -2
  87. package/lib/Highlight/JsonView.js +3 -3
  88. package/lib/Highlight/index.d.ts +1 -1
  89. package/lib/IconFont/index.d.ts +1 -1
  90. package/lib/NavMenu/index.d.ts +2 -2
  91. package/lib/PageContainer/ItemRender.d.ts +1 -2
  92. package/lib/Ranger/QuickPicker.d.ts +1 -2
  93. package/lib/SideTip/Dragger.d.ts +1 -1
  94. package/lib/SideTip/IconLoading.d.ts +1 -2
  95. package/lib/SideTip/index.less +4 -1
  96. package/lib/TagSelect/Group.d.ts +1 -1
  97. package/lib/TagSelect/Group.js +4 -6
  98. package/lib/TagSelect/Item.d.ts +1 -1
  99. package/lib/TagSelect/style/index.d.ts +1 -1
  100. package/package.json +10 -9
@@ -17,6 +17,8 @@ import fitViewIcon from "../assets/graph_fit_view_icon.svg";
17
17
  // @ts-ignore
18
18
  import resetIcon from "../assets/graph_reset_icon.svg";
19
19
  import "./index.less";
20
+ import { jsx as _jsx } from "react/jsx-runtime";
21
+ import { jsxs as _jsxs } from "react/jsx-runtime";
20
22
  export function getCenterPointByGraph(graph) {
21
23
  var group = graph === null || graph === void 0 ? void 0 : graph.get('group');
22
24
  if (group) {
@@ -59,72 +61,84 @@ var GraphToolbar = function GraphToolbar(_ref) {
59
61
  setZoom(graph === null || graph === void 0 ? void 0 : graph.getZoom());
60
62
  }, 16));
61
63
  }, [graph]);
62
- return /*#__PURE__*/React.createElement(Space, {
64
+ return /*#__PURE__*/_jsxs(Space, {
63
65
  size: 16,
64
- className: "".concat(prefix, " ", "".concat(prefix, "-").concat(mode), " ").concat(className)
65
- }, showFullscreen && /*#__PURE__*/React.createElement(Tooltip, {
66
- title: locale.fullscreen
67
- }, /*#__PURE__*/React.createElement(FullscreenOutlined, {
68
- className: "pointable",
69
- onClick: function onClick() {
70
- if (onFullscreen) {
71
- onFullscreen();
72
- }
73
- }
74
- })), /*#__PURE__*/React.createElement("span", {
75
- className: "".concat(prefix, "-zoom-wrapper")
76
- }, /*#__PURE__*/React.createElement(Tooltip, {
77
- title: locale.shrink
78
- }, /*#__PURE__*/React.createElement(MinusOutlined, {
79
- className: zoom >= 0.3 ? "".concat(prefix, "-pointable") : "".concat(prefix, "-disabled"),
80
- onClick: function onClick() {
81
- if (zoom >= 0.3) {
82
- var newZoom = zoom - 0.1;
83
- setZoom(newZoom);
84
- graph === null || graph === void 0 ? void 0 : graph.zoomTo(newZoom, getCenterPointByGraph(graph));
85
- }
86
- }
87
- })), toPercent(zoom), /*#__PURE__*/React.createElement(Tooltip, {
88
- title: locale.enlarge
89
- }, /*#__PURE__*/React.createElement(PlusOutlined, {
90
- className: zoom <= 0.9 ? "".concat(prefix, "-pointable") : "".concat(prefix, "-disabled"),
91
- onClick: function onClick() {
92
- if (zoom <= 0.9) {
93
- var newZoom = zoom + 0.1;
94
- setZoom(newZoom);
95
- graph === null || graph === void 0 ? void 0 : graph.zoomTo(newZoom, getCenterPointByGraph(graph));
96
- }
97
- }
98
- }))), /*#__PURE__*/React.createElement(Tooltip, {
99
- title: locale.reset
100
- }, /*#__PURE__*/React.createElement("img", {
101
- src: resetIcon,
102
- alt: "",
103
- className: "".concat(prefix, "-pointable"),
104
- onClick: function onClick() {
105
- setZoom(1);
106
- graph === null || graph === void 0 ? void 0 : graph.zoomTo(1, getCenterPointByGraph(graph));
107
- }
108
- })), /*#__PURE__*/React.createElement(Tooltip, {
109
- title: locale.fitView
110
- }, /*#__PURE__*/React.createElement("img", {
111
- src: fitViewIcon,
112
- alt: "",
113
- className: "".concat(prefix, "-pointable"),
114
- onClick: function onClick() {
115
- graph === null || graph === void 0 ? void 0 : graph.fitView();
116
- }
117
- })), onReload && /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(Divider, {
118
- type: "vertical",
119
- className: "".concat(prefix, "-divider")
120
- })), onReload && /*#__PURE__*/React.createElement(Tooltip, {
121
- title: locale.refresh
122
- }, /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(SyncOutlined, {
123
- className: "".concat(prefix, "-pointable"),
124
- onClick: function onClick() {
125
- onReload();
126
- }
127
- }))));
66
+ className: "".concat(prefix, " ", "".concat(prefix, "-").concat(mode), " ").concat(className),
67
+ children: [showFullscreen && /*#__PURE__*/_jsx(Tooltip, {
68
+ title: locale.fullscreen,
69
+ children: /*#__PURE__*/_jsx(FullscreenOutlined, {
70
+ className: "pointable",
71
+ onClick: function onClick() {
72
+ if (onFullscreen) {
73
+ onFullscreen();
74
+ }
75
+ }
76
+ })
77
+ }), /*#__PURE__*/_jsxs("span", {
78
+ className: "".concat(prefix, "-zoom-wrapper"),
79
+ children: [/*#__PURE__*/_jsx(Tooltip, {
80
+ title: locale.shrink,
81
+ children: /*#__PURE__*/_jsx(MinusOutlined, {
82
+ className: zoom >= 0.3 ? "".concat(prefix, "-pointable") : "".concat(prefix, "-disabled"),
83
+ onClick: function onClick() {
84
+ if (zoom >= 0.3) {
85
+ var newZoom = zoom - 0.1;
86
+ setZoom(newZoom);
87
+ graph === null || graph === void 0 ? void 0 : graph.zoomTo(newZoom, getCenterPointByGraph(graph));
88
+ }
89
+ }
90
+ })
91
+ }), toPercent(zoom), /*#__PURE__*/_jsx(Tooltip, {
92
+ title: locale.enlarge,
93
+ children: /*#__PURE__*/_jsx(PlusOutlined, {
94
+ className: zoom <= 0.9 ? "".concat(prefix, "-pointable") : "".concat(prefix, "-disabled"),
95
+ onClick: function onClick() {
96
+ if (zoom <= 0.9) {
97
+ var newZoom = zoom + 0.1;
98
+ setZoom(newZoom);
99
+ graph === null || graph === void 0 ? void 0 : graph.zoomTo(newZoom, getCenterPointByGraph(graph));
100
+ }
101
+ }
102
+ })
103
+ })]
104
+ }), /*#__PURE__*/_jsx(Tooltip, {
105
+ title: locale.reset,
106
+ children: /*#__PURE__*/_jsx("img", {
107
+ src: resetIcon,
108
+ alt: "",
109
+ className: "".concat(prefix, "-pointable"),
110
+ onClick: function onClick() {
111
+ setZoom(1);
112
+ graph === null || graph === void 0 ? void 0 : graph.zoomTo(1, getCenterPointByGraph(graph));
113
+ }
114
+ })
115
+ }), /*#__PURE__*/_jsx(Tooltip, {
116
+ title: locale.fitView,
117
+ children: /*#__PURE__*/_jsx("img", {
118
+ src: fitViewIcon,
119
+ alt: "",
120
+ className: "".concat(prefix, "-pointable"),
121
+ onClick: function onClick() {
122
+ graph === null || graph === void 0 ? void 0 : graph.fitView();
123
+ }
124
+ })
125
+ }), onReload && /*#__PURE__*/_jsx("span", {
126
+ children: /*#__PURE__*/_jsx(Divider, {
127
+ type: "vertical",
128
+ className: "".concat(prefix, "-divider")
129
+ })
130
+ }), onReload && /*#__PURE__*/_jsx(Tooltip, {
131
+ title: locale.refresh,
132
+ children: /*#__PURE__*/_jsx("span", {
133
+ children: /*#__PURE__*/_jsx(SyncOutlined, {
134
+ className: "".concat(prefix, "-pointable"),
135
+ onClick: function onClick() {
136
+ onReload();
137
+ }
138
+ })
139
+ })
140
+ })]
141
+ });
128
142
  };
129
143
  export default LocaleWrapper({
130
144
  componentName: 'GraphToolbar',
@@ -12,6 +12,6 @@ export interface DiffCellsProps {
12
12
  lock?: boolean;
13
13
  rowOffset?: number;
14
14
  onMouseDown?: React.MouseEventHandler;
15
- hashId: string;
15
+ hashId?: string;
16
16
  }
17
- export default function DiffCells({ diffPrefixCls, data, emptyText, width, lock, rowOffset, onMouseDown, hashId, }: DiffCellsProps): React.JSX.Element;
17
+ export default function DiffCells({ diffPrefixCls, data, emptyText, width, lock, rowOffset, onMouseDown, hashId, }: DiffCellsProps): import("@emotion/react/types/jsx-namespace").EmotionJSX.Element;
@@ -4,6 +4,9 @@ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _ty
4
4
  function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
5
5
  import classNames from 'classnames';
6
6
  import * as React from 'react';
7
+ import { jsx as _jsx } from "react/jsx-runtime";
8
+ import { jsxs as _jsxs } from "react/jsx-runtime";
9
+ import { Fragment as _Fragment } from "react/jsx-runtime";
7
10
  export default function DiffCells(_ref) {
8
11
  var _mergedClassName, _data$value;
9
12
  var diffPrefixCls = _ref.diffPrefixCls,
@@ -25,19 +28,23 @@ export default function DiffCells(_ref) {
25
28
  if (rowIndex !== undefined) {
26
29
  rowIndex += rowOffset;
27
30
  }
28
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("td", {
29
- className: classNames("".concat(diffPrefixCls, "-index"), mergedClassName, hashId)
30
- }, rowIndex), /*#__PURE__*/React.createElement("td", {
31
- className: classNames("".concat(diffPrefixCls, "-mark"), mergedClassName, hashId)
32
- }, add && '+', remove && '-'), /*#__PURE__*/React.createElement("td", {
33
- onMouseDown: onMouseDown,
34
- style: {
35
- width: width,
36
- userSelect: lock ? 'none' : undefined
37
- },
38
- className: classNames("".concat(diffPrefixCls, "-code"), mergedClassName, hashId),
39
- dangerouslySetInnerHTML: {
40
- __html: (_data$value = data === null || data === void 0 ? void 0 : data.value) !== null && _data$value !== void 0 ? _data$value : emptyText || ''
41
- }
42
- }));
31
+ return /*#__PURE__*/_jsxs(_Fragment, {
32
+ children: [/*#__PURE__*/_jsx("td", {
33
+ className: classNames("".concat(diffPrefixCls, "-index"), mergedClassName, hashId),
34
+ children: rowIndex
35
+ }), /*#__PURE__*/_jsxs("td", {
36
+ className: classNames("".concat(diffPrefixCls, "-mark"), mergedClassName, hashId),
37
+ children: [add && '+', remove && '-']
38
+ }), /*#__PURE__*/_jsx("td", {
39
+ onMouseDown: onMouseDown,
40
+ style: {
41
+ width: width,
42
+ userSelect: lock ? 'none' : undefined
43
+ },
44
+ className: classNames("".concat(diffPrefixCls, "-code"), mergedClassName, hashId),
45
+ dangerouslySetInnerHTML: {
46
+ __html: (_data$value = data === null || data === void 0 ? void 0 : data.value) !== null && _data$value !== void 0 ? _data$value : emptyText || ''
47
+ }
48
+ })]
49
+ });
43
50
  }
@@ -20,11 +20,13 @@ import hljs from 'highlight.js/lib/core';
20
20
  import warning from 'rc-util/lib/warning';
21
21
  import React, { useEffect, useMemo } from 'react';
22
22
  import { languageMap } from '..';
23
- import { getPrefix } from "../..//_util";
23
+ import { getPrefix } from "../../_util";
24
24
  import { useKeyDownCopyEvent } from "../useKeyDownCopyEvent";
25
25
  import DiffCells from "./DiffCells";
26
26
  // @ts-ignore
27
27
  import "../index.less";
28
+ import { jsx as _jsx } from "react/jsx-runtime";
29
+ import { jsxs as _jsxs } from "react/jsx-runtime";
28
30
  var MAX_MERGE_TIMES = 10000;
29
31
  var EMPTY_TEXT = "<span class=\"hljs-comment\">// \u6CA1\u6709\u6570\u636E</span>";
30
32
  function getHighlightRows(language, code) {
@@ -256,62 +258,69 @@ var DiffView = function DiffView(_ref2) {
256
258
  // ============================ Render ============================
257
259
  var viewRows;
258
260
  if (!report) {
259
- viewRows = /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement(DiffCells, {
260
- width: "100%",
261
- diffPrefixCls: diffPrefixCls,
262
- data: {
263
- index: 1,
264
- value: EMPTY_TEXT,
265
- type: 'keep'
266
- }
267
- }));
261
+ viewRows = /*#__PURE__*/_jsx("tr", {
262
+ children: /*#__PURE__*/_jsx(DiffCells, {
263
+ width: "100%",
264
+ diffPrefixCls: diffPrefixCls,
265
+ data: {
266
+ index: 1,
267
+ value: EMPTY_TEXT,
268
+ type: 'keep'
269
+ }
270
+ })
271
+ });
268
272
  } else if (split) {
269
273
  // Split view
270
274
  viewRows = mergedData.rows.map(function (_ref4, index) {
271
275
  var src = _ref4.source,
272
276
  tgt = _ref4.target;
273
- return /*#__PURE__*/React.createElement("tr", {
274
- key: index
275
- }, /*#__PURE__*/React.createElement(DiffCells, {
276
- width: "50%",
277
- diffPrefixCls: diffPrefixCls,
278
- data: src,
279
- emptyText: index === 0 && mergedData.sourceEmpty && EMPTY_TEXT,
280
- onMouseDown: onSourceMouseDown,
281
- lock: selectable !== 'source',
282
- rowOffset: rowOffsetSrc
283
- }), /*#__PURE__*/React.createElement(DiffCells, {
284
- width: "50%",
285
- diffPrefixCls: diffPrefixCls,
286
- data: tgt,
287
- emptyText: index === 0 && mergedData.targetEmpty && EMPTY_TEXT,
288
- onMouseDown: onTargetMouseDown,
289
- lock: selectable !== 'target',
290
- rowOffset: rowOffsetTgt
291
- }));
277
+ return /*#__PURE__*/_jsxs("tr", {
278
+ children: [/*#__PURE__*/_jsx(DiffCells, {
279
+ width: "50%",
280
+ diffPrefixCls: diffPrefixCls,
281
+ data: src,
282
+ emptyText: index === 0 && mergedData.sourceEmpty && EMPTY_TEXT,
283
+ onMouseDown: onSourceMouseDown,
284
+ lock: selectable !== 'source',
285
+ rowOffset: rowOffsetSrc
286
+ }), /*#__PURE__*/_jsx(DiffCells, {
287
+ width: "50%",
288
+ diffPrefixCls: diffPrefixCls,
289
+ data: tgt,
290
+ emptyText: index === 0 && mergedData.targetEmpty && EMPTY_TEXT,
291
+ onMouseDown: onTargetMouseDown,
292
+ lock: selectable !== 'target',
293
+ rowOffset: rowOffsetTgt
294
+ })]
295
+ }, index);
292
296
  });
293
297
  } else {
294
298
  // Merge
295
299
  viewRows = diffData.sourceRows.map(function (src, index) {
296
- return /*#__PURE__*/React.createElement("tr", {
297
- key: index
298
- }, /*#__PURE__*/React.createElement(DiffCells, {
299
- width: "100%",
300
- diffPrefixCls: diffPrefixCls,
301
- data: src !== null && src !== void 0 ? src : diffData.targetRows[index],
302
- rowOffset: rowOffsetTgt
303
- }));
300
+ return /*#__PURE__*/_jsx("tr", {
301
+ children: /*#__PURE__*/_jsx(DiffCells, {
302
+ width: "100%",
303
+ diffPrefixCls: diffPrefixCls,
304
+ data: src !== null && src !== void 0 ? src : diffData.targetRows[index],
305
+ rowOffset: rowOffsetTgt
306
+ })
307
+ }, index);
304
308
  });
305
309
  }
306
310
  var codeRef = React.useRef();
307
311
  useKeyDownCopyEvent(codeRef);
308
- return /*#__PURE__*/React.createElement("div", {
312
+ return /*#__PURE__*/_jsx("div", {
309
313
  style: _objectSpread({
310
314
  height: height
311
315
  }, style),
312
316
  ref: codeRef,
313
317
  tabIndex: -1,
314
- className: classNames(prefixCls, diffPrefixCls, "".concat(prefixCls, "-").concat(theme === 'dark' ? 'dark' : 'light'), _defineProperty({}, "".concat(diffPrefixCls, "-split"), split), className)
315
- }, /*#__PURE__*/React.createElement("table", null, /*#__PURE__*/React.createElement("tbody", null, viewRows)));
318
+ className: classNames(prefixCls, diffPrefixCls, "".concat(prefixCls, "-").concat(theme === 'dark' ? 'dark' : 'light'), _defineProperty({}, "".concat(diffPrefixCls, "-split"), split), className),
319
+ children: /*#__PURE__*/_jsx("table", {
320
+ children: /*#__PURE__*/_jsx("tbody", {
321
+ children: viewRows
322
+ })
323
+ })
324
+ });
316
325
  };
317
326
  export default DiffView;
@@ -15,4 +15,4 @@ export interface HighlightCellProps {
15
15
  lineNumber?: boolean;
16
16
  hashId?: string;
17
17
  }
18
- export default function HighlightCell({ prefixCls, theme, data, emptyText, width, lock, lineNumber, onMouseDown, hashId, }: HighlightCellProps): React.JSX.Element;
18
+ export default function HighlightCell({ prefixCls, theme, data, emptyText, width, lock, lineNumber, onMouseDown, hashId, }: HighlightCellProps): import("@emotion/react/types/jsx-namespace").EmotionJSX.Element;
@@ -1,5 +1,8 @@
1
1
  import classNames from 'classnames';
2
2
  import * as React from 'react';
3
+ import { jsx as _jsx } from "react/jsx-runtime";
4
+ import { Fragment as _Fragment } from "react/jsx-runtime";
5
+ import { jsxs as _jsxs } from "react/jsx-runtime";
3
6
  export default function HighlightCell(_ref) {
4
7
  var _data$value;
5
8
  var prefixCls = _ref.prefixCls,
@@ -13,17 +16,20 @@ export default function HighlightCell(_ref) {
13
16
  onMouseDown = _ref.onMouseDown,
14
17
  hashId = _ref.hashId;
15
18
  var rowIndex = data === null || data === void 0 ? void 0 : data.index;
16
- return /*#__PURE__*/React.createElement(React.Fragment, null, lineNumber ? /*#__PURE__*/React.createElement("td", {
17
- className: classNames("".concat(prefixCls, "-").concat(theme, "-index"), "".concat(prefixCls, "-index"), hashId)
18
- }, rowIndex) : null, /*#__PURE__*/React.createElement("td", {
19
- onMouseDown: onMouseDown,
20
- style: {
21
- width: width,
22
- userSelect: lock ? 'none' : undefined
23
- },
24
- className: classNames("".concat(prefixCls, "-content"), hashId),
25
- dangerouslySetInnerHTML: {
26
- __html: (_data$value = data === null || data === void 0 ? void 0 : data.value) !== null && _data$value !== void 0 ? _data$value : emptyText || ''
27
- }
28
- }));
19
+ return /*#__PURE__*/_jsxs(_Fragment, {
20
+ children: [lineNumber ? /*#__PURE__*/_jsx("td", {
21
+ className: classNames("".concat(prefixCls, "-").concat(theme, "-index"), "".concat(prefixCls, "-index"), hashId),
22
+ children: rowIndex
23
+ }) : null, /*#__PURE__*/_jsx("td", {
24
+ onMouseDown: onMouseDown,
25
+ style: {
26
+ width: width,
27
+ userSelect: lock ? 'none' : undefined
28
+ },
29
+ className: classNames("".concat(prefixCls, "-content"), hashId),
30
+ dangerouslySetInnerHTML: {
31
+ __html: (_data$value = data === null || data === void 0 ? void 0 : data.value) !== null && _data$value !== void 0 ? _data$value : emptyText || ''
32
+ }
33
+ })]
34
+ });
29
35
  }
@@ -1,8 +1,7 @@
1
- /// <reference types="react" />
2
1
  import type { HighlightProps } from '.';
3
2
  import './index.less';
4
3
  export interface JsonViewProps extends HighlightProps {
5
4
  json: object;
6
5
  }
7
- declare const _default: ({ json, theme, style, className, height, onCopyChange, copyable, }: JsonViewProps) => import("react").JSX.Element;
6
+ declare const _default: ({ json, theme, style, className, height, onCopyChange, copyable, }: JsonViewProps) => import("@emotion/react/types/jsx-namespace").EmotionJSX.Element;
8
7
  export default _default;
@@ -3,13 +3,14 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
3
3
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
4
4
  function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
5
5
  import classNames from 'classnames';
6
- import { useRef } from 'react';
6
+ import React, { useRef } from 'react';
7
7
  import ReactJson from 'react-json-view';
8
8
  import { getPrefix } from "../_util";
9
9
  import { THEME_DARK } from '.';
10
10
  import { useKeyDownCopyEvent } from "./useKeyDownCopyEvent";
11
11
  // @ts-ignore
12
12
  import "./index.less";
13
+ import { jsx as _jsx } from "react/jsx-runtime";
13
14
  export default (function (_ref) {
14
15
  var json = _ref.json,
15
16
  theme = _ref.theme,
@@ -24,21 +25,22 @@ export default (function (_ref) {
24
25
  var isDarkTheme = theme === THEME_DARK;
25
26
  var codeRef = useRef();
26
27
  useKeyDownCopyEvent(codeRef);
27
- return /*#__PURE__*/React.createElement("div", {
28
+ return /*#__PURE__*/_jsx("div", {
28
29
  style: style,
29
30
  ref: codeRef
30
31
  // 让div支持focus能力
31
32
  ,
32
33
  tabIndex: -1,
33
- className: classNames(prefixCls, "".concat(prefixCls, "-json-view"), _defineProperty({}, "".concat(prefixCls, "-light"), !isDarkTheme), className)
34
- }, /*#__PURE__*/React.createElement(ReactJson, {
35
- enableClipboard: copyable && onCopyChange,
36
- src: json,
37
- theme: isDarkTheme ? 'ocean' : undefined,
38
- displayDataTypes: false,
39
- style: {
40
- height: height
41
- },
42
- name: false
43
- }));
34
+ className: classNames(prefixCls, "".concat(prefixCls, "-json-view"), _defineProperty({}, "".concat(prefixCls, "-light"), !isDarkTheme), className),
35
+ children: /*#__PURE__*/_jsx(ReactJson, {
36
+ enableClipboard: copyable && onCopyChange,
37
+ src: json,
38
+ theme: isDarkTheme ? 'ocean' : undefined,
39
+ displayDataTypes: false,
40
+ style: {
41
+ height: height
42
+ },
43
+ name: false
44
+ })
45
+ });
44
46
  });
@@ -29,7 +29,7 @@ export declare const THEME_DARK = "dark";
29
29
  export declare const THEME_LIGHT = "light";
30
30
  declare const ThemeTypes: ["dark", "light"];
31
31
  export type ThemeType = (typeof ThemeTypes)[number];
32
- declare const supportedLanguages: ("ruby" | "javascript" | "typescript" | "css" | "groovy" | "java" | "python" | "bash" | "json" | "cpp" | "http" | "markdown" | "nginx" | "sql" | "xml" | "dockerfile" | "go" | "yaml" | "solidity" | "tsx" | "jsx")[];
32
+ declare const supportedLanguages: ("ruby" | "css" | "javascript" | "typescript" | "groovy" | "java" | "python" | "bash" | "json" | "cpp" | "http" | "markdown" | "nginx" | "sql" | "xml" | "dockerfile" | "go" | "yaml" | "solidity" | "tsx" | "jsx")[];
33
33
  export type LanguageType = (typeof supportedLanguages)[number] | 'html';
34
34
  export interface HighlightProps extends LocaleWrapperProps {
35
35
  /**
@@ -1,5 +1,4 @@
1
1
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
2
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
4
3
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
5
4
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
@@ -55,6 +54,9 @@ import { useKeyDownCopyEvent } from "./useKeyDownCopyEvent";
55
54
  import "./index.less";
56
55
 
57
56
  // 目前支持的语言列表
57
+ import { jsx as _jsx } from "react/jsx-runtime";
58
+ import { jsxs as _jsxs } from "react/jsx-runtime";
59
+ import { Fragment as _Fragment } from "react/jsx-runtime";
58
60
  export var languageMap = {
59
61
  javascript: javascript,
60
62
  typescript: typescript,
@@ -148,15 +150,15 @@ var Highlight = function Highlight(props) {
148
150
  };
149
151
  });
150
152
  setCodeBlock(rowList.map(function (src, index) {
151
- return /*#__PURE__*/React.createElement("tr", {
152
- key: index
153
- }, /*#__PURE__*/React.createElement(HighlightCell, {
154
- lineNumber: lineNumber,
155
- width: "100%",
156
- data: src,
157
- theme: theme,
158
- prefixCls: prefixCls
159
- }));
153
+ return /*#__PURE__*/_jsx("tr", {
154
+ children: /*#__PURE__*/_jsx(HighlightCell, {
155
+ lineNumber: lineNumber,
156
+ width: "100%",
157
+ data: src,
158
+ theme: theme,
159
+ prefixCls: prefixCls
160
+ })
161
+ }, index);
160
162
  }));
161
163
  };
162
164
 
@@ -177,7 +179,7 @@ var Highlight = function Highlight(props) {
177
179
  customProps.dangerouslySetInnerHTML = {
178
180
  __html: children
179
181
  };
180
- return /*#__PURE__*/React.createElement("div", customProps);
182
+ return /*#__PURE__*/_jsx("div", _objectSpread({}, customProps));
181
183
  }
182
184
  var CopyButton = function CopyButton() {
183
185
  var _useState = useState(),
@@ -193,58 +195,68 @@ var Highlight = function Highlight(props) {
193
195
  _useState4 = _slicedToArray(_useState3, 2),
194
196
  copied = _useState4[0],
195
197
  setCopied = _useState4[1];
196
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CopyToClipboard, {
197
- text: children && children.length ? children : '',
198
- onCopy: function onCopy(value) {
199
- onCopyChange(value);
200
- setCopied(true);
201
- message.success('Copied');
202
- var tempCopyId = window.setTimeout(function () {
203
- setCopied(false);
204
- }, 2000);
205
- setCopyId(tempCopyId);
206
- }
207
- }, /*#__PURE__*/React.createElement("button", {
208
- disabled: copied,
209
- className: classNames("".concat(prefixCls, "-copy")),
210
- style: {
211
- background: "".concat(theme === THEME_DARK ? "#2b303b" : token.colorBgLayout)
212
- }
213
- }, /*#__PURE__*/React.createElement(CopyOutlined, {
214
- className: classNames("".concat(prefixCls, "-copy-icon"), {
215
- scoll: copied
216
- }),
217
- style: {
218
- color: "".concat(theme === THEME_DARK ? token.colorBgLayout : "#2b303b")
219
- }
220
- }), /*#__PURE__*/React.createElement(CheckOutlined, {
221
- className: classNames("".concat(prefixCls, "-copy-icon")),
222
- style: {
223
- color: 'rgb(63,177,99)'
224
- }
225
- }))));
198
+ return /*#__PURE__*/_jsx(_Fragment, {
199
+ children: /*#__PURE__*/_jsx(CopyToClipboard, {
200
+ text: children && children.length ? children : '',
201
+ onCopy: function onCopy(value) {
202
+ onCopyChange(value);
203
+ setCopied(true);
204
+ message.success('Copied');
205
+ var tempCopyId = window.setTimeout(function () {
206
+ setCopied(false);
207
+ }, 2000);
208
+ setCopyId(tempCopyId);
209
+ },
210
+ children: /*#__PURE__*/_jsxs("button", {
211
+ disabled: copied,
212
+ className: classNames("".concat(prefixCls, "-copy")),
213
+ style: {
214
+ background: "".concat(theme === THEME_DARK ? "#2b303b" : token.colorBgLayout)
215
+ },
216
+ children: [/*#__PURE__*/_jsx(CopyOutlined, {
217
+ className: classNames("".concat(prefixCls, "-copy-icon"), {
218
+ scoll: copied
219
+ }),
220
+ style: {
221
+ color: "".concat(theme === THEME_DARK ? token.colorBgLayout : "#2b303b")
222
+ }
223
+ }), /*#__PURE__*/_jsx(CheckOutlined, {
224
+ className: classNames("".concat(prefixCls, "-copy-icon")),
225
+ style: {
226
+ color: 'rgb(63,177,99)'
227
+ }
228
+ })]
229
+ })
230
+ })
231
+ });
226
232
  };
227
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("pre", _extends({}, customProps, {
228
- style: _objectSpread(_objectSpread({}, customStyle), {}, {
229
- position: 'relative'
230
- }),
231
- className: classNames("".concat(prefixCls), className, themeClass)
232
- }), copyable && /*#__PURE__*/React.createElement(CopyButton, null), /*#__PURE__*/React.createElement("table", {
233
- style: {
234
- height: height
235
- },
236
- className: classNames("".concat(theme === THEME_DARK ? "".concat(prefixCls, "-dark") : "".concat(prefixCls, "-light")))
237
- }, /*#__PURE__*/React.createElement("tbody", null, codeBlock))));
233
+ return /*#__PURE__*/_jsx(_Fragment, {
234
+ children: /*#__PURE__*/_jsxs("pre", _objectSpread(_objectSpread({}, customProps), {}, {
235
+ style: _objectSpread(_objectSpread({}, customStyle), {}, {
236
+ position: 'relative'
237
+ }),
238
+ className: classNames("".concat(prefixCls), className, themeClass),
239
+ children: [copyable && /*#__PURE__*/_jsx(CopyButton, {}), /*#__PURE__*/_jsx("table", {
240
+ style: {
241
+ height: height
242
+ },
243
+ className: classNames("".concat(theme === THEME_DARK ? "".concat(prefixCls, "-dark") : "".concat(prefixCls, "-light"))),
244
+ children: /*#__PURE__*/_jsx("tbody", {
245
+ children: codeBlock
246
+ })
247
+ })]
248
+ }))
249
+ });
238
250
  };
239
251
  var HighlightWrapper = function HighlightWrapper(props) {
240
252
  var language = props.language,
241
253
  children = props.children;
242
254
  if (language === 'json' && children && _typeof(children) === 'object' && ! /*#__PURE__*/React.isValidElement(children)) {
243
- return /*#__PURE__*/React.createElement(JsonView, _extends({}, props, {
255
+ return /*#__PURE__*/_jsx(JsonView, _objectSpread(_objectSpread({}, props), {}, {
244
256
  json: children
245
257
  }));
246
258
  }
247
- return /*#__PURE__*/React.createElement(Highlight, props);
259
+ return /*#__PURE__*/_jsx(Highlight, _objectSpread({}, props));
248
260
  };
249
261
  HighlightWrapper.Diff = DiffView;
250
262