@soonspacejs/plugin-cps-soonmanager 2.13.7 → 2.13.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.
@@ -0,0 +1,338 @@
1
+ import { AnimationModeType, BaseObjectInfo, IVector3, PoiNodeType } from 'soonspacejs';
2
+ import { TTweenSource, TTweenType } from 'umanager-animation-parser';
3
+ export type BaseTreeNode<T> = T & {
4
+ id: string;
5
+ sid: string;
6
+ children: BaseTreeNode<T>[] | null;
7
+ };
8
+ /**
9
+ * 场景元数据
10
+ */
11
+ export interface IMetadata {
12
+ platformVersion: number;
13
+ version: number;
14
+ name: string;
15
+ projectId: string;
16
+ sceneId: string;
17
+ cover: string | null;
18
+ flatModel: string;
19
+ treeModel: string;
20
+ resource: string;
21
+ exportTime: number;
22
+ environment?: string;
23
+ previewSettings?: string;
24
+ }
25
+ /**
26
+ * 场景树
27
+ */
28
+ export interface ITreeData {
29
+ id: string;
30
+ pid: string | null;
31
+ sid: string;
32
+ name: string;
33
+ renderType: 'GROUP' | '3D' | 'STUB' | 'POLYGON' | 'CIRCLE' | 'WATER_SURFACE' | 'DECAL' | 'AREA' | 'FLOOR' | 'ROOM' | 'GS';
34
+ deviceCode: string | null;
35
+ matrix: number[];
36
+ familyId: string | null;
37
+ children: ITreeData[];
38
+ visible: boolean;
39
+ shape?: {
40
+ height?: number;
41
+ radius?: number;
42
+ depth?: number;
43
+ points?: IVector3[];
44
+ };
45
+ boundingBox?: number[];
46
+ extra?: {
47
+ [key: string]: any;
48
+ };
49
+ }
50
+ export interface IInnerTreeData extends ITreeData {
51
+ path: string | null;
52
+ children: IInnerTreeData[];
53
+ }
54
+ export type IFlatData = Pick<ITreeData, 'id' | 'pid' | 'sid' | 'name' | 'renderType' | 'deviceCode' | 'familyId'>;
55
+ export declare enum PoiContentTypeEnum {
56
+ PANEL = "PANEL",
57
+ VIDEO = "VIDEO",
58
+ VIDEO_STREAM = "VIDEO_STREAM"
59
+ }
60
+ export interface IProgress {
61
+ loaded: number;
62
+ total: number;
63
+ }
64
+ export interface IProgressEventMap {
65
+ progressing: {
66
+ progress: IProgress;
67
+ };
68
+ }
69
+ export interface PoiMedia {
70
+ assetId?: string | null;
71
+ url?: string;
72
+ isLoop?: boolean;
73
+ location?: string | null;
74
+ protocol?: string;
75
+ fileId?: string | null;
76
+ fileSourceType?: string;
77
+ }
78
+ export interface PoiContentData {
79
+ [group: string]: {
80
+ [key: string]: {
81
+ value: string;
82
+ index: number;
83
+ label: string;
84
+ };
85
+ };
86
+ }
87
+ export interface PoiContent {
88
+ ds_user: PoiContentData;
89
+ ds_system: PoiContentData;
90
+ }
91
+ /**
92
+ * Poi
93
+ */
94
+ export interface IPoiData {
95
+ projectId: string;
96
+ sceneId: string;
97
+ nodeId: string;
98
+ poiId: string;
99
+ name: string;
100
+ width: number;
101
+ height: number;
102
+ x: number;
103
+ y: number;
104
+ z: number;
105
+ rotationX: number;
106
+ rotationY: number;
107
+ rotationZ: number;
108
+ scale: number;
109
+ dimensional: PoiNodeType;
110
+ content: string;
111
+ contentData?: PoiContent;
112
+ media: PoiMedia | null;
113
+ contentType: PoiContentTypeEnum;
114
+ display: boolean;
115
+ style: string;
116
+ }
117
+ /**
118
+ * origin path
119
+ */
120
+ export interface ITopologyPath {
121
+ id: string;
122
+ name: string;
123
+ position: IVector3;
124
+ rotation: IVector3;
125
+ scale: IVector3;
126
+ nodes: ITopologyNode[];
127
+ type: 'network';
128
+ imgUrl?: string;
129
+ animation?: {
130
+ duration: 0;
131
+ };
132
+ }
133
+ export interface ITopologyNode {
134
+ id: string;
135
+ name: string;
136
+ position: IVector3;
137
+ graphs: ITopologyNodeGraph[];
138
+ }
139
+ export interface ITopologyNodeGraph {
140
+ linkInfo: ITopologyEdge;
141
+ targetNodeId: string;
142
+ passable: PassableType;
143
+ }
144
+ export interface ITopologyEdge {
145
+ id: string;
146
+ name: string;
147
+ }
148
+ declare enum PassableType {
149
+ BIDIRECTION = 0,
150
+ POSITIVE = 1,
151
+ OPPOSITE = 2,
152
+ FORBID = 3
153
+ }
154
+ /**
155
+ * 自定义属性
156
+ */
157
+ export interface IProperties {
158
+ modelId: string;
159
+ group: string;
160
+ key: string;
161
+ value: string | null;
162
+ label: string | null;
163
+ }
164
+ export interface IKeyframe {
165
+ id: string;
166
+ uuid: string;
167
+ x: number;
168
+ y: number;
169
+ z: number;
170
+ scaleX: number;
171
+ scaleY: number;
172
+ scaleZ: number;
173
+ rotationX: number;
174
+ rotationY: number;
175
+ rotationZ: number;
176
+ easing: AnimationModeType;
177
+ mode: string;
178
+ delay: number;
179
+ duration: number;
180
+ repeat: number;
181
+ yoyo: boolean;
182
+ }
183
+ /**
184
+ * 动画
185
+ */
186
+ export interface IAnimations {
187
+ id: string;
188
+ sid: string;
189
+ modelId: string;
190
+ name: string;
191
+ keyframes: IKeyframe[];
192
+ }
193
+ /**
194
+ * 模型视角
195
+ */
196
+ export interface IModelVisions {
197
+ id: string;
198
+ uuid: string;
199
+ nodeId: string;
200
+ name: string;
201
+ code?: any;
202
+ camera: 'O' | 'P';
203
+ position: IVector3;
204
+ rotation: IVector3;
205
+ target: IVector3;
206
+ zoom: number;
207
+ primary: boolean;
208
+ }
209
+ /**
210
+ * 空间
211
+ */
212
+ export interface ISpaces {
213
+ id: string;
214
+ sid: string;
215
+ name: string;
216
+ type: string;
217
+ matrix: number[];
218
+ visible: boolean;
219
+ assets: string[] | null;
220
+ children: ISpaces[] | null;
221
+ }
222
+ /**
223
+ * 预设效果 options
224
+ */
225
+ export interface IPresetEffectsOptions {
226
+ atmosphere?: boolean;
227
+ hdr?: boolean;
228
+ ssao?: boolean;
229
+ directionalLightShadow?: boolean | {
230
+ angle?: number;
231
+ };
232
+ toneMappping?: boolean;
233
+ }
234
+ /**
235
+ * constructor options
236
+ */
237
+ export interface ConstructorOptions {
238
+ /**
239
+ * 平台解密公钥
240
+ */
241
+ key?: string;
242
+ /**
243
+ * 资源包路径
244
+ */
245
+ path?: string;
246
+ }
247
+ /**
248
+ * loadScene options
249
+ */
250
+ export interface ILoadSceneOptions extends ConstructorOptions {
251
+ /**
252
+ * 同步自定义属性
253
+ */
254
+ syncProperties?: boolean;
255
+ /**
256
+ * 同步模型视角数据
257
+ */
258
+ syncModelVisions?: boolean;
259
+ /**
260
+ * 计算 bounds tree
261
+ */
262
+ needsModelsBoundsTree?: boolean;
263
+ /**
264
+ * 应用预设效果
265
+ */
266
+ applyPresetEffects?: boolean;
267
+ /**
268
+ * 同步场景算法 BFS | DFS
269
+ */
270
+ loadSceneAlgorithm?: LoadSceneAlgorithm;
271
+ /**
272
+ * 目标节点 id(DFS时有效)
273
+ */
274
+ loadTargetId?: ITreeData['id'];
275
+ /**
276
+ * 需要加载的层级(DFS时有效)
277
+ */
278
+ loadLevel?: number;
279
+ /**
280
+ * 需要隐藏的对象 id
281
+ */
282
+ hiddenObjects?: Set<string>;
283
+ /**
284
+ * 加载 poi
285
+ */
286
+ loadPoi?: boolean;
287
+ /**
288
+ * 通过数据源刷新 poi
289
+ */
290
+ refreshPoiByDataSource?: boolean;
291
+ /**
292
+ * 加载流程数据
293
+ */
294
+ loadFlowData?: boolean;
295
+ /**
296
+ * 场景 group 信息
297
+ */
298
+ sceneGroupInfo?: Partial<BaseObjectInfo>;
299
+ /**
300
+ * 对象 id 前缀
301
+ */
302
+ objectPrefixId?: string;
303
+ /**
304
+ * 作为对象的 id
305
+ */
306
+ asId?: 'id' | 'sid';
307
+ }
308
+ /**
309
+ * properties map
310
+ */
311
+ export type TPropertiesMap = Map<IProperties['modelId'], IProperties[]>;
312
+ /**
313
+ * playAnimationById options
314
+ */
315
+ export interface IPlayAnimationByIdOptions {
316
+ autoStopPrevious?: boolean;
317
+ onUpdate?: (source: TTweenSource, tween: TTweenType) => void;
318
+ onStart?: (tween: TTweenType) => void;
319
+ }
320
+ /**
321
+ * animation map
322
+ */
323
+ export type TAnimationsMap = Map<IAnimations['modelId'], IAnimations[]>;
324
+ /**
325
+ * model visions map
326
+ */
327
+ export type TModelVisionsMap = Map<IModelVisions['nodeId'], IModelVisions[]>;
328
+ export type TSpacesMap = Map<ISpaces['sid'], ISpaces>;
329
+ export interface TLicense {
330
+ sign: string;
331
+ content: string;
332
+ version?: number;
333
+ }
334
+ export declare enum LoadSceneAlgorithm {
335
+ BFS = "BFS",
336
+ DFS = "DFS"
337
+ }
338
+ export {};
@@ -0,0 +1,11 @@
1
+ import PoiRendererPlugin from '@soonspacejs/plugin-poi-renderer';
2
+ import CpsManagerPlugin from '../';
3
+ import { IUpdatePoi } from './type';
4
+ declare class UpdatePoi {
5
+ #private;
6
+ plugin: PoiRendererPlugin;
7
+ cpsPlugin: CpsManagerPlugin;
8
+ constructor(plugin: PoiRendererPlugin, cpsPlugin: CpsManagerPlugin);
9
+ listen(newValue: IUpdatePoi): void;
10
+ }
11
+ export default UpdatePoi;
@@ -0,0 +1,7 @@
1
+ import { IProperties } from '@soonspacejs/plugin-cps-soonmanager';
2
+ export type IUpdatePoi = {
3
+ target: IProperties;
4
+ property: string;
5
+ value: string;
6
+ source: 'unknow' | 'code';
7
+ };
@@ -0,0 +1,23 @@
1
+ import SoonSpace, { BaseObject3D } from 'soonspacejs';
2
+ import { TAnimationFrame } from 'umanager-animation-parser';
3
+ import { BaseTreeNode, IKeyframe, ITreeData } from './types';
4
+ import CpsSoonmanagerPlugin from '.';
5
+ /**
6
+ * 解码
7
+ * @param encodedStr
8
+ * @returns
9
+ */
10
+ export declare function decodeString(encodedStr: string): string;
11
+ export declare const mapTreeNodeByKey: <T, K extends keyof T | "id" | "sid" | "children", V>(tree: BaseTreeNode<T>[], key: K, map?: Map<V, BaseTreeNode<T>>) => Map<V, BaseTreeNode<T>>;
12
+ export declare function isSpace(renderType: ITreeData['renderType']): boolean;
13
+ /**
14
+ * 创建空间
15
+ * @param ssp
16
+ * @param node
17
+ * @returns
18
+ */
19
+ export declare function createSpace(ssp: SoonSpace, node: ITreeData, objectId: string): import("../../../soonspacejs/src/Library/Canvas3D").Canvas3D;
20
+ export declare function createWaterSurface(cpsPlugin: CpsSoonmanagerPlugin, node: ITreeData, objectId: string): import("../../../soonspacejs/src/Library/PluginObject").PluginObject | null;
21
+ export declare function createDecal(ssp: SoonSpace, node: ITreeData, objectId: string, path: string | null): Promise<import("../../../soonspacejs/src/Library/Decal").Decal | null>;
22
+ export declare function createGs3d(ssp: SoonSpace, node: ITreeData, path: string | null): Promise<BaseObject3D>;
23
+ export declare function transformKeyframes(keyframes: IKeyframe[]): TAnimationFrame[];
package/env.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- declare module '@mkkellogg/gaussian-splats-3d' {
2
- export const DropInViewer: any
1
+ declare module '@mkkellogg/gaussian-splats-3d' {
2
+ export const DropInViewer: any
3
3
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@soonspacejs/plugin-cps-soonmanager",
3
3
  "pluginName": "CpsSoonmanagerPlugin",
4
- "version": "2.13.7",
4
+ "version": "2.13.8",
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": "550040550bf20ec0015982ff1159d0cfe9b35ed3",
16
+ "gitHead": "d6b6f55e087ba0621e8bb404fc63c99fd4389660",
17
17
  "dependencyPlugins": [
18
18
  "plugin-poi-renderer",
19
19
  "plugin-effect",
@@ -32,11 +32,11 @@
32
32
  "socket.io-client": "^4.7.2"
33
33
  },
34
34
  "peerDependencies": {
35
- "@soonspacejs/plugin-atmosphere": "2.13.7",
36
- "@soonspacejs/plugin-effect": "2.13.7",
35
+ "@soonspacejs/plugin-atmosphere": "2.13.8",
36
+ "@soonspacejs/plugin-effect": "2.13.8",
37
37
  "@soonspacejs/plugin-gs3d-loader": "2.13.7",
38
- "@soonspacejs/plugin-poi-renderer": "2.13.7",
39
- "soonspacejs": "2.13.7",
38
+ "@soonspacejs/plugin-poi-renderer": "2.13.8",
39
+ "soonspacejs": "2.13.8",
40
40
  "umanager-animation-parser": "^0.0.6"
41
41
  }
42
42
  }