@soonspacejs/plugin-cps-soonmanager 2.11.55 → 2.11.57

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/types.d.ts CHANGED
@@ -1,5 +1,10 @@
1
1
  import { Tween } from 'three/examples/jsm/libs/tween.module.js';
2
2
  import { AnimationModeType, BaseObjectInfo, IVector3, PoiNodeType } from 'soonspacejs/types/Interface';
3
+ export type BaseTreeNode<T> = T & {
4
+ id: string;
5
+ sid: string;
6
+ children: BaseTreeNode<T>[] | null;
7
+ };
3
8
  /**
4
9
  * 场景元数据
5
10
  */
@@ -188,6 +193,19 @@ export interface IModelVisions {
188
193
  zoom: number;
189
194
  primary: boolean;
190
195
  }
196
+ /**
197
+ * 空间
198
+ */
199
+ export interface ISpaces {
200
+ id: string;
201
+ sid: string;
202
+ name: string;
203
+ type: string;
204
+ matrix: number[];
205
+ visible: boolean;
206
+ assets: string[] | null;
207
+ children: ISpaces[] | null;
208
+ }
191
209
  /**
192
210
  * 预设效果 options
193
211
  */
@@ -294,6 +312,7 @@ export type TAnimationsMap = Map<IAnimations['modelId'], IAnimations[]>;
294
312
  * model visions map
295
313
  */
296
314
  export type TModelVisionsMap = Map<IModelVisions['nodeId'], IModelVisions[]>;
315
+ export type TSpacesMap = Map<ISpaces['sid'], ISpaces>;
297
316
  export interface TLicense {
298
317
  sign: string;
299
318
  content: string;
package/dist/utils.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import SoonSpace from 'soonspacejs';
2
- import { ITreeData } from './types';
2
+ import { BaseTreeNode, ITreeData } from './types';
3
3
  import CpsSoonmanagerPlugin from '.';
4
4
  /**
5
5
  * 解码
@@ -14,12 +14,13 @@ export declare function decodeString(encodedStr: string): string;
14
14
  * @returns Map
15
15
  */
16
16
  export declare function groupBy<T extends Record<string, any>, V>(list: T[], key: keyof T): Map<V, T[]>;
17
+ 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>>;
17
18
  /**
18
19
  * 创建空间
19
20
  * @param ssp
20
21
  * @param node
21
22
  * @returns
22
23
  */
23
- export declare function createSpace(ssp: SoonSpace, node: ITreeData): import("../../../soonspacejs/src/Library/Canvas3D").Canvas3D;
24
- export declare function createWaterSurface(cpsPlugin: CpsSoonmanagerPlugin, node: ITreeData): import("../../../soonspacejs/src/Library/PluginObject").PluginObject | null;
25
- export declare function createDecal(ssp: SoonSpace, node: ITreeData): Promise<import("../../../soonspacejs/src/Library/Decal").Decal | null>;
24
+ export declare function createSpace(ssp: SoonSpace, node: ITreeData, objectId: string): import("../../../soonspacejs/src/Library/Canvas3D").Canvas3D;
25
+ export declare function createWaterSurface(cpsPlugin: CpsSoonmanagerPlugin, node: ITreeData, objectId: string): import("../../../soonspacejs/src/Library/PluginObject").PluginObject | null;
26
+ export declare function createDecal(ssp: SoonSpace, node: ITreeData, objectId: string): Promise<import("../../../soonspacejs/src/Library/Decal").Decal | 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.55",
4
+ "version": "2.11.57",
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": "d053b3ff0481011ad96a25898c02cbf6060ed7f5",
16
+ "gitHead": "9de883d2c9e95152a8e05ff61ff3667903ff7da2",
17
17
  "dependentPlugins": [
18
18
  "plugin-poi-renderer",
19
19
  "plugin-effect"
@@ -28,8 +28,8 @@
28
28
  "socket.io-client": "^4.7.2"
29
29
  },
30
30
  "peerDependencies": {
31
- "@soonspacejs/plugin-effect": "2.11.55",
32
- "@soonspacejs/plugin-poi-renderer": "2.11.55",
33
- "soonspacejs": "2.11.55"
31
+ "@soonspacejs/plugin-effect": "2.11.57",
32
+ "@soonspacejs/plugin-poi-renderer": "2.11.57",
33
+ "soonspacejs": "2.11.57"
34
34
  }
35
35
  }