mirror of
https://gitee.com/hoslay/ddei-editor.git
synced 2025-12-06 09:08:44 +08:00
优化打包,将lodash、three变为按需引入,基础框架以后只有一个依赖包。新增HTML直接引用的Demo
This commit is contained in:
parent
844a893c4c
commit
34faa14a3d
84111
examples/html/ddei-editor.umd.cjs
Normal file
84111
examples/html/ddei-editor.umd.cjs
Normal file
File diff suppressed because one or more lines are too long
11857
examples/html/ddei-flow.umd.cjs
Normal file
11857
examples/html/ddei-flow.umd.cjs
Normal file
File diff suppressed because one or more lines are too long
47
examples/html/editor.html
Normal file
47
examples/html/editor.html
Normal file
@ -0,0 +1,47 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>DDeiEditor-HTML直接引用</title>
|
||||
<script src="./vue.js"></script>
|
||||
<script src="./ddei-editor.umd.cjs"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="app">
|
||||
<component id="ddei_editor_1" :is="editor" :options="options"></component>
|
||||
</div>
|
||||
</body>
|
||||
<script>
|
||||
// 创建 Vue 应用
|
||||
const app = Vue.createApp({
|
||||
data () {
|
||||
return {
|
||||
editor: window["ddei-editor"].DDeiEditorView,
|
||||
options:options = {
|
||||
currentLayout: "ddei-core-layout-simple",
|
||||
config: {
|
||||
"grid": 0,
|
||||
"background": { color: "blue", opacity: 0.1 },
|
||||
initData: {
|
||||
controls: [
|
||||
{
|
||||
model: "102010",
|
||||
text: "初始化图形",
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
app.mount('#app');
|
||||
</script>
|
||||
</html>
|
||||
|
||||
|
||||
38
examples/html/flow.html
Normal file
38
examples/html/flow.html
Normal file
@ -0,0 +1,38 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>DFlow流程图-HTML直接使用</title>
|
||||
<script src="./vue.js"></script>
|
||||
<script src="./ddei-editor.umd.cjs"></script>
|
||||
<script src="./ddei-flow.umd.cjs"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="app">
|
||||
<component id="ddei_editor_1" :is="editor" :options="options"></component>
|
||||
</div>
|
||||
</body>
|
||||
<script>
|
||||
// 创建 Vue 应用
|
||||
const app = Vue.createApp({
|
||||
data () {
|
||||
return {
|
||||
editor: window["ddei-editor"].DDeiEditorView,
|
||||
options:options = {
|
||||
extensions: [
|
||||
window["ddei-flow"].DDeiFlow,
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
app.mount('#app');
|
||||
</script>
|
||||
</html>
|
||||
|
||||
|
||||
1
examples/html/vue.js
Normal file
1
examples/html/vue.js
Normal file
File diff suppressed because one or more lines are too long
1353
package-lock.json
generated
1353
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
10
package.json
10
package.json
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ddei-editor",
|
||||
"version": "1.2.43",
|
||||
"version": "1.2.44-4",
|
||||
"private": false,
|
||||
"type": "module",
|
||||
"author": "hoslay <3697355039@qq.com>",
|
||||
@ -50,13 +50,10 @@
|
||||
"type-check": "vue-tsc --noEmit -p tsconfig.app.json --composite false"
|
||||
},
|
||||
"dependencies": {
|
||||
"ddei-framework": "^1.2.43",
|
||||
"lodash": "^4.17.21",
|
||||
"three": "^0.156.1"
|
||||
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tsconfig/node18": "^18.2.0",
|
||||
"@types/lodash": "^4.14.197",
|
||||
"@types/node": "^18.17.6",
|
||||
"@vitejs/plugin-vue": "^4.2.3",
|
||||
"@vue/tsconfig": "^0.4.0",
|
||||
@ -65,6 +62,7 @@
|
||||
"typescript": "~5.1.6",
|
||||
"vite": "^4.4.6",
|
||||
"vite-plugin-compression": "^0.5.1",
|
||||
"vue-tsc": "^1.8.6"
|
||||
"vue-tsc": "^1.8.6",
|
||||
"ddei-framework": "file:///Users/hoslay/work/ddei/ddei-framework/ddei-framework-1.2.44-4.tgz"
|
||||
}
|
||||
}
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { debounce } from "lodash";
|
||||
import { debounce } from "ddei-framework";
|
||||
import {DDeiEditor} from "ddei-framework";
|
||||
import {DDeiEditorUtil} from "ddei-framework";
|
||||
import {DDeiUtil} from "ddei-framework";
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import {DDeiPluginBase} from "ddei-framework";
|
||||
import { loadControlByFrom, loadAndSortGroup } from "@/editor/grouputil"
|
||||
import { cloneDeep } from "lodash"
|
||||
import { cloneDeep } from "ddei-framework"
|
||||
const control_ctx = import.meta.glob('./control/**', { eager: true })
|
||||
const group_ctx = import.meta.glob('./group/**', { eager: true })
|
||||
|
||||
|
||||
@ -46,7 +46,7 @@
|
||||
import { DDeiEditor, DDei, DDeiEnumOperateType } from "ddei-framework";
|
||||
import {DDeiEnumBusCommandType} from "ddei-framework";
|
||||
import {DDeiConfig} from "ddei-framework";
|
||||
import { Matrix3 } from 'three';
|
||||
import { Matrix3 } from 'ddei-framework';
|
||||
import DialogBase from "./dialog"
|
||||
|
||||
export default {
|
||||
|
||||
@ -5,7 +5,7 @@ import {DDeiEditor} from "ddei-framework";
|
||||
import {DDeiEditorState} from "ddei-framework";
|
||||
import {DDeiEditorEnumBusCommandType} from "ddei-framework";
|
||||
import {DDeiUtil} from "ddei-framework";
|
||||
import { cloneDeep } from 'lodash'
|
||||
import { cloneDeep } from 'ddei-framework'
|
||||
|
||||
/**
|
||||
* 键行为:记录当前控件的格式
|
||||
|
||||
@ -7,13 +7,13 @@ import {DDeiStage} from "ddei-framework";
|
||||
import {DDeiConfig} from "ddei-framework";
|
||||
import {DDeiAbstractShape} from "ddei-framework";
|
||||
import {DDeiTable} from "ddei-framework";
|
||||
import { Matrix3 } from 'three';
|
||||
import { Matrix3 } from 'ddei-framework';
|
||||
import {DDeiEnumOperateType} from "ddei-framework";
|
||||
import {DDeiPolygon} from "ddei-framework";
|
||||
import {DDeiLink} from "ddei-framework";
|
||||
import {DDeiModelLink} from "ddei-framework";
|
||||
import { DDeiEditorState, DDeiEditorUtil } from "ddei-framework";
|
||||
import {cloneDeep} from "lodash"
|
||||
import {cloneDeep} from "ddei-framework"
|
||||
/**
|
||||
* 键行为:粘贴
|
||||
* 粘贴剪切板内容
|
||||
|
||||
@ -3,14 +3,14 @@ import { DDei, DDeiEnumOperateType } from "ddei-framework";
|
||||
import {DDeiEnumBusCommandType} from "ddei-framework";
|
||||
import {DDeiModelLink} from "ddei-framework";
|
||||
import { DDeiUtil, DDeiEditorUtil } from "ddei-framework";
|
||||
import { Matrix3, Vector3 } from 'three';
|
||||
import { Matrix3, Vector3 } from 'ddei-framework';
|
||||
import {DDeiEditor} from "ddei-framework";
|
||||
import {DDeiEditorEnumBusCommandType} from "ddei-framework";
|
||||
import {DDeiEditorState} from "ddei-framework";
|
||||
import {DDeiKeyAction} from "ddei-framework";
|
||||
import {DDeiEnumOperateState} from "ddei-framework";
|
||||
import {DDeiAbstractShape} from "ddei-framework";
|
||||
import { cloneDeep } from 'lodash';
|
||||
import { cloneDeep } from 'ddei-framework';
|
||||
/**
|
||||
* 键行为:开启快捷编辑
|
||||
* 开启快捷编辑
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { DDeiLifeCycle, DDeiFuncData, DDeiEditorUtil, DDeiUtil, DDeiFuncCallResult, DDeiEditorState } from "ddei-framework";
|
||||
import { debounce } from "lodash";
|
||||
import { debounce } from "ddei-framework";
|
||||
|
||||
class DDeiCoreLifeCycle extends DDeiLifeCycle {
|
||||
|
||||
|
||||
@ -16,7 +16,7 @@ import {DDeiEnumOperateState} from "ddei-framework";
|
||||
import {DDeiEnumBusCommandType} from "ddei-framework";
|
||||
import {DDeiEnumState} from "ddei-framework";
|
||||
import {DDeiUtil} from "ddei-framework";
|
||||
import { throttle } from "lodash";
|
||||
import { throttle } from "ddei-framework";
|
||||
import {DDeiEditorEnumBusCommandType} from "ddei-framework";
|
||||
|
||||
export default {
|
||||
|
||||
@ -59,7 +59,7 @@
|
||||
<script lang="ts">
|
||||
import {DDeiEditorUtil} from "ddei-framework";
|
||||
import {DDeiEditor} from "ddei-framework";
|
||||
import { cloneDeep, first } from "lodash";
|
||||
import { cloneDeep } from "ddei-framework";
|
||||
import {DDeiUtil} from "ddei-framework";
|
||||
import {DDeiAbstractShape} from "ddei-framework";
|
||||
import {DDeiEditorArrtibute } from "ddei-framework";
|
||||
|
||||
@ -30,11 +30,11 @@ import {DDei} from "ddei-framework";
|
||||
import {DDeiEditorState} from "ddei-framework";
|
||||
import {DDeiEditorUtil} from "ddei-framework";
|
||||
import {DDeiEnumControlState} from "ddei-framework";
|
||||
import { Matrix3 } from "three";
|
||||
import { Matrix3 } from "ddei-framework";
|
||||
import {DDeiEditorEnumBusCommandType} from "ddei-framework";
|
||||
import {DDeiUtil} from "ddei-framework";
|
||||
import {DDeiEnumBusCommandType} from "ddei-framework";
|
||||
import { clone } from 'lodash'
|
||||
import { clone } from 'ddei-framework'
|
||||
import {DDeiEnumOperateState} from "ddei-framework";
|
||||
|
||||
export default {
|
||||
|
||||
@ -59,15 +59,14 @@ import {DDeiEditor} from "ddei-framework";
|
||||
import {DDeiEnumOperateType} from "ddei-framework";
|
||||
import {DDei} from "ddei-framework";
|
||||
import {DDeiEditorState} from "ddei-framework";
|
||||
import { cloneDeep, trim } from "lodash";
|
||||
import {DDeiAbstractShape} from "ddei-framework";
|
||||
import { cloneDeep, trim } from "ddei-framework";
|
||||
import {DDeiEditorUtil} from "ddei-framework";
|
||||
import {DDeiEnumControlState} from "ddei-framework";
|
||||
import { Matrix3 } from "three";
|
||||
import { Matrix3 } from "ddei-framework";
|
||||
import {DDeiEditorEnumBusCommandType} from "ddei-framework";
|
||||
import {DDeiUtil} from "ddei-framework";
|
||||
import {DDeiEnumBusCommandType} from "ddei-framework";
|
||||
import { clone } from 'lodash'
|
||||
import { clone } from 'ddei-framework'
|
||||
import {DDeiEnumOperateState} from "ddei-framework";
|
||||
|
||||
export default {
|
||||
|
||||
@ -26,7 +26,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { debounce } from "lodash";
|
||||
import { debounce } from "ddei-framework";
|
||||
import {DDeiEditorArrtibute } from "ddei-framework";
|
||||
import {DDeiEditor} from "ddei-framework";
|
||||
import {DDeiUtil} from "ddei-framework";
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { debounce } from "lodash";
|
||||
import { debounce } from "ddei-framework";
|
||||
import {DDeiEditorArrtibute } from "ddei-framework";
|
||||
import {DDeiEditor} from "ddei-framework";
|
||||
import {DDeiUtil} from "ddei-framework";
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { throttle } from "lodash";
|
||||
import { throttle } from "ddei-framework";
|
||||
import {DDeiEditorArrtibute } from "ddei-framework";
|
||||
import {DDeiEditor} from "ddei-framework";
|
||||
import {DDeiEnumBusCommandType} from "ddei-framework";
|
||||
|
||||
@ -11,14 +11,14 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { debounce } from "lodash";
|
||||
import { debounce } from "ddei-framework";
|
||||
import {DDeiEditorArrtibute } from "ddei-framework";
|
||||
import {DDeiEditor} from "ddei-framework";
|
||||
import {DDeiEnumBusCommandType} from "ddei-framework";
|
||||
import {DDeiAbstractArrtibuteParser } from "ddei-framework";
|
||||
import {DDeiEditorEnumBusCommandType} from "ddei-framework";
|
||||
import {DDeiUtil} from "ddei-framework";
|
||||
import { throttle } from "lodash";
|
||||
import { throttle } from "ddei-framework";
|
||||
import {DDeiEnumOperateType} from "ddei-framework";
|
||||
export default {
|
||||
name: "pv-range",
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
<script lang="ts">
|
||||
import { DDeiAbstractShape } from "ddei-framework";
|
||||
import { DDeiEditorUtil, DDeiEnumOperateType, DDeiEnumBusCommandType } from "ddei-framework";
|
||||
import { clone } from "lodash"
|
||||
import { clone } from "ddei-framework"
|
||||
import DialogBase from "./dialog"
|
||||
|
||||
export default {
|
||||
|
||||
@ -34,7 +34,7 @@
|
||||
import { DDeiEditor, DDeiEnumControlState, DDeiUtil } from "ddei-framework";
|
||||
import {DDeiEditorUtil} from "ddei-framework";
|
||||
import { DDeiAbstractShape } from "ddei-framework";
|
||||
import { clone } from "lodash";
|
||||
import { clone } from "ddei-framework";
|
||||
import { DDeiEnumBusCommandType } from "ddei-framework";
|
||||
|
||||
export default {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { DDeiLifeCycle, DDeiEnumControlState,DDeiFuncData, DDeiEditorUtil, DDeiUtil, DDeiFuncCallResult } from "ddei-framework";
|
||||
import {debounce} from 'lodash';
|
||||
import {debounce} from 'ddei-framework';
|
||||
|
||||
class DDeiExtSearchLifeCycle extends DDeiLifeCycle {
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { DDeiLifeCycle, DDeiFuncData, DDeiEditorUtil, DDeiUtil, DDeiFuncCallResult, DDeiEditorState } from "ddei-framework";
|
||||
import { debounce } from "lodash";
|
||||
import { debounce } from "ddei-framework";
|
||||
|
||||
class DDeiCoreCanvasLifeCycle extends DDeiLifeCycle {
|
||||
|
||||
|
||||
@ -77,7 +77,7 @@ import { DDeiEditor, DDeiEditorEnumBusCommandType, DDeiUtil } from "ddei-framewo
|
||||
import {DDeiEditorUtil} from "ddei-framework";
|
||||
import {DDeiEnumBusCommandType} from "ddei-framework";
|
||||
import {DDeiEditorState} from "ddei-framework";
|
||||
import { debounce } from "lodash";
|
||||
import { debounce } from "ddei-framework";
|
||||
|
||||
export default {
|
||||
name: "ddei-ext-panel-search",
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { DDeiLifeCycle, DDeiFuncData, DDeiEditorUtil, DDeiUtil, DDeiFuncCallResult } from "ddei-framework";
|
||||
import {debounce} from 'lodash';
|
||||
import {debounce} from 'ddei-framework';
|
||||
|
||||
class DDeiExtSearchLifeCycle extends DDeiLifeCycle {
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { DDeiLifeCycle, DDeiFuncData, DDeiEditorUtil, DDeiUtil, DDeiFuncCallResult, DDeiEditorState } from "ddei-framework";
|
||||
import { debounce } from "lodash";
|
||||
import { debounce } from "ddei-framework";
|
||||
|
||||
class DDeiExtTooltipLifeCycle extends DDeiLifeCycle {
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import {DDeiPluginBase} from "ddei-framework";
|
||||
import { loadControlByFrom, loadAndSortGroup } from "@/editor/grouputil"
|
||||
import { cloneDeep } from "lodash"
|
||||
import { cloneDeep } from "ddei-framework"
|
||||
const control_ctx = import.meta.glob('./control/**', { eager: true })
|
||||
const group_ctx = import.meta.glob('./group/**', { eager: true })
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import {DDeiEditorArrtibute} from 'ddei-framework';
|
||||
import { cloneDeep } from 'lodash'
|
||||
import { cloneDeep } from 'ddei-framework'
|
||||
import {DDeiUtil} from 'ddei-framework';
|
||||
import { markRaw } from "vue"
|
||||
|
||||
|
||||
@ -21,10 +21,10 @@ export default defineConfig({
|
||||
minify: false,
|
||||
// 这里配置打包,打包时要排除Vue的依赖,因为我们使用组件库时本地肯定是vue 环境,否则会报isCE 的错误
|
||||
rollupOptions: {
|
||||
external: ["vue", "three", "lodash"],
|
||||
external: ["vue"],
|
||||
output: {
|
||||
globals: {
|
||||
vue: "Vue",
|
||||
vue: "Vue"
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user