@soonspacejs/plugin-cps-soonmanager 2.11.36 → 2.11.38

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/dist/index.d.ts DELETED
@@ -1,227 +0,0 @@
1
- import SoonSpace, { TopologyNodeInfo } from 'soonspacejs';
2
- import type { BaseObject3D, Group, TopologyInfo } from 'soonspacejs/types/Library';
3
- import { PoiNodeData } from '@soonspacejs/plugin-poi-renderer';
4
- import EffectPlugin from '@soonspacejs/plugin-effect';
5
- import SoonFlow from '@soonflow/core';
6
- import { Tween } from '@tweenjs/tween.js';
7
- import { IMetadata, ITreeData, IPoiData, ITopologyPath, ILoadSceneOptions, TPropertiesMap, TAnimationsMap, IPlayAnimationByIdOptions, TModelVisionsMap, IPresetEffectsOptions, ConstructorOptions } from './types';
8
- declare class CpsSoonmanagerPlugin {
9
- #private;
10
- readonly ssp: SoonSpace;
11
- get path(): string;
12
- set path(val: string);
13
- /**
14
- * 场景 group 包裹
15
- */
16
- sceneGroup: Group | null;
17
- /**
18
- * 场景元数据
19
- */
20
- metaData: IMetadata | null;
21
- /**
22
- * 模型树
23
- */
24
- treeData: ITreeData[] | null;
25
- /**
26
- * poi 数据
27
- */
28
- poiData: IPoiData[] | null;
29
- /**
30
- * 数据源
31
- */
32
- dataSourceData: any | null;
33
- /**
34
- * 拓扑路径
35
- */
36
- topologyData: TopologyInfo[] | null;
37
- /**
38
- * 自定义属性
39
- */
40
- propertiesData: TPropertiesMap | null;
41
- objectsAnimations: Map<string, Set<Tween<any>>>;
42
- /**
43
- * 动画
44
- */
45
- animationsData: TAnimationsMap | null;
46
- /**
47
- * 模型视角
48
- */
49
- modelVisionsData: TModelVisionsMap | null;
50
- /**
51
- * effect 插件
52
- */
53
- effectPlugin: EffectPlugin | null;
54
- /**
55
- * 流程引擎实咧
56
- */
57
- soonflow: SoonFlow;
58
- /**
59
- * 流程数据
60
- */
61
- flowData: any[] | null;
62
- constructor(ssp: SoonSpace, option?: ConstructorOptions);
63
- /**
64
- * 设置 key
65
- * @param key
66
- */
67
- setKey(key: string): void;
68
- /**
69
- * 获取场景元数据
70
- */
71
- fetchMetaData(): Promise<IMetadata>;
72
- /**
73
- * 获取场景树(旧版资源包使用)
74
- * @returns
75
- */
76
- fetchTreeData(): Promise<ITreeData[]>;
77
- /**
78
- * 获取 Poi 数据
79
- * @returns
80
- */
81
- fetchPoiData(): Promise<IPoiData[]>;
82
- /**
83
- * 获取数据源数据
84
- * @returns
85
- */
86
- fetchDataSourceData(): Promise<any>;
87
- /**
88
- * 获取拓扑路径
89
- * @returns
90
- */
91
- fetchTopologyData(): Promise<ITopologyPath[]>;
92
- /**
93
- * 获取自定义属性
94
- * @returns
95
- */
96
- fetchPropertiesData(): Promise<TPropertiesMap>;
97
- /**
98
- * 获取动画
99
- * @returns
100
- */
101
- fetchAnimationsData(): Promise<TAnimationsMap>;
102
- /**
103
- * 获取模型视角
104
- * @returns
105
- */
106
- fetchModelVisionsData(): Promise<TModelVisionsMap>;
107
- /**
108
- * 格式化 Poi 数据完成 Poi Renderer 插件使用
109
- */
110
- formatPoiData: (poiData: IPoiData) => PoiNodeData;
111
- /**
112
- * 初始化 Poi
113
- */
114
- loadPoi(refreshByDataSource?: boolean): Promise<void>;
115
- /**
116
- * 通过数据源刷新 poi
117
- */
118
- refreshPoiByDataSource(): Promise<void>;
119
- /**
120
- * 根据 id 获取树节点
121
- */
122
- getTreeNodeById(id: ITreeData['id'], treeData?: ITreeData[] | null): ITreeData | undefined;
123
- /**
124
- * 设置 path
125
- * @param path
126
- */
127
- setPath(path: string): void;
128
- /**
129
- * 加载整个场景
130
- */
131
- loadScene(options?: ILoadSceneOptions): Promise<undefined>;
132
- /**
133
- * 预设效果
134
- */
135
- presetEffects(options?: IPresetEffectsOptions): Promise<void>;
136
- /**
137
- * 获取拓扑路径列表
138
- */
139
- getTopologies(): Promise<TopologyInfo[]>;
140
- /**
141
- * 对 nodes 排序(只适用于线路结构的拓扑路径)
142
- */
143
- sortTopologyNodes(topologyInfo: TopologyInfo, startNodeId?: TopologyNodeInfo['id']): TopologyInfo | undefined;
144
- /**
145
- * 播放动画
146
- * @deprecated
147
- */
148
- playAnimationById(id: string, animationIndex?: number, options?: IPlayAnimationByIdOptions): Promise<void>;
149
- /**
150
- * 播放动画
151
- */
152
- playObjectAnimation(object: BaseObject3D, animationIndex?: number, options?: IPlayAnimationByIdOptions): Promise<void>;
153
- /**
154
- * 停止对象动画
155
- */
156
- stopObjectAnimation(object: BaseObject3D): Promise<void>;
157
- /**
158
- * 飞向场景视角
159
- * @param index
160
- */
161
- flyToSceneFromVisionsData(index?: number): Promise<void>;
162
- /**
163
- * 飞向场景主视角
164
- * @param fallback 是否使用默认视角
165
- */
166
- flyToMainSceneFromVisionsData(fallback?: boolean): Promise<boolean>;
167
- /**
168
- * 飞向对象视角
169
- * @param object
170
- * @param index
171
- */
172
- flyToObjectFromVisionsData(object: BaseObject3D, index?: number): Promise<void>;
173
- /**
174
- * 飞向对象默认视角
175
- * @param fallback 是否使用默认视角
176
- */
177
- flyToMainObjectFromVisionsData(object: BaseObject3D, fallback?: boolean): Promise<boolean>;
178
- /**
179
- * 加载流程数据
180
- */
181
- loadFlowData(): Promise<{
182
- nodes: {
183
- inputs: import("@soonflow/plugin-soonmanager2-sync/dist/interface").Handle[];
184
- outputs: import("@soonflow/plugin-soonmanager2-sync/dist/interface").Handle[];
185
- isStartNode: boolean;
186
- id: string;
187
- name: string;
188
- flowId: string;
189
- type: import("@soonflow/plugin-soonmanager2-sync/dist/interface").FlowNodeTypesEnum;
190
- config: string;
191
- posX: number;
192
- posY: number;
193
- sortNum: number;
194
- enable: boolean;
195
- handlerList: import("@soonflow/plugin-soonmanager2-sync/dist/interface").Handle[];
196
- }[];
197
- edges: {
198
- sourceNodeHandleId: string;
199
- targetNodeHandleId: string;
200
- id: string;
201
- name: string;
202
- type: string;
203
- sourceHandlerId: string;
204
- sourceNodeId: string;
205
- targetHandlerId: string;
206
- targetNodeId: string;
207
- enable: boolean;
208
- }[];
209
- id: string;
210
- name: string;
211
- applyType: "AUTO" | "MANUAL";
212
- pid: string | null;
213
- nodeData: {
214
- nodeList: import("@soonflow/plugin-soonmanager2-sync/dist/interface").Node[];
215
- lineList: import("@soonflow/plugin-soonmanager2-sync/dist/interface").Edge[];
216
- };
217
- subFlows: import("@soonflow/plugin-soonmanager2-sync/dist/interface").FlowSyncData[];
218
- }[]>;
219
- /**
220
- * 执行流程
221
- * @param id 流程 id
222
- */
223
- runFlowById(id: string): Promise<void>;
224
- }
225
- export * from './types';
226
- export * from './constants';
227
- export default CpsSoonmanagerPlugin;
package/dist/types.d.ts DELETED
@@ -1,301 +0,0 @@
1
- import { Tween } from '@tweenjs/tween.js';
2
- import { AnimationModeType, BaseObjectInfo, IVector3, PoiNodeType } from 'soonspacejs/types/Interface';
3
- /**
4
- * 场景元数据
5
- */
6
- export interface IMetadata {
7
- platformVersion: number;
8
- version: number;
9
- name: string;
10
- projectId: string;
11
- sceneId: string;
12
- cover: string | null;
13
- flatModel: string;
14
- treeModel: string;
15
- resource: string;
16
- exportTime: number;
17
- environment?: string;
18
- previewSettings?: string;
19
- }
20
- /**
21
- * 场景树
22
- */
23
- export interface ITreeData {
24
- id: string;
25
- pid: string | null;
26
- name: string;
27
- uuid: string;
28
- renderType: 'GROUP' | '3D' | 'ROOM' | 'STUB' | 'POLYGON' | 'CIRCLE' | 'WATER_SURFACE' | 'DECAL';
29
- deviceCode: string | null;
30
- matrix: number[];
31
- path: string | null;
32
- familyId: string | null;
33
- children: ITreeData[];
34
- visible: boolean;
35
- shape?: {
36
- height: number;
37
- radius: number;
38
- points?: IVector3[];
39
- };
40
- boundingBox?: number[];
41
- extra?: {
42
- [key: string]: any;
43
- };
44
- }
45
- export declare enum PoiContentTypeEnum {
46
- PANEL = "PANEL",
47
- VIDEO = "VIDEO",
48
- VIDEO_STREAM = "VIDEO_STREAM"
49
- }
50
- export interface PoiMedia {
51
- assetId?: string | null;
52
- url?: string;
53
- isLoop?: boolean;
54
- location?: string | null;
55
- protocol?: string;
56
- fileId?: string | null;
57
- fileSourceType?: string;
58
- }
59
- export interface PoiContentData {
60
- [group: string]: {
61
- [key: string]: {
62
- value: string;
63
- index: number;
64
- label: string;
65
- };
66
- };
67
- }
68
- export interface PoiContent {
69
- ds_user: PoiContentData;
70
- ds_system: PoiContentData;
71
- }
72
- /**
73
- * Poi
74
- */
75
- export interface IPoiData {
76
- projectId: string;
77
- sceneId: string;
78
- nodeId: string;
79
- poiId: string;
80
- name: string;
81
- width: number;
82
- height: number;
83
- x: number;
84
- y: number;
85
- z: number;
86
- rotationX: number;
87
- rotationY: number;
88
- rotationZ: number;
89
- scale: number;
90
- dimensional: PoiNodeType;
91
- content: string;
92
- contentData?: PoiContent;
93
- media: PoiMedia | null;
94
- contentType: PoiContentTypeEnum;
95
- display: boolean;
96
- style: string;
97
- }
98
- /**
99
- * origin path
100
- */
101
- export interface ITopologyPath {
102
- id: string;
103
- name: string;
104
- position: IVector3;
105
- rotation: IVector3;
106
- scale: IVector3;
107
- nodes: ITopologyNode[];
108
- type: 'network';
109
- imgUrl?: string;
110
- animation?: {
111
- duration: 0;
112
- };
113
- }
114
- export interface ITopologyNode {
115
- id: string;
116
- name: string;
117
- position: IVector3;
118
- graphs: ITopologyNodeGraph[];
119
- }
120
- export interface ITopologyNodeGraph {
121
- linkInfo: ITopologyEdge;
122
- targetNodeId: string;
123
- passable: PassableType;
124
- }
125
- export interface ITopologyEdge {
126
- id: string;
127
- name: string;
128
- }
129
- declare enum PassableType {
130
- BIDIRECTION = 0,
131
- POSITIVE = 1,
132
- OPPOSITE = 2,
133
- FORBID = 3
134
- }
135
- /**
136
- * 自定义属性
137
- */
138
- export interface IProperties {
139
- modelId: string;
140
- group: string;
141
- key: string;
142
- value: string | null;
143
- label: string | null;
144
- }
145
- export interface IKeyframe {
146
- id: string;
147
- uuid: string;
148
- x: number;
149
- y: number;
150
- z: number;
151
- scaleX: number;
152
- scaleY: number;
153
- scaleZ: number;
154
- rotationX: number;
155
- rotationY: number;
156
- rotationZ: number;
157
- easing: AnimationModeType;
158
- mode: string;
159
- delay: number;
160
- duration: number;
161
- repeat: number;
162
- yoyo: boolean;
163
- }
164
- /**
165
- * 动画
166
- */
167
- export interface IAnimations {
168
- id: string;
169
- uuid: string;
170
- modelId: string;
171
- name: string;
172
- keyframes: IKeyframe[];
173
- }
174
- /**
175
- * 模型视角
176
- */
177
- export interface IModelVisions {
178
- id: string;
179
- uuid: string;
180
- nodeId: string;
181
- name: string;
182
- code?: any;
183
- camera: 'O' | 'P';
184
- position: IVector3;
185
- rotation: IVector3;
186
- target: IVector3;
187
- zoom: number;
188
- primary: boolean;
189
- }
190
- /**
191
- * 预设效果 options
192
- */
193
- export interface IPresetEffectsOptions {
194
- hdr?: boolean;
195
- ssao?: boolean;
196
- directionalLightShadow?: boolean | {
197
- angle?: number;
198
- };
199
- toneMappping?: boolean;
200
- }
201
- /**
202
- * constructor options
203
- */
204
- export interface ConstructorOptions {
205
- /**
206
- * 平台解密公钥
207
- */
208
- key?: string;
209
- /**
210
- * 资源包路径
211
- */
212
- path?: string;
213
- }
214
- /**
215
- * loadScene options
216
- */
217
- export interface ILoadSceneOptions extends ConstructorOptions {
218
- /**
219
- * 同步自定义属性
220
- */
221
- syncProperties?: boolean;
222
- /**
223
- * 同步模型视角数据
224
- */
225
- syncModelVisions?: boolean;
226
- /**
227
- * 计算 bounds tree
228
- */
229
- needsModelsBoundsTree?: boolean;
230
- /**
231
- * 应用预设效果
232
- */
233
- applyPresetEffects?: boolean;
234
- /**
235
- * 同步场景算法 BFS | DFS
236
- */
237
- loadSceneAlgorithm?: LoadSceneAlgorithm;
238
- /**
239
- * 目标节点 id(DFS时有效)
240
- */
241
- loadTargetId?: ITreeData['id'];
242
- /**
243
- * 需要加载的层级(DFS时有效)
244
- */
245
- loadLevel?: number;
246
- /**
247
- * 需要隐藏的对象 id
248
- */
249
- hiddenObjects?: Set<string>;
250
- /**
251
- * 加载 poi
252
- */
253
- loadPoi?: boolean;
254
- /**
255
- * 通过数据源刷新 poi
256
- */
257
- refreshPoiByDataSource?: boolean;
258
- /**
259
- * 加载流程数据
260
- */
261
- loadFlowData?: boolean;
262
- /**
263
- * 场景 group 信息
264
- */
265
- sceneGroupInfo?: Partial<BaseObjectInfo>;
266
- /**
267
- * 对象 id 前缀
268
- */
269
- objectPrefixId?: string;
270
- }
271
- /**
272
- * properties map
273
- */
274
- export type TPropertiesMap = Map<IProperties['modelId'], IProperties[]>;
275
- export type TAnimationsTweenProps = Pick<IKeyframe, 'x' | 'y' | 'z' | 'rotationX' | 'rotationY' | 'rotationZ' | 'scaleX' | 'scaleY' | 'scaleZ'>;
276
- /**
277
- * playAnimationById options
278
- */
279
- export interface IPlayAnimationByIdOptions {
280
- autoStopPrevious?: boolean;
281
- onUpdate?: (source: TAnimationsTweenProps, tween: Tween<TAnimationsTweenProps>) => void;
282
- onStart?: (tween: Tween<TAnimationsTweenProps>) => void;
283
- }
284
- /**
285
- * animation map
286
- */
287
- export type TAnimationsMap = Map<IAnimations['modelId'], IAnimations[]>;
288
- /**
289
- * model visions map
290
- */
291
- export type TModelVisionsMap = Map<IModelVisions['nodeId'], IModelVisions[]>;
292
- export interface TLicense {
293
- sign: string;
294
- content: string;
295
- version?: number;
296
- }
297
- export declare enum LoadSceneAlgorithm {
298
- BFS = "BFS",
299
- DFS = "DFS"
300
- }
301
- export {};
package/dist/utils.d.ts DELETED
@@ -1,19 +0,0 @@
1
- import SoonSpace from 'soonspacejs';
2
- import { ITreeData } from './types';
3
- import CpsSoonmanagerPlugin from '.';
4
- /**
5
- * 解码
6
- * @param encodedStr
7
- * @returns
8
- */
9
- export declare function decodeString(encodedStr: string): string;
10
- /**
11
- * 分组
12
- * @param list
13
- * @param key
14
- * @returns Map
15
- */
16
- export declare function groupBy<T extends Record<string, any>, V>(list: T[], key: keyof T): Map<V, T[]>;
17
- export declare function createRoom(ssp: SoonSpace, node: ITreeData): import("../../../soonspacejs/src/Library/Group").Group | null;
18
- export declare function createWaterSurface(cpsPlugin: CpsSoonmanagerPlugin, node: ITreeData): import("../../../soonspacejs/src/Library/PluginObject").PluginObject | null;
19
- export declare function createDecal(ssp: SoonSpace, node: ITreeData): Promise<import("../../../soonspacejs/src/Library/Decal").Decal | null>;