Browse Source

dev: 通用Editor与部份外挂组件

Roxas 4 years ago
parent
commit
e6aeda2e30
65 changed files with 33164 additions and 34653 deletions
  1. 7
    2
      eslib/BraftEditor/index.d.ts
  2. 16390
    17206
      eslib/BraftEditor/index.js
  3. 1
    1
      eslib/BraftEditor/index.js.map
  4. 1
    2
      eslib/ConsumeListView/index.js
  5. 1
    1
      eslib/ConsumeListView/index.js.map
  6. 2
    1
      eslib/Editor/index.js
  7. 1
    1
      eslib/Editor/index.js.map
  8. 1
    2
      eslib/PayPlatformOptions/index.js
  9. 1
    1
      eslib/PayPlatformOptions/index.js.map
  10. 1
    2
      eslib/Payment/index.js
  11. 1
    1
      eslib/Payment/index.js.map
  12. 1
    2
      eslib/PriceOptions/index.js
  13. 1
    1
      eslib/PriceOptions/index.js.map
  14. 1
    2
      eslib/WaitPayInfoView/index.js
  15. 1
    1
      eslib/WaitPayInfoView/index.js.map
  16. 1
    4
      eslib/WantedPublishModal/index.js
  17. 1
    1
      eslib/WantedPublishModal/index.js.map
  18. 1
    2
      eslib/WantedPublishPopover/index.js
  19. 1
    1
      eslib/WantedPublishPopover/index.js.map
  20. 1
    2
      eslib/WantedPublishView/index.js
  21. 1
    1
      eslib/WantedPublishView/index.js.map
  22. 0
    12
      eslib/_commonjsHelpers-97e6d7b1.js
  23. 0
    1
      eslib/_commonjsHelpers-97e6d7b1.js.map
  24. 0
    0
      eslib/index-b8d80d39.d.ts
  25. 11
    3
      eslib/index-b8d80d39.js
  26. 1
    1
      eslib/index-b8d80d39.js.map
  27. 1
    2
      eslib/index.js
  28. 1
    1
      eslib/index.js.map
  29. 7
    2
      lib/BraftEditor/index.d.ts
  30. 16472
    17288
      lib/BraftEditor/index.js
  31. 1
    1
      lib/BraftEditor/index.js.map
  32. 1
    2
      lib/ConsumeListView/index.js
  33. 1
    1
      lib/ConsumeListView/index.js.map
  34. 2
    1
      lib/Editor/index.js
  35. 1
    1
      lib/Editor/index.js.map
  36. 1
    2
      lib/PayPlatformOptions/index.js
  37. 1
    1
      lib/PayPlatformOptions/index.js.map
  38. 1
    2
      lib/Payment/index.js
  39. 1
    1
      lib/Payment/index.js.map
  40. 1
    2
      lib/PriceOptions/index.js
  41. 1
    1
      lib/PriceOptions/index.js.map
  42. 1
    2
      lib/WaitPayInfoView/index.js
  43. 1
    1
      lib/WaitPayInfoView/index.js.map
  44. 1
    4
      lib/WantedPublishModal/index.js
  45. 1
    1
      lib/WantedPublishModal/index.js.map
  46. 1
    2
      lib/WantedPublishPopover/index.js
  47. 1
    1
      lib/WantedPublishPopover/index.js.map
  48. 1
    2
      lib/WantedPublishView/index.js
  49. 1
    1
      lib/WantedPublishView/index.js.map
  50. 0
    0
      lib/_commonjsHelpers-72d386ba.d.ts
  51. 0
    16
      lib/_commonjsHelpers-72d386ba.js
  52. 0
    1
      lib/_commonjsHelpers-72d386ba.js.map
  53. 0
    0
      lib/index-1143667e.d.ts
  54. 14
    3
      lib/index-1143667e.js
  55. 1
    1
      lib/index-1143667e.js.map
  56. 0
    0
      lib/index-44e17595.d.ts
  57. 1
    2
      lib/index.js
  58. 1
    1
      lib/index.js.map
  59. 1
    0
      package.json
  60. 31
    0
      src/components/Editor/BraftEditor/index.less
  61. 87
    30
      src/components/Editor/BraftEditor/index.tsx
  62. 8
    6
      src/typings/index.d.ts
  63. 1
    1
      stats.html
  64. 88
    15
      stories/Editor.stories.tsx
  65. 1
    1
      yarn.lock

+ 7
- 2
eslib/BraftEditor/index.d.ts View File

@@ -1,5 +1,10 @@
1 1
 /// <reference types="react" />
2
-declare const BarftEditorPage: ({ value, }: {
3
-    value: string;
2
+import { ControlType, EditorState } from "braft-editor";
3
+declare const BarftEditorPage: ({ initValue, value, onChange, controls, FloatControls }: {
4
+    initValue?: string | undefined;
5
+    value?: EditorState | undefined;
6
+    onChange?: ((editorState: EditorState) => void) | undefined;
7
+    controls?: ControlType[] | undefined;
8
+    FloatControls?: any;
4 9
 }) => JSX.Element;
5 10
 export { BarftEditorPage as default, BarftEditorPage };

+ 16390
- 17206
eslib/BraftEditor/index.js
File diff suppressed because it is too large
View File


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


+ 1
- 2
eslib/ConsumeListView/index.js View File

@@ -2,8 +2,7 @@ import { a as _inherits, b as _classCallCheck, c as _possibleConstructorReturn,
2 2
 import React, { Component } from 'react';
3 3
 import { s as styleInject } from '../style-inject.es-1f59c1d0.js';
4 4
 import { _ as _defineProperty } from '../defineProperty-18999f8e.js';
5
-import '../_commonjsHelpers-97e6d7b1.js';
6
-import { c as classnames } from '../index-c9837619.js';
5
+import { c as classnames } from '../index-b8d80d39.js';
7 6
 import { a as addImageProcess } from '../utils-6b513b37.js';
8 7
 
9 8
 var img = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAABvklEQVQ4T62UTygEcRTHv29MIsqfk6OL5CYH5aKd9WfjwqxEnBzExYWTCEWJJGove5H8OTA1uwdCrOWAi83ZwUXJiSj5u+Z5s0msmd2SX81h+r33ee/7fW+G8E+H/srhqEcFCjphve1RzcaVK4j3mmoB5YxqQzdOxTji1wE2QZglb2jAEcT7/g4wr0rQugS1OYJ26nOg5nYDr4ZrR7yrl0FBAKBlqjEX3eRLwSXAmidvOJbSI47oF9LVKaCOkNc4/w7kSPOoFBqDwjpp4XA60LUkF8nzbsuERQt4ejtGdsYwiAYTYIV6STOD6UB3EpqXJC0u7zKxz0Mk3Zrj7lOLerJg5T9K+2lWhALiYx8xS9NbDZnUuPXy0wN/hYw3lnbPiNfE7HaSfTAloRqKWkya8WAnMrdmIBqfBqM/BehJAo+gKHMibdMGzUhqKUiZAHGVXJYLwPdpshPnRDRM4fl5+7uKL/0c1WXdOSie5Dh3wZcyoR7SQttO9z+M5MOWEsStFQmsTAoOwVK7qM64d5P6ayKJj9EqHBa5Q4kx2/ujqR1Exnsq493HH2muFN98oNtJ0g7s3Ul5/vwbSab+G+gDqFybE11pYkYAAAAASUVORK5CYII=";

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


+ 2
- 1
eslib/Editor/index.js View File

@@ -1,7 +1,8 @@
1 1
 import 'react';
2 2
 import 'react-dom';
3 3
 import '../style-inject.es-1f59c1d0.js';
4
-import '../_commonjsHelpers-97e6d7b1.js';
4
+import '../defineProperty-18999f8e.js';
5
+import '../index-b8d80d39.js';
5 6
 import '../slicedToArray-4cd9e6d3.js';
6 7
 export { default as BraftEditor } from '../BraftEditor/index.js';
7 8
 import 'react-dom/server';

+ 1
- 1
eslib/Editor/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":";;;;;;;"}

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


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


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

@@ -4,8 +4,7 @@ import 'react-dom';
4 4
 import '../Modal/index.js';
5 5
 import '../style-inject.es-1f59c1d0.js';
6 6
 import '../defineProperty-18999f8e.js';
7
-import '../_commonjsHelpers-97e6d7b1.js';
8
-import '../index-c9837619.js';
7
+import '../index-b8d80d39.js';
9 8
 import '../utils-6b513b37.js';
10 9
 export { default as ConsumeListView } from '../ConsumeListView/index.js';
11 10
 export { default as PayPlatformOptions } from '../PayPlatformOptions/index.js';

+ 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":";;;;;;;;;;;;;;;;;"}

+ 1
- 2
eslib/PriceOptions/index.js View File

@@ -1,8 +1,7 @@
1 1
 import React, { useState } from 'react';
2 2
 import { s as styleInject } from '../style-inject.es-1f59c1d0.js';
3 3
 import { _ as _defineProperty } from '../defineProperty-18999f8e.js';
4
-import '../_commonjsHelpers-97e6d7b1.js';
5
-import { c as classnames } from '../index-c9837619.js';
4
+import { c as classnames } from '../index-b8d80d39.js';
6 5
 import { e as exportStyleSizeClass } from '../utils-6b513b37.js';
7 6
 import { _ as _slicedToArray } from '../slicedToArray-4cd9e6d3.js';
8 7
 import { Input } from 'antd';

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


+ 1
- 2
eslib/WaitPayInfoView/index.js View File

@@ -1,8 +1,7 @@
1 1
 import { a as _inherits, b as _classCallCheck, c as _possibleConstructorReturn, d as _getPrototypeOf, e as _createClass } from '../inherits-6cb67931.js';
2 2
 import React, { Component } from 'react';
3 3
 import { s as styleInject } from '../style-inject.es-1f59c1d0.js';
4
-import '../_commonjsHelpers-97e6d7b1.js';
5
-import { c as classnames } from '../index-c9837619.js';
4
+import { c as classnames } from '../index-b8d80d39.js';
6 5
 
7 6
 var css = ".WaitPayInfoView_waitingContainer__3pU2F {\n  display: flex;\n  flex-direction: column;\n  justify-content: center;\n  align-items: center;\n}\n";
8 7
 var styles = {

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


+ 1
- 4
eslib/WantedPublishModal/index.js View File

@@ -4,8 +4,7 @@ import 'react-dom';
4 4
 import Modal from '../Modal/index.js';
5 5
 import { s as styleInject } from '../style-inject.es-1f59c1d0.js';
6 6
 import '../defineProperty-18999f8e.js';
7
-import '../_commonjsHelpers-97e6d7b1.js';
8
-import '../index-c9837619.js';
7
+import '../index-b8d80d39.js';
9 8
 import 'antd';
10 9
 import WantedPublishView from '../WantedPublishView/index.js';
11 10
 import { W as WatnedPublishBase } from '../WantedPublish-b91e67a7.js';
@@ -76,8 +75,6 @@ function (_WatnedPublishBase) {
76 75
         InputWantedOnBlur: function InputWantedOnBlur(v) {
77 76
           var value = _this2.formatCurrentWanted(v);
78 77
 
79
-          if (_this2.props.handleConfirm) _this2.props.handleConfirm(_this2.formatResult(value));
80
-
81 78
           _this2.setState({
82 79
             current_wanted: value
83 80
           });

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


+ 1
- 2
eslib/WantedPublishPopover/index.js View File

@@ -4,8 +4,7 @@ import 'react-dom';
4 4
 import '../Modal/index.js';
5 5
 import { s as styleInject } from '../style-inject.es-1f59c1d0.js';
6 6
 import '../defineProperty-18999f8e.js';
7
-import '../_commonjsHelpers-97e6d7b1.js';
8
-import '../index-c9837619.js';
7
+import '../index-b8d80d39.js';
9 8
 import { Popover } from 'antd';
10 9
 import WantedPublishView from '../WantedPublishView/index.js';
11 10
 import { W as WatnedPublishBase } from '../WantedPublish-b91e67a7.js';

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


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


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


+ 0
- 12
eslib/_commonjsHelpers-97e6d7b1.js View File

@@ -1,12 +0,0 @@
1
-var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
2
-
3
-function unwrapExports (x) {
4
-	return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
5
-}
6
-
7
-function createCommonjsModule(fn, module) {
8
-	return module = { exports: {} }, fn(module, module.exports), module.exports;
9
-}
10
-
11
-export { commonjsGlobal as a, createCommonjsModule as c, unwrapExports as u };
12
-//# sourceMappingURL=_commonjsHelpers-97e6d7b1.js.map

+ 0
- 1
eslib/_commonjsHelpers-97e6d7b1.js.map View File

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

eslib/_commonjsHelpers-97e6d7b1.d.ts → eslib/index-b8d80d39.d.ts View File


eslib/index-c9837619.js → eslib/index-b8d80d39.js View File

@@ -1,4 +1,12 @@
1
-import { c as createCommonjsModule } from './_commonjsHelpers-97e6d7b1.js';
1
+var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
2
+
3
+function unwrapExports (x) {
4
+	return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
5
+}
6
+
7
+function createCommonjsModule(fn, module) {
8
+	return module = { exports: {} }, fn(module, module.exports), module.exports;
9
+}
2 10
 
3 11
 var classnames = createCommonjsModule(function (module) {
4 12
 /*!
@@ -49,5 +57,5 @@ var classnames = createCommonjsModule(function (module) {
49 57
 }());
50 58
 });
51 59
 
52
-export { classnames as c };
53
-//# sourceMappingURL=index-c9837619.js.map
60
+export { createCommonjsModule as a, commonjsGlobal as b, classnames as c, unwrapExports as u };
61
+//# sourceMappingURL=index-b8d80d39.js.map

eslib/index-c9837619.js.map → eslib/index-b8d80d39.js.map View File

@@ -1 +1 @@
1
-{"version":3,"file":"index-c9837619.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":";;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,YAAY;AAEb;AACA,CAAC,IAAI,MAAM,GAAG,EAAE,CAAC,cAAc,CAAC;AAChC;AACA,CAAC,SAAS,UAAU,IAAI;AACxB,EAAE,IAAI,OAAO,GAAG,EAAE,CAAC;AACnB;AACA,EAAE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AAC7C,GAAG,IAAI,GAAG,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;AAC1B,GAAG,IAAI,CAAC,GAAG,EAAE,SAAS;AACtB;AACA,GAAG,IAAI,OAAO,GAAG,OAAO,GAAG,CAAC;AAC5B;AACA,GAAG,IAAI,OAAO,KAAK,QAAQ,IAAI,OAAO,KAAK,QAAQ,EAAE;AACrD,IAAI,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACtB,IAAI,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,MAAM,EAAE;AAChD,IAAI,IAAI,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;AAC5C,IAAI,IAAI,KAAK,EAAE;AACf,KAAK,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACzB,KAAK;AACL,IAAI,MAAM,IAAI,OAAO,KAAK,QAAQ,EAAE;AACpC,IAAI,KAAK,IAAI,GAAG,IAAI,GAAG,EAAE;AACzB,KAAK,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,EAAE;AAC5C,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACxB,MAAM;AACN,KAAK;AACL,IAAI;AACJ,GAAG;AACH;AACA,EAAE,OAAO,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC3B,EAAE;AACF;AACA,CAAC,KAAqC,MAAM,CAAC,OAAO,EAAE;AACtD,EAAE,UAAU,CAAC,OAAO,GAAG,UAAU,CAAC;AAClC,EAAE,cAAc,GAAG,UAAU,CAAC;AAC9B,EAAE,MAKM;AACR,EAAE,MAAM,CAAC,UAAU,GAAG,UAAU,CAAC;AACjC,EAAE;AACF,CAAC,EAAE;;;;;"}
1
+{"version":3,"file":"index-b8d80d39.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":";;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,YAAY;AAEb;AACA,CAAC,IAAI,MAAM,GAAG,EAAE,CAAC,cAAc,CAAC;AAChC;AACA,CAAC,SAAS,UAAU,IAAI;AACxB,EAAE,IAAI,OAAO,GAAG,EAAE,CAAC;AACnB;AACA,EAAE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AAC7C,GAAG,IAAI,GAAG,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;AAC1B,GAAG,IAAI,CAAC,GAAG,EAAE,SAAS;AACtB;AACA,GAAG,IAAI,OAAO,GAAG,OAAO,GAAG,CAAC;AAC5B;AACA,GAAG,IAAI,OAAO,KAAK,QAAQ,IAAI,OAAO,KAAK,QAAQ,EAAE;AACrD,IAAI,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACtB,IAAI,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,MAAM,EAAE;AAChD,IAAI,IAAI,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;AAC5C,IAAI,IAAI,KAAK,EAAE;AACf,KAAK,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACzB,KAAK;AACL,IAAI,MAAM,IAAI,OAAO,KAAK,QAAQ,EAAE;AACpC,IAAI,KAAK,IAAI,GAAG,IAAI,GAAG,EAAE;AACzB,KAAK,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,EAAE;AAC5C,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACxB,MAAM;AACN,KAAK;AACL,IAAI;AACJ,GAAG;AACH;AACA,EAAE,OAAO,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC3B,EAAE;AACF;AACA,CAAC,KAAqC,MAAM,CAAC,OAAO,EAAE;AACtD,EAAE,UAAU,CAAC,OAAO,GAAG,UAAU,CAAC;AAClC,EAAE,cAAc,GAAG,UAAU,CAAC;AAC9B,EAAE,MAKM;AACR,EAAE,MAAM,CAAC,UAAU,GAAG,UAAU,CAAC;AACjC,EAAE;AACF,CAAC,EAAE;;;;;"}

+ 1
- 2
eslib/index.js View File

@@ -4,8 +4,7 @@ import 'react-dom';
4 4
 export { default as Modal, ModalCMD } from './Modal/index.js';
5 5
 import './style-inject.es-1f59c1d0.js';
6 6
 import './defineProperty-18999f8e.js';
7
-import './_commonjsHelpers-97e6d7b1.js';
8
-import './index-c9837619.js';
7
+import './index-b8d80d39.js';
9 8
 import './utils-6b513b37.js';
10 9
 export { default as ConsumeListView } from './ConsumeListView/index.js';
11 10
 export { default as PayPlatformOptions } from './PayPlatformOptions/index.js';

+ 1
- 1
eslib/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":";;;;;;;;;;;;;;;;;"}

+ 7
- 2
lib/BraftEditor/index.d.ts View File

@@ -1,5 +1,10 @@
1 1
 /// <reference types="react" />
2
-declare const BarftEditorPage: ({ value, }: {
3
-    value: string;
2
+import { ControlType, EditorState } from "braft-editor";
3
+declare const BarftEditorPage: ({ initValue, value, onChange, controls, FloatControls }: {
4
+    initValue?: string | undefined;
5
+    value?: EditorState | undefined;
6
+    onChange?: ((editorState: EditorState) => void) | undefined;
7
+    controls?: ControlType[] | undefined;
8
+    FloatControls?: any;
4 9
 }) => JSX.Element;
5 10
 export { BarftEditorPage as default, BarftEditorPage };

+ 16472
- 17288
lib/BraftEditor/index.js
File diff suppressed because it is too large
View File


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


+ 1
- 2
lib/ConsumeListView/index.js View File

@@ -9,8 +9,7 @@ var React = require('react');
9 9
 var React__default = _interopDefault(React);
10 10
 var styleInject_es = require('../style-inject.es-dcee06b6.js');
11 11
 var defineProperty = require('../defineProperty-ba7cd53d.js');
12
-require('../_commonjsHelpers-72d386ba.js');
13
-var index = require('../index-44e17595.js');
12
+var index = require('../index-1143667e.js');
14 13
 var utils = require('../utils-b800dc99.js');
15 14
 
16 15
 var img = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAABvklEQVQ4T62UTygEcRTHv29MIsqfk6OL5CYH5aKd9WfjwqxEnBzExYWTCEWJJGove5H8OTA1uwdCrOWAi83ZwUXJiSj5u+Z5s0msmd2SX81h+r33ee/7fW+G8E+H/srhqEcFCjphve1RzcaVK4j3mmoB5YxqQzdOxTji1wE2QZglb2jAEcT7/g4wr0rQugS1OYJ26nOg5nYDr4ZrR7yrl0FBAKBlqjEX3eRLwSXAmidvOJbSI47oF9LVKaCOkNc4/w7kSPOoFBqDwjpp4XA60LUkF8nzbsuERQt4ejtGdsYwiAYTYIV6STOD6UB3EpqXJC0u7zKxz0Mk3Zrj7lOLerJg5T9K+2lWhALiYx8xS9NbDZnUuPXy0wN/hYw3lnbPiNfE7HaSfTAloRqKWkya8WAnMrdmIBqfBqM/BehJAo+gKHMibdMGzUhqKUiZAHGVXJYLwPdpshPnRDRM4fl5+7uKL/0c1WXdOSie5Dh3wZcyoR7SQttO9z+M5MOWEsStFQmsTAoOwVK7qM64d5P6ayKJj9EqHBa5Q4kx2/ujqR1Exnsq493HH2muFN98oNtJ0g7s3Ul5/vwbSab+G+gDqFybE11pYkYAAAAASUVORK5CYII=";

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


+ 2
- 1
lib/Editor/index.js View File

@@ -5,7 +5,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
5 5
 require('react');
6 6
 require('react-dom');
7 7
 require('../style-inject.es-dcee06b6.js');
8
-require('../_commonjsHelpers-72d386ba.js');
8
+require('../defineProperty-ba7cd53d.js');
9
+require('../index-1143667e.js');
9 10
 require('../slicedToArray-172f4624.js');
10 11
 var BraftEditor = require('../BraftEditor/index.js');
11 12
 require('react-dom/server');

+ 1
- 1
lib/Editor/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":";;;;;;;;;;;;;;;"}

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


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


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

@@ -8,8 +8,7 @@ require('react-dom');
8 8
 require('../Modal/index.js');
9 9
 require('../style-inject.es-dcee06b6.js');
10 10
 require('../defineProperty-ba7cd53d.js');
11
-require('../_commonjsHelpers-72d386ba.js');
12
-require('../index-44e17595.js');
11
+require('../index-1143667e.js');
13 12
 require('../utils-b800dc99.js');
14 13
 var ConsumeListView = require('../ConsumeListView/index.js');
15 14
 var PayPlatformOptions = require('../PayPlatformOptions/index.js');

+ 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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}

+ 1
- 2
lib/PriceOptions/index.js View File

@@ -8,8 +8,7 @@ var React = require('react');
8 8
 var React__default = _interopDefault(React);
9 9
 var styleInject_es = require('../style-inject.es-dcee06b6.js');
10 10
 var defineProperty = require('../defineProperty-ba7cd53d.js');
11
-require('../_commonjsHelpers-72d386ba.js');
12
-var index = require('../index-44e17595.js');
11
+var index = require('../index-1143667e.js');
13 12
 var utils = require('../utils-b800dc99.js');
14 13
 var slicedToArray = require('../slicedToArray-172f4624.js');
15 14
 var antd = require('antd');

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


+ 1
- 2
lib/WaitPayInfoView/index.js View File

@@ -8,8 +8,7 @@ var inherits = require('../inherits-c86d64c1.js');
8 8
 var React = require('react');
9 9
 var React__default = _interopDefault(React);
10 10
 var styleInject_es = require('../style-inject.es-dcee06b6.js');
11
-require('../_commonjsHelpers-72d386ba.js');
12
-var index = require('../index-44e17595.js');
11
+var index = require('../index-1143667e.js');
13 12
 
14 13
 var css = ".WaitPayInfoView_waitingContainer__3pU2F {\n  display: flex;\n  flex-direction: column;\n  justify-content: center;\n  align-items: center;\n}\n";
15 14
 var styles = {

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


+ 1
- 4
lib/WantedPublishModal/index.js View File

@@ -11,8 +11,7 @@ require('react-dom');
11 11
 var Modal = require('../Modal/index.js');
12 12
 var styleInject_es = require('../style-inject.es-dcee06b6.js');
13 13
 require('../defineProperty-ba7cd53d.js');
14
-require('../_commonjsHelpers-72d386ba.js');
15
-require('../index-44e17595.js');
14
+require('../index-1143667e.js');
16 15
 require('antd');
17 16
 var WantedPublishView = require('../WantedPublishView/index.js');
18 17
 var WantedPublish = require('../WantedPublish-761aab8e.js');
@@ -83,8 +82,6 @@ function (_WatnedPublishBase) {
83 82
         InputWantedOnBlur: function InputWantedOnBlur(v) {
84 83
           var value = _this2.formatCurrentWanted(v);
85 84
 
86
-          if (_this2.props.handleConfirm) _this2.props.handleConfirm(_this2.formatResult(value));
87
-
88 85
           _this2.setState({
89 86
             current_wanted: value
90 87
           });

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


+ 1
- 2
lib/WantedPublishPopover/index.js View File

@@ -11,8 +11,7 @@ require('react-dom');
11 11
 require('../Modal/index.js');
12 12
 var styleInject_es = require('../style-inject.es-dcee06b6.js');
13 13
 require('../defineProperty-ba7cd53d.js');
14
-require('../_commonjsHelpers-72d386ba.js');
15
-require('../index-44e17595.js');
14
+require('../index-1143667e.js');
16 15
 var antd = require('antd');
17 16
 var WantedPublishView = require('../WantedPublishView/index.js');
18 17
 var WantedPublish = require('../WantedPublish-761aab8e.js');

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


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


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


+ 0
- 0
lib/_commonjsHelpers-72d386ba.d.ts View File


+ 0
- 16
lib/_commonjsHelpers-72d386ba.js View File

@@ -1,16 +0,0 @@
1
-'use strict';
2
-
3
-var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
4
-
5
-function unwrapExports (x) {
6
-	return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
7
-}
8
-
9
-function createCommonjsModule(fn, module) {
10
-	return module = { exports: {} }, fn(module, module.exports), module.exports;
11
-}
12
-
13
-exports.commonjsGlobal = commonjsGlobal;
14
-exports.createCommonjsModule = createCommonjsModule;
15
-exports.unwrapExports = unwrapExports;
16
-//# sourceMappingURL=_commonjsHelpers-72d386ba.js.map

+ 0
- 1
lib/_commonjsHelpers-72d386ba.js.map View File

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

eslib/index-c9837619.d.ts → lib/index-1143667e.d.ts View File


lib/index-44e17595.js → lib/index-1143667e.js View File

@@ -1,8 +1,16 @@
1 1
 'use strict';
2 2
 
3
-var _commonjsHelpers = require('./_commonjsHelpers-72d386ba.js');
3
+var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
4 4
 
5
-var classnames = _commonjsHelpers.createCommonjsModule(function (module) {
5
+function unwrapExports (x) {
6
+	return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
7
+}
8
+
9
+function createCommonjsModule(fn, module) {
10
+	return module = { exports: {} }, fn(module, module.exports), module.exports;
11
+}
12
+
13
+var classnames = createCommonjsModule(function (module) {
6 14
 /*!
7 15
   Copyright (c) 2017 Jed Watson.
8 16
   Licensed under the MIT License (MIT), see
@@ -52,4 +60,7 @@ var classnames = _commonjsHelpers.createCommonjsModule(function (module) {
52 60
 });
53 61
 
54 62
 exports.classnames = classnames;
55
-//# sourceMappingURL=index-44e17595.js.map
63
+exports.commonjsGlobal = commonjsGlobal;
64
+exports.createCommonjsModule = createCommonjsModule;
65
+exports.unwrapExports = unwrapExports;
66
+//# sourceMappingURL=index-1143667e.js.map

lib/index-44e17595.js.map → lib/index-1143667e.js.map View File

@@ -1 +1 @@
1
-{"version":3,"file":"index-c9837619.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":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,YAAY;AAEb;AACA,CAAC,IAAI,MAAM,GAAG,EAAE,CAAC,cAAc,CAAC;AAChC;AACA,CAAC,SAAS,UAAU,IAAI;AACxB,EAAE,IAAI,OAAO,GAAG,EAAE,CAAC;AACnB;AACA,EAAE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AAC7C,GAAG,IAAI,GAAG,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;AAC1B,GAAG,IAAI,CAAC,GAAG,EAAE,SAAS;AACtB;AACA,GAAG,IAAI,OAAO,GAAG,OAAO,GAAG,CAAC;AAC5B;AACA,GAAG,IAAI,OAAO,KAAK,QAAQ,IAAI,OAAO,KAAK,QAAQ,EAAE;AACrD,IAAI,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACtB,IAAI,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,MAAM,EAAE;AAChD,IAAI,IAAI,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;AAC5C,IAAI,IAAI,KAAK,EAAE;AACf,KAAK,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACzB,KAAK;AACL,IAAI,MAAM,IAAI,OAAO,KAAK,QAAQ,EAAE;AACpC,IAAI,KAAK,IAAI,GAAG,IAAI,GAAG,EAAE;AACzB,KAAK,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,EAAE;AAC5C,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACxB,MAAM;AACN,KAAK;AACL,IAAI;AACJ,GAAG;AACH;AACA,EAAE,OAAO,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC3B,EAAE;AACF;AACA,CAAC,KAAqC,MAAM,CAAC,OAAO,EAAE;AACtD,EAAE,UAAU,CAAC,OAAO,GAAG,UAAU,CAAC;AAClC,EAAE,cAAc,GAAG,UAAU,CAAC;AAC9B,EAAE,MAKM;AACR,EAAE,MAAM,CAAC,UAAU,GAAG,UAAU,CAAC;AACjC,EAAE;AACF,CAAC,EAAE;;;;;"}
1
+{"version":3,"file":"index-b8d80d39.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":";;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,YAAY;AAEb;AACA,CAAC,IAAI,MAAM,GAAG,EAAE,CAAC,cAAc,CAAC;AAChC;AACA,CAAC,SAAS,UAAU,IAAI;AACxB,EAAE,IAAI,OAAO,GAAG,EAAE,CAAC;AACnB;AACA,EAAE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AAC7C,GAAG,IAAI,GAAG,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;AAC1B,GAAG,IAAI,CAAC,GAAG,EAAE,SAAS;AACtB;AACA,GAAG,IAAI,OAAO,GAAG,OAAO,GAAG,CAAC;AAC5B;AACA,GAAG,IAAI,OAAO,KAAK,QAAQ,IAAI,OAAO,KAAK,QAAQ,EAAE;AACrD,IAAI,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACtB,IAAI,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,MAAM,EAAE;AAChD,IAAI,IAAI,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;AAC5C,IAAI,IAAI,KAAK,EAAE;AACf,KAAK,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACzB,KAAK;AACL,IAAI,MAAM,IAAI,OAAO,KAAK,QAAQ,EAAE;AACpC,IAAI,KAAK,IAAI,GAAG,IAAI,GAAG,EAAE;AACzB,KAAK,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,EAAE;AAC5C,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACxB,MAAM;AACN,KAAK;AACL,IAAI;AACJ,GAAG;AACH;AACA,EAAE,OAAO,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC3B,EAAE;AACF;AACA,CAAC,KAAqC,MAAM,CAAC,OAAO,EAAE;AACtD,EAAE,UAAU,CAAC,OAAO,GAAG,UAAU,CAAC;AAClC,EAAE,cAAc,GAAG,UAAU,CAAC;AAC9B,EAAE,MAKM;AACR,EAAE,MAAM,CAAC,UAAU,GAAG,UAAU,CAAC;AACjC,EAAE;AACF,CAAC,EAAE;;;;;;;;"}

+ 0
- 0
lib/index-44e17595.d.ts View File


+ 1
- 2
lib/index.js View File

@@ -8,8 +8,7 @@ require('react-dom');
8 8
 var Modal = require('./Modal/index.js');
9 9
 require('./style-inject.es-dcee06b6.js');
10 10
 require('./defineProperty-ba7cd53d.js');
11
-require('./_commonjsHelpers-72d386ba.js');
12
-require('./index-44e17595.js');
11
+require('./index-1143667e.js');
13 12
 require('./utils-b800dc99.js');
14 13
 var ConsumeListView = require('./ConsumeListView/index.js');
15 14
 var PayPlatformOptions = require('./PayPlatformOptions/index.js');

+ 1
- 1
lib/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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}

+ 1
- 0
package.json View File

@@ -18,6 +18,7 @@
18 18
     "antd": "^3.26.8",
19 19
     "braft-editor": "^2.3.8",
20 20
     "braft-extensions": "^0.0.20",
21
+    "braft-utils": "^3.0.12",
21 22
     "classnames": "^2.2.6",
22 23
     "immutable": "^4.0.0-rc.12",
23 24
     "react-intl": "^3.9.2",

+ 31
- 0
src/components/Editor/BraftEditor/index.less View File

@@ -0,0 +1,31 @@
1
+.baseWrapper {
2
+  position: relative;
3
+
4
+  :global(.bf-container) {
5
+    display: flex;
6
+    flex-direction: column;
7
+
8
+    .controlBar {
9
+      box-shadow: none;
10
+    }
11
+
12
+    .editorContent {
13
+      border: 1px solid #ccc;
14
+      border-radius: 4px;
15
+      height: auto;
16
+      transition: border-color 0.3s;
17
+
18
+      &.focus {
19
+        border-color: #1790ff;
20
+      }
21
+    }
22
+  }
23
+
24
+  .floatControls {
25
+    position: absolute;
26
+    right: 15px;
27
+    bottom: 15px;
28
+    display: flex;
29
+    z-index: 2;
30
+  }
31
+}

+ 87
- 30
src/components/Editor/BraftEditor/index.tsx View File

@@ -1,23 +1,27 @@
1 1
 import React, { useState } from "react";
2
-import BraftEditor, { ControlType } from "braft-editor";
2
+import classnames from "classnames";
3
+import BraftEditor, { ControlType, EditorState } from "braft-editor";
4
+import styles from "./index.less";
3 5
 import "braft-editor/dist/index.css";
4 6
 
5 7
 // 引入表情包扩展模块样式文件
6
-import 'braft-extensions/dist/emoticon.css'
8
+import "braft-extensions/dist/emoticon.css";
7 9
 // 引入表情包扩展模块和默认表情包列表
8
-import Emoticon, { defaultEmoticons } from 'braft-extensions/dist/emoticon';
9
-import MaxLength from 'braft-extensions/dist/max-length'
10
+import Emoticon, { defaultEmoticons } from "braft-extensions/dist/emoticon";
11
+import MaxLength from "braft-extensions/dist/max-length";
10 12
 
11 13
 const lengthOptions = {
12
-  defaultValue: 100, // 指定默认限制数,如不指定则为Infinity(无限)
14
+  defaultValue: 100 // 指定默认限制数,如不指定则为Infinity(无限)
13 15
   // includeEditors: ['editor-id-1'], // 指定该模块对哪些BraftEditor生效,不传此属性则对所有BraftEditor有效
14 16
   // excludeEditors: ['editor-id-2'],  // 指定该模块对哪些BraftEditor无效
15
-}
16
-BraftEditor.use(MaxLength(lengthOptions))
17
+};
18
+BraftEditor.use(MaxLength(lengthOptions));
17 19
 
18 20
 // 转换默认表情包列表,让webpack可以正确加载到默认表情包中的图片,请确保已对png格式的文件配置了loader
19 21
 // 如果你使用的webpack版本不支持动态require,或者使用的其他打包工具,请勿使用此写法
20
-const emoticons = defaultEmoticons.map((item: string) => require(`braft-extensions/dist/assets/${item}`))
22
+const emoticons = defaultEmoticons.map((item: string) =>
23
+  require(`braft-extensions/dist/assets/${item}`)
24
+);
21 25
 
22 26
 // 也可以使用自己的表情包资源,不受打包工具限制
23 27
 // 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', ...]
@@ -28,42 +32,95 @@ const emotionOptions = {
28 32
   emoticons: emoticons, // 指定可用表情图片列表,默认为空
29 33
   closeOnBlur: true, // 指定是否在点击表情选择器之外的地方时关闭表情选择器,默认false
30 34
   closeOnSelect: false // 指定是否在选择表情后关闭表情选择器,默认false
31
-}
35
+};
32 36
 
33
-BraftEditor.use(Emoticon(emotionOptions))
37
+BraftEditor.use(Emoticon(emotionOptions));
34 38
 
35 39
 export const BarftEditorPage = ({
40
+  initValue,
36 41
   value,
42
+  onChange,
43
+  controls,
44
+  FloatControls
37 45
 }: {
38
-  value: string;
46
+  initValue?: string;
47
+  value?: EditorState;
48
+  onChange?: (editorState: EditorState) => void;
49
+  controls?: ControlType[];
50
+  FloatControls?: any;
39 51
 }) => {
40
-  const controls: ControlType[] = [
41
-    "bold",
42
-    "italic",
43
-    "underline",
44
-    "separator",
45
-    "link",
46
-    "emoji",
47
-    "separator",
48
-    "media"
49
-  ];
52
+  const optionsControls = controls
53
+    ? controls
54
+    : [
55
+        "bold",
56
+        "italic",
57
+        "underline",
58
+        "separator",
59
+        "link",
60
+        "emoji",
61
+        "separator",
62
+        "media"
63
+      ];
64
+  const options: any = {
65
+    controls: optionsControls,
66
+    uncontrolled: !value && !onChange,
67
+    showControlsBar:
68
+      optionsControls && optionsControls.length > 0 && !FloatControls,
69
+    showFloatControls: FloatControls
70
+  };
50 71
 
51
-  const [editorState, setEditorState] = useState(
52
-    BraftEditor.createEditorState(value || "<p>Hello <b>World!</b></p>")
72
+  const [insideValue, setInsideValue] = useState(
73
+    BraftEditor.createEditorState(initValue || "<p>Hello <b>World!</b></p>")
53 74
   );
54 75
 
76
+  const [focusState, setFocusState] = useState(false);
77
+
78
+  let resultValue: EditorState | undefined;
79
+  let resultAction: ((editorState: EditorState) => void) | undefined;
80
+  if (options.uncontrolled) {
81
+    resultValue = insideValue;
82
+    resultAction = setInsideValue;
83
+  } else {
84
+    resultValue = value;
85
+    resultAction = onChange;
86
+  }
87
+
55 88
   return (
56
-    <div className="editor-wrapper">
89
+    <div className={styles.baseWrapper}>
57 90
       <BraftEditor
58
-        value={editorState}
59
-        onChange={setEditorState}
60
-        controls={controls}
61
-        contentStyle={{
62
-          boxShadow: "inset 0 1px 3px rgba(0,0,0,.1)"
91
+        value={resultValue}
92
+        onChange={resultAction}
93
+        controls={options.controls}
94
+        controlBarClassName={classnames(styles.controlBar, {
95
+          [styles.focus]: focusState
96
+        })}
97
+        controlBarStyle={options.showControlsBar ? {} : { display: "none" }}
98
+        contentClassName={classnames(styles.editorContent, {
99
+          [styles.focus]: focusState,
100
+          [styles.hasFloatControls]: options.showFloatControls
101
+        })}
102
+        contentStyle={{}}
103
+        onFocus={() => setFocusState(true)}
104
+        onBlur={() => setFocusState(false)}
105
+        hooks={{
106
+          "toggle-link": ({ href, target }) => {
107
+            href = href.indexOf("http") === 0 ? href : `http://${href}`;
108
+            return { href, target };
109
+          }
63 110
         }}
64 111
       />
112
+      {options.showFloatControls ? (
113
+        <div className={classnames(styles.floatControls)}>
114
+          {
115
+            <FloatControls
116
+              editorState={resultValue}
117
+              setEditorState={resultAction}
118
+            />
119
+          }
120
+        </div>
121
+      ) : null}
65 122
     </div>
66 123
   );
67 124
 };
68 125
 
69
-export default BarftEditorPage;
126
+export default BarftEditorPage;

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

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

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


+ 88
- 15
stories/Editor.stories.tsx View File

@@ -1,29 +1,102 @@
1
-import React from 'react';
2
-import { storiesOf } from '@storybook/react';
3
-import { action } from '@storybook/addon-actions';
1
+import React, { useState } from "react";
2
+import { storiesOf } from "@storybook/react";
3
+import { action } from "@storybook/addon-actions";
4 4
 import { withInfo } from "@storybook/addon-info";
5 5
 import { withKnobs, number, boolean, select } from "@storybook/addon-knobs";
6
-import { addReadme } from 'storybook-readme';
6
+import { addReadme } from "storybook-readme";
7 7
 
8
-import { BarftEditorPage } from '@components/Editor/BraftEditor';
8
+import { BarftEditorPage } from "@components/Editor/BraftEditor";
9
+import { ContentUtils } from "braft-utils";
9 10
 
10
-import EditorData from './data/articleData.json';
11
+import EditorData from "./data/articleData.json";
12
+import { Divider, Popover } from "antd";
13
+import BraftEditor from "braft-editor";
11 14
 
12
-const stories = storiesOf('Editor', module);
13
-stories.addDecorator((storyFn) => <div style={{padding: "0px 40px"}}>{storyFn()}</div>)
15
+const stories = storiesOf("Editor", module);
16
+stories.addDecorator(storyFn => (
17
+  <div style={{ padding: "0px 40px" }}>{storyFn()}</div>
18
+));
14 19
 stories.addDecorator(withKnobs);
15 20
 stories.addDecorator(withInfo);
16 21
 stories.addDecorator(addReadme);
17 22
 
18 23
 stories.add(
19
-  'BraftEditor',
20
-  () => (
21
-      <BarftEditorPage value={EditorData.text} />
22
-  ),
24
+  "BraftEditor",
25
+  () => {
26
+    return <BarftEditorPage initValue={EditorData.text} />;
27
+  },
23 28
   {
24 29
     info: {
25
-      inline: true,
30
+      inline: true
26 31
     },
27
-    notes: 'A very simple example of addon notes',
32
+    notes: "A very simple example of addon notes"
28 33
   }
29
-)
34
+);
35
+
36
+stories.add(
37
+  "BraftEditorCommon",
38
+  () => {
39
+    const [editorState, setEditorState] = useState(
40
+      BraftEditor.createEditorState("<p>Hello <b>World!</b></p>")
41
+    );
42
+    return (
43
+      <>
44
+        <h3>非受控组件</h3>
45
+        <BarftEditorPage controls={[]} />
46
+        <Divider />
47
+        <h3>受控组件</h3>
48
+        <BarftEditorPage
49
+          value={editorState}
50
+          onChange={setEditorState}
51
+          controls={["bold"]}
52
+          FloatControls={({ editorState, setEditorState }: any) => {
53
+            const IconWrapStyle = {
54
+              cursor: "pointer",
55
+              textAlign: "center" as const,
56
+              width: "42px"
57
+            };
58
+            const IconStyle = { fontSize: "21px" };
59
+            return (
60
+              <>
61
+                <div
62
+                  style={{ color: "#f07977", ...IconWrapStyle }}
63
+                  onClick={() => {
64
+                    setEditorState(
65
+                      ContentUtils.insertText(editorState, "Hello World")
66
+                    );
67
+                  }}
68
+                >
69
+                  <i
70
+                    className="schedule schedule-icon_story"
71
+                    style={IconStyle}
72
+                  />
73
+                </div>
74
+                <div style={{ ...IconWrapStyle, color: "#3d9bfe" }}>
75
+                  <i
76
+                    className="schedule schedule-icon_topic"
77
+                    style={IconStyle}
78
+                  />
79
+                </div>
80
+                <div style={{ ...IconWrapStyle, color: "#ffa405" }}>
81
+                  <i
82
+                    className="schedule schedule-icon_emoticon"
83
+                    style={IconStyle}
84
+                  />
85
+                </div>
86
+                <div style={{ ...IconWrapStyle, color: "#71c135" }}>
87
+                  <i className="schedule schedule-icon_img" style={IconStyle} />
88
+                </div>
89
+              </>
90
+            );
91
+          }}
92
+        />
93
+      </>
94
+    );
95
+  },
96
+  {
97
+    info: {
98
+      inline: true
99
+    },
100
+    notes: "A very simple example of addon notes"
101
+  }
102
+);

+ 1
- 1
yarn.lock View File

@@ -3772,7 +3772,7 @@ braft-finder@^0.0.19:
3772 3772
   resolved "https://registry.npm.taobao.org/braft-finder/download/braft-finder-0.0.19.tgz#c324d82526ed3476a93de86cc9b407f4e188bc8d"
3773 3773
   integrity sha1-wyTYJSbtNHapPehsybQH9OGIvI0=
3774 3774
 
3775
-braft-utils@^3.0.8:
3775
+braft-utils@^3.0.12, braft-utils@^3.0.8:
3776 3776
   version "3.0.12"
3777 3777
   resolved "https://registry.npm.taobao.org/braft-utils/download/braft-utils-3.0.12.tgz#2b755ce1d8397d96b627b6767f74d07f25729d85"
3778 3778
   integrity sha1-K3Vc4dg5fZa2J7Z2f3TQfyVynYU=