@sequent-org/ifc-viewer 1.0.21-ci.15.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.21-ci.15.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",
@@ -70,6 +70,19 @@ try {
70
70
  globalThis.__THREE_BUFFER_GEOMETRY_UTILS_PATCH__ = patchedUtils;
71
71
  }
72
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
+
73
86
  console.log('✅ Three.js патч: BufferGeometryUtils готов для web-ifc-three');
74
87
  } catch (error) {
75
88
  console.warn('Three.js патч: ошибка при создании патча:', error.message);
@@ -5,7 +5,8 @@ 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
  * Обработка критических ошибок инициализации