chili3d 0.7.11 → 0.7.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.
Files changed (2) hide show
  1. package/index.js +48 -13
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -61,7 +61,7 @@ module.exports = {};
61
61
 
62
62
  }),
63
63
  924: (function (module, __unused_webpack_exports, __webpack_require__) {
64
- module.exports = {};
64
+ __webpack_require__.r(module.exports = {});
65
65
 
66
66
 
67
67
  }),
@@ -84841,38 +84841,59 @@ class Dialog {
84841
84841
  }
84842
84842
  }
84843
84843
 
84844
- // EXTERNAL MODULE: ./packages/chili-ui/src/okCancel.module.css
84845
- var okCancel_module = __webpack_require__(924);
84846
84844
  ;// CONCATENATED MODULE: ./packages/chili-ui/src/okCancel.ts
84847
84845
  // Part of the Chili3d Project, under the AGPL-3.0 License.
84848
84846
  // See LICENSE file in the project root for full license information.
84849
84847
 
84850
84848
 
84851
-
84849
+ // 安全导入CSS模块,避免style为undefined时崩溃
84850
+ let okCancel_style;
84851
+ try {
84852
+ // 尝试导入CSS模块
84853
+ const importedStyle = __webpack_require__(924);
84854
+ // 确保所有属性都有值
84855
+ okCancel_style = {
84856
+ root: importedStyle.root || "",
84857
+ container: importedStyle.container || "",
84858
+ spacer: importedStyle.spacer || "",
84859
+ panel: importedStyle.panel || "",
84860
+ icon: importedStyle.icon || ""
84861
+ };
84862
+ } catch (error) {
84863
+ console.warn("Failed to load okCancel.module.css, using empty styles:", error);
84864
+ // 如果导入失败,使用空字符串作为默认值
84865
+ okCancel_style = {
84866
+ root: "",
84867
+ container: "",
84868
+ spacer: "",
84869
+ panel: "",
84870
+ icon: ""
84871
+ };
84872
+ }
84852
84873
  class OKCancel extends HTMLElement {
84853
84874
  control;
84854
84875
  constructor(){
84855
84876
  super();
84856
- this.className = okCancel_module/* ["default"].root */.A.root;
84877
+ this.className = okCancel_style.root;
84857
84878
  this.append(this.container());
84858
84879
  }
84859
84880
  container() {
84860
84881
  return div({
84861
- className: okCancel_module/* ["default"].container */.A.container
84882
+ className: okCancel_style.container
84862
84883
  }, span({
84863
84884
  textContent: new Localize("ribbon.group.selection")
84864
84885
  }), div({
84865
- className: okCancel_module/* ["default"].spacer */.A.spacer
84886
+ className: okCancel_style.spacer
84866
84887
  }), this.buttons());
84867
84888
  }
84868
84889
  buttons() {
84869
84890
  return div({
84870
- className: okCancel_module/* ["default"].panel */.A.panel
84891
+ className: okCancel_style.panel
84871
84892
  }, this._createIcon("icon-confirm", "common.confirm", this._onConfirm), this._createIcon("icon-cancel", "common.cancel", this._onCancel));
84872
84893
  }
84873
84894
  _createIcon(icon, text, onClick) {
84874
84895
  return div({
84875
- className: okCancel_module/* ["default"].icon */.A.icon,
84896
+ className: okCancel_style.icon,
84876
84897
  onclick: onClick
84877
84898
  }, controls_svg({
84878
84899
  icon
@@ -87403,7 +87424,13 @@ class LayoutViewport extends HTMLElement {
87403
87424
  };
87404
87425
  createViewport(view) {
87405
87426
  const viewport = new Viewport(view, this.showViewControls);
87406
- viewport.classList.add(layoutViewport_style.viewport, layoutViewport_style.hidden);
87427
+ // 只添加非空的样式类名
87428
+ if (layoutViewport_style.viewport) {
87429
+ viewport.classList.add(layoutViewport_style.viewport);
87430
+ }
87431
+ if (layoutViewport_style.hidden) {
87432
+ viewport.classList.add(layoutViewport_style.hidden);
87433
+ }
87407
87434
  this.appendChild(viewport);
87408
87435
  this._viewports.set(view, viewport);
87409
87436
  return viewport;
@@ -87411,9 +87438,15 @@ class LayoutViewport extends HTMLElement {
87411
87438
  _handleActiveViewChanged = (view)=>{
87412
87439
  this._viewports.forEach((v)=>{
87413
87440
  if (v.view === view) {
87414
- v.classList.remove(layoutViewport_style.hidden);
87441
+ // 只移除非空的样式类名
87442
+ if (layoutViewport_style.hidden) {
87443
+ v.classList.remove(layoutViewport_style.hidden);
87444
+ }
87415
87445
  } else {
87416
- v.classList.add(layoutViewport_style.hidden);
87446
+ // 只添加非空的样式类名
87447
+ if (layoutViewport_style.hidden) {
87448
+ v.classList.add(layoutViewport_style.hidden);
87449
+ }
87417
87450
  }
87418
87451
  });
87419
87452
  };
@@ -87486,7 +87519,9 @@ class Editor extends HTMLElement {
87486
87519
  super(), this.app = app;
87487
87520
  this.ribbonContent = new RibbonDataContent(app, editor_quickCommands, tabs.map(RibbonTabData.fromProfile));
87488
87521
  const viewport = new LayoutViewport(app);
87489
- viewport.classList.add(editor_style.viewport);
87522
+ if (editor_style.viewport) {
87523
+ viewport.classList.add(editor_style.viewport);
87524
+ }
87490
87525
  this._selectionController = new OKCancel();
87491
87526
  this._viewportContainer = div({
87492
87527
  className: editor_style.viewportContainer
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chili3d",
3
- "version": "0.7.11",
3
+ "version": "0.7.14",
4
4
  "description": "Chili3D - A 3D modeling and visualization framework",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",