@soonspacejs/plugin-flow 2.11.67 → 2.11.69
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/{ComponentFlowParser.d.ts → flows/ComponentFlowParser.d.ts} +0 -4
- package/dist/{FlowParser.d.ts → flows/FlowParser.d.ts} +7 -5
- package/dist/{Edge.d.ts → flows/edges/index.d.ts} +1 -1
- package/dist/flows/index.d.ts +3 -0
- package/dist/{nodes → flows/nodes}/ColorNode.d.ts +1 -3
- package/dist/flows/nodes/DelayNode.d.ts +8 -0
- package/dist/flows/nodes/EmissiveNode.d.ts +8 -0
- package/dist/flows/nodes/HideNode.d.ts +8 -0
- package/dist/{nodes → flows/nodes}/HighlightNode.d.ts +2 -2
- 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 +38 -0
- package/dist/{nodes → flows/nodes}/NumberNode.d.ts +1 -3
- package/dist/flows/nodes/OpacityNode.d.ts +8 -0
- package/dist/flows/nodes/ShowNode.d.ts +8 -0
- package/dist/flows/nodes/UnEmissiveNode.d.ts +8 -0
- package/dist/flows/nodes/UnHighlightNode.d.ts +8 -0
- package/dist/flows/nodes/UnOpacityNode.d.ts +8 -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 +20 -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 +91 -0
- package/dist/flows/utils.d.ts +11 -0
- package/dist/index.d.ts +3 -2
- package/dist/index.esm.js +1 -1
- package/dist/triggers/ComponentTrigger.d.ts +22 -0
- package/dist/triggers/Trigger.d.ts +8 -0
- package/dist/triggers/index.d.ts +3 -0
- package/dist/triggers/types.d.ts +41 -0
- package/dist/types.d.ts +12 -59
- package/package.json +4 -3
- package/dist/nodes/MeshNode.d.ts +0 -11
- package/dist/nodes/Node.d.ts +0 -13
- package/dist/nodes/index.d.ts +0 -6
- package/dist/utils.d.ts +0 -5
- /package/dist/{nodes → flows/nodes}/StartNode.d.ts +0 -0
|
@@ -1,22 +1,24 @@
|
|
|
1
1
|
import SoonSpace from 'soonspacejs';
|
|
2
|
-
import { Edge } from './
|
|
2
|
+
import { Edge } from './edges';
|
|
3
3
|
import { Node } from './nodes';
|
|
4
|
-
import { NodeGlobalType } from './types';
|
|
4
|
+
import { FlowType, NodeGlobalType } from './types';
|
|
5
5
|
declare class FlowParser {
|
|
6
6
|
ssp: SoonSpace;
|
|
7
|
+
flow: FlowType;
|
|
7
8
|
nodes: Node[];
|
|
8
9
|
nodesMap: Map<Node['id'], Node>;
|
|
9
10
|
edges: Edge[];
|
|
10
11
|
edgesMap: Map<Edge['id'], Edge>;
|
|
11
|
-
constructor(ssp: SoonSpace);
|
|
12
|
+
constructor(ssp: SoonSpace, flow: FlowType);
|
|
12
13
|
addNode(node: Node): void;
|
|
13
14
|
addEdge(edge: Edge): void;
|
|
14
15
|
getNodeById(id: string): Node | undefined;
|
|
15
16
|
getEdgeById(id: string): Edge | undefined;
|
|
17
|
+
clear(): void;
|
|
16
18
|
/**
|
|
17
|
-
*
|
|
19
|
+
* 解析流程
|
|
18
20
|
*/
|
|
19
|
-
|
|
21
|
+
parse(): void;
|
|
20
22
|
/**
|
|
21
23
|
* 执行流程
|
|
22
24
|
* @param startNode
|
|
@@ -3,8 +3,6 @@ import { NodeType } from '../types';
|
|
|
3
3
|
import { Node } from './Node';
|
|
4
4
|
declare class ColorNode extends Node {
|
|
5
5
|
constructor(ssp: SoonSpace, node: NodeType);
|
|
6
|
-
|
|
7
|
-
[x: number]: any;
|
|
8
|
-
} | undefined>;
|
|
6
|
+
exec(): Promise<void>;
|
|
9
7
|
}
|
|
10
8
|
export { ColorNode, };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import SoonSpace from 'soonspacejs';
|
|
2
|
-
import {
|
|
2
|
+
import { NodeType } from '../types';
|
|
3
3
|
import { Node } from './Node';
|
|
4
4
|
declare class HighlightNode extends Node {
|
|
5
5
|
constructor(ssp: SoonSpace, node: NodeType);
|
|
6
|
-
|
|
6
|
+
exec(): Promise<void>;
|
|
7
7
|
}
|
|
8
8
|
export { HighlightNode, };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import SoonSpace from 'soonspacejs';
|
|
2
|
+
import { NodeGlobalType, NodeType } from '../types';
|
|
3
|
+
import { Node } from './Node';
|
|
4
|
+
declare class MeshNode extends Node {
|
|
5
|
+
constructor(ssp: SoonSpace, node: NodeType);
|
|
6
|
+
exec(global: NodeGlobalType): Promise<void>;
|
|
7
|
+
}
|
|
8
|
+
export { MeshNode, };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import SoonSpace from 'soonspacejs';
|
|
2
|
+
import { NodeGlobalType, NodeType } from '../types';
|
|
3
|
+
import { Node } from './Node';
|
|
4
|
+
declare class MeshesNode extends Node {
|
|
5
|
+
constructor(ssp: SoonSpace, node: NodeType);
|
|
6
|
+
exec(global: NodeGlobalType): Promise<void>;
|
|
7
|
+
}
|
|
8
|
+
export { MeshesNode, };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import SoonSpace from 'soonspacejs';
|
|
2
|
+
import { NodeType, NodeCtxType, NodePropType, NodeGlobalType, NodeTypeEnum } from '../types';
|
|
3
|
+
declare class Node {
|
|
4
|
+
ssp: SoonSpace;
|
|
5
|
+
id: string;
|
|
6
|
+
type: NodeTypeEnum;
|
|
7
|
+
props: NodeType['props'];
|
|
8
|
+
prevNodes: Node[];
|
|
9
|
+
postNodes: Node[];
|
|
10
|
+
ctx: NodeCtxType;
|
|
11
|
+
promise: Promise<void>;
|
|
12
|
+
resolve: () => void;
|
|
13
|
+
reject: (reason?: any) => void;
|
|
14
|
+
constructor(ssp: SoonSpace, node: NodeType);
|
|
15
|
+
reset(): void;
|
|
16
|
+
readContext<T = any>(key: string): T | undefined;
|
|
17
|
+
writeContext(key: string, value: any): void;
|
|
18
|
+
findProp(name: string, type: NodePropType['type']): NodePropType | undefined;
|
|
19
|
+
/**
|
|
20
|
+
* 等待前置节点执行完毕
|
|
21
|
+
*/
|
|
22
|
+
waitForPrevNodes(): Promise<void>;
|
|
23
|
+
/**
|
|
24
|
+
* 合并上下文
|
|
25
|
+
*/
|
|
26
|
+
mergeContext(): void;
|
|
27
|
+
/**
|
|
28
|
+
* 执行节点逻辑
|
|
29
|
+
* @param global
|
|
30
|
+
*/
|
|
31
|
+
exec(_global: NodeGlobalType): Promise<void>;
|
|
32
|
+
/**
|
|
33
|
+
* 运行节点
|
|
34
|
+
* @param global
|
|
35
|
+
*/
|
|
36
|
+
run(global: NodeGlobalType): Promise<void>;
|
|
37
|
+
}
|
|
38
|
+
export { Node, };
|
|
@@ -3,8 +3,6 @@ import { NodeType } from '../types';
|
|
|
3
3
|
import { Node } from './Node';
|
|
4
4
|
declare class NumberNode extends Node {
|
|
5
5
|
constructor(ssp: SoonSpace, node: NodeType);
|
|
6
|
-
|
|
7
|
-
[x: number]: any;
|
|
8
|
-
} | undefined>;
|
|
6
|
+
exec(): Promise<void>;
|
|
9
7
|
}
|
|
10
8
|
export { NumberNode, };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import SoonSpace from 'soonspacejs';
|
|
2
|
+
import { NodeGlobalType, NodeType } from '../../types';
|
|
3
|
+
import { Node } from '../Node';
|
|
4
|
+
declare class ClipAnimationNode extends Node {
|
|
5
|
+
constructor(ssp: SoonSpace, node: NodeType);
|
|
6
|
+
exec(global: NodeGlobalType): Promise<void>;
|
|
7
|
+
}
|
|
8
|
+
export { ClipAnimationNode, };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import SoonSpace from 'soonspacejs';
|
|
2
|
+
import { NodeGlobalType, NodeType } from '../../types';
|
|
3
|
+
import { Node } from '../Node';
|
|
4
|
+
declare class UnClipAnimationNode extends Node {
|
|
5
|
+
constructor(ssp: SoonSpace, node: NodeType);
|
|
6
|
+
exec(global: NodeGlobalType): Promise<void>;
|
|
7
|
+
}
|
|
8
|
+
export { UnClipAnimationNode, };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import SoonSpace from 'soonspacejs';
|
|
2
|
+
import { NodeType, NodeGlobalType } from '../../types';
|
|
3
|
+
import { Node } from '../Node';
|
|
4
|
+
declare class ComponentTweenAnimationNode extends Node {
|
|
5
|
+
constructor(ssp: SoonSpace, node: NodeType);
|
|
6
|
+
exec(global: NodeGlobalType): Promise<void>;
|
|
7
|
+
}
|
|
8
|
+
export { ComponentTweenAnimationNode, };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import SoonSpace from 'soonspacejs';
|
|
2
|
+
import { NodeType } from '../../types';
|
|
3
|
+
import { Node } from '../Node';
|
|
4
|
+
declare class UnComponentTweenAnimationNode extends Node {
|
|
5
|
+
constructor(ssp: SoonSpace, node: NodeType);
|
|
6
|
+
exec(): Promise<void>;
|
|
7
|
+
}
|
|
8
|
+
export { UnComponentTweenAnimationNode, };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Object3D } from 'three';
|
|
2
|
+
import SoonSpace from 'soonspacejs';
|
|
3
|
+
import { IComponentAnimation } from '../../../types';
|
|
4
|
+
export declare function playComponentTweenAnimation(ssp: SoonSpace, object: Object3D, componentAnimation: IComponentAnimation): Promise<void>;
|
|
5
|
+
export declare function stopComponentTweenAnimation(animationId: string): void;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export { Node, } from './Node';
|
|
2
|
+
export { StartNode, } from './StartNode';
|
|
3
|
+
export { ColorNode, } from './ColorNode';
|
|
4
|
+
export { NumberNode, } from './NumberNode';
|
|
5
|
+
export { HighlightNode, } from './HighlightNode';
|
|
6
|
+
export { UnHighlightNode, } from './UnHighlightNode';
|
|
7
|
+
export { OpacityNode, } from './OpacityNode';
|
|
8
|
+
export { UnOpacityNode, } from './UnOpacityNode';
|
|
9
|
+
export { EmissiveNode, } from './EmissiveNode';
|
|
10
|
+
export { UnEmissiveNode, } from './UnEmissiveNode';
|
|
11
|
+
export { MeshNode, } from './MeshNode';
|
|
12
|
+
export { MeshesNode, } from './MeshesNode';
|
|
13
|
+
export { ModelNode, } from './ModelNode';
|
|
14
|
+
export { ModelsNode, } from './ModelsNode';
|
|
15
|
+
export { DelayNode, } from './DelayNode';
|
|
16
|
+
export { ShowNode, } from './ShowNode';
|
|
17
|
+
export { HideNode, } from './HideNode';
|
|
18
|
+
export { ClipAnimationNode, UnClipAnimationNode, } from './clip-animation';
|
|
19
|
+
export { TweenAnimationNode, UnTweenAnimationNode, } from './tween-animation';
|
|
20
|
+
export { ComponentTweenAnimationNode, UnComponentTweenAnimationNode, } from './component-tween-animation';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import SoonSpace from 'soonspacejs';
|
|
2
|
+
import { NodeType, NodeGlobalType } from '../../types';
|
|
3
|
+
import { Node } from '../Node';
|
|
4
|
+
declare class TweenAnimationNode extends Node {
|
|
5
|
+
constructor(ssp: SoonSpace, node: NodeType);
|
|
6
|
+
exec(global: NodeGlobalType): Promise<void>;
|
|
7
|
+
}
|
|
8
|
+
export { TweenAnimationNode, };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import SoonSpace from 'soonspacejs';
|
|
2
|
+
import { NodeType } from '../../types';
|
|
3
|
+
import { Node } from '../Node';
|
|
4
|
+
declare class UnTweenAnimationNode extends Node {
|
|
5
|
+
constructor(ssp: SoonSpace, node: NodeType);
|
|
6
|
+
exec(): Promise<void>;
|
|
7
|
+
}
|
|
8
|
+
export { UnTweenAnimationNode, };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Object3D } from 'three';
|
|
2
|
+
import SoonSpace from 'soonspacejs';
|
|
3
|
+
import { IAnimation } from '../../../types';
|
|
4
|
+
export declare function playTweenAnimation(ssp: SoonSpace, object: Object3D, animation: IAnimation): Promise<void>;
|
|
5
|
+
export declare function stopTweenAnimation(animationId: string): void;
|
|
@@ -0,0 +1,91 @@
|
|
|
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
|
+
DELAY = "DELAY",
|
|
25
|
+
SHOW = "SHOW",
|
|
26
|
+
HIDE = "HIDE",
|
|
27
|
+
CLIP_ANIMATION = "CLIP_ANIMATION",
|
|
28
|
+
UN_CLIP_ANIMATION = "UN_CLIP_ANIMATION",
|
|
29
|
+
TWEEN_ANIMATION = "TWEEN_ANIMATION",
|
|
30
|
+
UN_TWEEN_ANIMATION = "UN_TWEEN_ANIMATION",
|
|
31
|
+
COMPONENT_TWEEN_ANIMATION = "COMPONENT_TWEEN_ANIMATION",
|
|
32
|
+
UN_COMPONENT_TWEEN_ANIMATION = "UN_COMPONENT_TWEEN_ANIMATION"
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* 节点 props 数据
|
|
36
|
+
*/
|
|
37
|
+
export type NodePropType = {
|
|
38
|
+
name: string;
|
|
39
|
+
type: NodePropTypeEnum;
|
|
40
|
+
value: string;
|
|
41
|
+
valueType: string;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* 节点数据
|
|
45
|
+
*/
|
|
46
|
+
export type NodeType = {
|
|
47
|
+
id: string;
|
|
48
|
+
type: NodeTypeEnum;
|
|
49
|
+
props: NodePropType[];
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* 连接数据
|
|
53
|
+
*/
|
|
54
|
+
export type EdgeType = {
|
|
55
|
+
id: string;
|
|
56
|
+
source: string;
|
|
57
|
+
target: string;
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* 流程数据
|
|
61
|
+
*/
|
|
62
|
+
export type FlowType = {
|
|
63
|
+
id: string;
|
|
64
|
+
sid: string;
|
|
65
|
+
name: string;
|
|
66
|
+
portal: string;
|
|
67
|
+
nodes: NodeType[];
|
|
68
|
+
edges: EdgeType[];
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* 组件流程数据
|
|
72
|
+
*/
|
|
73
|
+
export type ComponentFlowType = FlowType & {
|
|
74
|
+
editionId: string;
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* 节点上下文对象
|
|
78
|
+
*/
|
|
79
|
+
export type NodeCtxType = {
|
|
80
|
+
[x: string]: any;
|
|
81
|
+
};
|
|
82
|
+
/**
|
|
83
|
+
* 节点全局对象
|
|
84
|
+
* 由运行时动态定义接口
|
|
85
|
+
*/
|
|
86
|
+
export type NodeGlobalType = {
|
|
87
|
+
getTarget?: (currentNode: Node) => Promise<Model | null>;
|
|
88
|
+
getAnimations?: (currentNode: Node, object: Object3D, animationId: string) => Promise<IAnimation[] | null>;
|
|
89
|
+
getComponentAnimations?: (currentNode: Node, object: Object3D, animationId: string) => Promise<IComponentAnimation[] | null>;
|
|
90
|
+
[s: symbol]: any;
|
|
91
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Object3D } from 'three';
|
|
2
|
+
import SoonSpace, { Model } from 'soonspacejs';
|
|
3
|
+
import { Node } from './nodes';
|
|
4
|
+
import { NodeType } from './types';
|
|
5
|
+
export declare function parseNodeByType(ssp: SoonSpace, node: NodeType): Node;
|
|
6
|
+
export declare function parseValue<T = any>(value: string): T;
|
|
7
|
+
export declare function waitFor(fn: () => Promise<void>, wait: boolean): Promise<void>;
|
|
8
|
+
export declare function getModelByUuid(ssp: SoonSpace, uuid: string): Model | null;
|
|
9
|
+
export declare function getModelByUuids(ssp: SoonSpace, uuids: string[]): Model[];
|
|
10
|
+
export declare function getModelByFamilyId(ssp: SoonSpace, family: string): Model | null;
|
|
11
|
+
export declare function getMeshByUserDataUuid(object: Object3D, uuid: string): Object3D | null;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
1
|
+
export * from './flows';
|
|
2
|
+
export * from './triggers';
|
|
3
|
+
export * from './types';
|
package/dist/index.esm.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
class s{constructor(s){this.ssp=s,this.nodes=[],this.nodesMap=new Map,this.edges=[],this.edgesMap=new Map}addNode(s){this.nodes.push(s),this.nodesMap.set(s.id,s)}addEdge(s){this.edges.push(s),this.edgesMap.set(s.id,s)}getNodeById(s){return this.nodesMap.get(s)}getEdgeById(s){return this.edgesMap.get(s)}getEdgesSource(s){return this.edges.filter((t=>t.source===s))}async run(s={target:null}){const t=new Map,e=[],r=new Set,n=new Map;for(this.nodes.forEach((({id:s})=>{t.set(s,0),n.set(s,{})})),this.edges.forEach((({target:s})=>{t.set(s,t.get(s)+1)})),t.forEach(((s,t)=>{0===s&&e.push(t)}));e.length>0;){const o=[...e];e.length=0;const i=o.map((async o=>{if(!r.has(o)){r.add(o);const i=n.get(o),c=this.nodesMap.get(o),a=await c.run(i,s),u=this.getEdgesSource(o).map((s=>s.target));u.forEach((s=>{n.has(s)||n.set(s,{});const t=n.get(s);Object.assign(t,i,a)})),u.forEach((s=>{const r=t.get(s)-1;t.set(s,r),0===r&&e.push(s)}))}}));await Promise.all(i)}}}class t{constructor(s){this.id=s.id,this.source=s.source,this.target=s.target}}class e{constructor(s,t){this.ssp=s,this.id=t.id,this.type=t.type,this.props=t.props}readCtx(s,t){return s[t]}findProp(s,t){return this.props.find((e=>e.name===s&&e.type===t))}async run(s,t){}}class r extends e{constructor(s,t){super(s,t)}}var n,o;!function(s){s.LOCAL="LOCAL",s.READ_CTX="READ_CTX",s.WRITE_CTX="WRITE_CTX"}(n||(n={})),function(s){s.START="START",s.HIGHLIGHT="HIGHLIGHT",s.COLOR="COLOR",s.MESH="MESH",s.NUMBER="NUMBER"}(o||(o={}));class i extends e{constructor(s,t){super(s,t)}async run(){const s=this.findProp("color",n.LOCAL),t=this.findProp("out",n.WRITE_CTX);if(s&&t)return{[p(t.value)]:p(s.value)}}}class c extends e{constructor(s,t){super(s,t)}async run(){const s=this.findProp("number",n.LOCAL),t=this.findProp("out",n.WRITE_CTX);if(s&&t)return{[p(t.value)]:p(s.value)}}}class a extends e{constructor(s,t){super(s,t)}async run(s){const t=this.findProp("objects",n.READ_CTX),e=this.findProp("color",n.READ_CTX),r=this.findProp("opacity",n.READ_CTX);if(t&&e&&r){const n=this.readCtx(s,p(t.value)),o=this.readCtx(s,p(e.value)),i=this.readCtx(s,p(r.value));this.ssp.highlightShow(n,{color:o,opacity:i})}}}const u=Symbol("meshCache");class h extends e{constructor(s,t){super(s,t)}async run(s,t){const{viewport:{scene:e}}=this.ssp,r=s.target||e;t[u]||(t[u]={});const o=this.findProp("meshes",n.LOCAL),i=this.findProp("out",n.WRITE_CTX);if(o&&i){const s=[],e=p(o.value),n=p(i.value);return e.forEach((e=>{const n=t[u][e];if(n)return void s.push(n);const o=d(r,e);o&&(s.push(o),t[u][e]=o)})),{[n]:s}}}}function d(s,t){if(s.userData.uuid===t)return s;for(let e=0,r=s.children.length;e<r;e++){const r=d(s.children[e],t);if(void 0!==r)return r}}function p(s){return JSON.parse(s)}class f extends s{constructor(s,t){super(s),this.flow=t}parse(){const{nodes:s,edges:n}=this.flow;s.forEach((s=>{const t=function(s,t){switch(t.type){case o.START:return new r(s,t);case o.MESH:return new h(s,t);case o.COLOR:return new i(s,t);case o.HIGHLIGHT:return new a(s,t);case o.NUMBER:return new c(s,t);default:return new e(s,t)}}(this.ssp,s);this.addNode(t)})),n.forEach((s=>{const e=new t(s);this.addEdge(e)}))}}export{f as ComponentFlowParser,s as FlowParser};
|
|
1
|
+
import s from"soonspacejs";import{AnimationPlayer as t}from"umanager-animation-parser";class e{constructor(s){this.id=s.id,this.source=s.source,this.target=s.target}}class i{constructor(s,t){this.prevNodes=[],this.postNodes=[],this.ssp=s,this.id=t.id,this.type=t.type,this.props=t.props,this.reset()}reset(){this.ctx={},this.promise=new Promise(((s,t)=>{this.resolve=s,this.reject=t}))}readContext(s){return this.ctx[s]}writeContext(s,t){this.ctx[s]=t}findProp(s,t){return this.props.find((e=>e.name===s&&e.type===t))}async waitForPrevNodes(){await Promise.all(this.prevNodes.map((s=>s.promise)))}mergeContext(){this.prevNodes.forEach((s=>{Object.assign(this.ctx,s.ctx)}))}async exec(s){}async run(s){await this.waitForPrevNodes(),this.mergeContext(),await this.exec(s).then(this.resolve)}}class n extends i{constructor(s,t){super(s,t)}}var o,a;!function(s){s.LOCAL="LOCAL",s.READ_CTX="READ_CTX",s.WRITE_CTX="WRITE_CTX"}(o||(o={})),function(s){s.START="START",s.COLOR="COLOR",s.NUMBER="NUMBER",s.HIGHLIGHT="HIGHLIGHT",s.UN_HIGHLIGHT="UN_HIGHLIGHT",s.OPACITY="OPACITY",s.UN_OPACITY="UN_OPACITY",s.EMISSIVE="EMISSIVE",s.UN_EMISSIVE="UN_EMISSIVE",s.MESH="MESH",s.MESHES="MESHES",s.MODEL="MODEL",s.MODELS="MODELS",s.DELAY="DELAY",s.SHOW="SHOW",s.HIDE="HIDE",s.CLIP_ANIMATION="CLIP_ANIMATION",s.UN_CLIP_ANIMATION="UN_CLIP_ANIMATION",s.TWEEN_ANIMATION="TWEEN_ANIMATION",s.UN_TWEEN_ANIMATION="UN_TWEEN_ANIMATION",s.COMPONENT_TWEEN_ANIMATION="COMPONENT_TWEEN_ANIMATION",s.UN_COMPONENT_TWEEN_ANIMATION="UN_COMPONENT_TWEEN_ANIMATION"}(a||(a={}));class r extends i{constructor(s,t){super(s,t)}async exec(){const s=this.findProp("color",o.LOCAL),t=this.findProp("out",o.WRITE_CTX);s&&t&&this.writeContext(H(t.value),H(s.value))}}class c extends i{constructor(s,t){super(s,t)}async exec(){const s=this.findProp("number",o.LOCAL),t=this.findProp("out",o.WRITE_CTX);s&&t&&this.writeContext(H(t.value),H(s.value))}}class h extends i{constructor(s,t){super(s,t)}async exec(){const s=this.findProp("objects",o.READ_CTX),t=this.findProp("color",o.READ_CTX),e=this.findProp("opacity",o.READ_CTX);if(s&&t&&e){const i=this.readContext(H(s.value)),n=this.readContext(H(t.value)),o=this.readContext(H(e.value));i&&this.ssp.highlightShow(i,{color:n,opacity:o})}}}class l extends i{constructor(s,t){super(s,t)}async exec(){const s=this.findProp("objects",o.READ_CTX);if(s){const t=this.readContext(H(s.value));t&&this.ssp.unHighlightShow(t)}}}class d extends i{constructor(s,t){super(s,t)}async exec(){const s=this.findProp("objects",o.READ_CTX),t=this.findProp("color",o.READ_CTX),e=this.findProp("opacity",o.READ_CTX);if(s&&t&&e){const i=this.readContext(H(s.value)),n=this.readContext(H(t.value)),o=this.readContext(H(e.value));i&&this.ssp.opacityShow(i,{color:n,opacity:o})}}}class u extends i{constructor(s,t){super(s,t)}async exec(){const s=this.findProp("objects",o.READ_CTX);if(s){const t=this.readContext(H(s.value));t&&this.ssp.unOpacityShow(t)}}}class p extends i{constructor(s,t){super(s,t)}async exec(){const s=this.findProp("objects",o.READ_CTX),t=this.findProp("color",o.READ_CTX),e=this.findProp("baseColor",o.READ_CTX),i=this.findProp("minOpacity",o.READ_CTX),n=this.findProp("maxOpacity",o.READ_CTX),a=this.findProp("duration",o.READ_CTX);if(s&&t&&e&&i&&n&&a){const o=this.readContext(H(s.value)),r=this.readContext(H(t.value)),c=this.readContext(H(e.value)),h=this.readContext(H(i.value)),l=this.readContext(H(n.value)),d=this.readContext(H(a.value));o&&this.ssp.emissiveShow(o,{color:r,baseColor:c,minOpacity:h,maxOpacity:l,duration:d})}}}class E extends i{constructor(s,t){super(s,t)}async exec(){const s=this.findProp("objects",o.READ_CTX);if(s){const t=this.readContext(H(s.value));t&&this.ssp.unEmissiveShow(t)}}}const C=Symbol("meshCache");class T extends i{constructor(s,t){super(s,t)}async exec(s){var t;const{viewport:{scene:e}}=this.ssp,i=await(null===(t=s.getTarget)||void 0===t?void 0:t.call(s,this))||e;s[C]||(s[C]={});const n=this.findProp("mesh",o.LOCAL),a=this.findProp("out",o.WRITE_CTX);if(n&&a){let t=null;const e=H(n.value),o=H(a.value),r=s[C][e];if(r)return void(t=r);const c=b(i,e);c&&(t=c,s[C][e]=c),this.writeContext(o,t)}}}const f=Symbol("meshesCache");class I extends i{constructor(s,t){super(s,t)}async exec(s){var t;const{viewport:{scene:e}}=this.ssp,i=await(null===(t=s.getTarget)||void 0===t?void 0:t.call(s,this))||e;s[f]||(s[f]={});const n=this.findProp("meshes",o.LOCAL),a=this.findProp("out",o.WRITE_CTX);if(n&&a){const t=[],e=H(n.value),o=H(a.value);e.forEach((e=>{const n=s[f][e];if(n)return void t.push(n);const o=b(i,e);o&&(t.push(o),s[f][e]=o)})),this.writeContext(o,t)}}}class N extends i{constructor(s,t){super(s,t)}async exec(){const s=this.findProp("model",o.LOCAL),t=this.findProp("out",o.WRITE_CTX);if(s&&t){const o=H(s.value),a=H(t.value);this.writeContext(a,(e=this.ssp,i=o,null!==(n=e.getAllModel().find((s=>s.userData.id===i||s.userData.uuid===i)))&&void 0!==n?n:null))}var e,i,n}}class A extends i{constructor(s,t){super(s,t)}async exec(){const s=this.findProp("models",o.LOCAL),t=this.findProp("out",o.WRITE_CTX);if(s&&t){const e=H(s.value),i=H(t.value);this.writeContext(i,function(s,t){const e=new Set(t);return s.getAllModel().filter((s=>e.has(s.userData.id)||e.has(s.userData.uuid)))}(this.ssp,e))}}}class v extends i{constructor(s,t){super(s,t)}async exec(){const t=this.findProp("delay",o.LOCAL);if(t){const e=H(t.value);await s.utils.sleep(e)}}}const{objectHandle:O}=s.utils;class _ extends i{constructor(s,t){super(s,t)}async exec(){const s=this.findProp("objects",o.READ_CTX);if(s){const t=this.readContext(H(s.value));t&&(O(t,(s=>{s.visible=!0})),this.ssp.render())}}}const{objectHandle:L}=s.utils;class x extends i{constructor(s,t){super(s,t)}async exec(){const s=this.findProp("objects",o.READ_CTX);if(s){const t=this.readContext(H(s.value));t&&(L(t,(s=>{s.visible=!1})),this.ssp.render())}}}class M extends i{constructor(s,t){super(s,t)}async exec(s){var t;let e=await(null===(t=s.getTarget)||void 0===t?void 0:t.call(s,this));if(!e){const s=this.findProp("object",o.READ_CTX);s&&(e=this.readContext(H(s.value)))}const i=this.findProp("animation",o.LOCAL);if(e&&i){const s=H(i.value),t=e.animations[s];t&&this.ssp.playModelAnimation(e,t)}}}class w extends i{constructor(s,t){super(s,t)}async exec(s){var t;let e=await(null===(t=s.getTarget)||void 0===t?void 0:t.call(s,this));if(!e){const s=this.findProp("object",o.READ_CTX);s&&(e=this.readContext(H(s.value)))}const i=this.findProp("animation",o.LOCAL);if(e&&i){const s=H(i.value),t=e.animations[s];t&&this.ssp.stopModelAnimation(e,t)}}}const g=new Map;class P extends i{constructor(s,t){super(s,t)}async exec(s){var e;const i=this.findProp("object",o.READ_CTX),n=this.findProp("animation",o.LOCAL),a=this.findProp("wait",o.LOCAL);if(i&&n&&a){const o=this.readContext(H(i.value)),r=H(n.value),c=H(a.value);if(o){const i=await(null===(e=s.getAnimations)||void 0===e?void 0:e.call(s,this,o,r));if(i){const s=i.find((s=>s.id===r));s&&await R((async()=>{await async function(s,e,i){var n;const{id:o,keyframes:a}=i,r=new t(s,e);g.has(o)||g.set(o,new Set),null===(n=g.get(o))||void 0===n||n.add(r),await r.play(a)}(this.ssp,o,s)}),c)}}}}}class y extends i{constructor(s,t){super(s,t)}async exec(){const s=this.findProp("animation",o.LOCAL);if(s){const n=H(s.value);t=n,null===(e=g.get(t))||void 0===e||e.forEach((s=>s.stop())),null===(i=g.get(t))||void 0===i||i.clear()}var t,e,i}}const m=new Map;class D extends i{constructor(s,t){super(s,t)}async exec(s){var e;const i=this.findProp("object",o.READ_CTX),n=this.findProp("animation",o.LOCAL),a=this.findProp("wait",o.LOCAL);if(i&&n&&a){const o=this.readContext(H(i.value)),r=H(n.value),c=H(a.value);if(o){const n=await(null===(e=s.getComponentAnimations)||void 0===e?void 0:e.call(s,this,o,r));if(n){const s=n.find((s=>s.id===r));if(s){let e=null;"Mesh"===i.valueType?e=o:"Model"===i.valueType&&(e=b(o,s.refId)),e&&await R((async()=>{e&&await async function(s,e,i){var n;const{id:o,keyframes:a}=i,r=new t(s,e);m.has(o)||m.set(o,new Set),null===(n=m.get(o))||void 0===n||n.add(r),await r.play(a)}(this.ssp,e,s)}),c)}}}}}}class S extends i{constructor(s,t){super(s,t)}async exec(){const s=this.findProp("animation",o.LOCAL);if(s){const n=H(s.value);t=n,null===(e=m.get(t))||void 0===e||e.forEach((s=>s.stop())),null===(i=m.get(t))||void 0===i||i.clear()}var t,e,i}}function H(s){return JSON.parse(s)}async function R(s,t){t?await s():s()}function b(s,t){if(s.userData.key===t)return s;for(let e=0,i=s.children.length;e<i;e++){const i=b(s.children[e],t);if(null!==i)return i}return null}class X{constructor(s,t){this.ssp=s,this.flow=t,this.nodes=[],this.nodesMap=new Map,this.edges=[],this.edgesMap=new Map}addNode(s){this.nodes.push(s),this.nodesMap.set(s.id,s)}addEdge(s){this.edges.push(s),this.edgesMap.set(s.id,s)}getNodeById(s){return this.nodesMap.get(s)}getEdgeById(s){return this.edgesMap.get(s)}clear(){this.nodes.length=0,this.nodesMap.clear(),this.edges.length=0,this.edgesMap.clear()}parse(){this.clear();const{nodes:s,edges:t}=this.flow;s.forEach((s=>{const t=function(s,t){switch(t.type){case a.START:return new n(s,t);case a.COLOR:return new r(s,t);case a.NUMBER:return new c(s,t);case a.HIGHLIGHT:return new h(s,t);case a.UN_HIGHLIGHT:return new l(s,t);case a.OPACITY:return new d(s,t);case a.UN_OPACITY:return new u(s,t);case a.EMISSIVE:return new p(s,t);case a.UN_EMISSIVE:return new E(s,t);case a.MESH:return new T(s,t);case a.MESHES:return new I(s,t);case a.MODEL:return new N(s,t);case a.MODELS:return new A(s,t);case a.DELAY:return new v(s,t);case a.SHOW:return new _(s,t);case a.HIDE:return new x(s,t);case a.CLIP_ANIMATION:return new M(s,t);case a.UN_CLIP_ANIMATION:return new w(s,t);case a.TWEEN_ANIMATION:return new P(s,t);case a.UN_TWEEN_ANIMATION:return new y(s,t);case a.COMPONENT_TWEEN_ANIMATION:return new D(s,t);case a.UN_COMPONENT_TWEEN_ANIMATION:return new S(s,t);default:return new i(s,t)}}(this.ssp,s);this.addNode(t)})),t.forEach((s=>{const t=new e(s);this.addEdge(t);const i=this.getNodeById(s.source),n=this.getNodeById(s.target);i&&n&&(i.postNodes.push(n),n.prevNodes.push(i))}))}async run(s={}){const t=this.nodes.map((t=>t.run(s)));await Promise.all(t)}}class U extends X{constructor(s,t){super(s,t),this.flow=t}}class G{constructor(s){this.disposables=[],this.ssp=s}dispose(){this.disposables.forEach((s=>s()))}}var W,k,B,j;!function(s){s.GLOBAL="GLOBAL",s.SELF="SELF",s.OTHER="OTHER"}(W||(W={})),function(s){s.FLOW="FLOW",s.ANIMATION="ANIMATION",s.DELAY="DELAY"}(k||(k={})),function(s){s.GLOBAL="GLOBAL",s.INSTANCE="INSTANCE",s.FAMILY="FAMILY"}(B||(B={})),function(s){s.MOUSE_CLICK="MOUSE_CLICK",s.MOUSE_DB_CLICK="MOUSE_DB_CLICK",s.MOUSE_RIGHT_CLICK="MOUSE_RIGHT_CLICK",s.THING_PROP_CHANGE="THING_PROP_CHANGE",s.THING_EVENT="THING_EVENT",s.LOADED="LOADED"}(j||(j={}));const{groupBy:Y}=s.utils;class F extends G{constructor(s,t,e,i){super(s),this.target=t,this.interaction=e,this.flows=i,this.flowsMap=Y(i,"id"),this.init()}init(){switch(this.interaction.type){case j.MOUSE_CLICK:this.initMouseClick();break;case j.MOUSE_DB_CLICK:this.initMouseDbClick();break;case j.MOUSE_RIGHT_CLICK:this.initMouseRightClick();break;case j.LOADED:this.initLoaded();break;case j.THING_PROP_CHANGE:this.initThingPropChange();break;case j.THING_EVENT:this.initThingEvent()}}modelHandler(s){var t;const{currentTarget:e}=s;null===(t=this.interaction.obsTargets)||void 0===t||t.forEach((s=>{s===e.userData.key&&this.execBehavior()}))}runFlowByIds(s){s.forEach((s=>{const t=this.flowsMap.get(s);if(t){const s=new U(this.ssp,t[0]);s.parse(),s.run({getTarget:async()=>this.target})}}))}async execBehavior(){const{behaviors:s}=this.interaction;null==s||s.forEach((s=>{if(s.action===k.FLOW)s.actionRefs&&this.runFlowByIds(s.actionRefs)}))}initMouseClick(){this.ssp.signals.modelClick.add(this.modelHandler),this.disposables.push((()=>this.ssp.signals.modelClick.remove(this.modelHandler)))}initMouseDbClick(){this.ssp.signals.modelDblClick.add(this.modelHandler),this.disposables.push((()=>this.ssp.signals.modelDblClick.remove(this.modelHandler)))}initMouseRightClick(){this.ssp.signals.modelRightClick.add(this.modelHandler),this.disposables.push((()=>this.ssp.signals.modelRightClick.remove(this.modelHandler)))}initLoaded(){const s=()=>{this.execBehavior()};this.target.addEventListener("load",s),this.disposables.push((()=>this.target.removeEventListener("load",s)))}initThingPropChange(){}initThingEvent(){}}export{U as ComponentFlowParser,F as ComponentTrigger,X as FlowParser,k as InteractionAction,W as InteractionActionType,B as InteractionObsType,j as InteractionType,o as NodePropTypeEnum,a as NodeTypeEnum,G as Trigger};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import SoonSpace, { Model, ModelEventParams } from 'soonspacejs';
|
|
2
|
+
import { Trigger } from './Trigger';
|
|
3
|
+
import { Interaction } from './types';
|
|
4
|
+
import { ComponentFlowType } from '../flows/types';
|
|
5
|
+
declare class ComponentTrigger extends Trigger {
|
|
6
|
+
target: Model;
|
|
7
|
+
interaction: Interaction;
|
|
8
|
+
flows: ComponentFlowType[];
|
|
9
|
+
flowsMap: Map<string, ComponentFlowType[]>;
|
|
10
|
+
constructor(ssp: SoonSpace, target: Model, interaction: Interaction, flows: ComponentFlowType[]);
|
|
11
|
+
init(): void;
|
|
12
|
+
modelHandler(params: ModelEventParams): void;
|
|
13
|
+
runFlowByIds(flowIds: string[]): void;
|
|
14
|
+
execBehavior(): Promise<void>;
|
|
15
|
+
initMouseClick(): void;
|
|
16
|
+
initMouseDbClick(): void;
|
|
17
|
+
initMouseRightClick(): void;
|
|
18
|
+
initLoaded(): void;
|
|
19
|
+
initThingPropChange(): void;
|
|
20
|
+
initThingEvent(): void;
|
|
21
|
+
}
|
|
22
|
+
export { ComponentTrigger, };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export declare enum InteractionActionType {
|
|
2
|
+
GLOBAL = "GLOBAL",
|
|
3
|
+
SELF = "SELF",
|
|
4
|
+
OTHER = "OTHER"
|
|
5
|
+
}
|
|
6
|
+
export declare enum InteractionAction {
|
|
7
|
+
FLOW = "FLOW",
|
|
8
|
+
ANIMATION = "ANIMATION",
|
|
9
|
+
DELAY = "DELAY"
|
|
10
|
+
}
|
|
11
|
+
export declare enum InteractionObsType {
|
|
12
|
+
GLOBAL = "GLOBAL",
|
|
13
|
+
INSTANCE = "INSTANCE",
|
|
14
|
+
FAMILY = "FAMILY"
|
|
15
|
+
}
|
|
16
|
+
export declare enum InteractionType {
|
|
17
|
+
MOUSE_CLICK = "MOUSE_CLICK",
|
|
18
|
+
MOUSE_DB_CLICK = "MOUSE_DB_CLICK",
|
|
19
|
+
MOUSE_RIGHT_CLICK = "MOUSE_RIGHT_CLICK",
|
|
20
|
+
THING_PROP_CHANGE = "THING_PROP_CHANGE",
|
|
21
|
+
THING_EVENT = "THING_EVENT",
|
|
22
|
+
LOADED = "LOADED"
|
|
23
|
+
}
|
|
24
|
+
export type InteractionBehavior = {
|
|
25
|
+
id: string;
|
|
26
|
+
uuid: string;
|
|
27
|
+
actionType: InteractionActionType;
|
|
28
|
+
action: InteractionAction;
|
|
29
|
+
actionTargets: string[] | null;
|
|
30
|
+
actionRefs: string[] | null;
|
|
31
|
+
};
|
|
32
|
+
export type Interaction = {
|
|
33
|
+
id: string;
|
|
34
|
+
uuid: string;
|
|
35
|
+
name: string;
|
|
36
|
+
type: InteractionType;
|
|
37
|
+
obsType: InteractionObsType;
|
|
38
|
+
obsTargets: string[] | null;
|
|
39
|
+
obsProps: string[] | null;
|
|
40
|
+
behaviors: InteractionBehavior[] | null;
|
|
41
|
+
};
|
package/dist/types.d.ts
CHANGED
|
@@ -1,63 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export
|
|
3
|
-
LOCAL = "LOCAL",
|
|
4
|
-
READ_CTX = "READ_CTX",
|
|
5
|
-
WRITE_CTX = "WRITE_CTX"
|
|
6
|
-
}
|
|
7
|
-
export declare enum NodeTypeEnum {
|
|
8
|
-
START = "START",
|
|
9
|
-
HIGHLIGHT = "HIGHLIGHT",
|
|
10
|
-
COLOR = "COLOR",
|
|
11
|
-
MESH = "MESH",
|
|
12
|
-
NUMBER = "NUMBER"
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* 节点 props 数据
|
|
16
|
-
*/
|
|
17
|
-
export type NodePropType = {
|
|
18
|
-
name: string;
|
|
19
|
-
type: NodePropTypeEnum;
|
|
20
|
-
value: string;
|
|
21
|
-
valueType: string;
|
|
22
|
-
};
|
|
23
|
-
/**
|
|
24
|
-
* 节点数据
|
|
25
|
-
*/
|
|
26
|
-
export type NodeType = {
|
|
27
|
-
id: string;
|
|
28
|
-
type: NodeTypeEnum;
|
|
29
|
-
props: NodePropType[];
|
|
30
|
-
};
|
|
31
|
-
/**
|
|
32
|
-
* 连接数据
|
|
33
|
-
*/
|
|
34
|
-
export type EdgeType = {
|
|
35
|
-
id: string;
|
|
36
|
-
source: string;
|
|
37
|
-
target: string;
|
|
38
|
-
};
|
|
39
|
-
/**
|
|
40
|
-
* 组件流程数据
|
|
41
|
-
*/
|
|
42
|
-
export type ComponentFlowType = {
|
|
1
|
+
import { TAnimationFrame } from 'umanager-animation-parser';
|
|
2
|
+
export interface IComponentAnimation {
|
|
43
3
|
id: string;
|
|
44
4
|
sid: string;
|
|
45
5
|
name: string;
|
|
46
|
-
|
|
6
|
+
refId: string;
|
|
47
7
|
editionId: string;
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* 节点全局对象
|
|
59
|
-
*/
|
|
60
|
-
export type NodeGlobalType = {
|
|
61
|
-
target: Object3D | null;
|
|
62
|
-
[s: symbol]: any;
|
|
63
|
-
};
|
|
8
|
+
keyframes: TAnimationFrame[];
|
|
9
|
+
}
|
|
10
|
+
export interface IAnimation {
|
|
11
|
+
id: string;
|
|
12
|
+
sid: string;
|
|
13
|
+
modelId: string;
|
|
14
|
+
name: string;
|
|
15
|
+
keyframes: TAnimationFrame[];
|
|
16
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@soonspacejs/plugin-flow",
|
|
3
3
|
"pluginName": "FlowPlugin",
|
|
4
|
-
"version": "2.11.
|
|
4
|
+
"version": "2.11.69",
|
|
5
5
|
"description": "FlowPlugin plugin for SoonSpace.js",
|
|
6
6
|
"main": "dist/index.esm.js",
|
|
7
7
|
"module": "dist/index.esm.js",
|
|
@@ -13,8 +13,9 @@
|
|
|
13
13
|
],
|
|
14
14
|
"author": "xunwei",
|
|
15
15
|
"license": "UNLICENSED",
|
|
16
|
-
"gitHead": "
|
|
16
|
+
"gitHead": "b7e6e7d5ff9694689741a2c42db1f800da5cca3a",
|
|
17
17
|
"peerDependencies": {
|
|
18
|
-
"soonspacejs": "2.11.
|
|
18
|
+
"soonspacejs": "2.11.69",
|
|
19
|
+
"umanager-animation-parser": "^0.0.6"
|
|
19
20
|
}
|
|
20
21
|
}
|
package/dist/nodes/MeshNode.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Object3D } from 'three';
|
|
2
|
-
import SoonSpace from 'soonspacejs';
|
|
3
|
-
import { NodeCtxType, NodeGlobalType, NodeType } from '../types';
|
|
4
|
-
import { Node } from './Node';
|
|
5
|
-
declare class MeshNode extends Node {
|
|
6
|
-
constructor(ssp: SoonSpace, node: NodeType);
|
|
7
|
-
run(ctx: NodeCtxType, global: NodeGlobalType): Promise<{
|
|
8
|
-
[x: number]: Object3D<import("three").Object3DEventMap>[];
|
|
9
|
-
} | undefined>;
|
|
10
|
-
}
|
|
11
|
-
export { MeshNode, };
|
package/dist/nodes/Node.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import SoonSpace from 'soonspacejs';
|
|
2
|
-
import { NodeType, NodeCtxType, NodePropType, NodeGlobalType } from '../types';
|
|
3
|
-
declare class Node {
|
|
4
|
-
ssp: SoonSpace;
|
|
5
|
-
id: string;
|
|
6
|
-
type: string;
|
|
7
|
-
props: NodeType['props'];
|
|
8
|
-
constructor(ssp: SoonSpace, node: NodeType);
|
|
9
|
-
readCtx<T = any>(ctx: NodeCtxType, key: string): T;
|
|
10
|
-
findProp(name: string, type: NodePropType['type']): NodePropType | undefined;
|
|
11
|
-
run(ctx: NodeCtxType, global: NodeGlobalType): Promise<NodeCtxType | void>;
|
|
12
|
-
}
|
|
13
|
-
export { Node, };
|
package/dist/nodes/index.d.ts
DELETED
package/dist/utils.d.ts
DELETED
|
File without changes
|