pro-comp-x 0.0.1 → 0.0.2

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 (149) hide show
  1. package/README.md +57 -12
  2. package/compiled/@ant-design/icons/index.js +1 -0
  3. package/compiled/@ant-design/icons/package.json +1 -0
  4. package/compiled/antd/index.d.ts +482 -0
  5. package/compiled/antd/index.js +29 -0
  6. package/compiled/antd/package.json +1 -0
  7. package/compiled/classnames/index.js +7 -0
  8. package/compiled/classnames/package.json +1 -0
  9. package/compiled/dayjs/index.js +1 -0
  10. package/compiled/dayjs/package.json +1 -0
  11. package/dist/404.html +36 -0
  12. package/dist/esm/antd-alias/antd.less +30 -0
  13. package/dist/esm/antd-alias/button.d.ts +2 -0
  14. package/dist/esm/antd-alias/button.js +2 -0
  15. package/dist/esm/antd-alias/cascader.d.ts +2 -0
  16. package/dist/esm/antd-alias/cascader.js +2 -0
  17. package/dist/esm/antd-alias/checkbox.d.ts +2 -0
  18. package/dist/esm/antd-alias/checkbox.js +2 -0
  19. package/dist/esm/antd-alias/col.d.ts +2 -0
  20. package/dist/esm/antd-alias/col.js +2 -0
  21. package/dist/esm/antd-alias/config-provider.d.ts +2 -0
  22. package/dist/esm/antd-alias/config-provider.js +2 -0
  23. package/dist/esm/antd-alias/date-picker.d.ts +2 -0
  24. package/dist/esm/antd-alias/date-picker.js +2 -0
  25. package/dist/esm/antd-alias/form.d.ts +2 -0
  26. package/dist/esm/antd-alias/form.js +2 -0
  27. package/dist/esm/antd-alias/index.d.ts +36 -0
  28. package/dist/esm/antd-alias/index.js +48 -0
  29. package/dist/esm/antd-alias/input-number.d.ts +2 -0
  30. package/dist/esm/antd-alias/input-number.js +2 -0
  31. package/dist/esm/antd-alias/input.d.ts +2 -0
  32. package/dist/esm/antd-alias/input.js +2 -0
  33. package/dist/esm/antd-alias/mentions.d.ts +2 -0
  34. package/dist/esm/antd-alias/mentions.js +2 -0
  35. package/dist/esm/antd-alias/modal.d.ts +2 -0
  36. package/dist/esm/antd-alias/modal.js +2 -0
  37. package/dist/esm/antd-alias/pagination.d.ts +2 -0
  38. package/dist/esm/antd-alias/pagination.js +2 -0
  39. package/dist/esm/antd-alias/popover.d.ts +2 -0
  40. package/dist/esm/antd-alias/popover.js +2 -0
  41. package/dist/esm/antd-alias/radio.d.ts +2 -0
  42. package/dist/esm/antd-alias/radio.js +2 -0
  43. package/dist/esm/antd-alias/row.d.ts +2 -0
  44. package/dist/esm/antd-alias/row.js +2 -0
  45. package/dist/esm/antd-alias/select.d.ts +2 -0
  46. package/dist/esm/antd-alias/select.js +2 -0
  47. package/dist/esm/antd-alias/slider.d.ts +2 -0
  48. package/dist/esm/antd-alias/slider.js +2 -0
  49. package/dist/esm/antd-alias/spin.d.ts +2 -0
  50. package/dist/esm/antd-alias/spin.js +2 -0
  51. package/dist/esm/antd-alias/switch.d.ts +2 -0
  52. package/dist/esm/antd-alias/switch.js +2 -0
  53. package/dist/esm/antd-alias/table.d.ts +2 -0
  54. package/dist/esm/antd-alias/table.js +2 -0
  55. package/dist/esm/antd-alias/tabs.d.ts +2 -0
  56. package/dist/esm/antd-alias/tabs.js +2 -0
  57. package/dist/esm/antd-alias/time-picker.d.ts +2 -0
  58. package/dist/esm/antd-alias/time-picker.js +2 -0
  59. package/dist/esm/antd-alias/tooltip.d.ts +2 -0
  60. package/dist/esm/antd-alias/tooltip.js +2 -0
  61. package/dist/esm/antd-alias/tree-select.d.ts +2 -0
  62. package/dist/esm/antd-alias/tree-select.js +2 -0
  63. package/dist/esm/antd-alias/upload.d.ts +2 -0
  64. package/dist/esm/antd-alias/upload.js +2 -0
  65. package/dist/esm/components/ComponentExtends/DatePicker/index.d.ts +9 -0
  66. package/dist/esm/components/ComponentExtends/DatePicker/index.js +5 -12
  67. package/dist/esm/components/ComponentExtends/InputBox/index.d.ts +31 -0
  68. package/dist/esm/components/ComponentExtends/InputBox/index.js +3 -4
  69. package/dist/esm/components/ComponentExtends/InputSearch/index.d.ts +9 -0
  70. package/dist/esm/components/ComponentExtends/InputSearch/index.js +3 -10
  71. package/dist/esm/components/ComponentExtends/InputTooltip/index.d.ts +11 -0
  72. package/dist/esm/components/ComponentExtends/InputTooltip/index.js +18 -28
  73. package/dist/esm/components/ComponentExtends/Modal/index.d.ts +15 -0
  74. package/dist/esm/components/ComponentExtends/Modal/index.js +4 -13
  75. package/dist/esm/components/ComponentExtends/NumberRange/index.d.ts +13 -0
  76. package/dist/esm/components/ComponentExtends/NumberRange/index.js +21 -30
  77. package/dist/esm/components/ComponentExtends/Raido/index.d.ts +10 -0
  78. package/dist/esm/components/ComponentExtends/Raido/index.js +3 -10
  79. package/dist/esm/components/ComponentExtends/SelectQuery/index.d.ts +32 -0
  80. package/dist/esm/components/ComponentExtends/SelectQuery/index.js +40 -51
  81. package/dist/esm/components/ComponentExtends/TableEditCell/index.d.ts +20 -0
  82. package/dist/esm/components/ComponentExtends/TableEditCell/index.js +5 -19
  83. package/dist/esm/components/ComponentExtends/Tabs/index.d.ts +8 -0
  84. package/dist/esm/components/ComponentExtends/Tabs/index.js +11 -16
  85. package/dist/esm/components/ComponentExtends/Text/index.d.ts +4 -0
  86. package/dist/esm/components/ComponentExtends/Text/index.js +1 -4
  87. package/dist/esm/components/ComponentExtends/TimePicker/index.d.ts +6 -0
  88. package/dist/esm/components/ComponentExtends/TimePicker/index.js +5 -12
  89. package/dist/esm/components/ComponentExtends/UploadImages/index.d.ts +8 -0
  90. package/dist/esm/components/ComponentExtends/UploadImages/index.js +10 -23
  91. package/dist/esm/components/ComponentExtends/index.d.ts +15 -0
  92. package/dist/esm/components/DndProvider/index.d.ts +7 -0
  93. package/dist/esm/components/DndProvider/index.js +15 -0
  94. package/dist/esm/components/DraggableBodyRow/DraggableBodyRow.less +16 -14
  95. package/dist/esm/components/DraggableBodyRow/index.d.ts +18 -0
  96. package/dist/esm/components/DraggableBodyRow/index.js +2 -2
  97. package/dist/esm/components/DraggableCell/index.d.ts +40 -0
  98. package/dist/esm/components/DraggableCell/index.js +23 -10
  99. package/dist/esm/components/DraggableTabNode/index.d.ts +7 -0
  100. package/dist/esm/components/DraggableTabNode/index.js +3 -5
  101. package/dist/esm/components/DraggableTable/DraggableTable.less +31 -0
  102. package/dist/esm/components/DraggableTable/index.d.ts +23 -0
  103. package/dist/esm/components/DraggableTable/index.js +170 -0
  104. package/dist/esm/components/PageList/FilterForm/index.d.ts +53 -0
  105. package/dist/esm/components/PageList/FilterForm/index.js +52 -66
  106. package/dist/esm/components/PageList/index.d.ts +76 -0
  107. package/dist/esm/components/PageList/index.js +148 -138
  108. package/dist/esm/components/PageWraper/index.d.ts +13 -0
  109. package/dist/esm/components/PageWraper/index.js +8 -13
  110. package/dist/esm/components/Panel/Panel.less +2 -0
  111. package/dist/esm/components/Panel/index.d.ts +20 -0
  112. package/dist/esm/components/Panel/index.js +17 -27
  113. package/dist/esm/components/ProConfigProvider/context.d.ts +17 -0
  114. package/dist/esm/components/ProConfigProvider/context.js +6 -1
  115. package/dist/esm/components/ProConfigProvider/index.d.ts +10 -0
  116. package/dist/esm/components/ProConfigProvider/index.js +4 -9
  117. package/dist/esm/components/RenderForm/RenderForm.less +19 -0
  118. package/dist/esm/components/RenderForm/index.d.ts +64 -0
  119. package/dist/esm/components/RenderForm/index.js +106 -103
  120. package/dist/esm/index.d.ts +25 -0
  121. package/dist/esm/index.js +4 -17
  122. package/dist/esm/styles/antd-custom.less +5 -0
  123. package/dist/esm/styles/base.less +3 -6
  124. package/dist/esm/styles/dumi.less +17 -0
  125. package/dist/esm/styles/index.less +1 -0
  126. package/dist/esm/utils/getClassPrefix.d.ts +2 -0
  127. package/dist/index.css +26895 -0
  128. package/dist/index.html +36 -0
  129. package/dist/pro-components-dark.css +1 -0
  130. package/dist/pro-components-default.css +1 -0
  131. package/dist/umi.css +2 -0
  132. package/dist/umi.js +1 -0
  133. package/package.json +29 -30
  134. package/public/pro-components-dark.css +19 -0
  135. package/public/pro-components-default.css +23 -0
  136. package/dist/esm/components/ActionConfigForm/index.js +0 -129
  137. package/dist/esm/components/ColorPalette/ColorPalette.less +0 -9
  138. package/dist/esm/components/ColorPalette/index.js +0 -88
  139. package/dist/esm/components/MarkdownView/MarkdownView.less +0 -93
  140. package/dist/esm/components/MarkdownView/index.js +0 -142
  141. package/dist/esm/components/MdPlainText/MdPlainText.less +0 -118
  142. package/dist/esm/components/MdPlainText/constants.js +0 -2
  143. package/dist/esm/components/MdPlainText/index.js +0 -717
  144. package/dist/esm/components/MdPlainText/planinShortcuts.js +0 -18
  145. package/dist/esm/components/MdPlainText/textContent.js +0 -4
  146. package/dist/esm/components/MdPlainText/utils.js +0 -159
  147. package/dist/esm/components/PlainText/index.js +0 -122
  148. package/dist/esm/components/PlainTextBox/PlainTextBox.less +0 -94
  149. package/dist/esm/components/PlainTextBox/index.js +0 -264
package/package.json CHANGED
@@ -1,17 +1,20 @@
1
1
  {
2
2
  "name": "pro-comp-x",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "description": "无限可能的组件库",
5
+ "main": "dist/esm/index.js",
5
6
  "module": "dist/esm/index.js",
6
7
  "types": "dist/esm/index.d.ts",
8
+ "style": "dist/index.css",
7
9
  "scripts": {
8
10
  "dev": "father dev",
11
+ "prebuild": "node ./scripts/createAntdAlias.js && npm run build:deps",
9
12
  "build": "father build && node ./scripts/buildCss.js",
10
13
  "build:deps": "father prebundle",
11
14
  "build:theme": "node ./scripts/buildCss.js",
12
- "prepublishOnly": "father doctor && npm run build",
13
- "sb": "storybook dev -p 6006",
14
- "sb:build": "storybook build"
15
+ "prepublishOnly": "npm run build",
16
+ "docs:dev": "NODE_PATH=../../node_modules dumi dev",
17
+ "docs:build": "dumi build"
15
18
  },
16
19
  "keywords": [],
17
20
  "authors": [
@@ -21,53 +24,49 @@
21
24
  "files": [
22
25
  "dist",
23
26
  "compiled",
24
- "public"
27
+ "public",
28
+ "README.md"
25
29
  ],
26
30
  "publishConfig": {
27
31
  "access": "public"
28
32
  },
29
33
  "dependencies": {
30
- "@ant-design/icons": "^5.3.7",
31
- "classnames": "^2.3.1",
32
- "dayjs": "^1.11.10",
33
- "rehype-raw": "6.1.1",
34
- "remark-gfm": "3.0.1",
35
- "is-hotkey": "^0.2.0",
36
- "slate": "^0.103.0",
37
- "slate-history": "^0.109.0",
38
- "slate-react": "^0.110.1",
39
- "react-color": "2.19.3",
40
- "react-markdown": "^8.0.7",
41
34
  "react-dnd": "^16.0.1",
42
35
  "react-dnd-html5-backend": "^16.0.1",
43
36
  "react-copy-to-clipboard": "^5.1.0",
44
37
  "react-syntax-highlighter": "^15.5.0"
45
38
  },
46
39
  "devDependencies": {
40
+ "antd": "^4.24.14",
41
+ "@ant-design/icons": "^4.8.0",
42
+ "babel-plugin-import": "^1.13.8",
43
+ "classnames": "^2.3.1",
44
+ "dayjs": "^1.11.10",
45
+ "@babel/preset-env": "^7.23.9",
46
+ "@babel/preset-react": "^7.23.9",
47
+ "@babel/preset-typescript": "^7.23.9",
47
48
  "@types/prismjs": "1.26.5",
48
49
  "@types/react-color": "3.0.12",
49
50
  "@types/turndown": "5.0.5",
51
+ "@types/react-copy-to-clipboard": "^5.0.7",
50
52
  "@types/react-syntax-highlighter": "^15.5.13",
51
- "@storybook/addon-essentials": "7.6.17",
52
- "@storybook/addon-interactions": "7.6.17",
53
- "@storybook/addon-links": "7.6.17",
54
- "@storybook/addon-onboarding": "^1.0.11",
55
- "@storybook/blocks": "7.6.17",
56
- "@storybook/react": "7.6.17",
57
- "@storybook/react-webpack5": "7.6.17",
58
- "@storybook/test": "7.6.17",
59
- "@babel/preset-env": "^7.23.9",
53
+ "@umijs/preset-react": "1.8.32",
60
54
  "babel-loader": "^9.1.3",
61
55
  "babel-preset-react-app": "^10.0.1",
62
56
  "less-loader": "10",
63
57
  "father": "^4.4.5",
64
58
  "less": "^4.2.0",
65
59
  "stylelint": "^15.7.0",
66
- "babel-plugin-import": "^1.13.8",
67
- "storybook": "7.6.17"
60
+ "dumi": "1.1.48"
68
61
  },
69
62
  "peerDependencies": {
70
- "react": "17.x",
71
- "antd": "^4.24.14"
72
- }
63
+ "react": ">=16.8.0",
64
+ "react-dom": ">=16.8.0"
65
+ },
66
+ "bundledDependencies": [
67
+ "antd",
68
+ "@ant-design/icons",
69
+ "classnames",
70
+ "dayjs"
71
+ ]
73
72
  }
@@ -568,3 +568,22 @@
568
568
  .ant-yanxi-drag-table-row-below td {
569
569
  border-bottom: 2px solid #0f89fc;
570
570
  }
571
+
572
+ /* KaTeX styles */
573
+ .ant-yanxi-markdown-view-wrap .katex {
574
+ font-size: 1.1em;
575
+ color: #f7f8fa;
576
+ }
577
+
578
+ .ant-yanxi-markdown-view-wrap .katex-display {
579
+ margin: 1em 0;
580
+ overflow-x: auto;
581
+ overflow-y: hidden;
582
+ padding-top: 0.5em;
583
+ padding-bottom: 0.5em;
584
+ }
585
+
586
+ .ant-yanxi-markdown-view-wrap .katex-display > .katex {
587
+ margin: 0;
588
+ text-align: center;
589
+ }
@@ -568,3 +568,26 @@
568
568
  .ant-yanxi-drag-table-row-below td {
569
569
  border-bottom: 2px solid #0f89fc;
570
570
  }
571
+
572
+ /* KaTeX styles */
573
+ .ant-yanxi-markdown-view-wrap .katex {
574
+ font-size: 1.1em;
575
+ }
576
+
577
+ .ant-yanxi-markdown-view-wrap .katex-display {
578
+ margin: 1em 0;
579
+ overflow-x: auto;
580
+ overflow-y: hidden;
581
+ padding-top: 0.5em;
582
+ padding-bottom: 0.5em;
583
+ }
584
+
585
+ .ant-yanxi-markdown-view-wrap .katex-display > .katex {
586
+ margin: 0;
587
+ text-align: center;
588
+ }
589
+
590
+ /* 暗色主题下的数学公式样式 */
591
+ .ant-yanxi-markdown-view-wrap[data-theme='dark'] .katex {
592
+ color: #f7f8fa;
593
+ }
@@ -1,129 +0,0 @@
1
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
- import "antd/es/modal/style";
3
- import _Modal from "antd/es/modal";
4
- import "antd/es/spin/style";
5
- import _Spin from "antd/es/spin";
6
- import "antd/es/form/style";
7
- import _Form from "antd/es/form";
8
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
9
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
10
- 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; }
11
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
12
- function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
13
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
14
- function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
15
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
16
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
17
- function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
18
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
19
- function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
20
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
21
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
22
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
23
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
24
- function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
25
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
26
- import React, { useEffect, useState } from 'react';
27
- import RenderForm from "../RenderForm";
28
- import { jsx as _jsx } from "react/jsx-runtime";
29
- export default (function (_ref) {
30
- var open = _ref.open,
31
- onOk = _ref.onOk,
32
- onCancel = _ref.onCancel,
33
- _ref$initValues = _ref.initValues,
34
- initValues = _ref$initValues === void 0 ? {} : _ref$initValues,
35
- _ref$widgetItems = _ref.widgetItems,
36
- widgetItems = _ref$widgetItems === void 0 ? [] : _ref$widgetItems;
37
- var _Form$useForm = _Form.useForm(),
38
- _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
39
- form = _Form$useForm2[0];
40
- var _useState = useState(false),
41
- _useState2 = _slicedToArray(_useState, 2),
42
- loading = _useState2[0],
43
- setLoading = _useState2[1];
44
- var onSubmit = /*#__PURE__*/function () {
45
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
46
- var values;
47
- return _regeneratorRuntime().wrap(function _callee$(_context) {
48
- while (1) switch (_context.prev = _context.next) {
49
- case 0:
50
- setLoading(true);
51
- _context.prev = 1;
52
- _context.next = 4;
53
- return form.validateFields();
54
- case 4:
55
- values = _context.sent;
56
- if (values && onOk) {
57
- onOk(values);
58
- if (onCancel) {
59
- onCancel();
60
- }
61
- }
62
- case 6:
63
- _context.prev = 6;
64
- setLoading(false);
65
- return _context.finish(6);
66
- case 9:
67
- case "end":
68
- return _context.stop();
69
- }
70
- }, _callee, null, [[1,, 6, 9]]);
71
- }));
72
- return function onSubmit() {
73
- return _ref2.apply(this, arguments);
74
- };
75
- }();
76
- var formItems = function formItems() {
77
- var commonFormItems = [{
78
- type: 'select',
79
- label: '事件类型',
80
- name: 'action',
81
- props: {
82
- options: [{
83
- label: '发送消息',
84
- value: 'sendMessage'
85
- }, {
86
- label: '添加到对话框',
87
- value: 'insertMessage'
88
- }]
89
- }
90
- }, {
91
- type: 'input',
92
- label: '发送内容',
93
- name: 'message'
94
- }];
95
- if (Array.isArray(widgetItems) && widgetItems.length > 0) {
96
- var filterCommonItems = commonFormItems.filter(function (item) {
97
- return !widgetItems.map(function (item) {
98
- return item.name;
99
- }).includes(item.name);
100
- });
101
- return [].concat(_toConsumableArray(filterCommonItems), _toConsumableArray(widgetItems));
102
- }
103
- return commonFormItems;
104
- };
105
- useEffect(function () {
106
- if (open) {
107
- form.setFieldsValue(_objectSpread({
108
- action: 'sendMessage'
109
- }, initValues));
110
- } else {
111
- form.resetFields();
112
- }
113
- }, [open, initValues]);
114
- return /*#__PURE__*/_jsx(_Modal, {
115
- width: 360,
116
- open: open,
117
- title: "\u4E8B\u4EF6\u914D\u7F6E",
118
- onCancel: onCancel,
119
- onOk: onSubmit,
120
- children: /*#__PURE__*/_jsx(_Spin, {
121
- spinning: loading,
122
- children: /*#__PURE__*/_jsx(RenderForm, {
123
- form: form,
124
- initialValues: initValues,
125
- formItems: formItems()
126
- })
127
- })
128
- });
129
- });
@@ -1,9 +0,0 @@
1
- @colorPalettePrefix: ~'@{pro-prefix}-color-palette';
2
-
3
- .@{colorPalettePrefix} {
4
- &-container {
5
- border: none !important;
6
- box-shadow: none !important;
7
- padding: 0 !important;
8
- }
9
- }
@@ -1,88 +0,0 @@
1
- import "antd/es/popover/style";
2
- import _Popover from "antd/es/popover";
3
- import "antd/es/button/style";
4
- import _Button from "antd/es/button";
5
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
6
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
7
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
8
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
9
- function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
10
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
11
- import React, { useState, useRef, forwardRef, useImperativeHandle, useEffect } from 'react';
12
- import { SketchPicker } from 'react-color';
13
- import { ConfigContext } from 'antd/es/config-provider';
14
- import getClassPrefix from "../../utils/getClassPrefix";
15
- import { jsx as _jsx } from "react/jsx-runtime";
16
- import { Fragment as _Fragment } from "react/jsx-runtime";
17
- import { jsxs as _jsxs } from "react/jsx-runtime";
18
- var ColorPalette = /*#__PURE__*/forwardRef(function (_ref, ref) {
19
- var _colorRef$current;
20
- var prefixCls = _ref.prefixCls,
21
- value = _ref.value,
22
- children = _ref.children,
23
- onChange = _ref.onChange,
24
- onClear = _ref.onClear,
25
- disabled = _ref.disabled;
26
- var _React$useContext = React.useContext(ConfigContext),
27
- antGetPrefixCls = _React$useContext.getPrefixCls;
28
- var antPrefixCls = antGetPrefixCls(prefixCls);
29
- var clsPrefix = getClassPrefix(antPrefixCls, 'color-palette');
30
- var _useState = useState(false),
31
- _useState2 = _slicedToArray(_useState, 2),
32
- visible = _useState2[0],
33
- setVisible = _useState2[1];
34
- var _useState3 = useState(''),
35
- _useState4 = _slicedToArray(_useState3, 2),
36
- colorContent = _useState4[0],
37
- setColorContent = _useState4[1];
38
- var colorRef = useRef(null);
39
- var onHandleChange = function onHandleChange(color) {
40
- setColorContent(color === null || color === void 0 ? void 0 : color.hex);
41
- if (onChange) {
42
- onChange(color === null || color === void 0 ? void 0 : color.hex);
43
- }
44
- setVisible(false);
45
- };
46
- var compCallBack = {
47
- setVisiele: function setVisiele(vis) {
48
- setVisible(vis);
49
- },
50
- onChange: colorRef === null || colorRef === void 0 || (_colorRef$current = colorRef.current) === null || _colorRef$current === void 0 ? void 0 : _colorRef$current.onChange
51
- };
52
- var onHanleClear = function onHanleClear() {
53
- if (onClear) {
54
- onClear();
55
- }
56
- setVisible(false);
57
- };
58
- useEffect(function () {
59
- setColorContent(value || '');
60
- }, [value]);
61
- useImperativeHandle(ref, function () {
62
- return compCallBack;
63
- });
64
- return /*#__PURE__*/_jsx(_Popover, {
65
- open: visible,
66
- onOpenChange: function onOpenChange(vis) {
67
- if (!disabled) {
68
- setVisible(vis);
69
- }
70
- },
71
- trigger: ['click'],
72
- content: /*#__PURE__*/_jsxs(_Fragment, {
73
- children: [/*#__PURE__*/_jsx(SketchPicker, {
74
- ref: colorRef,
75
- className: "".concat(clsPrefix, "-container"),
76
- color: colorContent,
77
- onChange: onHandleChange
78
- }), typeof onClear === 'function' ? /*#__PURE__*/_jsx(_Button, {
79
- block: true,
80
- size: "small",
81
- onClick: onHanleClear,
82
- children: "\u6E05\u9664"
83
- }) : null]
84
- }),
85
- children: typeof children === 'function' ? children(compCallBack) : children
86
- });
87
- });
88
- export default ColorPalette;
@@ -1,93 +0,0 @@
1
- @markdownViewPrefix: ~'@{pro-prefix}-markdown-view';
2
-
3
- .@{markdownViewPrefix} {
4
- &-wrap {
5
- p {
6
- white-space: pre-line;
7
- }
8
- }
9
-
10
- &-code-wrap {
11
- border: 1px solid @border-color-split;
12
- border-radius: @border-radius-base;
13
- background-color: @component-background;
14
- overflow: hidden;
15
-
16
- .@{markdownViewPrefix}-code-tools {
17
- display: flex;
18
- padding: @space-xs;
19
- gap: @space-md;
20
- border-bottom: 1px solid @border-color-split;
21
- background: @color-fill-2;
22
-
23
- &-cell {
24
- flex: 1;
25
- }
26
-
27
- &-extra {
28
- display: flex;
29
- gap: @space-xs;
30
- }
31
- }
32
- }
33
-
34
- &-quoteText {
35
- color: @text-color-secondary;
36
- font-size: @font-size-sm;
37
- cursor: pointer;
38
-
39
- .anticon {
40
- margin-left: @space-xxs;
41
- }
42
- }
43
-
44
- &-popver {
45
- .@{ant-prefix}-popover-inner-content {
46
- width: 200px;
47
- font-size: @font-size-sm;
48
- max-height: 200px;
49
- overflow: auto;
50
- padding: @space-sm;
51
-
52
- .@{ant-prefix}-list-item {
53
- font-size: @font-size-sm;
54
- padding: @space-sm 0;
55
- }
56
- }
57
- }
58
-
59
- &-table {
60
- width: 100%;
61
- table-layout: fixed;
62
- border-collapse: separate;
63
- border-spacing: 0;
64
- border: 1px solid @border-color-base;
65
- margin-bottom: 1em;
66
-
67
- tr th,
68
- tr td {
69
- padding: @space-sm;
70
- border: 1px solid @border-color-base;
71
- }
72
- }
73
-
74
- &-blockquote {
75
- position: relative;
76
- display: block;
77
- padding: @space-sm;
78
- padding-left: calc(@space-sm + 4px);
79
- background: @color-fill-2;
80
- margin-bottom: 1em;
81
-
82
- &::before {
83
- content: '';
84
- position: absolute;
85
- z-index: 1;
86
- width: 4px;
87
- left: 0;
88
- bottom: 0;
89
- top: 0;
90
- background: @border-color-split;
91
- }
92
- }
93
- }
@@ -1,142 +0,0 @@
1
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
- import "antd/es/tooltip/style";
3
- import _Tooltip from "antd/es/tooltip";
4
- import "antd/es/button/style";
5
- import _Button from "antd/es/button";
6
- import "antd/es/message/style";
7
- import _message from "antd/es/message";
8
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
9
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
10
- 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; }
11
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
12
- function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
13
- import React, { useCallback } from 'react';
14
- import ReactMarkdown from 'react-markdown';
15
- import { CopyToClipboard } from 'react-copy-to-clipboard';
16
- import { Prism } from 'react-syntax-highlighter';
17
- import { ConfigContext } from 'antd/es/config-provider';
18
- import rehypeRaw from 'rehype-raw';
19
- import remarkGfm from 'remark-gfm';
20
- import { oneDark, oneLight } from 'react-syntax-highlighter/dist/esm/styles/prism';
21
- import getClassPrefix from "../../utils/getClassPrefix";
22
- import { ReactComponent as IcoCopy } from "../../assets/svg/ico-copy.svg";
23
- import { jsx as _jsx } from "react/jsx-runtime";
24
- import { jsxs as _jsxs } from "react/jsx-runtime";
25
- var MarkdownView = function MarkdownView(_ref) {
26
- var prefixCls = _ref.prefixCls,
27
- theme = _ref.theme,
28
- content = _ref.content,
29
- components = _ref.components;
30
- var _React$useContext = React.useContext(ConfigContext),
31
- antGetPrefixCls = _React$useContext.getPrefixCls;
32
- var antPrefixCls = antGetPrefixCls(prefixCls);
33
- var clsPrefix = getClassPrefix(antPrefixCls, 'markdown-view');
34
- var renderCode = useCallback(function (codeProps, index) {
35
- var children = codeProps.children,
36
- className = codeProps.className,
37
- inline = codeProps.inline;
38
- var code = String(children);
39
- var match = /language-(\w+)/.exec(className || '');
40
- var language = (match === null || match === void 0 ? void 0 : match[1]) || 'plainxt';
41
- return !inline ? /*#__PURE__*/_jsxs("div", {
42
- className: "".concat(clsPrefix, "-code-wrap"),
43
- children: [/*#__PURE__*/_jsxs("div", {
44
- className: "".concat(clsPrefix, "-code-tools"),
45
- children: [/*#__PURE__*/_jsx("div", {
46
- className: "".concat(clsPrefix, "-code-tools-cell"),
47
- children: language
48
- }), /*#__PURE__*/_jsx("div", {
49
- className: "".concat(clsPrefix, "-code-tools-extra"),
50
- children: /*#__PURE__*/_jsx(_Tooltip, {
51
- title: "\u62F7\u8D1D",
52
- children: /*#__PURE__*/_jsx(CopyToClipboard, {
53
- text: code,
54
- onCopy: function onCopy() {
55
- return _message.success('拷贝成功');
56
- },
57
- children: /*#__PURE__*/_jsx(_Button, {
58
- type: "text",
59
- icon: /*#__PURE__*/_jsx(IcoCopy, {}),
60
- size: "small"
61
- })
62
- })
63
- })
64
- })]
65
- }), /*#__PURE__*/_jsx(Prism, {
66
- wrapLines: true,
67
- showLineNumbers: true,
68
- wrapLongLines: true,
69
- language: language,
70
- PreTag: "div",
71
- style: theme === 'dark' ? oneDark : oneLight,
72
- customStyle: {
73
- width: '100%',
74
- overflow: 'auto',
75
- padding: '12px',
76
- margin: '0',
77
- whiteSpace: 'pre-wrap'
78
- },
79
- codeTagProps: {
80
- style: {
81
- margin: 0,
82
- whiteSpace: 'pre-wrap'
83
- }
84
- },
85
- children: code
86
- })]
87
- }) : /*#__PURE__*/_jsx("code", {
88
- className: className,
89
- children: code
90
- });
91
- }, [theme]);
92
- var renderTable = useCallback(function (tableProps) {
93
- var children = tableProps.children;
94
- return /*#__PURE__*/_jsx("table", {
95
- className: "".concat(clsPrefix, "-table"),
96
- children: children
97
- });
98
- }, [theme]);
99
- var renderBlockquote = useCallback(function (blockquoteProps) {
100
- var children = blockquoteProps.children;
101
- return /*#__PURE__*/_jsx("blockquote", {
102
- className: "".concat(clsPrefix, "-blockquote"),
103
- children: children
104
- });
105
- }, [theme]);
106
-
107
- // const renderParagraph = useCallback((paragraphProps) => {
108
- // const { children, node, ...otherParagraphProps } = paragraphProps;
109
- // if (Array.isArray(children)) {
110
- // return (
111
- // <p {...otherParagraphProps}>
112
- // {children.map((child, index) => {
113
- // if (typeof child === 'string') {
114
- // const childArr = child.split('\n');
115
- // return childArr.map((line, lineIndex) => (
116
- // <Fragment key={`${index}-${lineIndex}`}>
117
- // {line}
118
- // {lineIndex < childArr.length - 1 && <br />}
119
- // </Fragment>
120
- // ));
121
- // }
122
- // return child;
123
- // })}
124
- // </p>
125
- // );
126
- // }
127
- // return <p {...paragraphProps} />;
128
- // }, [theme]);
129
-
130
- return /*#__PURE__*/_jsx(ReactMarkdown, {
131
- className: "".concat(clsPrefix, "-wrap"),
132
- components: _objectSpread({
133
- code: renderCode,
134
- table: renderTable,
135
- blockquote: renderBlockquote
136
- }, components),
137
- rehypePlugins: [rehypeRaw],
138
- remarkPlugins: [remarkGfm],
139
- children: content
140
- });
141
- };
142
- export default MarkdownView;