Browse Source

Merge pull request #80 from DouyinFE/docs-addRef

docs: update LICENSE; add reference of typography utils ; add inspired source of form & F/A architecture
pointhalo 4 years ago
parent
commit
949261006d

+ 39 - 0
LICENSE

@@ -19,3 +19,42 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 SOFTWARE.
+
+
+The code implementation of the external library is referenced by douyinFe are:
+
+- Ant Design
+    MIT LICENSE
+
+    Copyright (c) 2015-present Ant UED, https://xtech.antfin.com/
+
+    Permission is hereby granted, free of charge, to any person obtaining
+    a copy of this software and associated documentation files (the
+    "Software"), to deal in the Software without restriction, including
+    without limitation the rights to use, copy, modify, merge, publish,
+    distribute, sublicense, and/or sell copies of the Software, and to
+    permit persons to whom the Software is furnished to do so, subject to
+    the following conditions:
+
+    The above copyright notice and this permission notice shall be
+    included in all copies or substantial portions of the Software.
+
+    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+    EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+    NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+    LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+    OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+    WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+- rc-tree
+
+    MIT LICENSE
+
+    Copyright (c) 2015-present Alipay.com, https://www.alipay.com/
+
+    Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+    The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

+ 6 - 0
packages/semi-foundation/base/foundation.ts

@@ -1,3 +1,9 @@
+/**
+ * The Semi Foundation / Adapter architecture split was inspired by Material Component For Web. (https://github.com/material-components/material-components-web)
+ * We re-implemented our own code based on the principle and added more functions we need according to actual needs.
+ * 
+ */
+ 
 import log from '../utils/log';
 import { noop } from 'lodash-es';
 

+ 5 - 0
packages/semi-foundation/tree/foundation.ts

@@ -1,3 +1,8 @@
+/**
+ * The drag and drop handler implementation is referenced from rc-tree
+ * https://github.com/react-component/tree
+ */
+
 import { isUndefined, difference, pick, cloneDeep, get } from 'lodash-es';
 import BaseFoundation, { DefaultAdapter } from '../base/foundation';
 import {

+ 5 - 0
packages/semi-foundation/tree/treeUtil.ts

@@ -1,3 +1,8 @@
+/**
+ * Part of the utils function implementation process reference
+ * https://github.com/react-component/tree/blob/master/src/util.tsx
+ */
+
 import { difference, uniq, max, isObject, isNull, isUndefined, isEmpty, pick, get } from 'lodash-es';
 
 export interface KeyEntities {

+ 4 - 0
packages/semi-ui/_base/baseComponent.tsx

@@ -1,3 +1,7 @@
+/**
+ * The Semi Foundation / Adapter architecture split was inspired by Material Component For Web. (https://github.com/material-components/material-components-web)
+ * We re-implemented our own code based on the principle and added more functions we need according to actual needs.
+ */
 import React, { Component } from 'react';
 import log from '@douyinfe/semi-foundation/utils/log';
 import { DefaultAdapter } from '@douyinfe/semi-foundation/base/foundation';

+ 8 - 0
packages/semi-ui/form/index.tsx

@@ -1,3 +1,11 @@
+/**
+ * The early design of Semi Form was inspired by informed (https://github.com/joepuzzo/informed) and formik(https://github.com/formium/formik)
+ * The informed API design is very concise, and formik has very clear naming of the form status.
+ * However, due to the requirements of convenient scalability (we need to split into F/A architecture), in additional they have their own binding verification library,
+ * we cannot directly reuse such libraries.
+ * So we fully absorbed these excellent api designs. Combining the technical principles of the two to implement our own code,
+ */
+
 // FormComponent
 import Form from './baseForm';
 import Label from './label';

+ 3 - 0
packages/semi-ui/grid/col.tsx

@@ -1,3 +1,6 @@
+/**
+ * Implementation reference from: https://github.com/ant-design/ant-design/blob/master/components/grid/col.tsx
+ */
 import React from 'react';
 import PropTypes from 'prop-types';
 import { RowContext } from './row';

+ 3 - 0
packages/semi-ui/grid/row.tsx

@@ -1,3 +1,6 @@
+/**
+ * Implementation reference from: https://github.com/ant-design/ant-design/blob/master/components/grid/row.tsx
+ */
 import React from 'react';
 import classnames from 'classnames';
 import PropTypes from 'prop-types';

+ 5 - 0
packages/semi-ui/tree/index.tsx

@@ -174,6 +174,11 @@ class Tree extends BaseComponent<TreeProps, TreeState> {
         this.dragNode = null;
     }
 
+    /**
+     * Process of getDerivedStateFromProps was inspired by rc-tree
+     * https://github.com/react-component/tree
+     */
+
     static getDerivedStateFromProps(props: TreeProps, prevState: TreeState) {
         const { prevProps } = prevState;
         let treeData;

+ 7 - 0
packages/semi-ui/typography/util.tsx

@@ -1,6 +1,13 @@
 import ReactDOM from 'react-dom';
 import React from 'react';
 
+/**
+ * The logic of JS for text truncation is referenced from antd typography
+ * https://github.com/ant-design/ant-design/blob/master/components/typography/util.tsx
+ * 
+ * For more thinking and analysis about this function, please refer to Feishu document
+ * https://bytedance.feishu.cn/docs/doccnqovjjyoKm2U5O13bj30aTh
+ */
 
 let ellipsisContainer: HTMLElement;