build-dxf 0.0.19-12 → 0.0.19-14

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/src/index3.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as THREE from "three";
2
- import { i as isString, n as noop, r as resolveUnref, t as tryOnScopeDispose, c as isClient, d as tryOnMounted, e as identity, f as buildProps, g as definePropType, _ as _export_sfc, u as useNamespace, h as isNumber, j as addUnit, w as withInstall, k as useEmptyValuesProps, l as useSizeProp, p as provideGlobalConfig, m as iconPropType, o as useGlobalComponentSettings, T as TypeComponentsMap, q as ElIcon, s as TypeComponents, v as useTimeoutFn, x as isString$1, y as isFunction, z as isBoolean, A as isElement, B as withInstallFunction, L as Lines, D as DomEventRegister, b as ElCheckbox, E as ElButton, S as SelectLocalFile } from "./selectLocalFile.js";
2
+ import { O as isString, P as noop, Q as resolveUnref, T as tryOnScopeDispose, U as isClient, V as tryOnMounted, W as identity, m as buildProps, q as definePropType, _ as _export_sfc$1, x as useNamespace, B as isNumber, X as addUnit, y as withInstall, Y as useEmptyValuesProps, w as useSizeProp, Z as provideGlobalConfig, v as iconPropType, $ as useGlobalComponentSettings, a0 as TypeComponentsMap, E as ElIcon, a1 as TypeComponents, a2 as useTimeoutFn, A as isString$1, a3 as isFunction, C as isBoolean, a4 as isElement, a5 as withInstallFunction, I as Lines, J as DomEventRegister } from "./selectLocalFile.js";
3
3
  import { C as Component, L as LineSegment, P as Point, B as Box2, E as EventDispatcher, b as PointVirtualGrid, Q as Quadtree } from "./build.js";
4
- import { watch, ref, defineComponent, computed, createElementBlock, openBlock, normalizeClass, unref, renderSlot, createVNode, Transition, withCtx, withDirectives, createElementVNode, normalizeStyle, createTextVNode, toDisplayString, vShow, shallowReactive, onMounted, createBlock, createCommentVNode, resolveDynamicComponent, Fragment, withModifiers, nextTick, isVNode, render, toRaw, watchEffect, onUnmounted, renderList, createApp } from "vue";
4
+ import { watch, ref, defineComponent, computed, createElementBlock, openBlock, normalizeClass, unref, renderSlot, createVNode, Transition, withCtx, withDirectives, createElementVNode, normalizeStyle, createTextVNode, toDisplayString, vShow, shallowReactive, onMounted, createBlock, createCommentVNode, resolveDynamicComponent, Fragment, withModifiers, nextTick, isVNode, render, toRaw, onUnmounted, renderList, createApp } from "vue";
5
5
  import "clipper-lib";
6
6
  import "dxf-writer";
7
7
  import "three/addons/controls/OrbitControls.js";
@@ -258,7 +258,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
258
258
  };
259
259
  }
260
260
  });
261
- var Badge = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__file", "badge.vue"]]);
261
+ var Badge = /* @__PURE__ */ _export_sfc$1(_sfc_main$2, [["__file", "badge.vue"]]);
262
262
  const ElBadge = withInstall(Badge);
263
263
  const configProviderProps = buildProps({
264
264
  a11y: {
@@ -565,7 +565,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
565
565
  };
566
566
  }
567
567
  });
568
- var MessageConstructor = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__file", "message.vue"]]);
568
+ var MessageConstructor = /* @__PURE__ */ _export_sfc$1(_sfc_main$1, [["__file", "message.vue"]]);
569
569
  let seed = 1;
570
570
  const normalizeOptions = (params) => {
571
571
  const options = !params || isString$1(params) || isVNode(params) || isFunction(params) ? { message: params } : params;
@@ -1251,10 +1251,12 @@ class CommandManager extends EventDispatcher {
1251
1251
  const _imports_0 = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1757902422799'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='1735'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cpath%20d='M843.2%20726.4c-20.2%200-39.2%205.2-55.8%2014.3L283.8%20237.2c9-16.5%2014.1-35.4%2014.1-55.5%200-64.2-52.3-116.5-116.5-116.5S65%20117.4%2065%20181.6s52.3%20116.5%20116.5%20116.5c20.2%200%2039.2-5.2%2055.8-14.2l503.5%20503.5c-9%2016.5-14.1%2035.4-14.1%2055.5%200%2064.2%2052.3%20116.5%20116.5%20116.5s116.5-52.3%20116.5-116.5-52.3-116.5-116.5-116.5zM181.4%20232.1c-27.8%200-50.5-22.6-50.5-50.5s22.6-50.5%2050.5-50.5%2050.5%2022.6%2050.5%2050.5-22.6%2050.5-50.5%2050.5z%20m661.8%20661.3c-27.8%200-50.5-22.6-50.5-50.5%200-27.8%2022.6-50.5%2050.5-50.5s50.5%2022.6%2050.5%2050.5c0%2027.8-22.7%2050.5-50.5%2050.5z'%20fill='%23231815'%20p-id='1736'%3e%3c/path%3e%3c/svg%3e";
1252
1252
  const _hoisted_1 = { class: "mt-[5px] text-[#888] text-[10px] absolute left-[10px] bottom-[10px] rounded-[8px] min-w-[150px] bg-black/15 p-[10px]" };
1253
1253
  const _hoisted_2 = { class: "inline-block ml-[10px]" };
1254
- const _hoisted_3 = { class: "flex p-[5px_0px] flex-row header text-[14px] font-bold p-[10px 0px] border-b-1 border-b-[#eee]" };
1255
- const _hoisted_4 = { class: "p-[5px]" };
1256
- const _hoisted_5 = { class: "mt-[10px] text-[14px] flex flex-col" };
1257
- const _hoisted_6 = { class: "flex flex-row items-center gap-[10px] mt-[10px]" };
1254
+ const _hoisted_3 = {
1255
+ key: 0,
1256
+ class: "p-[5px] min-w-[140px]"
1257
+ };
1258
+ const _hoisted_4 = { class: "text-[14px] flex flex-col" };
1259
+ const _hoisted_5 = ["onClick"];
1258
1260
  const _sfc_main = /* @__PURE__ */ defineComponent({
1259
1261
  __name: "EditorTool",
1260
1262
  props: {
@@ -1262,7 +1264,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
1262
1264
  },
1263
1265
  setup(__props) {
1264
1266
  const props = __props;
1265
- const originalLineVisible = ref(true), dxfVisible = ref(true), whiteModelVisible = ref(true), isLook = ref(false), elRef = ref(), toolBarRef = ref(), dxfSystem = toRaw(props.dxfSystem), domEventRegister = dxfSystem.findComponentByType(DomEventRegister), toolBarPosition = ref({ left: 10, top: 10 }), shortcutKeys = [
1267
+ const originalLineVisible = ref(true), dxfVisible = ref(true), whiteModelVisible = ref(true), isLook = ref(false), elRef = ref(), toolBarRef = ref(), toolBarExpand = ref(true), currentCommand = ref(""), dxfSystem = toRaw(props.dxfSystem), domEventRegister = dxfSystem.findComponentByType(DomEventRegister), editor = dxfSystem.findComponentByType(Editor$1), toolBarPosition = ref({ left: 10, top: 10 }), shortcutKeys = [
1266
1268
  { "name": "绘制连续线段", "shortcut": "Ctrl + L" },
1267
1269
  { "name": "绘制线段确认", "shortcut": "Enter" },
1268
1270
  { "name": "绘制门线", "shortcut": "Ctrl + M" },
@@ -1278,53 +1280,62 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
1278
1280
  { "name": "线段连接", "shortcut": "选中 + Shift + L" },
1279
1281
  { "name": "线段交点连接", "shortcut": "选中 + Ctrl + Shift + L" },
1280
1282
  { "name": "取消命令", "shortcut": "Esc" }
1283
+ ], commandList = [
1284
+ {
1285
+ command: "default",
1286
+ name: "默认",
1287
+ show: false
1288
+ },
1289
+ {
1290
+ command: "draw-line",
1291
+ name: "绘制线段",
1292
+ show: true
1293
+ },
1294
+ {
1295
+ command: "draw-door-line",
1296
+ name: "绘制门线",
1297
+ show: true
1298
+ },
1299
+ {
1300
+ command: "draw-window-line",
1301
+ name: "绘制窗户线",
1302
+ show: true
1303
+ }
1281
1304
  ];
1282
- watchEffect(() => localStorage.setItem("EditorToolPosition", JSON.stringify(toolBarPosition.value)));
1283
- function setEditorToolPosition(left, top) {
1284
- const dom = elRef.value, toolBarDom = elRef.value, rect = dom.getBoundingClientRect(), toolBarRect = toolBarDom.getBoundingClientRect(), minX = 0, maxX = toolBarRect.width - rect.width, minY = 0, maxY = toolBarRect.height - rect.height;
1305
+ watch(toolBarPosition, () => localStorage.setItem("EditorToolPosition", JSON.stringify(toolBarPosition.value)));
1306
+ function setEditorToolPosition(left, top, rect = elRef.value.getBoundingClientRect(), toolBarRect = toolBarRef.value.getBoundingClientRect()) {
1307
+ const minX = 0, maxX = rect.width - toolBarRect.width, minY = 0, maxY = rect.height - toolBarRect.height;
1285
1308
  left = Math.max(minX, Math.min(left, maxX));
1286
1309
  top = Math.max(minY, Math.min(top, maxY));
1287
1310
  toolBarPosition.value = { left, top };
1288
- console.log(left, top);
1289
- }
1290
- function setLines(lines) {
1291
- if (lines) {
1292
- localStorage.setItem("lines", JSON.stringify(lines));
1293
- try {
1294
- dxfSystem.Dxf.set(lines);
1295
- dxfSystem.Dxf.lineOffset();
1296
- } catch (error) {
1297
- console.log(error);
1298
- }
1299
- }
1300
1311
  }
1301
- async function selectLocalFile() {
1302
- const data = await SelectLocalFile.json();
1303
- if (Array.isArray(data)) {
1304
- localStorage.removeItem("orbitControls");
1305
- setLines(data);
1306
- }
1312
+ function startCurrentCommandItem(item) {
1313
+ if (currentCommand.value === item.command) return;
1314
+ editor.commandManager.start(item.command);
1307
1315
  }
1308
- function dragMoveHelper(e) {
1316
+ function dragMoveHelper({ offsetX, offsetY }) {
1309
1317
  domEventRegister.mouseMoveEventProxylock = true;
1310
1318
  const cusor = document.body.style.cursor;
1311
1319
  document.body.style.cursor = "move";
1312
- const move = (e2) => {
1320
+ const move = (e) => {
1321
+ const rect = elRef.value.getBoundingClientRect(), toolBarRect = toolBarRef.value.getBoundingClientRect();
1313
1322
  setEditorToolPosition(
1314
- toolBarPosition.value.left + e2.movementX,
1315
- toolBarPosition.value.top + e2.movementY
1323
+ e.pageX - rect.left - offsetX,
1324
+ e.pageY - rect.top - offsetY,
1325
+ rect,
1326
+ toolBarRect
1316
1327
  );
1317
- e2.stopPropagation();
1328
+ e.stopPropagation();
1318
1329
  document.body.style.cursor = "move";
1319
1330
  };
1320
1331
  const end = () => {
1321
1332
  document.body.removeEventListener("mousemove", move);
1322
- document.body.removeEventListener("mouseup", end);
1333
+ document.removeEventListener("mouseup", end);
1323
1334
  document.body.style.cursor = cusor;
1324
1335
  domEventRegister.mouseMoveEventProxylock = false;
1325
1336
  };
1326
1337
  document.body.addEventListener("mousemove", move);
1327
- document.body.addEventListener("mouseup", end);
1338
+ document.addEventListener("mouseup", end);
1328
1339
  }
1329
1340
  watch(originalLineVisible, () => dxfSystem.Variable.set("originalLineVisible", originalLineVisible.value));
1330
1341
  watch(dxfVisible, () => dxfSystem.Variable.set("dxfVisible", dxfVisible.value));
@@ -1333,14 +1344,22 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
1333
1344
  dxfSystem.Variable.addEventListener("originalLineVisible", (e) => originalLineVisible.value = e.value);
1334
1345
  dxfSystem.Variable.addEventListener("dxfVisible", (e) => dxfVisible.value = e.value);
1335
1346
  dxfSystem.Variable.addEventListener("whiteModelVisible", (e) => whiteModelVisible.value = e.value);
1347
+ const startedEventCancel = editor.commandManager.addEventListener("started", (e) => {
1348
+ currentCommand.value = e.name;
1349
+ });
1336
1350
  onMounted(() => {
1337
- if (localStorage.getItem("EditorToolPosition")) {
1338
- const { left, top } = JSON.parse(localStorage.getItem("EditorToolPosition") ?? "{}");
1339
- setEditorToolPosition(left, top);
1340
- }
1351
+ toolBarRef.value.style.display = "none";
1352
+ setTimeout(() => {
1353
+ toolBarRef.value.style.display = "block";
1354
+ if (localStorage.getItem("EditorToolPosition")) {
1355
+ const { left, top } = JSON.parse(localStorage.getItem("EditorToolPosition") ?? "{}");
1356
+ setEditorToolPosition(left, top);
1357
+ }
1358
+ }, 20);
1341
1359
  });
1342
1360
  onUnmounted(() => {
1343
1361
  domEventRegister.mouseMoveEventProxylock = false;
1362
+ startedEventCancel();
1344
1363
  });
1345
1364
  return (_ctx, _cache) => {
1346
1365
  return openBlock(), createElementBlock("div", {
@@ -1363,77 +1382,85 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
1363
1382
  ref_key: "toolBarRef",
1364
1383
  ref: toolBarRef,
1365
1384
  style: normalizeStyle({ left: toolBarPosition.value.left + "px", top: toolBarPosition.value.top + "px" }),
1366
- class: "pointer-events-auto text-[#333] absolute rounded-[8px] min-w-[140px] z-[1000] bg-white select-none"
1385
+ class: "pointer-events-auto text-[#333] absolute rounded-[8px] z-[11] bg-white select-none"
1367
1386
  }, [
1368
- createElementVNode("div", _hoisted_3, [
1369
- (openBlock(), createElementBlock("svg", {
1370
- onMousedown: dragMoveHelper,
1371
- class: "m-[0px_5px]",
1372
- fill: "#aaa",
1373
- width: "20",
1374
- height: "20",
1375
- viewBox: "0 0 1024 1024",
1376
- version: "1.1",
1377
- xmlns: "http://www.w3.org/2000/svg"
1378
- }, _cache[2] || (_cache[2] = [
1379
- createElementVNode("path", { d: "M341.333333 298.666667a85.333333 85.333333 0 1 0 0-170.666667 85.333333 85.333333 0 0 0 0 170.666667z m0 298.666666a85.333333 85.333333 0 1 0 0-170.666666 85.333333 85.333333 0 0 0 0 170.666666z m85.333334 213.333334a85.333333 85.333333 0 1 1-170.666667 0 85.333333 85.333333 0 0 1 170.666667 0z m256-512a85.333333 85.333333 0 1 0 0-170.666667 85.333333 85.333333 0 0 0 0 170.666667z m85.333333 213.333333a85.333333 85.333333 0 1 1-170.666667 0 85.333333 85.333333 0 0 1 170.666667 0z m-85.333333 384a85.333333 85.333333 0 1 0 0-170.666667 85.333333 85.333333 0 0 0 0 170.666667z" }, null, -1)
1380
- ]), 32)),
1381
- _cache[3] || (_cache[3] = createElementVNode("span", null, "小工具", -1))
1382
- ]),
1383
- createElementVNode("div", _hoisted_4, [
1384
- createElementVNode("ul", _hoisted_5, [
1385
- (openBlock(), createElementBlock(Fragment, null, renderList(4, (i) => {
1386
- return createElementVNode("li", {
1387
- key: i,
1388
- class: "hover:bg-[#ddd] transition-all rounded-[6px] p-[5px] flex flex-row items-center cursor-pointer"
1389
- }, _cache[4] || (_cache[4] = [
1390
- createElementVNode("div", { class: "p-[5px] bg-[#f0f0f0] rounded-[6px] mr-[10px]" }, [
1391
- createElementVNode("img", {
1392
- class: "w-[20px] h-[20px]",
1393
- src: _imports_0,
1394
- alt: "",
1395
- srcset: ""
1396
- })
1397
- ], -1),
1398
- createElementVNode("span", null, "直线", -1)
1399
- ]));
1387
+ createElementVNode("div", {
1388
+ class: normalizeClass([{ "border-b-[#eee]": toolBarExpand.value }, "flex flex-row justify-between header text-[14px] font-bold p-[10px 0px] border-b-1"])
1389
+ }, [
1390
+ createElementVNode("div", {
1391
+ class: "flex flex-row",
1392
+ onMousedown: dragMoveHelper
1393
+ }, _cache[3] || (_cache[3] = [
1394
+ createElementVNode("div", { class: "p-[2px_5px] flex items-center pointer-events-none" }, [
1395
+ createElementVNode("svg", {
1396
+ fill: "#aaa",
1397
+ width: "20",
1398
+ height: "20",
1399
+ viewBox: "0 0 1024 1024",
1400
+ version: "1.1",
1401
+ xmlns: "http://www.w3.org/2000/svg"
1402
+ }, [
1403
+ createElementVNode("path", { d: "M341.333333 298.666667a85.333333 85.333333 0 1 0 0-170.666667 85.333333 85.333333 0 0 0 0 170.666667z m0 298.666666a85.333333 85.333333 0 1 0 0-170.666666 85.333333 85.333333 0 0 0 0 170.666666z m85.333334 213.333334a85.333333 85.333333 0 1 1-170.666667 0 85.333333 85.333333 0 0 1 170.666667 0z m256-512a85.333333 85.333333 0 1 0 0-170.666667 85.333333 85.333333 0 0 0 0 170.666667z m85.333333 213.333333a85.333333 85.333333 0 1 1-170.666667 0 85.333333 85.333333 0 0 1 170.666667 0z m-85.333333 384a85.333333 85.333333 0 1 0 0-170.666667 85.333333 85.333333 0 0 0 0 170.666667z" })
1404
+ ])
1405
+ ], -1),
1406
+ createElementVNode("h5", { class: "flex items-center pointer-events-none" }, "绘制工具", -1)
1407
+ ]), 32),
1408
+ createElementVNode("div", {
1409
+ onClick: _cache[0] || (_cache[0] = ($event) => toolBarExpand.value = !toolBarExpand.value),
1410
+ class: "cursor-pointer flex items-center p-[0px_5px]"
1411
+ }, [
1412
+ (openBlock(), createElementBlock("svg", {
1413
+ fill: "#666",
1414
+ class: normalizeClass([{ "rotate-90": toolBarExpand.value }, "transition-all"]),
1415
+ viewBox: "0 0 1024 1024",
1416
+ version: "1.1",
1417
+ xmlns: "http://www.w3.org/2000/svg",
1418
+ width: "12",
1419
+ height: "12"
1420
+ }, _cache[4] || (_cache[4] = [
1421
+ createElementVNode("path", { d: "M315.050667 938.666667a60.757333 60.757333 0 0 0 41.813333-16.298667L750.933333 551.338667a53.418667 53.418667 0 0 0 0-78.677334L356.864 101.632a61.696 61.696 0 0 0-83.541333 0 53.418667 53.418667 0 0 0-0.256 78.677333L625.408 512 273.066667 843.690667a53.418667 53.418667 0 0 0 0 78.677333 60.757333 60.757333 0 0 0 41.984 16.298667z" }, null, -1)
1422
+ ]), 2))
1423
+ ])
1424
+ ], 2),
1425
+ toolBarExpand.value ? (openBlock(), createElementBlock("div", _hoisted_3, [
1426
+ createElementVNode("ul", _hoisted_4, [
1427
+ (openBlock(), createElementBlock(Fragment, null, renderList(commandList, (item) => {
1428
+ return openBlock(), createElementBlock(Fragment, {
1429
+ key: item.command
1430
+ }, [
1431
+ item.show ? (openBlock(), createElementBlock("li", {
1432
+ key: 0,
1433
+ onClick: ($event) => startCurrentCommandItem(item),
1434
+ class: normalizeClass([{ "!bg-[#409eff] text-[#fff]": currentCommand.value === item.command }, "text-[12px] hover:bg-[#ddd] transition-all rounded-[6px] p-[5px] flex flex-row items-center cursor-pointer"])
1435
+ }, [
1436
+ _cache[5] || (_cache[5] = createElementVNode("div", { class: "p-[2px] h-fit bg-[#f0f0f0] rounded-[2px] mr-[10px]" }, [
1437
+ createElementVNode("img", {
1438
+ class: "w-[10px] h-[10px]",
1439
+ src: _imports_0,
1440
+ alt: "",
1441
+ srcset: ""
1442
+ })
1443
+ ], -1)),
1444
+ createElementVNode("span", null, toDisplayString(item.name), 1)
1445
+ ], 10, _hoisted_5)) : createCommentVNode("", true)
1446
+ ], 64);
1400
1447
  }), 64))
1401
1448
  ]),
1402
- createElementVNode("div", _hoisted_6, [
1403
- createVNode(unref(ElCheckbox), {
1404
- modelValue: dxfVisible.value,
1405
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => dxfVisible.value = $event),
1406
- label: "dxf"
1407
- }, null, 8, ["modelValue"]),
1408
- createVNode(unref(ElButton), {
1409
- size: "small",
1410
- type: "success",
1411
- onClick: selectLocalFile
1412
- }, {
1413
- default: withCtx(() => _cache[5] || (_cache[5] = [
1414
- createTextVNode(" 选择文件 ", -1)
1415
- ])),
1416
- _: 1,
1417
- __: [5]
1418
- }),
1419
- createVNode(unref(ElButton), {
1420
- size: "small",
1421
- type: "primary",
1422
- onClick: _cache[1] || (_cache[1] = ($event) => unref(dxfSystem).Dxf.download("test.dxf"))
1423
- }, {
1424
- default: withCtx(() => _cache[6] || (_cache[6] = [
1425
- createTextVNode(" 下载 DXF ", -1)
1426
- ])),
1427
- _: 1,
1428
- __: [6]
1429
- })
1430
- ])
1431
- ])
1449
+ createCommentVNode("", true)
1450
+ ])) : createCommentVNode("", true)
1432
1451
  ], 4)
1433
1452
  ], 512);
1434
1453
  };
1435
1454
  }
1436
1455
  });
1456
+ const _export_sfc = (sfc, props) => {
1457
+ const target = sfc.__vccOpts || sfc;
1458
+ for (const [key, val] of props) {
1459
+ target[key] = val;
1460
+ }
1461
+ return target;
1462
+ };
1463
+ const EditorTool = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-f1fa020d"]]);
1437
1464
  let Editor$1 = class Editor extends Component {
1438
1465
  static name = "Editor";
1439
1466
  container = new THREE.Group();
@@ -1470,7 +1497,7 @@ let Editor$1 = class Editor extends Component {
1470
1497
  this.container.add(grid);
1471
1498
  this.container.add(this.plane);
1472
1499
  this.plane.visible = false;
1473
- this.app = createApp(_sfc_main, { dxfSystem: this.parent });
1500
+ this.app = createApp(EditorTool, { dxfSystem: this.parent });
1474
1501
  this.app.mount(this.domElement);
1475
1502
  const cancelEvent = this.addEventListener("update", () => {
1476
1503
  if (this.domContainer.domElement.parentElement) {