@proveanything/smartlinks-utils-ui 0.1.7 → 0.1.8
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/{chunk-YVHF5JBL.js → chunk-ILQNQN27.js} +181 -119
- package/dist/chunk-ILQNQN27.js.map +1 -0
- package/dist/components/ConditionsEditor/index.js +1 -1
- package/dist/index.css +22 -26
- package/dist/index.css.map +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-YVHF5JBL.js.map +0 -1
|
@@ -524,40 +524,120 @@ var CountryPicker = ({
|
|
|
524
524
|
}) })
|
|
525
525
|
] });
|
|
526
526
|
};
|
|
527
|
-
var ContainsToggle = ({ value = true, onChange, trueLabel = "Is One Of", falseLabel = "Is Not One Of", disabled }) => /* @__PURE__ */ jsx("div", {
|
|
527
|
+
var ContainsToggle = ({ value = true, onChange, trueLabel = "Is One Of", falseLabel = "Is Not One Of", disabled }) => /* @__PURE__ */ jsx("div", { style: { display: "flex", gap: 4, backgroundColor: "#f3f4f6", borderRadius: 6, padding: 4, width: "fit-content" }, children: [{ v: true, label: trueLabel }, { v: false, label: falseLabel }].map((opt) => /* @__PURE__ */ jsx(
|
|
528
528
|
"button",
|
|
529
529
|
{
|
|
530
|
+
type: "button",
|
|
530
531
|
onClick: () => onChange(opt.v),
|
|
531
532
|
disabled,
|
|
532
|
-
|
|
533
|
-
"
|
|
534
|
-
|
|
535
|
-
|
|
533
|
+
style: {
|
|
534
|
+
padding: "6px 12px",
|
|
535
|
+
fontSize: 12,
|
|
536
|
+
fontWeight: 600,
|
|
537
|
+
borderRadius: 4,
|
|
538
|
+
border: "none",
|
|
539
|
+
cursor: disabled ? "default" : "pointer",
|
|
540
|
+
transition: "all 0.15s",
|
|
541
|
+
...value === opt.v ? { backgroundColor: "#3b82f6", color: "#ffffff", boxShadow: "0 1px 2px rgba(0,0,0,0.1)" } : { backgroundColor: "transparent", color: "#6b7280" }
|
|
542
|
+
},
|
|
536
543
|
children: opt.label
|
|
537
544
|
},
|
|
538
545
|
String(opt.v)
|
|
539
546
|
)) });
|
|
540
|
-
var
|
|
547
|
+
var ToggleSwitch = ({ checked, onChange, label, disabled }) => /* @__PURE__ */ jsxs("label", { style: { display: "flex", alignItems: "center", gap: 8, fontSize: 12, fontWeight: 500, color: "#4b5563", cursor: "pointer", userSelect: "none" }, children: [
|
|
548
|
+
/* @__PURE__ */ jsx(
|
|
549
|
+
"button",
|
|
550
|
+
{
|
|
551
|
+
type: "button",
|
|
552
|
+
onClick: () => onChange(!checked),
|
|
553
|
+
disabled,
|
|
554
|
+
style: {
|
|
555
|
+
width: 36,
|
|
556
|
+
height: 20,
|
|
557
|
+
borderRadius: 10,
|
|
558
|
+
border: "none",
|
|
559
|
+
cursor: disabled ? "default" : "pointer",
|
|
560
|
+
position: "relative",
|
|
561
|
+
flexShrink: 0,
|
|
562
|
+
transition: "background-color 0.2s",
|
|
563
|
+
backgroundColor: checked ? "#3b82f6" : "#d1d5db"
|
|
564
|
+
},
|
|
565
|
+
children: /* @__PURE__ */ jsx("span", { style: {
|
|
566
|
+
position: "absolute",
|
|
567
|
+
top: 2,
|
|
568
|
+
width: 16,
|
|
569
|
+
height: 16,
|
|
570
|
+
borderRadius: "50%",
|
|
571
|
+
backgroundColor: "#ffffff",
|
|
572
|
+
boxShadow: "0 1px 3px rgba(0,0,0,0.2)",
|
|
573
|
+
transition: "transform 0.2s",
|
|
574
|
+
transform: checked ? "translateX(18px)" : "translateX(2px)"
|
|
575
|
+
} })
|
|
576
|
+
}
|
|
577
|
+
),
|
|
578
|
+
label
|
|
579
|
+
] });
|
|
580
|
+
var ChipSelect = ({ options, selected, onChange, disabled }) => /* @__PURE__ */ jsx("div", { style: { display: "flex", flexWrap: "wrap", gap: 6 }, children: options.map((opt) => {
|
|
541
581
|
const isSelected = selected.includes(opt.value);
|
|
542
582
|
return /* @__PURE__ */ jsx(
|
|
543
583
|
"button",
|
|
544
584
|
{
|
|
585
|
+
type: "button",
|
|
545
586
|
onClick: () => {
|
|
546
587
|
if (disabled) return;
|
|
547
588
|
onChange(isSelected ? selected.filter((v) => v !== opt.value) : [...selected, opt.value]);
|
|
548
589
|
},
|
|
549
590
|
disabled,
|
|
550
591
|
title: opt.description,
|
|
551
|
-
|
|
552
|
-
"
|
|
553
|
-
|
|
554
|
-
|
|
592
|
+
style: {
|
|
593
|
+
padding: "4px 10px",
|
|
594
|
+
fontSize: 12,
|
|
595
|
+
borderRadius: 9999,
|
|
596
|
+
border: "1px solid",
|
|
597
|
+
cursor: disabled ? "default" : "pointer",
|
|
598
|
+
transition: "all 0.15s",
|
|
599
|
+
...isSelected ? { backgroundColor: "#dbeafe", borderColor: "#93c5fd", color: "#1d4ed8" } : { backgroundColor: "transparent", borderColor: "#e5e7eb", color: "#6b7280" }
|
|
600
|
+
},
|
|
555
601
|
children: opt.title
|
|
556
602
|
},
|
|
557
603
|
opt.value
|
|
558
604
|
);
|
|
559
605
|
}) });
|
|
560
|
-
var
|
|
606
|
+
var inputStyle = {
|
|
607
|
+
width: "100%",
|
|
608
|
+
padding: "6px 10px",
|
|
609
|
+
fontSize: 14,
|
|
610
|
+
borderRadius: 6,
|
|
611
|
+
border: "1px solid #d1d5db",
|
|
612
|
+
backgroundColor: "transparent",
|
|
613
|
+
outline: "none"
|
|
614
|
+
};
|
|
615
|
+
var labelStyle = {
|
|
616
|
+
fontSize: 10,
|
|
617
|
+
color: "#9ca3af",
|
|
618
|
+
marginBottom: 2,
|
|
619
|
+
display: "block"
|
|
620
|
+
};
|
|
621
|
+
var PillGroup = ({ options, selected, onChange, disabled }) => /* @__PURE__ */ jsx("div", { style: { display: "flex", gap: 4, backgroundColor: "#f3f4f6", borderRadius: 6, padding: 4, width: "fit-content" }, children: options.map((opt) => /* @__PURE__ */ jsx(
|
|
622
|
+
"button",
|
|
623
|
+
{
|
|
624
|
+
type: "button",
|
|
625
|
+
onClick: () => onChange(opt.value),
|
|
626
|
+
disabled,
|
|
627
|
+
style: {
|
|
628
|
+
padding: "6px 12px",
|
|
629
|
+
fontSize: 12,
|
|
630
|
+
fontWeight: 600,
|
|
631
|
+
borderRadius: 4,
|
|
632
|
+
border: "none",
|
|
633
|
+
cursor: disabled ? "default" : "pointer",
|
|
634
|
+
transition: "all 0.15s",
|
|
635
|
+
...selected === opt.value ? { backgroundColor: "#3b82f6", color: "#ffffff", boxShadow: "0 1px 2px rgba(0,0,0,0.1)" } : { backgroundColor: "transparent", color: "#6b7280" }
|
|
636
|
+
},
|
|
637
|
+
children: opt.label
|
|
638
|
+
},
|
|
639
|
+
opt.value
|
|
640
|
+
)) });
|
|
561
641
|
var ConditionConfig = ({
|
|
562
642
|
condition: cond,
|
|
563
643
|
onChange,
|
|
@@ -568,7 +648,7 @@ var ConditionConfig = ({
|
|
|
568
648
|
switch (cond.type) {
|
|
569
649
|
// ─── VERSION ──────────────────────────────────
|
|
570
650
|
case "version":
|
|
571
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
651
|
+
return /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 12 }, children: [
|
|
572
652
|
/* @__PURE__ */ jsx(ContainsToggle, { value: cond.contains, onChange: (v) => update({ contains: v }), disabled: readOnly }),
|
|
573
653
|
editorProps.versions?.length ? /* @__PURE__ */ jsx(
|
|
574
654
|
ChipSelect,
|
|
@@ -578,30 +658,21 @@ var ConditionConfig = ({
|
|
|
578
658
|
onChange: (vals) => update({ versions: vals.map((v) => ({ value: v, title: editorProps.versions?.find((o) => o.value === v)?.title || v })) }),
|
|
579
659
|
disabled: readOnly
|
|
580
660
|
}
|
|
581
|
-
) : /* @__PURE__ */ jsx("p", {
|
|
661
|
+
) : /* @__PURE__ */ jsx("p", { style: { fontSize: 12, color: "#9ca3af", fontStyle: "italic" }, children: "No versions available" })
|
|
582
662
|
] });
|
|
583
663
|
// ─── COUNTRY ──────────────────────────────────
|
|
584
664
|
case "country":
|
|
585
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
665
|
+
return /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 12 }, children: [
|
|
586
666
|
/* @__PURE__ */ jsx(ContainsToggle, { value: cond.contains, onChange: (v) => update({ contains: v }), disabled: readOnly }),
|
|
587
|
-
/* @__PURE__ */
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
),
|
|
597
|
-
children: /* @__PURE__ */ jsx("span", { className: cn(
|
|
598
|
-
"absolute top-0.5 w-4 h-4 rounded-full bg-white shadow transition-transform",
|
|
599
|
-
cond.useRegions ? "translate-x-4" : "translate-x-0.5"
|
|
600
|
-
) })
|
|
601
|
-
}
|
|
602
|
-
),
|
|
603
|
-
"Use regions"
|
|
604
|
-
] }),
|
|
667
|
+
/* @__PURE__ */ jsx(
|
|
668
|
+
ToggleSwitch,
|
|
669
|
+
{
|
|
670
|
+
checked: !!cond.useRegions,
|
|
671
|
+
onChange: (v) => update({ useRegions: v }),
|
|
672
|
+
label: "Use regions",
|
|
673
|
+
disabled: readOnly
|
|
674
|
+
}
|
|
675
|
+
),
|
|
605
676
|
cond.useRegions ? /* @__PURE__ */ jsx(
|
|
606
677
|
ChipSelect,
|
|
607
678
|
{
|
|
@@ -621,31 +692,31 @@ var ConditionConfig = ({
|
|
|
621
692
|
] });
|
|
622
693
|
// ─── VALUE ────────────────────────────────────
|
|
623
694
|
case "value":
|
|
624
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
625
|
-
/* @__PURE__ */ jsxs("div", {
|
|
695
|
+
return /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 12 }, children: [
|
|
696
|
+
/* @__PURE__ */ jsxs("div", { style: { display: "grid", gridTemplateColumns: "1fr 1fr", gap: 8 }, children: [
|
|
626
697
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
627
|
-
/* @__PURE__ */ jsx("label", {
|
|
628
|
-
/* @__PURE__ */ jsx("input", {
|
|
698
|
+
/* @__PURE__ */ jsx("label", { style: labelStyle, children: "Field Name" }),
|
|
699
|
+
/* @__PURE__ */ jsx("input", { style: inputStyle, value: cond.field || "", onChange: (e) => update({ field: e.target.value }), placeholder: "field_name", disabled: readOnly })
|
|
629
700
|
] }),
|
|
630
701
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
631
|
-
/* @__PURE__ */ jsx("label", {
|
|
632
|
-
/* @__PURE__ */ jsx("select", {
|
|
702
|
+
/* @__PURE__ */ jsx("label", { style: labelStyle, children: "Field Type" }),
|
|
703
|
+
/* @__PURE__ */ jsx("select", { style: inputStyle, value: cond.fieldType || "text", onChange: (e) => update({ fieldType: e.target.value }), disabled: readOnly, children: FIELD_TYPES.map((ft) => /* @__PURE__ */ jsx("option", { value: ft.value, children: ft.title }, ft.value)) })
|
|
633
704
|
] })
|
|
634
705
|
] }),
|
|
635
|
-
/* @__PURE__ */ jsxs("div", {
|
|
706
|
+
/* @__PURE__ */ jsxs("div", { style: { display: "grid", gridTemplateColumns: "1fr 1fr", gap: 8 }, children: [
|
|
636
707
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
637
|
-
/* @__PURE__ */ jsx("label", {
|
|
638
|
-
/* @__PURE__ */ jsx("select", {
|
|
708
|
+
/* @__PURE__ */ jsx("label", { style: labelStyle, children: "Operator" }),
|
|
709
|
+
/* @__PURE__ */ jsx("select", { style: inputStyle, value: cond.validationType || "equal", onChange: (e) => update({ validationType: e.target.value }), disabled: readOnly, children: VALUE_OPERATORS.map((op) => /* @__PURE__ */ jsx("option", { value: op.value, children: op.title }, op.value)) })
|
|
639
710
|
] }),
|
|
640
711
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
641
|
-
/* @__PURE__ */ jsx("label", {
|
|
642
|
-
/* @__PURE__ */ jsx("input", {
|
|
712
|
+
/* @__PURE__ */ jsx("label", { style: labelStyle, children: "Value" }),
|
|
713
|
+
/* @__PURE__ */ jsx("input", { style: inputStyle, value: String(cond.value ?? ""), onChange: (e) => update({ value: e.target.value }), placeholder: "value", disabled: readOnly })
|
|
643
714
|
] })
|
|
644
715
|
] })
|
|
645
716
|
] });
|
|
646
717
|
// ─── USER ─────────────────────────────────────
|
|
647
718
|
case "user":
|
|
648
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
719
|
+
return /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 12 }, children: [
|
|
649
720
|
/* @__PURE__ */ jsx(
|
|
650
721
|
ChipSelect,
|
|
651
722
|
{
|
|
@@ -667,35 +738,32 @@ var ConditionConfig = ({
|
|
|
667
738
|
] });
|
|
668
739
|
// ─── DATE ─────────────────────────────────────
|
|
669
740
|
case "date":
|
|
670
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
671
|
-
/* @__PURE__ */ jsx(
|
|
672
|
-
|
|
741
|
+
return /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 12 }, children: [
|
|
742
|
+
/* @__PURE__ */ jsx(
|
|
743
|
+
PillGroup,
|
|
673
744
|
{
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
},
|
|
685
|
-
dt
|
|
686
|
-
)) }),
|
|
745
|
+
options: [
|
|
746
|
+
{ value: "before", label: "Is Before" },
|
|
747
|
+
{ value: "after", label: "Is After" },
|
|
748
|
+
{ value: "between", label: "Is Between" }
|
|
749
|
+
],
|
|
750
|
+
selected: cond.dateTest,
|
|
751
|
+
onChange: (v) => update({ dateTest: v }),
|
|
752
|
+
disabled: readOnly
|
|
753
|
+
}
|
|
754
|
+
),
|
|
687
755
|
(cond.dateTest === "before" || cond.dateTest === "between") && /* @__PURE__ */ jsxs("div", { children: [
|
|
688
|
-
/* @__PURE__ */ jsx("label", {
|
|
689
|
-
/* @__PURE__ */ jsx("input", { type: "date",
|
|
756
|
+
/* @__PURE__ */ jsx("label", { style: labelStyle, children: cond.dateTest === "between" ? "Start Date" : "Before Date" }),
|
|
757
|
+
/* @__PURE__ */ jsx("input", { type: "date", style: inputStyle, value: cond.beforeDate || "", onChange: (e) => update({ beforeDate: e.target.value }), disabled: readOnly })
|
|
690
758
|
] }),
|
|
691
759
|
(cond.dateTest === "after" || cond.dateTest === "between") && /* @__PURE__ */ jsxs("div", { children: [
|
|
692
|
-
/* @__PURE__ */ jsx("label", {
|
|
693
|
-
/* @__PURE__ */ jsx("input", { type: "date",
|
|
760
|
+
/* @__PURE__ */ jsx("label", { style: labelStyle, children: cond.dateTest === "between" ? "End Date" : "After Date" }),
|
|
761
|
+
/* @__PURE__ */ jsx("input", { type: "date", style: inputStyle, value: cond.afterDate || "", onChange: (e) => update({ afterDate: e.target.value }), disabled: readOnly })
|
|
694
762
|
] })
|
|
695
763
|
] });
|
|
696
764
|
// ─── DEVICE ───────────────────────────────────
|
|
697
765
|
case "device":
|
|
698
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
766
|
+
return /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 12 }, children: [
|
|
699
767
|
/* @__PURE__ */ jsx(ContainsToggle, { value: cond.contains, onChange: (v) => update({ contains: v }), disabled: readOnly }),
|
|
700
768
|
/* @__PURE__ */ jsx(
|
|
701
769
|
ChipSelect,
|
|
@@ -709,7 +777,7 @@ var ConditionConfig = ({
|
|
|
709
777
|
] });
|
|
710
778
|
// ─── TAG ──────────────────────────────────────
|
|
711
779
|
case "tag":
|
|
712
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
780
|
+
return /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 12 }, children: [
|
|
713
781
|
/* @__PURE__ */ jsx(ContainsToggle, { value: cond.contains, onChange: (v) => update({ contains: v }), disabled: readOnly }),
|
|
714
782
|
editorProps.tags?.length ? /* @__PURE__ */ jsx(
|
|
715
783
|
ChipSelect,
|
|
@@ -719,25 +787,25 @@ var ConditionConfig = ({
|
|
|
719
787
|
onChange: (vals) => update({ tags: vals }),
|
|
720
788
|
disabled: readOnly
|
|
721
789
|
}
|
|
722
|
-
) : /* @__PURE__ */ jsx("input", {
|
|
790
|
+
) : /* @__PURE__ */ jsx("input", { style: inputStyle, value: (cond.tags || []).join(", "), onChange: (e) => update({ tags: e.target.value.split(",").map((s) => s.trim()).filter(Boolean) }), placeholder: "tag1, tag2, \u2026", disabled: readOnly })
|
|
723
791
|
] });
|
|
724
792
|
// ─── GEOFENCE ─────────────────────────────────
|
|
725
793
|
case "geofence":
|
|
726
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
794
|
+
return /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 12 }, children: [
|
|
727
795
|
/* @__PURE__ */ jsx(ContainsToggle, { value: cond.contains, onChange: (v) => update({ contains: v }), trueLabel: "Is Inside Of", falseLabel: "Is Outside Of", disabled: readOnly }),
|
|
728
|
-
/* @__PURE__ */ jsx("div", {
|
|
796
|
+
/* @__PURE__ */ jsx("div", { style: { display: "grid", gridTemplateColumns: "1fr 1fr", gap: 8 }, children: [
|
|
729
797
|
{ label: "Latitude 1 (NW)", key: "lat1" },
|
|
730
798
|
{ label: "Longitude 1 (NW)", key: "lng1" },
|
|
731
799
|
{ label: "Latitude 2 (SE)", key: "lat2" },
|
|
732
800
|
{ label: "Longitude 2 (SE)", key: "lng2" }
|
|
733
801
|
].map((f) => /* @__PURE__ */ jsxs("div", { children: [
|
|
734
|
-
/* @__PURE__ */ jsx("label", {
|
|
802
|
+
/* @__PURE__ */ jsx("label", { style: labelStyle, children: f.label }),
|
|
735
803
|
/* @__PURE__ */ jsx(
|
|
736
804
|
"input",
|
|
737
805
|
{
|
|
738
806
|
type: "number",
|
|
739
807
|
step: "any",
|
|
740
|
-
|
|
808
|
+
style: inputStyle,
|
|
741
809
|
value: cond[f.key] ?? "",
|
|
742
810
|
onChange: (e) => update({ [f.key]: e.target.value ? parseFloat(e.target.value) : void 0 }),
|
|
743
811
|
disabled: readOnly
|
|
@@ -747,7 +815,7 @@ var ConditionConfig = ({
|
|
|
747
815
|
] });
|
|
748
816
|
// ─── PRODUCT ──────────────────────────────────
|
|
749
817
|
case "product":
|
|
750
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
818
|
+
return /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 12 }, children: [
|
|
751
819
|
/* @__PURE__ */ jsx(ContainsToggle, { value: cond.contains, onChange: (v) => update({ contains: v }), disabled: readOnly }),
|
|
752
820
|
editorProps.products?.length ? /* @__PURE__ */ jsx(
|
|
753
821
|
ChipSelect,
|
|
@@ -757,7 +825,7 @@ var ConditionConfig = ({
|
|
|
757
825
|
onChange: (vals) => update({ productIds: vals }),
|
|
758
826
|
disabled: readOnly
|
|
759
827
|
}
|
|
760
|
-
) : /* @__PURE__ */ jsx("input", {
|
|
828
|
+
) : /* @__PURE__ */ jsx("input", { style: inputStyle, value: (cond.productIds || []).join(", "), onChange: (e) => update({ productIds: e.target.value.split(",").map((s) => s.trim()).filter(Boolean) }), placeholder: "product-id-1, product-id-2, \u2026", disabled: readOnly })
|
|
761
829
|
] });
|
|
762
830
|
// ─── ITEM STATUS ──────────────────────────────
|
|
763
831
|
case "itemStatus":
|
|
@@ -772,27 +840,26 @@ var ConditionConfig = ({
|
|
|
772
840
|
);
|
|
773
841
|
// ─── CONDITION REFERENCE ──────────────────────
|
|
774
842
|
case "condition":
|
|
775
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
776
|
-
editorProps.savedConditions?.length ? /* @__PURE__ */ jsxs("select", {
|
|
843
|
+
return /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 12 }, children: [
|
|
844
|
+
editorProps.savedConditions?.length ? /* @__PURE__ */ jsxs("select", { style: inputStyle, value: cond.conditionId || "", onChange: (e) => update({ conditionId: e.target.value }), disabled: readOnly, children: [
|
|
777
845
|
/* @__PURE__ */ jsx("option", { value: "", children: "Select a condition\u2026" }),
|
|
778
846
|
editorProps.savedConditions.map((c) => /* @__PURE__ */ jsx("option", { value: c.value, children: c.title }, c.value))
|
|
779
|
-
] }) : /* @__PURE__ */ jsx("input", {
|
|
780
|
-
/* @__PURE__ */ jsx(
|
|
781
|
-
|
|
847
|
+
] }) : /* @__PURE__ */ jsx("input", { style: inputStyle, value: cond.conditionId || "", onChange: (e) => update({ conditionId: e.target.value }), placeholder: "Condition ID", disabled: readOnly }),
|
|
848
|
+
/* @__PURE__ */ jsx(
|
|
849
|
+
PillGroup,
|
|
782
850
|
{
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
),
|
|
789
|
-
|
|
790
|
-
}
|
|
791
|
-
|
|
792
|
-
)) })
|
|
851
|
+
options: [
|
|
852
|
+
{ value: "true", label: "Passes" },
|
|
853
|
+
{ value: "false", label: "Fails" }
|
|
854
|
+
],
|
|
855
|
+
selected: cond.passes === true ? "true" : cond.passes === false ? "false" : void 0,
|
|
856
|
+
onChange: (v) => update({ passes: v === "true" }),
|
|
857
|
+
disabled: readOnly
|
|
858
|
+
}
|
|
859
|
+
)
|
|
793
860
|
] });
|
|
794
861
|
default:
|
|
795
|
-
return /* @__PURE__ */ jsx("p", {
|
|
862
|
+
return /* @__PURE__ */ jsx("p", { style: { fontSize: 12, color: "#9ca3af", fontStyle: "italic" }, children: "Unknown condition type" });
|
|
796
863
|
}
|
|
797
864
|
};
|
|
798
865
|
var ConditionCard = ({
|
|
@@ -1006,37 +1073,32 @@ var ConditionsEditorContent = ({
|
|
|
1006
1073
|
"Disabled / Hidden"
|
|
1007
1074
|
] })
|
|
1008
1075
|
] }),
|
|
1009
|
-
/* @__PURE__ */ jsxs("div", {
|
|
1010
|
-
/* @__PURE__ */ jsxs("div", {
|
|
1076
|
+
/* @__PURE__ */ jsxs("div", { style: { borderRadius: 8, border: "1px solid #e5e7eb", padding: 16 }, children: [
|
|
1077
|
+
/* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: 6, fontSize: 12, fontWeight: 500, color: "#6b7280", marginBottom: 12 }, children: [
|
|
1011
1078
|
/* @__PURE__ */ jsx(GitBranch, { className: "w-3.5 h-3.5" }),
|
|
1012
1079
|
"Logic Type"
|
|
1013
1080
|
] }),
|
|
1014
|
-
/* @__PURE__ */
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
),
|
|
1036
|
-
children: "Match ANY (OR)"
|
|
1037
|
-
}
|
|
1038
|
-
)
|
|
1039
|
-
] })
|
|
1081
|
+
/* @__PURE__ */ jsx("div", { style: { display: "flex", gap: 4, backgroundColor: "#f3f4f6", borderRadius: 6, padding: 4 }, children: [{ v: "and", l: "Match ALL (AND)" }, { v: "or", l: "Match ANY (OR)" }].map((opt) => /* @__PURE__ */ jsx(
|
|
1082
|
+
"button",
|
|
1083
|
+
{
|
|
1084
|
+
type: "button",
|
|
1085
|
+
onClick: () => toggleLogic(opt.v),
|
|
1086
|
+
disabled: readOnly,
|
|
1087
|
+
style: {
|
|
1088
|
+
flex: 1,
|
|
1089
|
+
padding: "8px 12px",
|
|
1090
|
+
fontSize: 14,
|
|
1091
|
+
fontWeight: 600,
|
|
1092
|
+
borderRadius: 4,
|
|
1093
|
+
border: "none",
|
|
1094
|
+
cursor: readOnly ? "default" : "pointer",
|
|
1095
|
+
transition: "all 0.15s",
|
|
1096
|
+
...value.type === opt.v ? { backgroundColor: "#3b82f6", color: "#ffffff", boxShadow: "0 1px 2px rgba(0,0,0,0.1)" } : { backgroundColor: "transparent", color: "#6b7280" }
|
|
1097
|
+
},
|
|
1098
|
+
children: opt.l
|
|
1099
|
+
},
|
|
1100
|
+
opt.v
|
|
1101
|
+
)) })
|
|
1040
1102
|
] }),
|
|
1041
1103
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
1042
1104
|
/* @__PURE__ */ jsx("p", { className: "text-sm font-semibold text-gray-700 dark:text-gray-300", children: "Conditions" }),
|
|
@@ -1096,5 +1158,5 @@ var ConditionsEditor = (props) => {
|
|
|
1096
1158
|
};
|
|
1097
1159
|
|
|
1098
1160
|
export { ConditionsEditor };
|
|
1099
|
-
//# sourceMappingURL=chunk-
|
|
1100
|
-
//# sourceMappingURL=chunk-
|
|
1161
|
+
//# sourceMappingURL=chunk-ILQNQN27.js.map
|
|
1162
|
+
//# sourceMappingURL=chunk-ILQNQN27.js.map
|