chili3d 0.7.10 → 0.7.12
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/index.css +106 -106
- package/index.js +79 -21
- 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 =
|
|
87376
|
+
this.className = layoutViewport_style.root;
|
|
87362
87377
|
app.views.onCollectionChanged(this._handleViewCollectionChanged);
|
|
87363
87378
|
}
|
|
87364
87379
|
_handleViewCollectionChanged = (args)=>{
|
|
@@ -87388,7 +87403,13 @@ class LayoutViewport extends HTMLElement {
|
|
|
87388
87403
|
};
|
|
87389
87404
|
createViewport(view) {
|
|
87390
87405
|
const viewport = new Viewport(view, this.showViewControls);
|
|
87391
|
-
|
|
87406
|
+
// 只添加非空的样式类名
|
|
87407
|
+
if (layoutViewport_style.viewport) {
|
|
87408
|
+
viewport.classList.add(layoutViewport_style.viewport);
|
|
87409
|
+
}
|
|
87410
|
+
if (layoutViewport_style.hidden) {
|
|
87411
|
+
viewport.classList.add(layoutViewport_style.hidden);
|
|
87412
|
+
}
|
|
87392
87413
|
this.appendChild(viewport);
|
|
87393
87414
|
this._viewports.set(view, viewport);
|
|
87394
87415
|
return viewport;
|
|
@@ -87396,9 +87417,15 @@ class LayoutViewport extends HTMLElement {
|
|
|
87396
87417
|
_handleActiveViewChanged = (view)=>{
|
|
87397
87418
|
this._viewports.forEach((v)=>{
|
|
87398
87419
|
if (v.view === view) {
|
|
87399
|
-
|
|
87420
|
+
// 只移除非空的样式类名
|
|
87421
|
+
if (layoutViewport_style.hidden) {
|
|
87422
|
+
v.classList.remove(layoutViewport_style.hidden);
|
|
87423
|
+
}
|
|
87400
87424
|
} else {
|
|
87401
|
-
|
|
87425
|
+
// 只添加非空的样式类名
|
|
87426
|
+
if (layoutViewport_style.hidden) {
|
|
87427
|
+
v.classList.add(layoutViewport_style.hidden);
|
|
87428
|
+
}
|
|
87402
87429
|
}
|
|
87403
87430
|
});
|
|
87404
87431
|
};
|
|
@@ -87423,7 +87450,36 @@ customElements.define("chili-viewport", LayoutViewport);
|
|
|
87423
87450
|
|
|
87424
87451
|
|
|
87425
87452
|
|
|
87426
|
-
|
|
87453
|
+
// 安全导入CSS模块,避免style为undefined时崩溃
|
|
87454
|
+
let editor_style;
|
|
87455
|
+
try {
|
|
87456
|
+
// 尝试导入CSS模块
|
|
87457
|
+
const importedStyle = __webpack_require__(189);
|
|
87458
|
+
// 确保所有属性都有值
|
|
87459
|
+
editor_style = {
|
|
87460
|
+
viewport: importedStyle.viewport || "",
|
|
87461
|
+
viewportContainer: importedStyle.viewportContainer || "",
|
|
87462
|
+
sidebar: importedStyle.sidebar || "",
|
|
87463
|
+
sidebarItem: importedStyle.sidebarItem || "",
|
|
87464
|
+
sidebarResizer: importedStyle.sidebarResizer || "",
|
|
87465
|
+
root: importedStyle.root || "",
|
|
87466
|
+
content: importedStyle.content || "",
|
|
87467
|
+
statusbar: importedStyle.statusbar || ""
|
|
87468
|
+
};
|
|
87469
|
+
} catch (error) {
|
|
87470
|
+
console.warn("Failed to load editor.module.css, using empty styles:", error);
|
|
87471
|
+
// 如果导入失败,使用空字符串作为默认值
|
|
87472
|
+
editor_style = {
|
|
87473
|
+
viewport: "",
|
|
87474
|
+
viewportContainer: "",
|
|
87475
|
+
sidebar: "",
|
|
87476
|
+
sidebarItem: "",
|
|
87477
|
+
sidebarResizer: "",
|
|
87478
|
+
root: "",
|
|
87479
|
+
content: "",
|
|
87480
|
+
statusbar: ""
|
|
87481
|
+
};
|
|
87482
|
+
}
|
|
87427
87483
|
const editor_quickCommands = [
|
|
87428
87484
|
"doc.save",
|
|
87429
87485
|
"doc.saveToFile",
|
|
@@ -87442,31 +87498,33 @@ class Editor extends HTMLElement {
|
|
|
87442
87498
|
super(), this.app = app;
|
|
87443
87499
|
this.ribbonContent = new RibbonDataContent(app, editor_quickCommands, tabs.map(RibbonTabData.fromProfile));
|
|
87444
87500
|
const viewport = new LayoutViewport(app);
|
|
87445
|
-
|
|
87501
|
+
if (editor_style.viewport) {
|
|
87502
|
+
viewport.classList.add(editor_style.viewport);
|
|
87503
|
+
}
|
|
87446
87504
|
this._selectionController = new OKCancel();
|
|
87447
87505
|
this._viewportContainer = div({
|
|
87448
|
-
className:
|
|
87506
|
+
className: editor_style.viewportContainer
|
|
87449
87507
|
}, this._selectionController, viewport);
|
|
87450
87508
|
this.clearSelectionControl();
|
|
87451
87509
|
this.render();
|
|
87452
87510
|
}
|
|
87453
87511
|
render() {
|
|
87454
87512
|
this._sidebarEl = div({
|
|
87455
|
-
className:
|
|
87513
|
+
className: editor_style.sidebar,
|
|
87456
87514
|
style: `width: ${this._sidebarWidth}px;`
|
|
87457
87515
|
}, new ProjectView({
|
|
87458
|
-
className:
|
|
87516
|
+
className: editor_style.sidebarItem
|
|
87459
87517
|
}), new PropertyView({
|
|
87460
|
-
className:
|
|
87518
|
+
className: editor_style.sidebarItem
|
|
87461
87519
|
}), div({
|
|
87462
|
-
className:
|
|
87520
|
+
className: editor_style.sidebarResizer,
|
|
87463
87521
|
onmousedown: (e)=>this._startSidebarResize(e)
|
|
87464
87522
|
}));
|
|
87465
87523
|
this.append(div({
|
|
87466
|
-
className:
|
|
87524
|
+
className: editor_style.root
|
|
87467
87525
|
}, new Ribbon(this.ribbonContent), div({
|
|
87468
|
-
className:
|
|
87469
|
-
}, this._sidebarEl, this._viewportContainer), new Statusbar(
|
|
87526
|
+
className: editor_style.content
|
|
87527
|
+
}, this._sidebarEl, this._viewportContainer), new Statusbar(editor_style.statusbar)));
|
|
87470
87528
|
this.app.mainWindow?.appendChild(this);
|
|
87471
87529
|
}
|
|
87472
87530
|
_startSidebarResize(e) {
|