@particle-academy/fancy-flow 0.46.0 → 0.47.1
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 +29 -0
- package/dist/{ConfigFieldRenderer-iMkZj0VK.d.ts → ConfigFieldRenderer-DrD2-Qml.d.ts} +1 -1
- package/dist/{ConfigFieldRenderer-Cyir8-B8.d.cts → ConfigFieldRenderer-NuDjtun1.d.cts} +1 -1
- package/dist/{chunk-P5SYH6M6.js → chunk-7DTUZUTB.js} +3 -3
- package/dist/{chunk-P5SYH6M6.js.map → chunk-7DTUZUTB.js.map} +1 -1
- package/dist/chunk-DRRZEAYB.js +196 -0
- package/dist/chunk-DRRZEAYB.js.map +1 -0
- package/dist/{chunk-MH4ZW4DJ.js → chunk-E6T3FZZP.js} +3 -5
- package/dist/chunk-E6T3FZZP.js.map +1 -0
- package/dist/{chunk-3BKU4SQZ.js → chunk-KTGXZBUM.js} +3 -4
- package/dist/chunk-KTGXZBUM.js.map +1 -0
- package/dist/{chunk-OWENS2H5.js → chunk-MJ3A3TAI.js} +1603 -36
- package/dist/chunk-MJ3A3TAI.js.map +1 -0
- package/dist/{chunk-HFUBVT7W.js → chunk-UVP43XU2.js} +7 -6
- package/dist/chunk-UVP43XU2.js.map +1 -0
- package/dist/durable.cjs +10174 -110
- package/dist/durable.cjs.map +1 -1
- package/dist/durable.js +3 -3
- package/dist/engine.cjs +10097 -47
- package/dist/engine.cjs.map +1 -1
- package/dist/engine.d.cts +2 -2
- package/dist/engine.d.ts +2 -2
- package/dist/engine.js +5 -7
- package/dist/engine.js.map +1 -1
- package/dist/fields/react-fancy.d.cts +2 -2
- package/dist/fields/react-fancy.d.ts +2 -2
- package/dist/index.cjs +203 -191
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +13 -16
- package/dist/index.js.map +1 -1
- package/dist/registry/index.d.cts +3 -3
- package/dist/registry/index.d.ts +3 -3
- package/dist/{registry-D_kyUZEf.d.cts → registry-BnnifM-t.d.cts} +22 -3
- package/dist/{registry-LHB3MlR9.d.ts → registry-DpARG95T.d.ts} +22 -3
- package/dist/registry.cjs +2978 -2968
- package/dist/registry.cjs.map +1 -1
- package/dist/registry.js +3 -6
- package/dist/runtime.cjs +3692 -2536
- package/dist/runtime.cjs.map +1 -1
- package/dist/runtime.js +5 -6
- package/dist/schema.cjs +10369 -24
- package/dist/schema.cjs.map +1 -1
- package/dist/schema.js +4 -3
- package/dist/screens.cjs +1366 -38
- package/dist/screens.cjs.map +1 -1
- package/dist/screens.js +5 -8
- package/dist/screens.js.map +1 -1
- package/dist/{types--S2Kzx7w.d.cts → types-BO8TgI2M.d.cts} +1 -1
- package/dist/{types-ChkCRonF.d.ts → types-DJAmfiJC.d.ts} +1 -1
- package/dist/ux.cjs +10363 -2
- package/dist/ux.cjs.map +1 -1
- package/dist/ux.d.cts +1 -1
- package/dist/ux.d.ts +1 -1
- package/dist/ux.js +3 -1
- package/dist/ux.js.map +1 -1
- package/package.json +6 -2
- package/dist/chunk-3BKU4SQZ.js.map +0 -1
- package/dist/chunk-HFUBVT7W.js.map +0 -1
- package/dist/chunk-L43CWD63.js +0 -282
- package/dist/chunk-L43CWD63.js.map +0 -1
- package/dist/chunk-MH4ZW4DJ.js.map +0 -1
- package/dist/chunk-OWENS2H5.js.map +0 -1
- package/dist/chunk-PVROYW7C.js +0 -187
- package/dist/chunk-PVROYW7C.js.map +0 -1
- package/dist/chunk-RMU6YCIQ.js +0 -1274
- package/dist/chunk-RMU6YCIQ.js.map +0 -1
- package/dist/chunk-TITD5W4Y.js +0 -26
- package/dist/chunk-TITD5W4Y.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1719,199 +1719,15 @@ var init_layout = __esm({
|
|
|
1719
1719
|
init_dagre_esm();
|
|
1720
1720
|
}
|
|
1721
1721
|
});
|
|
1722
|
-
|
|
1723
|
-
// src/registry/registry.ts
|
|
1724
|
-
var kinds = /* @__PURE__ */ new Map();
|
|
1725
|
-
var aliases = /* @__PURE__ */ new Map();
|
|
1726
|
-
var listeners = /* @__PURE__ */ new Set();
|
|
1727
|
-
var overrides = /* @__PURE__ */ new Map();
|
|
1728
|
-
function registerNodeKind(definition) {
|
|
1729
|
-
kinds.set(definition.name, definition);
|
|
1730
|
-
for (const alias of definition.aliases ?? []) aliases.set(alias, definition.name);
|
|
1731
|
-
notify();
|
|
1732
|
-
return () => {
|
|
1733
|
-
if (kinds.get(definition.name) === definition) {
|
|
1734
|
-
kinds.delete(definition.name);
|
|
1735
|
-
for (const alias of definition.aliases ?? []) {
|
|
1736
|
-
if (aliases.get(alias) === definition.name) aliases.delete(alias);
|
|
1737
|
-
}
|
|
1738
|
-
notify();
|
|
1739
|
-
}
|
|
1740
|
-
};
|
|
1741
|
-
}
|
|
1742
|
-
function resolveKindId(id2) {
|
|
1743
|
-
if (kinds.has(id2)) return id2;
|
|
1744
|
-
const canonical = aliases.get(id2);
|
|
1745
|
-
return canonical && kinds.has(canonical) ? canonical : null;
|
|
1746
|
-
}
|
|
1747
|
-
function overrideNodeKind(name, patch) {
|
|
1748
|
-
const canonical = resolveKindId(name) ?? name;
|
|
1749
|
-
const previous = overrides.get(canonical);
|
|
1750
|
-
overrides.set(canonical, { ...previous, ...patch });
|
|
1751
|
-
notify();
|
|
1752
|
-
return () => {
|
|
1753
|
-
if (previous) {
|
|
1754
|
-
overrides.set(canonical, previous);
|
|
1755
|
-
} else {
|
|
1756
|
-
overrides.delete(canonical);
|
|
1757
|
-
}
|
|
1758
|
-
notify();
|
|
1759
|
-
};
|
|
1760
|
-
}
|
|
1761
|
-
function clearNodeKindOverrides() {
|
|
1762
|
-
if (overrides.size === 0) return;
|
|
1763
|
-
overrides.clear();
|
|
1764
|
-
notify();
|
|
1765
|
-
}
|
|
1766
|
-
function withOverride(kind) {
|
|
1767
|
-
if (!kind) return null;
|
|
1768
|
-
const patch = overrides.get(kind.name);
|
|
1769
|
-
return patch ? { ...kind, ...patch } : kind;
|
|
1770
|
-
}
|
|
1771
|
-
function getNodeKind(name) {
|
|
1772
|
-
const canonical = resolveKindId(name);
|
|
1773
|
-
return canonical ? withOverride(kinds.get(canonical)) : null;
|
|
1774
|
-
}
|
|
1775
|
-
function kindIds(kind) {
|
|
1776
|
-
return [kind.name, ...kind.aliases ?? []];
|
|
1777
|
-
}
|
|
1778
|
-
function listNodeKinds(category) {
|
|
1779
|
-
const all = Array.from(kinds.values()).map(
|
|
1780
|
-
(k2) => withOverride(k2)
|
|
1781
|
-
);
|
|
1782
|
-
return category ? all.filter((k2) => k2.category === category) : all;
|
|
1783
|
-
}
|
|
1784
|
-
function onNodeKindsChanged(listener) {
|
|
1785
|
-
listeners.add(listener);
|
|
1786
|
-
return () => listeners.delete(listener);
|
|
1787
|
-
}
|
|
1788
|
-
function notify() {
|
|
1789
|
-
for (const l of listeners) l();
|
|
1790
|
-
}
|
|
1791
|
-
function defaultConfigFor(kind) {
|
|
1792
|
-
const fromKind = kind.defaultConfig ? { ...kind.defaultConfig } : {};
|
|
1793
|
-
for (const field of kind.configSchema ?? []) {
|
|
1794
|
-
if (fromKind[field.key] !== void 0) continue;
|
|
1795
|
-
if ("default" in field && field.default !== void 0) {
|
|
1796
|
-
fromKind[field.key] = field.default;
|
|
1797
|
-
}
|
|
1798
|
-
}
|
|
1799
|
-
return fromKind;
|
|
1800
|
-
}
|
|
1801
|
-
function validateConfig(kind, config) {
|
|
1802
|
-
const issues = [];
|
|
1803
|
-
for (const field of kind.configSchema ?? []) {
|
|
1804
|
-
const value = config[field.key];
|
|
1805
|
-
if (field.required && (value === void 0 || value === null || value === "")) {
|
|
1806
|
-
issues.push({ key: field.key, message: `${field.label} is required` });
|
|
1807
|
-
continue;
|
|
1808
|
-
}
|
|
1809
|
-
if (value === void 0 || value === null) continue;
|
|
1810
|
-
const issue = validateField(field, value);
|
|
1811
|
-
if (issue) issues.push({ key: field.key, message: issue });
|
|
1812
|
-
}
|
|
1813
|
-
return issues;
|
|
1814
|
-
}
|
|
1815
|
-
function validateField(field, value) {
|
|
1816
|
-
switch (field.type) {
|
|
1817
|
-
case "text":
|
|
1818
|
-
case "textarea":
|
|
1819
|
-
case "expression":
|
|
1820
|
-
case "credential":
|
|
1821
|
-
return typeof value === "string" ? null : `${field.label} must be a string`;
|
|
1822
|
-
case "number": {
|
|
1823
|
-
if (typeof value !== "number" || !Number.isFinite(value)) return `${field.label} must be a number`;
|
|
1824
|
-
if (field.min !== void 0 && value < field.min) return `${field.label} must be >= ${field.min}`;
|
|
1825
|
-
if (field.max !== void 0 && value > field.max) return `${field.label} must be <= ${field.max}`;
|
|
1826
|
-
return null;
|
|
1827
|
-
}
|
|
1828
|
-
case "switch":
|
|
1829
|
-
return typeof value === "boolean" ? null : `${field.label} must be a boolean`;
|
|
1830
|
-
case "select": {
|
|
1831
|
-
const allowed = field.options.map((o) => o.value);
|
|
1832
|
-
return allowed.includes(String(value)) ? null : `${field.label} must be one of ${allowed.join(", ")}`;
|
|
1833
|
-
}
|
|
1834
|
-
case "json":
|
|
1835
|
-
return null;
|
|
1836
|
-
// permissive — just JSON-shaped
|
|
1837
|
-
case "repeater": {
|
|
1838
|
-
if (!Array.isArray(value)) return `${field.label} must be a list`;
|
|
1839
|
-
if (field.minItems !== void 0 && value.length < field.minItems) {
|
|
1840
|
-
return `${field.label} needs at least ${field.minItems}`;
|
|
1841
|
-
}
|
|
1842
|
-
if (field.maxItems !== void 0 && value.length > field.maxItems) {
|
|
1843
|
-
return `${field.label} allows at most ${field.maxItems}`;
|
|
1844
|
-
}
|
|
1845
|
-
for (let i = 0; i < value.length; i++) {
|
|
1846
|
-
const row = value[i];
|
|
1847
|
-
if (!row || typeof row !== "object" || Array.isArray(row)) {
|
|
1848
|
-
return `${field.label} item ${i + 1} must be an object`;
|
|
1849
|
-
}
|
|
1850
|
-
for (const sub of field.fields) {
|
|
1851
|
-
const cell = row[sub.key];
|
|
1852
|
-
if (sub.required && (cell === void 0 || cell === null || cell === "")) {
|
|
1853
|
-
return `${field.label} item ${i + 1}: ${sub.label} is required`;
|
|
1854
|
-
}
|
|
1855
|
-
if (cell === void 0 || cell === null) continue;
|
|
1856
|
-
const issue = validateField(sub, cell);
|
|
1857
|
-
if (issue) return `${field.label} item ${i + 1}: ${issue}`;
|
|
1858
|
-
}
|
|
1859
|
-
}
|
|
1860
|
-
return null;
|
|
1861
|
-
}
|
|
1862
|
-
case "keyvalue": {
|
|
1863
|
-
if (typeof value !== "object" || value === null || Array.isArray(value)) {
|
|
1864
|
-
return `${field.label} must be a key/value map`;
|
|
1865
|
-
}
|
|
1866
|
-
const allowed = field.valueOptions?.map((o) => o.value);
|
|
1867
|
-
for (const [k2, v2] of Object.entries(value)) {
|
|
1868
|
-
if (typeof v2 !== "string") return `${field.label}: "${k2}" must be a string`;
|
|
1869
|
-
if (allowed && !allowed.includes(v2)) {
|
|
1870
|
-
return `${field.label}: "${k2}" must be one of ${allowed.join(", ")}`;
|
|
1871
|
-
}
|
|
1872
|
-
}
|
|
1873
|
-
return null;
|
|
1874
|
-
}
|
|
1875
|
-
case "document":
|
|
1876
|
-
return null;
|
|
1877
|
-
// opaque to fancy-flow — the host's editor owns its shape
|
|
1878
|
-
default:
|
|
1879
|
-
return null;
|
|
1880
|
-
}
|
|
1881
|
-
}
|
|
1882
|
-
function categoryAccent(category) {
|
|
1883
|
-
switch (category) {
|
|
1884
|
-
case "trigger":
|
|
1885
|
-
return "#10b981";
|
|
1886
|
-
case "logic":
|
|
1887
|
-
return "#f59e0b";
|
|
1888
|
-
case "data":
|
|
1889
|
-
return "#0ea5e9";
|
|
1890
|
-
case "ai":
|
|
1891
|
-
return "#8b5cf6";
|
|
1892
|
-
case "io":
|
|
1893
|
-
return "#3b82f6";
|
|
1894
|
-
case "human":
|
|
1895
|
-
return "#ec4899";
|
|
1896
|
-
case "output":
|
|
1897
|
-
return "#a855f7";
|
|
1898
|
-
case "layout":
|
|
1899
|
-
return "#64748b";
|
|
1900
|
-
case "annotation":
|
|
1901
|
-
return "#eab308";
|
|
1902
|
-
default:
|
|
1903
|
-
return "#71717a";
|
|
1904
|
-
}
|
|
1905
|
-
}
|
|
1906
1722
|
var adapter = null;
|
|
1907
|
-
var
|
|
1723
|
+
var listeners = /* @__PURE__ */ new Set();
|
|
1908
1724
|
function registerRichInputAdapter(next) {
|
|
1909
1725
|
adapter = next;
|
|
1910
|
-
for (const l of
|
|
1726
|
+
for (const l of listeners) l();
|
|
1911
1727
|
return () => {
|
|
1912
1728
|
if (adapter === next) {
|
|
1913
1729
|
adapter = null;
|
|
1914
|
-
for (const l of
|
|
1730
|
+
for (const l of listeners) l();
|
|
1915
1731
|
}
|
|
1916
1732
|
};
|
|
1917
1733
|
}
|
|
@@ -1922,8 +1738,8 @@ function isRichInputEnabled() {
|
|
|
1922
1738
|
return adapter !== null && (adapter.renderDocument !== void 0 || adapter.renderEditor !== void 0);
|
|
1923
1739
|
}
|
|
1924
1740
|
function onRichInputAdapterChanged(fn2) {
|
|
1925
|
-
|
|
1926
|
-
return () =>
|
|
1741
|
+
listeners.add(fn2);
|
|
1742
|
+
return () => listeners.delete(fn2);
|
|
1927
1743
|
}
|
|
1928
1744
|
function RichInputPreview({ config }) {
|
|
1929
1745
|
const a = getRichInputAdapter();
|
|
@@ -12371,6 +12187,199 @@ function registerBuiltinKinds() {
|
|
|
12371
12187
|
for (const k2 of KINDS) registerNodeKind(k2);
|
|
12372
12188
|
}
|
|
12373
12189
|
var BUILTIN_KINDS = KINDS;
|
|
12190
|
+
|
|
12191
|
+
// src/registry/registry.ts
|
|
12192
|
+
var kinds = /* @__PURE__ */ new Map();
|
|
12193
|
+
var aliases = /* @__PURE__ */ new Map();
|
|
12194
|
+
var listeners2 = /* @__PURE__ */ new Set();
|
|
12195
|
+
var overrides = /* @__PURE__ */ new Map();
|
|
12196
|
+
var builtinsEnsured = false;
|
|
12197
|
+
function ensureBuiltinKinds() {
|
|
12198
|
+
if (builtinsEnsured) return;
|
|
12199
|
+
builtinsEnsured = true;
|
|
12200
|
+
registerBuiltinKinds();
|
|
12201
|
+
}
|
|
12202
|
+
function registerNodeKind(definition) {
|
|
12203
|
+
ensureBuiltinKinds();
|
|
12204
|
+
kinds.set(definition.name, definition);
|
|
12205
|
+
for (const alias of definition.aliases ?? []) aliases.set(alias, definition.name);
|
|
12206
|
+
notify();
|
|
12207
|
+
return () => {
|
|
12208
|
+
if (kinds.get(definition.name) === definition) {
|
|
12209
|
+
kinds.delete(definition.name);
|
|
12210
|
+
for (const alias of definition.aliases ?? []) {
|
|
12211
|
+
if (aliases.get(alias) === definition.name) aliases.delete(alias);
|
|
12212
|
+
}
|
|
12213
|
+
notify();
|
|
12214
|
+
}
|
|
12215
|
+
};
|
|
12216
|
+
}
|
|
12217
|
+
function resolveKindId(id2) {
|
|
12218
|
+
ensureBuiltinKinds();
|
|
12219
|
+
if (kinds.has(id2)) return id2;
|
|
12220
|
+
const canonical = aliases.get(id2);
|
|
12221
|
+
return canonical && kinds.has(canonical) ? canonical : null;
|
|
12222
|
+
}
|
|
12223
|
+
function overrideNodeKind(name, patch) {
|
|
12224
|
+
const canonical = resolveKindId(name) ?? name;
|
|
12225
|
+
const previous = overrides.get(canonical);
|
|
12226
|
+
overrides.set(canonical, { ...previous, ...patch });
|
|
12227
|
+
notify();
|
|
12228
|
+
return () => {
|
|
12229
|
+
if (previous) {
|
|
12230
|
+
overrides.set(canonical, previous);
|
|
12231
|
+
} else {
|
|
12232
|
+
overrides.delete(canonical);
|
|
12233
|
+
}
|
|
12234
|
+
notify();
|
|
12235
|
+
};
|
|
12236
|
+
}
|
|
12237
|
+
function clearNodeKindOverrides() {
|
|
12238
|
+
if (overrides.size === 0) return;
|
|
12239
|
+
overrides.clear();
|
|
12240
|
+
notify();
|
|
12241
|
+
}
|
|
12242
|
+
function withOverride(kind) {
|
|
12243
|
+
if (!kind) return null;
|
|
12244
|
+
const patch = overrides.get(kind.name);
|
|
12245
|
+
return patch ? { ...kind, ...patch } : kind;
|
|
12246
|
+
}
|
|
12247
|
+
function getNodeKind(name) {
|
|
12248
|
+
const canonical = resolveKindId(name);
|
|
12249
|
+
return canonical ? withOverride(kinds.get(canonical)) : null;
|
|
12250
|
+
}
|
|
12251
|
+
function kindIds(kind) {
|
|
12252
|
+
return [kind.name, ...kind.aliases ?? []];
|
|
12253
|
+
}
|
|
12254
|
+
function listNodeKinds(category) {
|
|
12255
|
+
ensureBuiltinKinds();
|
|
12256
|
+
const all = Array.from(kinds.values()).map(
|
|
12257
|
+
(k2) => withOverride(k2)
|
|
12258
|
+
);
|
|
12259
|
+
return category ? all.filter((k2) => k2.category === category) : all;
|
|
12260
|
+
}
|
|
12261
|
+
function onNodeKindsChanged(listener) {
|
|
12262
|
+
listeners2.add(listener);
|
|
12263
|
+
return () => listeners2.delete(listener);
|
|
12264
|
+
}
|
|
12265
|
+
function notify() {
|
|
12266
|
+
for (const l of listeners2) l();
|
|
12267
|
+
}
|
|
12268
|
+
function defaultConfigFor(kind) {
|
|
12269
|
+
const fromKind = kind.defaultConfig ? { ...kind.defaultConfig } : {};
|
|
12270
|
+
for (const field of kind.configSchema ?? []) {
|
|
12271
|
+
if (fromKind[field.key] !== void 0) continue;
|
|
12272
|
+
if ("default" in field && field.default !== void 0) {
|
|
12273
|
+
fromKind[field.key] = field.default;
|
|
12274
|
+
}
|
|
12275
|
+
}
|
|
12276
|
+
return fromKind;
|
|
12277
|
+
}
|
|
12278
|
+
function validateConfig(kind, config) {
|
|
12279
|
+
const issues = [];
|
|
12280
|
+
for (const field of kind.configSchema ?? []) {
|
|
12281
|
+
const value = config[field.key];
|
|
12282
|
+
if (field.required && (value === void 0 || value === null || value === "")) {
|
|
12283
|
+
issues.push({ key: field.key, message: `${field.label} is required` });
|
|
12284
|
+
continue;
|
|
12285
|
+
}
|
|
12286
|
+
if (value === void 0 || value === null) continue;
|
|
12287
|
+
const issue = validateField(field, value);
|
|
12288
|
+
if (issue) issues.push({ key: field.key, message: issue });
|
|
12289
|
+
}
|
|
12290
|
+
return issues;
|
|
12291
|
+
}
|
|
12292
|
+
function validateField(field, value) {
|
|
12293
|
+
switch (field.type) {
|
|
12294
|
+
case "text":
|
|
12295
|
+
case "textarea":
|
|
12296
|
+
case "expression":
|
|
12297
|
+
case "credential":
|
|
12298
|
+
return typeof value === "string" ? null : `${field.label} must be a string`;
|
|
12299
|
+
case "number": {
|
|
12300
|
+
if (typeof value !== "number" || !Number.isFinite(value)) return `${field.label} must be a number`;
|
|
12301
|
+
if (field.min !== void 0 && value < field.min) return `${field.label} must be >= ${field.min}`;
|
|
12302
|
+
if (field.max !== void 0 && value > field.max) return `${field.label} must be <= ${field.max}`;
|
|
12303
|
+
return null;
|
|
12304
|
+
}
|
|
12305
|
+
case "switch":
|
|
12306
|
+
return typeof value === "boolean" ? null : `${field.label} must be a boolean`;
|
|
12307
|
+
case "select": {
|
|
12308
|
+
const allowed = field.options.map((o) => o.value);
|
|
12309
|
+
return allowed.includes(String(value)) ? null : `${field.label} must be one of ${allowed.join(", ")}`;
|
|
12310
|
+
}
|
|
12311
|
+
case "json":
|
|
12312
|
+
return null;
|
|
12313
|
+
// permissive — just JSON-shaped
|
|
12314
|
+
case "repeater": {
|
|
12315
|
+
if (!Array.isArray(value)) return `${field.label} must be a list`;
|
|
12316
|
+
if (field.minItems !== void 0 && value.length < field.minItems) {
|
|
12317
|
+
return `${field.label} needs at least ${field.minItems}`;
|
|
12318
|
+
}
|
|
12319
|
+
if (field.maxItems !== void 0 && value.length > field.maxItems) {
|
|
12320
|
+
return `${field.label} allows at most ${field.maxItems}`;
|
|
12321
|
+
}
|
|
12322
|
+
for (let i = 0; i < value.length; i++) {
|
|
12323
|
+
const row = value[i];
|
|
12324
|
+
if (!row || typeof row !== "object" || Array.isArray(row)) {
|
|
12325
|
+
return `${field.label} item ${i + 1} must be an object`;
|
|
12326
|
+
}
|
|
12327
|
+
for (const sub of field.fields) {
|
|
12328
|
+
const cell = row[sub.key];
|
|
12329
|
+
if (sub.required && (cell === void 0 || cell === null || cell === "")) {
|
|
12330
|
+
return `${field.label} item ${i + 1}: ${sub.label} is required`;
|
|
12331
|
+
}
|
|
12332
|
+
if (cell === void 0 || cell === null) continue;
|
|
12333
|
+
const issue = validateField(sub, cell);
|
|
12334
|
+
if (issue) return `${field.label} item ${i + 1}: ${issue}`;
|
|
12335
|
+
}
|
|
12336
|
+
}
|
|
12337
|
+
return null;
|
|
12338
|
+
}
|
|
12339
|
+
case "keyvalue": {
|
|
12340
|
+
if (typeof value !== "object" || value === null || Array.isArray(value)) {
|
|
12341
|
+
return `${field.label} must be a key/value map`;
|
|
12342
|
+
}
|
|
12343
|
+
const allowed = field.valueOptions?.map((o) => o.value);
|
|
12344
|
+
for (const [k2, v2] of Object.entries(value)) {
|
|
12345
|
+
if (typeof v2 !== "string") return `${field.label}: "${k2}" must be a string`;
|
|
12346
|
+
if (allowed && !allowed.includes(v2)) {
|
|
12347
|
+
return `${field.label}: "${k2}" must be one of ${allowed.join(", ")}`;
|
|
12348
|
+
}
|
|
12349
|
+
}
|
|
12350
|
+
return null;
|
|
12351
|
+
}
|
|
12352
|
+
case "document":
|
|
12353
|
+
return null;
|
|
12354
|
+
// opaque to fancy-flow — the host's editor owns its shape
|
|
12355
|
+
default:
|
|
12356
|
+
return null;
|
|
12357
|
+
}
|
|
12358
|
+
}
|
|
12359
|
+
function categoryAccent(category) {
|
|
12360
|
+
switch (category) {
|
|
12361
|
+
case "trigger":
|
|
12362
|
+
return "#10b981";
|
|
12363
|
+
case "logic":
|
|
12364
|
+
return "#f59e0b";
|
|
12365
|
+
case "data":
|
|
12366
|
+
return "#0ea5e9";
|
|
12367
|
+
case "ai":
|
|
12368
|
+
return "#8b5cf6";
|
|
12369
|
+
case "io":
|
|
12370
|
+
return "#3b82f6";
|
|
12371
|
+
case "human":
|
|
12372
|
+
return "#ec4899";
|
|
12373
|
+
case "output":
|
|
12374
|
+
return "#a855f7";
|
|
12375
|
+
case "layout":
|
|
12376
|
+
return "#64748b";
|
|
12377
|
+
case "annotation":
|
|
12378
|
+
return "#eab308";
|
|
12379
|
+
default:
|
|
12380
|
+
return "#71717a";
|
|
12381
|
+
}
|
|
12382
|
+
}
|
|
12374
12383
|
function NodeShellInner({
|
|
12375
12384
|
node,
|
|
12376
12385
|
accent,
|
|
@@ -15216,7 +15225,9 @@ function FlowViewer({
|
|
|
15216
15225
|
return {
|
|
15217
15226
|
node,
|
|
15218
15227
|
index: index2,
|
|
15219
|
-
|
|
15228
|
+
// The node's own label is the name the AUTHOR gave THIS node ("Summarize");
|
|
15229
|
+
// the kind label is the generic type name ("LLM Call"). Specific wins.
|
|
15230
|
+
title: node.data?.label ?? kind?.label ?? node.data?.kind ?? node.id,
|
|
15220
15231
|
description: kind?.description ?? null,
|
|
15221
15232
|
accent: kind?.accent ?? categoryAccent(kind?.category ?? "custom"),
|
|
15222
15233
|
status: statuses?.[node.id] ?? null
|
|
@@ -15494,7 +15505,7 @@ function evaluateConfig(config, context) {
|
|
|
15494
15505
|
}
|
|
15495
15506
|
|
|
15496
15507
|
// src/index.ts
|
|
15497
|
-
|
|
15508
|
+
ensureBuiltinKinds();
|
|
15498
15509
|
/*! Bundled license information:
|
|
15499
15510
|
|
|
15500
15511
|
@dagrejs/dagre/dist/dagre.esm.js:
|
|
@@ -15546,6 +15557,7 @@ exports.defineNode = defineNode;
|
|
|
15546
15557
|
exports.describeExpressionGrammar = describeExpressionGrammar;
|
|
15547
15558
|
exports.distributeNodes = distributeNodes;
|
|
15548
15559
|
exports.encodePause = encodePause;
|
|
15560
|
+
exports.ensureBuiltinKinds = ensureBuiltinKinds;
|
|
15549
15561
|
exports.evaluateConfig = evaluateConfig;
|
|
15550
15562
|
exports.evaluateExpression = evaluateExpression;
|
|
15551
15563
|
exports.exportWorkflow = exportWorkflow;
|