iflow-engine 1.1.4 → 1.1.6

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 (48) hide show
  1. package/dist/components/button-group/index.d.ts +1 -1
  2. package/dist/components/button-group/index.type.d.ts +3 -0
  3. package/dist/components/button-group/toolbar/buttons/ai-chat/index.d.ts +2 -1
  4. package/dist/components/button-group/toolbar/buttons/fullscreen/index.d.ts +2 -1
  5. package/dist/components/button-group/toolbar/buttons/home/index.d.ts +2 -1
  6. package/dist/components/button-group/toolbar/buttons/info/index.d.ts +2 -1
  7. package/dist/components/button-group/toolbar/buttons/map/index.d.ts +2 -1
  8. package/dist/components/button-group/toolbar/buttons/measure/index.d.ts +2 -1
  9. package/dist/components/button-group/toolbar/buttons/property/index.d.ts +2 -1
  10. package/dist/components/button-group/toolbar/buttons/section/section-axis/index.d.ts +2 -1
  11. package/dist/components/button-group/toolbar/buttons/section/section-box/index.d.ts +2 -1
  12. package/dist/components/button-group/toolbar/buttons/section/section-menu/index.d.ts +2 -1
  13. package/dist/components/button-group/toolbar/buttons/section/section-plane/index.d.ts +2 -1
  14. package/dist/components/button-group/toolbar/buttons/setting/index.d.ts +2 -1
  15. package/dist/components/button-group/toolbar/buttons/walk/walk-bird/index.d.ts +2 -1
  16. package/dist/components/button-group/toolbar/buttons/walk/walk-menu/index.d.ts +2 -1
  17. package/dist/components/button-group/toolbar/buttons/walk/walk-person/index.d.ts +2 -1
  18. package/dist/components/button-group/toolbar/buttons/zoom-box/index.d.ts +2 -1
  19. package/dist/components/engine/index.d.ts +13 -4
  20. package/dist/components/menu/buttons/four.d.ts +2 -1
  21. package/dist/components/menu/buttons/home.d.ts +2 -1
  22. package/dist/components/menu/buttons/info.d.ts +2 -1
  23. package/dist/components/menu/buttons/second.d.ts +2 -1
  24. package/dist/components/walk-path-panel/index.d.ts +4 -1
  25. package/dist/core/base-dialog-manager.d.ts +2 -0
  26. package/dist/core/base-manager.d.ts +2 -2
  27. package/dist/core/manager-registry.d.ts +5 -9
  28. package/dist/iflow-engine.es.js +4224 -4207
  29. package/dist/iflow-engine.es.js.map +1 -1
  30. package/dist/iflow-engine.umd.js +161 -161
  31. package/dist/iflow-engine.umd.js.map +1 -1
  32. package/dist/managers/ai-chat-manager.d.ts +2 -1
  33. package/dist/managers/button-group-manager.d.ts +2 -1
  34. package/dist/managers/component-detail-manager.d.ts +2 -1
  35. package/dist/managers/construct-tree-manager-btn.d.ts +2 -1
  36. package/dist/managers/dialog-manager.d.ts +2 -1
  37. package/dist/managers/engine-info-dialog-manager.d.ts +2 -0
  38. package/dist/managers/engine-manager.d.ts +4 -3
  39. package/dist/managers/measure-dialog-manager.d.ts +2 -0
  40. package/dist/managers/right-key-manager.d.ts +2 -1
  41. package/dist/managers/section-axis-dialog-manager.d.ts +2 -0
  42. package/dist/managers/section-box-dialog-manager.d.ts +2 -0
  43. package/dist/managers/section-plane-dialog-manager.d.ts +2 -0
  44. package/dist/managers/toolbar-manager.d.ts +2 -1
  45. package/dist/managers/walk-control-manager.d.ts +2 -1
  46. package/dist/managers/walk-path-dialog-manager.d.ts +2 -0
  47. package/dist/managers/walk-plan-view-dialog-manager.d.ts +2 -0
  48. package/package.json +1 -1
@@ -4,7 +4,7 @@ import { IBimComponent } from '../../types/component';
4
4
  import { EngineEvents } from '../../types/events';
5
5
  export declare class BimButtonGroup implements IBimComponent {
6
6
  private container;
7
- private options;
7
+ protected options: ButtonGroupOptions;
8
8
  private groups;
9
9
  private activeBtnIds;
10
10
  private btnRefs;
@@ -1,3 +1,4 @@
1
+ import { ManagerRegistry } from '../../core/manager-registry';
1
2
  export type ButtonType = 'button' | 'menu';
2
3
  /** 按钮组样式类型 */
3
4
  export type ButtonGroupType = 'default' | 'glass-pill';
@@ -76,6 +77,8 @@ export interface ButtonGroupOptions extends ButtonGroupColors {
76
77
  showLabel?: boolean;
77
78
  visibility?: Record<string, boolean>;
78
79
  className?: string;
80
+ /** Manager 注册表实例(用于事件通信) */
81
+ registry?: ManagerRegistry;
79
82
  }
80
83
  export interface ClickPayload {
81
84
  button: OptButton;
@@ -1,2 +1,3 @@
1
1
  import { ButtonConfig } from '../../../index.type';
2
- export declare const createAiChatButton: () => ButtonConfig;
2
+ import { ManagerRegistry } from '../../../../../core/manager-registry';
3
+ export declare const createAiChatButton: (registry: ManagerRegistry) => ButtonConfig;
@@ -1,2 +1,3 @@
1
1
  import { ButtonConfig } from '../../../index.type';
2
- export declare const createFullscreenButton: () => ButtonConfig;
2
+ import { ManagerRegistry } from '../../../../../core/manager-registry';
3
+ export declare const createFullscreenButton: (_registry?: ManagerRegistry) => ButtonConfig;
@@ -1,2 +1,3 @@
1
1
  import { ButtonConfig } from '../../../index.type';
2
- export declare const createHomeButton: () => ButtonConfig;
2
+ import { ManagerRegistry } from '../../../../../core/manager-registry';
3
+ export declare const createHomeButton: (registry: ManagerRegistry) => ButtonConfig;
@@ -1,2 +1,3 @@
1
1
  import { ButtonConfig } from '../../../index.type';
2
- export declare const createInfoButton: () => ButtonConfig;
2
+ import { ManagerRegistry } from '../../../../../core/manager-registry';
3
+ export declare const createInfoButton: (registry: ManagerRegistry) => ButtonConfig;
@@ -1,2 +1,3 @@
1
1
  import { ButtonConfig } from '../../../index.type';
2
- export declare const createMapButton: () => ButtonConfig;
2
+ import { ManagerRegistry } from '../../../../../core/manager-registry';
3
+ export declare const createMapButton: (registry: ManagerRegistry) => ButtonConfig;
@@ -1,2 +1,3 @@
1
1
  import { ButtonConfig } from '../../../index.type';
2
- export declare const createMeasureButton: () => ButtonConfig;
2
+ import { ManagerRegistry } from '../../../../../core/manager-registry';
3
+ export declare const createMeasureButton: (registry: ManagerRegistry) => ButtonConfig;
@@ -1,2 +1,3 @@
1
1
  import { ButtonConfig } from '../../../index.type';
2
- export declare const createPropertyButton: () => ButtonConfig;
2
+ import { ManagerRegistry } from '../../../../../core/manager-registry';
3
+ export declare const createPropertyButton: (registry: ManagerRegistry) => ButtonConfig;
@@ -1,2 +1,3 @@
1
1
  import { ButtonConfig } from '../../../../index.type';
2
- export declare const createSectionAxisButton: () => ButtonConfig;
2
+ import { ManagerRegistry } from '../../../../../../core/manager-registry';
3
+ export declare const createSectionAxisButton: (registry: ManagerRegistry) => ButtonConfig;
@@ -1,2 +1,3 @@
1
1
  import { ButtonConfig } from '../../../../index.type';
2
- export declare const createSectionBoxButton: () => ButtonConfig;
2
+ import { ManagerRegistry } from '../../../../../../core/manager-registry';
3
+ export declare const createSectionBoxButton: (registry: ManagerRegistry) => ButtonConfig;
@@ -1,2 +1,3 @@
1
1
  import { ButtonConfig } from '../../../../index.type';
2
- export declare const createSectionMenuButton: () => ButtonConfig;
2
+ import { ManagerRegistry } from '../../../../../../core/manager-registry';
3
+ export declare const createSectionMenuButton: (_registry?: ManagerRegistry) => ButtonConfig;
@@ -1,2 +1,3 @@
1
1
  import { ButtonConfig } from '../../../../index.type';
2
- export declare const createSectionPlaneButton: () => ButtonConfig;
2
+ import { ManagerRegistry } from '../../../../../../core/manager-registry';
3
+ export declare const createSectionPlaneButton: (registry: ManagerRegistry) => ButtonConfig;
@@ -1,2 +1,3 @@
1
1
  import { ButtonConfig } from '../../../index.type';
2
- export declare const createSettingButton: () => ButtonConfig;
2
+ import { ManagerRegistry } from '../../../../../core/manager-registry';
3
+ export declare const createSettingButton: (_registry?: ManagerRegistry) => ButtonConfig;
@@ -1,2 +1,3 @@
1
1
  import { ButtonConfig } from '../../../../index.type';
2
- export declare const createWalkBirdButton: () => ButtonConfig;
2
+ import { ManagerRegistry } from '../../../../../../core/manager-registry';
3
+ export declare const createWalkBirdButton: (_registry?: ManagerRegistry) => ButtonConfig;
@@ -1,2 +1,3 @@
1
1
  import { ButtonConfig } from '../../../../index.type';
2
- export declare const createWalkMenuButton: () => ButtonConfig;
2
+ import { ManagerRegistry } from '../../../../../../core/manager-registry';
3
+ export declare const createWalkMenuButton: (registry: ManagerRegistry) => ButtonConfig;
@@ -1,2 +1,3 @@
1
1
  import { ButtonConfig } from '../../../../index.type';
2
- export declare const createWalkPersonButton: () => ButtonConfig;
2
+ import { ManagerRegistry } from '../../../../../../core/manager-registry';
3
+ export declare const createWalkPersonButton: (_registry?: ManagerRegistry) => ButtonConfig;
@@ -1,2 +1,3 @@
1
1
  import { ButtonConfig } from '../../../index.type';
2
- export declare const createZoomBoxButton: () => ButtonConfig;
2
+ import { ManagerRegistry } from '../../../../../core/manager-registry';
3
+ export declare const createZoomBoxButton: (registry: ManagerRegistry) => ButtonConfig;
@@ -4,19 +4,23 @@ import { EngineOptions, ModelLoadOptions, EngineInfo } from './types';
4
4
  import { MeasureMode } from '../../types/measure';
5
5
  import { MeasureUnit, MeasurePrecision } from '../measure-panel/types';
6
6
  import { SectionBoxRange } from '../section-box-panel/types';
7
+ import { ManagerRegistry } from '../../core/manager-registry';
7
8
  export type { EngineOptions, ModelLoadOptions, EngineInfo };
8
9
  /**
9
10
  * 创建 Engine 实例的工厂函数
10
11
  * 兼容旧代码直接 import { createEngine } 的方式
11
12
  */
12
- export declare const createEngine: (options: EngineOptions) => Engine;
13
+ export declare const createEngine: (options: EngineOptions, registry: ManagerRegistry) => Engine;
13
14
  /**
14
15
  * 3D 引擎组件
15
16
  * 负责创建和管理第三方 3D 引擎实例
16
17
  */
17
18
  export declare class Engine implements IBimComponent {
19
+ /** 第三方 3D 引擎实例 */
18
20
  /** 第三方 3D 引擎实例 */
19
21
  private engine;
22
+ /** 管理器注册表实例 */
23
+ private registry;
20
24
  /** 引擎挂载的容器元素 */
21
25
  private container;
22
26
  /** 引擎容器 ID(用于传递给 createEngine) */
@@ -41,7 +45,7 @@ export declare class Engine implements IBimComponent {
41
45
  * 构造函数
42
46
  * @param options 3D 引擎配置选项
43
47
  */
44
- constructor(options: EngineOptions);
48
+ constructor(options: EngineOptions, registry: ManagerRegistry);
45
49
  /**
46
50
  * 初始化组件 (接口实现)
47
51
  * 创建 div 容器并初始化引擎
@@ -63,10 +67,10 @@ export declare class Engine implements IBimComponent {
63
67
  isInitialized(): boolean;
64
68
  /**
65
69
  * 加载 3D 模型
66
- * @param url 模型文件 URL
70
+ * @param urls 模型文件 URL 数组
67
71
  * @param options 加载选项(位置、旋转、缩放)
68
72
  */
69
- loadModel(url: string, options?: ModelLoadOptions): void;
73
+ loadModel(urls: string[], options?: ModelLoadOptions): void;
70
74
  /**
71
75
  * 回到主视角
72
76
  * @returns
@@ -88,6 +92,11 @@ export declare class Engine implements IBimComponent {
88
92
  * 销毁 3D 引擎,释放 GPU 资源
89
93
  */
90
94
  dispose(): void;
95
+ /**
96
+ * 调整渲染器尺寸
97
+ * 容器大小变化时调用,自动更新渲染器、相机投影矩阵和后处理合成器
98
+ */
99
+ resize(): void;
91
100
  /**
92
101
  * 激活测量功能
93
102
  * @param mode 测量类型
@@ -1,2 +1,3 @@
1
1
  import { MenuItemConfig } from '../item';
2
- export declare const fourMenuButton: () => MenuItemConfig;
2
+ import { ManagerRegistry } from '../../../core/manager-registry';
3
+ export declare const fourMenuButton: (registry: ManagerRegistry) => MenuItemConfig;
@@ -1,2 +1,3 @@
1
1
  import { MenuItemConfig } from '../item';
2
- export declare const homeMenuButton: () => MenuItemConfig;
2
+ import { ManagerRegistry } from '../../../core/manager-registry';
3
+ export declare const homeMenuButton: (registry: ManagerRegistry) => MenuItemConfig;
@@ -1,2 +1,3 @@
1
1
  import { MenuItemConfig } from '../item';
2
- export declare const infoMenuButton: () => MenuItemConfig;
2
+ import { ManagerRegistry } from '../../../core/manager-registry';
3
+ export declare const infoMenuButton: (registry: ManagerRegistry) => MenuItemConfig;
@@ -1,2 +1,3 @@
1
1
  import { MenuItemConfig } from '../item';
2
- export declare const secondMenuButton: () => MenuItemConfig;
2
+ import { ManagerRegistry } from '../../../core/manager-registry';
3
+ export declare const secondMenuButton: (registry: ManagerRegistry) => MenuItemConfig;
@@ -1,17 +1,20 @@
1
1
  import { ThemeConfig } from '../../themes/types';
2
2
  import { IBimComponent } from '../../types/component';
3
+ import { ManagerRegistry } from '../../core/manager-registry';
3
4
  /**
4
5
  * 路径漫游面板组件
5
6
  * 提供漫游点的添加、删除、跳转和播放功能
6
7
  */
7
8
  export declare class WalkPathPanel implements IBimComponent {
8
9
  element: HTMLElement;
9
- /** 管理器注册表实例 */
10
+ /** 管理器注册表実例 */
10
11
  private registry;
12
+ /** 管理器注册表实例 */
11
13
  /** 国际化订阅取消函数 */
12
14
  private unsubscribeLocale;
13
15
  /** 主题订阅取消函数 */
14
16
  private unsubscribeTheme;
17
+ constructor(registry: ManagerRegistry);
15
18
  /** 漫游点列表 */
16
19
  private points;
17
20
  /** 漫游时间(毫秒) */
@@ -1,4 +1,5 @@
1
1
  import { BaseManager } from './base-manager';
2
+ import { ManagerRegistry } from './manager-registry';
2
3
  import { BimDialog } from '../components/dialog';
3
4
  /** 对话框配置选项 */
4
5
  export interface DialogManagerOptions {
@@ -16,6 +17,7 @@ export declare abstract class BaseDialogManager extends BaseManager {
16
17
  protected dialog: BimDialog | null;
17
18
  /** 对话框是否可见 */
18
19
  protected isVisible: boolean;
20
+ constructor(registry: ManagerRegistry);
19
21
  /** 对话框唯一标识(子类必须实现) */
20
22
  protected abstract get dialogId(): string;
21
23
  /** 对话框标题,支持国际化 key(子类必须实现) */
@@ -2,7 +2,7 @@ import { ManagerRegistry } from './manager-registry';
2
2
  import { EngineEvents } from '../types/events';
3
3
  /**
4
4
  * Manager 抽象基类
5
- * - 自动获取 Registry 实例
5
+ * - 通过构造函数接收 Registry 实例
6
6
  * - 自动管理事件订阅的清理
7
7
  */
8
8
  export declare abstract class BaseManager {
@@ -10,7 +10,7 @@ export declare abstract class BaseManager {
10
10
  protected registry: ManagerRegistry;
11
11
  /** 事件订阅列表,用于自动清理 */
12
12
  private subscriptions;
13
- constructor();
13
+ constructor(registry: ManagerRegistry);
14
14
  /**
15
15
  * 订阅事件(自动追踪,destroy 时自动取消)
16
16
  * @param event 事件名称
@@ -16,12 +16,10 @@ import { EngineInfoDialogManager } from '../managers/engine-info-dialog-manager'
16
16
  import { ComponentDetailManager } from '../managers/component-detail-manager';
17
17
  import { AiChatManager } from '../managers/ai-chat-manager';
18
18
  /**
19
- * Manager 注册表 - 单例模式
20
- * 提供所有 Manager 的全局访问点,替代 engine 层层传递
19
+ * Manager 注册表 - 实例模式
20
+ * 每个 BimEngine 创建独立的 Registry 实例,替代旧的全局单例
21
21
  */
22
22
  export declare class ManagerRegistry {
23
- /** 单例实例 */
24
- private static instance;
25
23
  /** 事件发射器 */
26
24
  private eventEmitter;
27
25
  /** 主容器元素 */
@@ -60,11 +58,9 @@ export declare class ManagerRegistry {
60
58
  componentDetail: ComponentDetailManager | null;
61
59
  /** AI 聊天管理器 */
62
60
  aiChat: AiChatManager | null;
63
- private constructor();
64
- /** 获取单例实例 */
65
- static getInstance(): ManagerRegistry;
66
- /** 重置单例(用于测试或重新初始化) */
67
- static reset(): void;
61
+ constructor();
62
+ /** 重置(清理事件和引用) */
63
+ reset(): void;
68
64
  /**
69
65
  * 发送事件
70
66
  * @param event 事件名称