@notmrabhi/flowforge 0.1.35 → 0.1.37
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 +52 -0
- package/dist/GatewayBranchEdge-DNSPjIZw.js +2 -0
- package/dist/GatewayBranchEdge-DNSPjIZw.js.map +1 -0
- package/dist/{GatewayBranchEdge-Dxoy5B1A.js → GatewayBranchEdge-Diid9GtB.js} +30 -28
- package/dist/GatewayBranchEdge-Diid9GtB.js.map +1 -0
- package/dist/canvas.cjs +1 -1
- package/dist/canvas.d.ts +77 -0
- package/dist/canvas.js +2 -2
- package/dist/core.d.ts +49 -0
- package/dist/defaultUi.cjs +1 -1
- package/dist/defaultUi.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +49 -0
- package/dist/index.js +2 -2
- package/dist/nodeRegistry.d.ts +6 -0
- package/dist/style.css +1 -1
- package/dist/templateRegistry.cjs +1 -1
- package/dist/templateRegistry.cjs.map +1 -1
- package/dist/templateRegistry.d.ts +49 -0
- package/dist/templateRegistry.js +63 -20
- package/dist/templateRegistry.js.map +1 -1
- package/dist/{templateSkeletons-DCvfog6-.js → templateSkeletons-BB6jQ9r5.js} +2 -2
- package/dist/{templateSkeletons-DCvfog6-.js.map → templateSkeletons-BB6jQ9r5.js.map} +1 -1
- package/dist/{templateSkeletons-BTC2fk5u.js → templateSkeletons-BkdRPbV0.js} +2 -2
- package/dist/{templateSkeletons-BTC2fk5u.js.map → templateSkeletons-BkdRPbV0.js.map} +1 -1
- package/package.json +1 -1
- package/dist/GatewayBranchEdge-9YF32wwN.js +0 -2
- package/dist/GatewayBranchEdge-9YF32wwN.js.map +0 -1
- package/dist/GatewayBranchEdge-Dxoy5B1A.js.map +0 -1
package/dist/templateRegistry.js
CHANGED
|
@@ -1,44 +1,87 @@
|
|
|
1
|
-
class
|
|
1
|
+
class o {
|
|
2
2
|
constructor() {
|
|
3
3
|
this.templates = /* @__PURE__ */ new Map();
|
|
4
4
|
}
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Register a template. Normalises `allowedTasks` (the backend's name) →
|
|
7
|
+
* `availableTasks` (FlowForge's canonical name) so consumers can pass
|
|
8
|
+
* either without rewriting.
|
|
9
|
+
*/
|
|
10
|
+
register(t) {
|
|
11
|
+
const e = {
|
|
12
|
+
...t,
|
|
13
|
+
availableTasks: t.availableTasks ?? t.allowedTasks
|
|
14
|
+
};
|
|
6
15
|
return this.templates.set(e.triggerKey, e), this;
|
|
7
16
|
}
|
|
8
|
-
|
|
9
|
-
|
|
17
|
+
/**
|
|
18
|
+
* Register a list of templates fetched from `GET /api/v1/workflow-template`.
|
|
19
|
+
*
|
|
20
|
+
* The API shape is:
|
|
21
|
+
* {
|
|
22
|
+
* key, name, description, allowedTasks, allowedSources,
|
|
23
|
+
* configuration, // runtime BPMN — ignored by the canvas
|
|
24
|
+
* templateUI: { // ← UI bag, spread onto the template
|
|
25
|
+
* triggerCategory, icon, tags, category, author, popularity,
|
|
26
|
+
* source, product, taskLabels, maxTasks, skeletonState, …
|
|
27
|
+
* }
|
|
28
|
+
* }
|
|
29
|
+
*
|
|
30
|
+
* Anything in `templateUI` overrides the top-level shorthand where there's
|
|
31
|
+
* an overlap. Bad rows (missing `key`) are skipped with a DEV warning
|
|
32
|
+
* rather than throwing, so one broken template doesn't blank the picker.
|
|
33
|
+
*
|
|
34
|
+
* Returns `this` for chaining and the count of templates registered.
|
|
35
|
+
*/
|
|
36
|
+
registerFromApi(t) {
|
|
37
|
+
for (const e of t ?? [])
|
|
38
|
+
e != null && e.key && this.register({
|
|
39
|
+
triggerKey: e.key,
|
|
40
|
+
label: e.name ?? e.key,
|
|
41
|
+
description: e.description,
|
|
42
|
+
availableTasks: e.allowedTasks,
|
|
43
|
+
...e.templateUI ?? {}
|
|
44
|
+
});
|
|
45
|
+
return this;
|
|
46
|
+
}
|
|
47
|
+
lookup(t) {
|
|
48
|
+
return this.templates.get(t);
|
|
10
49
|
}
|
|
11
50
|
list() {
|
|
12
51
|
return [...this.templates.values()];
|
|
13
52
|
}
|
|
14
|
-
listByCategory(
|
|
15
|
-
return this.list().filter((
|
|
53
|
+
listByCategory(t) {
|
|
54
|
+
return this.list().filter((e) => e.category === t);
|
|
16
55
|
}
|
|
17
|
-
listByTag(
|
|
18
|
-
return this.list().filter((
|
|
56
|
+
listByTag(t) {
|
|
57
|
+
return this.list().filter((e) => {
|
|
19
58
|
var s;
|
|
20
|
-
return (s =
|
|
59
|
+
return (s = e.tags) == null ? void 0 : s.includes(t);
|
|
21
60
|
});
|
|
22
61
|
}
|
|
23
|
-
search(
|
|
24
|
-
const
|
|
62
|
+
search(t) {
|
|
63
|
+
const e = t.toLowerCase();
|
|
25
64
|
return this.list().filter(
|
|
26
65
|
(s) => {
|
|
27
|
-
var r,
|
|
28
|
-
return s.label.toLowerCase().includes(
|
|
66
|
+
var r, a, i;
|
|
67
|
+
return s.label.toLowerCase().includes(e) || ((r = s.description) == null ? void 0 : r.toLowerCase().includes(e)) || ((a = s.tags) == null ? void 0 : a.some((l) => l.toLowerCase().includes(e))) || ((i = s.category) == null ? void 0 : i.toLowerCase().includes(e));
|
|
29
68
|
}
|
|
30
69
|
);
|
|
31
70
|
}
|
|
32
71
|
categories() {
|
|
33
|
-
const
|
|
34
|
-
return this.list().forEach((
|
|
35
|
-
|
|
36
|
-
}), Array.from(
|
|
72
|
+
const t = /* @__PURE__ */ new Set();
|
|
73
|
+
return this.list().forEach((e) => {
|
|
74
|
+
e.category && t.add(e.category);
|
|
75
|
+
}), Array.from(t);
|
|
76
|
+
}
|
|
77
|
+
/** Remove every template — useful before re-loading from backend. */
|
|
78
|
+
clear() {
|
|
79
|
+
return this.templates.clear(), this;
|
|
37
80
|
}
|
|
38
81
|
}
|
|
39
|
-
const
|
|
82
|
+
const c = new o();
|
|
40
83
|
export {
|
|
41
|
-
|
|
42
|
-
|
|
84
|
+
o as TemplateRegistry,
|
|
85
|
+
c as templateRegistry
|
|
43
86
|
};
|
|
44
87
|
//# sourceMappingURL=templateRegistry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"templateRegistry.js","sources":["../src/templateRegistry/index.ts"],"sourcesContent":["import { WorkflowTemplate } from '../WorkflowCanvas/types';\
|
|
1
|
+
{"version":3,"file":"templateRegistry.js","sources":["../src/templateRegistry/index.ts"],"sourcesContent":["import type { WorkflowTemplate, ApiWorkflowTemplate } from '../WorkflowCanvas/types';\n\nexport class TemplateRegistry {\n private templates = new Map<string, WorkflowTemplate>();\n\n /**\n * Register a template. Normalises `allowedTasks` (the backend's name) →\n * `availableTasks` (FlowForge's canonical name) so consumers can pass\n * either without rewriting.\n */\n register(template: WorkflowTemplate): this {\n const normalised: WorkflowTemplate = {\n ...template,\n availableTasks: template.availableTasks ?? template.allowedTasks,\n };\n this.templates.set(normalised.triggerKey, normalised);\n return this;\n }\n\n /**\n * Register a list of templates fetched from `GET /api/v1/workflow-template`.\n *\n * The API shape is:\n * {\n * key, name, description, allowedTasks, allowedSources,\n * configuration, // runtime BPMN — ignored by the canvas\n * templateUI: { // ← UI bag, spread onto the template\n * triggerCategory, icon, tags, category, author, popularity,\n * source, product, taskLabels, maxTasks, skeletonState, …\n * }\n * }\n *\n * Anything in `templateUI` overrides the top-level shorthand where there's\n * an overlap. Bad rows (missing `key`) are skipped with a DEV warning\n * rather than throwing, so one broken template doesn't blank the picker.\n *\n * Returns `this` for chaining and the count of templates registered.\n */\n registerFromApi(list: ApiWorkflowTemplate[]): this {\n for (const t of list ?? []) {\n if (!t?.key) {\n if (import.meta.env?.DEV) {\n // eslint-disable-next-line no-console\n console.warn('[FlowForge] templateRegistry.registerFromApi: skipped row without `key`', t);\n }\n continue;\n }\n this.register({\n triggerKey: t.key,\n label: t.name ?? t.key,\n description: t.description,\n availableTasks: t.allowedTasks,\n ...(t.templateUI ?? {}),\n } as WorkflowTemplate);\n }\n return this;\n }\n\n lookup(triggerKey: string): WorkflowTemplate | undefined {\n return this.templates.get(triggerKey);\n }\n\n list(): WorkflowTemplate[] {\n return [...this.templates.values()];\n }\n\n listByCategory(category: string): WorkflowTemplate[] {\n return this.list().filter((t) => t.category === category);\n }\n\n listByTag(tag: string): WorkflowTemplate[] {\n return this.list().filter((t) => t.tags?.includes(tag));\n }\n\n search(query: string): WorkflowTemplate[] {\n const q = query.toLowerCase();\n return this.list().filter(\n (t) =>\n t.label.toLowerCase().includes(q) ||\n t.description?.toLowerCase().includes(q) ||\n t.tags?.some((tag) => tag.toLowerCase().includes(q)) ||\n t.category?.toLowerCase().includes(q),\n );\n }\n\n categories(): string[] {\n const cats = new Set<string>();\n this.list().forEach((t) => { if (t.category) cats.add(t.category); });\n return Array.from(cats);\n }\n\n /** Remove every template — useful before re-loading from backend. */\n clear(): this {\n this.templates.clear();\n return this;\n }\n}\n\nexport const templateRegistry = new TemplateRegistry();\nexport type { WorkflowTemplate, ApiWorkflowTemplate };\n"],"names":["TemplateRegistry","template","normalised","list","t","triggerKey","category","tag","_a","query","q","_b","_c","cats","templateRegistry"],"mappings":"AAEO,MAAMA,EAAiB;AAAA,EAAvB,cAAA;AACL,SAAQ,gCAAgB,IAAA;AAAA,EAA8B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOtD,SAASC,GAAkC;AACzC,UAAMC,IAA+B;AAAA,MACnC,GAAGD;AAAA,MACH,gBAAgBA,EAAS,kBAAkBA,EAAS;AAAA,IAAA;AAEtD,gBAAK,UAAU,IAAIC,EAAW,YAAYA,CAAU,GAC7C;AAAA,EACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAqBA,gBAAgBC,GAAmC;AACjD,eAAWC,KAAKD,KAAQ;AACtB,MAAKC,KAAA,QAAAA,EAAG,OAOR,KAAK,SAAS;AAAA,QACZ,YAAYA,EAAE;AAAA,QACd,OAAOA,EAAE,QAAQA,EAAE;AAA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,IAAmB,IAAId,EAAA;"}
|
|
@@ -2,7 +2,7 @@ import { jsxs as v, jsx as f, Fragment as ye } from "react/jsx-runtime";
|
|
|
2
2
|
import G, { useRef as vt, useEffect as re, useState as M, useCallback as $, useMemo as Y } from "react";
|
|
3
3
|
import In, { useStore as On, useReactFlow as Mn, Background as jn, Controls as Fn, MiniMap as zn } from "reactflow";
|
|
4
4
|
import "reactflow/dist/style.css";
|
|
5
|
-
import { e as Ln, G as An, E as Dn, P as Rn, L as Pn, d as Bn, f as Wn } from "./GatewayBranchEdge-
|
|
5
|
+
import { e as Ln, G as An, E as Dn, P as Rn, L as Pn, d as Bn, f as Wn } from "./GatewayBranchEdge-Diid9GtB.js";
|
|
6
6
|
import { Dialog as Gn, Box as Q, Drawer as $n, IconButton as Et, Button as Ne, CircularProgress as Yn } from "@mui/material";
|
|
7
7
|
import Kn from "react-select";
|
|
8
8
|
import { MdClose as Un, MdCalendarToday as Vn, MdBolt as Hn, MdArrowBack as Wt, MdChevronRight as Gt, MdAddCircleOutline as qn, MdApps as Xn, MdErrorOutline as Jn, MdAccountTree as Zn, MdAdd as Qn, MdSearch as er, MdCategory as tr, MdCancel as $t, MdError as Yt, MdCheckCircle as Kt, MdPlayArrow as Ut, MdHourglassEmpty as nr, MdSchedule as kt, MdPerson as rr, MdExpandLess as or, MdExpandMore as ir } from "react-icons/md";
|
|
@@ -2952,4 +2952,4 @@ export {
|
|
|
2952
2952
|
bs as u,
|
|
2953
2953
|
ws as w
|
|
2954
2954
|
};
|
|
2955
|
-
//# sourceMappingURL=templateSkeletons-
|
|
2955
|
+
//# sourceMappingURL=templateSkeletons-BB6jQ9r5.js.map
|