Browse Source

dev: 添加富文本编辑器相关page

Roxas 4 years ago
parent
commit
0b5bf31ba7
54 changed files with 120306 additions and 15733 deletions
  1. 0
    8
      .babelrc
  2. 0
    1
      .storybook/config.js
  3. 2
    4
      .storybook/webpack.config.js
  4. 3
    2
      eslib/Common/index.js
  5. 1
    1
      eslib/Common/index.js.map
  6. 58031
    0
      eslib/Editor/index.js
  7. 1
    0
      eslib/Editor/index.js.map
  8. 3
    6
      eslib/Payment/index.js
  9. 1
    1
      eslib/Payment/index.js.map
  10. 53
    0
      eslib/index-29b5a955.js
  11. 1
    0
      eslib/index-29b5a955.js.map
  12. 14
    41
      eslib/index-6e59934c.js
  13. 1
    1
      eslib/index-6e59934c.js.map
  14. 4
    7
      eslib/index.js
  15. 1
    1
      eslib/index.js.map
  16. 0
    1
      eslib/style-inject.es-7ed2769c.js.map
  17. 2
    51
      eslib/style-inject.es-b888177c.js
  18. 1
    0
      eslib/style-inject.es-b888177c.js.map
  19. 3
    2
      eslib/test-89de59f6.js
  20. 1
    1
      eslib/test-89de59f6.js.map
  21. 3
    2
      lib/Common/index.js
  22. 1
    1
      lib/Common/index.js.map
  23. 58040
    0
      lib/Editor/index.js
  24. 1
    0
      lib/Editor/index.js.map
  25. 7
    10
      lib/Payment/index.js
  26. 1
    1
      lib/Payment/index.js.map
  27. 55
    0
      lib/index-671ea010.js
  28. 1
    0
      lib/index-671ea010.js.map
  29. 25
    52
      lib/index-fe1b29d9.js
  30. 1
    1
      lib/index-fe1b29d9.js.map
  31. 8
    11
      lib/index.js
  32. 1
    1
      lib/index.js.map
  33. 0
    1
      lib/style-inject.es-3827494b.js.map
  34. 2
    51
      lib/style-inject.es-7b2c2b1b.js
  35. 1
    0
      lib/style-inject.es-7b2c2b1b.js.map
  36. 3
    2
      lib/test-f419c2cb.js
  37. 1
    1
      lib/test-f419c2cb.js.map
  38. 0
    14707
      package-lock.json
  39. 12
    3
      package.json
  40. 7
    3
      rollup.config.js
  41. 66
    0
      src/components/Editor/BraftEditor/index.tsx
  42. 8
    0
      src/components/Editor/RichTextEditor/RichTextEditor.less
  43. 175
    9
      src/components/Editor/RichTextEditor/index.tsx
  44. 0
    0
      src/components/Editor/RichTextEditorForSlate/RichTextEditorForSlate.less
  45. 49
    0
      src/components/Editor/RichTextEditorForSlate/index.tsx
  46. 3
    0
      src/components/Editor/index.ts
  47. 5
    6
      src/components/Payment/Common/PriceOptions/index.tsx
  48. 3
    2
      src/components/Payment/Common/WaitPayInfoView/index.tsx
  49. 8
    1
      src/typings/index.d.ts
  50. 3361
    0
      stats.html
  51. 55
    0
      stories/Editor.stories.tsx
  52. 0
    0
      stories/Payment.stories.tsx
  53. 1
    1
      tsconfig.json
  54. 279
    739
      yarn.lock

+ 0
- 8
.babelrc View File

@@ -5,14 +5,6 @@
5 5
     "@babel/preset-typescript"
6 6
   ],
7 7
   "plugins": [
8
-    [
9
-      "import",
10
-      {
11
-        "libraryName": "antd",
12
-        "style": true,   // or 'css'
13
-        "libraryDirectory": "es"
14
-      }
15
-    ],
16 8
     "@babel/plugin-proposal-class-properties"
17 9
     // "@babel/plugin-proposal-export-default-from"
18 10
   ]

+ 0
- 1
.storybook/config.js View File

@@ -18,5 +18,4 @@ configure(
18 18
 
19 19
 addDecorator((storyFn, context) => withConsole()(storyFn)(context));
20 20
 
21
-import 'antd/dist/antd.less';
22 21
 export { getStorybook }

+ 2
- 4
.storybook/webpack.config.js View File

@@ -2,6 +2,7 @@ const fs = require('fs');
2 2
 const path = require('path');
3 3
 
4 4
 module.exports = ({ config }) => {
5
+  config.resolve.modules =  ['node_modules'];
5 6
   config.module.rules.push({
6 7
     test: /\.stories\.tsx?$/,
7 8
     loaders: [require.resolve('@storybook/source-loader')],
@@ -48,10 +49,7 @@ module.exports = ({ config }) => {
48 49
       {
49 50
         loader: require.resolve('babel-loader'),
50 51
         options: {
51
-          presets: [['react-app', { flow: false, typescript: true }]],
52
-          "plugins": [
53
-            ["import", { "libraryName": "antd", "style": true }]
54
-          ]
52
+          presets: [['react-app', { flow: false, typescript: true }]]
55 53
         }
56 54
       },
57 55
       // Optional

+ 3
- 2
eslib/Common/index.js View File

@@ -1,4 +1,5 @@
1
-import '../style-inject.es-7ed2769c.js';
1
+import '../style-inject.es-b888177c.js';
2 2
 import 'react';
3
-export { T as Test } from '../test-4091af6f.js';
3
+import '../index-29b5a955.js';
4
+export { T as Test } from '../test-89de59f6.js';
4 5
 //# sourceMappingURL=index.js.map

+ 1
- 1
eslib/Common/index.js.map View File

@@ -1 +1 @@
1
-{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
1
+{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}

+ 58031
- 0
eslib/Editor/index.js
File diff suppressed because it is too large
View File


+ 1
- 0
eslib/Editor/index.js.map
File diff suppressed because it is too large
View File


+ 3
- 6
eslib/Payment/index.js View File

@@ -1,8 +1,5 @@
1
-import '../style-inject.es-7ed2769c.js';
1
+import '../style-inject.es-b888177c.js';
2 2
 import 'react';
3
-export { C as ConsumeListView, P as PayPlatformOptions, a as PriceOptions, W as WaitPayInfoView } from '../index-8e31d90e.js';
4
-import 'antd/es/input/style';
5
-import 'antd/es/input';
6
-import 'antd/es/button/style';
7
-import 'antd/es/button';
3
+import '../index-29b5a955.js';
4
+export { C as ConsumeListView, P as PayPlatformOptions, a as PriceOptions, W as WaitPayInfoView } from '../index-6e59934c.js';
8 5
 //# sourceMappingURL=index.js.map

+ 1
- 1
eslib/Payment/index.js.map View File

@@ -1 +1 @@
1
-{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
1
+{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}

+ 53
- 0
eslib/index-29b5a955.js View File

@@ -0,0 +1,53 @@
1
+import { c as createCommonjsModule } from './style-inject.es-b888177c.js';
2
+
3
+var classnames = createCommonjsModule(function (module) {
4
+/*!
5
+  Copyright (c) 2017 Jed Watson.
6
+  Licensed under the MIT License (MIT), see
7
+  http://jedwatson.github.io/classnames
8
+*/
9
+/* global define */
10
+
11
+(function () {
12
+
13
+	var hasOwn = {}.hasOwnProperty;
14
+
15
+	function classNames () {
16
+		var classes = [];
17
+
18
+		for (var i = 0; i < arguments.length; i++) {
19
+			var arg = arguments[i];
20
+			if (!arg) continue;
21
+
22
+			var argType = typeof arg;
23
+
24
+			if (argType === 'string' || argType === 'number') {
25
+				classes.push(arg);
26
+			} else if (Array.isArray(arg) && arg.length) {
27
+				var inner = classNames.apply(null, arg);
28
+				if (inner) {
29
+					classes.push(inner);
30
+				}
31
+			} else if (argType === 'object') {
32
+				for (var key in arg) {
33
+					if (hasOwn.call(arg, key) && arg[key]) {
34
+						classes.push(key);
35
+					}
36
+				}
37
+			}
38
+		}
39
+
40
+		return classes.join(' ');
41
+	}
42
+
43
+	if ( module.exports) {
44
+		classNames.default = classNames;
45
+		module.exports = classNames;
46
+	} else {
47
+		window.classNames = classNames;
48
+	}
49
+}());
50
+});
51
+
52
+export { classnames as c };
53
+//# sourceMappingURL=index-29b5a955.js.map

+ 1
- 0
eslib/index-29b5a955.js.map View File

@@ -0,0 +1 @@
1
+{"version":3,"file":"index-29b5a955.js","sources":["../node_modules/classnames/index.js"],"sourcesContent":["/*!\n  Copyright (c) 2017 Jed Watson.\n  Licensed under the MIT License (MIT), see\n  http://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames () {\n\t\tvar classes = [];\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (!arg) continue;\n\n\t\t\tvar argType = typeof arg;\n\n\t\t\tif (argType === 'string' || argType === 'number') {\n\t\t\t\tclasses.push(arg);\n\t\t\t} else if (Array.isArray(arg) && arg.length) {\n\t\t\t\tvar inner = classNames.apply(null, arg);\n\t\t\t\tif (inner) {\n\t\t\t\t\tclasses.push(inner);\n\t\t\t\t}\n\t\t\t} else if (argType === 'object') {\n\t\t\t\tfor (var key in arg) {\n\t\t\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\t\t\tclasses.push(key);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn classes.join(' ');\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n"],"names":[],"mappings":";;;;;;;;;;AAOA,CAAC,YAAY;;CAGZ,IAAI,MAAM,GAAG,EAAE,CAAC,cAAc,CAAC;;CAE/B,SAAS,UAAU,IAAI;EACtB,IAAI,OAAO,GAAG,EAAE,CAAC;;EAEjB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;GAC1C,IAAI,GAAG,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;GACvB,IAAI,CAAC,GAAG,EAAE,SAAS;;GAEnB,IAAI,OAAO,GAAG,OAAO,GAAG,CAAC;;GAEzB,IAAI,OAAO,KAAK,QAAQ,IAAI,OAAO,KAAK,QAAQ,EAAE;IACjD,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAClB,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,MAAM,EAAE;IAC5C,IAAI,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IACxC,IAAI,KAAK,EAAE;KACV,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;KACpB;IACD,MAAM,IAAI,OAAO,KAAK,QAAQ,EAAE;IAChC,KAAK,IAAI,GAAG,IAAI,GAAG,EAAE;KACpB,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,EAAE;MACtC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;MAClB;KACD;IACD;GACD;;EAED,OAAO,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;EACzB;;CAED,IAAI,CAAiC,MAAM,CAAC,OAAO,EAAE;EACpD,UAAU,CAAC,OAAO,GAAG,UAAU,CAAC;EAChC,cAAc,GAAG,UAAU,CAAC;EAC5B,MAAM,AAKA;EACN,MAAM,CAAC,UAAU,GAAG,UAAU,CAAC;EAC/B;CACD,EAAE,EAAE;;;;;"}

eslib/index-8e31d90e.js → eslib/index-6e59934c.js View File

@@ -1,9 +1,6 @@
1
-import { _ as _defineProperty, s as styleInject, b as _inherits, d as _createClass, e as _classCallCheck, f as _possibleConstructorReturn, h as _getPrototypeOf, i as classnames, j as _objectSpread2, k as _slicedToArray } from './style-inject.es-7ed2769c.js';
1
+import { _ as _defineProperty, s as styleInject, b as _inherits, d as _createClass, e as _classCallCheck, f as _possibleConstructorReturn, h as _getPrototypeOf, i as _objectSpread2, j as _slicedToArray } from './style-inject.es-b888177c.js';
2 2
 import React, { Component, PureComponent, useState } from 'react';
3
-import 'antd/es/input/style';
4
-import _Input from 'antd/es/input';
5
-import 'antd/es/button/style';
6
-import _Button from 'antd/es/button';
3
+import { c as classnames } from './index-29b5a955.js';
7 4
 
8 5
 var IMAGE_PROCESS = '?x-oss-process=image/resize,h_350';
9 6
 var IMAGE_PROCESS_SMALL = '?x-oss-process=image/resize,h_100';
@@ -363,7 +360,6 @@ var PriceOptions = function PriceOptions(_ref2) {
363 360
       onPriceChange = _ref2.onPriceChange,
364 361
       _ref2$size = _ref2.size,
365 362
       _ref2$focusScroll = _ref2.focusScroll,
366
-      focusScroll = _ref2$focusScroll === void 0 ? true : _ref2$focusScroll,
367 363
       _ref2$withTitle = _ref2.withTitle,
368 364
       withTitle = _ref2$withTitle === void 0 ? true : _ref2$withTitle,
369 365
       inputRef = _ref2.inputRef;
@@ -398,38 +394,7 @@ var PriceOptions = function PriceOptions(_ref2) {
398 394
     }, React.createElement(FormattedMessage, {
399 395
       id: "".concat(formatMoney(item / 100, 0), "\xA5")
400 396
     }));
401
-  })), React.createElement(_Input, {
402
-    ref: inputRef,
403
-    onMouseEnter: function onMouseEnter() {
404
-      if (inputStatus && inputRef && inputRef.current) {
405
-        inputRef.current.focus();
406
-        inputRef.current.select();
407
-      }
408
-    },
409
-    suffix: "\xA5",
410
-    className: styles$2.priceInput,
411
-    value: inputStatus ? price / 100 || "" : "",
412
-    placeholder: "Others",
413
-    onChange: function onChange(e) {
414
-      var n = +e.target.value;
415
-
416
-      if (Number.isNaN(n)) {
417
-        return;
418
-      } // 测试暂时改成1分
419
-
420
-
421
-      onPriceChange(n * 100);
422
-    },
423
-    onClick: function onClick(e) {
424
-      onPriceChange(0);
425
-      setInputStatus(true);
426
-    },
427
-    onFocus: function onFocus(e) {
428
-      if (focusScroll) {
429
-        e.target.scrollIntoView();
430
-      }
431
-    }
432
-  })));
397
+  }))));
433 398
 };
434 399
 
435 400
 var css$3 = ".WaitPayInfoView_waitingContainer__3wZ0a {\n  display: flex;\n  flex-direction: column;\n  justify-content: center;\n  align-items: center;\n}\n";
@@ -438,6 +403,14 @@ styleInject(css$3);
438 403
 
439 404
 const img$7 = 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iNDhweCIgaGVpZ2h0PSI0M3B4IiB2aWV3Qm94PSIwIDAgNDggNDMiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8IS0tIEdlbmVyYXRvcjogU2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ZSI+PC9wYXRoPgogICAgICAgICAgICAgICAgICAgIDwvZz4KICAgICAgICAgICAgICAgIDwvZz4KICAgICAgICAgICAgPC9nPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+';
440 405
 
406
+var Button = function Button() {
407
+  for (var _len = arguments.length, props = new Array(_len), _key = 0; _key < _len; _key++) {
408
+    props[_key] = arguments[_key];
409
+  }
410
+
411
+  return React.createElement("button", props, "button");
412
+};
413
+
441 414
 var WaitPayInfoView =
442 415
 /*#__PURE__*/
443 416
 function (_Component) {
@@ -466,13 +439,13 @@ function (_Component) {
466 439
         className: styles$3.pay_text
467 440
       }, "live.course_info.pay.notification"), React.createElement("div", {
468 441
         className: styles$3.btn_row
469
-      }, React.createElement(_Button, {
442
+      }, React.createElement(Button, {
470 443
         className: classnames(styles$3.pay_btn, styles$3.btn_default),
471 444
         size: "small",
472 445
         onClick: function onClick() {
473 446
           onClickPayed && onClickPayed();
474 447
         }
475
-      }, "live.course_info.pay.payed"), React.createElement(_Button, {
448
+      }, "live.course_info.pay.payed"), React.createElement(Button, {
476 449
         className: styles$3.btn_default,
477 450
         size: "small",
478 451
         style: {
@@ -498,4 +471,4 @@ _defineProperty(WaitPayInfoView, "defaultProps", {
498 471
 });
499 472
 
500 473
 export { ConsumeListView as C, PayPlatformOptions as P, WaitPayInfoView as W, PriceOptions as a };
501
-//# sourceMappingURL=index-8e31d90e.js.map
474
+//# sourceMappingURL=index-6e59934c.js.map

eslib/index-6e59934c.js.map
File diff suppressed because it is too large
View File


+ 4
- 7
eslib/index.js View File

@@ -1,11 +1,8 @@
1
-import { c as createCommonjsModule, g as getCjsExportFromNamespace, a as commonjsGlobal, u as unwrapExports } from './style-inject.es-7ed2769c.js';
1
+import { c as createCommonjsModule, g as getCjsExportFromNamespace, a as commonjsGlobal, u as unwrapExports } from './style-inject.es-b888177c.js';
2 2
 import 'react';
3
-import './test-4091af6f.js';
4
-export { C as ConsumeListView, P as PayPlatformOptions, a as PriceOptions, W as WaitPayInfoView } from './index-8e31d90e.js';
5
-import 'antd/es/input/style';
6
-import 'antd/es/input';
7
-import 'antd/es/button/style';
8
-import 'antd/es/button';
3
+import './index-29b5a955.js';
4
+import './test-89de59f6.js';
5
+export { C as ConsumeListView, P as PayPlatformOptions, a as PriceOptions, W as WaitPayInfoView } from './index-6e59934c.js';
9 6
 
10 7
 /*
11 8
 Copyright (c) 2014, Yahoo! Inc. All rights reserved.

+ 1
- 1
eslib/index.js.map
File diff suppressed because it is too large
View File


+ 0
- 1
eslib/style-inject.es-7ed2769c.js.map View File

@@ -1 +0,0 @@
1
-{"version":3,"file":"style-inject.es-7ed2769c.js","sources":["../node_modules/classnames/index.js","../node_modules/style-inject/dist/style-inject.es.js"],"sourcesContent":["/*!\n  Copyright (c) 2017 Jed Watson.\n  Licensed under the MIT License (MIT), see\n  http://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames () {\n\t\tvar classes = [];\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (!arg) continue;\n\n\t\t\tvar argType = typeof arg;\n\n\t\t\tif (argType === 'string' || argType === 'number') {\n\t\t\t\tclasses.push(arg);\n\t\t\t} else if (Array.isArray(arg) && arg.length) {\n\t\t\t\tvar inner = classNames.apply(null, arg);\n\t\t\t\tif (inner) {\n\t\t\t\t\tclasses.push(inner);\n\t\t\t\t}\n\t\t\t} else if (argType === 'object') {\n\t\t\t\tfor (var key in arg) {\n\t\t\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\t\t\tclasses.push(key);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn classes.join(' ');\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n","function styleInject(css, ref) {\n  if ( ref === void 0 ) ref = {};\n  var insertAt = ref.insertAt;\n\n  if (!css || typeof document === 'undefined') { return; }\n\n  var head = document.head || document.getElementsByTagName('head')[0];\n  var style = document.createElement('style');\n  style.type = 'text/css';\n\n  if (insertAt === 'top') {\n    if (head.firstChild) {\n      head.insertBefore(style, head.firstChild);\n    } else {\n      head.appendChild(style);\n    }\n  } else {\n    head.appendChild(style);\n  }\n\n  if (style.styleSheet) {\n    style.styleSheet.cssText = css;\n  } else {\n    style.appendChild(document.createTextNode(css));\n  }\n}\n\nexport default styleInject;\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,CAAC,YAAY;;CAGZ,IAAI,MAAM,GAAG,EAAE,CAAC,cAAc,CAAC;;CAE/B,SAAS,UAAU,IAAI;EACtB,IAAI,OAAO,GAAG,EAAE,CAAC;;EAEjB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;GAC1C,IAAI,GAAG,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;GACvB,IAAI,CAAC,GAAG,EAAE,SAAS;;GAEnB,IAAI,OAAO,GAAG,OAAO,GAAG,CAAC;;GAEzB,IAAI,OAAO,KAAK,QAAQ,IAAI,OAAO,KAAK,QAAQ,EAAE;IACjD,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAClB,MAAM,IAAI,KAAK,CAAC,OAAO,C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B,IAAI,IAAI,CAAC,UAAU,EAAE;MACnB,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;KAC3C,MAAM;MACL,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;KACzB;GACF,MAAM;IACL,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;GACzB;;EAED,IAAI,KAAK,CAAC,UAAU,EAAE;IACpB,KAAK,CAAC,UAAU,CAAC,OAAO,GAAG,GAAG,CAAC;GAChC,MAAM;IACL,KAAK,CAAC,WAAW,CAAC,QAAQ,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC;GACjD;CACF;;;;"}

eslib/style-inject.es-7ed2769c.js → eslib/style-inject.es-b888177c.js View File

@@ -172,55 +172,6 @@ function _nonIterableRest() {
172 172
   throw new TypeError("Invalid attempt to destructure non-iterable instance");
173 173
 }
174 174
 
175
-var classnames = createCommonjsModule(function (module) {
176
-/*!
177
-  Copyright (c) 2017 Jed Watson.
178
-  Licensed under the MIT License (MIT), see
179
-  http://jedwatson.github.io/classnames
180
-*/
181
-/* global define */
182
-
183
-(function () {
184
-
185
-	var hasOwn = {}.hasOwnProperty;
186
-
187
-	function classNames () {
188
-		var classes = [];
189
-
190
-		for (var i = 0; i < arguments.length; i++) {
191
-			var arg = arguments[i];
192
-			if (!arg) continue;
193
-
194
-			var argType = typeof arg;
195
-
196
-			if (argType === 'string' || argType === 'number') {
197
-				classes.push(arg);
198
-			} else if (Array.isArray(arg) && arg.length) {
199
-				var inner = classNames.apply(null, arg);
200
-				if (inner) {
201
-					classes.push(inner);
202
-				}
203
-			} else if (argType === 'object') {
204
-				for (var key in arg) {
205
-					if (hasOwn.call(arg, key) && arg[key]) {
206
-						classes.push(key);
207
-					}
208
-				}
209
-			}
210
-		}
211
-
212
-		return classes.join(' ');
213
-	}
214
-
215
-	if ( module.exports) {
216
-		classNames.default = classNames;
217
-		module.exports = classNames;
218
-	} else {
219
-		window.classNames = classNames;
220
-	}
221
-}());
222
-});
223
-
224 175
 function styleInject(css, ref) {
225 176
   if ( ref === void 0 ) ref = {};
226 177
   var insertAt = ref.insertAt;
@@ -248,5 +199,5 @@ function styleInject(css, ref) {
248 199
   }
249 200
 }
250 201
 
251
-export { _defineProperty as _, commonjsGlobal as a, _inherits as b, createCommonjsModule as c, _createClass as d, _classCallCheck as e, _possibleConstructorReturn as f, getCjsExportFromNamespace as g, _getPrototypeOf as h, classnames as i, _objectSpread2 as j, _slicedToArray as k, styleInject as s, unwrapExports as u };
252
-//# sourceMappingURL=style-inject.es-7ed2769c.js.map
202
+export { _defineProperty as _, commonjsGlobal as a, _inherits as b, createCommonjsModule as c, _createClass as d, _classCallCheck as e, _possibleConstructorReturn as f, getCjsExportFromNamespace as g, _getPrototypeOf as h, _objectSpread2 as i, _slicedToArray as j, _assertThisInitialized as k, styleInject as s, unwrapExports as u };
203
+//# sourceMappingURL=style-inject.es-b888177c.js.map

+ 1
- 0
eslib/style-inject.es-b888177c.js.map View File

@@ -0,0 +1 @@
1
+{"version":3,"file":"style-inject.es-b888177c.js","sources":["../node_modules/style-inject/dist/style-inject.es.js"],"sourcesContent":["function styleInject(css, ref) {\n  if ( ref === void 0 ) ref = {};\n  var insertAt = ref.insertAt;\n\n  if (!css || typeof document === 'undefined') { return; }\n\n  var head = document.head || document.getElementsByTagName('head')[0];\n  var style = document.createElement('style');\n  style.type = 'text/css';\n\n  if (insertAt === 'top') {\n    if (head.firstChild) {\n      head.insertBefore(style, head.firstChild);\n    } else {\n      head.appendChild(style);\n    }\n  } else {\n    head.appendChild(style);\n  }\n\n  if (style.styleSheet) {\n    style.styleSheet.cssText = css;\n  } else {\n    style.appendChild(document.createTextNode(css));\n  }\n}\n\nexport default styleInject;\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,WAAW,CAAC,GAAG,EAAE,GAAG,EAAE;EAC7B,KAAK,GAAG,KAAK,KAAK,CAAC,GAAG,GAAG,GAAG,EAAE,CAAC;EAC/B,IAAI,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC;;EAE5B,IAAI,CAAC,GAAG,IAAI,OAAO,QAAQ,KAAK,WAAW,EAAE,EAAE,OAAO,EAAE;;EAExD,IAAI,IAAI,GAAG,QAAQ,CAAC,IAAI,IAAI,QAAQ,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;EACrE,IAAI,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;EAC5C,KAAK,CAAC,IAAI,GAAG,UAAU,CAAC;;EAExB,IAAI,QAAQ,KAAK,KAAK,EAAE;IACtB,IAAI,IAAI,CAAC,UAAU,EAAE;MACnB,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;KAC3C,MAAM;MACL,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;KACzB;GACF,MAAM;IACL,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;GACzB;;EAED,IAAI,KAAK,CAAC,UAAU,EAAE;IACpB,KAAK,CAAC,UAAU,CAAC,OAAO,GAAG,GAAG,CAAC;GAChC,MAAM;IACL,KAAK,CAAC,WAAW,CAAC,QAAQ,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC;GACjD;CACF;;;;"}

eslib/test-4091af6f.js → eslib/test-89de59f6.js View File

@@ -1,5 +1,6 @@
1
-import { s as styleInject } from './style-inject.es-7ed2769c.js';
1
+import { s as styleInject } from './style-inject.es-b888177c.js';
2 2
 import 'react';
3
+import './index-29b5a955.js';
3 4
 
4 5
 var css = ".test_red__36-3- {\n  color: red;\n}\n";
5 6
 styleInject(css);
@@ -70,4 +71,4 @@ styleInject(css);
70 71
 var Test = "TestComponent";
71 72
 
72 73
 export { Test as T };
73
-//# sourceMappingURL=test-4091af6f.js.map
74
+//# sourceMappingURL=test-89de59f6.js.map

eslib/test-89de59f6.js.map
File diff suppressed because it is too large
View File


+ 3
- 2
lib/Common/index.js View File

@@ -2,9 +2,10 @@
2 2
 
3 3
 Object.defineProperty(exports, '__esModule', { value: true });
4 4
 
5
-require('../style-inject.es-3827494b.js');
5
+require('../style-inject.es-7b2c2b1b.js');
6 6
 require('react');
7
-var test = require('../test-b93e5209.js');
7
+require('../index-671ea010.js');
8
+var test = require('../test-f419c2cb.js');
8 9
 
9 10
 
10 11
 

+ 1
- 1
lib/Common/index.js.map View File

@@ -1 +1 @@
1
-{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;"}
1
+{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}

+ 58040
- 0
lib/Editor/index.js
File diff suppressed because it is too large
View File


+ 1
- 0
lib/Editor/index.js.map
File diff suppressed because it is too large
View File


+ 7
- 10
lib/Payment/index.js View File

@@ -2,18 +2,15 @@
2 2
 
3 3
 Object.defineProperty(exports, '__esModule', { value: true });
4 4
 
5
-require('../style-inject.es-3827494b.js');
5
+require('../style-inject.es-7b2c2b1b.js');
6 6
 require('react');
7
-var index = require('../index-e808551e.js');
8
-require('antd/es/input/style');
9
-require('antd/es/input');
10
-require('antd/es/button/style');
11
-require('antd/es/button');
7
+require('../index-671ea010.js');
8
+var index$1 = require('../index-fe1b29d9.js');
12 9
 
13 10
 
14 11
 
15
-exports.ConsumeListView = index.ConsumeListView;
16
-exports.PayPlatformOptions = index.PayPlatformOptions;
17
-exports.PriceOptions = index.PriceOptions;
18
-exports.WaitPayInfoView = index.WaitPayInfoView;
12
+exports.ConsumeListView = index$1.ConsumeListView;
13
+exports.PayPlatformOptions = index$1.PayPlatformOptions;
14
+exports.PriceOptions = index$1.PriceOptions;
15
+exports.WaitPayInfoView = index$1.WaitPayInfoView;
19 16
 //# sourceMappingURL=index.js.map

+ 1
- 1
lib/Payment/index.js.map View File

@@ -1 +1 @@
1
-{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;"}
1
+{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;"}

+ 55
- 0
lib/index-671ea010.js View File

@@ -0,0 +1,55 @@
1
+'use strict';
2
+
3
+var styleInject_es = require('./style-inject.es-7b2c2b1b.js');
4
+
5
+var classnames = styleInject_es.createCommonjsModule(function (module) {
6
+/*!
7
+  Copyright (c) 2017 Jed Watson.
8
+  Licensed under the MIT License (MIT), see
9
+  http://jedwatson.github.io/classnames
10
+*/
11
+/* global define */
12
+
13
+(function () {
14
+
15
+	var hasOwn = {}.hasOwnProperty;
16
+
17
+	function classNames () {
18
+		var classes = [];
19
+
20
+		for (var i = 0; i < arguments.length; i++) {
21
+			var arg = arguments[i];
22
+			if (!arg) continue;
23
+
24
+			var argType = typeof arg;
25
+
26
+			if (argType === 'string' || argType === 'number') {
27
+				classes.push(arg);
28
+			} else if (Array.isArray(arg) && arg.length) {
29
+				var inner = classNames.apply(null, arg);
30
+				if (inner) {
31
+					classes.push(inner);
32
+				}
33
+			} else if (argType === 'object') {
34
+				for (var key in arg) {
35
+					if (hasOwn.call(arg, key) && arg[key]) {
36
+						classes.push(key);
37
+					}
38
+				}
39
+			}
40
+		}
41
+
42
+		return classes.join(' ');
43
+	}
44
+
45
+	if ( module.exports) {
46
+		classNames.default = classNames;
47
+		module.exports = classNames;
48
+	} else {
49
+		window.classNames = classNames;
50
+	}
51
+}());
52
+});
53
+
54
+exports.classnames = classnames;
55
+//# sourceMappingURL=index-671ea010.js.map

+ 1
- 0
lib/index-671ea010.js.map View File

@@ -0,0 +1 @@
1
+{"version":3,"file":"index-29b5a955.js","sources":["../node_modules/classnames/index.js"],"sourcesContent":["/*!\n  Copyright (c) 2017 Jed Watson.\n  Licensed under the MIT License (MIT), see\n  http://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames () {\n\t\tvar classes = [];\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (!arg) continue;\n\n\t\t\tvar argType = typeof arg;\n\n\t\t\tif (argType === 'string' || argType === 'number') {\n\t\t\t\tclasses.push(arg);\n\t\t\t} else if (Array.isArray(arg) && arg.length) {\n\t\t\t\tvar inner = classNames.apply(null, arg);\n\t\t\t\tif (inner) {\n\t\t\t\t\tclasses.push(inner);\n\t\t\t\t}\n\t\t\t} else if (argType === 'object') {\n\t\t\t\tfor (var key in arg) {\n\t\t\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\t\t\tclasses.push(key);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn classes.join(' ');\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n"],"names":[],"mappings":";;;;;;;;;;;;AAOA,CAAC,YAAY;;CAGZ,IAAI,MAAM,GAAG,EAAE,CAAC,cAAc,CAAC;;CAE/B,SAAS,UAAU,IAAI;EACtB,IAAI,OAAO,GAAG,EAAE,CAAC;;EAEjB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;GAC1C,IAAI,GAAG,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;GACvB,IAAI,CAAC,GAAG,EAAE,SAAS;;GAEnB,IAAI,OAAO,GAAG,OAAO,GAAG,CAAC;;GAEzB,IAAI,OAAO,KAAK,QAAQ,IAAI,OAAO,KAAK,QAAQ,EAAE;IACjD,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAClB,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,MAAM,EAAE;IAC5C,IAAI,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IACxC,IAAI,KAAK,EAAE;KACV,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;KACpB;IACD,MAAM,IAAI,OAAO,KAAK,QAAQ,EAAE;IAChC,KAAK,IAAI,GAAG,IAAI,GAAG,EAAE;KACpB,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,EAAE;MACtC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;MAClB;KACD;IACD;GACD;;EAED,OAAO,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;EACzB;;CAED,IAAI,CAAiC,MAAM,CAAC,OAAO,EAAE;EACpD,UAAU,CAAC,OAAO,GAAG,UAAU,CAAC;EAChC,cAAc,GAAG,UAAU,CAAC;EAC5B,MAAM,AAKA;EACN,MAAM,CAAC,UAAU,GAAG,UAAU,CAAC;EAC/B;CACD,EAAE,EAAE;;;;;"}

lib/index-e808551e.js → lib/index-fe1b29d9.js View File

@@ -2,13 +2,10 @@
2 2
 
3 3
 function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
4 4
 
5
-var styleInject_es = require('./style-inject.es-3827494b.js');
5
+var styleInject_es = require('./style-inject.es-7b2c2b1b.js');
6 6
 var React = require('react');
7 7
 var React__default = _interopDefault(React);
8
-require('antd/es/input/style');
9
-var _Input = _interopDefault(require('antd/es/input'));
10
-require('antd/es/button/style');
11
-var _Button = _interopDefault(require('antd/es/button'));
8
+var index = require('./index-671ea010.js');
12 9
 
13 10
 var IMAGE_PROCESS = '?x-oss-process=image/resize,h_350';
14 11
 var IMAGE_PROCESS_SMALL = '?x-oss-process=image/resize,h_100';
@@ -147,7 +144,7 @@ function (_Component) {
147 144
         onClick: function onClick() {
148 145
           return onToggleChange();
149 146
         },
150
-        className: styleInject_es.classnames(styles.toggle, styleInject_es._defineProperty({}, styles.expand, isToggle)),
147
+        className: index.classnames(styles.toggle, styleInject_es._defineProperty({}, styles.expand, isToggle)),
151 148
         style: {
152 149
           width: "".concat(avatarSize, "px"),
153 150
           height: "".concat(avatarSize, "px"),
@@ -259,13 +256,13 @@ function (_PureComponent) {
259 256
         var _objectSpread2, _objectSpread3, _objectSpread4;
260 257
 
261 258
         return React__default.createElement("div", null, titleDOM, React__default.createElement("div", {
262
-          className: styleInject_es.classnames(styles$1["payment-method-box"], styleInject_es._defineProperty({}, styles$1.mobile, isMobile))
259
+          className: index.classnames(styles$1["payment-method-box"], styleInject_es._defineProperty({}, styles$1.mobile, isMobile))
263 260
         }, React__default.createElement("div", {
264 261
           className: styles$1.flexContainer
265 262
         }, React__default.createElement("div", {
266 263
           className: styles$1.flexItem
267 264
         }, React__default.createElement("div", {
268
-          className: styleInject_es.classnames(styleInject_es._objectSpread2((_objectSpread2 = {}, styleInject_es._defineProperty(_objectSpread2, styles$1.payitem, true), styleInject_es._defineProperty(_objectSpread2, styles$1.active, payitem === PAY_CHANNEL.ALI_WEB), _objectSpread2), exportStyleSizeClass(styles$1, size)), styles$1[locale]),
265
+          className: index.classnames(styleInject_es._objectSpread2((_objectSpread2 = {}, styleInject_es._defineProperty(_objectSpread2, styles$1.payitem, true), styleInject_es._defineProperty(_objectSpread2, styles$1.active, payitem === PAY_CHANNEL.ALI_WEB), _objectSpread2), exportStyleSizeClass(styles$1, size)), styles$1[locale]),
269 266
           onClick: function onClick() {
270 267
             onPayItemChange(PAY_CHANNEL.ALI_WEB);
271 268
           }
@@ -278,7 +275,7 @@ function (_PureComponent) {
278 275
         }, "\u652F\u4ED8\u5B9D"))), React__default.createElement("div", {
279 276
           className: styles$1.flexItem
280 277
         }, React__default.createElement("div", {
281
-          className: styleInject_es.classnames(styleInject_es._objectSpread2((_objectSpread3 = {}, styleInject_es._defineProperty(_objectSpread3, styles$1.payitem, true), styleInject_es._defineProperty(_objectSpread3, styles$1.active, payitem === PAY_CHANNEL.WX_NATIVE), _objectSpread3), exportStyleSizeClass(styles$1, size)), styles$1[locale]),
278
+          className: index.classnames(styleInject_es._objectSpread2((_objectSpread3 = {}, styleInject_es._defineProperty(_objectSpread3, styles$1.payitem, true), styleInject_es._defineProperty(_objectSpread3, styles$1.active, payitem === PAY_CHANNEL.WX_NATIVE), _objectSpread3), exportStyleSizeClass(styles$1, size)), styles$1[locale]),
282 279
           onClick: function onClick() {
283 280
             onPayItemChange(PAY_CHANNEL.WX_NATIVE);
284 281
           }
@@ -291,7 +288,7 @@ function (_PureComponent) {
291 288
         }, "\u5FAE\u4FE1"))), React__default.createElement("div", {
292 289
           className: styles$1.flexItem
293 290
         }, React__default.createElement("div", {
294
-          className: styleInject_es.classnames(styleInject_es._objectSpread2((_objectSpread4 = {}, styleInject_es._defineProperty(_objectSpread4, styles$1.payitem, true), styleInject_es._defineProperty(_objectSpread4, styles$1.active, payitem === PAY_CHANNEL.PAYPAL), _objectSpread4), exportStyleSizeClass(styles$1, size)), styles$1[locale]),
291
+          className: index.classnames(styleInject_es._objectSpread2((_objectSpread4 = {}, styleInject_es._defineProperty(_objectSpread4, styles$1.payitem, true), styleInject_es._defineProperty(_objectSpread4, styles$1.active, payitem === PAY_CHANNEL.PAYPAL), _objectSpread4), exportStyleSizeClass(styles$1, size)), styles$1[locale]),
295 292
           onClick: function onClick() {
296 293
             onPayItemChange(PAY_CHANNEL.PAYPAL);
297 294
           }
@@ -311,7 +308,7 @@ function (_PureComponent) {
311 308
       }, React__default.createElement("div", {
312 309
         className: styles$1.flexItem
313 310
       }, React__default.createElement("div", {
314
-        className: styleInject_es.classnames(styleInject_es._objectSpread2((_objectSpread5 = {}, styleInject_es._defineProperty(_objectSpread5, styles$1.payitem, true), styleInject_es._defineProperty(_objectSpread5, styles$1.active, payitem === PAY_CHANNEL.ALI_WEB), _objectSpread5), exportStyleSizeClass(styles$1, size)), styles$1[locale]),
311
+        className: index.classnames(styleInject_es._objectSpread2((_objectSpread5 = {}, styleInject_es._defineProperty(_objectSpread5, styles$1.payitem, true), styleInject_es._defineProperty(_objectSpread5, styles$1.active, payitem === PAY_CHANNEL.ALI_WEB), _objectSpread5), exportStyleSizeClass(styles$1, size)), styles$1[locale]),
315 312
         onClick: function onClick() {
316 313
           onPayItemChange(PAY_CHANNEL.ALI_WEB);
317 314
         }
@@ -324,7 +321,7 @@ function (_PureComponent) {
324 321
       }))), React__default.createElement("div", {
325 322
         className: styles$1.flexItem
326 323
       }, React__default.createElement("div", {
327
-        className: styleInject_es.classnames(styleInject_es._objectSpread2((_objectSpread6 = {}, styleInject_es._defineProperty(_objectSpread6, styles$1.payitem, true), styleInject_es._defineProperty(_objectSpread6, styles$1.active, payitem === PAY_CHANNEL.WX_NATIVE), _objectSpread6), exportStyleSizeClass(styles$1, size)), styles$1[locale]),
324
+        className: index.classnames(styleInject_es._objectSpread2((_objectSpread6 = {}, styleInject_es._defineProperty(_objectSpread6, styles$1.payitem, true), styleInject_es._defineProperty(_objectSpread6, styles$1.active, payitem === PAY_CHANNEL.WX_NATIVE), _objectSpread6), exportStyleSizeClass(styles$1, size)), styles$1[locale]),
328 325
         onClick: function onClick() {
329 326
           onPayItemChange(PAY_CHANNEL.WX_NATIVE);
330 327
         }
@@ -337,7 +334,7 @@ function (_PureComponent) {
337 334
       }))), React__default.createElement("div", {
338 335
         className: styles$1.flexItem
339 336
       }, React__default.createElement("div", {
340
-        className: styleInject_es.classnames(styleInject_es._objectSpread2((_objectSpread7 = {}, styleInject_es._defineProperty(_objectSpread7, styles$1.payitem, true), styleInject_es._defineProperty(_objectSpread7, styles$1.active, payitem === PAY_CHANNEL.PAYPAL), _objectSpread7), exportStyleSizeClass(styles$1, size)), styles$1[locale]),
337
+        className: index.classnames(styleInject_es._objectSpread2((_objectSpread7 = {}, styleInject_es._defineProperty(_objectSpread7, styles$1.payitem, true), styleInject_es._defineProperty(_objectSpread7, styles$1.active, payitem === PAY_CHANNEL.PAYPAL), _objectSpread7), exportStyleSizeClass(styles$1, size)), styles$1[locale]),
341 338
         onClick: function onClick() {
342 339
           onPayItemChange(PAY_CHANNEL.PAYPAL);
343 340
         }
@@ -368,7 +365,6 @@ var PriceOptions = function PriceOptions(_ref2) {
368 365
       onPriceChange = _ref2.onPriceChange,
369 366
       _ref2$size = _ref2.size,
370 367
       _ref2$focusScroll = _ref2.focusScroll,
371
-      focusScroll = _ref2$focusScroll === void 0 ? true : _ref2$focusScroll,
372 368
       _ref2$withTitle = _ref2.withTitle,
373 369
       withTitle = _ref2$withTitle === void 0 ? true : _ref2$withTitle,
374 370
       inputRef = _ref2.inputRef;
@@ -380,7 +376,7 @@ var PriceOptions = function PriceOptions(_ref2) {
380 376
       setInputStatus = _useState2[1];
381 377
 
382 378
   return React__default.createElement("div", {
383
-    className: styleInject_es.classnames(styles$2.options)
379
+    className: index.classnames(styles$2.options)
384 380
   }, withTitle ? React__default.createElement("p", null, React__default.createElement(FormattedMessage, {
385 381
     id: "pay.price.select.text"
386 382
   })) : null, React__default.createElement("div", {
@@ -394,7 +390,7 @@ var PriceOptions = function PriceOptions(_ref2) {
394 390
     var _classnames;
395 391
 
396 392
     return React__default.createElement("span", {
397
-      className: styleInject_es.classnames((_classnames = {}, styleInject_es._defineProperty(_classnames, styles$2.priceItem, true), styleInject_es._defineProperty(_classnames, styles$2.active, price === item && !inputStatus), _classnames)),
393
+      className: index.classnames((_classnames = {}, styleInject_es._defineProperty(_classnames, styles$2.priceItem, true), styleInject_es._defineProperty(_classnames, styles$2.active, price === item && !inputStatus), _classnames)),
398 394
       key: item,
399 395
       onClick: function onClick() {
400 396
         onPriceChange(item);
@@ -403,38 +399,7 @@ var PriceOptions = function PriceOptions(_ref2) {
403 399
     }, React__default.createElement(FormattedMessage, {
404 400
       id: "".concat(formatMoney(item / 100, 0), "\xA5")
405 401
     }));
406
-  })), React__default.createElement(_Input, {
407
-    ref: inputRef,
408
-    onMouseEnter: function onMouseEnter() {
409
-      if (inputStatus && inputRef && inputRef.current) {
410
-        inputRef.current.focus();
411
-        inputRef.current.select();
412
-      }
413
-    },
414
-    suffix: "\xA5",
415
-    className: styles$2.priceInput,
416
-    value: inputStatus ? price / 100 || "" : "",
417
-    placeholder: "Others",
418
-    onChange: function onChange(e) {
419
-      var n = +e.target.value;
420
-
421
-      if (Number.isNaN(n)) {
422
-        return;
423
-      } // 测试暂时改成1分
424
-
425
-
426
-      onPriceChange(n * 100);
427
-    },
428
-    onClick: function onClick(e) {
429
-      onPriceChange(0);
430
-      setInputStatus(true);
431
-    },
432
-    onFocus: function onFocus(e) {
433
-      if (focusScroll) {
434
-        e.target.scrollIntoView();
435
-      }
436
-    }
437
-  })));
402
+  }))));
438 403
 };
439 404
 
440 405
 var css$3 = ".WaitPayInfoView_waitingContainer__3wZ0a {\n  display: flex;\n  flex-direction: column;\n  justify-content: center;\n  align-items: center;\n}\n";
@@ -443,6 +408,14 @@ styleInject_es.styleInject(css$3);
443 408
 
444 409
 const img$7 = 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iNDhweCIgaGVpZ2h0PSI0M3B4IiB2aWV3Qm94PSIwIDAgNDggNDMiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8IS0tIEdlbmVyYXRvcjogU2tldGNoIDUwLjIgKDU1MDQ3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AgICAgICAgICAgIDwvZz4KICAgICAgICAgICAgICAgIDwvZz4KICAgICAgICAgICAgPC9nPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+';
445 410
 
411
+var Button = function Button() {
412
+  for (var _len = arguments.length, props = new Array(_len), _key = 0; _key < _len; _key++) {
413
+    props[_key] = arguments[_key];
414
+  }
415
+
416
+  return React__default.createElement("button", props, "button");
417
+};
418
+
446 419
 var WaitPayInfoView =
447 420
 /*#__PURE__*/
448 421
 function (_Component) {
@@ -471,13 +444,13 @@ function (_Component) {
471 444
         className: styles$3.pay_text
472 445
       }, "live.course_info.pay.notification"), React__default.createElement("div", {
473 446
         className: styles$3.btn_row
474
-      }, React__default.createElement(_Button, {
475
-        className: styleInject_es.classnames(styles$3.pay_btn, styles$3.btn_default),
447
+      }, React__default.createElement(Button, {
448
+        className: index.classnames(styles$3.pay_btn, styles$3.btn_default),
476 449
         size: "small",
477 450
         onClick: function onClick() {
478 451
           onClickPayed && onClickPayed();
479 452
         }
480
-      }, "live.course_info.pay.payed"), React__default.createElement(_Button, {
453
+      }, "live.course_info.pay.payed"), React__default.createElement(Button, {
481 454
         className: styles$3.btn_default,
482 455
         size: "small",
483 456
         style: {
@@ -506,4 +479,4 @@ exports.ConsumeListView = ConsumeListView;
506 479
 exports.PayPlatformOptions = PayPlatformOptions;
507 480
 exports.PriceOptions = PriceOptions;
508 481
 exports.WaitPayInfoView = WaitPayInfoView;
509
-//# sourceMappingURL=index-e808551e.js.map
482
+//# sourceMappingURL=index-fe1b29d9.js.map

lib/index-fe1b29d9.js.map
File diff suppressed because it is too large
View File


+ 8
- 11
lib/index.js View File

@@ -2,14 +2,11 @@
2 2
 
3 3
 Object.defineProperty(exports, '__esModule', { value: true });
4 4
 
5
-var styleInject_es = require('./style-inject.es-3827494b.js');
5
+var styleInject_es = require('./style-inject.es-7b2c2b1b.js');
6 6
 require('react');
7
-require('./test-b93e5209.js');
8
-var index = require('./index-e808551e.js');
9
-require('antd/es/input/style');
10
-require('antd/es/input');
11
-require('antd/es/button/style');
12
-require('antd/es/button');
7
+require('./index-671ea010.js');
8
+require('./test-f419c2cb.js');
9
+var index$1 = require('./index-fe1b29d9.js');
13 10
 
14 11
 /*
15 12
 Copyright (c) 2014, Yahoo! Inc. All rights reserved.
@@ -3149,10 +3146,10 @@ var langs = {
3149 3146
 };
3150 3147
 var kiwiIntl = KiwiIntl.init('en_US', langs);
3151 3148
 
3152
-exports.ConsumeListView = index.ConsumeListView;
3153
-exports.PayPlatformOptions = index.PayPlatformOptions;
3154
-exports.PriceOptions = index.PriceOptions;
3155
-exports.WaitPayInfoView = index.WaitPayInfoView;
3149
+exports.ConsumeListView = index$1.ConsumeListView;
3150
+exports.PayPlatformOptions = index$1.PayPlatformOptions;
3151
+exports.PriceOptions = index$1.PriceOptions;
3152
+exports.WaitPayInfoView = index$1.WaitPayInfoView;
3156 3153
 exports.Test = Test;
3157 3154
 exports.kiwiIntl = kiwiIntl;
3158 3155
 //# sourceMappingURL=index.js.map

+ 1
- 1
lib/index.js.map
File diff suppressed because it is too large
View File


+ 0
- 1
lib/style-inject.es-3827494b.js.map View File

@@ -1 +0,0 @@
1
-{"version":3,"file":"style-inject.es-7ed2769c.js","sources":["../node_modules/classnames/index.js","../node_modules/style-inject/dist/style-inject.es.js"],"sourcesContent":["/*!\n  Copyright (c) 2017 Jed Watson.\n  Licensed under the MIT License (MIT), see\n  http://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames () {\n\t\tvar classes = [];\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (!arg) continue;\n\n\t\t\tvar argType = typeof arg;\n\n\t\t\tif (argType === 'string' || argType === 'number') {\n\t\t\t\tclasses.push(arg);\n\t\t\t} else if (Array.isArray(arg) && arg.length) {\n\t\t\t\tvar inner = classNames.apply(null, arg);\n\t\t\t\tif (inner) {\n\t\t\t\t\tclasses.push(inner);\n\t\t\t\t}\n\t\t\t} else if (argType === 'object') {\n\t\t\t\tfor (var key in arg) {\n\t\t\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\t\t\tclasses.push(key);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn classes.join(' ');\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n","function styleInject(css, ref) {\n  if ( ref === void 0 ) ref = {};\n  var insertAt = ref.insertAt;\n\n  if (!css || typeof document === 'undefined') { return; }\n\n  var head = document.head || document.getElementsByTagName('head')[0];\n  var style = document.createElement('style');\n  style.type = 'text/css';\n\n  if (insertAt === 'top') {\n    if (head.firstChild) {\n      head.insertBefore(style, head.firstChild);\n    } else {\n      head.appendChild(style);\n    }\n  } else {\n    head.appendChild(style);\n  }\n\n  if (style.styleSheet) {\n    style.styleSheet.cssText = css;\n  } else {\n    style.appendChild(document.createTextNode(css));\n  }\n}\n\nexport default styleInject;\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,CAAC,YAAY;;CAGZ,IAAI,MAAM,GAAG,EAAE,CAAC,cAAc,CAAC;;CAE/B,SAAS,UAAU,IAAI;EACtB,IAAI,OAAO,GAAG,EAAE,CAAC;;EAEjB,KAAK,IAAI,CAAC,GAAG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AAC;;EAE5B,IAAI,CAAC,GAAG,IAAI,OAAO,QAAQ,KAAK,WAAW,EAAE,EAAE,OAAO,EAAE;;EAExD,IAAI,IAAI,GAAG,QAAQ,CAAC,IAAI,IAAI,QAAQ,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;EACrE,IAAI,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;EAC5C,KAAK,CAAC,IAAI,GAAG,UAAU,CAAC;;EAExB,IAAI,QAAQ,KAAK,KAAK,EAAE;IACtB,IAAI,IAAI,CAAC,UAAU,EAAE;MACnB,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;KAC3C,MAAM;MACL,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;KACzB;GACF,MAAM;IACL,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;GACzB;;EAED,IAAI,KAAK,CAAC,UAAU,EAAE;IACpB,KAAK,CAAC,UAAU,CAAC,OAAO,GAAG,GAAG,CAAC;GAChC,MAAM;IACL,KAAK,CAAC,WAAW,CAAC,QAAQ,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC;GACjD;CACF;;;;;;;;;;;;;;;;;"}

lib/style-inject.es-3827494b.js → lib/style-inject.es-7b2c2b1b.js View File

@@ -174,55 +174,6 @@ function _nonIterableRest() {
174 174
   throw new TypeError("Invalid attempt to destructure non-iterable instance");
175 175
 }
176 176
 
177
-var classnames = createCommonjsModule(function (module) {
178
-/*!
179
-  Copyright (c) 2017 Jed Watson.
180
-  Licensed under the MIT License (MIT), see
181
-  http://jedwatson.github.io/classnames
182
-*/
183
-/* global define */
184
-
185
-(function () {
186
-
187
-	var hasOwn = {}.hasOwnProperty;
188
-
189
-	function classNames () {
190
-		var classes = [];
191
-
192
-		for (var i = 0; i < arguments.length; i++) {
193
-			var arg = arguments[i];
194
-			if (!arg) continue;
195
-
196
-			var argType = typeof arg;
197
-
198
-			if (argType === 'string' || argType === 'number') {
199
-				classes.push(arg);
200
-			} else if (Array.isArray(arg) && arg.length) {
201
-				var inner = classNames.apply(null, arg);
202
-				if (inner) {
203
-					classes.push(inner);
204
-				}
205
-			} else if (argType === 'object') {
206
-				for (var key in arg) {
207
-					if (hasOwn.call(arg, key) && arg[key]) {
208
-						classes.push(key);
209
-					}
210
-				}
211
-			}
212
-		}
213
-
214
-		return classes.join(' ');
215
-	}
216
-
217
-	if ( module.exports) {
218
-		classNames.default = classNames;
219
-		module.exports = classNames;
220
-	} else {
221
-		window.classNames = classNames;
222
-	}
223
-}());
224
-});
225
-
226 177
 function styleInject(css, ref) {
227 178
   if ( ref === void 0 ) ref = {};
228 179
   var insertAt = ref.insertAt;
@@ -250,6 +201,7 @@ function styleInject(css, ref) {
250 201
   }
251 202
 }
252 203
 
204
+exports._assertThisInitialized = _assertThisInitialized;
253 205
 exports._classCallCheck = _classCallCheck;
254 206
 exports._createClass = _createClass;
255 207
 exports._defineProperty = _defineProperty;
@@ -258,10 +210,9 @@ exports._inherits = _inherits;
258 210
 exports._objectSpread2 = _objectSpread2;
259 211
 exports._possibleConstructorReturn = _possibleConstructorReturn;
260 212
 exports._slicedToArray = _slicedToArray;
261
-exports.classnames = classnames;
262 213
 exports.commonjsGlobal = commonjsGlobal;
263 214
 exports.createCommonjsModule = createCommonjsModule;
264 215
 exports.getCjsExportFromNamespace = getCjsExportFromNamespace;
265 216
 exports.styleInject = styleInject;
266 217
 exports.unwrapExports = unwrapExports;
267
-//# sourceMappingURL=style-inject.es-3827494b.js.map
218
+//# sourceMappingURL=style-inject.es-7b2c2b1b.js.map

+ 1
- 0
lib/style-inject.es-7b2c2b1b.js.map View File

@@ -0,0 +1 @@
1
+{"version":3,"file":"style-inject.es-b888177c.js","sources":["../node_modules/style-inject/dist/style-inject.es.js"],"sourcesContent":["function styleInject(css, ref) {\n  if ( ref === void 0 ) ref = {};\n  var insertAt = ref.insertAt;\n\n  if (!css || typeof document === 'undefined') { return; }\n\n  var head = document.head || document.getElementsByTagName('head')[0];\n  var style = document.createElement('style');\n  style.type = 'text/css';\n\n  if (insertAt === 'top') {\n    if (head.firstChild) {\n      head.insertBefore(style, head.firstChild);\n    } else {\n      head.appendChild(style);\n    }\n  } else {\n    head.appendChild(style);\n  }\n\n  if (style.styleSheet) {\n    style.styleSheet.cssText = css;\n  } else {\n    style.appendChild(document.createTextNode(css));\n  }\n}\n\nexport default styleInject;\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,WAAW,CAAC,GAAG,EAAE,GAAG,EAAE;EAC7B,KAAK,GAAG,KAAK,KAAK,CAAC,GAAG,GAAG,GAAG,EAAE,CAAC;EAC/B,IAAI,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC;;EAE5B,IAAI,CAAC,GAAG,IAAI,OAAO,QAAQ,KAAK,WAAW,EAAE,EAAE,OAAO,EAAE;;EAExD,IAAI,IAAI,GAAG,QAAQ,CAAC,IAAI,IAAI,QAAQ,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;EACrE,IAAI,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;EAC5C,KAAK,CAAC,IAAI,GAAG,UAAU,CAAC;;EAExB,IAAI,QAAQ,KAAK,KAAK,EAAE;IACtB,IAAI,IAAI,CAAC,UAAU,EAAE;MACnB,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;KAC3C,MAAM;MACL,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;KACzB;GACF,MAAM;IACL,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;GACzB;;EAED,IAAI,KAAK,CAAC,UAAU,EAAE;IACpB,KAAK,CAAC,UAAU,CAAC,OAAO,GAAG,GAAG,CAAC;GAChC,MAAM;IACL,KAAK,CAAC,WAAW,CAAC,QAAQ,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC;GACjD;CACF;;;;;;;;;;;;;;;;;"}

lib/test-b93e5209.js → lib/test-f419c2cb.js View File

@@ -1,7 +1,8 @@
1 1
 'use strict';
2 2
 
3
-var styleInject_es = require('./style-inject.es-3827494b.js');
3
+var styleInject_es = require('./style-inject.es-7b2c2b1b.js');
4 4
 require('react');
5
+require('./index-671ea010.js');
5 6
 
6 7
 var css = ".test_red__36-3- {\n  color: red;\n}\n";
7 8
 styleInject_es.styleInject(css);
@@ -72,4 +73,4 @@ styleInject_es.styleInject(css);
72 73
 var Test = "TestComponent";
73 74
 
74 75
 exports.Test = Test;
75
-//# sourceMappingURL=test-b93e5209.js.map
76
+//# sourceMappingURL=test-f419c2cb.js.map

lib/test-f419c2cb.js.map
File diff suppressed because it is too large
View File


+ 0
- 14707
package-lock.json
File diff suppressed because it is too large
View File


+ 12
- 3
package.json View File

@@ -7,18 +7,29 @@
7 7
     "@testing-library/jest-dom": "^4.2.4",
8 8
     "@testing-library/react": "^9.3.2",
9 9
     "@testing-library/user-event": "^7.1.2",
10
+    "@types/braft-editor": "^2.2.0",
10 11
     "@types/classnames": "^2.2.9",
12
+    "@types/draft-js": "^0.10.38",
11 13
     "@types/jest": "^24.0.0",
12 14
     "@types/node": "^12.0.0",
13 15
     "@types/react": "^16.9.0",
14 16
     "@types/react-dom": "^16.9.0",
15 17
     "@types/react-intl": "^3.0.0",
18
+    "@types/slate": "^0.47.5",
19
+    "@types/slate-react": "^0.22.9",
20
+    "braft-editor": "^2.3.8",
21
+    "braft-extensions": "^0.0.20",
16 22
     "classnames": "^2.2.6",
17
-    "draft-js": "^0.11.4",
23
+    "draftjs-to-html": "^0.9.1",
24
+    "draftjs-utils": "^0.10.2",
25
+    "immutable": "^4.0.0-rc.12",
18 26
     "kiwi-intl": "^1.2.4",
19 27
     "react-intl": "^3.9.2",
28
+    "react-quill": "^1.3.3",
20 29
     "react-scripts": "3.3.0",
21 30
     "rollup-plugin-visualizer": "^3.3.1",
31
+    "slate": "^0.57.1",
32
+    "slate-react": "^0.57.1",
22 33
     "typescript": "~3.7.2"
23 34
   },
24 35
   "scripts": {
@@ -73,7 +84,6 @@
73 84
     "@types/storybook__addon-info": "^5.2.1",
74 85
     "@typescript-eslint/eslint-plugin": "^2.16.0",
75 86
     "@typescript-eslint/parser": "^2.16.0",
76
-    "antd": "^3.26.4",
77 87
     "autoprefixer": "^9.7.3",
78 88
     "babel-loader": "^8.0.6",
79 89
     "babel-plugin-import": "^1.13.0",
@@ -105,7 +115,6 @@
105 115
     "ts-loader": "^6.2.1"
106 116
   },
107 117
   "peerDependencies": {
108
-    "antd": "^3.26.4",
109 118
     "react": "^16.12.0",
110 119
     "react-dom": "^16.12.0"
111 120
   }

+ 7
- 3
rollup.config.js View File

@@ -81,9 +81,13 @@ export default {
81 81
     commonjs({
82 82
       include: 'node_modules/**',
83 83
       browser: true,
84
-      namedExports: getNamedExports([
85
-        'prop-types',
86
-      ])
84
+      namedExports: {
85
+        ...getNamedExports([
86
+          'prop-types',
87
+          'draft-js',
88
+        ]),
89
+        'braft-extensions/dist/emoticon': ['defaultEmoticons']
90
+      },
87 91
     }),
88 92
     babel({
89 93
       exclude: "node_modules/**",

+ 66
- 0
src/components/Editor/BraftEditor/index.tsx View File

@@ -0,0 +1,66 @@
1
+import React, { useState } from "react";
2
+import BraftEditor, { ControlType } from "braft-editor";
3
+import "braft-editor/dist/index.css";
4
+
5
+// 引入表情包扩展模块样式文件
6
+import 'braft-extensions/dist/emoticon.css'
7
+// 引入表情包扩展模块和默认表情包列表
8
+import Emoticon, { defaultEmoticons } from 'braft-extensions/dist/emoticon';
9
+import MaxLength from 'braft-extensions/dist/max-length'
10
+
11
+const lengthOptions = {
12
+  defaultValue: 100, // 指定默认限制数,如不指定则为Infinity(无限)
13
+  // includeEditors: ['editor-id-1'], // 指定该模块对哪些BraftEditor生效,不传此属性则对所有BraftEditor有效
14
+  // excludeEditors: ['editor-id-2'],  // 指定该模块对哪些BraftEditor无效
15
+}
16
+BraftEditor.use(MaxLength(lengthOptions))
17
+
18
+// 转换默认表情包列表,让webpack可以正确加载到默认表情包中的图片,请确保已对png格式的文件配置了loader
19
+// 如果你使用的webpack版本不支持动态require,或者使用的其他打包工具,请勿使用此写法
20
+const emoticons = defaultEmoticons.map((item: string) => require(`braft-extensions/dist/assets/${item}`))
21
+
22
+// 也可以使用自己的表情包资源,不受打包工具限制
23
+// const emoticons = ['http://path/to/emoticon-1.png', 'http://path/to/emoticon-2.png', 'http://path/to/emoticon-3.png', 'http://path/to/emoticon-4.png', ...]
24
+
25
+const emotionOptions = {
26
+  // includeEditors: ['editor-id-1'], // 指定该模块对哪些BraftEditor生效,不传此属性则对所有BraftEditor有效
27
+  // excludeEditors: ['editor-id-2'],  // 指定该模块对哪些BraftEditor无效
28
+  emoticons: emoticons, // 指定可用表情图片列表,默认为空
29
+  closeOnBlur: true, // 指定是否在点击表情选择器之外的地方时关闭表情选择器,默认false
30
+  closeOnSelect: false // 指定是否在选择表情后关闭表情选择器,默认false
31
+}
32
+
33
+BraftEditor.use(Emoticon(emotionOptions))
34
+
35
+export const BarftEditorPage = () => {
36
+  const controls: ControlType[] = [
37
+    "bold",
38
+    "italic",
39
+    "underline",
40
+    "separator",
41
+    "link",
42
+    "emoji",
43
+    "separator",
44
+    "media"
45
+  ];
46
+
47
+  const [editorState, setEditorState] = useState(
48
+    BraftEditor.createEditorState("<p>Hello <b>World!</b></p>")
49
+  );
50
+
51
+  return (
52
+    <div className="editor-wrapper">
53
+      <BraftEditor
54
+        value={editorState}
55
+        onChange={setEditorState}
56
+        controls={controls}
57
+        contentStyle={{
58
+          height: 210,
59
+          boxShadow: "inset 0 1px 3px rgba(0,0,0,.1)"
60
+        }}
61
+      />
62
+    </div>
63
+  );
64
+};
65
+
66
+export default BarftEditorPage;

+ 8
- 0
src/components/Editor/RichTextEditor/RichTextEditor.less View File

@@ -0,0 +1,8 @@
1
+.wrapper {
2
+  .btnListWrapper {
3
+    display: flex;
4
+  }
5
+  .editorWrapper {
6
+    border: 1px solid #ccc;
7
+  }
8
+}

+ 175
- 9
src/components/Editor/RichTextEditor/index.tsx View File

@@ -1,23 +1,189 @@
1
-import React from 'react';
2
-import PropTypes from 'prop-types';
3
-import styles from './RichTextEditor.less';
1
+import React from "react";
2
+import PropTypes from "prop-types";
3
+import { Editor, EditorState, DraftEditorCommand, RichUtils, Modifier, ContentState, convertToRaw, ContentBlock, CompositeDecorator, Entity, SelectionState, AtomicBlockUtils } from "draft-js";
4
+import styles from "./RichTextEditor.less";
4 5
 
5 6
 interface RichTextEditorProps {}
6
-interface RichTextEditorState {}
7
+interface RichTextEditorState {
8
+  editorState: EditorState;
9
+}
10
+
11
+// 自定义组件,用于超链接
12
+const Link = (props: any) => {
13
+    // 这里通过contentState来获取entity�,之后通过getData获取entity中包含的数据
14
+    const { url } = props.contentState.getEntity(props.entityKey).getData();
15
+    return (
16
+        <a href={url}>
17
+            {props.children}
18
+        </a>
19
+    )
20
+}
21
+// decorator,用于超链接
22
+const decorator = new CompositeDecorator([
23
+  {
24
+      strategy (contentBlock, callback, contentState) {
25
+
26
+          // 这个方法接收2个函数作为参数,如果第一个参数的函数执行时�返回true,就会执行第二个参数函数,同时会�将匹配的�字符的起始位置和结束位置传递给第二个参数。
27
+          contentBlock.findEntityRanges(
28
+              (character) => {
29
+                  const entityKey = character.getEntity();
30
+                  return (
31
+                      entityKey !== null &&
32
+                      contentState.getEntity(entityKey).getType() === 'LINK'
33
+                  );
34
+              }, (...arr) => {
35
+                  callback(...arr)
36
+              }
37
+          );
38
+      },
39
+      component: Link
40
+  },
41
+  {
42
+    strategy (contentBlock, callback, contentState) {
43
+      contentBlock.findEntityRanges(
44
+        (character) => {
45
+          const entityKey = character.getEntity();
46
+          return (
47
+            entityKey !== null &&
48
+            contentState.getEntity(entityKey).getType() === 'EMOJI'
49
+          );
50
+        }, (...arr) => {
51
+          callback(...arr);
52
+        }
53
+      )
54
+    },
55
+    // component: (props: any) => (<span style={{ color: 'red' }}>[Emoji]</span>)
56
+    component: (props: any) => (
57
+      <i style={{
58
+          display:'inline-block',
59
+          height:'18px',
60
+          width:'18px',
61
+          backgroundImage:`url(https://i.pinimg.com/originals/03/7e/79/037e79b2fb52127537be79110891ae3f.png)`,
62
+          backgroundSize:'100% 100%',
63
+          color:'transparent'
64
+  }}>{`e`}</i>)
65
+  }
66
+]);
7 67
 
8
-class RichTextEditor extends React.Component<RichTextEditorProps, RichTextEditorState> {
68
+class RichTextEditor extends React.Component<
69
+  RichTextEditorProps,
70
+  RichTextEditorState
71
+> {
9 72
   constructor(props: RichTextEditorProps) {
10 73
     super(props);
11
-    this.state = {};
74
+    this.state = {
75
+      editorState: EditorState.createEmpty(decorator)
76
+    };
77
+    this.onChange = (editorState: EditorState) =>
78
+      this.setState({ editorState });
79
+    this.handleKeyCommand = this.handleKeyCommand.bind(this);
80
+    this.defaultBlockStyleFn = this.defaultBlockStyleFn.bind(this);
81
+  }
82
+
83
+  onChange: (editorState: EditorState) => void;
84
+  handleKeyCommand(command: DraftEditorCommand, editorState: EditorState) {
85
+    const newState = RichUtils.handleKeyCommand(editorState, command);
86
+    console.log('command: ', command);
87
+    console.log('newState: ', newState);
88
+    if (newState) {
89
+      this.onChange(newState);
90
+      return "handled";
91
+    }
92
+
93
+    switch (command) {
94
+      case 'backspace': 
95
+        const contentState = editorState.getCurrentContent();
96
+        const selectionState = editorState.getSelection();
97
+        const [startOffset, endOffset] = [selectionState.getStartOffset(), selectionState.getEndOffset()];
98
+        if (startOffset === endOffset) {
99
+          // 未选中状态
100
+          console.log(selectionState.getAnchorKey());
101
+        }
102
+        // 选中状态
103
+
104
+        break;
105
+      case 'backspace-word': 
106
+      case 'backspace-to-start-of-line':
107
+        break;
108
+    }
109
+    
110
+    return "not-handled";
111
+  }
112
+
113
+  _onBoldClick() {
114
+    this.onChange(RichUtils.toggleInlineStyle(this.state.editorState, 'BOLD'));
115
+  }
116
+
117
+  _onLinkClick() {
118
+    const { editorState } = this.state;
119
+    const contentState = editorState.getCurrentContent();
120
+    const selectionState = editorState.getSelection();
121
+    const contentStateWithEntity = contentState.createEntity('LINK', 'MUTABLE', {
122
+      url: 'http://www.zombo.com',
123
+    });
124
+    const entityKey = contentStateWithEntity.getLastCreatedEntityKey();
125
+    const contentStateWithLink = Modifier.applyEntity(
126
+      contentStateWithEntity,
127
+      selectionState,
128
+      entityKey,
129
+    );
130
+    const newEditorState = EditorState.push(editorState, contentStateWithLink, 'apply-entity');
131
+    this.onChange(newEditorState);
132
+  }
133
+
134
+  _onEmojiClick(e: React.MouseEvent, emojiCode: string) {
135
+    const { editorState } = this.state;
136
+    const contentState = editorState.getCurrentContent();
137
+    const selectionState = editorState.getSelection();
138
+    const EMOJIEntity: ContentState = contentState.createEntity('EMOJI', 'IMMUTABLE', { emojiCode });
139
+    const entityKey = EMOJIEntity.getLastCreatedEntityKey();
140
+    const ncsWithEntity = Modifier.insertText(contentState, selectionState, 'e', undefined, entityKey);
141
+    const newEditorState = EditorState.push(editorState, ncsWithEntity, 'insert-characters');
142
+    // const newEditorState = AtomicBlockUtils.insertAtomicBlock(
143
+    //   editorState,
144
+    //   entityKey,
145
+    //   ' '
146
+    // );
147
+    this.onChange(newEditorState);
148
+  }
149
+
150
+  _onCheckRange() {
151
+    console.log(this.state.editorState.getCurrentContent());
152
+    console.log(convertToRaw(this.state.editorState.getCurrentContent()));
153
+  }
154
+
155
+  defaultBlockStyleFn(contentBlock: ContentBlock) {
156
+    const type = contentBlock.getType();
157
+    return "";
158
+  }
159
+
160
+  defaultBlockRenderFn(contentBlock: ContentBlock) {
161
+    const type = contentBlock.getType();
162
+    return contentBlock;
12 163
   }
13 164
 
14 165
   render() {
166
+    const { editorState } = this.state;
15 167
     return (
16 168
       <div className={styles.wrapper}>
17
-        Component
169
+        <div className={styles.btnListWrapper}>
170
+          <button onClick={this._onBoldClick.bind(this)}>Bold</button>
171
+          <button onClick={this._onCheckRange.bind(this)}>Check</button>
172
+          <button onClick={this._onLinkClick.bind(this)}>Link</button>
173
+          <button onClick={(e: React.MouseEvent) => this._onEmojiClick(e, '0011')}>Emoji</button>
174
+        </div>
175
+        <div className={styles.editorWrapper}>
176
+          <Editor
177
+            editorState={editorState}
178
+            blockStyleFn={this.defaultBlockStyleFn}
179
+            blockRendererFn={this.defaultBlockRenderFn}
180
+            handleKeyCommand={this.handleKeyCommand}
181
+            onChange={this.onChange}
182
+          />
183
+        </div>
18 184
       </div>
19
-    )
185
+    );
20 186
   }
21 187
 }
22 188
 
23
-export default RichTextEditor;
189
+export default RichTextEditor;

+ 0
- 0
src/components/Editor/RichTextEditorForSlate/RichTextEditorForSlate.less View File


+ 49
- 0
src/components/Editor/RichTextEditorForSlate/index.tsx View File

@@ -0,0 +1,49 @@
1
+import React, { useMemo, useState } from 'react';
2
+import PropTypes from 'prop-types';
3
+
4
+// Import the Slate editor factory.
5
+import { createEditor, Node } from 'slate'
6
+
7
+// Import the Slate components and React plugin.
8
+import { Slate, Editable, withReact } from 'slate-react'
9
+
10
+
11
+import styles from './RichTextEditorForSlate.less';
12
+
13
+interface RichTextEditorForSlateProps {}
14
+interface RichTextEditorForSlateState {
15
+  editorState: any;
16
+}
17
+
18
+const RichTextEditorForSlate = () => {
19
+  const editor = useMemo(() => withReact(createEditor()), []);
20
+  const [value, setValue] = useState([
21
+    {
22
+      type: 'paragraph',
23
+      children: [{ text: 'A line of text in a paragraph.' }],
24
+    },
25
+  ] as Node[]);
26
+  return (
27
+    // Add the editable component inside the context.
28
+    <Slate editor={editor} value={value} onChange={value => {
29
+      console.log('value: ', value);
30
+      setValue(value);
31
+    }}>
32
+      <Editable />
33
+    </Slate>
34
+  )
35
+}
36
+
37
+// class RichTextEditorForSlate extends React.Component<RichTextEditorForSlateProps, RichTextEditorForSlateState> {
38
+//   constructor(props: RichTextEditorForSlateProps) {
39
+//     super(props);
40
+//     this.state = {
41
+//       editorState: initialState,
42
+//     };
43
+//   }
44
+
45
+//   render() {
46
+//   }
47
+// }
48
+
49
+export default RichTextEditorForSlate;

+ 3
- 0
src/components/Editor/index.ts View File

@@ -0,0 +1,3 @@
1
+export { default as BraftEditor } from './BraftEditor';
2
+export { default as RichTextEditor } from './RichTextEditor';
3
+export { default as RichTextEditorForSlate } from './RichTextEditorForSlate';

+ 5
- 6
src/components/Payment/Common/PriceOptions/index.tsx View File

@@ -1,5 +1,4 @@
1 1
 import React, { useState } from "react";
2
-import { Input } from "antd";
3 2
 import classnames from "classnames";
4 3
 import { formatMoney } from "../../Utils/utils";
5 4
 
@@ -7,14 +6,14 @@ import styles from "./PriceOptions.less";
7 6
 
8 7
 const FormattedMessage = ({ id }: any) => id;
9 8
 
10
-type Props = {
9
+interface Props {
11 10
   price: number;
12 11
   onPriceChange: (v: number) => void;
13 12
   size: "small" | "normal" | "large";
14 13
   focusScroll: boolean;
15 14
   withTitle: boolean;
16
-  inputRef: React.RefObject<Input>;
17
-};
15
+  inputRef: React.RefObject<any>;
16
+}
18 17
 
19 18
 const PriceOptions = ({
20 19
   price,
@@ -55,7 +54,7 @@ const PriceOptions = ({
55 54
             </span>
56 55
           ))}
57 56
         </span>
58
-        <Input
57
+        {/* <Input
59 58
           ref={inputRef}
60 59
           onMouseEnter={() => {
61 60
             if (inputStatus && inputRef && inputRef.current) {
@@ -84,7 +83,7 @@ const PriceOptions = ({
84 83
               e.target.scrollIntoView();
85 84
             }
86 85
           }}
87
-        />
86
+        /> */}
88 87
       </div>
89 88
     </div>
90 89
   );

+ 3
- 2
src/components/Payment/Common/WaitPayInfoView/index.tsx View File

@@ -1,11 +1,12 @@
1 1
 import React, { Component } from 'react';
2
-import { Button } from 'antd';
3 2
 import classnames from 'classnames';
4 3
 import styles from './WaitPayInfoView.less';
5 4
 
6 5
 import infoIconImg from '../assets/icon-info-blue@2x.svg';
7 6
 
8
-type Props = {
7
+const Button = (...props: any) => <button {...props}>button</button>;
8
+
9
+interface Props {
9 10
   onClickPayed?: Function;
10 11
   onClickProblem?: Function;
11 12
 }

+ 8
- 1
src/typings/index.d.ts View File

@@ -8,4 +8,11 @@ declare module "*.json";
8 8
 declare module "*.md";
9 9
 
10 10
 declare module 'storybook-addon-intl';
11
-declare module '@storybook/addon-console';
11
+declare module '@storybook/addon-console';
12
+
13
+declare module 'braft-extensions/dist/emoticon' {
14
+  export default (options: object) => any
15
+  export { defaultEmoticons };
16
+};
17
+
18
+declare module 'braft-extensions/dist/max-length';

+ 3361
- 0
stats.html
File diff suppressed because it is too large
View File


+ 55
- 0
stories/Editor.stories.tsx View File

@@ -0,0 +1,55 @@
1
+import React from 'react';
2
+import { storiesOf } from '@storybook/react';
3
+import { action } from '@storybook/addon-actions';
4
+import { withInfo } from "@storybook/addon-info";
5
+import { withKnobs, number, boolean, select } from "@storybook/addon-knobs";
6
+import { addReadme } from 'storybook-readme';
7
+
8
+import RichTextEditor from '@components/Editor/RichTextEditor';
9
+import RichTextEditorForSlate from '@components/Editor/RichTextEditorForSlate';
10
+import { BarftEditorPage } from '@components/Editor/BraftEditor';
11
+
12
+const stories = storiesOf('Editor', module);
13
+stories.addDecorator((storyFn) => <div style={{padding: "0px 40px"}}>{storyFn()}</div>)
14
+stories.addDecorator(withKnobs);
15
+stories.addDecorator(withInfo);
16
+stories.addDecorator(addReadme);
17
+
18
+stories.add(
19
+  'RichTextEditor',
20
+  () => (
21
+    <RichTextEditor />
22
+  ),
23
+  {
24
+    info: {
25
+      inline: true,
26
+    },
27
+    notes: 'A very simple example of addon notes',
28
+  }
29
+)
30
+
31
+stories.add(
32
+  'RichTextEditorForSlate',
33
+  () => (
34
+    <RichTextEditorForSlate />
35
+  ),
36
+  {
37
+    info: {
38
+      inline: true,
39
+    },
40
+    notes: 'A very simple example of addon notes',
41
+  }
42
+)
43
+
44
+stories.add(
45
+  'BraftEditor',
46
+  () => (
47
+      <BarftEditorPage />
48
+  ),
49
+  {
50
+    info: {
51
+      inline: true,
52
+    },
53
+    notes: 'A very simple example of addon notes',
54
+  }
55
+)

stories/index.stories.tsx → stories/Payment.stories.tsx View File


+ 1
- 1
tsconfig.json View File

@@ -28,7 +28,7 @@
28 28
     "paths": {
29 29
       "@/*": ["src/*"],
30 30
       "@components/*": [ "src/components/*" ]
31
-    },
31
+    }
32 32
   },
33 33
   "include": [
34 34
     "src/**/*",

+ 279
- 739
yarn.lock
File diff suppressed because it is too large
View File