chore: 🤖 complete project configure

This commit is contained in:
kangwei 2020-03-28 03:46:34 +08:00
parent 2f21a0d4d5
commit 2587b9719c
152 changed files with 2044 additions and 195427 deletions

2
.gitignore vendored
View File

@ -2,7 +2,9 @@
build
packages/*/lib/
packages/*/es/
packages/*/dist/
package-lock.json
yarn.lock
# IDE

22
LICENSE Normal file
View File

@ -0,0 +1,22 @@
MIT LICENSE
Copyright (c) 2020-present Alibaba Inc.
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.

3
abc.json Normal file
View File

@ -0,0 +1,3 @@
{
}

View File

@ -1,9 +1,8 @@
{
"name": "@ali/lowcode",
"private": true,
"scripts": {
"reinstall": "./scripts/reinstall.sh",
"bootstrap": "lerna bootstrap",
"clean": "lerna clean -y",
"setup": "./scripts/reinstall.sh",
"pub": "npm run test && lerna publish --registry http://registry.npm.alibaba-inc.com",
"lint": "eslint -p tsconfig.json",
"lint:fix": "eslint --fix -p tsconfig.json",
@ -20,19 +19,22 @@
"cz-conventional-changelog": "^2.1.0",
"eslint": "^6.5.1",
"git-cz": "^4.3.1",
"husky": "^4.2.3",
"lerna": "^2.11.0",
"lint-staged": "^8.1.0",
"prettier": "^1.15.3",
"ts-node": "^7.0.1",
"tslib": "^1.9.3",
"typescript": "^3.2.2",
"husky": "^4.2.3"
"typescript": "^3.2.2"
},
"workspaces": {
"packages": [
"packages/*"
],
"nohoist": []
"nohoist": [
"**/css-modules-typescript-loader",
"**/@alife/theme-lowcode-*"
]
},
"gitHooks": {
"pre-commit": "lint-staged"

View File

@ -1,6 +1,6 @@
{
"name": "@ali/lowcode-engine-code-generator",
"version": "0.0.1",
"version": "0.8.0",
"description": "出码引擎 for LowCode Engine",
"main": "lib/index.js",
"files": [
@ -20,7 +20,8 @@
"ava": "^1.0.1",
"rimraf": "^3.0.2",
"ts-node": "^7.0.1",
"tsconfig-paths": "^3.9.0"
"tsconfig-paths": "^3.9.0",
"typescript": "^3.8.3"
},
"ava": {
"compileEnhancements": false,

View File

@ -1,13 +1,12 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"target": "es6",
"module": "commonjs",
"outDir": "lib",
"paths": {
"@/*": ["./src/*"]
},
"outDir": "./lib",
"lib": [
"es6"
],
"types": ["node"],
"baseUrl": ".", /* Base directory to resolve non-absolute module names. */
},

View File

@ -1,4 +0,0 @@
{
"type": "ice-scripts",
"builder": "@ali/builder-ice-scripts"
}

30
packages/demo/build.json Normal file
View File

@ -0,0 +1,30 @@
{
"entry": {
"index": "src/index.jsx",
"react-simulator-renderer": "../react-simulator-renderer/src/index.js"
},
"vendor": false,
"publicPath": "/",
"externals": {
"react": "var window.React",
"react-dom": "var window.ReactDOM",
"prop-types": "var window.PropTypes",
"@alifd/next": "var window.Next"
},
"plugins": [
["build-plugin-react-app"],
[
"build-plugin-fusion",
{
"themePackage": "@alife/theme-lowcode-light"
}
],
[
"build-plugin-moment-locales",
{
"locales": ["zh-cn"]
}
],
"./build.plugin.js"
]
}

View File

@ -0,0 +1,12 @@
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
module.exports = ({ onGetWebpackConfig }) => {
onGetWebpackConfig((config) => {
config.resolve
.plugin('tsconfigpaths')
.use(TsconfigPathsPlugin, [{
configFile: "./tsconfig.json"
}]);
config.devServer.hot(false);
});
};

View File

@ -1,39 +0,0 @@
const path = require('path');
module.exports = {
entry: {
'index': 'src/index.tsx',
'simulator-renderer': '../react-simulator-renderer/src/index.ts'
},
"vendor": false,
publicPath: './',
plugins: [
['ice-plugin-fusion', {
themePackage: '@alife/theme-lowcode-light',
}],
['ice-plugin-moment-locales', {
locales: ['zh-cn'],
}],
],
externals: {
'react': 'var window.React',
'react-dom': 'var window.ReactDOM',
'prop-types': 'var window.PropTypes',
'@ali/lowcode-renderer': 'var window.LowCodeRenderer',
'@alifd/next': 'var window.Next',
'moment': 'var window.moment',
},
chainWebpack: (config) => {
// 修改对应 css module的 loader默认修改 scss-module 同理可以修改 css-module 和 less-module 规则
['scss-module'].forEach((rule) => {
if (config.module.rules.get(rule)) {
config.module.rule(rule).use('ts-css-module-loader')
.loader(require.resolve('css-modules-typescript-loader'))
.options({ modules: true, sass: true });
// 指定应用loader的位置
config.module.rule(rule).use('ts-css-module-loader').before('css-loader');
}
});
},
};

View File

@ -1,51 +1,32 @@
{
"name": "@icedesign/ts-scaffold",
"version": "0.0.1",
"description": "低代码编辑器",
"name": "@ali/lowcode-demo",
"version": "0.8.0",
"description": "低代码引擎 DEMO",
"scripts": {
"start": "build-scripts start",
"build": "build-scripts build"
},
"dependencies": {
"@ali/lowcode-editor-core": "0.0.1",
"@ali/lowcode-editor-skeleton": "0.0.1",
"@ali/lowcode-plugin-logo": "0.0.1",
"@ali/lowcode-plugin-undo-redo": "0.0.1",
"@ali/lowcode-plugin-save": "0.0.1",
"@ali/lowcode-plugin-designer": "0.0.1",
"@ali/lowcode-plugin-components-pane": "0.0.1",
"@alifd/next": "^1.x",
"@ali/lowcode-editor-core": "^0.8",
"@ali/lowcode-editor-skeleton": "^0.8.0",
"@ali/lowcode-plugin-components-pane": "^0.8.0",
"@ali/lowcode-plugin-designer": "^0.8.0",
"@ali/lowcode-plugin-logo": "^0.8.0",
"@ali/lowcode-plugin-save": "^0.8.0",
"@ali/lowcode-plugin-undo-redo": "^0.8.0",
"@alife/theme-lowcode-dark": "^0.1.0",
"@alife/theme-lowcode-light": "^0.1.0",
"@icedesign/theme": "^1.x",
"core-js": "^3.6.4",
"events": "^3.1.0",
"intl-messageformat": "^8.2.1",
"keymaster": "^1.6.2",
"moment": "^2.23.0",
"prop-types": "^15.5.8",
"react": "^16.8.1",
"react-dom": "^16.8.1",
"react-router-dom": "^5.1.2",
"serialize-javascript": "^3.0.0",
"store": "^2.0.12"
"react-dom": "^16.8.1"
},
"devDependencies": {
"@types/debug": "^4.1.5",
"@alib/build-scripts": "^0.1.18",
"@types/events": "^3.0.0",
"@types/react": "^16.8.3",
"@types/react-dom": "^16.8.2",
"@types/store": "^2.0.2",
"css-modules-typescript-loader": "^2.0.4",
"ice-plugin-fusion": "^0.1.4",
"ice-plugin-moment-locales": "^0.1.0",
"ice-scripts": "^2.0.0"
},
"scripts": {
"start": "ice-scripts dev",
"build": "ice-scripts build"
},
"iceworks": {
"type": "react",
"adapter": "adapter-react-v3"
},
"ideMode": {
"name": "ice-react"
"build-plugin-fusion": "^0.1.0",
"build-plugin-moment-locales": "^0.1.0",
"build-plugin-react-app": "^1.1.2",
"tsconfig-paths-webpack-plugin": "^3.2.0"
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

View File

@ -2,8 +2,8 @@ export default {
version: '^1.0.2',
theme: {
fusion: {
package: '@alife/dpl-iceluna',
version: '^2.3.0'
package: '@alife/theme-lowcode-light',
version: '^0.1.0'
},
scss: ''
},
@ -126,6 +126,7 @@ export default {
});
editor.utils.get('/schema.json').then(res => {
editor.set('schema', res);
editor.emit('schema.reset', res);
});
}

View File

@ -1,19 +1,21 @@
import React from 'react';
import ReactDOM from 'react-dom';
import Skeleton from '@ali/lowcode-editor-skeleton';
import { registerSetters } from '@ali/lowcode-setters';
import config from './config/skeleton';
import components from './config/components';
import utils from './config/utils';
import '@ali/lowcode-setters';
import './config/locale';
import './global.scss';
import './config/theme.scss';
registerSetters();
const LCE_CONTAINER = document.getElementById('lce-container');
if (!LCE_CONTAINER) {
throw new Error('当前页面不存在 <div id="lce-container"></div> 节点.');
}
// @ts-ignore
ReactDOM.render(<Skeleton config={config} utils={utils} components={components} />, LCE_CONTAINER);

File diff suppressed because one or more lines are too long

View File

@ -1,9 +1,8 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "build",
"target": "es6",
"jsx": "react"
"jsx": "react",
"target": "ES6"
},
"include": ["src/*"],
"exclude": ["node_modules", "build", "public"]

View File

@ -0,0 +1,7 @@
{
"plugins": [
[
"build-plugin-component"
]
]
}

View File

@ -1,12 +1,18 @@
{
"name": "@ali/lowcode-designer",
"version": "0.8.0",
"description": "alibaba lowcode designer",
"description": "Designer for Ali LowCode Engine",
"main": "lib/index.js",
"module": "es/index.js",
"files": [
"lib",
"umd"
"es"
],
"scripts": {
"build": "build-scripts build --skip-demo",
"test": "ava",
"test:snapshot": "ava --update-snapshots"
},
"license": "MIT",
"dependencies": {
"classnames": "^2.2.6",
@ -19,7 +25,9 @@
"@types/classnames": "^2.2.7",
"@types/node": "^13.7.1",
"@types/react": "^16",
"@types/react-dom": "^16"
"@types/react-dom": "^16",
"@alib/build-scripts": "^0.1.18",
"build-plugin-component": "^0.2.10"
},
"ava": {
"compileEnhancements": false,

View File

@ -8,9 +8,9 @@ import {
isLocationChildrenDetail,
LocationChildrenDetail,
isVertical
} from '../../../designer';
import { ISimulatorHost, } from '../../../simulator';
import {NodeParent } from '../../../document';
} from '../../designer';
import { ISimulatorHost, } from '../../simulator';
import {NodeParent } from '../../document';
import './insertion.less';
interface InsertionData {

View File

@ -1,7 +1,7 @@
// NOTE: 仅用作类型标注,切勿作为实体使用
import { BuiltinSimulatorHost } from './host';
import { AssetLevel, AssetLevels, AssetList, isAssetBundle, isAssetItem, AssetType, assetItem } from 'utils/asset';
import { isCSSUrl } from 'utils/is-css-url';
import { AssetLevel, AssetLevels, AssetList, isAssetBundle, isAssetItem, AssetType, assetItem } from '@ali/lowcode-globals';
import { isCSSUrl } from '@ali/lowcode-globals';
import { BuiltinSimulatorRenderer } from './renderer';
export function createSimulator(

View File

@ -4,7 +4,7 @@ import Viewport from './viewport';
import { createSimulator } from './create-simulator';
import { Node, NodeParent, DocumentModel, isNodeParent, isNode, contains, isRootNode } from '../document';
import ResourceConsumer from './resource-consumer';
import { AssetLevel, Asset, AssetList, assetBundle, assetItem, AssetType } from 'utils/asset';
import { AssetLevel, Asset, AssetList, assetBundle, assetItem, AssetType, getPublicPath } from '@ali/lowcode-globals';
import {
DragObjectType,
isShaken,
@ -22,7 +22,7 @@ import {
CanvasPoint,
} from '../designer';
import { parseProps } from './utils/parse-props';
import { isElement } from 'utils/is-element';
import { isElement } from '@ali/lowcode-globals';
import { ComponentMetadata } from '@ali/lowcode-globals';
import { BuiltinSimulatorRenderer } from './renderer';
@ -46,15 +46,16 @@ export interface BuiltinSimulatorProps {
[key: string]: any;
}
const publicPath = (document.currentScript as HTMLScriptElement).src.replace(/^(.*\/)[^/]+$/, '$1');
// TODO: use MACRO replace
const defaultSimulatorUrl = (() => {
const publicPath = getPublicPath();
let urls;
if (process.env.NODE_ENV === 'production') {
urls = [`${publicPath}../css/simulator-renderer.min.css`, `${publicPath}simulator-renderer.min.js`];
const [_, prefix = '', dev] = /^(.+?)(\/js)?\/?$/.exec(publicPath) || [];
if (dev) {
urls = [`${prefix}/css/react-simulator-renderer.css`, `${prefix}/js/react-simulator-renderer.js`];
} else if (process.env.NODE_ENV === 'production') {
urls = [`${prefix}/react-simulator-renderer.min.css`, `${prefix}/react-simulator-renderer.min.js`];
} else {
urls = [`${publicPath}../css/simulator-renderer.css`, `${publicPath}simulator-renderer.js`];
urls = [`${prefix}/react-simulator-renderer.css`, `${prefix}/react-simulator-renderer.js`];
}
return urls;
})();

View File

@ -1,6 +1,6 @@
import PropTypes from 'prop-types';
import { isValidElement } from 'react';
import { isElement } from 'utils/is-element';
import { isElement } from '@ali/lowcode-globals';
import { PropConfig } from '@ali/lowcode-globals';
export const primitiveTypes = [

View File

@ -4,8 +4,8 @@ import { DropLocation } from './location';
import { Node, DocumentModel } from '../document';
import { ISimulatorHost, isSimulatorHost } from '../simulator';
import { Designer } from './designer';
import { setNativeSelection } from 'utils/navtive-selection';
import cursor from 'utils/cursor';
import { setNativeSelection } from '@ali/lowcode-globals';
import { cursor } from '@ali/lowcode-globals';
export interface LocateEvent {
readonly type: 'LocateEvent';

View File

@ -1,5 +1,5 @@
import { obx, computed } from '@ali/lowcode-globals';
import { uniqueId } from 'utils/unique-id';
import { uniqueId } from '@ali/lowcode-globals';
import { INodeSelector, IViewport } from '../simulator';
import { isRootNode, Node } from '../document';

View File

@ -1,4 +1,4 @@
import { isElement } from 'utils/is-element';
import { isElement } from '@ali/lowcode-globals';
export class ScrollTarget {
get left() {

View File

@ -10,15 +10,14 @@ import {
isNodeSchema,
} from '@ali/lowcode-globals';
import { Project } from '../project';
import { ISimulatorHost } from '../simulator';
import { ComponentMeta } from '../component-meta';
import { isDragNodeDataObject, DragNodeObject, DragNodeDataObject, DropLocation } from '../designer';
import { Node, isNodeParent, insertChildren, insertChild, NodeParent, isNode } from './node/node';
import { Selection } from './selection';
import { RootNode } from './node/root-node';
import { ISimulatorHost } from '../simulator';
import { DropLocation } from '../designer/location';
import { ComponentMeta } from '../component-meta';
import { History } from './history';
import { Prop } from './node/props/prop';
import { isDragNodeDataObject, DragNodeObject, DragNodeDataObject } from '../designer/dragon';
export class DocumentModel {
/**

View File

@ -1,5 +1,5 @@
import { obx, computed, TitleContent } from '@ali/lowcode-globals';
import { uniqueId } from 'utils/unique-id';
import { uniqueId } from '@ali/lowcode-globals';
import { Node } from './node';
import { intl } from '../../locale';

View File

@ -8,9 +8,9 @@ import {
computed,
obx
} from '@ali/lowcode-globals';
import { uniqueId } from 'utils/unique-id';
import { isPlainObject } from 'utils/is-plain-object';
import { hasOwnProperty } from 'utils/has-own-property';
import { uniqueId } from '@ali/lowcode-globals';
import { isPlainObject } from '@ali/lowcode-globals';
import { hasOwnProperty } from '@ali/lowcode-globals';
import { PropStash } from './prop-stash';
import { valueToSource } from './value-to-source';
import { Props } from './props';

View File

@ -1,6 +0,0 @@
# 忽略目录
build/
node_modules/
**/*-min.js
**/*.min.js
coverage/

View File

@ -1,16 +0,0 @@
const { tslint, deepmerge } = require('@ice/spec');
module.exports = deepmerge(tslint, {
rules: {
"global-require": 0,
"comma-dangle": 0,
"no-unused-expressions": 0,
"object-shorthand": 0,
"jsx-a11y/anchor-has-content": 0,
"react/sort-comp": 0,
"react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx", ".tsx", "ts"] }],
"@typescript-eslint/interface-name-prefix": 0,
"@typescript-eslint/no-explicit-any": 0,
"@typescript-eslint/explicit-member-accessibility": 0
},
});

View File

@ -1,22 +0,0 @@
# See https://help.github.com/ignore-files/ for more about ignoring files.
# dependencies
node_modules/
# production
build/
dist/
tmp/
lib/
# misc
.idea/
.happypack
.DS_Store
*.swp
*.dia~
npm-debug.log*
yarn-debug.log*
yarn-error.log*
CHANGELOG.md

View File

@ -1,6 +0,0 @@
{
"semi": true,
"singleQuote": true,
"printWidth": 120,
"trailingComma": "all"
}

View File

@ -1,9 +1,5 @@
{
"plugins": [
"build-plugin-component",
"build-plugin-fusion",
["build-plugin-moment-locales", {
"locales": ["zh-cn"]
}]
"build-plugin-component"
]
}
}

View File

@ -1,22 +1,18 @@
{
"name": "@ali/lowcode-editor-core",
"version": "0.0.1",
"version": "0.8.0",
"description": "alibaba lowcode editor core",
"files": [
"demo/",
"es/",
"lib/",
"build/"
],
"main": "lib/index.js",
"module": "es/index.js",
"stylePath": "style.js",
"files": [
"lib",
"es"
],
"scripts": {
"start": "build-scripts start",
"build": "build-scripts build --skip-demo",
"prepublishOnly": "npm run prettier && npm run build",
"lint": "eslint --cache --ext .js,.jsx ./",
"prettier": "prettier --write \"./src/**/*.{ts,tsx,js,jsx,ejs,less,css,scss,json}\" "
"test": "ava",
"test:snapshot": "ava --update-snapshots"
},
"keywords": [
"lowcode",
@ -34,14 +30,11 @@
},
"devDependencies": {
"@alib/build-scripts": "^0.1.3",
"@alifd/next": "1.x",
"@ice/spec": "^0.1.1",
"@types/lodash": "^4.14.149",
"@types/react": "^16.9.13",
"@types/react-dom": "^16.9.4",
"build-plugin-component": "^0.2.7-1",
"build-plugin-fusion": "^0.1.0",
"build-plugin-moment-locales": "^0.1.0",
"eslint": "^6.0.1",
"prettier": "^1.19.1",
"react": "^16.8.0",

View File

@ -1,21 +1,11 @@
{
"compileOnSave": false,
"buildOnSave": false,
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "build",
"module": "esnext",
"outDir": "lib",
"target": "es6",
"jsx": "react",
"moduleResolution": "node",
"lib": ["es6", "dom"],
"sourceMap": true,
"allowJs": true,
"noUnusedLocals": true,
"noImplicitReturns": true,
"noImplicitThis": true,
"noImplicitAny": true,
"skipLibCheck": true
"jsx": "react"
},
"include": ["src/*.ts", "src/*.tsx"],
"exclude": ["node_modules", "build", "public"]
"include": [
"./src/"
]
}

View File

@ -1,12 +0,0 @@
# http://editorconfig.org
root = true
[*]
indent_style = space
indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.md]
trim_trailing_whitespace = false

View File

@ -1,11 +0,0 @@
# 忽略目录
build/
tests/
demo/
# node 覆盖率文件
coverage/
# 忽略文件
**/*-min.js
**/*.min.js

View File

@ -1,16 +0,0 @@
const { tslint, deepmerge } = require('@ice/spec');
module.exports = deepmerge(tslint, {
rules: {
"global-require": 0,
"comma-dangle": 0,
"no-unused-expressions": 0,
"object-shorthand": 0,
"jsx-a11y/anchor-has-content": 0,
"react/sort-comp": 0,
"react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx", ".tsx", "ts"] }],
"@typescript-eslint/interface-name-prefix": 0,
"@typescript-eslint/no-explicit-any": 0,
"@typescript-eslint/explicit-member-accessibility": 0
},
});

View File

@ -1,20 +0,0 @@
# See https://help.github.com/ignore-files/ for more about ignoring files.
# dependencies
/node_modules
# production
/build
/dist
# misc
.idea/
.happypack
.DS_Store
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# ignore d.ts auto generated by css-modules-typescript-loader
*.module.scss.d.ts

View File

@ -1,7 +0,0 @@
# 忽略目录
build/
tests/
demo/
# node 覆盖率文件
coverage/

View File

@ -1,3 +0,0 @@
const { stylelint } = require('@ice/spec');
module.exports = stylelint;

View File

@ -1,4 +0,0 @@
{
"type": "ice-scripts",
"builder": "@ali/builder-ice-scripts"
}

View File

@ -1,9 +0,0 @@
{
"compilerOptions": {
"baseUrl": ".",
"jsx": "react",
"paths": {
"@/*": ["./src/*"]
}
}
}

View File

@ -1,22 +1,18 @@
{
"name": "@ali/lowcode-editor-skeleton",
"version": "0.0.1",
"version": "0.8.0",
"description": "alibaba lowcode editor skeleton",
"files": [
"demo/",
"es/",
"lib/",
"build/"
],
"main": "lib/index.tsx",
"main": "lib/index.js",
"module": "es/index.js",
"stylePath": "style.js",
"files": [
"lib",
"es"
],
"scripts": {
"start": "build-scripts start",
"build": "build-scripts build --skip-demo",
"prepublishOnly": "npm run prettier && npm run build",
"lint": "eslint --cache --ext .js,.jsx ./",
"prettier": "prettier --write \"./src/**/*.{ts,tsx,js,jsx,ejs,less,css,scss,json}\" "
"test": "ava",
"test:snapshot": "ava --update-snapshots"
},
"keywords": [
"lowcode",
@ -24,7 +20,7 @@
],
"author": "xiayang.xy",
"dependencies": {
"@ali/lowcode-editor-core": "0.0.1",
"@ali/lowcode-editor-core": "^0.8.0",
"@alifd/next": "^1.x",
"prop-types": "^15.5.8",
"react": "^16.8.1",
@ -34,18 +30,11 @@
},
"devDependencies": {
"@alib/build-scripts": "^0.1.3",
"@alifd/next": "1.x",
"@ice/spec": "^0.1.1",
"@types/lodash": "^4.14.149",
"@types/react": "^16.9.13",
"@types/react-dom": "^16.9.4",
"build-plugin-component": "^0.2.7-1",
"build-plugin-fusion": "^0.1.0",
"build-plugin-moment-locales": "^0.1.0",
"eslint": "^6.0.1",
"prettier": "^1.19.1",
"react": "^16.8.0",
"react-dom": "^16.8.0"
"build-plugin-moment-locales": "^0.1.0"
},
"repository": {
"type": "git",

View File

@ -29,6 +29,5 @@ body {
flex: 1;
display: flex;
flex-direction: column;
overflow: auto;
}
}

View File

@ -1 +0,0 @@
// test file

View File

@ -1,21 +1,11 @@
{
"compileOnSave": false,
"buildOnSave": false,
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "build",
"module": "esnext",
"outDir": "lib",
"target": "es6",
"jsx": "react",
"moduleResolution": "node",
"lib": ["es6", "dom"],
"sourceMap": true,
"allowJs": true,
"noUnusedLocals": true,
"noImplicitReturns": true,
"noImplicitThis": true,
"noImplicitAny": true,
"skipLibCheck": true
"jsx": "react"
},
"include": ["src/*.ts", "src/*.tsx"],
"exclude": ["node_modules", "build", "public"]
"include": [
"./src/"
]
}

View File

@ -0,0 +1,17 @@
{
"plugins": [
[
"build-plugin-component",
{
"filename": "globals",
"library": "LCEGlobals",
"libraryExport": "default",
"libraryTarget": "umd"
}
],
"build-plugin-fusion",
["build-plugin-moment-locales", {
"locales": ["zh-cn"]
}]
]
}

View File

@ -3,11 +3,14 @@
"version": "0.8.0",
"description": "Globals api for Ali lowCode engine",
"main": "lib/index.js",
"module": "es/index.js",
"files": [
"lib"
"lib",
"es",
"dist"
],
"scripts": {
"build": "tsc",
"build": "build-scripts build --skip-demo",
"test": "ava",
"test:snapshot": "ava --update-snapshots"
},
@ -23,7 +26,11 @@
"@types/classnames": "^2.2.7",
"@types/node": "^13.7.1",
"@types/react": "^16",
"@types/react-dom": "^16"
"@types/react-dom": "^16",
"@alib/build-scripts": "^0.1.18",
"build-plugin-component": "^0.2.11",
"build-plugin-fusion": "^0.1.0",
"build-plugin-moment-locales": "^0.1.0"
},
"ava": {
"compileEnhancements": false,

View File

@ -1,4 +1,4 @@
import { uniqueId } from 'utils/unique-id';
import { uniqueId } from '@ali/lowcode-globals';
import { Component } from 'react';
import { saveTips } from './tip-handler';
import { TipConfig } from '../../types';

View File

@ -8,16 +8,27 @@ export type RegisteredSetter = {
defaultProps?: object;
title?: TitleContent;
};
const settersMap = new Map<string, RegisteredSetter>();
export function registerSetter(type: string, setter: CustomView | RegisteredSetter) {
export function registerSetter(
typeOrMaps: string | { [key: string]: CustomView | RegisteredSetter },
setter?: CustomView | RegisteredSetter,
) {
if (typeof typeOrMaps === 'object') {
Object.keys(typeOrMaps).forEach(type => {
registerSetter(type, typeOrMaps[type]);
});
return;
}
if (!setter) {
return;
}
if (isCustomView(setter)) {
setter = {
component: setter,
title: (setter as any).displayName || (setter as any).name || 'CustomSetter'
title: (setter as any).displayName || (setter as any).name || 'CustomSetter',
};
}
settersMap.set(type, setter);
settersMap.set(typeOrMaps, setter);
}
export function getSetter(type: string): RegisteredSetter | null {

View File

@ -57,4 +57,4 @@ export class Cursor {
}
}
export default new Cursor();
export const cursor = new Cursor();

View File

@ -0,0 +1,5 @@
const publicPath = (document.currentScript as HTMLScriptElement).src.replace(/^(.*\/)[^/]+$/, '$1');
export function getPublicPath(): string {
return publicPath;
}

View File

@ -1,4 +1,20 @@
export * from './create-icon';
export * from './is-react';
export * from 'utils/unique-id';
export * from './unique-id';
export * from './create-content';
export * from './asset';
export * from './clone-deep';
export * from './cursor';
export * from './get-prototype-of';
export * from './has-own-property';
export * from './is-css-url';
export * from './is-element';
export * from './is-es-module';
export * from './is-function';
export * from './is-object';
export * from './is-plain-object';
export * from './navtive-selection';
export * from './set-prototype-of';
export * from './shallow-equal';
export * from './unique-id';
export * from './get-public-path';

View File

@ -1,6 +1,6 @@
{
"name": "@ali/lowcode-material-parser",
"version": "0.1.0",
"version": "0.8.0",
"description": "material parser for Ali lowCode engine",
"main": "lib/index.js",
"files": [
@ -19,7 +19,8 @@
"jest": "^24.8.0",
"jest-watch-typeahead": "^0.3.1",
"js-yaml": "^3.13.1",
"json-schema-to-typescript": "^8.2.0"
"json-schema-to-typescript": "^8.2.0",
"typescript": "^3.8.3"
},
"scripts": {
"build": "tsc",
@ -42,7 +43,6 @@
},
"license": "MIT",
"dependencies": {
"@ali/lowcode-editor-core": "^0.0.1",
"@babel/generator": "^7.8.4",
"@babel/parser": "^7.8.4",
"@babel/traverse": "^7.8.4",

View File

@ -1,6 +1,8 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"target": "es6",
"module": "commonjs",
"rootDir": "src",
"outDir": "lib"
},

View File

@ -1,4 +0,0 @@
{
"type": "ice-scripts",
"builder": "@ali/builder-ice-scripts"
}

View File

@ -1,22 +1,18 @@
{
"name": "@ali/lowcode-plugin-components-pane",
"version": "0.0.1",
"version": "0.8.0",
"description": "alibaba lowcode editor component-list plugin",
"files": [
"demo/",
"es/",
"lib/",
"build/"
"lib/"
],
"main": "lib/index.tsx",
"main": "lib/index.js",
"module": "es/index.js",
"stylePath": "style.js",
"scripts": {
"start": "build-scripts start",
"build": "build-scripts build --skip-demo",
"prepublishOnly": "npm run prettier && npm run build",
"lint": "eslint --cache --ext .js,.jsx ./",
"prettier": "prettier --write \"./src/**/*.{ts,tsx,js,jsx,ejs,less,css,scss,json}\" "
"test": "ava",
"test:snapshot": "ava --update-snapshots"
},
"keywords": [
"lowcode",
@ -24,36 +20,19 @@
],
"author": "xiayang.xy",
"dependencies": {
"@ali/iceluna-addon-component-list": "^1.0.11",
"@ali/iceluna-comp-material-show": "^1.0.10",
"react": "^16.8.1",
"@ali/iceluna-sdk": "^1.0.6-beta.6",
"@alifd/next": "^1.19.19",
"prop-types": "^15.5.8",
"react": "^16.8.1",
"react-dom": "^16.8.1",
"react-router-dom": "^5.1.2"
},
"peerDependencies": {
"@ali/lowcode-editor-core": "0.0.1"
"@ali/lowcode-editor-core": "0.8.0",
"@ali/iceluna-comp-material-show": "^1.0.10",
"@ali/iceluna-addon-component-list": "^1.0.11"
},
"devDependencies": {
"@alib/build-scripts": "^0.1.3",
"@alifd/next": "1.x",
"@ice/spec": "^0.1.1",
"@types/lodash": "^4.14.149",
"@types/react": "^16.9.13",
"@types/react-dom": "^16.9.4",
"build-plugin-component": "^0.2.7-1",
"build-plugin-fusion": "^0.1.0",
"build-plugin-moment-locales": "^0.1.0",
"eslint": "^6.0.1",
"prettier": "^1.19.1",
"react": "^16.8.0",
"react-dom": "^16.8.0"
},
"repository": {
"type": "git",
"url": "https://github.com/ice-lab/react-materials/tree/master/scaffolds/ice-ts"
},
"homepage": "https://unpkg.alibaba-inc.com/@ali/lowcode-engine-skeleton@0.0.1/build/index.html"
"build-plugin-moment-locales": "^0.1.0"
}
}

View File

@ -1,7 +1,7 @@
import React, { PureComponent } from 'react';
import { Icon, Search, Select } from '@alifd/next';
import MaterialShow from '@ali/iceluna-comp-material-show';
import { PluginProps } from '@ali/lowcode-editor-core/lib/definitions';
import { PluginProps } from '@ali/lowcode-editor-core';
import './index.scss';

View File

@ -1,7 +1,11 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "lib"
"outDir": "lib",
"noUnusedLocals": true,
"noImplicitReturns": true,
"noImplicitThis": false,
"noImplicitAny": false
},
"include": [
"./src/"

View File

@ -1,9 +1,5 @@
{
"plugins": [
"build-plugin-component",
"build-plugin-fusion",
["build-plugin-moment-locales", {
"locales": ["zh-cn"]
}]
"build-plugin-component"
]
}
}

View File

@ -1,22 +1,18 @@
{
"name": "@ali/lowcode-plugin-designer",
"version": "0.0.1",
"version": "0.8.0",
"description": "alibaba lowcode editor designer plugin",
"files": [
"demo/",
"es/",
"lib/",
"build/"
"es",
"lib"
],
"main": "lib/index.tsx",
"main": "lib/index.js",
"module": "es/index.js",
"stylePath": "style.js",
"scripts": {
"start": "build-scripts start",
"build": "build-scripts build --skip-demo",
"prepublishOnly": "npm run prettier && npm run build",
"lint": "eslint --cache --ext .js,.jsx ./",
"prettier": "prettier --write \"./src/**/*.{ts,tsx,js,jsx,ejs,less,css,scss,json}\" "
"test": "ava",
"test:snapshot": "ava --update-snapshots"
},
"keywords": [
"lowcode",
@ -24,32 +20,15 @@
],
"author": "xiayang.xy",
"dependencies": {
"prop-types": "^15.5.8",
"react": "^16.8.1",
"react-dom": "^16.8.1",
"react-router-dom": "^5.1.2"
},
"peerDependencies": {
"@ali/lowcode-editor-core": "0.0.1"
"@ali/lowcode-designer": "0.8",
"@ali/lowcode-editor-core": "0.8"
},
"devDependencies": {
"@alib/build-scripts": "^0.1.3",
"@alifd/next": "1.x",
"@ice/spec": "^0.1.1",
"@types/lodash": "^4.14.149",
"@types/react": "^16.9.13",
"@types/react-dom": "^16.9.4",
"build-plugin-component": "^0.2.7-1",
"build-plugin-fusion": "^0.1.0",
"build-plugin-moment-locales": "^0.1.0",
"eslint": "^6.0.1",
"prettier": "^1.19.1",
"react": "^16.8.0",
"react-dom": "^16.8.0"
},
"repository": {
"type": "git",
"url": "https://github.com/ice-lab/react-materials/tree/master/scaffolds/ice-ts"
},
"homepage": "https://unpkg.alibaba-inc.com/@ali/lowcode-engine-skeleton@0.0.1/build/index.html"
"@alib/build-scripts": "^0.1.3",
"build-plugin-component": "^0.2.7-1"
}
}

View File

@ -147,6 +147,8 @@ const SCHEMA = {
],
};
const BaseLibrary = ["https://g.alicdn.com/mylib/moment/2.24.0/min/moment.min.js"];
export default class DesignerPlugin extends PureComponent<PluginProps> {
static displayName: 'LowcodePluginDesigner';
@ -161,8 +163,20 @@ export default class DesignerPlugin extends PureComponent<PluginProps> {
}
private designer?: Designer;
state = {
componentMetadatas: [],
library: null,
};
handleSchemaReset = (schema: any): void => {
const { editor } = this.props;
const { components, packages } = editor.get('assets') || {};
this.setState({
componentMetadatas: components ? Object.values(components) : [],
library: packages ? Object.values(packages) : [],
});
/*
if (this.designer) {
this.designer.setSchema(schema);
} else {
@ -170,27 +184,33 @@ export default class DesignerPlugin extends PureComponent<PluginProps> {
designer.setSchema(schema);
});
}
*/
};
handleDesignerMount = (designer: Designer): void => {
const { editor } = this.props;
this.designer = designer;
editor.set('designer', designer);
editor.emit('designer.ready', designer);
// editor.emit('designer.ready', designer);
};
render(): React.ReactNode {
const { editor } = this.props;
const assets = editor.get('assets') || {};
const { componentMetadatas, library } = this.state;
if (!library) {
return 'loading';
}
return (
<DesignerView
onMount={this.handleDesignerMount}
className="lowcode-plugin-designer"
defaultSchema={SCHEMA as any}
eventPipe={editor as any}
componentsDescription={Object.values(assets.components) as any}
eventPipe={editor}
componentMetadatas={componentMetadatas}
simulatorProps={{
library: Object.values(assets.packages),
library: BaseLibrary.concat(library || []),
}}
/>
);

View File

@ -1,9 +1,5 @@
{
"plugins": [
"build-plugin-component",
"build-plugin-fusion",
["build-plugin-moment-locales", {
"locales": ["zh-cn"]
}]
"build-plugin-component"
]
}
}

View File

@ -1,22 +1,18 @@
{
"name": "@ali/lowcode-plugin-logo",
"version": "0.0.1",
"version": "0.8.0",
"description": "alibaba lowcode editor logo plugin",
"files": [
"demo/",
"es/",
"lib/",
"build/"
"lib/"
],
"main": "lib/index.tsx",
"main": "lib/index.js",
"module": "es/index.js",
"stylePath": "style.js",
"scripts": {
"start": "build-scripts start",
"build": "build-scripts build --skip-demo",
"prepublishOnly": "npm run prettier && npm run build",
"lint": "eslint --cache --ext .js,.jsx ./",
"prettier": "prettier --write \"./src/**/*.{ts,tsx,js,jsx,ejs,less,css,scss,json}\" "
"test": "ava",
"test:snapshot": "ava --update-snapshots"
},
"keywords": [
"lowcode",
@ -24,32 +20,13 @@
],
"author": "xiayang.xy",
"dependencies": {
"prop-types": "^15.5.8",
"react": "^16.8.1",
"react-dom": "^16.8.1",
"react-router-dom": "^5.1.2"
},
"peerDependencies": {
"@ali/lowcode-editor-core": "0.0.1"
"@ali/lowcode-editor-core": "^0.8",
"react": "^16.8.1"
},
"devDependencies": {
"@alib/build-scripts": "^0.1.3",
"@alifd/next": "1.x",
"@ice/spec": "^0.1.1",
"@types/lodash": "^4.14.149",
"@alib/build-scripts": "^0.1.18",
"@types/react": "^16.9.13",
"@types/react-dom": "^16.9.4",
"build-plugin-component": "^0.2.7-1",
"build-plugin-fusion": "^0.1.0",
"build-plugin-moment-locales": "^0.1.0",
"eslint": "^6.0.1",
"prettier": "^1.19.1",
"react": "^16.8.0",
"react-dom": "^16.8.0"
},
"repository": {
"type": "git",
"url": "https://github.com/ice-lab/react-materials/tree/master/scaffolds/ice-ts"
},
"homepage": "https://unpkg.alibaba-inc.com/@ali/lowcode-engine-skeleton@0.0.1/build/index.html"
"build-plugin-component": "^0.2.10"
}
}

View File

@ -1,6 +1,6 @@
import React from 'react';
import './index.scss';
import { PluginProps } from '@ali/lowcode-editor-core/lib/definitions';
import { PluginProps } from '@ali/lowcode-editor-core';
export interface IProps {
logo?: string;

View File

@ -1,20 +1,9 @@
{
"compileOnSave": false,
"buildOnSave": false,
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "build",
"module": "esnext",
"outDir": "lib",
"target": "es6",
"jsx": "react",
"moduleResolution": "node",
"lib": ["es6", "dom"],
"sourceMap": true,
"allowJs": true,
"noUnusedLocals": true,
"noImplicitReturns": true,
"noImplicitThis": true,
"noImplicitAny": true,
"skipLibCheck": true
},
"include": ["src/*.ts", "src/*.tsx"],
"exclude": ["node_modules", "build", "public"]

View File

@ -0,0 +1,9 @@
{
"plugins": [
"build-plugin-component",
"build-plugin-fusion",
["build-plugin-moment-locales", {
"locales": ["zh-cn"]
}]
]
}

View File

@ -2,13 +2,14 @@
"name": "@ali/lowcode-plugin-outline-pane",
"version": "0.8.0",
"description": "Outline pane for Ali lowCode engine",
"main": "lib/index.js",
"files": [
"lib",
"umd"
"es",
"lib"
],
"main": "lib/index.js",
"module": "es/index.js",
"scripts": {
"build": "tsc",
"build": "build-scripts build --skip-demo",
"test": "ava",
"test:snapshot": "ava --update-snapshots"
},
@ -16,13 +17,19 @@
"@alifd/next": "^1.19.16",
"classnames": "^2.2.6",
"react": "^16",
"react-dom": "^16.7.0"
"react-dom": "^16.7.0",
"@ali/lowcode-designer": "^0.8.0",
"@ali/lowcode-globals": "^0.8.0"
},
"devDependencies": {
"@alib/build-scripts": "^0.1.18",
"@types/classnames": "^2.2.7",
"@types/node": "^13.7.1",
"@types/react": "^16",
"@types/react-dom": "^16"
"@types/react-dom": "^16",
"build-plugin-component": "^0.2.10",
"build-plugin-fusion": "^0.1.1",
"build-plugin-moment-locales": "^0.1.0"
},
"ava": {
"compileEnhancements": false,

View File

@ -6,4 +6,4 @@
"locales": ["zh-cn"]
}]
]
}
}

View File

@ -1,22 +1,17 @@
{
"name": "@ali/lowcode-plugin-save",
"version": "0.0.1",
"version": "0.8.0",
"description": "alibaba lowcode editor save plugin",
"files": [
"demo/",
"es/",
"lib/",
"build/"
"es",
"lib"
],
"main": "lib/index.tsx",
"main": "lib/index.js",
"module": "es/index.js",
"stylePath": "style.js",
"scripts": {
"start": "build-scripts start",
"build": "build-scripts build --skip-demo",
"prepublishOnly": "npm run prettier && npm run build",
"lint": "eslint --cache --ext .js,.jsx ./",
"prettier": "prettier --write \"./src/**/*.{ts,tsx,js,jsx,ejs,less,css,scss,json}\" "
"test": "ava",
"test:snapshot": "ava --update-snapshots"
},
"keywords": [
"lowcode",
@ -25,28 +20,16 @@
"author": "xiayang.xy",
"dependencies": {
"@alifd/next": "^1.x",
"prop-types": "^15.5.8",
"react": "^16.8.1",
"react-dom": "^16.8.1",
"react-router-dom": "^5.1.2"
},
"peerDependencies": {
"@ali/lowcode-editor-core": "0.0.1"
"@ali/lowcode-editor-core": "^0.8.0"
},
"devDependencies": {
"@alib/build-scripts": "^0.1.3",
"@alifd/next": "1.x",
"@ice/spec": "^0.1.1",
"@types/lodash": "^4.14.149",
"@types/react": "^16.9.13",
"@types/react-dom": "^16.9.4",
"build-plugin-component": "^0.2.7-1",
"build-plugin-fusion": "^0.1.0",
"build-plugin-moment-locales": "^0.1.0",
"eslint": "^6.0.1",
"prettier": "^1.19.1",
"react": "^16.8.0",
"react-dom": "^16.8.0"
"build-plugin-moment-locales": "^0.1.0"
},
"repository": {
"type": "git",

View File

@ -1,21 +1,5 @@
{
"compileOnSave": false,
"buildOnSave": false,
"compilerOptions": {
"outDir": "build",
"module": "esnext",
"target": "es6",
"jsx": "react",
"moduleResolution": "node",
"lib": ["es6", "dom"],
"sourceMap": true,
"allowJs": true,
"noUnusedLocals": true,
"noImplicitReturns": true,
"noImplicitThis": true,
"noImplicitAny": true,
"skipLibCheck": true
},
"extends": "../../tsconfig.json",
"include": ["src/*.ts", "src/*.tsx"],
"exclude": ["node_modules", "build", "public"]
}

View File

@ -0,0 +1,9 @@
{
"plugins": [
"build-plugin-component",
"build-plugin-fusion",
["build-plugin-moment-locales", {
"locales": ["zh-cn"]
}]
]
}

View File

@ -2,28 +2,33 @@
"name": "@ali/lowcode-plugin-settings-pane",
"version": "0.8.0",
"description": "Settings pane for Ali lowCode engine",
"main": "lib/index.js",
"files": [
"lib",
"umd"
"es",
"lib"
],
"main": "lib/index.js",
"module": "es/index.js",
"scripts": {
"build": "tsc",
"build": "build-scripts build --skip-demo",
"test": "ava",
"test:snapshot": "ava --update-snapshots"
},
"dependencies": {
"@ali/lowcode-editor-core": "^0.0.1",
"@ali/lowcode-editor-core": "^0.8.0",
"@ali/lowcode-designer": "^0.8.0",
"@ali/lowcode-globals": "^0.8.0",
"@alifd/next": "^1.19.16",
"classnames": "^2.2.6",
"react": "^16",
"react-dom": "^16.7.0"
"react": "^16"
},
"devDependencies": {
"@alib/build-scripts": "^0.1.18",
"@types/classnames": "^2.2.7",
"@types/node": "^13.7.1",
"@types/react": "^16",
"@types/react-dom": "^16"
"build-plugin-component": "^0.2.10",
"build-plugin-fusion": "^0.1.1",
"build-plugin-moment-locales": "^0.1.0"
},
"ava": {
"compileEnhancements": false,

View File

@ -1,5 +1,5 @@
import { EventEmitter } from 'events';
import { uniqueId } from '../../utils/unique-id';
import { uniqueId } from '@ali/lowcode-globals';
import { ComponentMeta, Node, Designer, Selection } from '@ali/lowcode-designer';
import { TitleContent, FieldExtraProps, SetterType, CustomView, FieldConfig, isCustomView } from '@ali/lowcode-globals';

View File

@ -1,7 +1,7 @@
import { createContext, ReactNode, Component, PureComponent } from 'react';
import { EventEmitter } from 'events';
import { Balloon } from '@alifd/next';
import { uniqueId } from 'utils/unique-id';
import { uniqueId } from '@ali/lowcode-globals';
import './style.less';
export const PopupContext = createContext<PopupPipe>({} as any);

View File

@ -7,8 +7,8 @@ import {
shallowIntl,
isSetterConfig,
createSetterContent,
shallowEqual
} from '@ali/lowcode-globals';
import { shallowEqual } from 'utils/shallow-equal';
import { SettingField, isSettingField, SettingTarget } from './main';
import { Field, FieldGroup } from './field';
import PopupService from './popup';

View File

@ -6,4 +6,4 @@
"locales": ["zh-cn"]
}]
]
}
}

View File

@ -1,22 +1,17 @@
{
"name": "@ali/lowcode-plugin-undo-redo",
"version": "0.0.1",
"version": "0.8.0",
"description": "alibaba lowcode editor undo redo plugin",
"files": [
"demo/",
"es/",
"lib/",
"build/"
"es",
"lib"
],
"main": "lib/index.tsx",
"main": "lib/index.js",
"module": "es/index.js",
"stylePath": "style.js",
"scripts": {
"start": "build-scripts start",
"build": "build-scripts build --skip-demo",
"prepublishOnly": "npm run prettier && npm run build",
"lint": "eslint --cache --ext .js,.jsx ./",
"prettier": "prettier --write \"./src/**/*.{ts,tsx,js,jsx,ejs,less,css,scss,json}\" "
"test": "ava",
"test:snapshot": "ava --update-snapshots"
},
"keywords": [
"lowcode",
@ -24,33 +19,17 @@
],
"author": "xiayang.xy",
"dependencies": {
"@ali/lowcode-editor-skeleton": "0.0.1",
"prop-types": "^15.5.8",
"@ali/lowcode-editor-skeleton": "^0.8.0",
"@ali/lowcode-editor-core": "^0.8.0",
"react": "^16.8.1",
"react-dom": "^16.8.1",
"react-router-dom": "^5.1.2"
},
"peerDependencies": {
"@ali/lowcode-editor-core": "0.0.1"
"react-dom": "^16.8.1"
},
"devDependencies": {
"@alib/build-scripts": "^0.1.3",
"@alifd/next": "1.x",
"@ice/spec": "^0.1.1",
"@types/lodash": "^4.14.149",
"@types/react": "^16.9.13",
"@types/react-dom": "^16.9.4",
"build-plugin-component": "^0.2.7-1",
"build-plugin-fusion": "^0.1.0",
"build-plugin-moment-locales": "^0.1.0",
"eslint": "^6.0.1",
"prettier": "^1.19.1",
"react": "^16.8.0",
"react-dom": "^16.8.0"
},
"repository": {
"type": "git",
"url": "https://github.com/ice-lab/react-materials/tree/master/scaffolds/ice-ts"
},
"homepage": "https://unpkg.alibaba-inc.com/@ali/lowcode-engine-skeleton@0.0.1/build/index.html"
"build-plugin-moment-locales": "^0.1.0"
}
}

View File

@ -1,6 +1,6 @@
import React, { PureComponent } from 'react';
import './index.scss';
import { PluginProps } from '@ali/lowcode-editor-core/lib/definitions';
import { PluginProps } from '@ali/lowcode-editor-core';
import { TopIcon } from '@ali/lowcode-editor-skeleton';
export interface IProps {
@ -21,7 +21,7 @@ export default class UndoRedo extends PureComponent<
private history: any;
constructor(props) {
constructor(props: any) {
super(props);
this.state = {
undoEnable: false,
@ -49,7 +49,7 @@ export default class UndoRedo extends PureComponent<
editor.off('designer.history-change', this.handleHistoryChange);
}
handleHistoryChange = (history): void => {
handleHistoryChange = (history: any): void => {
this.history = history;
this.updateState(this.history?.getState() || 0);
};
@ -60,7 +60,7 @@ export default class UndoRedo extends PureComponent<
this.history = editor.designer?.currentHistory;
this.updateState(this.history?.getState() || 0);
editor.on('designer.history-change', (history): void => {
editor.on('designer.history-change', (history: any): void => {
this.history = history;
this.updateState(this.history?.getState() || 0);
});

View File

@ -1,21 +1,9 @@
{
"compileOnSave": false,
"buildOnSave": false,
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "build",
"module": "esnext",
"target": "es6",
"jsx": "react",
"moduleResolution": "node",
"lib": ["es6", "dom"],
"sourceMap": true,
"allowJs": true,
"noUnusedLocals": true,
"noImplicitReturns": true,
"noImplicitThis": true,
"noImplicitAny": true,
"skipLibCheck": true
"outDir": "lib"
},
"include": ["src/*.ts", "src/*.tsx"],
"exclude": ["node_modules", "build", "public"]
"include": [
"./src/"
]
}

View File

@ -1 +0,0 @@
rax 渲染模块

View File

@ -1,11 +0,0 @@
{
"presets": [
"@babel/preset-env",
"@babel/preset-react"
],
"plugins": [
"@babel/plugin-syntax-dynamic-import",
"@babel/plugin-proposal-class-properties",
"@babel/plugin-transform-runtime"
]
}

View File

@ -1,11 +0,0 @@
# 忽略目录
build/
tests/
demo/
# node 覆盖率文件
coverage/
# 忽略文件
**/*-min.js
**/*.min.js

View File

@ -1,77 +0,0 @@
module.exports = {
"root": true,
"extends": [
"eslint:recommended",
"plugin:react/recommended"
],
"plugins": [
"react"
],
"env": {
"browser": true,
"node": true,
"es6":true
},
"parser": "babel-eslint",
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true,
"experimentalObjectRestSpread": true
}
},
"rules": {
"react/no-deprecated": 0, // react15.x关闭deprated警告
"constructor-super": 2,//要求在构造函数中有 super() 的调用
"no-case-declarations": 2,//不允许在 case 子句中使用词法声明
"no-class-assign": 2,//禁止修改类声明的变量
"no-compare-neg-zero": 2,//禁止负0比较
"no-cond-assign": 2,//禁止条件表达式中出现赋值操作符
"no-console": [2, {
"allow": ["info", "warn", "error"]
}],//禁止console
"no-const-assign": 2,//禁止修改 const 声明的变量
"no-constant-condition": 2,//禁止在条件中使用常量表达式
"no-control-regex": 2,//禁止在正则表达式中使用控制字符
"no-debugger": 2,//禁止debugger
"no-delete-var": 2,//禁止删除变量
"no-dupe-args": 2,//禁止重复的参数
"no-dupe-class-members": 2,//禁止类成员中出现重复的名称
"no-dupe-keys": 2,//禁止重复的键值
"no-duplicate-case": 2,//禁止重复的case条件
"no-empty-character-class": 2,//禁止在正则表达式中使用空字符集
"no-empty-pattern": 2,//禁止使用空解构模式
"no-empty": 2,//禁止出现空语句块
"no-ex-assign": 2,//禁止对 catch 子句的参数重新赋值
"no-extra-boolean-cast": 2,//禁止不必要的布尔转换
"no-extra-semi": 2,//禁止多余的分号
"no-fallthrough": 2,//禁止 case 语句落空
"no-func-assign": 2,//禁止对 function 声明重新赋值
"no-global-assign": 2,//禁止对全局对象重新赋值
"no-inner-declarations": 2,//禁止在嵌套的块中出现变量声明或 function 声明
"no-invalid-regexp": 2,//禁止 RegExp 构造函数中存在无效的正则表达式字符串
"no-irregular-whitespace": 2,//禁止在字符串和注释之外不规则的空白
"no-mixed-spaces-and-tabs": 2,//禁止空格和 tab 的混合缩进
"no-new-symbol": 2,//禁止对Symbol使用new关键字
"no-obj-calls": 2,//禁止把全局对象作为函数调用
"no-octal": 2,//禁止8进制的字面量
"no-redeclare": 2,//禁止多次声明同一变量
"no-regex-spaces": 2,//禁止正则表达式字面量中出现多个空格
"no-self-assign": 2,//禁止自我赋值
"no-sparse-arrays": 2,//禁用稀疏数组
"no-this-before-super": 2,//禁止在构造函数中,在调用 super() 之前使用 this 或 super
"no-undef": 2,//禁用未声明的变量,除非它们在 /*global */ 注释中被提到
"no-unexpected-multiline": 2,//禁止出现令人困惑的多行表达式
"no-unreachable": 2,//禁止在return、throw、continue 和 break 语句之后出现不可达代码
"no-unsafe-finally": 2,//禁止在 finally 语句块中出现控制流语句
"no-unsafe-negation": 2,//禁止在表达式左侧使用关系表达式
"no-unused-labels": 2,//禁用出现未使用过的标
"no-unused-vars": 2,//禁止出现未使用过的变量
"no-useless-escape": 2,//禁用不必要的转义字符
"require-yield": 2,//要求 generator 函数内有 yield
"use-isnan": 2,//使用isNan() 判断isNaN
"valid-typeof": 2//强制 typeof 表达式与有效的字符串进行比较
},
"settings": {}
}

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