@voiceflow/utils-designer 1.20.13 → 1.21.0
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/build/cjs/diagram.util.d.ts +6 -3
- package/build/cjs/diagram.util.d.ts.map +1 -1
- package/build/cjs/diagram.util.js +7 -2
- package/build/cjs/node.util.d.ts.map +1 -1
- package/build/cjs/node.util.js +5 -2
- package/build/esm/diagram.util.d.ts +6 -3
- package/build/esm/diagram.util.d.ts.map +1 -1
- package/build/esm/diagram.util.js +7 -2
- package/build/esm/node.util.d.ts.map +1 -1
- package/build/esm/node.util.js +5 -2
- package/package.json +3 -3
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import type { Diagram } from '@voiceflow/dtos';
|
|
2
2
|
export declare const getUniqueDiagramCopyName: (originalName: string, existingNames: string[]) => string;
|
|
3
3
|
type DiagramPayload = Omit<Diagram, '_id' | 'creatorID' | 'versionID' | 'diagramID'>;
|
|
4
|
-
export declare const componentDiagramPayloadFactory: ({
|
|
4
|
+
export declare const componentDiagramPayloadFactory: ({ startNode, diagramName, }: {
|
|
5
|
+
startNode?: {
|
|
6
|
+
name?: string | undefined;
|
|
7
|
+
coords?: [number, number] | undefined;
|
|
8
|
+
color?: string | undefined;
|
|
9
|
+
} | undefined;
|
|
5
10
|
diagramName: string;
|
|
6
|
-
startNodeName?: string | undefined;
|
|
7
|
-
startNodeCoords?: [number, number] | undefined;
|
|
8
11
|
}) => DiagramPayload;
|
|
9
12
|
export declare const topicDiagramPayloadFactory: ({ diagramName, triggerNodeName, triggerNodeCoords, }: {
|
|
10
13
|
diagramName: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diagram.util.d.ts","sourceRoot":"","sources":["../../src/diagram.util.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAe,MAAM,iBAAiB,CAAC;AAK5D,eAAO,MAAM,wBAAwB,iBAAkB,MAAM,iBAAiB,MAAM,EAAE,WAUrF,CAAC;AAQF,KAAK,cAAc,GAAG,IAAI,CAAC,OAAO,EAAE,KAAK,GAAG,WAAW,GAAG,WAAW,GAAG,WAAW,CAAC,CAAC;AAiBrF,eAAO,MAAM,8BAA8B
|
|
1
|
+
{"version":3,"file":"diagram.util.d.ts","sourceRoot":"","sources":["../../src/diagram.util.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAe,MAAM,iBAAiB,CAAC;AAK5D,eAAO,MAAM,wBAAwB,iBAAkB,MAAM,iBAAiB,MAAM,EAAE,WAUrF,CAAC;AAQF,KAAK,cAAc,GAAG,IAAI,CAAC,OAAO,EAAE,KAAK,GAAG,WAAW,GAAG,WAAW,GAAG,WAAW,CAAC,CAAC;AAiBrF,eAAO,MAAM,8BAA8B;;;;;;iBAK5B,MAAM;oBAWjB,CAAC;AAEL,eAAO,MAAM,0BAA0B;iBAKxB,MAAM;;;oBAcpB,CAAC;AAEF,eAAO,MAAM,6BAA6B;;oBACgD,CAAC"}
|
|
@@ -24,10 +24,15 @@ const diagramPayloadFactory = ({ name, type, nodes, }) => ({
|
|
|
24
24
|
modified: common_1.Utils.time.getCurrentTimestamp(),
|
|
25
25
|
variables: [],
|
|
26
26
|
});
|
|
27
|
-
const componentDiagramPayloadFactory = ({
|
|
27
|
+
const componentDiagramPayloadFactory = ({ startNode, diagramName, }) => diagramPayloadFactory({
|
|
28
28
|
name: diagramName,
|
|
29
29
|
type: dtos_1.DiagramType.COMPONENT,
|
|
30
|
-
nodes: [
|
|
30
|
+
nodes: [
|
|
31
|
+
(0, node_util_1.startNodeFactory)({
|
|
32
|
+
coords: startNode?.coords ?? dtos_1.START_NODE_POSITION,
|
|
33
|
+
data: { name: startNode?.name ?? 'Enter', color: startNode?.color },
|
|
34
|
+
}),
|
|
35
|
+
],
|
|
31
36
|
});
|
|
32
37
|
exports.componentDiagramPayloadFactory = componentDiagramPayloadFactory;
|
|
33
38
|
const topicDiagramPayloadFactory = ({ diagramName, triggerNodeName, triggerNodeCoords = dtos_1.START_NODE_POSITION, }) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node.util.d.ts","sourceRoot":"","sources":["../../src/node.util.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAKtF,eAAO,MAAM,kBAAkB;;;;;;;YAInB,CAAC;AAEb,KAAK,kBAAkB,CAAC,IAAI,SAAS,WAAW,IAAI,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,GAAG;IACzE,IAAI,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,eAAO,MAAM,gBAAgB,+BAAqD,mBAAmB,SAAS,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAe3G,CAAC;AAEL,eAAO,MAAM,gBAAgB,sBAAuB,mBAAmB,SAAS,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAU7E,CAAC;AAEL,eAAO,MAAM,kBAAkB,wBAAwB,mBAAmB,WAAW,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"node.util.d.ts","sourceRoot":"","sources":["../../src/node.util.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAKtF,eAAO,MAAM,kBAAkB;;;;;;;YAInB,CAAC;AAEb,KAAK,kBAAkB,CAAC,IAAI,SAAS,WAAW,IAAI,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,GAAG;IACzE,IAAI,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,eAAO,MAAM,gBAAgB,+BAAqD,mBAAmB,SAAS,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAe3G,CAAC;AAEL,eAAO,MAAM,gBAAgB,sBAAuB,mBAAmB,SAAS,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAU7E,CAAC;AAEL,eAAO,MAAM,kBAAkB,wBAAwB,mBAAmB,WAAW,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAalF,CAAC"}
|
package/build/cjs/node.util.js
CHANGED
|
@@ -14,7 +14,7 @@ const startNodeFactory = ({ data, coords = dtos_1.START_NODE_POSITION, ...rest }
|
|
|
14
14
|
type: dtos_1.NodeType.START,
|
|
15
15
|
data: {
|
|
16
16
|
name: data?.name ?? 'Start',
|
|
17
|
-
color: data?.color ?? '#
|
|
17
|
+
color: data?.color ?? '#56b365',
|
|
18
18
|
triggers: data?.triggers ?? [],
|
|
19
19
|
portsV2: data?.portsV2 ??
|
|
20
20
|
(0, node_port_util_1.nodePortsFactory)({
|
|
@@ -41,7 +41,10 @@ const triggerNodeFactory = ({ data, ...reset } = {}) => (0, exports.diagramNodeF
|
|
|
41
41
|
data: {
|
|
42
42
|
name: data?.name ?? '',
|
|
43
43
|
items: data?.items ?? [],
|
|
44
|
-
portsV2: data?.portsV2 ??
|
|
44
|
+
portsV2: data?.portsV2 ??
|
|
45
|
+
(0, node_port_util_1.nodePortsFactory)({
|
|
46
|
+
byKey: { [dtos_1.NodeSystemPortType.NEXT]: (0, node_port_util_1.nodePortFactory)({ type: dtos_1.NodeSystemPortType.NEXT, target: null }) },
|
|
47
|
+
}),
|
|
45
48
|
},
|
|
46
49
|
});
|
|
47
50
|
exports.triggerNodeFactory = triggerNodeFactory;
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import type { Diagram } from '@voiceflow/dtos';
|
|
2
2
|
export declare const getUniqueDiagramCopyName: (originalName: string, existingNames: string[]) => string;
|
|
3
3
|
type DiagramPayload = Omit<Diagram, '_id' | 'creatorID' | 'versionID' | 'diagramID'>;
|
|
4
|
-
export declare const componentDiagramPayloadFactory: ({
|
|
4
|
+
export declare const componentDiagramPayloadFactory: ({ startNode, diagramName, }: {
|
|
5
|
+
startNode?: {
|
|
6
|
+
name?: string | undefined;
|
|
7
|
+
coords?: [number, number] | undefined;
|
|
8
|
+
color?: string | undefined;
|
|
9
|
+
} | undefined;
|
|
5
10
|
diagramName: string;
|
|
6
|
-
startNodeName?: string | undefined;
|
|
7
|
-
startNodeCoords?: [number, number] | undefined;
|
|
8
11
|
}) => DiagramPayload;
|
|
9
12
|
export declare const topicDiagramPayloadFactory: ({ diagramName, triggerNodeName, triggerNodeCoords, }: {
|
|
10
13
|
diagramName: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diagram.util.d.ts","sourceRoot":"","sources":["../../src/diagram.util.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAe,MAAM,iBAAiB,CAAC;AAK5D,eAAO,MAAM,wBAAwB,iBAAkB,MAAM,iBAAiB,MAAM,EAAE,WAUrF,CAAC;AAQF,KAAK,cAAc,GAAG,IAAI,CAAC,OAAO,EAAE,KAAK,GAAG,WAAW,GAAG,WAAW,GAAG,WAAW,CAAC,CAAC;AAiBrF,eAAO,MAAM,8BAA8B
|
|
1
|
+
{"version":3,"file":"diagram.util.d.ts","sourceRoot":"","sources":["../../src/diagram.util.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAe,MAAM,iBAAiB,CAAC;AAK5D,eAAO,MAAM,wBAAwB,iBAAkB,MAAM,iBAAiB,MAAM,EAAE,WAUrF,CAAC;AAQF,KAAK,cAAc,GAAG,IAAI,CAAC,OAAO,EAAE,KAAK,GAAG,WAAW,GAAG,WAAW,GAAG,WAAW,CAAC,CAAC;AAiBrF,eAAO,MAAM,8BAA8B;;;;;;iBAK5B,MAAM;oBAWjB,CAAC;AAEL,eAAO,MAAM,0BAA0B;iBAKxB,MAAM;;;oBAcpB,CAAC;AAEF,eAAO,MAAM,6BAA6B;;oBACgD,CAAC"}
|
|
@@ -20,10 +20,15 @@ const diagramPayloadFactory = ({ name, type, nodes, }) => ({
|
|
|
20
20
|
modified: Utils.time.getCurrentTimestamp(),
|
|
21
21
|
variables: [],
|
|
22
22
|
});
|
|
23
|
-
export const componentDiagramPayloadFactory = ({
|
|
23
|
+
export const componentDiagramPayloadFactory = ({ startNode, diagramName, }) => diagramPayloadFactory({
|
|
24
24
|
name: diagramName,
|
|
25
25
|
type: DiagramType.COMPONENT,
|
|
26
|
-
nodes: [
|
|
26
|
+
nodes: [
|
|
27
|
+
startNodeFactory({
|
|
28
|
+
coords: startNode?.coords ?? START_NODE_POSITION,
|
|
29
|
+
data: { name: startNode?.name ?? 'Enter', color: startNode?.color },
|
|
30
|
+
}),
|
|
31
|
+
],
|
|
27
32
|
});
|
|
28
33
|
export const topicDiagramPayloadFactory = ({ diagramName, triggerNodeName, triggerNodeCoords = START_NODE_POSITION, }) => {
|
|
29
34
|
const triggerNodeID = Utils.id.objectID();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node.util.d.ts","sourceRoot":"","sources":["../../src/node.util.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAKtF,e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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAe3G,CAAC;AAEL,eAAO,MAAM,gBAAgB,sBAAuB,mBAAmB,SAAS,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAU7E,CAAC;AAEL,eAAO,MAAM,kBAAkB,wBAAwB,mBAAmB,WAAW,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAalF,CAAC"}
|
package/build/esm/node.util.js
CHANGED
|
@@ -10,7 +10,7 @@ export const startNodeFactory = ({ data, coords = START_NODE_POSITION, ...rest }
|
|
|
10
10
|
type: NodeType.START,
|
|
11
11
|
data: {
|
|
12
12
|
name: data?.name ?? 'Start',
|
|
13
|
-
color: data?.color ?? '#
|
|
13
|
+
color: data?.color ?? '#56b365',
|
|
14
14
|
triggers: data?.triggers ?? [],
|
|
15
15
|
portsV2: data?.portsV2 ??
|
|
16
16
|
nodePortsFactory({
|
|
@@ -35,6 +35,9 @@ export const triggerNodeFactory = ({ data, ...reset } = {}) => diagramNodeFactor
|
|
|
35
35
|
data: {
|
|
36
36
|
name: data?.name ?? '',
|
|
37
37
|
items: data?.items ?? [],
|
|
38
|
-
portsV2: data?.portsV2 ??
|
|
38
|
+
portsV2: data?.portsV2 ??
|
|
39
|
+
nodePortsFactory({
|
|
40
|
+
byKey: { [NodeSystemPortType.NEXT]: nodePortFactory({ type: NodeSystemPortType.NEXT, target: null }) },
|
|
41
|
+
}),
|
|
39
42
|
},
|
|
40
43
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voiceflow/utils-designer",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.21.0",
|
|
4
4
|
"exports": {
|
|
5
5
|
".": {
|
|
6
6
|
"types": "./build/cjs/main.d.ts",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@voiceflow/common": "8.3.0",
|
|
34
|
-
"@voiceflow/dtos": "1.
|
|
34
|
+
"@voiceflow/dtos": "1.91.0",
|
|
35
35
|
"bidirectional-adapter": "1.2.1",
|
|
36
36
|
"ts-pattern": "5.0.5",
|
|
37
37
|
"zod": "3.22.4"
|
|
@@ -42,5 +42,5 @@
|
|
|
42
42
|
"volta": {
|
|
43
43
|
"extends": "../../package.json"
|
|
44
44
|
},
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "1fc05f9203c615b403fc09f2f2bc04153326aeda"
|
|
46
46
|
}
|