@sequent-org/ifc-viewer 1.0.18-ci.14.0 → 1.0.10000001-ci.16.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sequent-org/ifc-viewer",
3
3
  "private": false,
4
- "version": "1.0.18-ci.14.0",
4
+ "version": "1.0.10000001-ci.16.0",
5
5
  "type": "module",
6
6
  "description": "IFC 3D model viewer component for web applications",
7
7
  "main": "src/index.js",
@@ -56,3 +56,34 @@ if (typeof window !== 'undefined' && window.THREE) {
56
56
  console.warn('Three.js патч: не удалось применить к глобальному THREE:', error.message);
57
57
  }
58
58
  }
59
+
60
+ // Патчим модуль BufferGeometryUtils напрямую для web-ifc-three
61
+ try {
62
+ // Создаем объект с обеими функциями для совместимости
63
+ const patchedUtils = {
64
+ mergeGeometries: mergeGeometries,
65
+ mergeBufferGeometries: mergeBufferGeometries
66
+ };
67
+
68
+ // Экспортируем для возможного использования другими модулями
69
+ if (typeof globalThis !== 'undefined') {
70
+ globalThis.__THREE_BUFFER_GEOMETRY_UTILS_PATCH__ = patchedUtils;
71
+ }
72
+
73
+ // Патчим модуль BufferGeometryUtils через import.meta
74
+ if (typeof import.meta !== 'undefined' && import.meta.glob) {
75
+ // Для Vite - патчим через import.meta.glob
76
+ try {
77
+ const utilsModule = await import('three/examples/jsm/utils/BufferGeometryUtils.js');
78
+ if (utilsModule && !utilsModule.mergeGeometries) {
79
+ utilsModule.mergeGeometries = mergeGeometries;
80
+ }
81
+ } catch (e) {
82
+ // Игнорируем ошибки импорта
83
+ }
84
+ }
85
+
86
+ console.log('✅ Three.js патч: BufferGeometryUtils готов для web-ifc-three');
87
+ } catch (error) {
88
+ console.warn('Three.js патч: ошибка при создании патча:', error.message);
89
+ }
@@ -1,11 +1,12 @@
1
1
  // Сервис загрузки IFC моделей и добавления их в сцену three.js
2
2
  // Требует three@^0.149 и web-ifc-three совместимой версии
3
3
 
4
- import { IFCLoader } from "web-ifc-three/IFCLoader";
4
+ import { IFCLoader } from "web-ifc-three/IFCLoader.js";
5
5
  // Примечание: IFCWorker не используется, так как мы отключаем Web Workers
6
6
  // для стабильности работы в различных окружениях
7
7
 
8
- // Патч совместимости будет применен после инициализации WASM
8
+ // Применяем патч совместимости сразу при импорте
9
+ import '../compat/three-compat-patch.js';
9
10
 
10
11
  export class IfcService {
11
12
  /**
@@ -41,9 +42,6 @@ export class IfcService {
41
42
  // Настройка конфигурации web-ifc
42
43
  this._setupWebIfcConfig();
43
44
 
44
- // Применяем патч совместимости Three.js после успешной инициализации
45
- this._applyThreeJsPatch();
46
-
47
45
  } catch (error) {
48
46
  console.error('IfcService: критическая ошибка инициализации:', error);
49
47
  this._handleCriticalError(error);
@@ -113,22 +111,6 @@ export class IfcService {
113
111
  }
114
112
  }
115
113
 
116
- /**
117
- * Применяет патч совместимости для Three.js 0.149+
118
- * @private
119
- */
120
- _applyThreeJsPatch() {
121
- try {
122
- // Динамически импортируем патч совместимости
123
- import('../compat/three-compat-patch.js').then(() => {
124
- console.log('✅ IfcService: Патч совместимости Three.js применен');
125
- }).catch(error => {
126
- console.warn('IfcService: не удалось применить патч совместимости:', error.message);
127
- });
128
- } catch (error) {
129
- console.warn('IfcService: ошибка при применении патча совместимости:', error.message);
130
- }
131
- }
132
114
 
133
115
  /**
134
116
  * Обработка критических ошибок инициализации
package/src/index.js CHANGED
@@ -1,10 +1,9 @@
1
1
  // Основная точка входа пакета @sequent-org/ifc-viewer
2
2
  // Автоматически подключает стили и экспортирует API
3
3
 
4
- // Подключаем стили только в браузерном окружении
5
- if (typeof window !== 'undefined') {
6
- import('./style.css');
7
- }
4
+ // CSS импорт закомментирован для совместимости с Node.js
5
+ // Стили загружаются автоматически через IfcViewer.js
6
+ // import './style.css';
8
7
 
9
8
  // Экспортируем основной класс
10
9
  export { IfcViewer } from "./IfcViewer.js";