chore(project): 添加项目配置文件和忽略规则

- 添加 Babel 配置文件支持 ES6+ 语法转换
- 添加 ESLint 忽略规则和配置文件
- 添加 Git 忽略规则文件
- 添加 Travis CI 配置文件
- 添加 1.4.2 版本变更日志文件
- 添加 Helm 图表辅助模板文件
- 添加 Helm 忽略规则文件
This commit is contained in:
2026-03-27 17:36:48 +08:00
commit c2453d6434
1703 changed files with 277582 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
import React from 'react';
export default React.createContext({});

View File

@@ -0,0 +1,18 @@
import React from 'react';
import GGEditorContext from '@common/context/GGEditorContext';
export default function (WrappedComponent) {
class InjectGGEditorContext extends React.Component {
render() {
const { forwardRef, ...rest } = this.props;
return (
<GGEditorContext.Consumer>
{context => <WrappedComponent ref={forwardRef} {...rest} {...context} />}
</GGEditorContext.Consumer>
);
}
}
return React.forwardRef((props, ref) => <InjectGGEditorContext {...props} forwardRef={ref} />);
}

View File

@@ -0,0 +1,3 @@
import React from 'react';
export default React.createContext({});

View File

@@ -0,0 +1,21 @@
class PropsAPI {
editor = null;
constructor(editor) {
this.editor = editor;
['executeCommand'].forEach((key) => {
this[key] = (...params) => this.editor[key](...params);
});
['read', 'save', 'add', 'find', 'update', 'remove', 'getSelected'].forEach((key) => {
this[key] = (...params) => this.currentPage[key](...params);
});
}
get currentPage() {
return this.editor.getCurrentPage();
}
}
export default PropsAPI;

View File

@@ -0,0 +1,18 @@
import React from 'react';
import PropsAPIContext from '@common/context/PropsAPIContext';
export default function (WrappedComponent) {
class InjectPropsAPI extends React.Component {
render() {
const { forwardRef, ...rest } = this.props;
return (
<PropsAPIContext.Consumer>
{propsAPI => <WrappedComponent ref={forwardRef} {...rest} propsAPI={propsAPI} />}
</PropsAPIContext.Consumer>
);
}
}
return React.forwardRef((props, ref) => <InjectPropsAPI {...props} forwardRef={ref} />);
}