@mlightcad/cad-viewer 1.0.16 → 1.0.18

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.
@@ -1 +1 @@
1
- {"version":3,"file":"useCurrentPos.d.ts","sourceRoot":"","sources":["../../src/composable/useCurrentPos.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAsB,MAAM,8BAA8B,CAAA;AAS/E,wBAAgB,aAAa,CAAC,IAAI,EAAE,YAAY;;;;EAsB/C"}
1
+ {"version":3,"file":"useCurrentPos.d.ts","sourceRoot":"","sources":["../../src/composable/useCurrentPos.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAsB,MAAM,8BAA8B,CAAA;AAqB/E,wBAAgB,aAAa,CAAC,IAAI,EAAE,YAAY;;;;EAsB/C"}
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import "./index.css";
2
2
  import { AcEdCommandStack as q, AcApDocManager as B, eventBus as j, AcApSettingManager as Y, AcApConvertToSvgCmd as Ie, AcApQNewCmd as Fe, AcApOpenCmd as Pe, registerConverters as Re, AcEdCommand as re } from "@mlightcad/cad-simple-viewer";
3
3
  import "element-plus/dist/index.css";
4
- import { reactive as W, computed as k, defineComponent as L, onMounted as N, resolveComponent as M, createBlock as C, openBlock as u, unref as m, withCtx as p, renderSlot as ie, createVNode as v, createTextVNode as I, toDisplayString as D, createElementVNode as d, ref as b, onUnmounted as ee, watch as E, createElementBlock as w, Fragment as K, renderList as X, resolveDynamicComponent as ve, mergeProps as Oe, mergeModels as Z, useCssVars as Ce, useModel as ge, createCommentVNode as U, normalizeStyle as pe, normalizeClass as Le, pushScopeId as ze, popScopeId as De, onBeforeUnmount as Be, withKeys as Ne, isRef as He, markRaw as he } from "vue";
4
+ import { reactive as W, computed as k, defineComponent as L, onMounted as O, resolveComponent as M, createBlock as C, openBlock as u, unref as m, withCtx as p, renderSlot as ie, createVNode as v, createTextVNode as I, toDisplayString as D, createElementVNode as d, ref as b, onUnmounted as ee, watch as E, createElementBlock as w, Fragment as K, renderList as X, resolveDynamicComponent as ve, mergeProps as Ne, mergeModels as Z, useCssVars as Ce, useModel as ge, createCommentVNode as U, normalizeStyle as pe, normalizeClass as Le, pushScopeId as ze, popScopeId as De, onBeforeUnmount as Be, withKeys as Oe, isRef as He, markRaw as he } from "vue";
5
5
  import { AcDbDatabaseConverterManager as Ge, acdbHostApplicationServices as Te, AcCmPerformanceCollector 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";
@@ -69,7 +69,7 @@ const ut = /* @__PURE__ */ L({
69
69
  function r() {
70
70
  l("cancel"), l("update:modelValue", !1);
71
71
  }
72
- return N(() => {
72
+ return O(() => {
73
73
  o({
74
74
  name: i.name,
75
75
  component: "BaseDialog",
@@ -129,18 +129,25 @@ function dt() {
129
129
  (n, i) => n.commandName.toLowerCase().localeCompare(i.commandName.toLowerCase())
130
130
  ), t;
131
131
  }
132
- const ye = new Intl.NumberFormat("en-US", {
133
- style: "decimal",
134
- minimumFractionDigits: 2,
135
- maximumFractionDigits: 2
136
- });
132
+ function ye(t, e = "en-US") {
133
+ const n = Math.abs(t);
134
+ if (n !== 0 && (n < 1e-3 || n >= 1e6)) {
135
+ const [i, l] = t.toExponential(3).split("e");
136
+ return `${new Intl.NumberFormat(e, {
137
+ maximumFractionDigits: 3
138
+ }).format(Number(i))}e${l}`;
139
+ } else
140
+ return new Intl.NumberFormat(e, {
141
+ maximumFractionDigits: 6
142
+ }).format(t);
143
+ }
137
144
  function mt(t) {
138
145
  const e = b(0), n = b(0);
139
146
  function i(o) {
140
147
  e.value = o.x, n.value = o.y;
141
148
  }
142
- N(() => t.events.mouseMove.addEventListener(i)), ee(() => t.events.mouseMove.removeEventListener(i));
143
- const l = k(() => `${ye.format(e.value)}, ${ye.format(n.value)}`);
149
+ O(() => t.events.mouseMove.addEventListener(i)), ee(() => t.events.mouseMove.removeEventListener(i));
150
+ const l = k(() => `${ye(e.value)}, ${ye(n.value)}`);
144
151
  return { x: e, y: n, text: l };
145
152
  }
146
153
  const ae = We(), pt = Ue(ae);
@@ -199,7 +206,7 @@ function ft(t) {
199
206
  e.length = 0, i(l.doc.database);
200
207
  }), Te().layoutManager.events.layoutSwitched.addEventListener(
201
208
  (l) => {
202
- const o = l.newLayout;
209
+ const o = l.layout;
203
210
  e.forEach((a) => {
204
211
  a.name == o.layoutName ? a.isActive = !0 : a.isActive = !1;
205
212
  });
@@ -846,7 +853,7 @@ const ht = {
846
853
  const e = J.global.t, n = "main.progress." + t.replace(/_/g, "").toLowerCase();
847
854
  return e(n, t);
848
855
  }, me = "preferred_lang";
849
- function Ve(t) {
856
+ function $e(t) {
850
857
  const { locale: e } = R(), i = b((() => {
851
858
  const s = localStorage.getItem(me);
852
859
  return s === "en" || s === "zh" ? s : navigator.language.toLowerCase().substring(0, 2) === "zh" ? "zh" : "en";
@@ -880,7 +887,7 @@ function Ve(t) {
880
887
  isControlled: k(() => !!(t && t !== "default"))
881
888
  };
882
889
  }
883
- function $e() {
890
+ function Ve() {
884
891
  const t = W(/* @__PURE__ */ new Map()), e = W(/* @__PURE__ */ new Map()), n = () => {
885
892
  const i = B.instance.curView.missedData, l = Y.instance.fontMapping;
886
893
  t.clear(), Object.keys(i.fonts).forEach((o) => {
@@ -931,13 +938,13 @@ const Tt = /* @__PURE__ */ L({
931
938
  }), (o, a) => (u(!0), w(K, null, X(m(n), (r) => (u(), w("div", {
932
939
  key: r.name
933
940
  }, [
934
- (u(), C(ve(r.component), Oe({
941
+ (u(), C(ve(r.component), Ne({
935
942
  modelValue: r.visible,
936
943
  "onUpdate:modelValue": (s) => r.visible = s
937
944
  }, { ref_for: !0 }, r.props), null, 16, ["modelValue", "onUpdate:modelValue"]))
938
945
  ]))), 128));
939
946
  }
940
- }), Et = ["accept"], Vt = /* @__PURE__ */ L({
947
+ }), Et = ["accept"], $t = /* @__PURE__ */ L({
941
948
  __name: "MlFileReader",
942
949
  emits: ["file-read"],
943
950
  setup(t, { emit: e }) {
@@ -948,7 +955,7 @@ const Tt = /* @__PURE__ */ L({
948
955
  c == f - 1 ? s += `.${r[c]}` : s += `.${r[c]}, `;
949
956
  return s;
950
957
  });
951
- N(() => {
958
+ O(() => {
952
959
  j.on("open-file", () => {
953
960
  var r;
954
961
  (r = i.value) == null || r.click();
@@ -977,7 +984,7 @@ const Tt = /* @__PURE__ */ L({
977
984
  onChange: a
978
985
  }, null, 40, Et));
979
986
  }
980
- }), $t = /* @__PURE__ */ L({
987
+ }), Vt = /* @__PURE__ */ L({
981
988
  __name: "MlToggleButton",
982
989
  props: /* @__PURE__ */ Z({
983
990
  size: { default: 30 },
@@ -1011,10 +1018,10 @@ const Tt = /* @__PURE__ */ L({
1011
1018
  }, 8, ["content"]);
1012
1019
  };
1013
1020
  }
1014
- }), Ae = /* @__PURE__ */ H($t, [["__scopeId", "data-v-48d6b055"]]), At = /* @__PURE__ */ L({
1021
+ }), Ae = /* @__PURE__ */ H(Vt, [["__scopeId", "data-v-48d6b055"]]), At = /* @__PURE__ */ L({
1015
1022
  __name: "MlReplacementDlg",
1016
1023
  setup(t) {
1017
- const { t: e } = R(), { fonts: n, images: i } = $e(), l = b(!0), o = k(() => n.size > 0 ? "font" : "image"), a = b(null), r = k(() => B.instance.avaiableFonts.map((h) => h.name[0])), s = () => {
1024
+ const { t: e } = R(), { fonts: n, images: i } = Ve(), l = b(!0), o = k(() => n.size > 0 ? "font" : "image"), a = b(null), r = k(() => B.instance.avaiableFonts.map((h) => h.name[0])), s = () => {
1018
1025
  const g = B.instance.curDocument.database;
1019
1026
  i.forEach((_) => {
1020
1027
  _.file && _.ids.forEach((y) => {
@@ -1040,7 +1047,7 @@ const Tt = /* @__PURE__ */ L({
1040
1047
  n.set(g, h);
1041
1048
  };
1042
1049
  return (g, h) => {
1043
- const _ = M("el-col"), y = M("el-row"), S = M("el-option"), V = M("el-select"), F = M("el-tab-pane"), $ = M("el-table-column"), T = M("el-button"), G = M("el-table"), P = M("el-tabs");
1050
+ const _ = M("el-col"), y = M("el-row"), S = M("el-option"), $ = M("el-select"), F = M("el-tab-pane"), V = M("el-table-column"), T = M("el-button"), G = M("el-table"), P = M("el-tabs");
1044
1051
  return u(), C(Ee, {
1045
1052
  title: m(e)("dialog.replacementDlg.title"),
1046
1053
  modelValue: l.value,
@@ -1092,17 +1099,17 @@ const Tt = /* @__PURE__ */ L({
1092
1099
  }, 1024),
1093
1100
  v(_, { span: 12 }, {
1094
1101
  default: p(() => [
1095
- v(V, {
1102
+ v($, {
1096
1103
  "model-value": A,
1097
1104
  placeholder: m(e)("dialog.replacementDlg.selectFont"),
1098
- "onUpdate:modelValue": (O) => x(z, O),
1105
+ "onUpdate:modelValue": (N) => x(z, N),
1099
1106
  style: { width: "100%" }
1100
1107
  }, {
1101
1108
  default: p(() => [
1102
- (u(!0), w(K, null, X(r.value, (O, de) => (u(), C(S, {
1109
+ (u(!0), w(K, null, X(r.value, (N, de) => (u(), C(S, {
1103
1110
  key: de,
1104
- label: O,
1105
- value: O
1111
+ label: N,
1112
+ value: N
1106
1113
  }, null, 8, ["label", "value"]))), 128))
1107
1114
  ]),
1108
1115
  _: 2
@@ -1129,13 +1136,13 @@ const Tt = /* @__PURE__ */ L({
1129
1136
  "v-show": !1
1130
1137
  }, {
1131
1138
  default: p(() => [
1132
- v($, {
1139
+ v(V, {
1133
1140
  label: m(e)("dialog.replacementDlg.file"),
1134
1141
  prop: "fileName",
1135
1142
  "min-width": 0,
1136
1143
  flex: 1
1137
1144
  }, null, 8, ["label"]),
1138
- v($, {
1145
+ v(V, {
1139
1146
  label: m(e)("dialog.replacementDlg.replace"),
1140
1147
  fixed: "right",
1141
1148
  width: "60"
@@ -1218,14 +1225,14 @@ function Rt(t, e) {
1218
1225
  }, null, -1)
1219
1226
  ]));
1220
1227
  }
1221
- const Ot = { render: Rt }, Nt = {
1228
+ const Nt = { render: Rt }, Ot = {
1222
1229
  xmlns: "http://www.w3.org/2000/svg",
1223
1230
  width: "1em",
1224
1231
  height: "1em",
1225
1232
  viewBox: "0 0 20 20"
1226
1233
  };
1227
1234
  function Ht(t, e) {
1228
- return u(), w("svg", Nt, e[0] || (e[0] = [
1235
+ return u(), w("svg", Ot, e[0] || (e[0] = [
1229
1236
  d("path", { d: "m15.08 12.854.002-.002V5.59c0-.422-.652-.414-.652 0v3.466c0 .938-1.482.95-1.482 0v-4.83c0-.414-.638-.414-.638 0h-.014v4.83c.014.95-1.482.95-1.482 0V3.444c0-.42-.638-.414-.638 0v5.612c0 .95-1.494.95-1.494 0V4.232c0-.408-.64-.42-.64 0v6.756c0 .802-1.094 1.088-1.494.388q-.39-.669-.776-1.338c-.338-.482-1.1-.15-.794.38l.978 1.698.02.04q.829 1.418 1.658 2.834c.19.3.422.578.666.802h-.006c.672.61 1.528.964 2.418 1.052.888.06 1.792-.124 2.56-.612q.45-.285.816-.68a4 4 0 0 0 .734-1.204c.176-.482.258-.97.258-1.494m-.91-8.608-.004-.002c.958-.38 2.058.244 2.058 1.346v7.266c0 .652-.108 1.29-.332 1.894a4.8 4.8 0 0 1-.964 1.576 5.9 5.9 0 0 1-1.046.884c-.978.612-2.146.862-3.26.774a5.34 5.34 0 0 1-3.098-1.352 5.4 5.4 0 0 1-.87-1.034l-1.672-2.88-.012-.028-.978-1.706c-.59-1.018.068-2.186 1.156-2.336.536-.074 1.126.116 1.562.72.026.028.04.062.054.096q.061.11.122.218V4.234c0-1.176 1.244-1.788 2.202-1.278.42-1.278 2.378-1.264 2.792-.014.972-.51 2.222.102 2.222 1.284v.06z" }, null, -1)
1230
1237
  ]));
1231
1238
  }
@@ -1399,18 +1406,18 @@ function Tn(t, e) {
1399
1406
  d("path", { d: "M17 3v14H3V3zm1-1H2v16h16z" }, null, -1)
1400
1407
  ]));
1401
1408
  }
1402
- const En = { render: Tn }, Vn = {
1409
+ const En = { render: Tn }, $n = {
1403
1410
  xmlns: "http://www.w3.org/2000/svg",
1404
1411
  width: "1em",
1405
1412
  height: "1em",
1406
1413
  viewBox: "0 0 20 20"
1407
1414
  };
1408
- function $n(t, e) {
1409
- return u(), w("svg", Vn, e[0] || (e[0] = [
1415
+ function Vn(t, e) {
1416
+ return u(), w("svg", $n, e[0] || (e[0] = [
1410
1417
  d("path", { d: "M17 3v14H3V3zm1-1H2v16h16z" }, null, -1)
1411
1418
  ]));
1412
1419
  }
1413
- const An = { render: $n }, In = {
1420
+ const An = { render: Vn }, In = {
1414
1421
  xmlns: "http://www.w3.org/2000/svg",
1415
1422
  width: "1em",
1416
1423
  height: "1em",
@@ -1429,14 +1436,14 @@ const Pn = { render: Fn }, Rn = {
1429
1436
  height: "1em",
1430
1437
  viewBox: "0 0 20 20"
1431
1438
  };
1432
- function On(t, e) {
1439
+ function Nn(t, e) {
1433
1440
  return u(), w("svg", Rn, e[0] || (e[0] = [
1434
1441
  d("path", { d: "M17 3.08v14H3v-14zm1-1H2v16h16z" }, null, -1),
1435
1442
  d("path", { d: "m2.146 2.851.707-.707 14.998 14.998-.707.707z" }, null, -1),
1436
1443
  d("path", { d: "M2.146 17.149 17.144 2.15l.707.707L2.853 17.856z" }, null, -1)
1437
1444
  ]));
1438
1445
  }
1439
- const Nn = { render: On }, Hn = {
1446
+ const On = { render: Nn }, Hn = {
1440
1447
  xmlns: "http://www.w3.org/2000/svg",
1441
1448
  width: "1em",
1442
1449
  height: "1em",
@@ -1536,7 +1543,7 @@ const ao = { render: lo }, io = /* @__PURE__ */ L({
1536
1543
  { id: 64, icon: En },
1537
1544
  { id: 65, icon: An },
1538
1545
  { id: 66, icon: Pn },
1539
- { id: 67, icon: Nn },
1546
+ { id: 67, icon: On },
1540
1547
  { id: 68, icon: qn }
1541
1548
  ],
1542
1549
  [
@@ -1569,22 +1576,22 @@ const ao = { render: lo }, io = /* @__PURE__ */ L({
1569
1576
  onCancel: f
1570
1577
  }, {
1571
1578
  default: p(() => [
1572
- (u(), w(K, null, X(o, (S, V) => v(y, {
1573
- key: V,
1579
+ (u(), w(K, null, X(o, (S, $) => v(y, {
1580
+ key: $,
1574
1581
  style: { "margin-top": "10px" },
1575
1582
  gutter: 6,
1576
1583
  justify: "space-between"
1577
1584
  }, {
1578
1585
  default: p(() => [
1579
- (u(!0), w(K, null, X(S, (F, $) => (u(), C(_, {
1580
- key: $,
1586
+ (u(!0), w(K, null, X(S, (F, V) => (u(), C(_, {
1587
+ key: V,
1581
1588
  span: 4
1582
1589
  }, {
1583
1590
  default: p(() => [
1584
1591
  v(h, {
1585
1592
  icon: F.icon,
1586
- type: r(V, $),
1587
- onClick: (T) => s(V, $),
1593
+ type: r($, V),
1594
+ onClick: (T) => s($, V),
1588
1595
  style: { "font-size": "25px" }
1589
1596
  }, null, 8, ["icon", "type", "onClick"])
1590
1597
  ]),
@@ -1790,7 +1797,7 @@ const zo = /* @__PURE__ */ ue(ko, [["render", Lo], ["__scopeId", "data-v-d6a59cf
1790
1797
  class: Le(l.value)
1791
1798
  }, {
1792
1799
  default: p(() => [
1793
- (u(!0), w(K, null, X(f.items, (S, V) => (u(), C(_, {
1800
+ (u(!0), w(K, null, X(f.items, (S, $) => (u(), C(_, {
1794
1801
  key: S.text,
1795
1802
  content: r(S),
1796
1803
  "hide-after": 0
@@ -1799,7 +1806,7 @@ const zo = /* @__PURE__ */ ue(ko, [["render", Lo], ["__scopeId", "data-v-d6a59cf
1799
1806
  (u(), C(h, {
1800
1807
  class: "ml-toolbar-button",
1801
1808
  style: pe({ width: a.value + "px", height: a.value + "px" }),
1802
- key: V,
1809
+ key: $,
1803
1810
  onClick: (F) => c(S.command)
1804
1811
  }, {
1805
1812
  default: p(() => [
@@ -1837,7 +1844,7 @@ function Eo(t, e, n) {
1837
1844
  }, r = () => {
1838
1845
  e.value && e.value.removeEventListener("mousemove", o), t.value && t.value.removeEventListener("mousemove", o);
1839
1846
  };
1840
- return N(() => {
1847
+ return O(() => {
1841
1848
  window.addEventListener("mousemove", l);
1842
1849
  }), ee(() => {
1843
1850
  window.removeEventListener("mousemove", l);
@@ -1847,7 +1854,7 @@ function Eo(t, e, n) {
1847
1854
  s ? a() : r();
1848
1855
  }), { autoOpened: i };
1849
1856
  }
1850
- function Vo(t, e, n) {
1857
+ function $o(t, e, n) {
1851
1858
  const i = b(!1), l = b(null), o = b(null), a = { x: 0, y: 0 }, r = k(() => l.value == null || o.value == null ? { x: 0, y: 0 } : {
1852
1859
  x: l.value.x - o.value.x,
1853
1860
  y: l.value.y - o.value.y
@@ -1876,12 +1883,12 @@ function Vo(t, e, n) {
1876
1883
  }
1877
1884
  }, g = (_) => {
1878
1885
  if (i.value && o.value && l.value) {
1879
- const y = window.innerWidth, S = window.innerHeight, V = t.value, F = V.getBoundingClientRect(), $ = F.width, T = F.height, G = o.value.x + (_.clientX - a.x), P = o.value.y + (_.clientY - a.y);
1886
+ const y = window.innerWidth, S = window.innerHeight, $ = t.value, F = $.getBoundingClientRect(), V = F.width, T = F.height, G = o.value.x + (_.clientX - a.x), P = o.value.y + (_.clientY - a.y);
1880
1887
  l.value.x = Math.max(
1881
1888
  n ? n.value.offset.value.left : 0,
1882
1889
  G
1883
1890
  );
1884
- const z = y - $;
1891
+ const z = y - V;
1885
1892
  l.value.x = Math.min(
1886
1893
  n ? z - n.value.offset.value.right : z,
1887
1894
  l.value.x
@@ -1893,12 +1900,12 @@ function Vo(t, e, n) {
1893
1900
  l.value.y = Math.min(
1894
1901
  n ? A - n.value.offset.value.bottom : A,
1895
1902
  l.value.y
1896
- ), V.style.left = l.value.x + "px", V.style.top = l.value.y + "px";
1903
+ ), $.style.left = l.value.x + "px", $.style.top = l.value.y + "px";
1897
1904
  }
1898
1905
  }, h = () => {
1899
1906
  i.value = !1, document.removeEventListener("mousemove", g), document.removeEventListener("mouseup", h);
1900
1907
  };
1901
- return N(() => {
1908
+ return O(() => {
1902
1909
  t.value && (s(), c());
1903
1910
  }), ee(() => {
1904
1911
  t.value && t.value.removeEventListener("mousedown", x);
@@ -1910,8 +1917,8 @@ function Vo(t, e, n) {
1910
1917
  position: l
1911
1918
  };
1912
1919
  }
1913
- function $o(t, e, n) {
1914
- const i = b(!1), l = b("left"), { isDragging: o, movement: a, position: r } = Vo(
1920
+ function Vo(t, e, n) {
1921
+ const i = b(!1), l = b("left"), { isDragging: o, movement: a, position: r } = $o(
1915
1922
  t,
1916
1923
  e,
1917
1924
  n
@@ -1963,7 +1970,7 @@ function Fo(t, e = b({ left: 0, right: 0, top: 0, bottom: 0 })) {
1963
1970
  n.value.left = Math.max(o.left, e.value.left), n.value.top = Math.max(o.top, e.value.top), n.value.width = o.width, n.value.height = o.height, i = !0;
1964
1971
  }
1965
1972
  };
1966
- return N(() => {
1973
+ return O(() => {
1967
1974
  t.value && l();
1968
1975
  }), E(t, (o) => {
1969
1976
  o && l();
@@ -1975,10 +1982,10 @@ function Fo(t, e = b({ left: 0, right: 0, top: 0, bottom: 0 })) {
1975
1982
  function Po(t, e = b(!1), n = b(!1), i = b({ left: 0, right: 0, top: 0, bottom: 0 }), l = { width: 20, height: 40 }) {
1976
1983
  const { initialRect: o } = Fo(t, i), a = b(!1);
1977
1984
  let r = 0, s = 0, c = 0, f = 0, x = 0;
1978
- const g = 5, h = b(null), _ = ($) => {
1985
+ const g = 5, h = b(null), _ = (V) => {
1979
1986
  if (!(!t.value || e.value))
1980
1987
  if (a.value) {
1981
- const T = $.clientX - f, G = $.clientY - x;
1988
+ const T = V.clientX - f, G = V.clientY - x;
1982
1989
  if (h.value === "left" || h.value === "left-bottom-corner") {
1983
1990
  const P = s - T;
1984
1991
  P > l.width && (o.value.width = P, o.value.left = r + T, t.value.style.left = o.value.left + "px", t.value.style.width = o.value.width + "px");
@@ -1992,26 +1999,26 @@ function Po(t, e = b(!1), n = b(!1), i = b({ left: 0, right: 0, top: 0, bottom:
1992
1999
  P > l.height && (o.value.height = P, t.value.style.height = o.value.height + "px");
1993
2000
  }
1994
2001
  } else {
1995
- const T = t.value.getBoundingClientRect(), G = $.clientX - T.left, P = $.clientY - T.top, z = G <= g, A = G >= T.width - g, O = P >= T.height - g;
1996
- z && O && n.value ? (t.value.style.cursor = "nesw-resize", h.value = "left-bottom-corner") : A && O && !n.value ? (t.value.style.cursor = "nwse-resize", h.value = "right-bottom-corner") : z && n.value ? (t.value.style.cursor = "ew-resize", h.value = "left") : A && !n.value ? (t.value.style.cursor = "ew-resize", h.value = "right") : O ? (t.value.style.cursor = "ns-resize", h.value = "bottom") : (t.value.style.cursor = "", h.value = null);
2002
+ const T = t.value.getBoundingClientRect(), G = V.clientX - T.left, P = V.clientY - T.top, z = G <= g, A = G >= T.width - g, N = P >= T.height - g;
2003
+ z && N && n.value ? (t.value.style.cursor = "nesw-resize", h.value = "left-bottom-corner") : A && N && !n.value ? (t.value.style.cursor = "nwse-resize", h.value = "right-bottom-corner") : z && n.value ? (t.value.style.cursor = "ew-resize", h.value = "left") : A && !n.value ? (t.value.style.cursor = "ew-resize", h.value = "right") : N ? (t.value.style.cursor = "ns-resize", h.value = "bottom") : (t.value.style.cursor = "", h.value = null);
1997
2004
  }
1998
- }, y = ($) => {
2005
+ }, y = (V) => {
1999
2006
  if (!t.value || !h.value) return;
2000
2007
  const T = t.value.getBoundingClientRect();
2001
- f = $.clientX, x = $.clientY, s = T.width, c = T.height, r = T.left, o.value.width = s, o.value.height = c, o.value.left = T.left, o.value.top = T.top, a.value = !0, document.addEventListener("mousemove", _), document.addEventListener("mouseup", S);
2008
+ f = V.clientX, x = V.clientY, s = T.width, c = T.height, r = T.left, o.value.width = s, o.value.height = c, o.value.left = T.left, o.value.top = T.top, a.value = !0, document.addEventListener("mousemove", _), document.addEventListener("mouseup", S);
2002
2009
  }, S = () => {
2003
2010
  a.value = !1, h.value = null, t.value && (t.value.style.cursor = ""), document.removeEventListener("mousemove", _), document.removeEventListener("mouseup", S);
2004
- }, V = () => {
2011
+ }, $ = () => {
2005
2012
  t.value && (t.value.removeEventListener("mousedown", y), t.value.removeEventListener("mousemove", _)), document.removeEventListener("mouseup", S);
2006
2013
  }, F = () => {
2007
2014
  t.value && (t.value.addEventListener("mousedown", y), t.value.addEventListener("mousemove", _));
2008
2015
  };
2009
- return N(() => {
2016
+ return O(() => {
2010
2017
  t.value && F();
2011
2018
  }), Be(() => {
2012
- V();
2013
- }), E(t, ($) => {
2014
- $ ? F() : V();
2019
+ $();
2020
+ }), E(t, (V) => {
2021
+ V ? F() : $();
2015
2022
  }), { rect: o, isResizing: a };
2016
2023
  }
2017
2024
  function Ro(t, e, n, i) {
@@ -2027,7 +2034,7 @@ function Ro(t, e, n, i) {
2027
2034
  }, r = () => {
2028
2035
  t.value && t.value.addEventListener("transitionend", o);
2029
2036
  };
2030
- N(() => {
2037
+ O(() => {
2031
2038
  t.value && t.value.addEventListener("transitionend", o);
2032
2039
  }), Be(() => {
2033
2040
  t.value && t.value.removeEventListener("transitionend", o);
@@ -2039,8 +2046,8 @@ function Ro(t, e, n, i) {
2039
2046
  l();
2040
2047
  });
2041
2048
  }
2042
- function Oo(t, e, n, i) {
2043
- const l = b(window.innerWidth), o = b(window.innerHeight), { docked: a, orientation: r, movement: s, position: c, isDragging: f } = $o(
2049
+ function No(t, e, n, i) {
2050
+ const l = b(window.innerWidth), o = b(window.innerHeight), { docked: a, orientation: r, movement: s, position: c, isDragging: f } = Vo(
2044
2051
  t,
2045
2052
  e,
2046
2053
  i
@@ -2054,28 +2061,28 @@ function Oo(t, e, n, i) {
2054
2061
  h,
2055
2062
  c,
2056
2063
  f
2057
- ), { lastTop: S, lastHeight: V } = Ao(
2064
+ ), { lastTop: S, lastHeight: $ } = Ao(
2058
2065
  k(() => g.value.left),
2059
2066
  k(() => g.value.top),
2060
2067
  k(() => g.value.width),
2061
2068
  k(() => g.value.height)
2062
2069
  ), { autoOpened: F } = Eo(t, e, n);
2063
2070
  Ro(t, x, n, F);
2064
- const $ = (z) => {
2071
+ const V = (z) => {
2065
2072
  if (t.value) {
2066
- const A = t.value.getBoundingClientRect(), O = A.left + z;
2073
+ const A = t.value.getBoundingClientRect(), N = A.left + z;
2067
2074
  if (x.value) {
2068
- g.value.left = O;
2075
+ g.value.left = N;
2069
2076
  const de = window.innerWidth - A.width - A.left;
2070
- A.left <= 0 && de >= 0 && z < 0 && (g.value.left = Math.max(0, O)), window.innerWidth - A.width <= 0 && (g.value.left = window.innerWidth - A.width);
2077
+ A.left <= 0 && de >= 0 && z < 0 && (g.value.left = Math.max(0, N)), window.innerWidth - A.width <= 0 && (g.value.left = window.innerWidth - A.width);
2071
2078
  } else
2072
- A.left + A.width >= window.innerWidth && z < 0 && (g.value.left = Math.max(0, O));
2079
+ A.left + A.width >= window.innerWidth && z < 0 && (g.value.left = Math.max(0, N));
2073
2080
  }
2074
2081
  }, T = () => {
2075
2082
  const z = window.innerWidth - l.value;
2076
- l.value = window.innerWidth, o.value = window.innerHeight, $(z);
2083
+ l.value = window.innerWidth, o.value = window.innerHeight, V(z);
2077
2084
  };
2078
- N(() => {
2085
+ O(() => {
2079
2086
  window.addEventListener("resize", T);
2080
2087
  }), ee(() => {
2081
2088
  window.removeEventListener("resize", T);
@@ -2083,7 +2090,7 @@ function Oo(t, e, n, i) {
2083
2090
  const G = (z) => {
2084
2091
  z ? (g.value.width = Me, x.value && y.value && _.value && (g.value.left = y.value + _.value - Me)) : (g.value.width = _.value, x.value && y.value && _.value && (g.value.left = y.value));
2085
2092
  }, P = () => {
2086
- a.value ? (g.value.top = i.value.offset.value.top, g.value.height = window.innerHeight - i.value.offset.value.top - i.value.offset.value.bottom) : (g.value.top = S.value, g.value.height = V.value);
2093
+ a.value ? (g.value.top = i.value.offset.value.top, g.value.height = window.innerHeight - i.value.offset.value.top - i.value.offset.value.bottom) : (g.value.top = S.value, g.value.height = $.value);
2087
2094
  };
2088
2095
  return E(a, () => {
2089
2096
  P();
@@ -2098,7 +2105,7 @@ function Oo(t, e, n, i) {
2098
2105
  }
2099
2106
  }), { rect: g, orientation: r, reversed: x };
2100
2107
  }
2101
- const No = (t) => (ze("data-v-11a64c54"), t = t(), De(), t), Ho = /* @__PURE__ */ No(() => /* @__PURE__ */ d("svg", {
2108
+ const Oo = (t) => (ze("data-v-11a64c54"), t = t(), De(), t), Ho = /* @__PURE__ */ Oo(() => /* @__PURE__ */ d("svg", {
2102
2109
  xmlns: "http://www.w3.org/2000/svg",
2103
2110
  width: "1em",
2104
2111
  height: "1em",
@@ -2133,7 +2140,7 @@ const No = (t) => (ze("data-v-11a64c54"), t = t(), De(), t), Ho = /* @__PURE__ *
2133
2140
  rect: c,
2134
2141
  orientation: f,
2135
2142
  reversed: x
2136
- } = Oo(r, a, o, s), g = k(() => ({
2143
+ } = No(r, a, o, s), g = k(() => ({
2137
2144
  left: `${c.value.left}px`,
2138
2145
  top: `${c.value.top}px`,
2139
2146
  width: `${c.value.width}px`,
@@ -2153,7 +2160,7 @@ const No = (t) => (ze("data-v-11a64c54"), t = t(), De(), t), Ho = /* @__PURE__ *
2153
2160
  });
2154
2161
  };
2155
2162
  return (y, S) => {
2156
- const V = se;
2163
+ const $ = se;
2157
2164
  return i.value ? (u(), w("div", {
2158
2165
  key: 0,
2159
2166
  ref_key: "toolPaletteElement",
@@ -2170,7 +2177,7 @@ const No = (t) => (ze("data-v-11a64c54"), t = t(), De(), t), Ho = /* @__PURE__ *
2170
2177
  class: "ml-tool-palette-title-bar",
2171
2178
  style: pe(h.value)
2172
2179
  }, [
2173
- v(V, {
2180
+ v($, {
2174
2181
  size: 18,
2175
2182
  class: "ml-tool-palette-dialog-icon",
2176
2183
  onClick: _
@@ -2314,7 +2321,7 @@ const No = (t) => (ze("data-v-11a64c54"), t = t(), De(), t), Ho = /* @__PURE__ *
2314
2321
  "trigger-on-focus": "",
2315
2322
  "fit-input-width": !1,
2316
2323
  onSelect: r,
2317
- onKeydown: Ne(r, ["enter"]),
2324
+ onKeydown: Oe(r, ["enter"]),
2318
2325
  class: "autocomplete-input"
2319
2326
  }, {
2320
2327
  default: p(({ item: x }) => [
@@ -2357,15 +2364,15 @@ const No = (t) => (ze("data-v-11a64c54"), t = t(), De(), t), Ho = /* @__PURE__ *
2357
2364
  }, x = () => {
2358
2365
  n.value = !1;
2359
2366
  };
2360
- return N(() => {
2367
+ return O(() => {
2361
2368
  const g = B.instance.curView.events;
2362
2369
  g.hover.addEventListener(f), g.unhover.addEventListener(x);
2363
2370
  }), ee(() => {
2364
2371
  const g = B.instance.curView.events;
2365
2372
  g.hover.removeEventListener(f), g.unhover.removeEventListener(x);
2366
2373
  }), (g, h) => {
2367
- const _ = M("el-text"), y = M("el-col"), S = M("el-row"), V = M("el-card");
2368
- return c.value ? (u(), C(V, {
2374
+ const _ = M("el-text"), y = M("el-col"), S = M("el-row"), $ = M("el-card");
2375
+ return c.value ? (u(), C($, {
2369
2376
  key: 0,
2370
2377
  class: "ml-entity-info"
2371
2378
  }, {
@@ -2481,7 +2488,7 @@ const No = (t) => (ze("data-v-11a64c54"), t = t(), De(), t), Ho = /* @__PURE__ *
2481
2488
  currentLocale: { default: void 0 }
2482
2489
  },
2483
2490
  setup(t) {
2484
- const e = t, { effectiveLocale: n, setLocale: i } = Ve(e.currentLocale), l = W([
2491
+ const e = t, { effectiveLocale: n, setLocale: i } = $e(e.currentLocale), l = W([
2485
2492
  {
2486
2493
  name: "en",
2487
2494
  text: "English"
@@ -2680,7 +2687,7 @@ const wl = /* @__PURE__ */ L({
2680
2687
  description: e("main.verticalToolbar.zoomToBox.description")
2681
2688
  },
2682
2689
  {
2683
- icon: Ot,
2690
+ icon: Nt,
2684
2691
  text: e("main.verticalToolbar.layer.text"),
2685
2692
  command: "la",
2686
2693
  description: e("main.verticalToolbar.layer.description")
@@ -2759,7 +2766,7 @@ const wl = /* @__PURE__ */ L({
2759
2766
  r.setText(e("main.message.fetchingDrawingFile")), n.value = a.percentage, n.value < 100 ? i.value = !0 : (i.value = !1, r.close());
2760
2767
  }
2761
2768
  }, o = (a) => `${a.toFixed(0)}%`;
2762
- return N(() => {
2769
+ return O(() => {
2763
2770
  j.on("open-file-progress", l);
2764
2771
  }), ee(() => {
2765
2772
  j.off("open-file-progress", l);
@@ -2866,7 +2873,7 @@ const wl = /* @__PURE__ */ L({
2866
2873
  setup(t) {
2867
2874
  const e = () => {
2868
2875
  B.instance.sendStringToExecute("md");
2869
- }, { fonts: n, images: i } = $e(), l = k(() => i.size > 0 || n.size > 0);
2876
+ }, { fonts: n, images: i } = Ve(), l = k(() => i.size > 0 || n.size > 0);
2870
2877
  return (o, a) => {
2871
2878
  const r = M("el-button");
2872
2879
  return l.value ? (u(), C(r, {
@@ -2878,7 +2885,7 @@ const wl = /* @__PURE__ */ L({
2878
2885
  }, null, 8, ["icon"])) : U("", !0);
2879
2886
  };
2880
2887
  }
2881
- }), Vl = /* @__PURE__ */ H(El, [["__scopeId", "data-v-3411a3ec"]]), $l = /* @__PURE__ */ L({
2888
+ }), $l = /* @__PURE__ */ H(El, [["__scopeId", "data-v-3411a3ec"]]), Vl = /* @__PURE__ */ L({
2882
2889
  __name: "MlStatusBar",
2883
2890
  setup(t) {
2884
2891
  const { text: e } = mt(B.instance.curView), n = ft(B.instance), i = ce(), l = (o) => {
@@ -2920,7 +2927,7 @@ const wl = /* @__PURE__ */ L({
2920
2927
  ]),
2921
2928
  _: 1
2922
2929
  })) : U("", !0),
2923
- v(Vl),
2930
+ v($l),
2924
2931
  v(Tl),
2925
2932
  v(kl),
2926
2933
  v(Sl),
@@ -2933,7 +2940,7 @@ const wl = /* @__PURE__ */ L({
2933
2940
  });
2934
2941
  };
2935
2942
  }
2936
- }), Al = /* @__PURE__ */ H($l, [["__scopeId", "data-v-ee6f13c4"]]), Il = { class: "ml-file-name" }, da = /* @__PURE__ */ L({
2943
+ }), Al = /* @__PURE__ */ H(Vl, [["__scopeId", "data-v-ee6f13c4"]]), Il = { class: "ml-file-name" }, da = /* @__PURE__ */ L({
2937
2944
  __name: "MlCadViewer",
2938
2945
  props: {
2939
2946
  locale: { default: "default" },
@@ -2945,7 +2952,7 @@ const wl = /* @__PURE__ */ L({
2945
2952
  setup(t) {
2946
2953
  const e = t;
2947
2954
  Rl(e.canvasId);
2948
- const { t: n } = R(), { effectiveLocale: i, elementPlusLocale: l } = Ve(e.locale), o = async (r, s) => {
2955
+ const { t: n } = R(), { effectiveLocale: i, elementPlusLocale: l } = $e(e.locale), o = async (r, s) => {
2949
2956
  const c = { minimumChunkSize: 1e3 };
2950
2957
  await B.instance.openDocument(r, s, c), Q.fileName = r;
2951
2958
  }, a = async (r) => {
@@ -2973,7 +2980,7 @@ const wl = /* @__PURE__ */ L({
2973
2980
  (r) => {
2974
2981
  r != null && (B.instance.curView.backgroundColor = r);
2975
2982
  }
2976
- ), N(async () => {
2983
+ ), O(async () => {
2977
2984
  e.url && a(e.url), e.background != null && (B.instance.curView.backgroundColor = e.background);
2978
2985
  }), j.on("message", (r) => {
2979
2986
  te({
@@ -3027,7 +3034,7 @@ const wl = /* @__PURE__ */ L({
3027
3034
  v(m(tl)),
3028
3035
  v(m(Al))
3029
3036
  ]),
3030
- v(m(Vt), { onFileRead: o }),
3037
+ v(m($t), { onFileRead: o }),
3031
3038
  v(m(ol))
3032
3039
  ]),
3033
3040
  _: 1
@@ -3040,12 +3047,12 @@ const wl = /* @__PURE__ */ L({
3040
3047
  q.SYSTEMT_COMMAND_GROUP_NAME,
3041
3048
  "log",
3042
3049
  "log",
3043
- new Nl()
3050
+ new Ol()
3044
3051
  ), q.instance.addCommand(
3045
3052
  q.SYSTEMT_COMMAND_GROUP_NAME,
3046
3053
  "la",
3047
3054
  "la",
3048
- new Ol()
3055
+ new Nl()
3049
3056
  ), q.instance.addCommand(
3050
3057
  q.SYSTEMT_COMMAND_GROUP_NAME,
3051
3058
  "md",
@@ -3076,12 +3083,12 @@ const wl = /* @__PURE__ */ L({
3076
3083
  layerManager: !1
3077
3084
  }
3078
3085
  });
3079
- class Ol extends re {
3086
+ class Nl extends re {
3080
3087
  execute(e) {
3081
3088
  Q.dialogs.layerManager = !0;
3082
3089
  }
3083
3090
  }
3084
- class Nl extends re {
3091
+ class Ol extends re {
3085
3092
  execute(e) {
3086
3093
  this.printSelectionSet(e), this.printStats(e), this.printPerformanceData();
3087
3094
  }
@@ -3142,8 +3149,8 @@ class Gl extends re {
3142
3149
  }
3143
3150
  }
3144
3151
  export {
3145
- Ol as AcApLayerStateCmd,
3146
- Nl as AcApLogCmd,
3152
+ Nl as AcApLayerStateCmd,
3153
+ Ol as AcApLogCmd,
3147
3154
  Hl as AcApMissedDataCmd,
3148
3155
  Gl as AcApPointStyleCmd,
3149
3156
  Ee as MlBaseDialog,
@@ -3151,7 +3158,7 @@ export {
3151
3158
  tl as MlCommandLine,
3152
3159
  Tt as MlDialogManager,
3153
3160
  ol as MlEntityInfo,
3154
- Vt as MlFileReader,
3161
+ $t as MlFileReader,
3155
3162
  al as MlLanguageSelector,
3156
3163
  Zo as MlLayerManager,
3157
3164
  yl as MlMainMenu,
@@ -3174,8 +3181,8 @@ export {
3174
3181
  vt as useFileTypes,
3175
3182
  gt as useLayers,
3176
3183
  ft as useLayouts,
3177
- Ve as useLocale,
3178
- $e as useMissedData,
3184
+ $e as useLocale,
3185
+ Ve as useMissedData,
3179
3186
  ce as useSettings,
3180
3187
  Bt as useSystemVars,
3181
3188
  ua as userCmdDescription
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mlightcad/cad-viewer",
3
- "version": "1.0.16",
3
+ "version": "1.0.18",
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/three-renderer": "1.0.14",
46
- "@mlightcad/svg-renderer": "0.0.13"
45
+ "@mlightcad/three-renderer": "1.0.16",
46
+ "@mlightcad/svg-renderer": "0.0.15"
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.2.5",
54
+ "@mlightcad/data-model": "1.2.7",
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.16"
59
+ "@mlightcad/cad-simple-viewer": "1.0.18"
60
60
  },
61
61
  "scripts": {
62
62
  "analyze": "vite build --mode analyze",