build-dxf 0.1.20 → 0.1.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/build.d.ts +2 -0
- package/src/build.js +18 -2
- package/src/index.css +23 -1
- package/src/index3.js +1427 -374
- package/src/utils/CommandManager/CommandFlow.d.ts +4 -1
- package/src/utils/CommandManager/CommandManager.d.ts +5 -0
- package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/CommandFlowComponent.d.ts +1 -0
- package/src/utils/DxfSystem/plugin/Editor/pages/EditorTool.vue.d.ts +1 -1
package/package.json
CHANGED
package/src/build.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ export declare function createEditor(dom: HTMLDivElement, camera?: THREE.Camera,
|
|
|
15
15
|
dxfSystem: DxfSystem;
|
|
16
16
|
getFileAll: () => Promise<{
|
|
17
17
|
dxf: File;
|
|
18
|
+
obj: File;
|
|
18
19
|
glb: File;
|
|
19
20
|
gltf: File;
|
|
20
21
|
json: File;
|
|
@@ -59,6 +60,7 @@ export declare function buildJson(opt: HandleJsonOption): Promise<{
|
|
|
59
60
|
*/
|
|
60
61
|
export declare function getFileAll(dxfSystem?: DxfSystem): Promise<{
|
|
61
62
|
dxf: File;
|
|
63
|
+
obj: File;
|
|
62
64
|
glb: File;
|
|
63
65
|
gltf: File;
|
|
64
66
|
json: File;
|
package/src/build.js
CHANGED
|
@@ -15000,11 +15000,13 @@ const SelectLocalFile = Object.assign(selectLocalFileFun, {
|
|
|
15000
15000
|
});
|
|
15001
15001
|
class CommandFlow extends EventDispatcher {
|
|
15002
15002
|
list = [];
|
|
15003
|
+
dataList = [];
|
|
15003
15004
|
rollbacklist = [];
|
|
15004
15005
|
revokeRollbacklist = [];
|
|
15005
15006
|
// 是否写入操作记录
|
|
15006
15007
|
writeOperationList = true;
|
|
15007
15008
|
loop = false;
|
|
15009
|
+
currentIndex = 0;
|
|
15008
15010
|
setLoop(loop) {
|
|
15009
15011
|
this.loop = loop;
|
|
15010
15012
|
return this;
|
|
@@ -15014,8 +15016,9 @@ class CommandFlow extends EventDispatcher {
|
|
|
15014
15016
|
* @param operation
|
|
15015
15017
|
* @returns
|
|
15016
15018
|
*/
|
|
15017
|
-
add(operation) {
|
|
15019
|
+
add(operation, data = {}) {
|
|
15018
15020
|
this.list.push(operation);
|
|
15021
|
+
this.dataList.push(data);
|
|
15019
15022
|
return this;
|
|
15020
15023
|
}
|
|
15021
15024
|
/** 添加回滚回调列表
|
|
@@ -15033,6 +15036,9 @@ class CommandFlow extends EventDispatcher {
|
|
|
15033
15036
|
this.revokeRollbacklist.push(callBack);
|
|
15034
15037
|
return this;
|
|
15035
15038
|
}
|
|
15039
|
+
getData(index2) {
|
|
15040
|
+
return this.dataList[index2];
|
|
15041
|
+
}
|
|
15036
15042
|
}
|
|
15037
15043
|
class CommandManager extends EventDispatcher {
|
|
15038
15044
|
commandFlowMap = /* @__PURE__ */ new Map();
|
|
@@ -15066,6 +15072,13 @@ class CommandManager extends EventDispatcher {
|
|
|
15066
15072
|
this.commandFlowMap.set(name, commandFlow);
|
|
15067
15073
|
return commandFlow;
|
|
15068
15074
|
}
|
|
15075
|
+
/** 获取命令流
|
|
15076
|
+
* @param name
|
|
15077
|
+
* @returns
|
|
15078
|
+
*/
|
|
15079
|
+
getCommandFlow(name) {
|
|
15080
|
+
return this.commandFlowMap.get(name);
|
|
15081
|
+
}
|
|
15069
15082
|
executionPromise = null;
|
|
15070
15083
|
executionResolve = null;
|
|
15071
15084
|
/** 执行控制流
|
|
@@ -15096,6 +15109,7 @@ class CommandManager extends EventDispatcher {
|
|
|
15096
15109
|
try {
|
|
15097
15110
|
for (let i = step; i < commandFlow.list.length; i++) {
|
|
15098
15111
|
const operation = commandFlow.list[i];
|
|
15112
|
+
commandFlow.currentIndex = i;
|
|
15099
15113
|
commandFlow.dispatchEvent({ type: "executing", index: i });
|
|
15100
15114
|
this.dispatchEvent({ type: "executing", name, index: i });
|
|
15101
15115
|
data = await new Promise((resolve) => {
|
|
@@ -15117,6 +15131,7 @@ class CommandManager extends EventDispatcher {
|
|
|
15117
15131
|
} finally {
|
|
15118
15132
|
this.lock = false;
|
|
15119
15133
|
this.currentName = null;
|
|
15134
|
+
commandFlow.currentIndex = 0;
|
|
15120
15135
|
if (this.abortController && !this.abortController.signal.aborted) {
|
|
15121
15136
|
commandFlow.dispatchEvent({ type: "completed", data });
|
|
15122
15137
|
this.dispatchEvent({ type: "completed", name, data });
|
|
@@ -15402,12 +15417,13 @@ async function getFileAll(dxfSystem = gloabalDxfSystem) {
|
|
|
15402
15417
|
const dxf = new File([dxfSystem.CorrectionDxf.toDxfBlob() ?? ""], "dxf.dxf", { type: "application/dxf" });
|
|
15403
15418
|
const jpg = new File([await dxfSystem.CorrectionDxf.toRCDxfImageBlob()], "img.jpg", { type: "image/jpeg" });
|
|
15404
15419
|
const correctionDxf = new File([dxfSystem.CorrectionDxf.toRCDxfBlob() ?? ""], "dxf.dxf", { type: "application/dxf" });
|
|
15420
|
+
const obj = new File([await whiteModel.toOBJBlob()], "model.obj", { type: "application/octet-stream" });
|
|
15405
15421
|
const glb = new File([await whiteModel.toGltfBlob(true)], "model.glb", { type: "application/octet-stream" });
|
|
15406
15422
|
const gltf2 = new File([await whiteModel.toGltfBlob(false)], "model.gltf", { type: "application/json" });
|
|
15407
15423
|
const json = new File([JSON.stringify(dxfSystem.Dxf.originalData)], "json.json", { type: "application/json" });
|
|
15408
15424
|
return {
|
|
15409
15425
|
dxf,
|
|
15410
|
-
|
|
15426
|
+
obj,
|
|
15411
15427
|
glb,
|
|
15412
15428
|
gltf: gltf2,
|
|
15413
15429
|
json,
|
package/src/index.css
CHANGED
|
@@ -109,6 +109,10 @@
|
|
|
109
109
|
bottom: 10px;
|
|
110
110
|
}
|
|
111
111
|
|
|
112
|
+
.bottom-\[20px\] {
|
|
113
|
+
bottom: 20px;
|
|
114
|
+
}
|
|
115
|
+
|
|
112
116
|
.left-0 {
|
|
113
117
|
left: calc(var(--spacing) * 0);
|
|
114
118
|
}
|
|
@@ -117,6 +121,14 @@
|
|
|
117
121
|
left: 10px;
|
|
118
122
|
}
|
|
119
123
|
|
|
124
|
+
.left-\[20px\] {
|
|
125
|
+
left: 20px;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.z-100 {
|
|
129
|
+
z-index: 100;
|
|
130
|
+
}
|
|
131
|
+
|
|
120
132
|
.z-\[11\] {
|
|
121
133
|
z-index: 11;
|
|
122
134
|
}
|
|
@@ -424,6 +436,16 @@
|
|
|
424
436
|
background-color: var(--color-white);
|
|
425
437
|
}
|
|
426
438
|
|
|
439
|
+
.bg-white\/15 {
|
|
440
|
+
background-color: #ffffff26;
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
444
|
+
.bg-white\/15 {
|
|
445
|
+
background-color: color-mix(in oklab, var(--color-white) 15%, transparent);
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
|
|
427
449
|
.p-\[0px_5px\] {
|
|
428
450
|
padding: 0 5px;
|
|
429
451
|
}
|
|
@@ -680,7 +702,7 @@
|
|
|
680
702
|
inherits: false
|
|
681
703
|
}
|
|
682
704
|
|
|
683
|
-
[data-v-
|
|
705
|
+
[data-v-492c138f] {
|
|
684
706
|
font-family: 宋体;
|
|
685
707
|
}
|
|
686
708
|
|