iflow-engine 1.0.6 → 1.0.8

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 (110) hide show
  1. package/dist/assets/hdr/001.hdr +0 -0
  2. package/dist/assets/svg/rotate-orbit.svg +1 -0
  3. package/dist/assets/viewcube/cn_back.png +0 -0
  4. package/dist/assets/viewcube/cn_bottom.png +0 -0
  5. package/dist/assets/viewcube/cn_front.png +0 -0
  6. package/dist/assets/viewcube/cn_left.png +0 -0
  7. package/dist/assets/viewcube/cn_right.png +0 -0
  8. package/dist/assets/viewcube/cn_top.png +0 -0
  9. package/dist/assets/viewcube/home.png +0 -0
  10. package/dist/draco/DRACOLoader.js +739 -0
  11. package/dist/draco/draco_decoder.js +52 -0
  12. package/dist/draco/draco_decoder.wasm +0 -0
  13. package/dist/draco/draco_encoder.js +33 -0
  14. package/dist/draco/draco_wasm_wrapper.js +104 -0
  15. package/dist/engine/src/bim-engine.d.ts +51 -0
  16. package/dist/engine/src/components/ai-chat/index.d.ts +202 -0
  17. package/dist/engine/src/components/ai-chat/types.d.ts +133 -0
  18. package/dist/engine/src/components/button-group/index.d.ts +89 -0
  19. package/dist/engine/src/components/button-group/index.type.d.ts +84 -0
  20. package/dist/engine/src/components/button-group/toolbar/buttons/ai-chat/index.d.ts +2 -0
  21. package/dist/engine/src/components/button-group/toolbar/buttons/fullscreen/index.d.ts +2 -0
  22. package/dist/engine/src/components/button-group/toolbar/buttons/home/index.d.ts +2 -0
  23. package/dist/engine/src/components/button-group/toolbar/buttons/info/icon.d.ts +1 -0
  24. package/dist/engine/src/components/button-group/toolbar/buttons/info/index.d.ts +2 -0
  25. package/dist/engine/src/components/button-group/toolbar/buttons/map/index.d.ts +2 -0
  26. package/dist/engine/src/components/button-group/toolbar/buttons/measure/index.d.ts +2 -0
  27. package/dist/engine/src/components/button-group/toolbar/buttons/property/index.d.ts +2 -0
  28. package/dist/engine/src/components/button-group/toolbar/buttons/section/section-axis/index.d.ts +2 -0
  29. package/dist/engine/src/components/button-group/toolbar/buttons/section/section-box/index.d.ts +2 -0
  30. package/dist/engine/src/components/button-group/toolbar/buttons/section/section-menu/index.d.ts +2 -0
  31. package/dist/engine/src/components/button-group/toolbar/buttons/section/section-plane/index.d.ts +2 -0
  32. package/dist/engine/src/components/button-group/toolbar/buttons/setting/index.d.ts +2 -0
  33. package/dist/engine/src/components/button-group/toolbar/buttons/walk/walk-bird/index.d.ts +2 -0
  34. package/dist/engine/src/components/button-group/toolbar/buttons/walk/walk-menu/index.d.ts +2 -0
  35. package/dist/engine/src/components/button-group/toolbar/buttons/walk/walk-person/index.d.ts +2 -0
  36. package/dist/engine/src/components/button-group/toolbar/buttons/zoom-box/index.d.ts +2 -0
  37. package/dist/engine/src/components/button-group/toolbar/index.d.ts +4 -0
  38. package/dist/engine/src/components/collapse/index.d.ts +21 -0
  39. package/dist/engine/src/components/collapse/types.d.ts +34 -0
  40. package/dist/engine/src/components/description/index.d.ts +25 -0
  41. package/dist/engine/src/components/description/types.d.ts +43 -0
  42. package/dist/engine/src/components/dialog/index.d.ts +87 -0
  43. package/dist/engine/src/components/dialog/index.type.d.ts +57 -0
  44. package/dist/engine/src/components/engine/index.d.ts +436 -0
  45. package/dist/engine/src/components/engine/types.d.ts +31 -0
  46. package/dist/engine/src/components/measure-panel/index.d.ts +185 -0
  47. package/dist/engine/src/components/measure-panel/types.d.ts +87 -0
  48. package/dist/engine/src/components/menu/buttons/four.d.ts +2 -0
  49. package/dist/engine/src/components/menu/buttons/home.d.ts +2 -0
  50. package/dist/engine/src/components/menu/buttons/info.d.ts +2 -0
  51. package/dist/engine/src/components/menu/buttons/second.d.ts +2 -0
  52. package/dist/engine/src/components/menu/index.d.ts +57 -0
  53. package/dist/engine/src/components/menu/item.d.ts +12 -0
  54. package/dist/engine/src/components/menu/types.d.ts +34 -0
  55. package/dist/engine/src/components/right-key/index.d.ts +55 -0
  56. package/dist/engine/src/components/right-key/types.d.ts +20 -0
  57. package/dist/engine/src/components/section-axis-panel/index.d.ts +88 -0
  58. package/dist/engine/src/components/section-axis-panel/types.d.ts +31 -0
  59. package/dist/engine/src/components/section-box-panel/index.d.ts +53 -0
  60. package/dist/engine/src/components/section-box-panel/types.d.ts +60 -0
  61. package/dist/engine/src/components/section-plane-panel/index.d.ts +48 -0
  62. package/dist/engine/src/components/section-plane-panel/types.d.ts +22 -0
  63. package/dist/engine/src/components/tab/index.d.ts +64 -0
  64. package/dist/engine/src/components/tab/index.type.d.ts +35 -0
  65. package/dist/engine/src/components/tree/index.d.ts +71 -0
  66. package/dist/engine/src/components/tree/tree-node.d.ts +60 -0
  67. package/dist/engine/src/components/tree/types.d.ts +74 -0
  68. package/dist/engine/src/components/walk-control-panel/index.d.ts +46 -0
  69. package/dist/engine/src/components/walk-control-panel/types.d.ts +64 -0
  70. package/dist/engine/src/components/walk-path-panel/index.d.ts +102 -0
  71. package/dist/engine/src/components/walk-path-panel/types.d.ts +22 -0
  72. package/dist/engine/src/components/walk-plan-view-panel/index.d.ts +16 -0
  73. package/dist/engine/src/core/base-dialog-manager.d.ts +57 -0
  74. package/dist/engine/src/core/base-manager.d.ts +31 -0
  75. package/dist/engine/src/core/event-emitter.d.ts +36 -0
  76. package/dist/engine/src/core/manager-registry.d.ts +89 -0
  77. package/dist/engine/src/index.d.ts +10 -0
  78. package/dist/engine/src/locales/en-US.d.ts +2 -0
  79. package/dist/engine/src/locales/types.d.ts +236 -0
  80. package/dist/engine/src/locales/zh-CN.d.ts +2 -0
  81. package/dist/engine/src/managers/ai-chat-manager.d.ts +86 -0
  82. package/dist/engine/src/managers/button-group-manager.d.ts +35 -0
  83. package/dist/engine/src/managers/component-detail-manager.d.ts +24 -0
  84. package/dist/engine/src/managers/construct-tree-manager-btn.d.ts +89 -0
  85. package/dist/engine/src/managers/dialog-manager.d.ts +12 -0
  86. package/dist/engine/src/managers/engine-info-dialog-manager.d.ts +12 -0
  87. package/dist/engine/src/managers/engine-manager.d.ts +242 -0
  88. package/dist/engine/src/managers/measure-dialog-manager.d.ts +24 -0
  89. package/dist/engine/src/managers/right-key-manager.d.ts +34 -0
  90. package/dist/engine/src/managers/section-axis-dialog-manager.d.ts +55 -0
  91. package/dist/engine/src/managers/section-box-dialog-manager.d.ts +58 -0
  92. package/dist/engine/src/managers/section-plane-dialog-manager.d.ts +35 -0
  93. package/dist/engine/src/managers/toolbar-manager.d.ts +81 -0
  94. package/dist/engine/src/managers/walk-control-manager.d.ts +21 -0
  95. package/dist/engine/src/managers/walk-path-dialog-manager.d.ts +33 -0
  96. package/dist/engine/src/managers/walk-plan-view-dialog-manager.d.ts +33 -0
  97. package/dist/engine/src/services/locale.d.ts +35 -0
  98. package/dist/engine/src/services/theme.d.ts +35 -0
  99. package/dist/engine/src/themes/presets.d.ts +15 -0
  100. package/dist/engine/src/themes/types.d.ts +261 -0
  101. package/dist/engine/src/types/component.d.ts +27 -0
  102. package/dist/engine/src/types/events.d.ts +104 -0
  103. package/dist/engine/src/types/measure.d.ts +57 -0
  104. package/dist/engine/src/utils/icon-manager.d.ts +10 -0
  105. package/dist/iflow-engine.es.js +16816 -11998
  106. package/dist/iflow-engine.es.js.map +1 -1
  107. package/dist/iflow-engine.umd.js +2264 -173
  108. package/dist/iflow-engine.umd.js.map +1 -1
  109. package/package.json +3 -3
  110. package/dist/index.d.ts +0 -1963
@@ -0,0 +1,236 @@
1
+ /**
2
+ * 翻译字典接口
3
+ * 定义所有可用的翻译键值对结构,保证类型安全
4
+ */
5
+ export interface TranslationDictionary {
6
+ common: {
7
+ title: string;
8
+ description: string;
9
+ openTestDialog: string;
10
+ openInfoDialog: string;
11
+ };
12
+ toolbar: {
13
+ home: string;
14
+ measure: string;
15
+ zoomBox: string;
16
+ info: string;
17
+ location: string;
18
+ setting: string;
19
+ walk: string;
20
+ map: string;
21
+ property: string;
22
+ fullscreen: string;
23
+ walkMenu: string;
24
+ walkPerson: string;
25
+ walkBird: string;
26
+ tree: string;
27
+ section: string;
28
+ sectionPlane: string;
29
+ sectionAxis: string;
30
+ sectionBox: string;
31
+ };
32
+ panel: {
33
+ property: {
34
+ title: string;
35
+ base: string;
36
+ material: string;
37
+ advanced: string;
38
+ tab: {
39
+ props: string;
40
+ material: string;
41
+ };
42
+ };
43
+ componentDetail: {
44
+ title: string;
45
+ noSelection: string;
46
+ };
47
+ };
48
+ dialog: {
49
+ testTitle: string;
50
+ testContent: string;
51
+ };
52
+ menu: {
53
+ info: string;
54
+ home: string;
55
+ componentDetail: string;
56
+ hideSelected: string;
57
+ transparentSelected: string;
58
+ cancelTranslucent: string;
59
+ isolateSelected: string;
60
+ hideOthers: string;
61
+ transparentOthers: string;
62
+ fitSectionBox: string;
63
+ showAll: string;
64
+ /** 快速选择 */
65
+ quickSelect: string;
66
+ /** 选择同类模型 */
67
+ selectSameType: string;
68
+ /** 选择同层模型 */
69
+ selectSameLevel: string;
70
+ /** 选择同层同类模型 */
71
+ selectSameLevelType: string;
72
+ };
73
+ tree: {
74
+ searchPlaceholder: string;
75
+ };
76
+ constructTree: {
77
+ title: string;
78
+ };
79
+ tab: {
80
+ component: string;
81
+ system: string;
82
+ space: string;
83
+ type: string;
84
+ major: string;
85
+ };
86
+ measure: {
87
+ btnName: string;
88
+ dialogTitle: string;
89
+ modes: {
90
+ clearHeight: string;
91
+ clearDistance: string;
92
+ distance: string;
93
+ elevation: string;
94
+ point: string;
95
+ angle: string;
96
+ area: string;
97
+ slope: string;
98
+ };
99
+ actions: {
100
+ expand: string;
101
+ collapse: string;
102
+ clearAll: string;
103
+ settings: string;
104
+ };
105
+ labels: {
106
+ currentMode: string;
107
+ x: string;
108
+ y: string;
109
+ z: string;
110
+ value: {
111
+ clearHeight: string;
112
+ clearDistance: string;
113
+ distance: string;
114
+ elevation: string;
115
+ point: string;
116
+ angle: string;
117
+ area: string;
118
+ slope: string;
119
+ };
120
+ };
121
+ /**
122
+ * 设置面板(单位/精度)
123
+ */
124
+ settings: {
125
+ title: string;
126
+ unit: string;
127
+ precision: string;
128
+ hint: string;
129
+ save: string;
130
+ cancel: string;
131
+ };
132
+ };
133
+ sectionPlane: {
134
+ dialogTitle: string;
135
+ actions: {
136
+ hide: string;
137
+ reverse: string;
138
+ reset: string;
139
+ };
140
+ };
141
+ sectionAxis: {
142
+ dialogTitle: string;
143
+ actions: {
144
+ hide: string;
145
+ reverse: string;
146
+ axisX: string;
147
+ axisY: string;
148
+ axisZ: string;
149
+ };
150
+ };
151
+ sectionBox: {
152
+ dialogTitle: string;
153
+ actions: {
154
+ hide: string;
155
+ reverse: string;
156
+ fitToModel: string;
157
+ reset: string;
158
+ };
159
+ axes: {
160
+ x: string;
161
+ y: string;
162
+ z: string;
163
+ };
164
+ };
165
+ walkControl: {
166
+ speed: string;
167
+ gravity: string;
168
+ collision: string;
169
+ characterModel: {
170
+ label: string;
171
+ constructionWorker: string;
172
+ officeMale: string;
173
+ };
174
+ walkMode: {
175
+ label: string;
176
+ walk: string;
177
+ run: string;
178
+ };
179
+ exit: string;
180
+ path: {
181
+ /** 对话框标题 */
182
+ dialogTitle: string;
183
+ /** 漫游时间标签 */
184
+ duration: string;
185
+ /** 时间单位 */
186
+ durationUnit: string;
187
+ /** 循环播放 */
188
+ loop: string;
189
+ /** 添加漫游点按钮 */
190
+ addPoint: string;
191
+ /** 删除全部按钮 */
192
+ deleteAll: string;
193
+ /** 漫游点前缀 */
194
+ point: string;
195
+ /** 播放按钮 */
196
+ play: string;
197
+ /** 停止按钮 */
198
+ stop: string;
199
+ /** 无漫游点提示 */
200
+ noPoints: string;
201
+ };
202
+ };
203
+ info: {
204
+ dialogTitle: string;
205
+ meshCount: string;
206
+ totalTriangles: string;
207
+ totalVertices: string;
208
+ };
209
+ aiChat: {
210
+ title: string;
211
+ placeholder: string;
212
+ quickPrompt: {
213
+ summarize: string;
214
+ explain: string;
215
+ generate: string;
216
+ };
217
+ action: {
218
+ new: string;
219
+ history: string;
220
+ settings: string;
221
+ close: string;
222
+ };
223
+ helper: {
224
+ newline: string;
225
+ send: string;
226
+ };
227
+ thinking: string;
228
+ other: string;
229
+ otherPlaceholder: string;
230
+ submit: string;
231
+ };
232
+ }
233
+ /**
234
+ * 语言��码类型
235
+ */
236
+ export type LocaleType = 'zh-CN' | 'en-US';
@@ -0,0 +1,2 @@
1
+ import { TranslationDictionary } from './types';
2
+ export declare const zhCN: TranslationDictionary;
@@ -0,0 +1,86 @@
1
+ import { Message, QuestionOption, StepStatus } from '../components/ai-chat/types';
2
+ /**
3
+ * AI 聊天管理器
4
+ * 管理 AI 聊天组件的生命周期和消息交互
5
+ */
6
+ export declare class AiChatManager {
7
+ /** AI 聊天组件实例 */
8
+ private aiChat;
9
+ /** Manager 注册表 */
10
+ private registry;
11
+ /** 是否已初始化 */
12
+ private initialized;
13
+ constructor();
14
+ /**
15
+ * 初始化 AI 聊天组件
16
+ * 创建 AiChat 实例并注册事件
17
+ */
18
+ init(): void;
19
+ /**
20
+ * 显示 AI 聊天抽屉
21
+ */
22
+ show(): void;
23
+ /**
24
+ * 隐藏 AI 聊天抽屉
25
+ */
26
+ hide(): void;
27
+ /**
28
+ * 切换 AI 聊天抽屉显示状态
29
+ */
30
+ toggle(): void;
31
+ /**
32
+ * 检查 AI 聊天抽屉是否可见
33
+ */
34
+ isVisible(): boolean;
35
+ /**
36
+ * 添加用户消息
37
+ * @param content 消息内容
38
+ * @returns 消息 ID
39
+ */
40
+ addUserMessage(content: string): string;
41
+ /**
42
+ * 添加 AI 消息
43
+ * @param content 消息内容
44
+ * @returns 消息 ID
45
+ */
46
+ addAiMessage(content: string): string;
47
+ /**
48
+ * 添加步骤消息
49
+ * @param status 步骤状态
50
+ * @param content 步骤描述
51
+ * @returns 消息 ID
52
+ */
53
+ addStepMessage(status: StepStatus, content: string): string;
54
+ /**
55
+ * 添加思考中消息
56
+ * @returns 消息 ID
57
+ */
58
+ addThinkingMessage(): string;
59
+ /**
60
+ * 添加问答卡片消息
61
+ * @param title 问题标题
62
+ * @param question 问题内容
63
+ * @param options 选项列表
64
+ * @returns 消息 ID
65
+ */
66
+ addQuestionMessage(title: string, question: string, options: QuestionOption[]): string;
67
+ /**
68
+ * 更新消息
69
+ * @param id 消息 ID
70
+ * @param updates 更新内容
71
+ */
72
+ updateMessage(id: string, updates: Partial<Message>): void;
73
+ /**
74
+ * 删除消息
75
+ * @param id 消息 ID
76
+ */
77
+ removeMessage(id: string): void;
78
+ /**
79
+ * 清空所有消息
80
+ */
81
+ clearMessages(): void;
82
+ /**
83
+ * 销毁 AI 聊天管理器
84
+ */
85
+ destroy(): void;
86
+ }
@@ -0,0 +1,35 @@
1
+ import { BimButtonGroup } from '../components/button-group';
2
+ import { ButtonGroupOptions } from '../components/button-group/index.type';
3
+ import { ThemeConfig } from '../themes/types';
4
+ import { BaseManager } from '../core/base-manager';
5
+ /**
6
+ * 按钮组管理器
7
+ * 统一管理多个按钮组的创建、主题更新和销毁
8
+ */
9
+ export declare class ButtonGroupManager extends BaseManager {
10
+ /** 按钮组映射表 */
11
+ private groups;
12
+ /** 容器元素 */
13
+ private container;
14
+ constructor(container: HTMLElement);
15
+ /**
16
+ * 创建按钮组
17
+ * @param id 按钮组 ID
18
+ * @param options 按钮组配置
19
+ * @returns 按钮组实例
20
+ */
21
+ create(id: string, options: Omit<ButtonGroupOptions, 'container'>): BimButtonGroup;
22
+ /**
23
+ * 获取按钮组
24
+ * @param id 按钮组 ID
25
+ * @returns 按钮组实例
26
+ */
27
+ get(id: string): BimButtonGroup | undefined;
28
+ /**
29
+ * 更新所有按钮组的主题
30
+ * @param theme 主题配置
31
+ */
32
+ updateTheme(theme: ThemeConfig): void;
33
+ /** 销毁管理器和所有按钮组 */
34
+ destroy(): void;
35
+ }
@@ -0,0 +1,24 @@
1
+ import { BaseManager } from '../core/base-manager';
2
+ export declare class ComponentDetailManager extends BaseManager {
3
+ private dialogId;
4
+ private dialog;
5
+ private currentSelection;
6
+ private unsubscribeSelected;
7
+ private unsubscribeDeselected;
8
+ private tabInstance;
9
+ private propertiesData;
10
+ constructor();
11
+ init(): void;
12
+ show(): void;
13
+ private createDialog;
14
+ private loadAndRenderContent;
15
+ private showLoading;
16
+ private renderNoSelection;
17
+ private renderTabbedContent;
18
+ private createPropertiesPanel;
19
+ private createMaterialsPanel;
20
+ private createCategoryContent;
21
+ isOpen(): boolean;
22
+ hide(): void;
23
+ destroy(): void;
24
+ }
@@ -0,0 +1,89 @@
1
+ import { ButtonGroupColors, ButtonConfig } from '../components/button-group/index.type';
2
+ import { BaseManager } from '../core/base-manager';
3
+ /**
4
+ * 构件树管理器
5
+ *
6
+ * 职责:
7
+ * 1. 管理构件树按钮的生命周期(创建、显示/隐藏、销毁)
8
+ * 2. 管理构件树对话框(打开、关闭、内容渲染)
9
+ * 3. 处理树节点点击事件,调用 3D 引擎高亮模型
10
+ *
11
+ * 使用示例:
12
+ * ```typescript
13
+ * const manager = new ConstructTreeManagerBtn(container);
14
+ * manager.openConstructTreeDialog(); // 打开构件树对话框
15
+ * ```
16
+ */
17
+ export declare class ConstructTreeManagerBtn extends BaseManager {
18
+ /** 按钮组实例 - 用于渲染构件树按钮 */
19
+ private toolbar;
20
+ /** 按钮容器元素 */
21
+ private toolbarContainer;
22
+ /** 主容器元素 - 按钮挂载的父容器 */
23
+ private container;
24
+ /** 构件树对话框实例 */
25
+ private dialog;
26
+ /**
27
+ * 创建构件树管理器
28
+ * @param container - 按钮挂载的容器元素
29
+ */
30
+ constructor(container: HTMLElement);
31
+ /**
32
+ * 初始化按钮
33
+ * 创建按钮容器和按钮组,添加构件树按钮
34
+ */
35
+ private init;
36
+ /**
37
+ * 打开构件树对话框
38
+ *
39
+ * 流程:
40
+ * 1. 隐藏按钮组
41
+ * 2. 从 3D 引擎获取三种树数据(楼层/类型/专业)
42
+ * 3. 转换数据格式
43
+ * 4. 创建三个 BimTree 实例
44
+ * 5. 创建选项卡组件
45
+ * 6. 创建对话框并显示
46
+ */
47
+ openConstructTreeDialog(): Promise<void>;
48
+ /** 刷新渲染 */
49
+ refresh(): void;
50
+ /** 销毁管理器 */
51
+ destroy(): void;
52
+ /**
53
+ * 添加按钮组
54
+ * @param groupId - 组 ID
55
+ * @param beforeGroupId - 插入位置
56
+ */
57
+ addGroup(groupId: string, beforeGroupId?: string): void;
58
+ /**
59
+ * 添加按钮
60
+ * @param config - 按钮配置
61
+ */
62
+ addButton(config: ButtonConfig): void;
63
+ /**
64
+ * 设置按钮可见性
65
+ * @param id - 按钮 ID
66
+ * @param v - 是否可见
67
+ */
68
+ setButtonVisibility(id: string, v: boolean): void;
69
+ /**
70
+ * 设置是否显示标签
71
+ * @param show - 是否显示
72
+ */
73
+ setShowLabel(show: boolean): void;
74
+ /**
75
+ * 设置按钮组可见性
76
+ * @param visible - 是否可见
77
+ */
78
+ setVisible(visible: boolean): void;
79
+ /**
80
+ * 设置背景颜色
81
+ * @param color - 颜色值
82
+ */
83
+ setBackgroundColor(color: string): void;
84
+ /**
85
+ * 设置按钮组颜色
86
+ * @param colors - 颜色配置
87
+ */
88
+ setColors(colors: ButtonGroupColors): void;
89
+ }
@@ -0,0 +1,12 @@
1
+ import { BimDialog } from '../components/dialog';
2
+ import { DialogOptions } from '../components/dialog/index.type';
3
+ import { ThemeConfig } from '../themes/types';
4
+ import { BaseManager } from '../core/base-manager';
5
+ export declare class DialogManager extends BaseManager {
6
+ private container;
7
+ private activeDialogs;
8
+ constructor(container: HTMLElement);
9
+ create(options: Omit<DialogOptions, 'container'>): BimDialog;
10
+ updateTheme(theme: ThemeConfig): void;
11
+ destroy(): void;
12
+ }
@@ -0,0 +1,12 @@
1
+ import { BaseDialogManager } from '../core/base-dialog-manager';
2
+ export declare class EngineInfoDialogManager extends BaseDialogManager {
3
+ protected get dialogId(): string;
4
+ protected get dialogTitle(): string;
5
+ protected get dialogWidth(): number;
6
+ init(): void;
7
+ protected getDialogPosition(): {
8
+ x: number;
9
+ y: number;
10
+ };
11
+ protected createContent(): HTMLElement;
12
+ }