replace doc

This commit is contained in:
hufeixiong
2021-11-24 12:50:19 +08:00
parent 18b8e80782
commit 0fe64cc6be
82 changed files with 5514 additions and 3332 deletions

View File

@@ -0,0 +1,4 @@
export default {
esm: 'rollup',
cjs: 'rollup',
};

View File

@@ -0,0 +1,32 @@
import { defineConfig } from 'dumi';
export default defineConfig({
title: 'Dooringx',
favicon: 'https://yehuozhili-1259443377.cos.ap-nanjing.myqcloud.com/dooringxlogo.png',
logo: 'https://yehuozhili-1259443377.cos.ap-nanjing.myqcloud.com/dooringxlogo.png',
outputPath: 'docs-dist',
mode: 'site',
locales: [
['zh', '中文'],
['en', 'English'],
],
navs: {
// 多语言 key 值需与 locales 配置中的 key 一致
en: [
null, // null 值代表保留约定式生成的导航,只做增量配置
{
title: 'GitHub',
path: 'https://github.com/H5-Dooring/dooringx',
},
],
zh: [
null, // null 值代表保留约定式生成的导航,只做增量配置
{
title: 'GitHub',
path: 'https://github.com/H5-Dooring/dooringx',
},
],
},
base: process.env.NODE_ENV === 'production' ? '/dooringx' : '/',
publicPath: process.env.NODE_ENV === 'production' ? '/dooringx/' : '/',
// more config: https://d.umijs.org/config
});

View File

@@ -0,0 +1,27 @@
# dooringx-dumi-doc
## Getting Started
Install dependencies,
```bash
$ npm i
```
Start the dev server,
```bash
$ npm start
```
Build documentation,
```bash
$ npm run docs:build
```
Build library via `father-build`,
```bash
$ npm run build
```

View File

@@ -0,0 +1,9 @@
---
title: API
toc: menu
nav:
title: API
order: 5
---
In process

View File

@@ -0,0 +1,9 @@
---
title: API
toc: menu
nav:
title: API
order: 5
---
In process

View File

@@ -0,0 +1,192 @@
---
title: ChangeLog
toc: menu
nav:
title: ChangeLog
order: 6
---
## 0.10.2
修改timeline选中底色增加item类名方便修改。
## 0.10.1
修改timeline类名方便修改样式。
## 0.10.0
函数名提出name作为单独配置项传递第一个参数作为id最后个参数作为函数名这样函数的显示名称可以支持转换。
弹窗事件如果不传递弹窗名字,则不会出现弹窗。
## 0.9.5
preview组件scripts加载由并发变为线性。
编辑模式下使用远程组件会储存当前画布状态。
## 0.9.4
修复preview组件不能解除loading的bug
## 0.9.3
增加双击置入画布。
变更元素初始focus状态。
存在元素宽高,则置入时定位于元素中心。
## 0.9.2
增加远程组件调用全流程component中增加url属性便于script加载。
## 0.9.1
增加config.i18n配置不使用国际化则不需要导入intl的context。
control组件第一个按钮变更为拖拽功能合并至timeline
## 0.9.0
增加react-intl修改部分样式。
## 0.8.4
增加preview的属性可外界控制loading。
## 0.8.3
增加timeline拖动条与选中。
修复antd menu属性报错。
## 0.8.2
增加左侧面板配置。
修复timeline闪烁问题。
## 0.8.1
新增动画组件timeline。可以更好预览所有动画。
## 0.8.0
动画部分重构,可支持多动画同时配置。
画布拖动最小值变更为0。
## 0.7.7
优化画布拖拽逻辑,更平滑移动。
## 0.7.6
右侧自定义rightGlobalCustom类型变更为函数传入config
## 0.7.5
修改滚轮方向。
## 0.7.4
修复框选移动bug。
## 0.7.3
修复弹窗位置与选中问题。
## 0.7.2
修复锁定组件影响,锁定中无法拖拽,缩放,旋转。
## 0.7.1
修复锁定组件无法选中解锁。
## 0.7.0
已支持组件旋转!
修复拖拽参考线等优化逻辑。
## 0.6.0
已支持编辑模式使用Iframe
修复选中条件。
## 0.5.1
修复右侧选中不能取消选中问题。
## 0.5.0
修复control组件宽度不够问题。
移除antd自定义icon容器底部icon可配置。
## 0.4.2
修复animate错误初始值。
修改markline样式。
全局设置增加容器高度。
## 0.4.1
去除lib自动导入样式。
## 0.4.0
去除runtime导出所有属性从config中获取。
## 0.3.1
1、由uuid更换为nanoid。
2、control组件增加标尺控制。
## 0.3.0
1、增加标尺ContainerWrapper需要传递config才可使用。
2、修改容器最小拖动667。修复画布缩放下拖拽时与鼠标距离不一致。
3、innerContainerDragUp需要传递config。
## 0.2.0
commander的传递进行修改可以获得config了commander不再从index中导出 需要使用时从config中获取。增加左侧类名方便自定义。
## 0.1.10
修改eslint依赖推荐
## 0.1.9
增加全局body设置
## 0.1.8
增加弹窗设置移除modalContainer
## 0.1.7
修改预览特殊条件显示删除console
## 0.1.6
调整初始缩放,画布初始比例,增加回正画布功能。
## 0.1.5
删除未作按钮增加fixed配置
## 0.1.4
基础功能

View File

@@ -0,0 +1,191 @@
---
title: 变更日志
toc: menu
nav:
title: 变更日志
order: 6
---
## 0.10.2
修改timeline选中底色增加item类名方便修改。
## 0.10.1
修改timeline类名方便修改样式。
## 0.10.0
函数名提出name作为单独配置项传递第一个参数作为id最后个参数作为函数名这样函数的显示名称可以支持转换。
弹窗事件如果不传递弹窗名字,则不会出现弹窗。
## 0.9.5
preview组件scripts加载由并发变为线性。
编辑模式下使用远程组件会储存当前画布状态。
## 0.9.4
修复preview组件不能解除loading的bug
## 0.9.3
增加双击置入画布。
变更元素初始focus状态。
存在元素宽高,则置入时定位于元素中心。
## 0.9.2
增加远程组件调用全流程component中增加url属性便于script加载。
## 0.9.1
增加config.i18n配置不使用国际化则不需要导入intl的context。
control组件第一个按钮变更为拖拽功能合并至timeline
## 0.9.0
增加react-intl修改部分样式。
## 0.8.4
增加preview的属性可外界控制loading。
## 0.8.3
增加timeline拖动条与选中。
修复antd menu属性报错。
## 0.8.2
增加左侧面板配置。
修复timeline闪烁问题。
## 0.8.1
新增动画组件timeline。可以更好预览所有动画。
## 0.8.0
动画部分重构,可支持多动画同时配置。
画布拖动最小值变更为0。
## 0.7.7
优化画布拖拽逻辑,更平滑移动。
## 0.7.6
右侧自定义rightGlobalCustom类型变更为函数传入config
## 0.7.5
修改滚轮方向。
## 0.7.4
修复框选移动bug。
## 0.7.3
修复弹窗位置与选中问题。
## 0.7.2
修复锁定组件影响,锁定中无法拖拽,缩放,旋转。
## 0.7.1
修复锁定组件无法选中解锁。
## 0.7.0
已支持组件旋转!
修复拖拽参考线等优化逻辑。
## 0.6.0
已支持编辑模式使用Iframe
修复选中条件。
## 0.5.1
修复右侧选中不能取消选中问题。
## 0.5.0
修复control组件宽度不够问题。
移除antd自定义icon容器底部icon可配置。
## 0.4.2
修复animate错误初始值。
修改markline样式。
全局设置增加容器高度。
## 0.4.1
去除lib自动导入样式。
## 0.4.0
去除runtime导出所有属性从config中获取。
## 0.3.1
1、由uuid更换为nanoid。
2、control组件增加标尺控制。
## 0.3.0
1、增加标尺ContainerWrapper需要传递config才可使用。
2、修改容器最小拖动667。修复画布缩放下拖拽时与鼠标距离不一致。
3、innerContainerDragUp需要传递config。
## 0.2.0
commander的传递进行修改可以获得config了commander不再从index中导出 需要使用时从config中获取。增加左侧类名方便自定义。
## 0.1.10
修改eslint依赖推荐
## 0.1.9
增加全局body设置
## 0.1.8
增加弹窗设置移除modalContainer
## 0.1.7
修改预览特殊条件显示删除console
## 0.1.6
调整初始缩放,画布初始比例,增加回正画布功能。
## 0.1.5
删除未作按钮增加fixed配置
## 0.1.4
基础功能

View File

@@ -0,0 +1,6 @@
---
title: FAQ
nav:
title: FAQ
order: 4
---

View File

@@ -0,0 +1,60 @@
---
title: FAQ
toc: menu
nav:
title: FAQ
order: 4
---
## 图表在位移时不断刷新
请使用fast-deep-equal比对所需要的数据如果相同则忽略更新即可。
## 无法选中组件或预览适配有问题
绝对定位组件必须有初始宽高,虽然在拖拽中会给组件加上宽高,但如果用户一开始就未拖动,则组件无宽高,不止影响选中判定,也会影响最后预览的计算。
## 组件动态注册的函数会一直保留
组件函数需要在组件卸载时调用卸载方法,否则一直存在。
## 表单验证提交思路
表单验证提交有非常多的做法,因为数据全部是联通的,或者直接写个表单组件也可以。
在不使用表单组件时,简单的做法是为每个输入组件做个验证函数与提交函数。
这样是否验证就取决于用户的选取,而抛出的输入可以让用户选择放到哪,并由用户去命名变量。
在点击提交按钮时调用所有组件的验证函数与提交函数使其抛给上下文再通过上下文聚合函数聚合成对象最后可以通过发送函数发送给对应后端从而完成整个流程。你可以在example中试下这个demo。
如果操作人员能看懂后端提供的接口文档,那么就可以让操作人员自己通过命名来拼出后端想要的字段。
如果不需要文档,那么某些值也可以在开发时写死。
另外的做法是可以专门写个提交按钮,固定了参数,以及部分规则,比如规定在页面中的所有表单都会被收集提交。
那么我们可以利用数据源将所有表单输出内容自动提交给数据源最后的提交按钮按数据源规定格式的key提取发送给后端。
## 置顶置底问题
有小伙伴反应置顶置底的操作有点不符合常理。置顶和置底其实不应该使用zindex去制作这样和图层的换顺序相矛盾而且使用zindex在置底时会有问题因为元素zindex不能比画布还低所以置顶置底符合常理的做法应该是去提升顺序。
## 多语言去除
config中的i18n设置为false即可不用在外层套用IntlProvider。
```js
config.i18n = false;
```

View File

@@ -0,0 +1,7 @@
---
title: Guide
toc: menu
nav:
title: Guide
order: 1
---

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,20 @@
---
title: Dooringx
hero:
desc: Quickly build your visual drag and drop application!
background: https://images.tuyacn.com/rms-static/b2994480-b3df-11eb-8b85-1990e48a4eb7-1620905892040.png?tyName=210513docs_bg.png
image: https://img-blog.csdnimg.cn/img_convert/520863a38a93d960862f92c805bc97cc.png#pic_center
actions:
- link: /docs
text: Get started
features:
- icon: https://yehuozhili-1259443377.cos.ap-nanjing.myqcloud.com/boxes.png
title: Out of the box
desc: It provides low-level capabilities to help developers get started at zero cost, so that all their attention can focus on component development and application design
- icon: https://yehuozhili-1259443377.cos.ap-nanjing.myqcloud.com/typescript.png
title: Typescript support
desc: Providing good TS definition support makes it easier to write components
- icon: https://yehuozhili-1259443377.cos.ap-nanjing.myqcloud.com/expand.png
title: Scalable and configurable
desc: Not only components, but also shortcut keys, event systems and UI layers can be configured and expanded by themselves
---

View File

@@ -0,0 +1,20 @@
---
title: Dooringx
hero:
desc: 快速搭建你的可视化拖拽应用!
background: https://images.tuyacn.com/rms-static/b2994480-b3df-11eb-8b85-1990e48a4eb7-1620905892040.png?tyName=210513docs_bg.png
image: https://img-blog.csdnimg.cn/img_convert/520863a38a93d960862f92c805bc97cc.png#pic_center
actions:
- link: /docs
text: 快速上手
features:
- icon: https://yehuozhili-1259443377.cos.ap-nanjing.myqcloud.com/boxes.png
title: 开箱即用
desc: 提供的底层能力,帮助开发者零成本上手,让所有注意力都能放组件开发与应用设计上
- icon: https://yehuozhili-1259443377.cos.ap-nanjing.myqcloud.com/typescript.png
title: Typescript支持
desc: 提供良好的ts定义支持让编写组件更加轻松
- icon: https://yehuozhili-1259443377.cos.ap-nanjing.myqcloud.com/expand.png
title: 可扩展可配置
desc: 不止是组件快捷键、事件系统、ui层面都可自行配置与扩展
---

View File

@@ -0,0 +1,42 @@
{
"private": true,
"name": "dooringx-dumi-doc",
"version": "1.0.0",
"scripts": {
"start": "dumi dev",
"docs:build": "dumi build",
"docs:deploy": "gh-pages -d docs-dist",
"build": "father-build",
"deploy": "npm run docs:build && npm run docs:deploy",
"release": "npm run build && npm publish",
"prettier": "prettier --write \"**/*.{js,jsx,tsx,ts,less,md,json}\"",
"test": "umi-test",
"test:coverage": "umi-test --coverage"
},
"main": "dist/index.js",
"module": "dist/index.esm.js",
"typings": "dist/index.d.ts",
"gitHooks": {
"pre-commit": "lint-staged"
},
"lint-staged": {
"*.{js,jsx,less,md,json}": [
"prettier --write"
],
"*.ts?(x)": [
"prettier --parser=typescript --write"
]
},
"dependencies": {
"react": "^16.12.0 || ^17.0.0"
},
"devDependencies": {
"@umijs/test": "^3.0.5",
"dumi": "^1.0.17",
"father-build": "^1.17.2",
"gh-pages": "^3.0.0",
"lint-staged": "^10.0.7",
"prettier": "^2.2.1",
"yorkie": "^2.0.0"
}
}

View File

View File

@@ -0,0 +1,29 @@
{
"compilerOptions": {
"target": "esnext",
"module": "esnext",
"moduleResolution": "node",
"importHelpers": true,
"jsx": "react",
"esModuleInterop": true,
"sourceMap": true,
"baseUrl": "./",
"strict": true,
"paths": {
"@/*": ["src/*"],
"@@/*": ["src/.umi/*"]
},
"allowSyntheticDefaultImports": true
},
"exclude": [
"node_modules",
"lib",
"es",
"dist",
"typings",
"**/__test__",
"test",
"docs",
"tests"
]
}

View File

@@ -0,0 +1,2 @@
declare module '*.css';
declare module '*.less';