journey-flow-editor 0.0.8 → 0.0.10
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 +42 -42
- package/dist/FlowEditor.d.ts +5 -2
- package/dist/FlowEditor.d.ts.map +1 -1
- package/dist/flow/FlowEditorInner.d.ts +5 -2
- package/dist/flow/FlowEditorInner.d.ts.map +1 -1
- package/dist/flow/types.d.ts +7 -1
- package/dist/flow/types.d.ts.map +1 -1
- package/dist/forms/TrackedEventForm.d.ts.map +1 -1
- package/dist/index.cjs +46 -46
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3972 -3922
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# React +
|
|
1
|
+
# React + ReactFlow Client Journey Editor
|
|
2
2
|
|
|
3
3
|
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
|
|
4
4
|
|
|
@@ -17,57 +17,57 @@ If you are developing a production application, we recommend updating the config
|
|
|
17
17
|
|
|
18
18
|
```js
|
|
19
19
|
export default defineConfig([
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
globalIgnores(["dist"]),
|
|
21
|
+
{
|
|
22
|
+
files: ["**/*.{ts,tsx}"],
|
|
23
|
+
extends: [
|
|
24
|
+
// Other configs...
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
26
|
+
// Remove tseslint.configs.recommended and replace with this
|
|
27
|
+
tseslint.configs.recommendedTypeChecked,
|
|
28
|
+
// Alternatively, use this for stricter rules
|
|
29
|
+
tseslint.configs.strictTypeChecked,
|
|
30
|
+
// Optionally, add this for stylistic rules
|
|
31
|
+
tseslint.configs.stylisticTypeChecked,
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
33
|
+
// Other configs...
|
|
34
|
+
],
|
|
35
|
+
languageOptions: {
|
|
36
|
+
parserOptions: {
|
|
37
|
+
project: ["./tsconfig.node.json", "./tsconfig.app.json"],
|
|
38
|
+
tsconfigRootDir: import.meta.dirname,
|
|
39
|
+
},
|
|
40
|
+
// other options...
|
|
39
41
|
},
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
},
|
|
43
|
-
])
|
|
42
|
+
},
|
|
43
|
+
]);
|
|
44
44
|
```
|
|
45
45
|
|
|
46
46
|
You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules:
|
|
47
47
|
|
|
48
48
|
```js
|
|
49
49
|
// eslint.config.js
|
|
50
|
-
import reactX from
|
|
51
|
-
import reactDom from
|
|
50
|
+
import reactX from "eslint-plugin-react-x";
|
|
51
|
+
import reactDom from "eslint-plugin-react-dom";
|
|
52
52
|
|
|
53
53
|
export default defineConfig([
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
54
|
+
globalIgnores(["dist"]),
|
|
55
|
+
{
|
|
56
|
+
files: ["**/*.{ts,tsx}"],
|
|
57
|
+
extends: [
|
|
58
|
+
// Other configs...
|
|
59
|
+
// Enable lint rules for React
|
|
60
|
+
reactX.configs["recommended-typescript"],
|
|
61
|
+
// Enable lint rules for React DOM
|
|
62
|
+
reactDom.configs.recommended,
|
|
63
|
+
],
|
|
64
|
+
languageOptions: {
|
|
65
|
+
parserOptions: {
|
|
66
|
+
project: ["./tsconfig.node.json", "./tsconfig.app.json"],
|
|
67
|
+
tsconfigRootDir: import.meta.dirname,
|
|
68
|
+
},
|
|
69
|
+
// other options...
|
|
68
70
|
},
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
},
|
|
72
|
-
])
|
|
71
|
+
},
|
|
72
|
+
]);
|
|
73
73
|
```
|
package/dist/FlowEditor.d.ts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import "@xyflow/react/dist/style.css";
|
|
2
|
-
import type { NodeDefinition } from "./flow/types";
|
|
2
|
+
import type { FlowEditorJson, NodeDefinition } from "./flow/types";
|
|
3
3
|
export type FlowEditorProps = {
|
|
4
4
|
nodeDefinitions?: NodeDefinition[];
|
|
5
5
|
extendNodeDefinitions?: NodeDefinition[];
|
|
6
|
+
initialFlow?: Partial<FlowEditorJson> | null;
|
|
7
|
+
onExportJson?: (payload: FlowEditorJson) => void;
|
|
8
|
+
onCancel?: () => void;
|
|
6
9
|
};
|
|
7
|
-
export default function FlowEditor({ nodeDefinitions, extendNodeDefinitions, }: FlowEditorProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export default function FlowEditor({ nodeDefinitions, extendNodeDefinitions, initialFlow, onExportJson, onCancel, }: FlowEditorProps): import("react/jsx-runtime").JSX.Element;
|
|
8
11
|
//# sourceMappingURL=FlowEditor.d.ts.map
|
package/dist/FlowEditor.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FlowEditor.d.ts","sourceRoot":"","sources":["../src/FlowEditor.tsx"],"names":[],"mappings":"AAEA,OAAO,8BAA8B,CAAC;AAOtC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"FlowEditor.d.ts","sourceRoot":"","sources":["../src/FlowEditor.tsx"],"names":[],"mappings":"AAEA,OAAO,8BAA8B,CAAC;AAOtC,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAEnE,MAAM,MAAM,eAAe,GAAG;IAC3B,eAAe,CAAC,EAAE,cAAc,EAAE,CAAC;IACnC,qBAAqB,CAAC,EAAE,cAAc,EAAE,CAAC;IACzC,WAAW,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,GAAG,IAAI,CAAC;IAC7C,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,IAAI,CAAC;IACjD,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,EAChC,eAAe,EACf,qBAA0B,EAC1B,WAAW,EACX,YAAY,EACZ,QAAQ,GACV,EAAE,eAAe,2CAgBjB"}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import type { NodeDefinition } from "./types";
|
|
1
|
+
import type { FlowEditorJson, NodeDefinition } from "./types";
|
|
2
2
|
/** -------------------- Editor -------------------- */
|
|
3
|
-
export declare function FlowEditorInner({ nodeDefinitions, }: {
|
|
3
|
+
export declare function FlowEditorInner({ nodeDefinitions, initialFlow, onExportJson, onCancel, }: {
|
|
4
4
|
nodeDefinitions?: NodeDefinition[];
|
|
5
|
+
initialFlow?: Partial<FlowEditorJson> | null;
|
|
6
|
+
onExportJson?: (payload: FlowEditorJson) => void;
|
|
7
|
+
onCancel?: () => void;
|
|
5
8
|
}): import("react/jsx-runtime").JSX.Element;
|
|
6
9
|
//# sourceMappingURL=FlowEditorInner.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FlowEditorInner.d.ts","sourceRoot":"","sources":["../../src/flow/FlowEditorInner.tsx"],"names":[],"mappings":"AA4BA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"FlowEditorInner.d.ts","sourceRoot":"","sources":["../../src/flow/FlowEditorInner.tsx"],"names":[],"mappings":"AA4BA,OAAO,KAAK,EAGT,cAAc,EAEd,cAAc,EAKhB,MAAM,SAAS,CAAC;AAoIjB,uDAAuD;AAEvD,wBAAgB,eAAe,CAAC,EAC7B,eAA0C,EAC1C,WAAW,EACX,YAAY,EACZ,QAAQ,GACV,EAAE;IACA,eAAe,CAAC,EAAE,cAAc,EAAE,CAAC;IACnC,WAAW,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,GAAG,IAAI,CAAC;IAC7C,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,IAAI,CAAC;IACjD,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB,2CA2+BA"}
|
package/dist/flow/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Edge, Node } from "@xyflow/react";
|
|
1
|
+
import type { Edge, Node, Viewport } from "@xyflow/react";
|
|
2
2
|
import type { ComponentType, Dispatch, SetStateAction } from "react";
|
|
3
3
|
export type NodeType = "start" | "end" | "conditional" | "action" | "multiChoice";
|
|
4
4
|
export type NodeKind = "start" | "end" | "email" | "sms" | "push" | "tag" | "note" | "delay" | "smartFilter" | "waitForEvent" | "abTest" | "multiChoice";
|
|
@@ -24,6 +24,12 @@ export type EdgeData = {
|
|
|
24
24
|
};
|
|
25
25
|
export type RFNode = Node<NodeData, NodeType>;
|
|
26
26
|
export type RFEdge = Edge<EdgeData>;
|
|
27
|
+
export type FlowEditorJson = {
|
|
28
|
+
version: number;
|
|
29
|
+
nodes: RFNode[];
|
|
30
|
+
edges: RFEdge[];
|
|
31
|
+
viewport: Viewport;
|
|
32
|
+
};
|
|
27
33
|
export type NodeCategory = "Send Message" | "Update" | "Action" | "Event";
|
|
28
34
|
export type NodeDrawerFormComponentProps = {
|
|
29
35
|
node: RFNode;
|
package/dist/flow/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/flow/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/flow/types.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e,CAAC;AAElE,wBAAgB,gBAAgB,CAAC,EAC9B,IAAI,EACJ,YAAY,EACZ,YAAY,EACZ,eAAe,GACjB,EAAE,4BAA4B,
|
|
1
|
+
{"version":3,"file":"TrackedEventForm.d.ts","sourceRoot":"","sources":["../../src/forms/TrackedEventForm.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,eAAe,CAAC;AAElE,wBAAgB,gBAAgB,CAAC,EAC9B,IAAI,EACJ,YAAY,EACZ,YAAY,EACZ,eAAe,GACjB,EAAE,4BAA4B,2CAkG9B"}
|