@sequent-org/ifc-viewer 1.0.14-ci.13.0 → 1.0.18-ci.14.0
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/package.json +2 -3
- package/src/IfcViewer.js +12 -0
- package/src/index.js +4 -2
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sequent-org/ifc-viewer",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.18-ci.14.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "IFC 3D model viewer component for web applications",
|
|
7
7
|
"main": "src/index.js",
|
|
@@ -9,8 +9,7 @@
|
|
|
9
9
|
"exports": {
|
|
10
10
|
".": {
|
|
11
11
|
"import": "./src/index.js"
|
|
12
|
-
}
|
|
13
|
-
"./style.css": "./src/style.css"
|
|
12
|
+
}
|
|
14
13
|
},
|
|
15
14
|
"files": [
|
|
16
15
|
"src/",
|
package/src/IfcViewer.js
CHANGED
|
@@ -14,6 +14,18 @@ import { Viewer } from "./viewer/Viewer.js";
|
|
|
14
14
|
import { IfcService } from "./ifc/IfcService.js";
|
|
15
15
|
import { IfcTreeView } from "./ifc/IfcTreeView.js";
|
|
16
16
|
|
|
17
|
+
// Загружаем стили при импорте IfcViewer
|
|
18
|
+
if (typeof window !== 'undefined' && !document.querySelector('style[data-ifc-viewer]')) {
|
|
19
|
+
import('./style.css').then(() => {
|
|
20
|
+
// Добавляем маркер, что стили загружены
|
|
21
|
+
const style = document.createElement('style');
|
|
22
|
+
style.setAttribute('data-ifc-viewer', 'loaded');
|
|
23
|
+
document.head.appendChild(style);
|
|
24
|
+
}).catch(error => {
|
|
25
|
+
console.warn('IfcViewer: не удалось загрузить стили:', error.message);
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
|
|
17
29
|
export class IfcViewer {
|
|
18
30
|
/**
|
|
19
31
|
* Создаёт новый экземпляр IfcViewer
|
package/src/index.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
// Основная точка входа пакета @sequent-org/ifc-viewer
|
|
2
2
|
// Автоматически подключает стили и экспортирует API
|
|
3
3
|
|
|
4
|
-
// Подключаем стили
|
|
5
|
-
|
|
4
|
+
// Подключаем стили только в браузерном окружении
|
|
5
|
+
if (typeof window !== 'undefined') {
|
|
6
|
+
import('./style.css');
|
|
7
|
+
}
|
|
6
8
|
|
|
7
9
|
// Экспортируем основной класс
|
|
8
10
|
export { IfcViewer } from "./IfcViewer.js";
|