9 Commits

Author SHA1 Message Date
  Roxas a85bb47627 add: add info 3 years ago
  Roxas 13aa5d59d8 init 3 years ago
  Roxas 0b5bf31ba7 dev: 添加富文本编辑器相关page 4 years ago
  Roxas d485735782 add eslint and fix tsconfig.json error config; init Editor Component 4 years ago
  Roxas a15aafc49e update 4 years ago
  Roxas 9767067ffe dev: 接入storybook 4 years ago
  Roxas 756893b321 dev: temp init intl part 4 years ago
  Roxas abe1f2004b dev: init build logic 4 years ago
  Roxas 3d21e63382 Initial commit from Create React App 4 years ago
100 changed files with 380 additions and 125907 deletions
  1. 0
    11
      .babelrc
  2. 0
    17
      .eslintrc.js
  3. 99
    18
      .gitignore
  4. 0
    7
      .kiwi/config.json
  5. 0
    7
      .kiwi/en_US/index.ts
  6. 0
    3
      .kiwi/en_US/payplatformoption.ts
  7. 0
    5
      .kiwi/en_US/priceOptions.ts
  8. 0
    7
      .kiwi/zh_CN/index.ts
  9. 0
    3
      .kiwi/zh_CN/payplatformoption.ts
  10. 0
    5
      .kiwi/zh_CN/priceOptions.ts
  11. 1
    0
      .storybook/addons.js
  12. 5
    1
      .storybook/config.js
  13. 1
    0
      .storybook/preview-head.html
  14. 37
    0
      .storybook/theme.js
  15. 13
    5
      .storybook/webpack.config.js
  16. 0
    44
      README.md
  17. 0
    35
      config-overrides.js
  18. 0
    5
      eslib/Common/index.js
  19. 0
    1
      eslib/Common/index.js.map
  20. 0
    58031
      eslib/Editor/index.js
  21. 0
    1
      eslib/Editor/index.js.map
  22. 0
    5
      eslib/Payment/index.js
  23. 0
    1
      eslib/Payment/index.js.map
  24. 0
    53
      eslib/index-29b5a955.js
  25. 0
    1
      eslib/index-29b5a955.js.map
  26. 0
    474
      eslib/index-6e59934c.js
  27. 0
    1
      eslib/index-6e59934c.js.map
  28. 0
    3146
      eslib/index.js
  29. 0
    1
      eslib/index.js.map
  30. 0
    203
      eslib/style-inject.es-b888177c.js
  31. 0
    1
      eslib/style-inject.es-b888177c.js.map
  32. 0
    74
      eslib/test-89de59f6.js
  33. 0
    1
      eslib/test-89de59f6.js.map
  34. 0
    13
      lib/Common/index.js
  35. 0
    1
      lib/Common/index.js.map
  36. 0
    58040
      lib/Editor/index.js
  37. 0
    1
      lib/Editor/index.js.map
  38. 0
    16
      lib/Payment/index.js
  39. 0
    1
      lib/Payment/index.js.map
  40. 0
    55
      lib/index-671ea010.js
  41. 0
    1
      lib/index-671ea010.js.map
  42. 0
    482
      lib/index-fe1b29d9.js
  43. 0
    1
      lib/index-fe1b29d9.js.map
  44. 0
    3155
      lib/index.js
  45. 0
    1
      lib/index.js.map
  46. 0
    218
      lib/style-inject.es-7b2c2b1b.js
  47. 0
    1
      lib/style-inject.es-7b2c2b1b.js.map
  48. 0
    76
      lib/test-f419c2cb.js
  49. 0
    1
      lib/test-f419c2cb.js.map
  50. 29
    26
      package.json
  51. 3
    1
      postcss.config.js
  52. BIN
      public/favicon.ico
  53. 0
    43
      public/index.html
  54. BIN
      public/logo192.png
  55. BIN
      public/logo512.png
  56. 0
    25
      public/manifest.json
  57. 0
    2
      public/robots.txt
  58. 58
    15
      rollup.config.js
  59. 0
    38
      src/App.css
  60. 0
    9
      src/App.test.tsx
  61. 0
    26
      src/App.tsx
  62. 0
    1
      src/components/Common/index.ts
  63. 0
    3
      src/components/Common/test.less
  64. 0
    233
      src/components/Common/test.tsx
  65. 0
    66
      src/components/Editor/BraftEditor/index.tsx
  66. 0
    8
      src/components/Editor/RichTextEditor/RichTextEditor.less
  67. 0
    189
      src/components/Editor/RichTextEditor/index.tsx
  68. 0
    0
      src/components/Editor/RichTextEditorForSlate/RichTextEditorForSlate.less
  69. 0
    49
      src/components/Editor/RichTextEditorForSlate/index.tsx
  70. 0
    3
      src/components/Editor/index.ts
  71. 0
    60
      src/components/Payment/Common/ConsumeListView/ConsumeListView.less
  72. 0
    3
      src/components/Payment/Common/ConsumeListView/README.md
  73. 0
    166
      src/components/Payment/Common/ConsumeListView/index.tsx
  74. 0
    112
      src/components/Payment/Common/PayPlatformOptions/PayPlatformOptions.less
  75. 0
    3
      src/components/Payment/Common/PayPlatformOptions/README.md
  76. 0
    234
      src/components/Payment/Common/PayPlatformOptions/index.tsx
  77. 0
    133
      src/components/Payment/Common/PriceOptions/PriceOptions.less
  78. 0
    3
      src/components/Payment/Common/PriceOptions/README.md
  79. 0
    92
      src/components/Payment/Common/PriceOptions/index.tsx
  80. 0
    3
      src/components/Payment/Common/WaitPayInfoView/README.md
  81. 0
    7
      src/components/Payment/Common/WaitPayInfoView/WaitPayInfoView.less
  82. 0
    57
      src/components/Payment/Common/WaitPayInfoView/index.tsx
  83. BIN
      src/components/Payment/Common/assets/btn_toggle.png
  84. 0
    19
      src/components/Payment/Common/assets/icon-info-blue@2x.svg
  85. BIN
      src/components/Payment/Common/assets/kcxq_popovers_icon_alipay@2x.png
  86. BIN
      src/components/Payment/Common/assets/kcxq_popovers_icon_paypal@2x.png
  87. BIN
      src/components/Payment/Common/assets/kcxq_popovers_icon_wechatpay@2x.png
  88. BIN
      src/components/Payment/Common/assets/payment_btn_pay_alipay@2x.png
  89. BIN
      src/components/Payment/Common/assets/payment_btn_pay_paypal@2x.png
  90. BIN
      src/components/Payment/Common/assets/payment_btn_pay_wechatpay@2x.png
  91. BIN
      src/components/Payment/Common/assets/popovers_list_huangguan.png
  92. 0
    44
      src/components/Payment/Utils/utils.ts
  93. 0
    4
      src/components/Payment/index.ts
  94. 35
    0
      src/components/comment/CommentItem.tsx
  95. 20
    0
      src/components/comment/CommentList.tsx
  96. 13
    0
      src/components/comment/README.md
  97. 34
    0
      src/components/comment/config/constant.js
  98. 18
    0
      src/components/comment/context/index.ts
  99. 14
    0
      src/components/comment/demo.jsx
  100. 0
    0
      src/components/comment/index.jsx

+ 0
- 11
.babelrc View File

@@ -1,11 +0,0 @@
1
-{
2
-  "presets": [
3
-    "@babel/preset-env",
4
-    "@babel/preset-react",
5
-    "@babel/preset-typescript"
6
-  ],
7
-  "plugins": [
8
-    "@babel/plugin-proposal-class-properties"
9
-    // "@babel/plugin-proposal-export-default-from"
10
-  ]
11
-}

+ 0
- 17
.eslintrc.js View File

@@ -1,17 +0,0 @@
1
-module.exports = {
2
-  parser: "@typescript-eslint/parser",
3
-  parserOptions: {
4
-    ecmaVersion: 6, //也就是ES6语法支持的意思
5
-    sourceType: "module",
6
-    ecmaFeatures: {
7
-      modules: true
8
-    }
9
-  },
10
-  plugins: ["@typescript-eslint"],
11
-  rules: {
12
-    // 禁止使用 var
13
-    "no-var": "error",
14
-    // 优先使用 interface 而不是 type
15
-    "@typescript-eslint/consistent-type-definitions": ["error", "interface"]
16
-  }
17
-};

+ 99
- 18
.gitignore View File

@@ -1,23 +1,104 @@
1
-# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
1
+# Logs
2
+logs
3
+*.log
4
+npm-debug.log*
5
+yarn-debug.log*
6
+yarn-error.log*
7
+lerna-debug.log*
2 8
 
3
-# dependencies
4
-/node_modules
5
-/.pnp
6
-.pnp.js
9
+# Diagnostic reports (https://nodejs.org/api/report.html)
10
+report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
7 11
 
8
-# testing
9
-/coverage
12
+# Runtime data
13
+pids
14
+*.pid
15
+*.seed
16
+*.pid.lock
10 17
 
11
-# production
12
-/build
18
+# Directory for instrumented libs generated by jscoverage/JSCover
19
+lib-cov
13 20
 
14
-# misc
15
-.DS_Store
16
-.env.local
17
-.env.development.local
18
-.env.test.local
19
-.env.production.local
21
+# Coverage directory used by tools like istanbul
22
+coverage
23
+*.lcov
20 24
 
21
-npm-debug.log*
22
-yarn-debug.log*
23
-yarn-error.log*
25
+# nyc test coverage
26
+.nyc_output
27
+
28
+# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
29
+.grunt
30
+
31
+# Bower dependency directory (https://bower.io/)
32
+bower_components
33
+
34
+# node-waf configuration
35
+.lock-wscript
36
+
37
+# Compiled binary addons (https://nodejs.org/api/addons.html)
38
+build/Release
39
+
40
+# Dependency directories
41
+node_modules/
42
+jspm_packages/
43
+
44
+# TypeScript v1 declaration files
45
+typings/
46
+
47
+# TypeScript cache
48
+*.tsbuildinfo
49
+
50
+# Optional npm cache directory
51
+.npm
52
+
53
+# Optional eslint cache
54
+.eslintcache
55
+
56
+# Microbundle cache
57
+.rpt2_cache/
58
+.rts2_cache_cjs/
59
+.rts2_cache_es/
60
+.rts2_cache_umd/
61
+
62
+# Optional REPL history
63
+.node_repl_history
64
+
65
+# Output of 'npm pack'
66
+*.tgz
67
+
68
+# Yarn Integrity file
69
+.yarn-integrity
70
+
71
+# dotenv environment variables file
72
+.env
73
+.env.test
74
+
75
+# parcel-bundler cache (https://parceljs.org/)
76
+.cache
77
+
78
+# Next.js build output
79
+.next
80
+
81
+# Nuxt.js build / generate output
82
+.nuxt
83
+dist
84
+
85
+# Gatsby files
86
+.cache/
87
+# Comment in the public line in if your project uses Gatsby and *not* Next.js
88
+# https://nextjs.org/blog/next-9-1#public-directory-support
89
+# public
90
+
91
+# vuepress build output
92
+.vuepress/dist
93
+
94
+# Serverless directories
95
+.serverless/
96
+
97
+# FuseBox cache
98
+.fusebox/
99
+
100
+# DynamoDB Local files
101
+.dynamodb/
102
+
103
+# TernJS port file
104
+.tern-port

+ 0
- 7
.kiwi/config.json View File

@@ -1,7 +0,0 @@
1
-{
2
-  "srcLang": "zh_CN",
3
-  "distLangs": [
4
-    "en_US"
5
-  ],
6
-  "googleApiKey": ""
7
-}

+ 0
- 7
.kiwi/en_US/index.ts View File

@@ -1,7 +0,0 @@
1
-import priceOptions from './priceOptions';
2
-import payplatformoption from './payplatformoption';
3
-
4
-export default Object.assign({}, {
5
-  priceOptions,
6
-  payplatformoption,
7
-});

+ 0
- 3
.kiwi/en_US/payplatformoption.ts View File

@@ -1,3 +0,0 @@
1
-export default {
2
-  "platform": "支付平台"
3
-}

+ 0
- 5
.kiwi/en_US/priceOptions.ts View File

@@ -1,5 +0,0 @@
1
-export default {
2
-  "index": {
3
-    "others": "Others"
4
-  }
5
-}

+ 0
- 7
.kiwi/zh_CN/index.ts View File

@@ -1,7 +0,0 @@
1
-import priceOptions from './priceOptions';
2
-import payplatformoption from './payplatformoption';
3
-
4
-export default Object.assign({}, {
5
-  priceOptions,
6
-  payplatformoption,
7
-});

+ 0
- 3
.kiwi/zh_CN/payplatformoption.ts View File

@@ -1,3 +0,0 @@
1
-export default {
2
-  platform: '支付平台',
3
-};

+ 0
- 5
.kiwi/zh_CN/priceOptions.ts View File

@@ -1,5 +0,0 @@
1
-export default {
2
-  index: {
3
-    others: '其他金额',
4
-  },
5
-};

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

@@ -5,4 +5,5 @@ import '@storybook/addon-knobs/register';
5 5
 import '@storybook/addon-viewport/register';
6 6
 import '@storybook/addon-console';
7 7
 import '@storybook/addon-storysource/register';
8
+import 'storybook-addon-themes';
8 9
 import 'storybook-readme/register';

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

@@ -3,6 +3,9 @@ import { addParameters } from '@storybook/react';
3 3
 import { INITIAL_VIEWPORTS } from '@storybook/addon-viewport';
4 4
 import { addDecorator } from '@storybook/react';
5 5
 import { withConsole } from '@storybook/addon-console';
6
+import theme from './theme';
7
+
8
+import 'antd/dist/antd.less';
6 9
 
7 10
 addParameters({
8 11
   info: { inline: true },
@@ -10,10 +13,11 @@ addParameters({
10 13
     viewports: INITIAL_VIEWPORTS,
11 14
     defaultViewport: 'someDefault',
12 15
   },
16
+  options: { theme },
13 17
 });
14 18
 // automatically import all files ending in *.stories.tsx
15 19
 configure(
16
-  require.context('../stories', true, /\.stories\.tsx?$/), module
20
+  require.context('../stories', true, /\.stories\.(t|j)sx?$/), module
17 21
 )
18 22
 
19 23
 addDecorator((storyFn, context) => withConsole()(storyFn)(context));

+ 1
- 0
.storybook/preview-head.html View File

@@ -0,0 +1 @@
1
+<link rel="stylesheet" href="//at.alicdn.com/t/font_1158309_1tkgtp97s75.css" />

+ 37
- 0
.storybook/theme.js View File

@@ -0,0 +1,37 @@
1
+import { create } from '@storybook/theming/create';
2
+
3
+export default create({
4
+  base: 'light',
5
+
6
+  colorPrimary: '#fc4747',
7
+  colorSecondary: '#fc695a',
8
+
9
+  // UI
10
+  appBg: 'white',
11
+  appContentBg: 'white',
12
+  appBorderColor: 'grey',
13
+  appBorderRadius: 4,
14
+
15
+  // Typography
16
+  fontBase: '"Open Sans", sans-serif',
17
+  fontCode: 'monospace',
18
+
19
+  // Text colors
20
+  textColor: 'black',
21
+  textInverseColor: 'rgba(255,255,255,0.9)',
22
+
23
+  // Toolbar default and active colors
24
+  barTextColor: 'black',
25
+  barSelectedColor: 'white',
26
+  barBg: '#fc4747',
27
+
28
+  // Form colors
29
+  inputBg: 'white',
30
+  inputBorder: 'silver',
31
+  inputTextColor: 'black',
32
+  inputBorderRadius: 4,
33
+
34
+  brandTitle: 'BilingoUI',
35
+  brandUrl: 'https://www.bilingo.com/',
36
+  brandImage: 'https://a.links123.cn/common/imgs/logo_en_mobile@2x.png?2019021101',
37
+});

+ 13
- 5
.storybook/webpack.config.js View File

@@ -38,6 +38,9 @@ module.exports = ({ config }) => {
38 38
     {
39 39
       loader: 'less-loader',
40 40
       options: {
41
+        config: {
42
+          path: path.join(path.resolve(__dirname, '..'), 'postcss.config.js')
43
+        },
41 44
         javascriptEnabled: true,
42 45
       },
43 46
     }],
@@ -46,15 +49,20 @@ module.exports = ({ config }) => {
46 49
   config.module.rules.push({
47 50
     test: /\.(ts|tsx)$/,
48 51
     use: [
52
+      // Optional
49 53
       {
50
-        loader: require.resolve('babel-loader'),
54
+        loader: require.resolve("react-docgen-typescript-loader"),
51 55
         options: {
52
-          presets: [['react-app', { flow: false, typescript: true }]]
53
-        }
56
+          // Provide the path to your tsconfig.json so that your stories can
57
+          // display types from outside each individual story.
58
+          tsconfigPath: path.resolve(__dirname, "../tsconfig.json"),
59
+        },
54 60
       },
55
-      // Optional
56 61
       {
57
-        loader: require.resolve("react-docgen-typescript-loader")
62
+        loader: require.resolve('babel-loader'),
63
+        options: {
64
+          presets: [['react-app', { flow: false, typescript: true }]],
65
+        }
58 66
       },
59 67
     ]
60 68
   });

+ 0
- 44
README.md View File

@@ -1,44 +0,0 @@
1
-This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
2
-
3
-## Available Scripts
4
-
5
-In the project directory, you can run:
6
-
7
-### `yarn start`
8
-
9
-Runs the app in the development mode.<br />
10
-Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
11
-
12
-The page will reload if you make edits.<br />
13
-You will also see any lint errors in the console.
14
-
15
-### `yarn test`
16
-
17
-Launches the test runner in the interactive watch mode.<br />
18
-See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
19
-
20
-### `yarn build`
21
-
22
-Builds the app for production to the `build` folder.<br />
23
-It correctly bundles React in production mode and optimizes the build for the best performance.
24
-
25
-The build is minified and the filenames include the hashes.<br />
26
-Your app is ready to be deployed!
27
-
28
-See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
29
-
30
-### `yarn eject`
31
-
32
-**Note: this is a one-way operation. Once you `eject`, you can’t go back!**
33
-
34
-If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
35
-
36
-Instead, it will copy all the configuration files and the transitive dependencies (Webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
37
-
38
-You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
39
-
40
-## Learn More
41
-
42
-You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
43
-
44
-To learn React, check out the [React documentation](https://reactjs.org/).

+ 0
- 35
config-overrides.js View File

@@ -1,35 +0,0 @@
1
-const fs = require('fs');
2
-const path = require('path');
3
-
4
-const rootPath = fs.realpathSync(process.cwd());
5
-const srcPath = path.resolve(rootPath, )
6
-
7
-module.exports = function override(config, env) {
8
-  config.resolve.extensions = ['.js', '.jsx', '.ts', '.tsx', '.less', '.json'];
9
-  config.resolve.alias = {
10
-    '@': srcPath,
11
-    '@components': `${srcPath}/components`,
12
-  };
13
-  config.module.rules.push({
14
-    test: /\.less$/,
15
-    use: [
16
-    'style-loader', 
17
-    {
18
-      loader: 'css-loader',// translates CSS into CommonJS
19
-      options: {
20
-        modules: {
21
-          localIdentName: '[name]__[local]___[hash:base64:5]',
22
-        },
23
-      }
24
-    },
25
-    'postcss-loader',
26
-    {
27
-      loader: 'less-loader',
28
-      options: {
29
-        javascriptEnabled: true,
30
-      },
31
-    }],
32
-    exclude: /node_modules|antd\.less/,
33
-  });
34
-  return config;
35
-}

+ 0
- 5
eslib/Common/index.js View File

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

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

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

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


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


+ 0
- 5
eslib/Payment/index.js View File

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

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

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

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

@@ -1,53 +0,0 @@
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

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

@@ -1 +0,0 @@
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;;;;;"}

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


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


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


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


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

@@ -1,203 +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
-function getCjsExportFromNamespace (n) {
12
-	return n && n['default'] || n;
13
-}
14
-
15
-function _classCallCheck(instance, Constructor) {
16
-  if (!(instance instanceof Constructor)) {
17
-    throw new TypeError("Cannot call a class as a function");
18
-  }
19
-}
20
-
21
-function _defineProperties(target, props) {
22
-  for (var i = 0; i < props.length; i++) {
23
-    var descriptor = props[i];
24
-    descriptor.enumerable = descriptor.enumerable || false;
25
-    descriptor.configurable = true;
26
-    if ("value" in descriptor) descriptor.writable = true;
27
-    Object.defineProperty(target, descriptor.key, descriptor);
28
-  }
29
-}
30
-
31
-function _createClass(Constructor, protoProps, staticProps) {
32
-  if (protoProps) _defineProperties(Constructor.prototype, protoProps);
33
-  if (staticProps) _defineProperties(Constructor, staticProps);
34
-  return Constructor;
35
-}
36
-
37
-function _defineProperty(obj, key, value) {
38
-  if (key in obj) {
39
-    Object.defineProperty(obj, key, {
40
-      value: value,
41
-      enumerable: true,
42
-      configurable: true,
43
-      writable: true
44
-    });
45
-  } else {
46
-    obj[key] = value;
47
-  }
48
-
49
-  return obj;
50
-}
51
-
52
-function ownKeys(object, enumerableOnly) {
53
-  var keys = Object.keys(object);
54
-
55
-  if (Object.getOwnPropertySymbols) {
56
-    var symbols = Object.getOwnPropertySymbols(object);
57
-    if (enumerableOnly) symbols = symbols.filter(function (sym) {
58
-      return Object.getOwnPropertyDescriptor(object, sym).enumerable;
59
-    });
60
-    keys.push.apply(keys, symbols);
61
-  }
62
-
63
-  return keys;
64
-}
65
-
66
-function _objectSpread2(target) {
67
-  for (var i = 1; i < arguments.length; i++) {
68
-    var source = arguments[i] != null ? arguments[i] : {};
69
-
70
-    if (i % 2) {
71
-      ownKeys(Object(source), true).forEach(function (key) {
72
-        _defineProperty(target, key, source[key]);
73
-      });
74
-    } else if (Object.getOwnPropertyDescriptors) {
75
-      Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
76
-    } else {
77
-      ownKeys(Object(source)).forEach(function (key) {
78
-        Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
79
-      });
80
-    }
81
-  }
82
-
83
-  return target;
84
-}
85
-
86
-function _inherits(subClass, superClass) {
87
-  if (typeof superClass !== "function" && superClass !== null) {
88
-    throw new TypeError("Super expression must either be null or a function");
89
-  }
90
-
91
-  subClass.prototype = Object.create(superClass && superClass.prototype, {
92
-    constructor: {
93
-      value: subClass,
94
-      writable: true,
95
-      configurable: true
96
-    }
97
-  });
98
-  if (superClass) _setPrototypeOf(subClass, superClass);
99
-}
100
-
101
-function _getPrototypeOf(o) {
102
-  _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
103
-    return o.__proto__ || Object.getPrototypeOf(o);
104
-  };
105
-  return _getPrototypeOf(o);
106
-}
107
-
108
-function _setPrototypeOf(o, p) {
109
-  _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
110
-    o.__proto__ = p;
111
-    return o;
112
-  };
113
-
114
-  return _setPrototypeOf(o, p);
115
-}
116
-
117
-function _assertThisInitialized(self) {
118
-  if (self === void 0) {
119
-    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
120
-  }
121
-
122
-  return self;
123
-}
124
-
125
-function _possibleConstructorReturn(self, call) {
126
-  if (call && (typeof call === "object" || typeof call === "function")) {
127
-    return call;
128
-  }
129
-
130
-  return _assertThisInitialized(self);
131
-}
132
-
133
-function _slicedToArray(arr, i) {
134
-  return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest();
135
-}
136
-
137
-function _arrayWithHoles(arr) {
138
-  if (Array.isArray(arr)) return arr;
139
-}
140
-
141
-function _iterableToArrayLimit(arr, i) {
142
-  if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) {
143
-    return;
144
-  }
145
-
146
-  var _arr = [];
147
-  var _n = true;
148
-  var _d = false;
149
-  var _e = undefined;
150
-
151
-  try {
152
-    for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
153
-      _arr.push(_s.value);
154
-
155
-      if (i && _arr.length === i) break;
156
-    }
157
-  } catch (err) {
158
-    _d = true;
159
-    _e = err;
160
-  } finally {
161
-    try {
162
-      if (!_n && _i["return"] != null) _i["return"]();
163
-    } finally {
164
-      if (_d) throw _e;
165
-    }
166
-  }
167
-
168
-  return _arr;
169
-}
170
-
171
-function _nonIterableRest() {
172
-  throw new TypeError("Invalid attempt to destructure non-iterable instance");
173
-}
174
-
175
-function styleInject(css, ref) {
176
-  if ( ref === void 0 ) ref = {};
177
-  var insertAt = ref.insertAt;
178
-
179
-  if (!css || typeof document === 'undefined') { return; }
180
-
181
-  var head = document.head || document.getElementsByTagName('head')[0];
182
-  var style = document.createElement('style');
183
-  style.type = 'text/css';
184
-
185
-  if (insertAt === 'top') {
186
-    if (head.firstChild) {
187
-      head.insertBefore(style, head.firstChild);
188
-    } else {
189
-      head.appendChild(style);
190
-    }
191
-  } else {
192
-    head.appendChild(style);
193
-  }
194
-
195
-  if (style.styleSheet) {
196
-    style.styleSheet.cssText = css;
197
-  } else {
198
-    style.appendChild(document.createTextNode(css));
199
-  }
200
-}
201
-
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

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

@@ -1 +0,0 @@
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;;;;"}

+ 0
- 74
eslib/test-89de59f6.js View File

@@ -1,74 +0,0 @@
1
-import { s as styleInject } from './style-inject.es-b888177c.js';
2
-import 'react';
3
-import './index-29b5a955.js';
4
-
5
-var css = ".test_red__36-3- {\n  color: red;\n}\n";
6
-styleInject(css);
7
-
8
-// type TransmitImgTxtData = {
9
-//   user_id?: string|number;
10
-//   anonymity?: boolean;
11
-//   avatar?: string;
12
-//   nickname?: string;
13
-//   is_long?: boolean;
14
-// }
15
-// interface TransmitCardProps {
16
-//   type: TransmitType;
17
-//   data: TransmitImgTxtData;
18
-// }
19
-// export class TransmitCard extends React.PureComponent<TransmitCardProps, {}> {
20
-//   renderVideo() {
21
-//     return <div className={styles.transmitVideoCard}>Video</div>;
22
-//   }
23
-//   renderImgTxt() {
24
-//     const { data } = this.props;
25
-//     const {
26
-//       user_id,
27
-//       anonymity,
28
-//       avatar,
29
-//       nickname,
30
-//       is_long,
31
-//     } = data;
32
-//     return (
33
-//       <div className={styles.transmitImgTxtCard}>
34
-//         <div className={styles.header}>
35
-//           <UserLink user_id={user_id} anonymity={anonymity}>
36
-//             <Avatar
37
-//               id={user_id}
38
-//               image={avatar}
39
-//               follow={false}
40
-//               size="cover"
41
-//               className={styles.ava}
42
-//               anonymity={anonymity}
43
-//             />
44
-//           </UserLink>
45
-//           <div className={styles.nickname}>
46
-//             <UserLink user_id={user_id} anonymity={anonymity}>
47
-//               {nickname}
48
-//             </UserLink>
49
-//           </div>
50
-//           <div className={styles.type}>
51
-//             {is_long
52
-//               ? intl.get('bilingually.imgtxt.article')
53
-//               : intl.get('bilingually.imgtxt')}
54
-//           </div>
55
-//         </div>
56
-//       </div>
57
-//     );
58
-//   }
59
-//   render() {
60
-//     const { type } = this.props;
61
-//     if (type === 'imgTxt') {
62
-//       this.renderImgTxt();
63
-//     }
64
-//     if (type === 'shortVideo' || type === 'microVideo') {
65
-//       this.renderVideo();
66
-//     }
67
-//     return null;
68
-//   }
69
-// }
70
-
71
-var Test = "TestComponent";
72
-
73
-export { Test as T };
74
-//# sourceMappingURL=test-89de59f6.js.map

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


+ 0
- 13
lib/Common/index.js View File

@@ -1,13 +0,0 @@
1
-'use strict';
2
-
3
-Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
-require('../style-inject.es-7b2c2b1b.js');
6
-require('react');
7
-require('../index-671ea010.js');
8
-var test = require('../test-f419c2cb.js');
9
-
10
-
11
-
12
-exports.Test = test.Test;
13
-//# sourceMappingURL=index.js.map

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

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

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


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


+ 0
- 16
lib/Payment/index.js View File

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

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

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

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

@@ -1,55 +0,0 @@
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

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

@@ -1 +0,0 @@
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;;;;;"}

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


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


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


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


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

@@ -1,218 +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
-function getCjsExportFromNamespace (n) {
14
-	return n && n['default'] || n;
15
-}
16
-
17
-function _classCallCheck(instance, Constructor) {
18
-  if (!(instance instanceof Constructor)) {
19
-    throw new TypeError("Cannot call a class as a function");
20
-  }
21
-}
22
-
23
-function _defineProperties(target, props) {
24
-  for (var i = 0; i < props.length; i++) {
25
-    var descriptor = props[i];
26
-    descriptor.enumerable = descriptor.enumerable || false;
27
-    descriptor.configurable = true;
28
-    if ("value" in descriptor) descriptor.writable = true;
29
-    Object.defineProperty(target, descriptor.key, descriptor);
30
-  }
31
-}
32
-
33
-function _createClass(Constructor, protoProps, staticProps) {
34
-  if (protoProps) _defineProperties(Constructor.prototype, protoProps);
35
-  if (staticProps) _defineProperties(Constructor, staticProps);
36
-  return Constructor;
37
-}
38
-
39
-function _defineProperty(obj, key, value) {
40
-  if (key in obj) {
41
-    Object.defineProperty(obj, key, {
42
-      value: value,
43
-      enumerable: true,
44
-      configurable: true,
45
-      writable: true
46
-    });
47
-  } else {
48
-    obj[key] = value;
49
-  }
50
-
51
-  return obj;
52
-}
53
-
54
-function ownKeys(object, enumerableOnly) {
55
-  var keys = Object.keys(object);
56
-
57
-  if (Object.getOwnPropertySymbols) {
58
-    var symbols = Object.getOwnPropertySymbols(object);
59
-    if (enumerableOnly) symbols = symbols.filter(function (sym) {
60
-      return Object.getOwnPropertyDescriptor(object, sym).enumerable;
61
-    });
62
-    keys.push.apply(keys, symbols);
63
-  }
64
-
65
-  return keys;
66
-}
67
-
68
-function _objectSpread2(target) {
69
-  for (var i = 1; i < arguments.length; i++) {
70
-    var source = arguments[i] != null ? arguments[i] : {};
71
-
72
-    if (i % 2) {
73
-      ownKeys(Object(source), true).forEach(function (key) {
74
-        _defineProperty(target, key, source[key]);
75
-      });
76
-    } else if (Object.getOwnPropertyDescriptors) {
77
-      Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
78
-    } else {
79
-      ownKeys(Object(source)).forEach(function (key) {
80
-        Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
81
-      });
82
-    }
83
-  }
84
-
85
-  return target;
86
-}
87
-
88
-function _inherits(subClass, superClass) {
89
-  if (typeof superClass !== "function" && superClass !== null) {
90
-    throw new TypeError("Super expression must either be null or a function");
91
-  }
92
-
93
-  subClass.prototype = Object.create(superClass && superClass.prototype, {
94
-    constructor: {
95
-      value: subClass,
96
-      writable: true,
97
-      configurable: true
98
-    }
99
-  });
100
-  if (superClass) _setPrototypeOf(subClass, superClass);
101
-}
102
-
103
-function _getPrototypeOf(o) {
104
-  _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
105
-    return o.__proto__ || Object.getPrototypeOf(o);
106
-  };
107
-  return _getPrototypeOf(o);
108
-}
109
-
110
-function _setPrototypeOf(o, p) {
111
-  _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
112
-    o.__proto__ = p;
113
-    return o;
114
-  };
115
-
116
-  return _setPrototypeOf(o, p);
117
-}
118
-
119
-function _assertThisInitialized(self) {
120
-  if (self === void 0) {
121
-    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
122
-  }
123
-
124
-  return self;
125
-}
126
-
127
-function _possibleConstructorReturn(self, call) {
128
-  if (call && (typeof call === "object" || typeof call === "function")) {
129
-    return call;
130
-  }
131
-
132
-  return _assertThisInitialized(self);
133
-}
134
-
135
-function _slicedToArray(arr, i) {
136
-  return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest();
137
-}
138
-
139
-function _arrayWithHoles(arr) {
140
-  if (Array.isArray(arr)) return arr;
141
-}
142
-
143
-function _iterableToArrayLimit(arr, i) {
144
-  if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) {
145
-    return;
146
-  }
147
-
148
-  var _arr = [];
149
-  var _n = true;
150
-  var _d = false;
151
-  var _e = undefined;
152
-
153
-  try {
154
-    for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
155
-      _arr.push(_s.value);
156
-
157
-      if (i && _arr.length === i) break;
158
-    }
159
-  } catch (err) {
160
-    _d = true;
161
-    _e = err;
162
-  } finally {
163
-    try {
164
-      if (!_n && _i["return"] != null) _i["return"]();
165
-    } finally {
166
-      if (_d) throw _e;
167
-    }
168
-  }
169
-
170
-  return _arr;
171
-}
172
-
173
-function _nonIterableRest() {
174
-  throw new TypeError("Invalid attempt to destructure non-iterable instance");
175
-}
176
-
177
-function styleInject(css, ref) {
178
-  if ( ref === void 0 ) ref = {};
179
-  var insertAt = ref.insertAt;
180
-
181
-  if (!css || typeof document === 'undefined') { return; }
182
-
183
-  var head = document.head || document.getElementsByTagName('head')[0];
184
-  var style = document.createElement('style');
185
-  style.type = 'text/css';
186
-
187
-  if (insertAt === 'top') {
188
-    if (head.firstChild) {
189
-      head.insertBefore(style, head.firstChild);
190
-    } else {
191
-      head.appendChild(style);
192
-    }
193
-  } else {
194
-    head.appendChild(style);
195
-  }
196
-
197
-  if (style.styleSheet) {
198
-    style.styleSheet.cssText = css;
199
-  } else {
200
-    style.appendChild(document.createTextNode(css));
201
-  }
202
-}
203
-
204
-exports._assertThisInitialized = _assertThisInitialized;
205
-exports._classCallCheck = _classCallCheck;
206
-exports._createClass = _createClass;
207
-exports._defineProperty = _defineProperty;
208
-exports._getPrototypeOf = _getPrototypeOf;
209
-exports._inherits = _inherits;
210
-exports._objectSpread2 = _objectSpread2;
211
-exports._possibleConstructorReturn = _possibleConstructorReturn;
212
-exports._slicedToArray = _slicedToArray;
213
-exports.commonjsGlobal = commonjsGlobal;
214
-exports.createCommonjsModule = createCommonjsModule;
215
-exports.getCjsExportFromNamespace = getCjsExportFromNamespace;
216
-exports.styleInject = styleInject;
217
-exports.unwrapExports = unwrapExports;
218
-//# sourceMappingURL=style-inject.es-7b2c2b1b.js.map

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

@@ -1 +0,0 @@
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;;;;;;;;;;;;;;;;;"}

+ 0
- 76
lib/test-f419c2cb.js View File

@@ -1,76 +0,0 @@
1
-'use strict';
2
-
3
-var styleInject_es = require('./style-inject.es-7b2c2b1b.js');
4
-require('react');
5
-require('./index-671ea010.js');
6
-
7
-var css = ".test_red__36-3- {\n  color: red;\n}\n";
8
-styleInject_es.styleInject(css);
9
-
10
-// type TransmitImgTxtData = {
11
-//   user_id?: string|number;
12
-//   anonymity?: boolean;
13
-//   avatar?: string;
14
-//   nickname?: string;
15
-//   is_long?: boolean;
16
-// }
17
-// interface TransmitCardProps {
18
-//   type: TransmitType;
19
-//   data: TransmitImgTxtData;
20
-// }
21
-// export class TransmitCard extends React.PureComponent<TransmitCardProps, {}> {
22
-//   renderVideo() {
23
-//     return <div className={styles.transmitVideoCard}>Video</div>;
24
-//   }
25
-//   renderImgTxt() {
26
-//     const { data } = this.props;
27
-//     const {
28
-//       user_id,
29
-//       anonymity,
30
-//       avatar,
31
-//       nickname,
32
-//       is_long,
33
-//     } = data;
34
-//     return (
35
-//       <div className={styles.transmitImgTxtCard}>
36
-//         <div className={styles.header}>
37
-//           <UserLink user_id={user_id} anonymity={anonymity}>
38
-//             <Avatar
39
-//               id={user_id}
40
-//               image={avatar}
41
-//               follow={false}
42
-//               size="cover"
43
-//               className={styles.ava}
44
-//               anonymity={anonymity}
45
-//             />
46
-//           </UserLink>
47
-//           <div className={styles.nickname}>
48
-//             <UserLink user_id={user_id} anonymity={anonymity}>
49
-//               {nickname}
50
-//             </UserLink>
51
-//           </div>
52
-//           <div className={styles.type}>
53
-//             {is_long
54
-//               ? intl.get('bilingually.imgtxt.article')
55
-//               : intl.get('bilingually.imgtxt')}
56
-//           </div>
57
-//         </div>
58
-//       </div>
59
-//     );
60
-//   }
61
-//   render() {
62
-//     const { type } = this.props;
63
-//     if (type === 'imgTxt') {
64
-//       this.renderImgTxt();
65
-//     }
66
-//     if (type === 'shortVideo' || type === 'microVideo') {
67
-//       this.renderVideo();
68
-//     }
69
-//     return null;
70
-//   }
71
-// }
72
-
73
-var Test = "TestComponent";
74
-
75
-exports.Test = Test;
76
-//# sourceMappingURL=test-f419c2cb.js.map

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


+ 29
- 26
package.json View File

@@ -1,46 +1,40 @@
1 1
 {
2
-  "name": "bilingo-ui",
3
-  "version": "0.1.0",
4
-  "private": true,
5
-  "main": "lib/index.js",
2
+  "name": "base-ui",
3
+  "version": "1.0.0",
4
+  "description": "a base components ui lib",
5
+  "main": "index.js",
6
+  "scripts": {
7
+    "start": "react-app-rewired start",
8
+    "build": "react-app-rewired build",
9
+    "test": "react-app-rewired test",
10
+    "eject": "react-app-rewired eject",
11
+    "build:lib": "rimraf lib && rimraf eslib && rollup -c ./rollup.config.js",
12
+    "storybook": "start-storybook -p 9009 -s public",
13
+    "build-storybook": "build-storybook -s public"
14
+  },
6 15
   "dependencies": {
7 16
     "@testing-library/jest-dom": "^4.2.4",
8 17
     "@testing-library/react": "^9.3.2",
9 18
     "@testing-library/user-event": "^7.1.2",
19
+    "@types/axios": "^0.14.0",
10 20
     "@types/braft-editor": "^2.2.0",
11 21
     "@types/classnames": "^2.2.9",
12
-    "@types/draft-js": "^0.10.38",
13 22
     "@types/jest": "^24.0.0",
14 23
     "@types/node": "^12.0.0",
15 24
     "@types/react": "^16.9.0",
16 25
     "@types/react-dom": "^16.9.0",
17 26
     "@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",
27
+    "@wessberg/rollup-plugin-ts": "^1.2.15",
28
+    "antd": "^4.3.4",
29
+    "axios": "^0.19.2",
22 30
     "classnames": "^2.2.6",
23
-    "draftjs-to-html": "^0.9.1",
24
-    "draftjs-utils": "^0.10.2",
25 31
     "immutable": "^4.0.0-rc.12",
26
-    "kiwi-intl": "^1.2.4",
27
-    "react-intl": "^3.9.2",
28
-    "react-quill": "^1.3.3",
29 32
     "react-scripts": "3.3.0",
30 33
     "rollup-plugin-visualizer": "^3.3.1",
31
-    "slate": "^0.57.1",
32
-    "slate-react": "^0.57.1",
33 34
     "typescript": "~3.7.2"
34 35
   },
35
-  "scripts": {
36
-    "start": "react-app-rewired start",
37
-    "build": "react-app-rewired build",
38
-    "test": "react-app-rewired test",
39
-    "eject": "react-app-rewired eject",
40
-    "build:lib": "rimraf lib && rimraf eslib && rollup -c ./rollup.config.js",
41
-    "storybook": "start-storybook -p 9009 -s public",
42
-    "build-storybook": "build-storybook -s public"
43
-  },
36
+  "author": "thewindsword",
37
+  "license": "MIT",
44 38
   "eslintConfig": {
45 39
     "extends": "react-app"
46 40
   },
@@ -80,6 +74,7 @@
80 74
     "@storybook/addon-viewport": "^5.2.8",
81 75
     "@storybook/addons": "^5.2.8",
82 76
     "@storybook/react": "^5.2.8",
77
+    "@types/draft-js": "^0.10.38",
83 78
     "@types/storybook-readme": "^5.0.4",
84 79
     "@types/storybook__addon-info": "^5.2.1",
85 80
     "@typescript-eslint/eslint-plugin": "^2.16.0",
@@ -89,6 +84,7 @@
89 84
     "babel-plugin-import": "^1.13.0",
90 85
     "cross-env": "^6.0.3",
91 86
     "css-loader": "^3.2.1",
87
+    "draftjs-utils": "^0.10.2",
92 88
     "eslint": "^6.8.0",
93 89
     "file-loader": "^5.0.2",
94 90
     "less": "^3.10.3",
@@ -96,8 +92,10 @@
96 92
     "node-eval": "^2.0.0",
97 93
     "postcss-loader": "^3.0.0",
98 94
     "postcss-url": "^8.0.0",
95
+    "react": "^16.12.0",
99 96
     "react-app-rewired": "^2.1.5",
100 97
     "react-docgen-typescript-loader": "^3.6.0",
98
+    "react-dom": "^16.12.0",
101 99
     "rimraf": "^3.0.0",
102 100
     "rollup": "^1.27.13",
103 101
     "rollup-plugin-alias": "^2.2.0",
@@ -110,11 +108,16 @@
110 108
     "rollup-plugin-peer-deps-external": "^2.2.0",
111 109
     "rollup-plugin-postcss-modules": "^2.0.1",
112 110
     "rollup-plugin-replace": "^2.2.0",
111
+    "rollup-plugin-sourcemaps": "^0.5.0",
112
+    "rollup-plugin-typescript2": "^0.25.3",
113
+    "storybook-addon-themes": "^5.3.0",
113 114
     "storybook-readme": "^5.0.8",
114 115
     "style-loader": "^1.0.1",
115
-    "ts-loader": "^6.2.1"
116
+    "ts-loader": "^6.2.1",
117
+    "tslib": "^1.10.0"
116 118
   },
117 119
   "peerDependencies": {
120
+    "antd": "^4.3.4",
118 121
     "react": "^16.12.0",
119 122
     "react-dom": "^16.12.0"
120 123
   }

+ 3
- 1
postcss.config.js View File

@@ -1,3 +1,5 @@
1 1
 module.exports = {  
2
-  plugins: {}
2
+  plugins: [
3
+    require('autoprefixer'),
4
+  ]
3 5
 } 

BIN
public/favicon.ico View File


+ 0
- 43
public/index.html View File

@@ -1,43 +0,0 @@
1
-<!DOCTYPE html>
2
-<html lang="en">
3
-  <head>
4
-    <meta charset="utf-8" />
5
-    <link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
6
-    <meta name="viewport" content="width=device-width, initial-scale=1" />
7
-    <meta name="theme-color" content="#000000" />
8
-    <meta
9
-      name="description"
10
-      content="Web site created using create-react-app"
11
-    />
12
-    <link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
13
-    <!--
14
-      manifest.json provides metadata used when your web app is installed on a
15
-      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
16
-    -->
17
-    <link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
18
-    <!--
19
-      Notice the use of %PUBLIC_URL% in the tags above.
20
-      It will be replaced with the URL of the `public` folder during the build.
21
-      Only files inside the `public` folder can be referenced from the HTML.
22
-
23
-      Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
24
-      work correctly both with client-side routing and a non-root public URL.
25
-      Learn how to configure a non-root public URL by running `npm run build`.
26
-    -->
27
-    <title>React App</title>
28
-  </head>
29
-  <body>
30
-    <noscript>You need to enable JavaScript to run this app.</noscript>
31
-    <div id="root"></div>
32
-    <!--
33
-      This HTML file is a template.
34
-      If you open it directly in the browser, you will see an empty page.
35
-
36
-      You can add webfonts, meta tags, or analytics to this file.
37
-      The build step will place the bundled scripts into the <body> tag.
38
-
39
-      To begin the development, run `npm start` or `yarn start`.
40
-      To create a production bundle, use `npm run build` or `yarn build`.
41
-    -->
42
-  </body>
43
-</html>

BIN
public/logo192.png View File


BIN
public/logo512.png View File


+ 0
- 25
public/manifest.json View File

@@ -1,25 +0,0 @@
1
-{
2
-  "short_name": "React App",
3
-  "name": "Create React App Sample",
4
-  "icons": [
5
-    {
6
-      "src": "favicon.ico",
7
-      "sizes": "64x64 32x32 24x24 16x16",
8
-      "type": "image/x-icon"
9
-    },
10
-    {
11
-      "src": "logo192.png",
12
-      "type": "image/png",
13
-      "sizes": "192x192"
14
-    },
15
-    {
16
-      "src": "logo512.png",
17
-      "type": "image/png",
18
-      "sizes": "512x512"
19
-    }
20
-  ],
21
-  "start_url": ".",
22
-  "display": "standalone",
23
-  "theme_color": "#000000",
24
-  "background_color": "#ffffff"
25
-}

+ 0
- 2
public/robots.txt View File

@@ -1,2 +0,0 @@
1
-# https://www.robotstxt.org/robotstxt.html
2
-User-agent: *

+ 58
- 15
rollup.config.js View File

@@ -4,13 +4,16 @@ import image from '@rollup/plugin-image';
4 4
 import alias from '@rollup/plugin-alias';
5 5
 import postcss from 'rollup-plugin-postcss-modules'
6 6
 import babel from "rollup-plugin-babel";
7
+import { DEFAULT_EXTENSIONS } from '@babel/core';
7 8
 import json from "rollup-plugin-json";
8 9
 import autoprefixer from 'autoprefixer';
9 10
 import postcssUrl from 'postcss-url';
10 11
 import peerDepsExternal from 'rollup-plugin-peer-deps-external';
11 12
 import visualizer from 'rollup-plugin-visualizer';
12 13
 import analyze from 'rollup-plugin-analyzer';
13
- 
14
+import ts from "@wessberg/rollup-plugin-ts";
15
+// import typescript from 'rollup-plugin-typescript2';
16
+// import sourcemaps from 'rollup-plugin-sourcemaps';
14 17
 
15 18
 // import url from '@rollup/plugin-url';
16 19
 // import less from "rollup-plugin-less";
@@ -38,18 +41,39 @@ export function getNamedExports(moduleIds) {
38 41
 
39 42
 const fs = require('fs');
40 43
 const path = require('path');
41
-const componentFold = 'src/components';
42
-const cModuleNames = fs.readdirSync(path.resolve(componentFold));
44
+const componentsFold = 'src/components';
45
+const cModuleNames = fs.readdirSync(path.resolve(componentsFold));
43 46
 const cModuleMap = cModuleNames.reduce((prev, name) => {
44
-  prev[name] = `${componentFold}/${name}/index.ts`;
47
+  const modulePath = `${componentsFold}/${name}`;
48
+  prev[name] = `${modulePath}/index.ts`;
49
+  const child = fs.readdirSync(path.resolve(modulePath));
50
+  child.forEach(c => {
51
+    const childFoldPath = `${modulePath}/${c}`;
52
+    const isDir = fs.statSync(childFoldPath).isDirectory();
53
+    if (isDir) {
54
+      if (fs.existsSync(`${childFoldPath}/index.tsx`)) {
55
+        prev[c] = `${childFoldPath}/index.tsx`;
56
+      }
57
+      if (c === 'Common' && fs.existsSync(childFoldPath) && fs.statSync(childFoldPath).isDirectory()) {
58
+        const commonComponentsArr = fs.readdirSync(childFoldPath);
59
+        commonComponentsArr.forEach(commonComponentFold => {
60
+          const commonComponentFoldPath = `${childFoldPath}/${commonComponentFold}`;
61
+          const isCommonComponentDir = fs.statSync(commonComponentFoldPath).isDirectory();
62
+          if (isCommonComponentDir && fs.existsSync(`${commonComponentFoldPath}/index.tsx`)) {
63
+            prev[`${commonComponentFold}`] = `${commonComponentFoldPath}/index.tsx`;
64
+          }
65
+        });
66
+      }
67
+    }
68
+  });
45 69
   return prev;
46 70
 }, {});
47 71
 
48
-const extensions = ['.js', '.jsx', '.ts', '.tsx'];
72
+const extensions = [ ...DEFAULT_EXTENSIONS, '.js', '.jsx', '.ts', '.tsx'];
49 73
 
50 74
 export default {
51 75
   input: {
52
-    '.': "src/lib-build.js",
76
+    '.': "src/lib-build.ts",
53 77
     ...cModuleMap
54 78
   },
55 79
   output: [
@@ -78,8 +102,11 @@ export default {
78 102
       browser: true,
79 103
       extensions,
80 104
     }),
105
+    image(),
106
+    json(),
107
+    // sourcemaps(),
81 108
     commonjs({
82
-      include: 'node_modules/**',
109
+      include: /node_modules/,
83 110
       browser: true,
84 111
       namedExports: {
85 112
         ...getNamedExports([
@@ -89,13 +116,6 @@ export default {
89 116
         'braft-extensions/dist/emoticon': ['defaultEmoticons']
90 117
       },
91 118
     }),
92
-    babel({
93
-      exclude: "node_modules/**",
94
-      runtimeHelpers: true,
95
-      extensions,
96
-    }),
97
-    image(),
98
-    json(),
99 119
     // url(),
100 120
     // less(),
101 121
     postcss({
@@ -108,11 +128,34 @@ export default {
108 128
       ],
109 129
       modules: true,
110 130
     }),
131
+    ts({
132
+      exclude: "node_modules/**",
133
+      transpiler: "babel",
134
+      hook: {
135
+        outputPath: (path, kind) => {
136
+          return path
137
+        }
138
+      }
139
+    }),
140
+    // typescript({
141
+    //   include: ["*.js+(|x)", "**/*.js+(|x)", "*.ts+(|x)", "**/*.ts+(|x)"],
142
+    //   verbosity: 3,
143
+    //   clean: true,
144
+    //   typescript: require('typescript'),
145
+    //   // useTsconfigDeclarationDir: true,
146
+    //   rollupCommonJSResolveHack: true,
147
+    //   objectHashIgnoreUnknownHack: true,
148
+    // }),
149
+    babel({
150
+      exclude: "node_modules/**",
151
+      runtimeHelpers: true,
152
+      extensions,
153
+    }),
111 154
     alias({
112 155
       entries: [
113 156
         { find: '@', replacement: 'src' },
114 157
         { find: '@components', replacement: 'src/components' },
115
-      ]
158
+      ],
116 159
     }),
117 160
     visualizer({
118 161
       sourcemap: true,

+ 0
- 38
src/App.css View File

@@ -1,38 +0,0 @@
1
-.App {
2
-  text-align: center;
3
-}
4
-
5
-.App-logo {
6
-  height: 40vmin;
7
-  pointer-events: none;
8
-}
9
-
10
-@media (prefers-reduced-motion: no-preference) {
11
-  .App-logo {
12
-    animation: App-logo-spin infinite 20s linear;
13
-  }
14
-}
15
-
16
-.App-header {
17
-  background-color: #282c34;
18
-  min-height: 100vh;
19
-  display: flex;
20
-  flex-direction: column;
21
-  align-items: center;
22
-  justify-content: center;
23
-  font-size: calc(10px + 2vmin);
24
-  color: white;
25
-}
26
-
27
-.App-link {
28
-  color: #61dafb;
29
-}
30
-
31
-@keyframes App-logo-spin {
32
-  from {
33
-    transform: rotate(0deg);
34
-  }
35
-  to {
36
-    transform: rotate(360deg);
37
-  }
38
-}

+ 0
- 9
src/App.test.tsx View File

@@ -1,9 +0,0 @@
1
-import React from 'react';
2
-import { render } from '@testing-library/react';
3
-import App from './App';
4
-
5
-test('renders learn react link', () => {
6
-  const { getByText } = render(<App />);
7
-  const linkElement = getByText(/learn react/i);
8
-  expect(linkElement).toBeInTheDocument();
9
-});

+ 0
- 26
src/App.tsx View File

@@ -1,26 +0,0 @@
1
-import React from 'react';
2
-import logo from './logo.svg';
3
-import './App.css';
4
-
5
-const App: React.FC = () => {
6
-  return (
7
-    <div className="App">
8
-      <header className="App-header">
9
-        <img src={logo} className="App-logo" alt="logo" />
10
-        <p>
11
-          Edit <code>src/App.tsx</code> and save to reload.
12
-        </p>
13
-        <a
14
-          className="App-link"
15
-          href="https://reactjs.org"
16
-          target="_blank"
17
-          rel="noopener noreferrer"
18
-        >
19
-          Learn React
20
-        </a>
21
-      </header>
22
-    </div>
23
-  );
24
-}
25
-
26
-export default App;

+ 0
- 1
src/components/Common/index.ts View File

@@ -1 +0,0 @@
1
-export { Test } from './test';

+ 0
- 3
src/components/Common/test.less View File

@@ -1,3 +0,0 @@
1
-.red {
2
-  color: red;
3
-}

+ 0
- 233
src/components/Common/test.tsx View File

@@ -1,233 +0,0 @@
1
-import React, { PureComponent } from "react";
2
-import classnames from 'classnames';
3
-
4
-import styles from './test.less';
5
-
6
-export const ImgRowList = (
7
-  imglist: Array<string>,
8
-  outterKey: string,
9
-  type: string | null = 'normal',
10
-) => {
11
-  if (!imglist || !Array.isArray(imglist)) return null;
12
-  return (
13
-    <div
14
-      className={classnames(styles.normal_img_row_list, {
15
-        [styles.middle_type]: type === 'middle',
16
-      })}
17
-    >
18
-      {imglist.map((image_url: string, index: number) => {
19
-        return (
20
-          <span key={`${outterKey}_${image_url}`}>
21
-            <img src={image_url} alt={`comment ${index}`} />
22
-          </span>
23
-        );
24
-      })}
25
-    </div>
26
-  );
27
-};
28
-
29
-interface MyNormalListProps {
30
-  style?: any;
31
-  renderItem: Function | any;
32
-  renderData: Array<any>;
33
-}
34
-export class MyNormalList extends PureComponent<MyNormalListProps, {}> {
35
-  render() {
36
-    const {
37
-      style: innerStyle = {},
38
-      renderItem = () => {},
39
-      renderData = [],
40
-    } = this.props;
41
-
42
-    if (!renderData || !Array.isArray(renderData)) {
43
-      console.error('MyNormalList Components renderData Props must be Array');
44
-      return null;
45
-    }
46
-
47
-    return (
48
-      <div className={styles.normal_list_wrapper} style={innerStyle}>
49
-        {renderData.map((value, index, arr) => renderItem(value, index))}
50
-      </div>
51
-    );
52
-  }
53
-}
54
-
55
-interface NormalCardProps {
56
-  key: any;
57
-  userinfo: {
58
-    nickname: string | any;
59
-    avatar: string | any;
60
-    created: string | number;
61
-  };
62
-  main_content: any;
63
-  append_content?: any;
64
-  content_img_assets?: Array<string>;
65
-  options?: {
66
-    header_size?: 'small' | 'normal' | 'middle';
67
-    bottom_divider?: boolean;
68
-  };
69
-}
70
-export class NormalCard extends PureComponent<NormalCardProps, {}> {
71
-  render() {
72
-    const {
73
-      userinfo: { nickname, avatar, created } = {
74
-        nickname: '',
75
-        avatar: '',
76
-        created: '',
77
-      },
78
-      main_content = null,
79
-      append_content = null,
80
-      content_img_assets = [],
81
-      options = {
82
-        header_size: 'normal',
83
-        bottom_divider: false,
84
-      },
85
-    } = this.props;
86
-    //
87
-
88
-    const RENDEROPTIONS_showImgList =
89
-      content_img_assets && content_img_assets.length > 0;
90
-
91
-    return (
92
-      <div
93
-        className={classnames(styles.normal_card_wrapper, {
94
-          [styles.header_middle]: options.header_size === 'middle', // default
95
-          [styles.header_small]: options.header_size === 'small',
96
-          [styles.bottom_border]: options.bottom_divider,
97
-        })}
98
-      >
99
-        <time>{created}</time>
100
-        <header>
101
-          {typeof avatar === 'string' ? (
102
-            <div className={styles.avatar_wrapper}>
103
-              <img src={avatar} alt="user_avatar" />
104
-            </div>
105
-          ) : (
106
-            avatar
107
-          )}
108
-          <div className={styles.nickname_wrapper}>{nickname}</div>
109
-        </header>
110
-        <div className={styles.main_content_wrapper}>
111
-          {main_content}
112
-          {RENDEROPTIONS_showImgList
113
-            ? ImgRowList(content_img_assets, this.props.key)
114
-            : null}
115
-        </div>
116
-        <div className={styles.append_wrapper}>{append_content}</div>
117
-      </div>
118
-    );
119
-  }
120
-}
121
-
122
-interface ShareCardProps {
123
-  isMobile: boolean | any;
124
-  mode: 'line' | 'block';
125
-  render_mode: 'text' | 'object';
126
-  share_data: any;
127
-}
128
-export class ShareCard extends PureComponent<ShareCardProps, {}> {
129
-  render() {
130
-    const {
131
-      isMobile = false,
132
-      render_mode = 'text',
133
-      mode = 'line',
134
-      share_data = '',
135
-    } = this.props;
136
-
137
-    return (
138
-      <div
139
-        className={classnames(styles.share_card_wrapper, {
140
-          [styles.mobile_mode]: isMobile,
141
-          [styles.mode_line]: mode === 'line', // default
142
-          [styles.mode_block]: mode === 'block',
143
-        })}
144
-      >
145
-        {render_mode === 'text' ? share_data : null}
146
-      </div>
147
-    );
148
-  }
149
-}
150
-
151
-// type TransmitType = 'imgTxt' | 'shortVideo' | 'microVideo';
152
-// type TransmitImgTxtData = {
153
-//   user_id?: string|number;
154
-//   anonymity?: boolean;
155
-//   avatar?: string;
156
-//   nickname?: string;
157
-//   is_long?: boolean;
158
-// }
159
-
160
-// interface TransmitCardProps {
161
-//   type: TransmitType;
162
-//   data: TransmitImgTxtData;
163
-// }
164
-
165
-// export class TransmitCard extends React.PureComponent<TransmitCardProps, {}> {
166
-//   renderVideo() {
167
-//     return <div className={styles.transmitVideoCard}>Video</div>;
168
-//   }
169
-
170
-//   renderImgTxt() {
171
-//     const { data } = this.props;
172
-//     const {
173
-//       user_id,
174
-//       anonymity,
175
-//       avatar,
176
-//       nickname,
177
-//       is_long,
178
-//     } = data;
179
-
180
-//     return (
181
-//       <div className={styles.transmitImgTxtCard}>
182
-//         <div className={styles.header}>
183
-//           <UserLink user_id={user_id} anonymity={anonymity}>
184
-//             <Avatar
185
-//               id={user_id}
186
-//               image={avatar}
187
-//               follow={false}
188
-//               size="cover"
189
-//               className={styles.ava}
190
-//               anonymity={anonymity}
191
-//             />
192
-//           </UserLink>
193
-//           <div className={styles.nickname}>
194
-//             <UserLink user_id={user_id} anonymity={anonymity}>
195
-//               {nickname}
196
-//             </UserLink>
197
-//           </div>
198
-//           <div className={styles.type}>
199
-//             {is_long
200
-//               ? intl.get('bilingually.imgtxt.article')
201
-//               : intl.get('bilingually.imgtxt')}
202
-//           </div>
203
-//         </div>
204
-//       </div>
205
-//     );
206
-//   }
207
-
208
-//   render() {
209
-//     const { type } = this.props;
210
-//     if (type === 'imgTxt') {
211
-//       this.renderImgTxt();
212
-//     }
213
-//     if (type === 'shortVideo' || type === 'microVideo') {
214
-//       this.renderVideo();
215
-//     }
216
-//     return null;
217
-//   }
218
-// }
219
-
220
-export const Test = "TestComponent";
221
-export const TestRedTxt = () => (
222
-  <div className={styles.red}>
223
-    RedTxt
224
-  </div>
225
-)
226
-
227
-export default {
228
-  MyNormalList,
229
-  NormalCard,
230
-  ShareCard,
231
-  Test,
232
-  // TransmitCard
233
-};

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

@@ -1,66 +0,0 @@
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;

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

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

+ 0
- 189
src/components/Editor/RichTextEditor/index.tsx View File

@@ -1,189 +0,0 @@
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";
5
-
6
-interface RichTextEditorProps {}
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
-]);
67
-
68
-class RichTextEditor extends React.Component<
69
-  RichTextEditorProps,
70
-  RichTextEditorState
71
-> {
72
-  constructor(props: RichTextEditorProps) {
73
-    super(props);
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;
163
-  }
164
-
165
-  render() {
166
-    const { editorState } = this.state;
167
-    return (
168
-      <div className={styles.wrapper}>
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>
184
-      </div>
185
-    );
186
-  }
187
-}
188
-
189
-export default RichTextEditor;

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


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

@@ -1,49 +0,0 @@
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;

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

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

+ 0
- 60
src/components/Payment/Common/ConsumeListView/ConsumeListView.less View File

@@ -1,60 +0,0 @@
1
-.wrapper {
2
-  display: flex;
3
-  justify-content: center;
4
-
5
-  .consumelist {
6
-    padding: 0;
7
-    margin: 0;
8
-    display: flex;
9
-    flex-wrap: wrap;
10
-    padding-top: 10px;
11
-
12
-    li {
13
-      list-style: none;
14
-    }
15
-
16
-    .consumeItem {
17
-      margin: 0 6px 10px;
18
-      text-align: center;
19
-      position: relative;
20
-
21
-      .kingdomIcon {
22
-        position: absolute;
23
-        width: 24px;
24
-        height: 22px;
25
-        left: -6px;
26
-        top: -12px;
27
-      }
28
-
29
-      .avatar {
30
-        margin: 0 auto 4px;
31
-        width: 36px;
32
-        height: 36px;
33
-        background-size: cover;
34
-        border-radius: 50%;
35
-      }
36
-
37
-      .gray {
38
-        color: #9b9b9b;
39
-        font-size: 12px;
40
-      }
41
-    }
42
-
43
-    .toggle {
44
-      margin: 0 6px 10px;
45
-      width: 36px;
46
-      height: 36px;
47
-      line-height: 36px;
48
-      background-color: #ececec;
49
-      border-radius: 50%;
50
-      color: #a8adb6;
51
-      cursor: pointer;
52
-      background-image: url(../assets/btn_toggle.png);
53
-      background-position: center;
54
-
55
-      &.expand {
56
-        transform: rotate(180deg);
57
-      }
58
-    }
59
-  }
60
-}

+ 0
- 3
src/components/Payment/Common/ConsumeListView/README.md View File

@@ -1,3 +0,0 @@
1
-# ConsumeListView
2
-
3
-- 简单介绍

+ 0
- 166
src/components/Payment/Common/ConsumeListView/index.tsx View File

@@ -1,166 +0,0 @@
1
-import React, { Component } from 'react';
2
-import classnames from 'classnames';
3
-
4
-// import { DEFAULT_AVATAR } from '@/constants';
5
-import { addImageProcess } from '../../Utils/utils';
6
-import KingDomPic from '../assets/popovers_list_huangguan.png';
7
-
8
-import styles from './ConsumeListView.less';
9
-
10
-const DEFAULT_AVATAR =
11
-  '//links-comment.oss-cn-beijing.aliyuncs.com/comment/20180820/Kgka4_oU1.jpeg';
12
-
13
-type Props = {
14
-  isToggle: boolean;
15
-  onToggleChange: Function;
16
-  dataSource: Array<{
17
-    id?: string|number;
18
-    user_avatar?: string;
19
-    bill_price?: number;
20
-  }>;
21
-  listLength: number;
22
-  showLength: number;
23
-  options: {
24
-    avatarSize: number,
25
-    avatarMarginLeftAndRight: number,
26
-    kingdomWidth: number,
27
-    kingdomHeight: number,
28
-    kingdomPosition: [number, number],
29
-  },
30
-}
31
-
32
-class ConsumeListView extends Component<Props> {
33
-  static defaultProps: Props = {
34
-    isToggle: false,
35
-    onToggleChange: () => {},
36
-    dataSource: [],
37
-    listLength: 0,
38
-    showLength: 6,
39
-    options: {
40
-      avatarSize: 36,
41
-      avatarMarginLeftAndRight: 6,
42
-      kingdomWidth: 24,
43
-      kingdomHeight: 22,
44
-      kingdomPosition: [-6, -12],
45
-    },
46
-  }
47
-
48
-  renderConsumeItem() {
49
-    const {
50
-      dataSource,
51
-      isToggle,
52
-      showLength,
53
-      listLength,
54
-      options,
55
-    } = this.props;
56
-    const {
57
-      kingdomWidth,
58
-      kingdomHeight,
59
-      kingdomPosition,
60
-      avatarSize,
61
-      avatarMarginLeftAndRight,
62
-    } = options;
63
-
64
-    let renderData = dataSource;
65
-    if (!isToggle && listLength > showLength) {
66
-      renderData = dataSource.slice(0, showLength - 1);
67
-    }
68
-
69
-    return renderData.map((v, i) => {
70
-      let kingdom = null;
71
-      if (i === 0) {
72
-        kingdom = (
73
-          <img
74
-            className={styles.kingdomIcon}
75
-            src={KingDomPic}
76
-            alt="reward top user"
77
-            style={{
78
-              width: `${kingdomWidth}px`,
79
-              height: `${kingdomHeight}px`,
80
-              left: `${kingdomPosition[0]}px`,
81
-              top: `${kingdomPosition[1]}px`,
82
-            }}
83
-          />
84
-        );
85
-      }
86
-      return (
87
-        <li
88
-          key={v.id}
89
-          className={styles.consumeItem}
90
-          style={{ margin: `0 ${avatarMarginLeftAndRight}px 10px` }}
91
-        >
92
-          {kingdom}
93
-          <div
94
-            className={styles.avatar}
95
-            style={{
96
-              backgroundImage: `url(${addImageProcess(
97
-                v.user_avatar || DEFAULT_AVATAR,
98
-                {
99
-                  small: true,
100
-                },
101
-              )})`,
102
-              width: `${avatarSize}px`,
103
-              height: `${avatarSize}px`,
104
-            }}
105
-          />
106
-          <span className={styles.gray}>
107
-            {/* {intl.get('bilingually.gift.item', {
108
-              nums: v.bill_price / 100,
109
-            }) /* {item.num}另币 */}
110
-          </span>
111
-        </li>
112
-      );
113
-    });
114
-  }
115
-
116
-  renderToggleButton() {
117
-    const {
118
-      isToggle,
119
-      onToggleChange,
120
-      listLength,
121
-      showLength,
122
-      options,
123
-    } = this.props;
124
-    const { avatarSize, avatarMarginLeftAndRight } = options;
125
-
126
-    if (listLength <= showLength) {
127
-      return null;
128
-    }
129
-
130
-    return (
131
-      <li
132
-        onClick={() => onToggleChange()}
133
-        className={classnames(styles.toggle, {
134
-          [styles.expand]: isToggle,
135
-        })}
136
-        style={{
137
-          width: `${avatarSize}px`,
138
-          height: `${avatarSize}px`,
139
-          lineHeight: `${avatarSize}px`,
140
-          margin: `0 ${avatarMarginLeftAndRight}px 10px`,
141
-        }}
142
-      />
143
-    );
144
-  }
145
-
146
-  render() {
147
-    const { showLength, options } = this.props;
148
-    const { avatarSize, avatarMarginLeftAndRight } = options;
149
-    return (
150
-      <div className={styles.wrapper}>
151
-        <ul
152
-          className={styles.consumelist}
153
-          style={{
154
-            width: `calc(${avatarMarginLeftAndRight * 2 +
155
-              avatarSize}px * ${showLength})`,
156
-          }}
157
-        >
158
-          {this.renderConsumeItem()}
159
-          {this.renderToggleButton()}
160
-        </ul>
161
-      </div>
162
-    );
163
-  }
164
-}
165
-
166
-export default ConsumeListView;

+ 0
- 112
src/components/Payment/Common/PayPlatformOptions/PayPlatformOptions.less View File

@@ -1,112 +0,0 @@
1
-.flexContainer {
2
-  display: flex;
3
-  justify-content: space-around;
4
-  align-items: center;
5
-
6
-  .flexItem {
7
-
8
-  }
9
-}
10
-
11
-
12
-.label {
13
-  font-size: 14px;
14
-  font-weight: 400;
15
-  color: #616A79;
16
-}
17
-.payment-method-box {
18
-  padding: 20px 10px 10px 10px;
19
-  text-align: center;
20
-
21
-  .payment-method {
22
-      display: inline-block;
23
-      margin: 0;
24
-      width: 60%;
25
-      vertical-align: middle;
26
-      &-before {
27
-          // TODO pseudo doesn't work
28
-          // content: '';
29
-          display: inline-block;
30
-          height: 100%;
31
-          vertical-align: middle;
32
-      }
33
-  }
34
-
35
-  .payitem {
36
-      display: flex;
37
-      justify-content: center;
38
-      align-items: center;
39
-      cursor: pointer;
40
-      border: 1px solid transparent;
41
-      height: 66px;
42
-      line-height: 66px;
43
-
44
-      .platformName {
45
-        text-align: center;
46
-        white-space: nowrap;
47
-      }
48
-
49
-      &.small {
50
-        width: 88px;
51
-        height: 36px;
52
-        line-height: 36px;
53
-        
54
-        .payment-method {
55
-          margin: 0;
56
-        }
57
-      }
58
-
59
-      &.normal {
60
-        width: 132px;
61
-      }
62
-
63
-      &.large {
64
-        width: 162px;
65
-      }
66
-
67
-      &.active {
68
-          border-radius: 5px;
69
-          border-color:#1790FF;
70
-          box-shadow: 0px 2px 6px 0px rgba(163,163,163,0.3);
71
-      }
72
-
73
-      &.en {
74
-        font-size: 12px;
75
-      }
76
-  }
77
-
78
-  &.mobile {
79
-      padding: 8px 10px 10px 8px;
80
-      .payitem {
81
-          display: inline-flex;
82
-          flex-direction: column;
83
-          justify-content: space-around;
84
-          width: 78px;
85
-          height: 80px;
86
-          line-height: initial;
87
-          border: 1px solid transparent;
88
-
89
-          &.active {
90
-              border-radius: 4px;
91
-              border-color: #1790FF;
92
-          }
93
-
94
-          .payment-method {
95
-              display: inline-block;
96
-              width: 34px;
97
-              height: 34px;
98
-          }
99
-      }
100
-  }
101
-}
102
-
103
-@media (max-width: 768px) {
104
-  .payitem {
105
-      cursor: pointer;
106
-      border: 1px solid transparent;
107
-      &.active {
108
-          border-radius: 5px;
109
-          border-color:#1790FF;
110
-      }
111
-  }
112
-}

+ 0
- 3
src/components/Payment/Common/PayPlatformOptions/README.md View File

@@ -1,3 +0,0 @@
1
-# PayPlatformOptions
2
-
3
-- 简单介绍

+ 0
- 234
src/components/Payment/Common/PayPlatformOptions/index.tsx View File

@@ -1,234 +0,0 @@
1
-import React, { PureComponent } from "react";
2
-import classnames from "classnames";
3
-
4
-import iconAlipay from "../assets/kcxq_popovers_icon_alipay@2x.png";
5
-import iconWechatpay from "../assets/kcxq_popovers_icon_wechatpay@2x.png";
6
-import iconPaypal from "../assets/kcxq_popovers_icon_paypal@2x.png";
7
-import mobileIconAlipay from "../assets/payment_btn_pay_alipay@2x.png";
8
-import mobileIconWechatpay from "../assets/payment_btn_pay_wechatpay@2x.png";
9
-import mobileIconPaypal from "../assets/payment_btn_pay_paypal@2x.png";
10
-
11
-import styles from "./PayPlatformOptions.less";
12
-import { exportStyleSizeClass } from "../../Utils/utils";
13
-
14
-type PAY_CHANNEL_VALUE =
15
-  | "PAYPAL_PAYPAL"
16
-  | "ALI_WEB"
17
-  | "ALI_WAP"
18
-  | "WX_WAP"
19
-  | "WX_NATIVE";
20
-interface PAY_CHANNEL_TYPE {
21
-  PAYPAL: PAY_CHANNEL_VALUE;
22
-  ALI_WEB: PAY_CHANNEL_VALUE;
23
-  ALI_WAP: PAY_CHANNEL_VALUE;
24
-  WX_WAP: PAY_CHANNEL_VALUE;
25
-  WX_NATIVE: PAY_CHANNEL_VALUE;
26
-}
27
-
28
-interface Props {
29
-  payitem: PAY_CHANNEL_VALUE;
30
-  onPayItemChange: (value: PAY_CHANNEL_VALUE) => void;
31
-  isMobile: boolean;
32
-  size: "small" | "normal" | "large";
33
-  withTitle: boolean;
34
-  titleTxt?: string;
35
-  locale: "zh" | "en";
36
-}
37
-
38
-export const PAY_CHANNEL: PAY_CHANNEL_TYPE = {
39
-  PAYPAL: "PAYPAL_PAYPAL", // PAYPAL_LIVE
40
-  ALI_WEB: "ALI_WEB",
41
-  ALI_WAP: "ALI_WAP",
42
-  WX_WAP: "WX_WAP",
43
-  WX_NATIVE: "WX_NATIVE"
44
-};
45
-
46
-class PayPlatformOptions extends PureComponent<Props, {}> {
47
-  render() {
48
-    const {
49
-      payitem,
50
-      onPayItemChange,
51
-      isMobile = false,
52
-      size = "normal",
53
-      withTitle = true,
54
-      titleTxt,
55
-      locale = "zh"
56
-    } = this.props;
57
-
58
-    let titleDOM = null;
59
-    if (withTitle) {
60
-      const titleResult = titleTxt || locale === 'zh' ? '支付方式' : 'Payment';
61
-      titleDOM = (
62
-        <div className={styles.label}>
63
-          {titleResult}
64
-        </div>
65
-      );
66
-    }
67
-
68
-    if (isMobile) {
69
-      return (
70
-        <div>
71
-          {titleDOM}
72
-          <div
73
-            className={classnames(styles["payment-method-box"], {
74
-              [styles.mobile]: isMobile
75
-            })}
76
-          >
77
-            <div className={styles.flexContainer}>
78
-              <div className={styles.flexItem}>
79
-                <div
80
-                  className={classnames(
81
-                    {
82
-                      [styles.payitem]: true,
83
-                      [styles.active]: payitem === PAY_CHANNEL.ALI_WEB,
84
-                      ...exportStyleSizeClass(styles, size),
85
-                    },
86
-                    styles[locale]
87
-                  )}
88
-                  onClick={() => {
89
-                    onPayItemChange(PAY_CHANNEL.ALI_WEB);
90
-                  }}
91
-                >
92
-                  <img
93
-                    src={mobileIconAlipay}
94
-                    alt="alipay"
95
-                    className={styles["payment-method"]}
96
-                  />
97
-                  <div className={styles.platformName}>
98
-                    支付宝
99
-                  </div>
100
-                </div>
101
-              </div>
102
-              <div className={styles.flexItem}>
103
-                <div
104
-                  className={classnames(
105
-                    {
106
-                      [styles.payitem]: true,
107
-                      [styles.active]: payitem === PAY_CHANNEL.WX_NATIVE,
108
-                      ...exportStyleSizeClass(styles, size),
109
-                    },
110
-                    styles[locale]
111
-                  )}
112
-                  onClick={() => {
113
-                    onPayItemChange(PAY_CHANNEL.WX_NATIVE);
114
-                  }}
115
-                >
116
-                  <img
117
-                    src={mobileIconWechatpay}
118
-                    alt="wechatpay"
119
-                    className={styles["payment-method"]}
120
-                  />
121
-                  <div className={styles.platformName}>
122
-                    微信
123
-                  </div>
124
-                </div>
125
-              </div>
126
-              <div className={styles.flexItem}>
127
-                <div
128
-                  className={classnames(
129
-                    {
130
-                      [styles.payitem]: true,
131
-                      [styles.active]: payitem === PAY_CHANNEL.PAYPAL,
132
-                      ...exportStyleSizeClass(styles, size),
133
-                    },
134
-                    styles[locale]
135
-                  )}
136
-                  onClick={() => {
137
-                    onPayItemChange(PAY_CHANNEL.PAYPAL);
138
-                  }}
139
-                >
140
-                  <img
141
-                    src={mobileIconPaypal}
142
-                    alt="paypal"
143
-                    className={styles["payment-method"]}
144
-                  />
145
-                  <div className={styles.platformName}>
146
-                    Paypal
147
-                  </div>
148
-                </div>
149
-              </div>
150
-            </div>
151
-          </div>
152
-        </div>
153
-      );
154
-    }
155
-
156
-    return (
157
-      <div>
158
-        {titleDOM}
159
-        <div className={styles["payment-method-box"]}>
160
-          <div className={styles.flexContainer}>
161
-            <div className={styles.flexItem}>
162
-              <div
163
-                className={classnames(
164
-                  {
165
-                    [styles.payitem]: true,
166
-                    [styles.active]: payitem === PAY_CHANNEL.ALI_WEB,
167
-                    ...exportStyleSizeClass(styles, size),
168
-                  },
169
-                  styles[locale]
170
-                )}
171
-                onClick={() => {
172
-                  onPayItemChange(PAY_CHANNEL.ALI_WEB);
173
-                }}
174
-              >
175
-                <span className={styles["payment-method-before"]} />
176
-                <img
177
-                  src={iconAlipay}
178
-                  alt="alipay"
179
-                  className={styles["payment-method"]}
180
-                />
181
-              </div>
182
-            </div>
183
-            <div className={styles.flexItem}>
184
-              <div
185
-                className={classnames(
186
-                  {
187
-                    [styles.payitem]: true,
188
-                    [styles.active]: payitem === PAY_CHANNEL.WX_NATIVE,
189
-                    ...exportStyleSizeClass(styles, size),
190
-                  },
191
-                  styles[locale]
192
-                )}
193
-                onClick={() => {
194
-                  onPayItemChange(PAY_CHANNEL.WX_NATIVE);
195
-                }}
196
-              >
197
-                <span className={styles["payment-method-before"]} />
198
-                <img
199
-                  src={iconWechatpay}
200
-                  alt="wechatpay"
201
-                  className={styles["payment-method"]}
202
-                />
203
-              </div>
204
-            </div>
205
-            <div className={styles.flexItem}>
206
-              <div
207
-                className={classnames(
208
-                  {
209
-                    [styles.payitem]: true,
210
-                    [styles.active]: payitem === PAY_CHANNEL.PAYPAL,
211
-                    ...exportStyleSizeClass(styles, size),
212
-                  },
213
-                  styles[locale]
214
-                )}
215
-                onClick={() => {
216
-                  onPayItemChange(PAY_CHANNEL.PAYPAL);
217
-                }}
218
-              >
219
-                <span className={styles["payment-method-before"]} />
220
-                <img
221
-                  src={iconPaypal}
222
-                  alt="paypal"
223
-                  className={styles["payment-method"]}
224
-                />
225
-              </div>
226
-            </div>
227
-          </div>
228
-        </div>
229
-      </div>
230
-    );
231
-  }
232
-}
233
-
234
-export default PayPlatformOptions;

+ 0
- 133
src/components/Payment/Common/PriceOptions/PriceOptions.less View File

@@ -1,133 +0,0 @@
1
-@item_width: 70px;
2
-@item_margin: 6px;
3
-.options{
4
-  padding: 20px 50px;
5
-  border-bottom: 1px dashed #00000017;
6
-  p {
7
-    font-size:14px;
8
-    font-weight:400;
9
-    color:rgba(97,106,121,1);
10
-    margin-bottom: 20px;
11
-  }
12
-  .infoItem {
13
-    padding-right: 0;
14
-    .priceItem {
15
-      background:rgba(243,243,243,0.14);
16
-      border-radius:4px;
17
-      border:1px solid rgba(207,207,207,1);
18
-      font-size:14px;
19
-      font-weight:600;
20
-      color:rgba(97,106,121,1);
21
-      display: inline-block;
22
-      text-align: center;
23
-      vertical-align: top;
24
-      height: 30px;
25
-      width: @item_width;
26
-      line-height: 30px;
27
-      cursor: pointer;
28
-      margin: @item_margin;
29
-
30
-      &.active {
31
-        background:rgba(255,50,102,0.1);
32
-        border-radius:4px;
33
-        border:1px solid rgba(255,50,102,1);
34
-        color:rgba(97,106,121,1);
35
-      }
36
-    }
37
-    .priceInput {
38
-        display: inline-block;
39
-        min-width: 70px;
40
-        width: auto;
41
-        margin: @item_margin;
42
-        text-align: center;
43
-    }
44
-    button {
45
-        border-top-left-radius: 0;
46
-        border-bottom-left-radius: 0;
47
-        height: 30px;
48
-        width: 50px;
49
-        vertical-align: top;
50
-        padding: 0 5px;
51
-    }
52
-    .rate {
53
-        margin-left: 10px;
54
-        i {
55
-            margin-right: 5px;
56
-            color: #1790FF;
57
-        }
58
-    }
59
-  }
60
-
61
-  &.small {
62
-    @item_width: 72px;
63
-    @item_margin: 19px;
64
-
65
-    padding: 0 0 12px 0;
66
-    // padding: 12px 20px;
67
-    border-bottom: none;
68
-    p {
69
-      margin-bottom: 8px;
70
-    }
71
-    .infoItem {
72
-      text-align: center;
73
-
74
-      .priceItem {
75
-        border-radius:6px;
76
-        height: 32px;
77
-        width: @item_width;
78
-        margin: 0 0 (@item_margin - 7px) @item_margin;
79
-      }
80
-      .priceItem:first-child{
81
-        margin: 0 0 (@item_margin - 7px) 0px;
82
-      }
83
-
84
-      .priceInput {
85
-        display: block;
86
-        width: @item_width*3+@item_margin*2;
87
-        border-radius: 6px;
88
-        height: 32px;
89
-      }
90
-    }
91
-  }
92
-}
93
-
94
-@media (max-width: 768px) {
95
-  .options {
96
-    padding: 20px 20px;
97
-    p{
98
-      font-size:14px;
99
-      font-weight:400;
100
-      color:rgba(97,106,121,1);
101
-    }
102
-    .infoItem {
103
-      padding-right: 0;
104
-      display: flex;
105
-      flex-direction: column;
106
-      justify-content: center;
107
-      .priceBtn{
108
-        display: flex;
109
-        justify-content: space-between;
110
-      }
111
-      .priceItem {
112
-        display: inline-block;
113
-        background-color: #fff;
114
-        width:74px;
115
-        height:36px;
116
-        line-height: 36px;
117
-        border-radius:6px;
118
-        border:1px solid rgba(207,207,207,1);
119
-          &.active {
120
-          background-color: #fff;
121
-          color: #FF3266FF;
122
-          border-radius:4px;
123
-          border:1px solid rgba(255,50,102,1);
124
-        }
125
-      }
126
-      .priceInput {
127
-        border-radius:6px;
128
-        height: 36px;
129
-        width: auto;
130
-      }
131
-    }
132
-  }
133
-}

+ 0
- 3
src/components/Payment/Common/PriceOptions/README.md View File

@@ -1,3 +0,0 @@
1
-# PriceOptions
2
-
3
-- 简单介绍

+ 0
- 92
src/components/Payment/Common/PriceOptions/index.tsx View File

@@ -1,92 +0,0 @@
1
-import React, { useState } from "react";
2
-import classnames from "classnames";
3
-import { formatMoney } from "../../Utils/utils";
4
-
5
-import styles from "./PriceOptions.less";
6
-
7
-const FormattedMessage = ({ id }: any) => id;
8
-
9
-interface Props {
10
-  price: number;
11
-  onPriceChange: (v: number) => void;
12
-  size: "small" | "normal" | "large";
13
-  focusScroll: boolean;
14
-  withTitle: boolean;
15
-  inputRef: React.RefObject<any>;
16
-}
17
-
18
-const PriceOptions = ({
19
-  price,
20
-  onPriceChange,
21
-  size = "normal",
22
-  focusScroll = true,
23
-  withTitle = true,
24
-  inputRef
25
-}: Props) => {
26
-  const defaultOptions = [100, 600, 800];
27
-  // 控制是否为其他金额输入情况
28
-  const [inputStatus, setInputStatus] = useState(false);
29
-
30
-  return (
31
-    <div
32
-      className={classnames(styles.options)}
33
-    >
34
-      {withTitle ? (
35
-        <p>
36
-          <FormattedMessage id="pay.price.select.text" />
37
-        </p>
38
-      ) : null}
39
-      <div className={styles.infoItem} style={{ marginBottom: "-12px" }}>
40
-        <span className={styles.priceBtn}>
41
-          {defaultOptions.map(item => (
42
-            <span
43
-              className={classnames({
44
-                [styles.priceItem]: true,
45
-                [styles.active]: price === item && !inputStatus
46
-              })}
47
-              key={item}
48
-              onClick={() => {
49
-                onPriceChange(item);
50
-                setInputStatus(false);
51
-              }}
52
-            >
53
-              <FormattedMessage id={`${formatMoney(item/100, 0)}¥`} />
54
-            </span>
55
-          ))}
56
-        </span>
57
-        {/* <Input
58
-          ref={inputRef}
59
-          onMouseEnter={() => {
60
-            if (inputStatus && inputRef && inputRef.current) {
61
-              inputRef.current.focus();
62
-              inputRef.current.select();
63
-            }
64
-          }}
65
-          suffix="¥"
66
-          className={styles.priceInput}
67
-          value={inputStatus ? price / 100 || "" : ""}
68
-          placeholder="Others"
69
-          onChange={e => {
70
-            const n = +e.target.value;
71
-            if (Number.isNaN(n)) {
72
-              return;
73
-            }
74
-            // 测试暂时改成1分
75
-            onPriceChange(n * 100);
76
-          }}
77
-          onClick={e => {
78
-            onPriceChange(0);
79
-            setInputStatus(true);
80
-          }}
81
-          onFocus={e => {
82
-            if (focusScroll) {
83
-              e.target.scrollIntoView();
84
-            }
85
-          }}
86
-        /> */}
87
-      </div>
88
-    </div>
89
-  );
90
-};
91
-
92
-export default PriceOptions;

+ 0
- 3
src/components/Payment/Common/WaitPayInfoView/README.md View File

@@ -1,3 +0,0 @@
1
-# WaitPayInfoView
2
-
3
-简单介绍

+ 0
- 7
src/components/Payment/Common/WaitPayInfoView/WaitPayInfoView.less View File

@@ -1,7 +0,0 @@
1
-.waitingContainer {
2
-  display: flex;
3
-  flex-direction: column;
4
-  justify-content: center;
5
-  align-items: center;
6
-
7
-}

+ 0
- 57
src/components/Payment/Common/WaitPayInfoView/index.tsx View File

@@ -1,57 +0,0 @@
1
-import React, { Component } from 'react';
2
-import classnames from 'classnames';
3
-import styles from './WaitPayInfoView.less';
4
-
5
-import infoIconImg from '../assets/icon-info-blue@2x.svg';
6
-
7
-const Button = (...props: any) => <button {...props}>button</button>;
8
-
9
-interface Props {
10
-  onClickPayed?: Function;
11
-  onClickProblem?: Function;
12
-}
13
-
14
-export class WaitPayInfoView extends Component<Props, {}> {
15
-  static defaultProps = {
16
-    onClickPayed: () => { console.log("onClickPayed"); },
17
-    onClickProblem: () => { console.log("onClickProblem"); }
18
-  }
19
-
20
-  render() {
21
-    const { onClickPayed, onClickProblem } = this.props;
22
-
23
-    return (
24
-      <div className={styles.waitingContainer}>
25
-        <div className={styles.infoIconImgContainer}>
26
-          <img src={infoIconImg} alt="info label icon" />
27
-        </div>
28
-        <div>
29
-          <div className={styles.pay_text}>
30
-            {"live.course_info.pay.notification"}
31
-          </div>
32
-          <div className={styles.btn_row}>
33
-            <Button
34
-              className={classnames(styles.pay_btn, styles.btn_default)}
35
-              size="small"
36
-              onClick={() => { onClickPayed && onClickPayed() }}
37
-            >
38
-              {"live.course_info.pay.payed"}
39
-            </Button>
40
-            <Button
41
-              className={styles.btn_default}
42
-              size="small"
43
-              style={{
44
-                marginLeft: '16px',
45
-              }}
46
-              onClick={() => { onClickProblem && onClickProblem() }}
47
-            >
48
-              {"live.course_info.pay.help"}
49
-            </Button>
50
-          </div>
51
-        </div>
52
-      </div>
53
-    );
54
-  }
55
-}
56
-
57
-export default WaitPayInfoView;

BIN
src/components/Payment/Common/assets/btn_toggle.png View File


+ 0
- 19
src/components/Payment/Common/assets/icon-info-blue@2x.svg View File

@@ -1,19 +0,0 @@
1
-<?xml version="1.0" encoding="UTF-8"?>
2
-<svg width="48px" height="43px" viewBox="0 0 48 43" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
-    <!-- Generator: Sketch 50.2 (55047) - http://www.bohemiancoding.com/sketch -->
4
-    <title>kcxq_popovers_icon_tanhao</title>
5
-    <desc>Created with Sketch.</desc>
6
-    <defs></defs>
7
-    <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
8
-        <g id="另客网_直播课_课程介绍详情_购买提示弹窗" transform="translate(-936.000000, -190.000000)" fill-rule="nonzero">
9
-            <g id="Group-22" transform="translate(690.000000, 110.000000)">
10
-                <g id="kcxq_popovers_icon_tanhao" transform="translate(246.000000, 80.000000)">
11
-                    <path d="M48,21.5 C48,33.3736626 38.3645756,43 26.4797048,43 C21.1306273,43 17.0391144,42.1506173 13.2841328,38.9300412 C11.8140221,37.6736626 1.700369,43.2123457 0.177121771,39.2839506 C-1.06273063,36.0987654 5.95129151,29.2506173 5.31365314,27.0740741 C4.76457565,25.1806584 4.95940959,23.5703704 4.95940959,21.5 C4.95940959,9.62633745 14.5948339,0 26.4797048,0 C38.3645756,0 48,9.62633745 48,21.5 Z" id="Shape" fill="#1790FF"></path>
12
-                    <g id="Group" transform="translate(23.848708, 8.193416)" fill="#FFFFFF">
13
-                        <path d="M2.5,27.4971098 C1.13235294,27.4971098 0,26.3794628 0,24.9971098 C0,23.6147569 1.13235294,22.4971098 2.5,22.4971098 C3.86764706,22.4971098 5,23.6147569 5,24.9971098 C5,26.3794628 3.86764706,27.4971098 2.5,27.4971098 Z M2.5,19.4219653 C1.13235294,19.4219653 0,18.1919075 0,16.6705202 L0,2.75144509 C0,1.24624277 1.13235294,0 2.5,0 C3.86764706,0 5,1.2300578 5,2.75144509 L5,16.6705202 C5,18.1919075 3.86764706,19.4219653 2.5,19.4219653 Z" id="Shape"></path>
14
-                    </g>
15
-                </g>
16
-            </g>
17
-        </g>
18
-    </g>
19
-</svg>

BIN
src/components/Payment/Common/assets/kcxq_popovers_icon_alipay@2x.png View File


BIN
src/components/Payment/Common/assets/kcxq_popovers_icon_paypal@2x.png View File


BIN
src/components/Payment/Common/assets/kcxq_popovers_icon_wechatpay@2x.png View File


BIN
src/components/Payment/Common/assets/payment_btn_pay_alipay@2x.png View File


BIN
src/components/Payment/Common/assets/payment_btn_pay_paypal@2x.png View File


BIN
src/components/Payment/Common/assets/payment_btn_pay_wechatpay@2x.png View File


BIN
src/components/Payment/Common/assets/popovers_list_huangguan.png View File


+ 0
- 44
src/components/Payment/Utils/utils.ts View File

@@ -1,44 +0,0 @@
1
-
2
-export const IMAGE_PROCESS = '?x-oss-process=image/resize,h_350';
3
-export const IMAGE_PROCESS_SMALL = '?x-oss-process=image/resize,h_100';
4
-export const IMAGE_PROCESS_LARGE = '?x-oss-process=image/resize,h_500';
5
-
6
-type AddImageProcessOptions = {
7
-  small?: boolean;
8
-  large?: boolean;
9
-  custom?: boolean;
10
-  width?: string;
11
-  height?: string;
12
-}
13
-
14
-export function addImageProcess(url: string, options: AddImageProcessOptions = { width: '36px', height: '36px' }) {
15
-  // 防止重复添加导致的url不正确
16
-  if (url && url.indexOf('x-oss-process') > -1) {
17
-    return url;
18
-  }
19
-  if (options.small) {
20
-    return url + IMAGE_PROCESS_SMALL;
21
-  }
22
-  if (options.large) {
23
-    return url + IMAGE_PROCESS_LARGE;
24
-  }
25
-  if (options.custom) {
26
-    return `${url}?x-oss-process=image/resize,limit_0,m_fill,w_${options.width},h_${options.height}`;
27
-  }
28
-  return url + IMAGE_PROCESS;
29
-}
30
-
31
-export function formatMoney(input: any, fuzz = 2) {
32
-  if (isNaN(+input)) {
33
-    return input;
34
-  }
35
-  return (+input).toFixed(fuzz);
36
-}
37
-
38
-type classSize = 'small'|'normal'|'large';
39
-
40
-export function exportStyleSizeClass(styles: any, size: classSize) {
41
-  return {
42
-    [styles[size]]: true,
43
-  }
44
-}

+ 0
- 4
src/components/Payment/index.ts View File

@@ -1,4 +0,0 @@
1
-export { default as ConsumeListView } from './Common/ConsumeListView';
2
-export { default as PayPlatformOptions } from './Common/PayPlatformOptions';
3
-export { default as PriceOptions } from './Common/PriceOptions';
4
-export { default as WaitPayInfoView } from './Common/WaitPayInfoView';

+ 35
- 0
src/components/comment/CommentItem.tsx View File

@@ -0,0 +1,35 @@
1
+import React, { Component } from 'react'
2
+
3
+export interface CommentItemData {
4
+  content: string;
5
+  created: number;
6
+  favor_count: number;
7
+  favored: boolean;
8
+  id: string;
9
+  is_speak: boolean;
10
+  medias: any;
11
+  replies: Array<any>
12
+  reply_count: number;
13
+  user_avatar: string;
14
+  user_id: number;
15
+  user_name: string;
16
+}
17
+
18
+interface IP {
19
+  data: CommentItemData;
20
+}
21
+
22
+interface IS {}
23
+
24
+export default class CommentItem extends Component<IP, IS> {
25
+  render() {
26
+    console.log(this.props.data.content);
27
+    return (
28
+      <div>
29
+        {
30
+          this.props.data.content
31
+        }
32
+      </div>
33
+    )
34
+  }
35
+}

+ 20
- 0
src/components/comment/CommentList.tsx View File

@@ -0,0 +1,20 @@
1
+import React, { PureComponent } from 'react'
2
+import CommentItem, { CommentItemData } from './CommentItem'
3
+
4
+interface IP {
5
+  list: Array<CommentItemData>
6
+}
7
+
8
+interface IS {
9
+
10
+}
11
+
12
+export default class CommentList extends PureComponent<IP, IS> {
13
+  render() {
14
+    return (
15
+      <div>
16
+        {this.props.list.map(i => <CommentItem data={i} />)}
17
+      </div>
18
+    )
19
+  }
20
+}

+ 13
- 0
src/components/comment/README.md View File

@@ -0,0 +1,13 @@
1
+# comment
2
+
3
+通用评论组件
4
+
5
+** `veresion 0.1` **
6
+
7
+## Getting Started
8
+
9
+
10
+## Running the tests
11
+
12
+
13
+## Built

+ 34
- 0
src/components/comment/config/constant.js View File

@@ -0,0 +1,34 @@
1
+export const ERROR_DEFAULT = "出错了!";
2
+
3
+export const LIMIT = 10; // 默认 limit
4
+
5
+export const DRIVER_LICENSE_PATH = "/comment";
6
+
7
+export const OSS_LINK = "//links-comment.oss-cn-beijing.aliyuncs.com";
8
+
9
+export const MAX_UPLOAD_NUMBER = 4;
10
+
11
+export const URL_REGEXP = /((http(s)?:)?\/\/)?(www\.)?[-a-zA-Z0-9@:%._+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_+.~#?&//=]*)/g;
12
+
13
+export const REGEXP = /\[[^[\]]+?\]/g;
14
+
15
+export const AVATAR = "";
16
+
17
+export const IMAGE_SPLIT = "IMAGE_SPLIT";
18
+
19
+export const IMAGE_PROCESS = "?x-oss-process=image/resize,h_350";
20
+export const IMAGE_PROCESS_SMALL = "?x-oss-process=image/resize,h_100";
21
+export const IMAGE_PROCESS_LARGE = "?x-oss-process=image/resize,h_500";
22
+
23
+export const COMMENT_TYPE = {
24
+  COMMENT: "comment",
25
+  REPLY: "reply"
26
+};
27
+
28
+// 线上静态库地址
29
+export const LANGUAGE_LINK =
30
+  process.env.NODE_ENV === "production"
31
+    ? "//a.links123.cn/lang"
32
+    : "//a.links123.net/lang";
33
+
34
+export const COMMENT_API = `http://api.links123.net/comment/v1`

+ 18
- 0
src/components/comment/context/index.ts View File

@@ -0,0 +1,18 @@
1
+import React from 'react';
2
+import { LIMIT } from "@/components/comment/config/constant";
3
+
4
+export const CommentContext = React.createContext('comment')
5
+
6
+// const DEFAULT_TYPE = 1;
7
+// const DEFAULT_BUSSINESSID = 'test';
8
+// const DEFAULT_BUSSINESS_USER_ID = 4;
9
+// const DEFAULT_PAGE = 1;
10
+// const DEFAULT_LIMIT = LIMIT;
11
+
12
+export const DefaultValue = {
13
+  type: 1,
14
+  bussiness_id: 'test',
15
+  bussiness_user_id: 4,
16
+  page: 1,
17
+  limit: LIMIT,
18
+}

+ 14
- 0
src/components/comment/demo.jsx View File

@@ -0,0 +1,14 @@
1
+import React from 'react';
2
+import CommentCombine from './index';
3
+import styles from './index.less';
4
+
5
+export class CommentDemo extends React.Component {
6
+  render() {
7
+    return (
8
+      <div className={styles.playgroundWrapper}>
9
+        <CommentCombine />
10
+      </div>
11
+    )
12
+  }
13
+}
14
+export default CommentDemo;

+ 0
- 0
src/components/comment/index.jsx View File


Some files were not shown because too many files changed in this diff