@soonspacejs/plugin-flow 2.13.7 → 2.13.9
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/README.md +4 -4
- package/dist/flows/ComponentFlowParser.d.ts +8 -0
- package/dist/flows/FlowParser.d.ts +46 -0
- package/dist/flows/edges/index.d.ts +9 -0
- package/dist/flows/index.d.ts +4 -0
- package/dist/flows/nodes/ColorNode.d.ts +8 -0
- package/dist/flows/nodes/ConditionNode.d.ts +9 -0
- package/dist/flows/nodes/DataExtractionNode.d.ts +8 -0
- package/dist/flows/nodes/DataFilterNode.d.ts +8 -0
- package/dist/flows/nodes/DelayNode.d.ts +8 -0
- package/dist/flows/nodes/EmissiveNode.d.ts +10 -0
- package/dist/flows/nodes/FlyToNode.d.ts +8 -0
- package/dist/flows/nodes/HideNode.d.ts +10 -0
- package/dist/flows/nodes/HighlightNode.d.ts +10 -0
- package/dist/flows/nodes/MeshNode.d.ts +8 -0
- package/dist/flows/nodes/MeshesNode.d.ts +8 -0
- package/dist/flows/nodes/ModelNode.d.ts +8 -0
- package/dist/flows/nodes/ModelsNode.d.ts +8 -0
- package/dist/flows/nodes/Node.d.ts +48 -0
- package/dist/flows/nodes/NumberNode.d.ts +8 -0
- package/dist/flows/nodes/OpacityNode.d.ts +10 -0
- package/dist/flows/nodes/POINode.d.ts +8 -0
- package/dist/flows/nodes/POISNode.d.ts +8 -0
- package/dist/flows/nodes/PathNode.d.ts +8 -0
- package/dist/flows/nodes/PathsNode.d.ts +8 -0
- package/dist/flows/nodes/RotateNode.d.ts +8 -0
- package/dist/flows/nodes/ScaleNode.d.ts +8 -0
- package/dist/flows/nodes/ShowNode.d.ts +10 -0
- package/dist/flows/nodes/SpaceNode.d.ts +8 -0
- package/dist/flows/nodes/SpacesNode.d.ts +8 -0
- package/dist/flows/nodes/StartNode.d.ts +7 -0
- package/dist/flows/nodes/TranslateNode.d.ts +8 -0
- package/dist/flows/nodes/UnEmissiveNode.d.ts +10 -0
- package/dist/flows/nodes/UnHighlightNode.d.ts +10 -0
- package/dist/flows/nodes/UnOpacityNode.d.ts +10 -0
- package/dist/flows/nodes/clip-animation/ClipAnimationNode.d.ts +8 -0
- package/dist/flows/nodes/clip-animation/UnClipAnimationNode.d.ts +8 -0
- package/dist/flows/nodes/clip-animation/index.d.ts +2 -0
- package/dist/flows/nodes/component-tween-animation/ComponentTweenAnimationNode.d.ts +8 -0
- package/dist/flows/nodes/component-tween-animation/UnComponentTweenAnimationNode.d.ts +8 -0
- package/dist/flows/nodes/component-tween-animation/index.d.ts +2 -0
- package/dist/flows/nodes/component-tween-animation/utils.d.ts +5 -0
- package/dist/flows/nodes/index.d.ts +33 -0
- package/dist/flows/nodes/tween-animation/TweenAnimationNode.d.ts +8 -0
- package/dist/flows/nodes/tween-animation/UnTweenAnimationNode.d.ts +8 -0
- package/dist/flows/nodes/tween-animation/index.d.ts +2 -0
- package/dist/flows/nodes/tween-animation/utils.d.ts +5 -0
- package/dist/flows/types.d.ts +106 -0
- package/dist/flows/utils.d.ts +12 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.esm.js +1 -1881
- package/dist/triggers/ComponentTrigger.d.ts +18 -0
- package/dist/triggers/Trigger.d.ts +27 -0
- package/dist/triggers/index.d.ts +3 -0
- package/dist/triggers/types.d.ts +54 -0
- package/dist/triggers/utils.d.ts +2 -0
- package/dist/types.d.ts +16 -0
- package/package.json +3 -3
- package/test/test.ts +118 -118
- package/dist/index.esm.js.map +0 -1
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { Model } from 'soonspacejs';
|
|
2
|
+
import { Object3D } from 'three';
|
|
3
|
+
import { IAnimation, IComponentAnimation } from '../types';
|
|
4
|
+
import { Node } from './nodes';
|
|
5
|
+
export declare enum NodePropTypeEnum {
|
|
6
|
+
LOCAL = "LOCAL",
|
|
7
|
+
READ_CTX = "READ_CTX",
|
|
8
|
+
WRITE_CTX = "WRITE_CTX"
|
|
9
|
+
}
|
|
10
|
+
export declare enum NodeTypeEnum {
|
|
11
|
+
START = "START",
|
|
12
|
+
COLOR = "COLOR",
|
|
13
|
+
NUMBER = "NUMBER",
|
|
14
|
+
HIGHLIGHT = "HIGHLIGHT",
|
|
15
|
+
UN_HIGHLIGHT = "UN_HIGHLIGHT",
|
|
16
|
+
OPACITY = "OPACITY",
|
|
17
|
+
UN_OPACITY = "UN_OPACITY",
|
|
18
|
+
EMISSIVE = "EMISSIVE",
|
|
19
|
+
UN_EMISSIVE = "UN_EMISSIVE",
|
|
20
|
+
MESH = "MESH",
|
|
21
|
+
MESHES = "MESHES",
|
|
22
|
+
MODEL = "MODEL",
|
|
23
|
+
MODELS = "MODELS",
|
|
24
|
+
SHOW = "SHOW",
|
|
25
|
+
HIDE = "HIDE",
|
|
26
|
+
CLIP_ANIMATION = "CLIP_ANIMATION",
|
|
27
|
+
UN_CLIP_ANIMATION = "UN_CLIP_ANIMATION",
|
|
28
|
+
TWEEN_ANIMATION = "TWEEN_ANIMATION",
|
|
29
|
+
UN_TWEEN_ANIMATION = "UN_TWEEN_ANIMATION",
|
|
30
|
+
COMPONENT_TWEEN_ANIMATION = "COMPONENT_TWEEN_ANIMATION",
|
|
31
|
+
UN_COMPONENT_TWEEN_ANIMATION = "UN_COMPONENT_TWEEN_ANIMATION",
|
|
32
|
+
SPACE = "SPACE",
|
|
33
|
+
SPACES = "SPACES",
|
|
34
|
+
PATH = "PATH",
|
|
35
|
+
PATHS = "PATHS",
|
|
36
|
+
POI = "POI",
|
|
37
|
+
POIS = "POIS",
|
|
38
|
+
FLY_TO = "FLY_TO",
|
|
39
|
+
TRANSLATE = "TRANSLATE",
|
|
40
|
+
ROTATE = "ROTATE",
|
|
41
|
+
SCALE = "SCALE",
|
|
42
|
+
DATA_FILTER = "DATA_FILTER",
|
|
43
|
+
DATA_EXTRACTION = "DATA_EXTRACTION",
|
|
44
|
+
CONDITION_NODE = "CONDITION_NODE",
|
|
45
|
+
DELAY = "DELAY"
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* 节点 props 数据
|
|
49
|
+
*/
|
|
50
|
+
export type NodePropType = {
|
|
51
|
+
name: string;
|
|
52
|
+
type: NodePropTypeEnum;
|
|
53
|
+
value: string;
|
|
54
|
+
valueType: string;
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* 节点数据
|
|
58
|
+
*/
|
|
59
|
+
export type NodeType = {
|
|
60
|
+
id: string;
|
|
61
|
+
type: NodeTypeEnum;
|
|
62
|
+
props: NodePropType[];
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* 连接数据
|
|
66
|
+
*/
|
|
67
|
+
export type EdgeType = {
|
|
68
|
+
id: string;
|
|
69
|
+
source: string;
|
|
70
|
+
target: string;
|
|
71
|
+
sourceHandle?: string | null;
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* 流程数据
|
|
75
|
+
*/
|
|
76
|
+
export type FlowType = {
|
|
77
|
+
id: string;
|
|
78
|
+
sid: string;
|
|
79
|
+
name: string;
|
|
80
|
+
portal: string;
|
|
81
|
+
nodes: NodeType[];
|
|
82
|
+
edges: EdgeType[];
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* 组件流程数据
|
|
86
|
+
*/
|
|
87
|
+
export type ComponentFlowType = FlowType & {
|
|
88
|
+
editionId: string;
|
|
89
|
+
};
|
|
90
|
+
/**
|
|
91
|
+
* 节点上下文对象
|
|
92
|
+
*/
|
|
93
|
+
export type NodeCtxType = {
|
|
94
|
+
[x: string]: any;
|
|
95
|
+
};
|
|
96
|
+
/**
|
|
97
|
+
* 节点全局对象
|
|
98
|
+
* 由运行时动态定义接口
|
|
99
|
+
*/
|
|
100
|
+
export type NodeGlobalType = {
|
|
101
|
+
getTarget?: (currentNode: Node) => Promise<Model | null>;
|
|
102
|
+
getAnimations?: (currentNode: Node, object: Object3D, animationId: string) => Promise<IAnimation[] | null>;
|
|
103
|
+
getComponentAnimations?: (currentNode: Node, object: Object3D, animationId: string) => Promise<IComponentAnimation[] | null>;
|
|
104
|
+
[s: symbol]: any;
|
|
105
|
+
};
|
|
106
|
+
export type FlowParserEventMap = {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Object3D } from 'three';
|
|
2
|
+
import SoonSpace, { BaseObject3D } from 'soonspacejs';
|
|
3
|
+
import { FlowParser } from './FlowParser';
|
|
4
|
+
import { Node } from './nodes';
|
|
5
|
+
import { NodeType } from './types';
|
|
6
|
+
export declare function parseNodeByType(parser: FlowParser, node: NodeType): Node;
|
|
7
|
+
export declare function parseValue<T = any>(value: string): T;
|
|
8
|
+
export declare function waitFor(fn: () => Promise<void>, wait: boolean): Promise<void>;
|
|
9
|
+
export declare function getObjectByIds(ssp: SoonSpace, ids: string[]): BaseObject3D[];
|
|
10
|
+
export declare function getObjectById(ssp: SoonSpace, id: string, object?: Object3D): Object3D | null;
|
|
11
|
+
export declare function getMeshByUserDataUuid(object: Object3D, uuid: string): Object3D | null;
|
|
12
|
+
export declare function filterNodes(prevNode: Node, result: Node[]): Node[];
|
package/dist/index.d.ts
ADDED