@soonspacejs/plugin-cps-soonmanager 2.11.13 → 2.11.15

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