@soonspacejs/plugin-cps-soonmanager 2.11.13 → 2.11.14

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.
@@ -0,0 +1,293 @@
1
+ import { Tween } from '@tweenjs/tween.js';
2
+ import { AnimationModeType, BaseObjectInfo, IVector3, PlaneIVector2, 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
+ renderType: 'GROUP' | '3D' | 'ROOM' | 'STUB' | 'POLYGON' | 'CIRCLE';
28
+ deviceName: string | null;
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?: PlaneIVector2[];
39
+ };
40
+ }
41
+ export declare enum PoiContentTypeEnum {
42
+ PANEL = "PANEL",
43
+ VIDEO = "VIDEO",
44
+ VIDEO_STREAM = "VIDEO_STREAM"
45
+ }
46
+ export interface PoiMedia {
47
+ assetId?: string | null;
48
+ url?: string;
49
+ isLoop?: boolean;
50
+ location?: string | null;
51
+ protocol?: string;
52
+ fileId?: string | null;
53
+ fileSourceType?: string;
54
+ }
55
+ export interface PoiContentData {
56
+ [group: string]: {
57
+ [key: string]: {
58
+ value: string;
59
+ index: number;
60
+ label: string;
61
+ };
62
+ };
63
+ }
64
+ export interface PoiContent {
65
+ ds_user: PoiContentData;
66
+ ds_system: PoiContentData;
67
+ }
68
+ /**
69
+ * Poi
70
+ */
71
+ export interface IPoiData {
72
+ projectId: string;
73
+ sceneId: string;
74
+ nodeId: string;
75
+ poiId: string;
76
+ name: string;
77
+ width: number;
78
+ height: number;
79
+ x: number;
80
+ y: number;
81
+ z: number;
82
+ rotationX: number;
83
+ rotationY: number;
84
+ rotationZ: number;
85
+ scale: number;
86
+ dimensional: PoiNodeType;
87
+ content: string;
88
+ contentData?: PoiContent;
89
+ media: PoiMedia | null;
90
+ contentType: PoiContentTypeEnum;
91
+ display: boolean;
92
+ style: string;
93
+ }
94
+ /**
95
+ * origin path
96
+ */
97
+ export interface ITopologyPath {
98
+ id: string;
99
+ name: string;
100
+ position: IVector3;
101
+ rotation: IVector3;
102
+ scale: IVector3;
103
+ nodes: ITopologyNode[];
104
+ type: 'network';
105
+ imgUrl?: string;
106
+ animation?: {
107
+ duration: 0;
108
+ };
109
+ }
110
+ export interface ITopologyNode {
111
+ id: string;
112
+ name: string;
113
+ position: IVector3;
114
+ graphs: ITopologyNodeGraph[];
115
+ }
116
+ export interface ITopologyNodeGraph {
117
+ linkInfo: ITopologyEdge;
118
+ targetNodeId: string;
119
+ passable: PassableType;
120
+ }
121
+ export interface ITopologyEdge {
122
+ id: string;
123
+ name: string;
124
+ }
125
+ declare enum PassableType {
126
+ BIDIRECTION = 0,
127
+ POSITIVE = 1,
128
+ OPPOSITE = 2,
129
+ FORBID = 3
130
+ }
131
+ /**
132
+ * 自定义属性
133
+ */
134
+ export interface IProperties {
135
+ modelId: string;
136
+ group: string;
137
+ key: string;
138
+ value: string | null;
139
+ label: string | null;
140
+ }
141
+ export interface IKeyframe {
142
+ id: string;
143
+ uuid: string;
144
+ x: number;
145
+ y: number;
146
+ z: number;
147
+ scaleX: number;
148
+ scaleY: number;
149
+ scaleZ: number;
150
+ rotationX: number;
151
+ rotationY: number;
152
+ rotationZ: number;
153
+ easing: AnimationModeType;
154
+ mode: string;
155
+ delay: number;
156
+ duration: number;
157
+ repeat: number;
158
+ yoyo: boolean;
159
+ }
160
+ /**
161
+ * 动画
162
+ */
163
+ export interface IAnimations {
164
+ id: string;
165
+ uuid: string;
166
+ modelId: string;
167
+ name: string;
168
+ keyframes: IKeyframe[];
169
+ }
170
+ /**
171
+ * 模型视角
172
+ */
173
+ export interface IModelVisions {
174
+ id: string;
175
+ uuid: string;
176
+ nodeId: string;
177
+ name: string;
178
+ code?: any;
179
+ position: IVector3;
180
+ rotation: IVector3;
181
+ target: IVector3;
182
+ }
183
+ /**
184
+ * 预设效果 options
185
+ */
186
+ export interface IPresetEffectsOptions {
187
+ hdr?: boolean;
188
+ ssao?: boolean;
189
+ directionalLightShadow?: boolean | {
190
+ angle?: number;
191
+ };
192
+ }
193
+ /**
194
+ * constructor options
195
+ */
196
+ export interface ConstructorOptions {
197
+ /**
198
+ * 平台解密公钥
199
+ */
200
+ key?: string;
201
+ /**
202
+ * 资源包路径
203
+ */
204
+ path?: string;
205
+ }
206
+ /**
207
+ * loadScene options
208
+ */
209
+ export interface ILoadSceneOptions extends ConstructorOptions {
210
+ /**
211
+ * 同步自定义属性
212
+ */
213
+ syncProperties?: boolean;
214
+ /**
215
+ * 同步模型视角数据
216
+ */
217
+ syncModelVisions?: boolean;
218
+ /**
219
+ * 计算 bounds tree
220
+ */
221
+ needsModelsBoundsTree?: boolean;
222
+ /**
223
+ * 应用预设效果
224
+ */
225
+ applyPresetEffects?: boolean;
226
+ /**
227
+ * 同步场景算法 BFS | DFS
228
+ */
229
+ loadSceneAlgorithm?: LoadSceneAlgorithm;
230
+ /**
231
+ * 目标节点 id(DFS时有效)
232
+ */
233
+ loadTargetId?: ITreeData['id'];
234
+ /**
235
+ * 需要加载的层级(DFS时有效)
236
+ */
237
+ loadLevel?: number;
238
+ /**
239
+ * 需要隐藏的对象 id
240
+ */
241
+ hiddenObjects?: Set<string>;
242
+ /**
243
+ * 加载 poi
244
+ */
245
+ loadPoi?: boolean;
246
+ /**
247
+ * 通过数据源刷新 poi
248
+ */
249
+ refreshPoiByDataSource?: boolean;
250
+ /**
251
+ * 加载流程数据
252
+ */
253
+ loadFlowData?: boolean;
254
+ /**
255
+ * 场景 group 信息
256
+ */
257
+ sceneGroupInfo?: Partial<BaseObjectInfo>;
258
+ /**
259
+ * 对象 id 前缀
260
+ */
261
+ objectPrefixId?: string;
262
+ }
263
+ /**
264
+ * properties map
265
+ */
266
+ export type TPropertiesMap = Map<IProperties['modelId'], IProperties[]>;
267
+ export type TAnimationsTweenProps = Pick<IKeyframe, 'x' | 'y' | 'z' | 'rotationX' | 'rotationY' | 'rotationZ' | 'scaleX' | 'scaleY' | 'scaleZ'>;
268
+ /**
269
+ * playAnimationById options
270
+ */
271
+ export interface IPlayAnimationByIdOptions {
272
+ autoStopPrevious?: boolean;
273
+ onUpdate?: (source: TAnimationsTweenProps, tween: Tween<TAnimationsTweenProps>) => void;
274
+ onStart?: (tween: Tween<TAnimationsTweenProps>) => void;
275
+ }
276
+ /**
277
+ * animation map
278
+ */
279
+ export type TAnimationsMap = Map<IAnimations['modelId'], IAnimations[]>;
280
+ /**
281
+ * model visions map
282
+ */
283
+ export type TModelVisionsMap = Map<IModelVisions['nodeId'], IModelVisions[]>;
284
+ export interface TLicense {
285
+ sign: string;
286
+ content: string;
287
+ version?: number;
288
+ }
289
+ export declare enum LoadSceneAlgorithm {
290
+ BFS = "BFS",
291
+ DFS = "DFS"
292
+ }
293
+ export {};
@@ -0,0 +1,13 @@
1
+ /**
2
+ * 解码
3
+ * @param encodedStr
4
+ * @returns
5
+ */
6
+ export declare function decodeString(encodedStr: string): string;
7
+ /**
8
+ * 分组
9
+ * @param list
10
+ * @param key
11
+ * @returns Map
12
+ */
13
+ export declare function groupBy<T extends Record<string, any>, V>(list: T[], key: keyof T): Map<V, T[]>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@soonspacejs/plugin-cps-soonmanager",
3
3
  "pluginName": "CpsSoonmanagerPlugin",
4
- "version": "2.11.13",
4
+ "version": "2.11.14",
5
5
  "description": "Sync cps soonmanager data plugin for SoonSpace.js",
6
6
  "main": "dist/index.esm.js",
7
7
  "module": "dist/index.esm.js",
@@ -13,7 +13,7 @@
13
13
  ],
14
14
  "author": "xunwei",
15
15
  "license": "UNLICENSED",
16
- "gitHead": "0ecdef9d6546f8cd0e7f8ea38e7eb84fda951e4b",
16
+ "gitHead": "963b094e48abbe2a9e02a0906625aec3b43db8a6",
17
17
  "dependentPlugins": [
18
18
  "plugin-poi-renderer"
19
19
  ],
@@ -27,7 +27,7 @@
27
27
  "socket.io-client": "^4.7.2"
28
28
  },
29
29
  "peerDependencies": {
30
- "@soonspacejs/plugin-poi-renderer": "2.11.13",
31
- "soonspacejs": "2.11.13"
30
+ "@soonspacejs/plugin-poi-renderer": "2.11.14",
31
+ "soonspacejs": "2.11.14"
32
32
  }
33
33
  }