next-flow-interface 0.25.13 → 0.26.7

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.
Files changed (2) hide show
  1. package/index.d.ts +153 -198
  2. package/package.json +1 -2
package/index.d.ts CHANGED
@@ -9,20 +9,16 @@ import { Attributes } from "react";
9
9
  import { Awareness } from "rhine-var";
10
10
  import { BaseTexture } from "@babylonjs/core";
11
11
  import { ClipboardEventHandler } from "react";
12
- import { Color } from "antd/es/color-picker";
13
12
  import { Color3 } from "@babylonjs/core";
14
13
  import { Color3 as Color3_2 } from "@babylonjs/core/Maths/math.color";
15
14
  import { Color4 } from "@babylonjs/core";
16
- import { ColorPickerProps } from "antd/es/color-picker";
17
15
  import { CompositionEventHandler } from "react";
18
16
  import { CSSProperties } from "react";
19
17
  import { CubeTexture } from "@babylonjs/core";
20
- import { DefaultOptionType } from "antd/es/select";
21
18
  import { DetailedHTMLProps } from "react";
22
19
  import { DragEvent as DragEvent_2 } from "react";
23
20
  import { DragEventHandler } from "react";
24
21
  import { DynamicTexture } from "@babylonjs/core";
25
- import { EmptyProps } from "antd";
26
22
  import { Engine } from "@babylonjs/core";
27
23
  import { EventType } from "rhine-var";
28
24
  import { FocusEventHandler } from "react";
@@ -35,7 +31,6 @@ import { HTMLAttributeReferrerPolicy } from "react";
35
31
  import { HTMLAttributes } from "react";
36
32
  import { InputBlock } from "@babylonjs/core";
37
33
  import { InputEventHandler } from "react";
38
- import { InputNumberProps } from "antd";
39
34
  import { IParticleSystem } from "@babylonjs/core";
40
35
  import { JSX } from "react/jsx-runtime";
41
36
  import { Key } from "react";
@@ -77,13 +72,11 @@ import { Root } from "react-dom/client";
77
72
  import { RvKey } from "rhine-var";
78
73
  import { RvPath } from "rhine-var";
79
74
  import { Scene } from "@babylonjs/core";
80
- import { SelectProps } from "antd";
81
75
  import { ShadowGenerator } from "@babylonjs/core";
82
76
  import { SixDofDragBehavior } from "@babylonjs/core/Behaviors/Meshes/sixDofDragBehavior";
83
77
  import { Skeleton } from "@babylonjs/core";
84
78
  import { StandardMaterial } from "@babylonjs/core";
85
79
  import { StoredRhineVar } from "rhine-var";
86
- import { SwitchProps } from "antd";
87
80
  import { Texture } from "@babylonjs/core";
88
81
  import { TextureBlock } from "@babylonjs/core";
89
82
  import { ToggleEventHandler } from "react";
@@ -233,115 +226,6 @@ export declare class AnimationNativeAttribute extends NodeAttribute<RvNative> {
233
226
  generate(sid: string, nid: string): RvNative;
234
227
  }
235
228
 
236
- /**
237
- * @public
238
- */
239
- export declare function AntCheckbox(props: AntCheckboxProps): JSX.Element;
240
-
241
- /**
242
- * @public
243
- */
244
- export declare interface AntCheckboxProps extends SwitchProps {
245
- value: boolean;
246
- onChange: (value: boolean) => void;
247
- className?: string | undefined;
248
- label?: string;
249
- }
250
-
251
- /**
252
- * @public
253
- */
254
- export declare function AntColor(props: AntColorProps): JSX.Element;
255
-
256
- /**
257
- * @public
258
- */
259
- export declare interface AntColorProps extends ColorPickerProps {
260
- value: Color | string | null;
261
- onColorChange: (value: string) => void;
262
- className?: string;
263
- classNameInner?: string;
264
- theme?: string;
265
- }
266
-
267
- /**
268
- * @public
269
- */
270
- export declare function AntEmpty(props: AntEmptyProps): JSX.Element;
271
-
272
- /**
273
- * @public
274
- */
275
- export declare interface AntEmptyProps extends EmptyProps {
276
- className?: string;
277
- classNameInner?: string;
278
- image?: ReactNode;
279
- description?: ReactNode;
280
- children?: ReactNode;
281
- }
282
-
283
- /**
284
- * @public
285
- */
286
- export declare function AntNumber(props: AntNumberProps): JSX.Element;
287
-
288
- /**
289
- * @public
290
- */
291
- export declare interface AntNumberProps extends Omit<
292
- InputNumberProps,
293
- "onChange"
294
- > {
295
- value: number | null;
296
- onChange: (value: number | null) => void;
297
- placeholder?: string;
298
- className?: string;
299
- classNameInner?: string;
300
- theme?: string;
301
- }
302
-
303
- /**
304
- * @public
305
- */
306
- export declare function AntSelect<ValueType>(
307
- props: AntSelectProps<ValueType>,
308
- ): JSX.Element;
309
-
310
- /**
311
- * @public
312
- */
313
- export declare interface AntSelectProps<
314
- ValueType,
315
- > extends SelectProps<ValueType> {
316
- value?: ValueType;
317
- onChange?: (
318
- value: ValueType,
319
- option?: DefaultOptionType | DefaultOptionType[],
320
- ) => void;
321
- showSearch?: boolean;
322
- onClick?: MouseEventHandler<HTMLDivElement>;
323
- className?: string;
324
- classNameInner?: string;
325
- placeholder?: string;
326
- optionFilterProp?: string;
327
- size?: "small" | "middle" | "large" | undefined;
328
- options?: DefaultOptionType[];
329
- }
330
-
331
- /**
332
- * @public
333
- */
334
- export declare function AntSwitch(props: AntSwitchProps): JSX.Element;
335
-
336
- /**
337
- * @public
338
- */
339
- export declare interface AntSwitchProps extends SwitchProps {
340
- value: boolean;
341
- onChange: (value: boolean) => void;
342
- className?: string | undefined;
343
- }
344
-
345
229
  declare function approximatelyEqual(
346
230
  n1: number,
347
231
  n2: number,
@@ -943,6 +827,31 @@ declare function checkRvPathStartWith(
943
827
 
944
828
  declare function chunkHash(file: File): Promise<string>;
945
829
 
830
+ /**
831
+ * 剪贴板工具集
832
+ *
833
+ * 提供剪贴板读写操作,支持普通文本和节点列表的复制粘贴
834
+ *
835
+ * @remarks
836
+ * 节点列表使用特定格式 `<nodes nid-a nid-b...>` 存储在剪贴板中,
837
+ * 便于在应用内识别和解析节点数据
838
+ *
839
+ * @example
840
+ * ```typescript
841
+ * // 复制节点
842
+ * await ClipboardUtils.copyNodes(['node-1', 'node-2'])
843
+ *
844
+ * // 粘贴节点
845
+ * const nodes = await ClipboardUtils.getNodes()
846
+ * ```
847
+ */
848
+ export declare const ClipboardUtils: {
849
+ copy: typeof copy;
850
+ copyNodes: typeof copyNodes;
851
+ getText: typeof getText;
852
+ getNodes: typeof getNodes;
853
+ };
854
+
946
855
  declare function computeSHA256(buffer: BufferSource): Promise<string>;
947
856
 
948
857
  /**
@@ -1145,10 +1054,50 @@ declare function convertBytesToHigherUnit(bn: number): string;
1145
1054
 
1146
1055
  declare function convertTimeText(seconds: number): string;
1147
1056
 
1057
+ /**
1058
+ * 复制文本到剪贴板
1059
+ *
1060
+ * @param text - 要复制的文本内容
1061
+ * @returns 复制完成的 Promise
1062
+ * @throws 当剪贴板 API 不可用或权限被拒绝时抛出异常
1063
+ *
1064
+ * @example
1065
+ * ```typescript
1066
+ * await ClipboardUtils.copy('Hello World')
1067
+ * ```
1068
+ */
1069
+ declare function copy(text: string): Promise<void>;
1070
+
1148
1071
  declare function copyCurrentUrlToClipboard(): Promise<boolean>;
1149
1072
 
1073
+ /**
1074
+ * 复制节点列表到剪贴板
1075
+ *
1076
+ * 将节点 ID 列表格式化为 `<nodes nid-a nid-b...>` 格式并复制到剪贴板
1077
+ *
1078
+ * @param nidList - 节点 ID 列表
1079
+ * @returns 复制完成的 Promise
1080
+ * @throws 当剪贴板 API 不可用或权限被拒绝时抛出异常
1081
+ *
1082
+ * @example
1083
+ * ```typescript
1084
+ * await ClipboardUtils.copyNodes(['node-1', 'node-2', 'node-3'])
1085
+ * // 剪贴板内容: <nodes node-1 node-2 node-3>
1086
+ * ```
1087
+ */
1088
+ declare function copyNodes(nidList: string[]): Promise<void>;
1089
+
1150
1090
  declare function copyText(text: string): Promise<boolean>;
1151
1091
 
1092
+ /**
1093
+ * @public
1094
+ */
1095
+ export declare class Counter {
1096
+ value: number;
1097
+ constructor(defaultValue?: number);
1098
+ add(): number;
1099
+ }
1100
+
1152
1101
  /**
1153
1102
  * 创建属性右键菜单
1154
1103
  *
@@ -2226,6 +2175,27 @@ export declare function getNearestAngleVector3(
2226
2175
 
2227
2176
  declare function getNearestNumberIndex(x: number, list: number[]): number;
2228
2177
 
2178
+ /**
2179
+ * 获取剪贴板中的节点列表
2180
+ *
2181
+ * 解析剪贴板中 `<nodes nid-a nid-b...>` 格式的文本,提取节点 ID 列表
2182
+ *
2183
+ * @returns 节点 ID 列表,格式不符合时返回空数组
2184
+ * @throws 当剪贴板 API 不可用或权限被拒绝时抛出异常
2185
+ *
2186
+ * @example
2187
+ * ```typescript
2188
+ * // 假设剪贴板内容为: <nodes node-1 node-2 node-3>
2189
+ * const nodes = await ClipboardUtils.getNodes()
2190
+ * console.log(nodes) // ['node-1', 'node-2', 'node-3']
2191
+ *
2192
+ * // 假设剪贴板内容为普通文本
2193
+ * const nodes = await ClipboardUtils.getNodes()
2194
+ * console.log(nodes) // []
2195
+ * ```
2196
+ */
2197
+ declare function getNodes(): Promise<string[]>;
2198
+
2229
2199
  declare function getPageTypeBySpaceText(space: string): PageType;
2230
2200
 
2231
2201
  declare function getParam(name: string): string;
@@ -2237,6 +2207,20 @@ export declare function getPointDistance(p1: Vector3, p2: Vector3): number;
2237
2207
 
2238
2208
  declare function getSearchParams(key: string): string | undefined;
2239
2209
 
2210
+ /**
2211
+ * 获取剪贴板中的文本
2212
+ *
2213
+ * @returns 剪贴板中的文本内容
2214
+ * @throws 当剪贴板 API 不可用或权限被拒绝时抛出异常
2215
+ *
2216
+ * @example
2217
+ * ```typescript
2218
+ * const text = await ClipboardUtils.getText()
2219
+ * console.log(text)
2220
+ * ```
2221
+ */
2222
+ declare function getText(): Promise<string>;
2223
+
2240
2224
  /**
2241
2225
  * @public
2242
2226
  */
@@ -4342,7 +4326,7 @@ declare function roundToX(num: number, x: number): number;
4342
4326
  export declare class RsAnimationManager {
4343
4327
  constructor();
4344
4328
  static initialize(): Promise<void>;
4345
- static analysisAnimationDuration(
4329
+ static analyzeAnimationDuration(
4346
4330
  step: StoredRhineVar<RvStep>,
4347
4331
  lastStep?: RvStep,
4348
4332
  ): number;
@@ -4508,7 +4492,6 @@ export declare interface RsdInputProps extends DivPropsSimple {
4508
4492
  type?: "text" | "number" | "password";
4509
4493
  placeholder?: string;
4510
4494
  className?: string;
4511
- theme?: string;
4512
4495
  rows?: number;
4513
4496
  maxLength?: number;
4514
4497
  }
@@ -4942,6 +4925,7 @@ export declare class RsNodeMaterialManager {
4942
4925
  * - mid: model id,模型ID
4943
4926
  * - level: 节点在树中的层级(从0开始)
4944
4927
  * - index: 节点在当前生成过程中的序号(深度优先遍历顺序)
4928
+ * 注意 nid 的格式并非绝对,请勿从 nid 中截取信息,来用于后续的计算
4945
4929
  *
4946
4930
  * @example
4947
4931
  * ```typescript
@@ -4960,51 +4944,6 @@ export declare class RsNodeService {
4960
4944
  */
4961
4945
  static get instance(): RsNodeService;
4962
4946
  private constructor();
4963
- /**
4964
- * 解析节点映射关系
4965
- *
4966
- * 从 RvModelService 中读取压缩的节点结构数据,解压并重建 nodePairs 映射表。
4967
- * 使用场景:当模型从服务器加载或从 RhineVar 同步时,需要恢复节点映射关系。
4968
- *
4969
- * @param mid - 模型ID
4970
- * @param root - 模型的根节点对象
4971
- *
4972
- * @remarks
4973
- * 数据压缩格式:将 `":[]"},{"` 替换为 `\x11` 以减少存储空间
4974
- *
4975
- * @example
4976
- * ```typescript
4977
- * // 模型加载完成后,解析节点映射
4978
- * const rootNode = container.meshes[0]
4979
- * RsNodeService.instance.analysisNodePairs('model-123', rootNode)
4980
- * ```
4981
- */
4982
- analysisNodePairs(mid: string, root: Node_2): void;
4983
- /**
4984
- * 生成节点映射对并保存到 RvModel
4985
- *
4986
- * 遍历 Babylon.js 节点树,为每个节点生成 nid 并创建 NodePair 映射。
4987
- * 将节点结构序列化、压缩后存储到 RvModelService 中。
4988
- *
4989
- * 使用场景:首次加载模型时,或者模型节点结构发生变化时调用。
4990
- *
4991
- * @param mid - 模型ID
4992
- * @param root - 模型的根节点对象
4993
- *
4994
- * @remarks
4995
- * - 采用深度优先遍历生成节点序号
4996
- * - 压缩算法:将重复的 `":[]"},{"` 字符串替换为 `\x11` 以节省空间
4997
- * - 生成完成后会通过发布订阅机制通知所有订阅者
4998
- *
4999
- * @example
5000
- * ```typescript
5001
- * // 首次加载模型后生成映射
5002
- * const container = await SceneLoader.ImportMeshAsync(...)
5003
- * const root = container.meshes[0]
5004
- * RsNodeService.instance.generateNodePairs('model-123', root)
5005
- * ```
5006
- */
5007
- generateNodePairs(mid: string, root: Node_2): void;
5008
4947
  /**
5009
4948
  * 生成场景节点结构并添加到 RvScene
5010
4949
  *
@@ -5016,20 +4955,23 @@ export declare class RsNodeService {
5016
4955
  * @param mid - 模型ID
5017
4956
  * @param root - 模型的根节点对象
5018
4957
  *
5019
- * @remarks
5020
- * 与 generateNodePairs 的区别:
5021
- * - generateNodePairs: 生成压缩的节点结构存储到 RvModel(用于节点查询)
5022
- * - generateSceneNode: 生成完整的场景节点树存储到 RvScene(用于场景编辑和同步)
5023
- *
5024
4958
  * @example
5025
4959
  * ```typescript
5026
4960
  * // 添加模型到场景
5027
- * const container = await SceneLoader.ImportMeshAsync(...)
5028
- * const root = container.meshes[0]
5029
4961
  * RsNodeService.instance.generateSceneNode('model-123', root)
5030
4962
  * ```
5031
4963
  */
5032
4964
  generateSceneNode(mid: string, root: Node_2): void;
4965
+ /**
4966
+ * 生成节点指纹
4967
+ *
4968
+ * 根据节点的多种属性生成唯一指纹,用于区分同名节点。
4969
+ * 包含:位置、旋转、缩放、子节点数量、Mesh 顶点等信息。
4970
+ *
4971
+ * @param node - Babylon.js 节点对象
4972
+ * @returns 指纹字符串
4973
+ */
4974
+ generateFingerprint(node: Node_2): string;
5033
4975
  /**
5034
4976
  * 根据 nid 获取节点映射信息
5035
4977
  *
@@ -5108,6 +5050,16 @@ export declare class RsNodeService {
5108
5050
  * ```
5109
5051
  */
5110
5052
  getMidByNid(nid: string): string | null;
5053
+ /**
5054
+ * 分析指定mid的模型加载内部所有节点
5055
+ *
5056
+ * 从 RvSceneService 中获取所有来自该 mid 的 RvSceneNode,
5057
+ * 并将 root 及其内部的所有节点与 RvSceneNode 对应上,调用 addNodePair 完成加载。
5058
+ *
5059
+ * @param mid - 模型的 mid
5060
+ * @param root - 该模型的根节点
5061
+ */
5062
+ analyzeSceneNode(mid: string, root: Node_2): void;
5111
5063
  /**
5112
5064
  * 根据模型ID获取文件ID (fid)
5113
5065
  *
@@ -5313,9 +5265,10 @@ export declare class RsSeparateService {
5313
5265
  checkMaterialType(material: Material, type: RvMaterialType): boolean;
5314
5266
  /**
5315
5267
  * 分析所有模型,找到其中所有有使用相同材质的模型,分组他们的id
5316
- * @param meshes -
5268
+ *
5269
+ * @param meshes
5317
5270
  */
5318
- analysisByMeshes(meshes: AbstractMesh[]): void;
5271
+ analyzeByMeshes(meshes: AbstractMesh[]): void;
5319
5272
  }
5320
5273
 
5321
5274
  /**
@@ -6023,7 +5976,6 @@ export declare interface RvModel {
6023
5976
  origin: RvModelOrigin;
6024
5977
  fid?: string;
6025
5978
  config?: RvBasicConfig | Record<string, unknown>;
6026
- node?: string;
6027
5979
  }
6028
5980
 
6029
5981
  /**
@@ -6056,15 +6008,11 @@ export declare class RvModelService {
6056
6008
  ): Promise<void>;
6057
6009
  addByFid(fid: string, provide?: boolean): string;
6058
6010
  models: RecursiveMap<RvModel>;
6059
- hadAddList: string[];
6060
6011
  get(mid: string): RecursiveObject<RvModel> | undefined;
6061
6012
  has(mid: string): boolean;
6062
6013
  hasFid(fid: string): boolean;
6063
6014
  add(rvModel: RvModel): string;
6064
6015
  remove(mid: string): boolean;
6065
- hasNode(mid: string): boolean;
6066
- setNode(mid: string, node: string): boolean;
6067
- getNode(mid: string): string | undefined;
6068
6016
  generateId(): string;
6069
6017
  }
6070
6018
 
@@ -6122,6 +6070,7 @@ export declare class RvNodeService {
6122
6070
  isInitialized(nid: string): boolean;
6123
6071
  multiInitialize(nidList: string[]): void;
6124
6072
  isAllInitialized(nidList: string[]): boolean;
6073
+ copy(fromNid: string, toNid: string): void;
6125
6074
  forEachAny(
6126
6075
  callback: (node: StoredRhineVar<RvNode>, sid: string, nid: string) => void,
6127
6076
  nidList?: string[],
@@ -6332,15 +6281,13 @@ export declare enum RvResourceType {
6332
6281
  export declare interface RvSceneNode {
6333
6282
  nid: string;
6334
6283
  name: string;
6335
- from: string;
6336
- }
6337
-
6338
- /**
6339
- * @public
6340
- */
6341
- export declare interface RvSceneNodeWithRelatedInfo extends RvSceneNode {
6342
- children: string[];
6343
- parents: string[];
6284
+ parentNode: string;
6285
+ source: {
6286
+ mid: string;
6287
+ name: string;
6288
+ fingerprint?: string;
6289
+ copy?: string;
6290
+ };
6344
6291
  }
6345
6292
 
6346
6293
  /**
@@ -6351,11 +6298,17 @@ export declare class RvSceneService {
6351
6298
  private constructor();
6352
6299
  scene: RecursiveMap<RvSceneNode>;
6353
6300
  isDescendant(nid: string, of: string): boolean;
6301
+ /**
6302
+ * 是否存在来自指定mid的节点
6303
+ *
6304
+ * @param mid
6305
+ */
6306
+ hasNodeFromMid(mid: string): boolean;
6354
6307
  isAncestor(nid: string, of: string): boolean;
6355
6308
  isParent(nid: string, of: string): boolean;
6356
6309
  isChild(nid: string, of: string): boolean;
6357
6310
  move(nid: string, newParent?: string): void;
6358
- getSortedRvSceneNodeWithRelatedInfoList(): RvSceneNodeWithRelatedInfo[];
6311
+ getSortedRvSceneNodeWithRelatedInfoList(): SceneNodeWithRelatedInfo[];
6359
6312
  }
6360
6313
 
6361
6314
  /**
@@ -6443,6 +6396,14 @@ declare function scaleV3(ratio: number, v: V3): V3;
6443
6396
 
6444
6397
  declare function scaleV4(ratio: number, v: V4): V4;
6445
6398
 
6399
+ /**
6400
+ * @public
6401
+ */
6402
+ export declare interface SceneNodeWithRelatedInfo extends RvSceneNode {
6403
+ children: string[];
6404
+ parents: string[];
6405
+ }
6406
+
6446
6407
  /**
6447
6408
  * @public
6448
6409
  */
@@ -6456,6 +6417,7 @@ export declare class SceneService {
6456
6417
  offsetX: number;
6457
6418
  offsetY: number;
6458
6419
  };
6420
+ copy(fromNid: string, parent?: string): string;
6459
6421
  }
6460
6422
 
6461
6423
  /**
@@ -6625,6 +6587,10 @@ export declare class SpaceService {
6625
6587
  page: Page;
6626
6588
  screen: Screen_2;
6627
6589
  private constructor();
6590
+ /**
6591
+ * @public
6592
+ */
6593
+ updateScreenSize(): void;
6628
6594
  /**
6629
6595
  * @public
6630
6596
  */
@@ -6925,17 +6891,6 @@ export declare type SupportAnimationTarget =
6925
6891
  * @public
6926
6892
  */
6927
6893
  export declare class SyncService {
6928
- /**
6929
- * RhineVar 同步覆写模式标志
6930
- *
6931
- * @description
6932
- * 启用时,允许本地状态在初始化时覆盖远程状态。
6933
- * 通常仅用于开发或调试目的。
6934
- *
6935
- * @defaultValue false
6936
- * @public
6937
- */
6938
- OVERWRITE_MODE: boolean;
6939
6894
  /**
6940
6895
  * 启用 RhineVar 内部日志
6941
6896
  *
package/package.json CHANGED
@@ -27,7 +27,6 @@
27
27
  ],
28
28
  "peerDependencies": {
29
29
  "@babylonjs/core": "8.33.0",
30
- "antd": "5.27.0",
31
30
  "brotli-wasm": "^3.0.1",
32
31
  "clsx": "2.1.1",
33
32
  "file-type": "^21.0.0",
@@ -37,7 +36,7 @@
37
36
  "valtio": "2.1.7",
38
37
  "rhine-var": "0.11.2"
39
38
  },
40
- "version": "0.25.13",
39
+ "version": "0.26.7",
41
40
  "author": "NextFlow",
42
41
  "license": "Apache-2.0",
43
42
  "keywords": [