@mlightcad/cad-viewer 1.0.2 → 1.0.3
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/README.md
CHANGED
|
@@ -8,6 +8,7 @@ CAD Viewer is a **high-performance** Vue 3 component for viewing and editing CAD
|
|
|
8
8
|
- **No backend required** - Files are parsed and processed entirely in the browser
|
|
9
9
|
- **Enhanced data security** - Files never leave your device, ensuring complete privacy
|
|
10
10
|
- **Easy integration** - No server setup or backend infrastructure needed for third-party integration
|
|
11
|
+
- **Customizable UI** - Control visibility of toolbars, command line, coordinates, and performance stats
|
|
11
12
|
- Modern UI optimized for large CAD file handling
|
|
12
13
|
- State management for layers, entities, and settings
|
|
13
14
|
- Integration with optimized SVG and THREE.js renderers
|
|
@@ -119,43 +120,45 @@ The `MlCadViewer` component accepts the following props:
|
|
|
119
120
|
|----------|------|---------|-------------|
|
|
120
121
|
| `locale` | `'en' \| 'zh' \| 'default'` | `'default'` | Sets the language for the component interface. Use `'en'` for English, `'zh'` for Chinese, or `'default'` to use the browser's default language. |
|
|
121
122
|
| `url` | `string` | `undefined` | Optional URL to automatically load a CAD file when the component mounts. The file will be fetched and opened automatically. |
|
|
122
|
-
| `wait` | `number` | `10` | When set to a positive number, the component will wait for DWG converter ready
|
|
123
|
+
| `wait` | `number` | `10` | When set to a positive number, the component will wait for DWG converter ready to use for the specified number of seconds before initializing. This is useful when you need to ensure DWG file support is available before the component becomes interactive. Set to `0` or negative value to disable waiting. |
|
|
123
124
|
|
|
124
|
-
###
|
|
125
|
+
### UI Settings
|
|
125
126
|
|
|
126
|
-
|
|
127
|
-
```vue
|
|
128
|
-
<template>
|
|
129
|
-
<MlCadViewer />
|
|
130
|
-
</template>
|
|
131
|
-
```
|
|
127
|
+
The `MlCadViewer` reads its UI visibility from the global `AcApSettingManager` (provided by `@mlightcad/cad-simple-viewer`). Configure these flags anywhere before rendering the viewer to customize the UI.
|
|
132
128
|
|
|
133
|
-
|
|
129
|
+
| Setting | Type | Default | Description |
|
|
130
|
+
|---------|------|---------|-------------|
|
|
131
|
+
| `isShowToolbar` | `boolean` | `true` | Controls toolbar visibility |
|
|
132
|
+
| `isShowCommandLine` | `boolean` | `true` | Controls command line visibility |
|
|
133
|
+
| `isShowCoordinate` | `boolean` | `true` | Controls coordinate display visibility |
|
|
134
|
+
| `isShowStats` | `boolean` | `false` | Controls performance statistics display |
|
|
135
|
+
|
|
136
|
+
#### Example (recommended)
|
|
134
137
|
```vue
|
|
135
138
|
<template>
|
|
136
139
|
<MlCadViewer locale="en" />
|
|
140
|
+
<!-- Or provide url/wait props as needed -->
|
|
141
|
+
<!-- <MlCadViewer :wait="10" url="https://example.com/drawing.dwg" /> -->
|
|
142
|
+
|
|
137
143
|
</template>
|
|
138
|
-
```
|
|
139
144
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
145
|
+
<script setup lang="ts">
|
|
146
|
+
import { MlCadViewer } from '@mlightcad/cad-viewer'
|
|
147
|
+
import { AcApSettingManager } from '@mlightcad/cad-simple-viewer'
|
|
148
|
+
|
|
149
|
+
// Configure global UI flags before the viewer mounts
|
|
150
|
+
AcApSettingManager.instance.isShowCommandLine = false
|
|
151
|
+
// Optional toggles
|
|
152
|
+
// AcApSettingManager.instance.isShowToolbar = false
|
|
153
|
+
// AcApSettingManager.instance.isShowStats = true
|
|
154
|
+
// AcApSettingManager.instance.isShowCoordinate = false
|
|
155
|
+
</script>
|
|
148
156
|
```
|
|
149
157
|
|
|
150
|
-
####
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
:wait="10"
|
|
155
|
-
url="https://example.com/path/to/drawing.dwg"
|
|
156
|
-
/>
|
|
157
|
-
</template>
|
|
158
|
-
```
|
|
158
|
+
#### Notes
|
|
159
|
+
|
|
160
|
+
- Settings are global and immediately reflected by `MlCadViewer`.
|
|
161
|
+
- You can change them at runtime using the same `AcApSettingManager.instance` reference.
|
|
159
162
|
|
|
160
163
|
### Component Features
|
|
161
164
|
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { LocaleProp } from '../locale';
|
|
2
2
|
interface Props {
|
|
3
|
+
/** Language locale for internationalization ('en', 'zh', or 'default') */
|
|
3
4
|
locale?: LocaleProp;
|
|
5
|
+
/** Optional URL to automatically load a CAD file on component mount */
|
|
4
6
|
url?: string;
|
|
7
|
+
/** Timeout in seconds to wait for DWG converter (libredwg.js) to load before proceeding */
|
|
5
8
|
wait?: number;
|
|
6
9
|
}
|
|
7
10
|
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<Props>, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MlCadViewer.vue.d.ts","sourceRoot":"","sources":["../../src/component/MlCadViewer.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MlCadViewer.vue.d.ts","sourceRoot":"","sources":["../../src/component/MlCadViewer.vue"],"names":[],"mappings":"AAyCA;AAiYA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AAatC,UAAU,KAAK;IACb,0EAA0E;IAC1E,MAAM,CAAC,EAAE,UAAU,CAAA;IACnB,uEAAuE;IACvE,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,2FAA2F;IAC3F,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;;;;;;;;;;YALU,UAAU;SAEb,MAAM;UAEL,MAAM;;AAiVf,wBAMG;AAEH,KAAK,kBAAkB,CAAC,CAAC,EAAE,CAAC,IAAI;KAC9B,CAAC,IAAI,MAAM,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,SAAS,MAAM,CAAC,GAC7C,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG;QAAE,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;KAAC,CAAC,GAC5C,CAAC,CAAC,CAAC,CAAC;CACP,CAAC;AACF,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AACjE,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC;AACF,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
export * from './useCurrentPos';
|
|
2
1
|
export * from './useCommands';
|
|
2
|
+
export * from './useCurrentPos';
|
|
3
3
|
export * from './useDark';
|
|
4
4
|
export * from './useDialogManager';
|
|
5
|
+
export * from './useFileTypes';
|
|
5
6
|
export * from './useLayers';
|
|
6
7
|
export * from './useLayouts';
|
|
8
|
+
export * from './useLocale';
|
|
7
9
|
export * from './useMissedData';
|
|
8
10
|
export * from './useSettings';
|
|
9
11
|
export * from './useSystemVars';
|
|
10
|
-
export * from './useLocale';
|
|
11
12
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/composable/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/composable/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA;AAC7B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,WAAW,CAAA;AACzB,cAAc,oBAAoB,CAAA;AAClC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA;AAC3B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,eAAe,CAAA;AAC7B,cAAc,iBAAiB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "./index.css";
|
|
2
2
|
import "element-plus/dist/index.css";
|
|
3
3
|
import { AcEdCommand as re, AcEdCommandStack as q, AcApDocManager as D, eventBus as j, AcApSettingManager as Y, AcApConvertToSvgCmd as Ie, AcApQNewCmd as Pe, AcApOpenCmd as Ne } from "@mlightcad/cad-simple-viewer";
|
|
4
|
-
import { ref as x, onMounted as H, onUnmounted as ee, computed as k,
|
|
5
|
-
import { AcCmPerformanceCollector as Ge,
|
|
4
|
+
import { reactive as W, ref as x, onMounted as H, onUnmounted as ee, computed as k, watch as E, defineComponent as L, resolveComponent as M, createBlock as C, openBlock as u, unref as m, withCtx as p, renderSlot as ie, createVNode as v, createTextVNode as F, toDisplayString as B, createElementVNode as d, createElementBlock as w, Fragment as K, renderList as X, resolveDynamicComponent as ge, mergeProps as Oe, mergeModels as Z, useCssVars as Ce, useModel as fe, createCommentVNode as U, normalizeStyle as pe, normalizeClass as Le, pushScopeId as ze, popScopeId as Be, onBeforeUnmount as De, withKeys as He, isRef as Re, markRaw as _e } from "vue";
|
|
5
|
+
import { AcCmPerformanceCollector as Ge, AcDbDatabaseConverterManager as Te, acdbHostApplicationServices as Ee, AcDbFileType as qe } from "@mlightcad/data-model";
|
|
6
6
|
import { useDark as We, useToggle as Ue, useFullscreen as je } from "@vueuse/core";
|
|
7
7
|
import Ye from "element-plus/es/locale/lang/en";
|
|
8
8
|
import Ke from "element-plus/es/locale/lang/zh-cn";
|
|
@@ -70,12 +70,23 @@ class st extends re {
|
|
|
70
70
|
Ge.getInstance().printAll();
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
|
+
function ct() {
|
|
74
|
+
const t = W([]), e = q.instance.iterator();
|
|
75
|
+
for (const n of e)
|
|
76
|
+
t.push({
|
|
77
|
+
commandName: n.command.localName,
|
|
78
|
+
groupName: n.commandGroup
|
|
79
|
+
});
|
|
80
|
+
return t.sort(
|
|
81
|
+
(n, i) => n.commandName.toLowerCase().localeCompare(i.commandName.toLowerCase())
|
|
82
|
+
), t;
|
|
83
|
+
}
|
|
73
84
|
const ye = new Intl.NumberFormat("en-US", {
|
|
74
85
|
style: "decimal",
|
|
75
86
|
minimumFractionDigits: 2,
|
|
76
87
|
maximumFractionDigits: 2
|
|
77
88
|
});
|
|
78
|
-
function
|
|
89
|
+
function ut(t) {
|
|
79
90
|
const e = x(0), n = x(0);
|
|
80
91
|
function i(o) {
|
|
81
92
|
e.value = o.x, n.value = o.y;
|
|
@@ -84,17 +95,6 @@ function ct(t) {
|
|
|
84
95
|
const l = k(() => `${ye.format(e.value)}, ${ye.format(n.value)}`);
|
|
85
96
|
return { x: e, y: n, text: l };
|
|
86
97
|
}
|
|
87
|
-
function ut() {
|
|
88
|
-
const t = W([]), e = q.instance.iterator();
|
|
89
|
-
for (const n of e)
|
|
90
|
-
t.push({
|
|
91
|
-
commandName: n.command.localName,
|
|
92
|
-
groupName: n.commandGroup
|
|
93
|
-
});
|
|
94
|
-
return t.sort(
|
|
95
|
-
(n, i) => n.commandName.toLowerCase().localeCompare(i.commandName.toLowerCase())
|
|
96
|
-
), t;
|
|
97
|
-
}
|
|
98
98
|
const ae = We(), dt = Ue(ae), ne = W([]);
|
|
99
99
|
function mt(t) {
|
|
100
100
|
ne.find((n) => n.name === t.name) || ne.push({ ...t, visible: !1 });
|
|
@@ -114,7 +114,15 @@ function oe() {
|
|
|
114
114
|
getDialogByName: vt
|
|
115
115
|
};
|
|
116
116
|
}
|
|
117
|
-
function gt(
|
|
117
|
+
function gt() {
|
|
118
|
+
const t = x(/* @__PURE__ */ new Set()), e = Te.instance;
|
|
119
|
+
for (const n of e.fileTypes)
|
|
120
|
+
t.value.add(n);
|
|
121
|
+
return e.events.registered.addEventListener((n) => {
|
|
122
|
+
t.value.add(n.fileType);
|
|
123
|
+
}), t;
|
|
124
|
+
}
|
|
125
|
+
function ft(t) {
|
|
118
126
|
const e = W([]), n = t.curDocument, i = (l) => {
|
|
119
127
|
const o = l.tables.layerTable.newIterator();
|
|
120
128
|
for (const a of o)
|
|
@@ -144,7 +152,7 @@ function gt(t) {
|
|
|
144
152
|
e.length = 0, i(l.doc.database);
|
|
145
153
|
}), e;
|
|
146
154
|
}
|
|
147
|
-
function
|
|
155
|
+
function ht(t) {
|
|
148
156
|
const e = W([]), n = t.curDocument, i = (l) => {
|
|
149
157
|
const o = l.dictionaries.layouts.newIterator();
|
|
150
158
|
e.length = 0;
|
|
@@ -159,7 +167,7 @@ function ft(t) {
|
|
|
159
167
|
};
|
|
160
168
|
return i(n.database), t.events.documentActivated.addEventListener((l) => {
|
|
161
169
|
e.length = 0, i(l.doc.database);
|
|
162
|
-
}),
|
|
170
|
+
}), Ee().layoutManager.events.layoutSwitched.addEventListener(
|
|
163
171
|
(l) => {
|
|
164
172
|
const o = l.newLayout;
|
|
165
173
|
e.forEach((a) => {
|
|
@@ -168,47 +176,6 @@ function ft(t) {
|
|
|
168
176
|
}
|
|
169
177
|
), e;
|
|
170
178
|
}
|
|
171
|
-
function $e() {
|
|
172
|
-
const t = W(/* @__PURE__ */ new Map()), e = W(/* @__PURE__ */ new Map()), n = () => {
|
|
173
|
-
const i = D.instance.curView.missedData, l = Y.instance.fontMapping;
|
|
174
|
-
t.clear(), Object.keys(i.fonts).forEach((o) => {
|
|
175
|
-
const a = l[o];
|
|
176
|
-
t.set(o, a || "");
|
|
177
|
-
}), e.clear(), i.images.forEach((o, a) => {
|
|
178
|
-
const s = e.get(o);
|
|
179
|
-
s ? s.ids.add(a) : e.set(o, {
|
|
180
|
-
fileName: o,
|
|
181
|
-
ids: /* @__PURE__ */ new Set([a])
|
|
182
|
-
});
|
|
183
|
-
});
|
|
184
|
-
};
|
|
185
|
-
return D.instance.events.documentActivated.addEventListener(() => {
|
|
186
|
-
n();
|
|
187
|
-
}), j.on("font-not-found", (i) => {
|
|
188
|
-
n();
|
|
189
|
-
}), {
|
|
190
|
-
fonts: t,
|
|
191
|
-
images: e
|
|
192
|
-
};
|
|
193
|
-
}
|
|
194
|
-
function ce() {
|
|
195
|
-
const t = W(
|
|
196
|
-
Y.instance.settings
|
|
197
|
-
);
|
|
198
|
-
return Y.instance.events.modified.addEventListener((e) => {
|
|
199
|
-
t[e.key] = e.value;
|
|
200
|
-
}), t;
|
|
201
|
-
}
|
|
202
|
-
function ht(t) {
|
|
203
|
-
const e = W({}), n = t.curDocument, i = (l) => {
|
|
204
|
-
e.pdmode = l.pdmode, e.pdmode = l.pdsize;
|
|
205
|
-
};
|
|
206
|
-
return i(n.database), n.database.events.headerSysVarChanged.addEventListener((l) => {
|
|
207
|
-
e[l.name] = l.database[l.name];
|
|
208
|
-
}), t.events.documentActivated.addEventListener((l) => {
|
|
209
|
-
i(l.doc.database);
|
|
210
|
-
}), e;
|
|
211
|
-
}
|
|
212
179
|
const _t = {
|
|
213
180
|
ACAD: {
|
|
214
181
|
csvg: "Converts current drawing to SVG",
|
|
@@ -425,11 +392,11 @@ const _t = {
|
|
|
425
392
|
dimstyle: "Parsing dimension styles ...",
|
|
426
393
|
layer: "Parsing layers ...",
|
|
427
394
|
vport: "Parsing viewports ...",
|
|
428
|
-
blockrecord: "
|
|
395
|
+
blockrecord: "Parsing block record ...",
|
|
429
396
|
header: "Parsing header ...",
|
|
430
397
|
block: "Parsing blocks ...",
|
|
431
398
|
entity: "Parsing entities ...",
|
|
432
|
-
object: "
|
|
399
|
+
object: "Parsing named dictionaries ...",
|
|
433
400
|
end: "Finished!"
|
|
434
401
|
},
|
|
435
402
|
verticalToolbar: {
|
|
@@ -831,7 +798,7 @@ const _t = {
|
|
|
831
798
|
const e = J.global.t, n = "main.progress." + t.replace(/_/g, "").toLowerCase();
|
|
832
799
|
return e(n, t);
|
|
833
800
|
}, me = "preferred_lang";
|
|
834
|
-
function
|
|
801
|
+
function $e(t) {
|
|
835
802
|
const { locale: e } = N(), i = x((() => {
|
|
836
803
|
const r = localStorage.getItem(me);
|
|
837
804
|
return r === "en" || r === "zh" ? r : navigator.language.toLowerCase().substring(0, 2) === "zh" ? "zh" : "en";
|
|
@@ -865,19 +832,60 @@ function Ve(t) {
|
|
|
865
832
|
isControlled: k(() => !!(t && t !== "default"))
|
|
866
833
|
};
|
|
867
834
|
}
|
|
868
|
-
|
|
835
|
+
function Ve() {
|
|
836
|
+
const t = W(/* @__PURE__ */ new Map()), e = W(/* @__PURE__ */ new Map()), n = () => {
|
|
837
|
+
const i = D.instance.curView.missedData, l = Y.instance.fontMapping;
|
|
838
|
+
t.clear(), Object.keys(i.fonts).forEach((o) => {
|
|
839
|
+
const a = l[o];
|
|
840
|
+
t.set(o, a || "");
|
|
841
|
+
}), e.clear(), i.images.forEach((o, a) => {
|
|
842
|
+
const s = e.get(o);
|
|
843
|
+
s ? s.ids.add(a) : e.set(o, {
|
|
844
|
+
fileName: o,
|
|
845
|
+
ids: /* @__PURE__ */ new Set([a])
|
|
846
|
+
});
|
|
847
|
+
});
|
|
848
|
+
};
|
|
849
|
+
return D.instance.events.documentActivated.addEventListener(() => {
|
|
850
|
+
n();
|
|
851
|
+
}), j.on("font-not-found", (i) => {
|
|
852
|
+
n();
|
|
853
|
+
}), {
|
|
854
|
+
fonts: t,
|
|
855
|
+
images: e
|
|
856
|
+
};
|
|
857
|
+
}
|
|
858
|
+
function ce() {
|
|
859
|
+
const t = W(
|
|
860
|
+
Y.instance.settings
|
|
861
|
+
);
|
|
862
|
+
return Y.instance.events.modified.addEventListener((e) => {
|
|
863
|
+
t[e.key] = e.value;
|
|
864
|
+
}), t;
|
|
865
|
+
}
|
|
866
|
+
function Tt(t) {
|
|
867
|
+
const e = W({}), n = t.curDocument, i = (l) => {
|
|
868
|
+
e.pdmode = l.pdmode, e.pdmode = l.pdsize;
|
|
869
|
+
};
|
|
870
|
+
return i(n.database), n.database.events.headerSysVarChanged.addEventListener((l) => {
|
|
871
|
+
e[l.name] = l.database[l.name];
|
|
872
|
+
}), t.events.documentActivated.addEventListener((l) => {
|
|
873
|
+
i(l.doc.database);
|
|
874
|
+
}), e;
|
|
875
|
+
}
|
|
876
|
+
class Et extends re {
|
|
869
877
|
execute(e) {
|
|
870
878
|
const { toggleDialog: n } = oe();
|
|
871
879
|
n("ReplacementDlg", !0);
|
|
872
880
|
}
|
|
873
881
|
}
|
|
874
|
-
class
|
|
882
|
+
class $t extends re {
|
|
875
883
|
execute(e) {
|
|
876
884
|
const { toggleDialog: n } = oe();
|
|
877
885
|
n("PointStyleDlg", !0);
|
|
878
886
|
}
|
|
879
887
|
}
|
|
880
|
-
const
|
|
888
|
+
const Vt = /* @__PURE__ */ L({
|
|
881
889
|
__name: "MlBaseDialog",
|
|
882
890
|
props: {
|
|
883
891
|
title: {
|
|
@@ -958,7 +966,7 @@ const $t = /* @__PURE__ */ L({
|
|
|
958
966
|
for (const [i, l] of e)
|
|
959
967
|
n[i] = l;
|
|
960
968
|
return n;
|
|
961
|
-
}, Ae = /* @__PURE__ */ R(
|
|
969
|
+
}, Ae = /* @__PURE__ */ R(Vt, [["__scopeId", "data-v-8df470d5"]]), At = /* @__PURE__ */ L({
|
|
962
970
|
__name: "MlDialogManager",
|
|
963
971
|
setup(t, { expose: e }) {
|
|
964
972
|
const { dialogs: n, toggleDialog: i, registerDialog: l } = oe();
|
|
@@ -974,20 +982,11 @@ const $t = /* @__PURE__ */ L({
|
|
|
974
982
|
}, { ref_for: !0 }, s.props), null, 16, ["modelValue", "onUpdate:modelValue"]))
|
|
975
983
|
]))), 128));
|
|
976
984
|
}
|
|
977
|
-
})
|
|
978
|
-
function At() {
|
|
979
|
-
const t = x(/* @__PURE__ */ new Set()), e = Ee.instance;
|
|
980
|
-
for (const n of e.fileTypes)
|
|
981
|
-
t.value.add(n);
|
|
982
|
-
return e.events.registered.addEventListener((n) => {
|
|
983
|
-
t.value.add(n.fileType);
|
|
984
|
-
}), t;
|
|
985
|
-
}
|
|
986
|
-
const Ft = ["accept"], It = /* @__PURE__ */ L({
|
|
985
|
+
}), Ft = ["accept"], It = /* @__PURE__ */ L({
|
|
987
986
|
__name: "MlFileReader",
|
|
988
987
|
emits: ["file-read"],
|
|
989
988
|
setup(t, { emit: e }) {
|
|
990
|
-
const n = e, i = x(null), l =
|
|
989
|
+
const n = e, i = x(null), l = gt(), o = k(() => {
|
|
991
990
|
const s = Array.from(l.value);
|
|
992
991
|
let r = "";
|
|
993
992
|
for (let c = 0, f = s.length; c < f; ++c)
|
|
@@ -1060,7 +1059,7 @@ const Ft = ["accept"], It = /* @__PURE__ */ L({
|
|
|
1060
1059
|
}), Fe = /* @__PURE__ */ R(Pt, [["__scopeId", "data-v-48d6b055"]]), Nt = /* @__PURE__ */ L({
|
|
1061
1060
|
__name: "MlReplacementDlg",
|
|
1062
1061
|
setup(t) {
|
|
1063
|
-
const { t: e } = N(), { fonts: n, images: i } =
|
|
1062
|
+
const { t: e } = N(), { fonts: n, images: i } = Ve(), l = x(!0), o = k(() => n.size > 0 ? "font" : "image"), a = x(null), s = k(() => D.instance.avaiableFonts.map((h) => h.name[0])), r = () => {
|
|
1064
1063
|
const g = D.instance.curDocument.database;
|
|
1065
1064
|
i.forEach((_) => {
|
|
1066
1065
|
_.file && _.ids.forEach((y) => {
|
|
@@ -1563,7 +1562,7 @@ function so(t, e) {
|
|
|
1563
1562
|
const co = { render: so }, uo = /* @__PURE__ */ L({
|
|
1564
1563
|
__name: "MlPointStyleDlg",
|
|
1565
1564
|
setup(t) {
|
|
1566
|
-
const { t: e } = N(), n =
|
|
1565
|
+
const { t: e } = N(), n = Tt(D.instance), i = x(!0), l = x(0), o = [
|
|
1567
1566
|
[
|
|
1568
1567
|
{ id: 0, icon: an },
|
|
1569
1568
|
{ id: 1, icon: cn },
|
|
@@ -2247,7 +2246,7 @@ const Wo = (t) => (ze("data-v-11a64c54"), t = t(), Be(), t), Uo = /* @__PURE__ *
|
|
|
2247
2246
|
editor: {}
|
|
2248
2247
|
},
|
|
2249
2248
|
setup(t) {
|
|
2250
|
-
const { t: e } = N(), n = t, i =
|
|
2249
|
+
const { t: e } = N(), n = t, i = ft(n.editor), l = x(), o = x([]), a = (r) => {
|
|
2251
2250
|
o.value = r;
|
|
2252
2251
|
}, s = (r) => {
|
|
2253
2252
|
const c = n.editor.curDocument.database.tables.layerTable.getAt(
|
|
@@ -2339,7 +2338,7 @@ const Wo = (t) => (ze("data-v-11a64c54"), t = t(), Be(), t), Uo = /* @__PURE__ *
|
|
|
2339
2338
|
}), nl = /* @__PURE__ */ R(tl, [["__scopeId", "data-v-d49ba2cb"]]), ol = { class: "autocomplete-container" }, ll = /* @__PURE__ */ L({
|
|
2340
2339
|
__name: "MlCommandLine",
|
|
2341
2340
|
setup(t) {
|
|
2342
|
-
const { t: e } = N(), n = ce(), i =
|
|
2341
|
+
const { t: e } = N(), n = ce(), i = ct(), l = x(""), o = x(""), a = (c, f) => {
|
|
2343
2342
|
const b = c ? i.filter(
|
|
2344
2343
|
(g) => g.commandName.startsWith(c.toLowerCase())
|
|
2345
2344
|
) : i;
|
|
@@ -2527,7 +2526,7 @@ const Wo = (t) => (ze("data-v-11a64c54"), t = t(), Be(), t), Uo = /* @__PURE__ *
|
|
|
2527
2526
|
currentLocale: { default: void 0 }
|
|
2528
2527
|
},
|
|
2529
2528
|
setup(t) {
|
|
2530
|
-
const e = t, { effectiveLocale: n, setLocale: i } =
|
|
2529
|
+
const e = t, { effectiveLocale: n, setLocale: i } = $e(e.currentLocale), l = W([
|
|
2531
2530
|
{
|
|
2532
2531
|
name: "en",
|
|
2533
2532
|
text: "English"
|
|
@@ -2912,7 +2911,7 @@ const kl = /* @__PURE__ */ L({
|
|
|
2912
2911
|
setup(t) {
|
|
2913
2912
|
const e = () => {
|
|
2914
2913
|
D.instance.sendStringToExecute("md");
|
|
2915
|
-
}, { fonts: n, images: i } =
|
|
2914
|
+
}, { fonts: n, images: i } = Ve(), l = k(() => i.size > 0 || n.size > 0);
|
|
2916
2915
|
return (o, a) => {
|
|
2917
2916
|
const s = M("el-button");
|
|
2918
2917
|
return l.value ? (u(), C(s, {
|
|
@@ -2927,8 +2926,8 @@ const kl = /* @__PURE__ */ L({
|
|
|
2927
2926
|
}), Il = /* @__PURE__ */ R(Fl, [["__scopeId", "data-v-3411a3ec"]]), Pl = /* @__PURE__ */ L({
|
|
2928
2927
|
__name: "MlStatusBar",
|
|
2929
2928
|
setup(t) {
|
|
2930
|
-
const { text: e } =
|
|
2931
|
-
|
|
2929
|
+
const { text: e } = ut(D.instance.curView), n = ht(D.instance), i = ce(), l = (o) => {
|
|
2930
|
+
Ee().layoutManager.setCurrentLayoutBtrId(
|
|
2932
2931
|
o.blockTableRecordId
|
|
2933
2932
|
);
|
|
2934
2933
|
};
|
|
@@ -2991,7 +2990,7 @@ const kl = /* @__PURE__ */ L({
|
|
|
2991
2990
|
const c = ve.service({
|
|
2992
2991
|
lock: !0,
|
|
2993
2992
|
text: i("main.message.loadingDwgConverter")
|
|
2994
|
-
}), f = () =>
|
|
2993
|
+
}), f = () => Te.instance.get(
|
|
2995
2994
|
qe.DWG
|
|
2996
2995
|
) ? (c.close(), r(), !0) : !1;
|
|
2997
2996
|
if (f())
|
|
@@ -3006,7 +3005,7 @@ const kl = /* @__PURE__ */ L({
|
|
|
3006
3005
|
`DWG converter loading timeout after ${e.wait} seconds - proceeding anyway`
|
|
3007
3006
|
), c.close(), clearInterval(h), r());
|
|
3008
3007
|
}, 500);
|
|
3009
|
-
}), { t: i } = N(), { effectiveLocale: l, elementPlusLocale: o } =
|
|
3008
|
+
}), { t: i } = N(), { effectiveLocale: l, elementPlusLocale: o } = $e(e.locale), a = async (r, c) => {
|
|
3010
3009
|
const f = { minimumChunkSize: 1e3 };
|
|
3011
3010
|
await D.instance.openDocument(r, c, f), Q.fileName = r;
|
|
3012
3011
|
}, s = async (r) => {
|
|
@@ -3077,7 +3076,7 @@ const kl = /* @__PURE__ */ L({
|
|
|
3077
3076
|
v(m(nl), {
|
|
3078
3077
|
editor: m(D).instance
|
|
3079
3078
|
}, null, 8, ["editor"]),
|
|
3080
|
-
v(m(
|
|
3079
|
+
v(m(At))
|
|
3081
3080
|
]),
|
|
3082
3081
|
d("footer", null, [
|
|
3083
3082
|
v(m(al)),
|
|
@@ -3106,12 +3105,12 @@ const kl = /* @__PURE__ */ L({
|
|
|
3106
3105
|
q.SYSTEMT_COMMAND_GROUP_NAME,
|
|
3107
3106
|
"md",
|
|
3108
3107
|
"md",
|
|
3109
|
-
new
|
|
3108
|
+
new Et()
|
|
3110
3109
|
), q.instance.addCommand(
|
|
3111
3110
|
q.SYSTEMT_COMMAND_GROUP_NAME,
|
|
3112
3111
|
"pttype",
|
|
3113
3112
|
"pttype",
|
|
3114
|
-
new
|
|
3113
|
+
new $t()
|
|
3115
3114
|
);
|
|
3116
3115
|
}, Rl = () => {
|
|
3117
3116
|
Se({
|
|
@@ -3137,12 +3136,12 @@ const kl = /* @__PURE__ */ L({
|
|
|
3137
3136
|
export {
|
|
3138
3137
|
rt as AcApLayerStateCmd,
|
|
3139
3138
|
st as AcApLogCmd,
|
|
3140
|
-
|
|
3141
|
-
|
|
3139
|
+
Et as AcApMissedDataCmd,
|
|
3140
|
+
$t as AcApPointStyleCmd,
|
|
3142
3141
|
Ae as MlBaseDialog,
|
|
3143
3142
|
ua as MlCadViewer,
|
|
3144
3143
|
al as MlCommandLine,
|
|
3145
|
-
|
|
3144
|
+
At as MlDialogManager,
|
|
3146
3145
|
rl as MlEntityInfo,
|
|
3147
3146
|
It as MlFileReader,
|
|
3148
3147
|
cl as MlLanguageSelector,
|
|
@@ -3164,14 +3163,15 @@ export {
|
|
|
3164
3163
|
Q as store,
|
|
3165
3164
|
sa as sysCmdDescription,
|
|
3166
3165
|
dt as toggleDark,
|
|
3167
|
-
|
|
3168
|
-
|
|
3166
|
+
ct as useCommands,
|
|
3167
|
+
ut as useCurrentPos,
|
|
3169
3168
|
oe as useDialogManager,
|
|
3170
|
-
gt as
|
|
3171
|
-
ft as
|
|
3172
|
-
|
|
3173
|
-
$e as
|
|
3169
|
+
gt as useFileTypes,
|
|
3170
|
+
ft as useLayers,
|
|
3171
|
+
ht as useLayouts,
|
|
3172
|
+
$e as useLocale,
|
|
3173
|
+
Ve as useMissedData,
|
|
3174
3174
|
ce as useSettings,
|
|
3175
|
-
|
|
3175
|
+
Tt as useSystemVars,
|
|
3176
3176
|
ca as userCmdDescription
|
|
3177
3177
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mlightcad/cad-viewer",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
"vite-svg-loader": "^5.1.0",
|
|
43
43
|
"vue-eslint-parser": "^9.4.3",
|
|
44
44
|
"vue-tsc": "^2.1.6",
|
|
45
|
-
"@mlightcad/
|
|
46
|
-
"@mlightcad/
|
|
45
|
+
"@mlightcad/three-renderer": "1.0.3",
|
|
46
|
+
"@mlightcad/svg-renderer": "0.0.4"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
49
|
"@element-plus/icons-vue": "^2.3.1",
|
|
@@ -51,12 +51,12 @@
|
|
|
51
51
|
"three": "^0.172.0"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
54
|
-
"@mlightcad/data-model": "1.1.
|
|
54
|
+
"@mlightcad/data-model": "1.1.5",
|
|
55
55
|
"@vueuse/core": "^11.1.0",
|
|
56
56
|
"element-plus": "^2.9.1",
|
|
57
57
|
"vue": "^3.4.21",
|
|
58
58
|
"vue-i18n": "^10.0.1",
|
|
59
|
-
"@mlightcad/cad-simple-viewer": "1.0.
|
|
59
|
+
"@mlightcad/cad-simple-viewer": "1.0.3"
|
|
60
60
|
},
|
|
61
61
|
"scripts": {
|
|
62
62
|
"analyze": "vite build --mode analyze",
|