@goplasmatic/dataflow-ui 2.0.16 → 2.0.18
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/index.cjs +12 -21
- package/dist/index.d.ts +3 -1
- package/dist/index.js +12 -21
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -457,12 +457,13 @@ const X = createLucideIcon("X", [
|
|
|
457
457
|
["path", { d: "m6 6 12 12", key: "d8bk6v" }]
|
|
458
458
|
]);
|
|
459
459
|
function isBuiltinFunction(name) {
|
|
460
|
-
return name === "map" || name === "validation";
|
|
460
|
+
return name === "map" || name === "validation" || name === "validate";
|
|
461
461
|
}
|
|
462
462
|
function getFunctionDisplayInfo(name) {
|
|
463
463
|
switch (name) {
|
|
464
464
|
case "map":
|
|
465
465
|
return { label: "Map", colorClass: "df-function-badge-map", Icon: ArrowRightLeft };
|
|
466
|
+
case "validate":
|
|
466
467
|
case "validation":
|
|
467
468
|
return { label: "Validation", colorClass: "df-function-badge-validation", Icon: CircleCheckBig };
|
|
468
469
|
default:
|
|
@@ -31864,7 +31865,7 @@ function getTaskSubtitle(task) {
|
|
|
31864
31865
|
return `${count} mapping${count !== 1 ? "s" : ""}`;
|
|
31865
31866
|
}
|
|
31866
31867
|
}
|
|
31867
|
-
if (fn.name === "validation" && fn.input) {
|
|
31868
|
+
if ((fn.name === "validation" || fn.name === "validate") && fn.input) {
|
|
31868
31869
|
const input = fn.input;
|
|
31869
31870
|
if (input.rules) {
|
|
31870
31871
|
const count = input.rules.length;
|
|
@@ -32473,14 +32474,12 @@ function WorkflowFlowView({
|
|
|
32473
32474
|
}
|
|
32474
32475
|
function DataLogicView({ value, data }) {
|
|
32475
32476
|
const { resolvedTheme } = useTheme();
|
|
32476
|
-
const [preserveStructure, setPreserveStructure] = React.useState(true);
|
|
32477
32477
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "df-details-content", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "df-details-logic-editor", "data-theme": resolvedTheme, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
32478
32478
|
DataLogicEditor,
|
|
32479
32479
|
{
|
|
32480
32480
|
value,
|
|
32481
32481
|
theme: resolvedTheme,
|
|
32482
|
-
preserveStructure,
|
|
32483
|
-
onPreserveStructureChange: setPreserveStructure,
|
|
32482
|
+
preserveStructure: true,
|
|
32484
32483
|
className: "df-datalogic-viewer",
|
|
32485
32484
|
data
|
|
32486
32485
|
}
|
|
@@ -32497,7 +32496,6 @@ function TaskContent({ selection: selection2 }) {
|
|
|
32497
32496
|
const { task } = selection2;
|
|
32498
32497
|
const { resolvedTheme } = useTheme();
|
|
32499
32498
|
const dbgContext = useDebuggerOptional();
|
|
32500
|
-
const [preserveStructure, setPreserveStructure] = React.useState(true);
|
|
32501
32499
|
const functionName = task.function.name;
|
|
32502
32500
|
const input = task.function.input;
|
|
32503
32501
|
let debugData;
|
|
@@ -32506,7 +32504,7 @@ function TaskContent({ selection: selection2 }) {
|
|
|
32506
32504
|
if (step.workflow_id === selection2.workflow.id && step.task_id === task.id && step.result === "executed") {
|
|
32507
32505
|
if (functionName === "map") {
|
|
32508
32506
|
debugData = getMappingContext(step, 0);
|
|
32509
|
-
} else if (functionName === "validation" && step.message) {
|
|
32507
|
+
} else if ((functionName === "validation" || functionName === "validate") && step.message) {
|
|
32510
32508
|
debugData = step.message.context;
|
|
32511
32509
|
}
|
|
32512
32510
|
}
|
|
@@ -32519,14 +32517,13 @@ function TaskContent({ selection: selection2 }) {
|
|
|
32519
32517
|
{
|
|
32520
32518
|
value: visualData,
|
|
32521
32519
|
theme: resolvedTheme,
|
|
32522
|
-
preserveStructure,
|
|
32523
|
-
onPreserveStructureChange: setPreserveStructure,
|
|
32520
|
+
preserveStructure: true,
|
|
32524
32521
|
className: "df-datalogic-viewer",
|
|
32525
32522
|
data: debugData
|
|
32526
32523
|
}
|
|
32527
32524
|
) }) });
|
|
32528
32525
|
}
|
|
32529
|
-
if (functionName === "validation") {
|
|
32526
|
+
if (functionName === "validation" || functionName === "validate") {
|
|
32530
32527
|
const rules = (input == null ? void 0 : input.rules) || [];
|
|
32531
32528
|
const andExpression = {
|
|
32532
32529
|
and: rules.map((rule) => rule.logic)
|
|
@@ -32536,8 +32533,7 @@ function TaskContent({ selection: selection2 }) {
|
|
|
32536
32533
|
{
|
|
32537
32534
|
value: andExpression,
|
|
32538
32535
|
theme: resolvedTheme,
|
|
32539
|
-
preserveStructure,
|
|
32540
|
-
onPreserveStructureChange: setPreserveStructure,
|
|
32536
|
+
preserveStructure: true,
|
|
32541
32537
|
className: "df-datalogic-viewer",
|
|
32542
32538
|
data: debugData
|
|
32543
32539
|
}
|
|
@@ -32548,8 +32544,7 @@ function TaskContent({ selection: selection2 }) {
|
|
|
32548
32544
|
{
|
|
32549
32545
|
value: task.function.input,
|
|
32550
32546
|
theme: resolvedTheme,
|
|
32551
|
-
preserveStructure,
|
|
32552
|
-
onPreserveStructureChange: setPreserveStructure,
|
|
32547
|
+
preserveStructure: true,
|
|
32553
32548
|
className: "df-datalogic-viewer"
|
|
32554
32549
|
}
|
|
32555
32550
|
) }) });
|
|
@@ -32558,7 +32553,6 @@ function MappingContent({ selection: selection2 }) {
|
|
|
32558
32553
|
const { mapping } = selection2;
|
|
32559
32554
|
const { resolvedTheme } = useTheme();
|
|
32560
32555
|
const dbgContext = useDebuggerOptional();
|
|
32561
|
-
const [preserveStructure, setPreserveStructure] = React.useState(true);
|
|
32562
32556
|
const visualData = {
|
|
32563
32557
|
[mapping.path]: mapping.logic
|
|
32564
32558
|
};
|
|
@@ -32574,8 +32568,7 @@ function MappingContent({ selection: selection2 }) {
|
|
|
32574
32568
|
{
|
|
32575
32569
|
value: visualData,
|
|
32576
32570
|
theme: resolvedTheme,
|
|
32577
|
-
preserveStructure,
|
|
32578
|
-
onPreserveStructureChange: setPreserveStructure,
|
|
32571
|
+
preserveStructure: true,
|
|
32579
32572
|
className: "df-datalogic-viewer",
|
|
32580
32573
|
data: debugData
|
|
32581
32574
|
}
|
|
@@ -32585,7 +32578,6 @@ function ValidationRuleContent({ selection: selection2 }) {
|
|
|
32585
32578
|
const { rule } = selection2;
|
|
32586
32579
|
const { resolvedTheme } = useTheme();
|
|
32587
32580
|
const dbgContext = useDebuggerOptional();
|
|
32588
|
-
const [preserveStructure, setPreserveStructure] = React.useState(true);
|
|
32589
32581
|
let debugData;
|
|
32590
32582
|
if ((dbgContext == null ? void 0 : dbgContext.state.isActive) && dbgContext.currentStep) {
|
|
32591
32583
|
const step = dbgContext.currentStep;
|
|
@@ -32598,8 +32590,7 @@ function ValidationRuleContent({ selection: selection2 }) {
|
|
|
32598
32590
|
{
|
|
32599
32591
|
value: rule.logic,
|
|
32600
32592
|
theme: resolvedTheme,
|
|
32601
|
-
preserveStructure,
|
|
32602
|
-
onPreserveStructureChange: setPreserveStructure,
|
|
32593
|
+
preserveStructure: true,
|
|
32603
32594
|
className: "df-datalogic-viewer",
|
|
32604
32595
|
data: debugData
|
|
32605
32596
|
}
|
|
@@ -37040,7 +37031,7 @@ function TaskNode({
|
|
|
37040
37031
|
const input = task.function.input;
|
|
37041
37032
|
const hasCondition2 = task.condition !== void 0 && task.condition !== null && task.condition !== true;
|
|
37042
37033
|
const mappings = functionName === "map" ? (input == null ? void 0 : input.mappings) || [] : [];
|
|
37043
|
-
const rules = functionName === "validation" ? (input == null ? void 0 : input.rules) || [] : [];
|
|
37034
|
+
const rules = functionName === "validation" || functionName === "validate" ? (input == null ? void 0 : input.rules) || [] : [];
|
|
37044
37035
|
const hasChildren = hasCondition2 || mappings.length > 0 || rules.length > 0;
|
|
37045
37036
|
const isTaskSelected = selection2.type === "task" && selection2.task.id === task.id && selection2.workflow.id === workflow.id;
|
|
37046
37037
|
const taskDebugState = useTaskDebugState(task, workflow);
|
package/dist/index.d.ts
CHANGED
|
@@ -26,7 +26,7 @@ export declare interface AuditTrail {
|
|
|
26
26
|
/**
|
|
27
27
|
* Built-in function types
|
|
28
28
|
*/
|
|
29
|
-
export declare type BuiltinFunctionType = 'map' | 'validation';
|
|
29
|
+
export declare type BuiltinFunctionType = 'map' | 'validation' | 'validate';
|
|
30
30
|
|
|
31
31
|
/**
|
|
32
32
|
* A single change in the audit trail
|
|
@@ -725,6 +725,8 @@ export declare interface ValidationRule {
|
|
|
725
725
|
logic: JsonLogicValue;
|
|
726
726
|
/** Error message if validation fails */
|
|
727
727
|
message: string;
|
|
728
|
+
/** Optional path for the validation target */
|
|
729
|
+
path?: string;
|
|
728
730
|
}
|
|
729
731
|
|
|
730
732
|
export { WasmEngineAdapter }
|
package/dist/index.js
CHANGED
|
@@ -455,12 +455,13 @@ const X = createLucideIcon("X", [
|
|
|
455
455
|
["path", { d: "m6 6 12 12", key: "d8bk6v" }]
|
|
456
456
|
]);
|
|
457
457
|
function isBuiltinFunction(name) {
|
|
458
|
-
return name === "map" || name === "validation";
|
|
458
|
+
return name === "map" || name === "validation" || name === "validate";
|
|
459
459
|
}
|
|
460
460
|
function getFunctionDisplayInfo(name) {
|
|
461
461
|
switch (name) {
|
|
462
462
|
case "map":
|
|
463
463
|
return { label: "Map", colorClass: "df-function-badge-map", Icon: ArrowRightLeft };
|
|
464
|
+
case "validate":
|
|
464
465
|
case "validation":
|
|
465
466
|
return { label: "Validation", colorClass: "df-function-badge-validation", Icon: CircleCheckBig };
|
|
466
467
|
default:
|
|
@@ -31862,7 +31863,7 @@ function getTaskSubtitle(task) {
|
|
|
31862
31863
|
return `${count} mapping${count !== 1 ? "s" : ""}`;
|
|
31863
31864
|
}
|
|
31864
31865
|
}
|
|
31865
|
-
if (fn.name === "validation" && fn.input) {
|
|
31866
|
+
if ((fn.name === "validation" || fn.name === "validate") && fn.input) {
|
|
31866
31867
|
const input = fn.input;
|
|
31867
31868
|
if (input.rules) {
|
|
31868
31869
|
const count = input.rules.length;
|
|
@@ -32471,14 +32472,12 @@ function WorkflowFlowView({
|
|
|
32471
32472
|
}
|
|
32472
32473
|
function DataLogicView({ value, data }) {
|
|
32473
32474
|
const { resolvedTheme } = useTheme();
|
|
32474
|
-
const [preserveStructure, setPreserveStructure] = useState(true);
|
|
32475
32475
|
return /* @__PURE__ */ jsx("div", { className: "df-details-content", children: /* @__PURE__ */ jsx("div", { className: "df-details-logic-editor", "data-theme": resolvedTheme, children: /* @__PURE__ */ jsx(
|
|
32476
32476
|
DataLogicEditor,
|
|
32477
32477
|
{
|
|
32478
32478
|
value,
|
|
32479
32479
|
theme: resolvedTheme,
|
|
32480
|
-
preserveStructure,
|
|
32481
|
-
onPreserveStructureChange: setPreserveStructure,
|
|
32480
|
+
preserveStructure: true,
|
|
32482
32481
|
className: "df-datalogic-viewer",
|
|
32483
32482
|
data
|
|
32484
32483
|
}
|
|
@@ -32495,7 +32494,6 @@ function TaskContent({ selection: selection2 }) {
|
|
|
32495
32494
|
const { task } = selection2;
|
|
32496
32495
|
const { resolvedTheme } = useTheme();
|
|
32497
32496
|
const dbgContext = useDebuggerOptional();
|
|
32498
|
-
const [preserveStructure, setPreserveStructure] = useState(true);
|
|
32499
32497
|
const functionName = task.function.name;
|
|
32500
32498
|
const input = task.function.input;
|
|
32501
32499
|
let debugData;
|
|
@@ -32504,7 +32502,7 @@ function TaskContent({ selection: selection2 }) {
|
|
|
32504
32502
|
if (step.workflow_id === selection2.workflow.id && step.task_id === task.id && step.result === "executed") {
|
|
32505
32503
|
if (functionName === "map") {
|
|
32506
32504
|
debugData = getMappingContext(step, 0);
|
|
32507
|
-
} else if (functionName === "validation" && step.message) {
|
|
32505
|
+
} else if ((functionName === "validation" || functionName === "validate") && step.message) {
|
|
32508
32506
|
debugData = step.message.context;
|
|
32509
32507
|
}
|
|
32510
32508
|
}
|
|
@@ -32517,14 +32515,13 @@ function TaskContent({ selection: selection2 }) {
|
|
|
32517
32515
|
{
|
|
32518
32516
|
value: visualData,
|
|
32519
32517
|
theme: resolvedTheme,
|
|
32520
|
-
preserveStructure,
|
|
32521
|
-
onPreserveStructureChange: setPreserveStructure,
|
|
32518
|
+
preserveStructure: true,
|
|
32522
32519
|
className: "df-datalogic-viewer",
|
|
32523
32520
|
data: debugData
|
|
32524
32521
|
}
|
|
32525
32522
|
) }) });
|
|
32526
32523
|
}
|
|
32527
|
-
if (functionName === "validation") {
|
|
32524
|
+
if (functionName === "validation" || functionName === "validate") {
|
|
32528
32525
|
const rules = (input == null ? void 0 : input.rules) || [];
|
|
32529
32526
|
const andExpression = {
|
|
32530
32527
|
and: rules.map((rule) => rule.logic)
|
|
@@ -32534,8 +32531,7 @@ function TaskContent({ selection: selection2 }) {
|
|
|
32534
32531
|
{
|
|
32535
32532
|
value: andExpression,
|
|
32536
32533
|
theme: resolvedTheme,
|
|
32537
|
-
preserveStructure,
|
|
32538
|
-
onPreserveStructureChange: setPreserveStructure,
|
|
32534
|
+
preserveStructure: true,
|
|
32539
32535
|
className: "df-datalogic-viewer",
|
|
32540
32536
|
data: debugData
|
|
32541
32537
|
}
|
|
@@ -32546,8 +32542,7 @@ function TaskContent({ selection: selection2 }) {
|
|
|
32546
32542
|
{
|
|
32547
32543
|
value: task.function.input,
|
|
32548
32544
|
theme: resolvedTheme,
|
|
32549
|
-
preserveStructure,
|
|
32550
|
-
onPreserveStructureChange: setPreserveStructure,
|
|
32545
|
+
preserveStructure: true,
|
|
32551
32546
|
className: "df-datalogic-viewer"
|
|
32552
32547
|
}
|
|
32553
32548
|
) }) });
|
|
@@ -32556,7 +32551,6 @@ function MappingContent({ selection: selection2 }) {
|
|
|
32556
32551
|
const { mapping } = selection2;
|
|
32557
32552
|
const { resolvedTheme } = useTheme();
|
|
32558
32553
|
const dbgContext = useDebuggerOptional();
|
|
32559
|
-
const [preserveStructure, setPreserveStructure] = useState(true);
|
|
32560
32554
|
const visualData = {
|
|
32561
32555
|
[mapping.path]: mapping.logic
|
|
32562
32556
|
};
|
|
@@ -32572,8 +32566,7 @@ function MappingContent({ selection: selection2 }) {
|
|
|
32572
32566
|
{
|
|
32573
32567
|
value: visualData,
|
|
32574
32568
|
theme: resolvedTheme,
|
|
32575
|
-
preserveStructure,
|
|
32576
|
-
onPreserveStructureChange: setPreserveStructure,
|
|
32569
|
+
preserveStructure: true,
|
|
32577
32570
|
className: "df-datalogic-viewer",
|
|
32578
32571
|
data: debugData
|
|
32579
32572
|
}
|
|
@@ -32583,7 +32576,6 @@ function ValidationRuleContent({ selection: selection2 }) {
|
|
|
32583
32576
|
const { rule } = selection2;
|
|
32584
32577
|
const { resolvedTheme } = useTheme();
|
|
32585
32578
|
const dbgContext = useDebuggerOptional();
|
|
32586
|
-
const [preserveStructure, setPreserveStructure] = useState(true);
|
|
32587
32579
|
let debugData;
|
|
32588
32580
|
if ((dbgContext == null ? void 0 : dbgContext.state.isActive) && dbgContext.currentStep) {
|
|
32589
32581
|
const step = dbgContext.currentStep;
|
|
@@ -32596,8 +32588,7 @@ function ValidationRuleContent({ selection: selection2 }) {
|
|
|
32596
32588
|
{
|
|
32597
32589
|
value: rule.logic,
|
|
32598
32590
|
theme: resolvedTheme,
|
|
32599
|
-
preserveStructure,
|
|
32600
|
-
onPreserveStructureChange: setPreserveStructure,
|
|
32591
|
+
preserveStructure: true,
|
|
32601
32592
|
className: "df-datalogic-viewer",
|
|
32602
32593
|
data: debugData
|
|
32603
32594
|
}
|
|
@@ -37038,7 +37029,7 @@ function TaskNode({
|
|
|
37038
37029
|
const input = task.function.input;
|
|
37039
37030
|
const hasCondition2 = task.condition !== void 0 && task.condition !== null && task.condition !== true;
|
|
37040
37031
|
const mappings = functionName === "map" ? (input == null ? void 0 : input.mappings) || [] : [];
|
|
37041
|
-
const rules = functionName === "validation" ? (input == null ? void 0 : input.rules) || [] : [];
|
|
37032
|
+
const rules = functionName === "validation" || functionName === "validate" ? (input == null ? void 0 : input.rules) || [] : [];
|
|
37042
37033
|
const hasChildren = hasCondition2 || mappings.length > 0 || rules.length > 0;
|
|
37043
37034
|
const isTaskSelected = selection2.type === "task" && selection2.task.id === task.id && selection2.workflow.id === workflow.id;
|
|
37044
37035
|
const taskDebugState = useTaskDebugState(task, workflow);
|
package/package.json
CHANGED