chili3d 0.7.10 → 0.7.11

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 (3) hide show
  1. package/index.css +106 -106
  2. package/index.js +65 -21
  3. package/package.json +1 -1
package/index.css CHANGED
@@ -231,90 +231,6 @@ dialog::backdrop {
231
231
  }
232
232
  }
233
233
 
234
- .root {
235
- width: 100%;
236
- height: 100%;
237
- position: relative;
238
- display: flex;
239
- flex-direction: column;
240
- background-color: var(--background-color);
241
- }
242
-
243
- .content {
244
- display: flex;
245
- flex-direction: row;
246
- justify-content: stretch;
247
- flex: 1 1 auto;
248
- height: 0;
249
-
250
- & .sidebar {
251
- display: flex;
252
- flex-direction: column;
253
- min-width: 150px;
254
- max-width: 85%;
255
- background-color: var(--background-color);
256
- position: relative;
257
-
258
- & .sidebarItem {
259
- margin-top: 10px;
260
- overflow: hidden;
261
- flex: 1 1 auto;
262
- height: 0;
263
- }
264
- }
265
-
266
- & .viewportContainer {
267
- position: relative;
268
- background-color: var(--viewport-background-color);
269
- flex: 1 1 auto;
270
- width: 0;
271
-
272
- .viewport {
273
- height: 100%;
274
- position: relative;
275
- }
276
- }
277
- }
278
-
279
- .sidebarResizer {
280
- width: 6px;
281
- cursor: ew-resize;
282
- position: absolute;
283
- top: 0;
284
- right: 0;
285
- bottom: 0;
286
- z-index: 10;
287
- background: var(--resizer-gradient);
288
- transition: background 0.2s;
289
- }
290
- .sidebarResizer:hover {
291
- background: var(--resizer-gradient-hover);
292
- }
293
-
294
- .statusbar {
295
- height: 24px;
296
- display: flex;
297
- flex-direction: column;
298
- }
299
-
300
- @media (max-width: 680px) {
301
- .content {
302
- flex-direction: column-reverse;
303
- min-height: 0;
304
-
305
- & .viewportContainer {
306
- height: 100px;
307
- width: 100%;
308
- }
309
-
310
- & .sidebar {
311
- display: none;
312
- flex: 1 1 auto;
313
- width: 100%;
314
- }
315
- }
316
- }
317
-
318
234
  .root {
319
235
  position: absolute;
320
236
  top: 0;
@@ -1269,28 +1185,6 @@ dialog::backdrop {
1269
1185
  }
1270
1186
  }
1271
1187
 
1272
- .root {
1273
- display: flex;
1274
- flex-direction: row;
1275
- background: var(--viewport-background-color);
1276
- position: relative;
1277
- }
1278
-
1279
- .viewports {
1280
- width: 100%;
1281
- height: 100%;
1282
- position: relative;
1283
- }
1284
-
1285
- .viewport {
1286
- width: 100%;
1287
- height: 100%;
1288
- }
1289
-
1290
- .hidden {
1291
- display: none;
1292
- }
1293
-
1294
1188
  .root {
1295
1189
  position: absolute;
1296
1190
  display: flex;
@@ -1525,6 +1419,112 @@ dialog::backdrop {
1525
1419
  }
1526
1420
  }
1527
1421
 
1422
+ .root {
1423
+ display: flex;
1424
+ flex-direction: row;
1425
+ background: var(--viewport-background-color);
1426
+ position: relative;
1427
+ }
1428
+
1429
+ .viewports {
1430
+ width: 100%;
1431
+ height: 100%;
1432
+ position: relative;
1433
+ }
1434
+
1435
+ .viewport {
1436
+ width: 100%;
1437
+ height: 100%;
1438
+ }
1439
+
1440
+ .hidden {
1441
+ display: none;
1442
+ }
1443
+
1444
+ .root {
1445
+ width: 100%;
1446
+ height: 100%;
1447
+ position: relative;
1448
+ display: flex;
1449
+ flex-direction: column;
1450
+ background-color: var(--background-color);
1451
+ }
1452
+
1453
+ .content {
1454
+ display: flex;
1455
+ flex-direction: row;
1456
+ justify-content: stretch;
1457
+ flex: 1 1 auto;
1458
+ height: 0;
1459
+
1460
+ & .sidebar {
1461
+ display: flex;
1462
+ flex-direction: column;
1463
+ min-width: 150px;
1464
+ max-width: 85%;
1465
+ background-color: var(--background-color);
1466
+ position: relative;
1467
+
1468
+ & .sidebarItem {
1469
+ margin-top: 10px;
1470
+ overflow: hidden;
1471
+ flex: 1 1 auto;
1472
+ height: 0;
1473
+ }
1474
+ }
1475
+
1476
+ & .viewportContainer {
1477
+ position: relative;
1478
+ background-color: var(--viewport-background-color);
1479
+ flex: 1 1 auto;
1480
+ width: 0;
1481
+
1482
+ .viewport {
1483
+ height: 100%;
1484
+ position: relative;
1485
+ }
1486
+ }
1487
+ }
1488
+
1489
+ .sidebarResizer {
1490
+ width: 6px;
1491
+ cursor: ew-resize;
1492
+ position: absolute;
1493
+ top: 0;
1494
+ right: 0;
1495
+ bottom: 0;
1496
+ z-index: 10;
1497
+ background: var(--resizer-gradient);
1498
+ transition: background 0.2s;
1499
+ }
1500
+ .sidebarResizer:hover {
1501
+ background: var(--resizer-gradient-hover);
1502
+ }
1503
+
1504
+ .statusbar {
1505
+ height: 24px;
1506
+ display: flex;
1507
+ flex-direction: column;
1508
+ }
1509
+
1510
+ @media (max-width: 680px) {
1511
+ .content {
1512
+ flex-direction: column-reverse;
1513
+ min-height: 0;
1514
+
1515
+ & .viewportContainer {
1516
+ height: 100px;
1517
+ width: 100%;
1518
+ }
1519
+
1520
+ & .sidebar {
1521
+ display: none;
1522
+ flex: 1 1 auto;
1523
+ width: 100%;
1524
+ }
1525
+ }
1526
+ }
1527
+
1528
1528
  .root {
1529
1529
  position: absolute;
1530
1530
  display: flex;
package/index.js CHANGED
@@ -46,7 +46,7 @@ module.exports = {};
46
46
 
47
47
  }),
48
48
  189: (function (module, __unused_webpack_exports, __webpack_require__) {
49
- module.exports = {};
49
+ __webpack_require__.r(module.exports = {});
50
50
 
51
51
 
52
52
  }),
@@ -191,7 +191,7 @@ module.exports = {};
191
191
 
192
192
  }),
193
193
  481: (function (module, __unused_webpack_exports, __webpack_require__) {
194
- module.exports = {};
194
+ __webpack_require__.r(module.exports = {});
195
195
 
196
196
 
197
197
  }),
@@ -84841,8 +84841,6 @@ class Dialog {
84841
84841
  }
84842
84842
  }
84843
84843
 
84844
- // EXTERNAL MODULE: ./packages/chili-ui/src/editor.module.css
84845
- var editor_module = __webpack_require__(189);
84846
84844
  // EXTERNAL MODULE: ./packages/chili-ui/src/okCancel.module.css
84847
84845
  var okCancel_module = __webpack_require__(924);
84848
84846
  ;// CONCATENATED MODULE: ./packages/chili-ui/src/okCancel.ts
@@ -86913,8 +86911,6 @@ const cursors = new Map([
86913
86911
  })(cursor_Cursor || (cursor_Cursor = {}));
86914
86912
  var cursor_Cursor;
86915
86913
 
86916
- // EXTERNAL MODULE: ./packages/chili-ui/src/viewport/layoutViewport.module.css
86917
- var layoutViewport_module = __webpack_require__(481);
86918
86914
  // EXTERNAL MODULE: ./packages/chili-ui/src/viewport/flyout/flyout.module.css
86919
86915
  var flyout_module = __webpack_require__(134);
86920
86916
  // EXTERNAL MODULE: ./packages/chili-ui/src/viewport/flyout/input.module.css
@@ -87351,14 +87347,33 @@ customElements.define("chili-uiview", Viewport);
87351
87347
 
87352
87348
 
87353
87349
 
87354
-
87350
+ // 安全导入CSS模块,避免style为undefined时崩溃
87351
+ let layoutViewport_style;
87352
+ try {
87353
+ // 尝试导入CSS模块
87354
+ const importedStyle = __webpack_require__(481);
87355
+ // 确保所有属性都有值
87356
+ layoutViewport_style = {
87357
+ root: importedStyle.root || "",
87358
+ viewport: importedStyle.viewport || "",
87359
+ hidden: importedStyle.hidden || ""
87360
+ };
87361
+ } catch (error) {
87362
+ console.warn("Failed to load layoutViewport.module.css, using empty styles:", error);
87363
+ // 如果导入失败,使用空字符串作为默认值
87364
+ layoutViewport_style = {
87365
+ root: "",
87366
+ viewport: "",
87367
+ hidden: ""
87368
+ };
87369
+ }
87355
87370
  class LayoutViewport extends HTMLElement {
87356
87371
  app;
87357
87372
  showViewControls;
87358
87373
  _viewports = new Map();
87359
87374
  constructor(app, showViewControls = true){
87360
87375
  super(), this.app = app, this.showViewControls = showViewControls;
87361
- this.className = layoutViewport_module/* ["default"].root */.A.root;
87376
+ this.className = layoutViewport_style.root;
87362
87377
  app.views.onCollectionChanged(this._handleViewCollectionChanged);
87363
87378
  }
87364
87379
  _handleViewCollectionChanged = (args)=>{
@@ -87388,7 +87403,7 @@ class LayoutViewport extends HTMLElement {
87388
87403
  };
87389
87404
  createViewport(view) {
87390
87405
  const viewport = new Viewport(view, this.showViewControls);
87391
- viewport.classList.add(layoutViewport_module/* ["default"].viewport */.A.viewport, layoutViewport_module/* ["default"].hidden */.A.hidden);
87406
+ viewport.classList.add(layoutViewport_style.viewport, layoutViewport_style.hidden);
87392
87407
  this.appendChild(viewport);
87393
87408
  this._viewports.set(view, viewport);
87394
87409
  return viewport;
@@ -87396,9 +87411,9 @@ class LayoutViewport extends HTMLElement {
87396
87411
  _handleActiveViewChanged = (view)=>{
87397
87412
  this._viewports.forEach((v)=>{
87398
87413
  if (v.view === view) {
87399
- v.classList.remove(layoutViewport_module/* ["default"].hidden */.A.hidden);
87414
+ v.classList.remove(layoutViewport_style.hidden);
87400
87415
  } else {
87401
- v.classList.add(layoutViewport_module/* ["default"].hidden */.A.hidden);
87416
+ v.classList.add(layoutViewport_style.hidden);
87402
87417
  }
87403
87418
  });
87404
87419
  };
@@ -87423,7 +87438,36 @@ customElements.define("chili-viewport", LayoutViewport);
87423
87438
 
87424
87439
 
87425
87440
 
87426
-
87441
+ // 安全导入CSS模块,避免style为undefined时崩溃
87442
+ let editor_style;
87443
+ try {
87444
+ // 尝试导入CSS模块
87445
+ const importedStyle = __webpack_require__(189);
87446
+ // 确保所有属性都有值
87447
+ editor_style = {
87448
+ viewport: importedStyle.viewport || "",
87449
+ viewportContainer: importedStyle.viewportContainer || "",
87450
+ sidebar: importedStyle.sidebar || "",
87451
+ sidebarItem: importedStyle.sidebarItem || "",
87452
+ sidebarResizer: importedStyle.sidebarResizer || "",
87453
+ root: importedStyle.root || "",
87454
+ content: importedStyle.content || "",
87455
+ statusbar: importedStyle.statusbar || ""
87456
+ };
87457
+ } catch (error) {
87458
+ console.warn("Failed to load editor.module.css, using empty styles:", error);
87459
+ // 如果导入失败,使用空字符串作为默认值
87460
+ editor_style = {
87461
+ viewport: "",
87462
+ viewportContainer: "",
87463
+ sidebar: "",
87464
+ sidebarItem: "",
87465
+ sidebarResizer: "",
87466
+ root: "",
87467
+ content: "",
87468
+ statusbar: ""
87469
+ };
87470
+ }
87427
87471
  const editor_quickCommands = [
87428
87472
  "doc.save",
87429
87473
  "doc.saveToFile",
@@ -87442,31 +87486,31 @@ class Editor extends HTMLElement {
87442
87486
  super(), this.app = app;
87443
87487
  this.ribbonContent = new RibbonDataContent(app, editor_quickCommands, tabs.map(RibbonTabData.fromProfile));
87444
87488
  const viewport = new LayoutViewport(app);
87445
- viewport.classList.add(editor_module/* ["default"].viewport */.A.viewport);
87489
+ viewport.classList.add(editor_style.viewport);
87446
87490
  this._selectionController = new OKCancel();
87447
87491
  this._viewportContainer = div({
87448
- className: editor_module/* ["default"].viewportContainer */.A.viewportContainer
87492
+ className: editor_style.viewportContainer
87449
87493
  }, this._selectionController, viewport);
87450
87494
  this.clearSelectionControl();
87451
87495
  this.render();
87452
87496
  }
87453
87497
  render() {
87454
87498
  this._sidebarEl = div({
87455
- className: editor_module/* ["default"].sidebar */.A.sidebar,
87499
+ className: editor_style.sidebar,
87456
87500
  style: `width: ${this._sidebarWidth}px;`
87457
87501
  }, new ProjectView({
87458
- className: editor_module/* ["default"].sidebarItem */.A.sidebarItem
87502
+ className: editor_style.sidebarItem
87459
87503
  }), new PropertyView({
87460
- className: editor_module/* ["default"].sidebarItem */.A.sidebarItem
87504
+ className: editor_style.sidebarItem
87461
87505
  }), div({
87462
- className: editor_module/* ["default"].sidebarResizer */.A.sidebarResizer,
87506
+ className: editor_style.sidebarResizer,
87463
87507
  onmousedown: (e)=>this._startSidebarResize(e)
87464
87508
  }));
87465
87509
  this.append(div({
87466
- className: editor_module/* ["default"].root */.A.root
87510
+ className: editor_style.root
87467
87511
  }, new Ribbon(this.ribbonContent), div({
87468
- className: editor_module/* ["default"].content */.A.content
87469
- }, this._sidebarEl, this._viewportContainer), new Statusbar(editor_module/* ["default"].statusbar */.A.statusbar)));
87512
+ className: editor_style.content
87513
+ }, this._sidebarEl, this._viewportContainer), new Statusbar(editor_style.statusbar)));
87470
87514
  this.app.mainWindow?.appendChild(this);
87471
87515
  }
87472
87516
  _startSidebarResize(e) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chili3d",
3
- "version": "0.7.10",
3
+ "version": "0.7.11",
4
4
  "description": "Chili3D - A 3D modeling and visualization framework",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",