@ixo/editor 1.21.0 → 1.23.0
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-XEZXD5ZV.mjs → chunk-22UP3RB4.mjs} +954 -566
- package/dist/chunk-22UP3RB4.mjs.map +1 -0
- package/dist/index.d.ts +119 -25
- package/dist/index.mjs +3 -1
- package/dist/mantine/index.d.ts +1 -1
- package/dist/mantine/index.mjs +3 -1
- package/package.json +1 -1
- package/dist/chunk-XEZXD5ZV.mjs.map +0 -1
|
@@ -3545,58 +3545,144 @@ var ListBlockSpec = createReactBlockSpec2(
|
|
|
3545
3545
|
);
|
|
3546
3546
|
|
|
3547
3547
|
// src/mantine/blocks/overview/OverviewBlock.tsx
|
|
3548
|
-
import React44 from "react";
|
|
3548
|
+
import React44, { useEffect as useEffect7, useState as useState7 } from "react";
|
|
3549
3549
|
import { createReactBlockSpec as createReactBlockSpec3 } from "@blocknote/react";
|
|
3550
|
-
|
|
3550
|
+
import { Stack as Stack28, Text as Text28, Box as Box17, Loader as Loader3, Alert as Alert5, Group as Group9, Accordion as Accordion2, Collapse as Collapse2 } from "@mantine/core";
|
|
3551
|
+
import { IconChevronRight, IconChevronDown as IconChevronDown2, IconFileDescription, IconWorld, IconCalendar, IconUser, IconCircleCheck } from "@tabler/icons-react";
|
|
3552
|
+
import { useDisclosure as useDisclosure2 } from "@mantine/hooks";
|
|
3553
|
+
var OverviewBlockContent = () => {
|
|
3554
|
+
const handlers = useBlocknoteHandlers();
|
|
3555
|
+
const [domainCard, setDomainCard] = useState7(null);
|
|
3556
|
+
const [loading, setLoading] = useState7(true);
|
|
3557
|
+
const [error, setError] = useState7(null);
|
|
3558
|
+
const [detailsOpened, { toggle: toggleDetails }] = useDisclosure2(false);
|
|
3559
|
+
useEffect7(() => {
|
|
3560
|
+
const fetchDomainCard = async () => {
|
|
3561
|
+
setLoading(true);
|
|
3562
|
+
setError(null);
|
|
3563
|
+
try {
|
|
3564
|
+
const data = await handlers.getDomainCard();
|
|
3565
|
+
setDomainCard(data);
|
|
3566
|
+
} catch (err) {
|
|
3567
|
+
setError(err instanceof Error ? err.message : "Failed to load domain card");
|
|
3568
|
+
setDomainCard(null);
|
|
3569
|
+
} finally {
|
|
3570
|
+
setLoading(false);
|
|
3571
|
+
}
|
|
3572
|
+
};
|
|
3573
|
+
fetchDomainCard();
|
|
3574
|
+
}, [handlers]);
|
|
3575
|
+
if (loading) {
|
|
3576
|
+
return /* @__PURE__ */ React44.createElement(
|
|
3577
|
+
Box17,
|
|
3578
|
+
{
|
|
3579
|
+
style: {
|
|
3580
|
+
width: "100%",
|
|
3581
|
+
borderRadius: "6px",
|
|
3582
|
+
padding: "40px",
|
|
3583
|
+
backgroundColor: "#1a1a1a",
|
|
3584
|
+
display: "flex",
|
|
3585
|
+
justifyContent: "center",
|
|
3586
|
+
alignItems: "center"
|
|
3587
|
+
}
|
|
3588
|
+
},
|
|
3589
|
+
/* @__PURE__ */ React44.createElement(Loader3, { color: "blue", size: "md" })
|
|
3590
|
+
);
|
|
3591
|
+
}
|
|
3592
|
+
if (error) {
|
|
3593
|
+
return /* @__PURE__ */ React44.createElement(Alert5, { color: "red", title: "Error loading overview" }, error);
|
|
3594
|
+
}
|
|
3595
|
+
if (!domainCard) {
|
|
3596
|
+
return /* @__PURE__ */ React44.createElement(Alert5, { color: "gray", title: "No data" }, "No domain card data available");
|
|
3597
|
+
}
|
|
3598
|
+
const ChatIcon = () => /* @__PURE__ */ React44.createElement("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React44.createElement(
|
|
3599
|
+
"path",
|
|
3600
|
+
{
|
|
3601
|
+
d: "M8 12H8.01M12 12H12.01M16 12H16.01M21 12C21 16.4183 16.9706 20 12 20C10.4607 20 9.01172 19.6565 7.74467 19.0511L3 20L4.39499 16.28C3.51156 15.0423 3 13.5743 3 12C3 7.58172 7.02944 4 12 4C16.9706 4 21 7.58172 21 12Z",
|
|
3602
|
+
stroke: "#adb5bd",
|
|
3603
|
+
strokeWidth: "2",
|
|
3604
|
+
strokeLinecap: "round",
|
|
3605
|
+
strokeLinejoin: "round"
|
|
3606
|
+
}
|
|
3607
|
+
));
|
|
3551
3608
|
return /* @__PURE__ */ React44.createElement(
|
|
3552
|
-
|
|
3609
|
+
Box17,
|
|
3553
3610
|
{
|
|
3554
3611
|
style: {
|
|
3555
3612
|
width: "100%",
|
|
3556
|
-
|
|
3557
|
-
padding: "16px",
|
|
3558
|
-
backgroundColor: "#FFFFFF",
|
|
3613
|
+
color: "#ffffff",
|
|
3559
3614
|
fontFamily: "Inter, Helvetica, Arial, sans-serif",
|
|
3560
|
-
|
|
3615
|
+
padding: "24px",
|
|
3616
|
+
borderRadius: "8px"
|
|
3561
3617
|
}
|
|
3562
3618
|
},
|
|
3563
|
-
/* @__PURE__ */ React44.createElement(
|
|
3564
|
-
|
|
3619
|
+
/* @__PURE__ */ React44.createElement(Stack28, { gap: "md" }, /* @__PURE__ */ React44.createElement(
|
|
3620
|
+
Text28,
|
|
3565
3621
|
{
|
|
3566
|
-
|
|
3567
|
-
|
|
3568
|
-
placeholder: "Enter DID",
|
|
3622
|
+
fz: "32px",
|
|
3623
|
+
fw: 700,
|
|
3569
3624
|
style: {
|
|
3570
|
-
color: "#
|
|
3571
|
-
|
|
3572
|
-
|
|
3573
|
-
|
|
3574
|
-
|
|
3575
|
-
|
|
3576
|
-
|
|
3577
|
-
|
|
3625
|
+
color: "#ffffff",
|
|
3626
|
+
letterSpacing: "-0.02em"
|
|
3627
|
+
}
|
|
3628
|
+
},
|
|
3629
|
+
domainCard.name
|
|
3630
|
+
), /* @__PURE__ */ React44.createElement(
|
|
3631
|
+
Box17,
|
|
3632
|
+
{
|
|
3633
|
+
style: {
|
|
3634
|
+
background: "#333",
|
|
3635
|
+
borderRadius: "16px",
|
|
3636
|
+
overflow: "hidden"
|
|
3637
|
+
}
|
|
3638
|
+
},
|
|
3639
|
+
/* @__PURE__ */ React44.createElement(
|
|
3640
|
+
Box17,
|
|
3641
|
+
{
|
|
3642
|
+
style: {
|
|
3643
|
+
padding: "12px",
|
|
3644
|
+
cursor: "pointer"
|
|
3645
|
+
},
|
|
3646
|
+
onClick: toggleDetails
|
|
3578
3647
|
},
|
|
3579
|
-
|
|
3580
|
-
|
|
3581
|
-
|
|
3582
|
-
|
|
3583
|
-
|
|
3584
|
-
|
|
3585
|
-
|
|
3648
|
+
/* @__PURE__ */ React44.createElement(Group9, { gap: "xs" }, detailsOpened ? /* @__PURE__ */ React44.createElement(IconChevronDown2, { size: 20, color: "#ffffff" }) : /* @__PURE__ */ React44.createElement(IconChevronRight, { size: 20, color: "#ffffff" }), /* @__PURE__ */ React44.createElement(Text28, { size: "sm", fw: 500, c: "#ffffff" }, "Details"))
|
|
3649
|
+
),
|
|
3650
|
+
/* @__PURE__ */ React44.createElement(Collapse2, { in: detailsOpened }, /* @__PURE__ */ React44.createElement(
|
|
3651
|
+
Box17,
|
|
3652
|
+
{
|
|
3653
|
+
style: {
|
|
3654
|
+
padding: "0 16px 16px 16px"
|
|
3655
|
+
}
|
|
3656
|
+
},
|
|
3657
|
+
/* @__PURE__ */ React44.createElement(Stack28, { gap: "xs" }, domainCard.entity_type && domainCard.entity_type.length > 0 && /* @__PURE__ */ React44.createElement(Group9, { gap: "xs", wrap: "nowrap" }, /* @__PURE__ */ React44.createElement(IconFileDescription, { size: 20, color: "#adb5bd", style: { flexShrink: 0 } }), /* @__PURE__ */ React44.createElement(Text28, { size: "sm", c: "dimmed", style: { width: "140px", flexShrink: 0 } }, "Type"), /* @__PURE__ */ React44.createElement(Text28, { size: "sm", style: { color: "#ffffff" } }, domainCard.entity_type[0].replace("ixo:", ""))), domainCard.valid_from && /* @__PURE__ */ React44.createElement(Group9, { gap: "xs", wrap: "nowrap" }, /* @__PURE__ */ React44.createElement(IconCalendar, { size: 20, color: "#adb5bd", style: { flexShrink: 0 } }), /* @__PURE__ */ React44.createElement(Text28, { size: "sm", c: "dimmed", style: { width: "140px", flexShrink: 0 } }, "Created"), /* @__PURE__ */ React44.createElement(Text28, { size: "sm", style: { color: "#ffffff" } }, new Date(domainCard.valid_from).toLocaleDateString("en-GB", { day: "numeric", month: "short", year: "numeric" }))), /* @__PURE__ */ React44.createElement(Group9, { gap: "xs", wrap: "nowrap" }, /* @__PURE__ */ React44.createElement(IconCircleCheck, { size: 20, color: "#adb5bd", style: { flexShrink: 0 } }), /* @__PURE__ */ React44.createElement(Text28, { size: "sm", c: "dimmed", style: { width: "140px", flexShrink: 0 } }, "Status"), /* @__PURE__ */ React44.createElement(Text28, { size: "sm", style: { color: "#ffffff" } }, "Active")), domainCard.area_served && /* @__PURE__ */ React44.createElement(Group9, { gap: "xs", wrap: "nowrap" }, /* @__PURE__ */ React44.createElement(IconWorld, { size: 20, color: "#adb5bd", style: { flexShrink: 0 } }), /* @__PURE__ */ React44.createElement(Text28, { size: "sm", c: "dimmed", style: { width: "140px", flexShrink: 0 } }, "Country"), /* @__PURE__ */ React44.createElement(Text28, { size: "sm", style: { color: "#ffffff" } }, domainCard.area_served)), domainCard.issuer && /* @__PURE__ */ React44.createElement(Group9, { gap: "xs", wrap: "nowrap" }, /* @__PURE__ */ React44.createElement(IconUser, { size: 20, color: "#adb5bd", style: { flexShrink: 0 } }), /* @__PURE__ */ React44.createElement(Text28, { size: "sm", c: "dimmed", style: { width: "140px", flexShrink: 0 } }, "Issuer"), /* @__PURE__ */ React44.createElement(Text28, { size: "sm", style: { color: "#ffffff" } }, domainCard.issuer)))
|
|
3658
|
+
))
|
|
3659
|
+
), /* @__PURE__ */ React44.createElement(Box17, { style: { marginTop: "24px" } }, /* @__PURE__ */ React44.createElement(Text28, { size: "lg", fw: 600, style: { marginBottom: "12px" } }, "About the Project"), /* @__PURE__ */ React44.createElement(
|
|
3660
|
+
Text28,
|
|
3661
|
+
{
|
|
3662
|
+
size: "sm",
|
|
3663
|
+
c: "dimmed",
|
|
3664
|
+
style: {
|
|
3665
|
+
lineHeight: 1.6
|
|
3586
3666
|
}
|
|
3587
|
-
}
|
|
3588
|
-
|
|
3589
|
-
/* @__PURE__ */ React44.createElement(
|
|
3667
|
+
},
|
|
3668
|
+
domainCard.summary || domainCard.overview || domainCard.description || "No summary available"
|
|
3669
|
+
)), /* @__PURE__ */ React44.createElement(Box17, { style: { marginTop: "16px" } }, /* @__PURE__ */ React44.createElement(Text28, { size: "lg", fw: 600, style: { marginBottom: "12px" } }, "What are the next steps"), /* @__PURE__ */ React44.createElement(
|
|
3670
|
+
Text28,
|
|
3671
|
+
{
|
|
3672
|
+
size: "sm",
|
|
3673
|
+
c: "dimmed",
|
|
3674
|
+
style: {
|
|
3675
|
+
lineHeight: 1.6
|
|
3676
|
+
}
|
|
3677
|
+
},
|
|
3678
|
+
domainCard.description
|
|
3679
|
+
)), domainCard.faq && domainCard.faq.length > 0 && /* @__PURE__ */ React44.createElement(Box17, { style: { width: "95%", margin: "auto" } }, /* @__PURE__ */ React44.createElement(Accordion2, null, domainCard.faq.map((faqItem, index) => /* @__PURE__ */ React44.createElement(Accordion2.Item, { key: index, value: `faq-${index}` }, /* @__PURE__ */ React44.createElement(Accordion2.Control, { icon: /* @__PURE__ */ React44.createElement(ChatIcon, null) }, faqItem.question), /* @__PURE__ */ React44.createElement(Accordion2.Panel, null, faqItem.answer))))))
|
|
3590
3680
|
);
|
|
3591
3681
|
};
|
|
3592
3682
|
var OverviewBlock = createReactBlockSpec3(
|
|
3593
3683
|
{
|
|
3594
3684
|
type: "overview",
|
|
3595
|
-
propSchema: {
|
|
3596
|
-
did: {
|
|
3597
|
-
default: ""
|
|
3598
|
-
}
|
|
3599
|
-
},
|
|
3685
|
+
propSchema: {},
|
|
3600
3686
|
content: "none"
|
|
3601
3687
|
},
|
|
3602
3688
|
{
|
|
@@ -3627,18 +3713,18 @@ var ValidatorActionType = /* @__PURE__ */ ((ValidatorActionType2) => {
|
|
|
3627
3713
|
})(ValidatorActionType || {});
|
|
3628
3714
|
|
|
3629
3715
|
// src/mantine/context/hooks/useSharedProposal.ts
|
|
3630
|
-
import { useState as
|
|
3716
|
+
import { useState as useState8, useEffect as useEffect8, useCallback as useCallback11 } from "react";
|
|
3631
3717
|
var useSharedProposal = ({ proposalId, contractAddress, autoFetch = true }) => {
|
|
3632
3718
|
const { sharedProposals, fetchSharedProposal, invalidateProposal, subscribeToProposal } = useBlocknoteContext();
|
|
3633
|
-
const [localProposal, setLocalProposal] =
|
|
3719
|
+
const [localProposal, setLocalProposal] = useState8(null);
|
|
3634
3720
|
const cacheKey = `${contractAddress}:${proposalId}`;
|
|
3635
|
-
|
|
3721
|
+
useEffect8(() => {
|
|
3636
3722
|
if (!proposalId || !contractAddress || !autoFetch) return;
|
|
3637
3723
|
fetchSharedProposal(proposalId, contractAddress).then(setLocalProposal).catch((error) => {
|
|
3638
3724
|
console.error("Failed to fetch proposal:", error);
|
|
3639
3725
|
});
|
|
3640
3726
|
}, [proposalId, contractAddress, fetchSharedProposal, autoFetch]);
|
|
3641
|
-
|
|
3727
|
+
useEffect8(() => {
|
|
3642
3728
|
const proposal = subscribeToProposal(cacheKey);
|
|
3643
3729
|
if (proposal) {
|
|
3644
3730
|
setLocalProposal(proposal);
|
|
@@ -3670,23 +3756,23 @@ import React80, { useCallback as useCallback13 } from "react";
|
|
|
3670
3756
|
import { Paper as Paper6, CloseButton as CloseButton4, Title as Title5 } from "@mantine/core";
|
|
3671
3757
|
|
|
3672
3758
|
// src/mantine/blocks/proposal/template/GeneralTab.tsx
|
|
3673
|
-
import React45, { useEffect as
|
|
3674
|
-
import { Stack as
|
|
3759
|
+
import React45, { useEffect as useEffect9, useState as useState9 } from "react";
|
|
3760
|
+
import { Stack as Stack29, Text as Text29, TextInput as TextInput5, Textarea as Textarea2, Select as Select3, Loader as Loader4, SegmentedControl as SegmentedControl4 } from "@mantine/core";
|
|
3675
3761
|
var GeneralTab3 = ({ title, description, coreAddress, onTitleChange, onDescriptionChange, onGroupChange }) => {
|
|
3676
3762
|
const handlers = useBlocknoteHandlers();
|
|
3677
|
-
const [localTitle, setLocalTitle] =
|
|
3678
|
-
const [localDescription, setLocalDescription] =
|
|
3679
|
-
const [groups, setGroups] =
|
|
3680
|
-
const [loadingGroups, setLoadingGroups] =
|
|
3681
|
-
const [inputMode, setInputMode] =
|
|
3682
|
-
const [manualAddress, setManualAddress] =
|
|
3683
|
-
|
|
3763
|
+
const [localTitle, setLocalTitle] = useState9(title || "");
|
|
3764
|
+
const [localDescription, setLocalDescription] = useState9(description || "");
|
|
3765
|
+
const [groups, setGroups] = useState9([]);
|
|
3766
|
+
const [loadingGroups, setLoadingGroups] = useState9(false);
|
|
3767
|
+
const [inputMode, setInputMode] = useState9("select");
|
|
3768
|
+
const [manualAddress, setManualAddress] = useState9("");
|
|
3769
|
+
useEffect9(() => {
|
|
3684
3770
|
setLocalTitle(title || "");
|
|
3685
3771
|
}, [title]);
|
|
3686
|
-
|
|
3772
|
+
useEffect9(() => {
|
|
3687
3773
|
setLocalDescription(description || "");
|
|
3688
3774
|
}, [description]);
|
|
3689
|
-
|
|
3775
|
+
useEffect9(() => {
|
|
3690
3776
|
if (coreAddress) {
|
|
3691
3777
|
const matchesGroup = groups.some((g) => g.coreAddress === coreAddress);
|
|
3692
3778
|
if (matchesGroup) {
|
|
@@ -3697,7 +3783,7 @@ var GeneralTab3 = ({ title, description, coreAddress, onTitleChange, onDescripti
|
|
|
3697
3783
|
}
|
|
3698
3784
|
}
|
|
3699
3785
|
}, [coreAddress, groups]);
|
|
3700
|
-
|
|
3786
|
+
useEffect9(() => {
|
|
3701
3787
|
const fetchGroups = async () => {
|
|
3702
3788
|
if (!handlers?.getDAOGroups) {
|
|
3703
3789
|
console.warn("getDAOGroups handler not available");
|
|
@@ -3715,7 +3801,7 @@ var GeneralTab3 = ({ title, description, coreAddress, onTitleChange, onDescripti
|
|
|
3715
3801
|
};
|
|
3716
3802
|
fetchGroups();
|
|
3717
3803
|
}, [handlers]);
|
|
3718
|
-
return /* @__PURE__ */ React45.createElement(
|
|
3804
|
+
return /* @__PURE__ */ React45.createElement(Stack29, { gap: "lg" }, /* @__PURE__ */ React45.createElement(Stack29, { gap: "xs" }, /* @__PURE__ */ React45.createElement(Text29, { size: "sm", fw: 600 }, "Title"), /* @__PURE__ */ React45.createElement(
|
|
3719
3805
|
TextInput5,
|
|
3720
3806
|
{
|
|
3721
3807
|
placeholder: "e.g. Proposal Title",
|
|
@@ -3726,7 +3812,7 @@ var GeneralTab3 = ({ title, description, coreAddress, onTitleChange, onDescripti
|
|
|
3726
3812
|
onTitleChange(newTitle);
|
|
3727
3813
|
}
|
|
3728
3814
|
}
|
|
3729
|
-
)), /* @__PURE__ */ React45.createElement(
|
|
3815
|
+
)), /* @__PURE__ */ React45.createElement(Stack29, { gap: "xs" }, /* @__PURE__ */ React45.createElement(Text29, { size: "sm", fw: 600 }, "Description"), /* @__PURE__ */ React45.createElement(
|
|
3730
3816
|
Textarea2,
|
|
3731
3817
|
{
|
|
3732
3818
|
placeholder: "Describe what this proposal is about",
|
|
@@ -3738,7 +3824,7 @@ var GeneralTab3 = ({ title, description, coreAddress, onTitleChange, onDescripti
|
|
|
3738
3824
|
onDescriptionChange(newDescription);
|
|
3739
3825
|
}
|
|
3740
3826
|
}
|
|
3741
|
-
)), /* @__PURE__ */ React45.createElement(
|
|
3827
|
+
)), /* @__PURE__ */ React45.createElement(Stack29, { gap: "xs" }, /* @__PURE__ */ React45.createElement(Text29, { size: "sm", fw: 600 }, "Group"), /* @__PURE__ */ React45.createElement(
|
|
3742
3828
|
SegmentedControl4,
|
|
3743
3829
|
{
|
|
3744
3830
|
value: inputMode,
|
|
@@ -3767,7 +3853,7 @@ var GeneralTab3 = ({ title, description, coreAddress, onTitleChange, onDescripti
|
|
|
3767
3853
|
label: group.name
|
|
3768
3854
|
})),
|
|
3769
3855
|
disabled: loadingGroups,
|
|
3770
|
-
rightSection: loadingGroups ? /* @__PURE__ */ React45.createElement(
|
|
3856
|
+
rightSection: loadingGroups ? /* @__PURE__ */ React45.createElement(Loader4, { size: "xs" }) : void 0,
|
|
3771
3857
|
searchable: true
|
|
3772
3858
|
}
|
|
3773
3859
|
) : /* @__PURE__ */ React45.createElement(
|
|
@@ -3785,12 +3871,12 @@ var GeneralTab3 = ({ title, description, coreAddress, onTitleChange, onDescripti
|
|
|
3785
3871
|
};
|
|
3786
3872
|
|
|
3787
3873
|
// src/mantine/blocks/proposal/template/ActionsTab.tsx
|
|
3788
|
-
import React78, { useCallback as useCallback12, useEffect as
|
|
3789
|
-
import { Card as Card13, Stack as
|
|
3874
|
+
import React78, { useCallback as useCallback12, useEffect as useEffect12, useState as useState17 } from "react";
|
|
3875
|
+
import { Card as Card13, Stack as Stack62 } from "@mantine/core";
|
|
3790
3876
|
|
|
3791
3877
|
// src/mantine/blocks/proposal/actions-components/ActionsCard.tsx
|
|
3792
3878
|
import React46 from "react";
|
|
3793
|
-
import { Card as Card6, Group as
|
|
3879
|
+
import { Card as Card6, Group as Group10, Text as Text30, Badge as Badge5, Stack as Stack30, ActionIcon as ActionIcon6, ScrollArea } from "@mantine/core";
|
|
3794
3880
|
var getActionSummary = (action) => {
|
|
3795
3881
|
switch (action.type) {
|
|
3796
3882
|
case "Spend":
|
|
@@ -3839,7 +3925,7 @@ var ActionsCard = ({ actions, isSelected, onClick, onEditAction, onRemoveAction,
|
|
|
3839
3925
|
},
|
|
3840
3926
|
onClick: handleCardClick
|
|
3841
3927
|
},
|
|
3842
|
-
/* @__PURE__ */ React46.createElement(
|
|
3928
|
+
/* @__PURE__ */ React46.createElement(Group10, { justify: "space-between", align: "flex-start" }, /* @__PURE__ */ React46.createElement(Stack30, { gap: "xs", style: { flex: 1 } }, /* @__PURE__ */ React46.createElement(Text30, { size: "md", fw: 600, style: { color: "#f1f3f5" } }, "Proposal Actions (", actions.length, ")"), actions.length === 0 ? /* @__PURE__ */ React46.createElement(Text30, { size: "sm", style: { color: "#868e96" } }, "No actions added yet.") : /* @__PURE__ */ React46.createElement(ScrollArea, { h: actions.length > 3 ? 150 : void 0, style: { marginTop: 8 } }, /* @__PURE__ */ React46.createElement(Stack30, { gap: "xs" }, actions.map((action, index) => /* @__PURE__ */ React46.createElement(
|
|
3843
3929
|
Card6,
|
|
3844
3930
|
{
|
|
3845
3931
|
key: index,
|
|
@@ -3850,7 +3936,7 @@ var ActionsCard = ({ actions, isSelected, onClick, onEditAction, onRemoveAction,
|
|
|
3850
3936
|
borderColor: "#333"
|
|
3851
3937
|
}
|
|
3852
3938
|
},
|
|
3853
|
-
/* @__PURE__ */ React46.createElement(
|
|
3939
|
+
/* @__PURE__ */ React46.createElement(Group10, { justify: "space-between", align: "center" }, /* @__PURE__ */ React46.createElement(Group10, { gap: "xs", style: { flex: 1 } }, /* @__PURE__ */ React46.createElement(
|
|
3854
3940
|
Badge5,
|
|
3855
3941
|
{
|
|
3856
3942
|
size: "sm",
|
|
@@ -3861,7 +3947,7 @@ var ActionsCard = ({ actions, isSelected, onClick, onEditAction, onRemoveAction,
|
|
|
3861
3947
|
}
|
|
3862
3948
|
},
|
|
3863
3949
|
action.type
|
|
3864
|
-
), /* @__PURE__ */ React46.createElement(
|
|
3950
|
+
), /* @__PURE__ */ React46.createElement(Text30, { size: "sm", style: { color: "#adb5bd" } }, getActionSummary(action))), !disabled && /* @__PURE__ */ React46.createElement(Group10, { gap: 4 }, /* @__PURE__ */ React46.createElement(
|
|
3865
3951
|
ActionIcon6,
|
|
3866
3952
|
{
|
|
3867
3953
|
size: "sm",
|
|
@@ -3893,14 +3979,14 @@ var ActionsCard = ({ actions, isSelected, onClick, onEditAction, onRemoveAction,
|
|
|
3893
3979
|
};
|
|
3894
3980
|
|
|
3895
3981
|
// src/mantine/blocks/proposal/ActionsPanel.tsx
|
|
3896
|
-
import React77, { useState as
|
|
3897
|
-
import { Stack as
|
|
3982
|
+
import React77, { useState as useState16, useEffect as useEffect11, useMemo as useMemo10 } from "react";
|
|
3983
|
+
import { Stack as Stack61, Button as Button11, Group as Group21, Text as Text38, Card as Card12, Badge as Badge8, Divider as Divider4, ScrollArea as ScrollArea3, Alert as Alert8, Tabs as Tabs2, SimpleGrid, Paper as Paper5 } from "@mantine/core";
|
|
3898
3984
|
|
|
3899
3985
|
// src/mantine/blocks/proposal/actions-components/SpendActionForm.tsx
|
|
3900
3986
|
import React47 from "react";
|
|
3901
|
-
import { TextInput as TextInput6, Stack as
|
|
3987
|
+
import { TextInput as TextInput6, Stack as Stack31 } from "@mantine/core";
|
|
3902
3988
|
var SpendActionForm = ({ data, onChange }) => {
|
|
3903
|
-
return /* @__PURE__ */ React47.createElement(
|
|
3989
|
+
return /* @__PURE__ */ React47.createElement(Stack31, null, /* @__PURE__ */ React47.createElement(
|
|
3904
3990
|
TextInput6,
|
|
3905
3991
|
{
|
|
3906
3992
|
label: "Recipient Address",
|
|
@@ -3964,11 +4050,11 @@ var SpendActionForm = ({ data, onChange }) => {
|
|
|
3964
4050
|
};
|
|
3965
4051
|
|
|
3966
4052
|
// src/mantine/blocks/proposal/actions-components/UpdateMembersActionForm.tsx
|
|
3967
|
-
import React48, { useState as
|
|
3968
|
-
import { Stack as
|
|
4053
|
+
import React48, { useState as useState10 } from "react";
|
|
4054
|
+
import { Stack as Stack32, TextInput as TextInput7, NumberInput as NumberInput2, Button as Button6, Group as Group11, Text as Text31, Card as Card7, Badge as Badge6, ActionIcon as ActionIcon7, Divider as Divider3, ScrollArea as ScrollArea2 } from "@mantine/core";
|
|
3969
4055
|
var UpdateMembersActionForm = ({ data, onChange }) => {
|
|
3970
|
-
const [newMember, setNewMember] =
|
|
3971
|
-
const [newRemoveAddress, setNewRemoveAddress] =
|
|
4056
|
+
const [newMember, setNewMember] = useState10({ addr: "", weight: 1 });
|
|
4057
|
+
const [newRemoveAddress, setNewRemoveAddress] = useState10("");
|
|
3972
4058
|
const handleAddMember = () => {
|
|
3973
4059
|
if (!newMember.addr) return;
|
|
3974
4060
|
onChange({
|
|
@@ -4008,7 +4094,7 @@ var UpdateMembersActionForm = ({ data, onChange }) => {
|
|
|
4008
4094
|
}
|
|
4009
4095
|
}
|
|
4010
4096
|
};
|
|
4011
|
-
return /* @__PURE__ */ React48.createElement(
|
|
4097
|
+
return /* @__PURE__ */ React48.createElement(Stack32, null, /* @__PURE__ */ React48.createElement(Stack32, { gap: "xs" }, /* @__PURE__ */ React48.createElement(Text31, { size: "sm", fw: 500, style: { color: "#adb5bd" } }, "Members to Add"), /* @__PURE__ */ React48.createElement(ScrollArea2, { h: 150 }, /* @__PURE__ */ React48.createElement(Stack32, { gap: "xs" }, (data.add || []).map((member, index) => /* @__PURE__ */ React48.createElement(
|
|
4012
4098
|
Card7,
|
|
4013
4099
|
{
|
|
4014
4100
|
key: index,
|
|
@@ -4019,7 +4105,7 @@ var UpdateMembersActionForm = ({ data, onChange }) => {
|
|
|
4019
4105
|
borderColor: "#333"
|
|
4020
4106
|
}
|
|
4021
4107
|
},
|
|
4022
|
-
/* @__PURE__ */ React48.createElement(
|
|
4108
|
+
/* @__PURE__ */ React48.createElement(Group11, { justify: "space-between" }, /* @__PURE__ */ React48.createElement("div", null, /* @__PURE__ */ React48.createElement(Text31, { size: "sm", fw: 500, style: { color: "#f1f3f5" } }, member.addr.slice(0, 20), "..."), /* @__PURE__ */ React48.createElement(
|
|
4023
4109
|
Badge6,
|
|
4024
4110
|
{
|
|
4025
4111
|
size: "sm",
|
|
@@ -4031,7 +4117,7 @@ var UpdateMembersActionForm = ({ data, onChange }) => {
|
|
|
4031
4117
|
"Weight: ",
|
|
4032
4118
|
member.weight
|
|
4033
4119
|
)), /* @__PURE__ */ React48.createElement(ActionIcon7, { size: "sm", variant: "subtle", onClick: () => handleRemoveMember(index), style: { color: "#ff6b6b" } }, "\u{1F5D1}\uFE0F"))
|
|
4034
|
-
)))), /* @__PURE__ */ React48.createElement(
|
|
4120
|
+
)))), /* @__PURE__ */ React48.createElement(Group11, { grow: true }, /* @__PURE__ */ React48.createElement(TextInput7, { placeholder: "Member address", value: newMember.addr, onChange: (e) => setNewMember({ ...newMember, addr: e.currentTarget.value }), styles: inputStyles29 }), /* @__PURE__ */ React48.createElement(
|
|
4035
4121
|
NumberInput2,
|
|
4036
4122
|
{
|
|
4037
4123
|
placeholder: "Weight",
|
|
@@ -4053,7 +4139,7 @@ var UpdateMembersActionForm = ({ data, onChange }) => {
|
|
|
4053
4139
|
}
|
|
4054
4140
|
},
|
|
4055
4141
|
"\u2795 Add"
|
|
4056
|
-
))), /* @__PURE__ */ React48.createElement(Divider3, { color: "#333" }), /* @__PURE__ */ React48.createElement(
|
|
4142
|
+
))), /* @__PURE__ */ React48.createElement(Divider3, { color: "#333" }), /* @__PURE__ */ React48.createElement(Stack32, { gap: "xs" }, /* @__PURE__ */ React48.createElement(Text31, { size: "sm", fw: 500, style: { color: "#adb5bd" } }, "Members to Remove"), /* @__PURE__ */ React48.createElement(ScrollArea2, { h: 100 }, /* @__PURE__ */ React48.createElement(Stack32, { gap: "xs" }, (data.remove || []).map((item, index) => /* @__PURE__ */ React48.createElement(
|
|
4057
4143
|
Card7,
|
|
4058
4144
|
{
|
|
4059
4145
|
key: index,
|
|
@@ -4064,8 +4150,8 @@ var UpdateMembersActionForm = ({ data, onChange }) => {
|
|
|
4064
4150
|
borderColor: "#333"
|
|
4065
4151
|
}
|
|
4066
4152
|
},
|
|
4067
|
-
/* @__PURE__ */ React48.createElement(
|
|
4068
|
-
)))), /* @__PURE__ */ React48.createElement(
|
|
4153
|
+
/* @__PURE__ */ React48.createElement(Group11, { justify: "space-between" }, /* @__PURE__ */ React48.createElement(Text31, { size: "sm", style: { color: "#adb5bd" } }, item.addr.slice(0, 30), "..."), /* @__PURE__ */ React48.createElement(ActionIcon7, { size: "sm", variant: "subtle", onClick: () => handleRemoveRemoveAddress(index), style: { color: "#ff6b6b" } }, "\u{1F5D1}\uFE0F"))
|
|
4154
|
+
)))), /* @__PURE__ */ React48.createElement(Group11, { grow: true }, /* @__PURE__ */ React48.createElement(TextInput7, { placeholder: "Address to remove", value: newRemoveAddress, onChange: (e) => setNewRemoveAddress(e.currentTarget.value), styles: inputStyles29 }), /* @__PURE__ */ React48.createElement(
|
|
4069
4155
|
Button6,
|
|
4070
4156
|
{
|
|
4071
4157
|
size: "sm",
|
|
@@ -4083,7 +4169,7 @@ var UpdateMembersActionForm = ({ data, onChange }) => {
|
|
|
4083
4169
|
|
|
4084
4170
|
// src/mantine/blocks/proposal/actions-components/StakeActionForm.tsx
|
|
4085
4171
|
import React49 from "react";
|
|
4086
|
-
import { Stack as
|
|
4172
|
+
import { Stack as Stack33, TextInput as TextInput8, Select as Select4, NumberInput as NumberInput3 } from "@mantine/core";
|
|
4087
4173
|
var stakeTypeOptions = [
|
|
4088
4174
|
{ value: StakeType.Delegate, label: "Delegate" },
|
|
4089
4175
|
{ value: StakeType.Undelegate, label: "Undelegate" },
|
|
@@ -4128,7 +4214,7 @@ var selectStyles = {
|
|
|
4128
4214
|
var StakeActionForm = ({ data, onChange }) => {
|
|
4129
4215
|
const isRedelegate = data.stakeType === StakeType.Redelegate;
|
|
4130
4216
|
const needsAmount = data.stakeType !== StakeType.WithdrawDelegatorReward;
|
|
4131
|
-
return /* @__PURE__ */ React49.createElement(
|
|
4217
|
+
return /* @__PURE__ */ React49.createElement(Stack33, { gap: "md" }, /* @__PURE__ */ React49.createElement(
|
|
4132
4218
|
Select4,
|
|
4133
4219
|
{
|
|
4134
4220
|
label: "Stake Type",
|
|
@@ -4188,7 +4274,7 @@ var StakeActionForm = ({ data, onChange }) => {
|
|
|
4188
4274
|
|
|
4189
4275
|
// src/mantine/blocks/proposal/actions-components/JoinActionForm.tsx
|
|
4190
4276
|
import React50 from "react";
|
|
4191
|
-
import { Stack as
|
|
4277
|
+
import { Stack as Stack34, TextInput as TextInput9 } from "@mantine/core";
|
|
4192
4278
|
var inputStyles2 = {
|
|
4193
4279
|
label: { color: "#adb5bd" },
|
|
4194
4280
|
input: {
|
|
@@ -4201,7 +4287,7 @@ var inputStyles2 = {
|
|
|
4201
4287
|
}
|
|
4202
4288
|
};
|
|
4203
4289
|
var JoinActionForm = ({ data, onChange }) => {
|
|
4204
|
-
return /* @__PURE__ */ React50.createElement(
|
|
4290
|
+
return /* @__PURE__ */ React50.createElement(Stack34, { gap: "md" }, /* @__PURE__ */ React50.createElement(TextInput9, { label: "ID", placeholder: "did:ixo:entity:abc123...", value: data.id, onChange: (e) => onChange({ ...data, id: e.target.value }), required: true, styles: inputStyles2 }), /* @__PURE__ */ React50.createElement(
|
|
4205
4291
|
TextInput9,
|
|
4206
4292
|
{
|
|
4207
4293
|
label: "Core Address",
|
|
@@ -4216,7 +4302,7 @@ var JoinActionForm = ({ data, onChange }) => {
|
|
|
4216
4302
|
|
|
4217
4303
|
// src/mantine/blocks/proposal/actions-components/forms/MintActionForm.tsx
|
|
4218
4304
|
import React51 from "react";
|
|
4219
|
-
import { Stack as
|
|
4305
|
+
import { Stack as Stack35, TextInput as TextInput10, NumberInput as NumberInput4 } from "@mantine/core";
|
|
4220
4306
|
var inputStyles3 = {
|
|
4221
4307
|
label: { color: "#adb5bd" },
|
|
4222
4308
|
input: {
|
|
@@ -4229,7 +4315,7 @@ var inputStyles3 = {
|
|
|
4229
4315
|
}
|
|
4230
4316
|
};
|
|
4231
4317
|
var MintActionForm = ({ data, onChange }) => {
|
|
4232
|
-
return /* @__PURE__ */ React51.createElement(
|
|
4318
|
+
return /* @__PURE__ */ React51.createElement(Stack35, { gap: "md" }, /* @__PURE__ */ React51.createElement(TextInput10, { label: "Recipient Address", placeholder: "ixo1...", value: data.to, onChange: (e) => onChange({ ...data, to: e.currentTarget.value }), required: true, styles: inputStyles3 }), /* @__PURE__ */ React51.createElement(
|
|
4233
4319
|
NumberInput4,
|
|
4234
4320
|
{
|
|
4235
4321
|
label: "Amount",
|
|
@@ -4245,8 +4331,8 @@ var MintActionForm = ({ data, onChange }) => {
|
|
|
4245
4331
|
};
|
|
4246
4332
|
|
|
4247
4333
|
// src/mantine/blocks/proposal/actions-components/forms/ExecuteActionForm.tsx
|
|
4248
|
-
import React52, { useState as
|
|
4249
|
-
import { Stack as
|
|
4334
|
+
import React52, { useState as useState11 } from "react";
|
|
4335
|
+
import { Stack as Stack36, TextInput as TextInput11, Textarea as Textarea3, Button as Button7, Group as Group12, Text as Text32, Card as Card8 } from "@mantine/core";
|
|
4250
4336
|
var inputStyles4 = {
|
|
4251
4337
|
label: { color: "#adb5bd" },
|
|
4252
4338
|
input: {
|
|
@@ -4259,7 +4345,7 @@ var inputStyles4 = {
|
|
|
4259
4345
|
}
|
|
4260
4346
|
};
|
|
4261
4347
|
var ExecuteActionForm = ({ data, onChange }) => {
|
|
4262
|
-
const [newFund, setNewFund] =
|
|
4348
|
+
const [newFund, setNewFund] = useState11({ denom: "uixo", amount: "" });
|
|
4263
4349
|
const handleAddFund = () => {
|
|
4264
4350
|
if (newFund.amount && newFund.denom) {
|
|
4265
4351
|
onChange({
|
|
@@ -4283,7 +4369,7 @@ var ExecuteActionForm = ({ data, onChange }) => {
|
|
|
4283
4369
|
return data.message;
|
|
4284
4370
|
}
|
|
4285
4371
|
};
|
|
4286
|
-
return /* @__PURE__ */ React52.createElement(
|
|
4372
|
+
return /* @__PURE__ */ React52.createElement(Stack36, { gap: "md" }, /* @__PURE__ */ React52.createElement(
|
|
4287
4373
|
TextInput11,
|
|
4288
4374
|
{
|
|
4289
4375
|
label: "Contract Address",
|
|
@@ -4304,7 +4390,7 @@ var ExecuteActionForm = ({ data, onChange }) => {
|
|
|
4304
4390
|
required: true,
|
|
4305
4391
|
styles: inputStyles4
|
|
4306
4392
|
}
|
|
4307
|
-
), /* @__PURE__ */ React52.createElement(
|
|
4393
|
+
), /* @__PURE__ */ React52.createElement(Stack36, { gap: "xs" }, /* @__PURE__ */ React52.createElement(Text32, { size: "sm", fw: 500, style: { color: "#adb5bd" } }, "Funds (Optional)"), (data.funds || []).map((fund, index) => /* @__PURE__ */ React52.createElement(Card8, { key: index, withBorder: true, padding: "xs", style: { backgroundColor: "#2a2a2a", borderColor: "#333" } }, /* @__PURE__ */ React52.createElement(Group12, { justify: "space-between" }, /* @__PURE__ */ React52.createElement(Text32, { size: "sm", style: { color: "#f1f3f5" } }, fund.amount, " ", fund.denom), /* @__PURE__ */ React52.createElement(Button7, { size: "xs", variant: "subtle", onClick: () => handleRemoveFund(index), style: { color: "#ff6b6b" } }, "Remove")))), /* @__PURE__ */ React52.createElement(Group12, { grow: true }, /* @__PURE__ */ React52.createElement(TextInput11, { placeholder: "Amount", value: newFund.amount, onChange: (e) => setNewFund({ ...newFund, amount: e.currentTarget.value }), styles: inputStyles4 }), /* @__PURE__ */ React52.createElement(TextInput11, { placeholder: "Denom (e.g., uixo)", value: newFund.denom, onChange: (e) => setNewFund({ ...newFund, denom: e.currentTarget.value }), styles: inputStyles4 }), /* @__PURE__ */ React52.createElement(
|
|
4308
4394
|
Button7,
|
|
4309
4395
|
{
|
|
4310
4396
|
size: "sm",
|
|
@@ -4319,9 +4405,9 @@ var ExecuteActionForm = ({ data, onChange }) => {
|
|
|
4319
4405
|
};
|
|
4320
4406
|
|
|
4321
4407
|
// src/mantine/blocks/proposal/actions-components/forms/CustomActionForm.tsx
|
|
4322
|
-
import React53, { useState as
|
|
4323
|
-
import { Stack as
|
|
4324
|
-
import { Group as
|
|
4408
|
+
import React53, { useState as useState12, useEffect as useEffect10 } from "react";
|
|
4409
|
+
import { Stack as Stack37, Textarea as Textarea4, Alert as Alert6, Text as Text33, Badge as Badge7 } from "@mantine/core";
|
|
4410
|
+
import { Group as Group13 } from "@mantine/core";
|
|
4325
4411
|
var inputStyles5 = {
|
|
4326
4412
|
label: { color: "#adb5bd" },
|
|
4327
4413
|
input: {
|
|
@@ -4335,9 +4421,9 @@ var inputStyles5 = {
|
|
|
4335
4421
|
}
|
|
4336
4422
|
};
|
|
4337
4423
|
var CustomActionForm = ({ data, onChange }) => {
|
|
4338
|
-
const [isValid, setIsValid] =
|
|
4339
|
-
const [error, setError] =
|
|
4340
|
-
|
|
4424
|
+
const [isValid, setIsValid] = useState12(true);
|
|
4425
|
+
const [error, setError] = useState12("");
|
|
4426
|
+
useEffect10(() => {
|
|
4341
4427
|
try {
|
|
4342
4428
|
if (data.message) {
|
|
4343
4429
|
JSON.parse(data.message);
|
|
@@ -4357,7 +4443,7 @@ var CustomActionForm = ({ data, onChange }) => {
|
|
|
4357
4443
|
return data.message;
|
|
4358
4444
|
}
|
|
4359
4445
|
};
|
|
4360
|
-
return /* @__PURE__ */ React53.createElement(
|
|
4446
|
+
return /* @__PURE__ */ React53.createElement(Stack37, { gap: "md" }, /* @__PURE__ */ React53.createElement(Alert6, { color: "yellow", style: { backgroundColor: "#2a2a2a", borderColor: "#ffd43b" } }, /* @__PURE__ */ React53.createElement(Text33, { size: "sm", style: { color: "#ffd43b" } }, "\u26A0\uFE0F Custom actions require valid JSON messages. Supports both Wasm and Stargate message formats.")), /* @__PURE__ */ React53.createElement("div", null, /* @__PURE__ */ React53.createElement(Group13, { gap: "xs", mb: "xs" }, /* @__PURE__ */ React53.createElement(Text33, { size: "sm", fw: 500, style: { color: "#adb5bd" } }, "Custom Message (JSON)"), /* @__PURE__ */ React53.createElement(
|
|
4361
4447
|
Badge7,
|
|
4362
4448
|
{
|
|
4363
4449
|
size: "sm",
|
|
@@ -4401,7 +4487,7 @@ Example Stargate message:
|
|
|
4401
4487
|
|
|
4402
4488
|
// src/mantine/blocks/proposal/actions-components/forms/AuthzExecActionForm.tsx
|
|
4403
4489
|
import React54 from "react";
|
|
4404
|
-
import { Stack as
|
|
4490
|
+
import { Stack as Stack38, Select as Select5, TextInput as TextInput12, Textarea as Textarea5 } from "@mantine/core";
|
|
4405
4491
|
var inputStyles6 = {
|
|
4406
4492
|
label: { color: "#adb5bd" },
|
|
4407
4493
|
input: {
|
|
@@ -4436,7 +4522,7 @@ var AuthzExecActionForm = ({ data, onChange }) => {
|
|
|
4436
4522
|
onChange({ ...data, [field]: value });
|
|
4437
4523
|
}
|
|
4438
4524
|
};
|
|
4439
|
-
return /* @__PURE__ */ React54.createElement(
|
|
4525
|
+
return /* @__PURE__ */ React54.createElement(Stack38, { gap: "md" }, /* @__PURE__ */ React54.createElement(
|
|
4440
4526
|
Select5,
|
|
4441
4527
|
{
|
|
4442
4528
|
label: "Action Type",
|
|
@@ -4501,7 +4587,7 @@ var AuthzExecActionForm = ({ data, onChange }) => {
|
|
|
4501
4587
|
|
|
4502
4588
|
// src/mantine/blocks/proposal/actions-components/forms/AuthzGrantActionForm.tsx
|
|
4503
4589
|
import React55 from "react";
|
|
4504
|
-
import { Stack as
|
|
4590
|
+
import { Stack as Stack39, TextInput as TextInput13 } from "@mantine/core";
|
|
4505
4591
|
var inputStyles7 = {
|
|
4506
4592
|
label: { color: "#adb5bd" },
|
|
4507
4593
|
input: {
|
|
@@ -4514,7 +4600,7 @@ var inputStyles7 = {
|
|
|
4514
4600
|
}
|
|
4515
4601
|
};
|
|
4516
4602
|
var AuthzGrantActionForm = ({ data, onChange }) => {
|
|
4517
|
-
return /* @__PURE__ */ React55.createElement(
|
|
4603
|
+
return /* @__PURE__ */ React55.createElement(Stack39, { gap: "md" }, /* @__PURE__ */ React55.createElement(
|
|
4518
4604
|
TextInput13,
|
|
4519
4605
|
{
|
|
4520
4606
|
label: "Type URL",
|
|
@@ -4555,7 +4641,7 @@ var AuthzGrantActionForm = ({ data, onChange }) => {
|
|
|
4555
4641
|
|
|
4556
4642
|
// src/mantine/blocks/proposal/actions-components/forms/BurnNftActionForm.tsx
|
|
4557
4643
|
import React56 from "react";
|
|
4558
|
-
import { Stack as
|
|
4644
|
+
import { Stack as Stack40, TextInput as TextInput14 } from "@mantine/core";
|
|
4559
4645
|
var inputStyles8 = {
|
|
4560
4646
|
label: { color: "#adb5bd" },
|
|
4561
4647
|
input: {
|
|
@@ -4568,7 +4654,7 @@ var inputStyles8 = {
|
|
|
4568
4654
|
}
|
|
4569
4655
|
};
|
|
4570
4656
|
var BurnNftActionForm = ({ data, onChange }) => {
|
|
4571
|
-
return /* @__PURE__ */ React56.createElement(
|
|
4657
|
+
return /* @__PURE__ */ React56.createElement(Stack40, { gap: "md" }, /* @__PURE__ */ React56.createElement(
|
|
4572
4658
|
TextInput14,
|
|
4573
4659
|
{
|
|
4574
4660
|
label: "Collection Address",
|
|
@@ -4583,7 +4669,7 @@ var BurnNftActionForm = ({ data, onChange }) => {
|
|
|
4583
4669
|
|
|
4584
4670
|
// src/mantine/blocks/proposal/actions-components/forms/TransferNftActionForm.tsx
|
|
4585
4671
|
import React57 from "react";
|
|
4586
|
-
import { Stack as
|
|
4672
|
+
import { Stack as Stack41, TextInput as TextInput15, Checkbox as Checkbox4, Textarea as Textarea6 } from "@mantine/core";
|
|
4587
4673
|
var inputStyles9 = {
|
|
4588
4674
|
label: { color: "#adb5bd" },
|
|
4589
4675
|
input: {
|
|
@@ -4596,7 +4682,7 @@ var inputStyles9 = {
|
|
|
4596
4682
|
}
|
|
4597
4683
|
};
|
|
4598
4684
|
var TransferNftActionForm = ({ data, onChange }) => {
|
|
4599
|
-
return /* @__PURE__ */ React57.createElement(
|
|
4685
|
+
return /* @__PURE__ */ React57.createElement(Stack41, { gap: "md" }, /* @__PURE__ */ React57.createElement(
|
|
4600
4686
|
TextInput15,
|
|
4601
4687
|
{
|
|
4602
4688
|
label: "Collection Address",
|
|
@@ -4642,7 +4728,7 @@ var TransferNftActionForm = ({ data, onChange }) => {
|
|
|
4642
4728
|
|
|
4643
4729
|
// src/mantine/blocks/proposal/actions-components/forms/ManageCw721ActionForm.tsx
|
|
4644
4730
|
import React58 from "react";
|
|
4645
|
-
import { Stack as
|
|
4731
|
+
import { Stack as Stack42, TextInput as TextInput16, Radio, Group as Group14 } from "@mantine/core";
|
|
4646
4732
|
var inputStyles10 = {
|
|
4647
4733
|
label: { color: "#adb5bd" },
|
|
4648
4734
|
input: {
|
|
@@ -4655,7 +4741,7 @@ var inputStyles10 = {
|
|
|
4655
4741
|
}
|
|
4656
4742
|
};
|
|
4657
4743
|
var ManageCw721ActionForm = ({ data, onChange }) => {
|
|
4658
|
-
return /* @__PURE__ */ React58.createElement(
|
|
4744
|
+
return /* @__PURE__ */ React58.createElement(Stack42, { gap: "md" }, /* @__PURE__ */ React58.createElement(Radio.Group, { label: "Action", value: data.adding ? "add" : "remove", onChange: (value) => onChange({ ...data, adding: value === "add" }) }, /* @__PURE__ */ React58.createElement(Group14, { mt: "xs" }, /* @__PURE__ */ React58.createElement(
|
|
4659
4745
|
Radio,
|
|
4660
4746
|
{
|
|
4661
4747
|
value: "add",
|
|
@@ -4689,8 +4775,8 @@ var ManageCw721ActionForm = ({ data, onChange }) => {
|
|
|
4689
4775
|
};
|
|
4690
4776
|
|
|
4691
4777
|
// src/mantine/blocks/proposal/actions-components/forms/InstantiateActionForm.tsx
|
|
4692
|
-
import React59, { useState as
|
|
4693
|
-
import { Stack as
|
|
4778
|
+
import React59, { useState as useState13 } from "react";
|
|
4779
|
+
import { Stack as Stack43, TextInput as TextInput17, Textarea as Textarea7, NumberInput as NumberInput5, Button as Button8, Group as Group15, Text as Text34, Card as Card9 } from "@mantine/core";
|
|
4694
4780
|
var inputStyles11 = {
|
|
4695
4781
|
label: { color: "#adb5bd" },
|
|
4696
4782
|
input: {
|
|
@@ -4703,7 +4789,7 @@ var inputStyles11 = {
|
|
|
4703
4789
|
}
|
|
4704
4790
|
};
|
|
4705
4791
|
var InstantiateActionForm = ({ data, onChange }) => {
|
|
4706
|
-
const [newFund, setNewFund] =
|
|
4792
|
+
const [newFund, setNewFund] = useState13({ denom: "uixo", amount: "" });
|
|
4707
4793
|
const handleAddFund = () => {
|
|
4708
4794
|
if (newFund.amount && newFund.denom) {
|
|
4709
4795
|
onChange({
|
|
@@ -4727,7 +4813,7 @@ var InstantiateActionForm = ({ data, onChange }) => {
|
|
|
4727
4813
|
return data.message;
|
|
4728
4814
|
}
|
|
4729
4815
|
};
|
|
4730
|
-
return /* @__PURE__ */ React59.createElement(
|
|
4816
|
+
return /* @__PURE__ */ React59.createElement(Stack43, { gap: "md" }, /* @__PURE__ */ React59.createElement(
|
|
4731
4817
|
TextInput17,
|
|
4732
4818
|
{
|
|
4733
4819
|
label: "Admin Address",
|
|
@@ -4759,7 +4845,7 @@ var InstantiateActionForm = ({ data, onChange }) => {
|
|
|
4759
4845
|
required: true,
|
|
4760
4846
|
styles: inputStyles11
|
|
4761
4847
|
}
|
|
4762
|
-
), /* @__PURE__ */ React59.createElement(
|
|
4848
|
+
), /* @__PURE__ */ React59.createElement(Stack43, { gap: "xs" }, /* @__PURE__ */ React59.createElement(Text34, { size: "sm", fw: 500, style: { color: "#adb5bd" } }, "Funds (Optional)"), (data.funds || []).map((fund, index) => /* @__PURE__ */ React59.createElement(Card9, { key: index, withBorder: true, padding: "xs", style: { backgroundColor: "#2a2a2a", borderColor: "#333" } }, /* @__PURE__ */ React59.createElement(Group15, { justify: "space-between" }, /* @__PURE__ */ React59.createElement(Text34, { size: "sm", style: { color: "#f1f3f5" } }, fund.amount, " ", fund.denom), /* @__PURE__ */ React59.createElement(Button8, { size: "xs", variant: "subtle", onClick: () => handleRemoveFund(index), style: { color: "#ff6b6b" } }, "Remove")))), /* @__PURE__ */ React59.createElement(Group15, { grow: true }, /* @__PURE__ */ React59.createElement(TextInput17, { placeholder: "Amount", value: newFund.amount, onChange: (e) => setNewFund({ ...newFund, amount: e.currentTarget.value }), styles: inputStyles11 }), /* @__PURE__ */ React59.createElement(TextInput17, { placeholder: "Denom (e.g., uixo)", value: newFund.denom, onChange: (e) => setNewFund({ ...newFund, denom: e.currentTarget.value }), styles: inputStyles11 }), /* @__PURE__ */ React59.createElement(
|
|
4763
4849
|
Button8,
|
|
4764
4850
|
{
|
|
4765
4851
|
size: "sm",
|
|
@@ -4775,7 +4861,7 @@ var InstantiateActionForm = ({ data, onChange }) => {
|
|
|
4775
4861
|
|
|
4776
4862
|
// src/mantine/blocks/proposal/actions-components/forms/MigrateActionForm.tsx
|
|
4777
4863
|
import React60 from "react";
|
|
4778
|
-
import { Stack as
|
|
4864
|
+
import { Stack as Stack44, TextInput as TextInput18, Textarea as Textarea8, NumberInput as NumberInput6 } from "@mantine/core";
|
|
4779
4865
|
var inputStyles12 = {
|
|
4780
4866
|
label: { color: "#adb5bd" },
|
|
4781
4867
|
input: {
|
|
@@ -4796,7 +4882,7 @@ var MigrateActionForm = ({ data, onChange }) => {
|
|
|
4796
4882
|
return data.msg;
|
|
4797
4883
|
}
|
|
4798
4884
|
};
|
|
4799
|
-
return /* @__PURE__ */ React60.createElement(
|
|
4885
|
+
return /* @__PURE__ */ React60.createElement(Stack44, { gap: "md" }, /* @__PURE__ */ React60.createElement(
|
|
4800
4886
|
TextInput18,
|
|
4801
4887
|
{
|
|
4802
4888
|
label: "Contract Address",
|
|
@@ -4833,7 +4919,7 @@ var MigrateActionForm = ({ data, onChange }) => {
|
|
|
4833
4919
|
|
|
4834
4920
|
// src/mantine/blocks/proposal/actions-components/forms/UpdateAdminActionForm.tsx
|
|
4835
4921
|
import React61 from "react";
|
|
4836
|
-
import { Stack as
|
|
4922
|
+
import { Stack as Stack45, TextInput as TextInput19 } from "@mantine/core";
|
|
4837
4923
|
var inputStyles13 = {
|
|
4838
4924
|
label: { color: "#adb5bd" },
|
|
4839
4925
|
input: {
|
|
@@ -4846,7 +4932,7 @@ var inputStyles13 = {
|
|
|
4846
4932
|
}
|
|
4847
4933
|
};
|
|
4848
4934
|
var UpdateAdminActionForm = ({ data, onChange }) => {
|
|
4849
|
-
return /* @__PURE__ */ React61.createElement(
|
|
4935
|
+
return /* @__PURE__ */ React61.createElement(Stack45, { gap: "md" }, /* @__PURE__ */ React61.createElement(
|
|
4850
4936
|
TextInput19,
|
|
4851
4937
|
{
|
|
4852
4938
|
label: "Contract Address",
|
|
@@ -4871,7 +4957,7 @@ var UpdateAdminActionForm = ({ data, onChange }) => {
|
|
|
4871
4957
|
|
|
4872
4958
|
// src/mantine/blocks/proposal/actions-components/forms/ManageCw20ActionForm.tsx
|
|
4873
4959
|
import React62 from "react";
|
|
4874
|
-
import { Stack as
|
|
4960
|
+
import { Stack as Stack46, TextInput as TextInput20, Radio as Radio2, Group as Group16 } from "@mantine/core";
|
|
4875
4961
|
var inputStyles14 = {
|
|
4876
4962
|
label: { color: "#adb5bd" },
|
|
4877
4963
|
input: {
|
|
@@ -4884,7 +4970,7 @@ var inputStyles14 = {
|
|
|
4884
4970
|
}
|
|
4885
4971
|
};
|
|
4886
4972
|
var ManageCw20ActionForm = ({ data, onChange }) => {
|
|
4887
|
-
return /* @__PURE__ */ React62.createElement(
|
|
4973
|
+
return /* @__PURE__ */ React62.createElement(Stack46, { gap: "md" }, /* @__PURE__ */ React62.createElement(Radio2.Group, { label: "Action", value: data.adding ? "add" : "remove", onChange: (value) => onChange({ ...data, adding: value === "add" }) }, /* @__PURE__ */ React62.createElement(Group16, { mt: "xs" }, /* @__PURE__ */ React62.createElement(
|
|
4888
4974
|
Radio2,
|
|
4889
4975
|
{
|
|
4890
4976
|
value: "add",
|
|
@@ -4918,8 +5004,8 @@ var ManageCw20ActionForm = ({ data, onChange }) => {
|
|
|
4918
5004
|
};
|
|
4919
5005
|
|
|
4920
5006
|
// src/mantine/blocks/proposal/actions-components/forms/ManageSubDaosActionForm.tsx
|
|
4921
|
-
import React63, { useState as
|
|
4922
|
-
import { Stack as
|
|
5007
|
+
import React63, { useState as useState14 } from "react";
|
|
5008
|
+
import { Stack as Stack47, TextInput as TextInput21, Button as Button9, Group as Group17, Text as Text35, Card as Card10, Textarea as Textarea9 } from "@mantine/core";
|
|
4923
5009
|
var inputStyles15 = {
|
|
4924
5010
|
label: { color: "#adb5bd" },
|
|
4925
5011
|
input: {
|
|
@@ -4932,8 +5018,8 @@ var inputStyles15 = {
|
|
|
4932
5018
|
}
|
|
4933
5019
|
};
|
|
4934
5020
|
var ManageSubDaosActionForm = ({ data, onChange }) => {
|
|
4935
|
-
const [newSubDao, setNewSubDao] =
|
|
4936
|
-
const [newRemoveAddress, setNewRemoveAddress] =
|
|
5021
|
+
const [newSubDao, setNewSubDao] = useState14({ addr: "", charter: "" });
|
|
5022
|
+
const [newRemoveAddress, setNewRemoveAddress] = useState14("");
|
|
4937
5023
|
const handleAddSubDao = () => {
|
|
4938
5024
|
if (newSubDao.addr) {
|
|
4939
5025
|
onChange({
|
|
@@ -4964,7 +5050,7 @@ var ManageSubDaosActionForm = ({ data, onChange }) => {
|
|
|
4964
5050
|
toRemove: (data.toRemove || []).filter((_, i) => i !== index)
|
|
4965
5051
|
});
|
|
4966
5052
|
};
|
|
4967
|
-
return /* @__PURE__ */ React63.createElement(
|
|
5053
|
+
return /* @__PURE__ */ React63.createElement(Stack47, { gap: "md" }, /* @__PURE__ */ React63.createElement(Stack47, { gap: "xs" }, /* @__PURE__ */ React63.createElement(Text35, { size: "sm", fw: 500, style: { color: "#adb5bd" } }, "SubDAOs to Add"), (data.toAdd || []).map((subDao, index) => /* @__PURE__ */ React63.createElement(Card10, { key: index, withBorder: true, padding: "xs", style: { backgroundColor: "#2a2a2a", borderColor: "#333" } }, /* @__PURE__ */ React63.createElement(Stack47, { gap: "xs" }, /* @__PURE__ */ React63.createElement(Group17, { justify: "space-between" }, /* @__PURE__ */ React63.createElement(Text35, { size: "sm", style: { color: "#f1f3f5" } }, subDao.addr), /* @__PURE__ */ React63.createElement(Button9, { size: "xs", variant: "subtle", onClick: () => handleRemoveFromAddList(index), style: { color: "#ff6b6b" } }, "Remove")), subDao.charter && /* @__PURE__ */ React63.createElement(Text35, { size: "xs", style: { color: "#adb5bd" } }, "Charter: ", subDao.charter)))), /* @__PURE__ */ React63.createElement(Stack47, { gap: "xs" }, /* @__PURE__ */ React63.createElement(TextInput21, { placeholder: "SubDAO Address", value: newSubDao.addr, onChange: (e) => setNewSubDao({ ...newSubDao, addr: e.currentTarget.value }), styles: inputStyles15 }), /* @__PURE__ */ React63.createElement(
|
|
4968
5054
|
Textarea9,
|
|
4969
5055
|
{
|
|
4970
5056
|
placeholder: "Charter (optional)",
|
|
@@ -4984,7 +5070,7 @@ var ManageSubDaosActionForm = ({ data, onChange }) => {
|
|
|
4984
5070
|
}
|
|
4985
5071
|
},
|
|
4986
5072
|
"Add SubDAO"
|
|
4987
|
-
))), /* @__PURE__ */ React63.createElement(
|
|
5073
|
+
))), /* @__PURE__ */ React63.createElement(Stack47, { gap: "xs" }, /* @__PURE__ */ React63.createElement(Text35, { size: "sm", fw: 500, style: { color: "#adb5bd" } }, "SubDAOs to Remove"), (data.toRemove || []).map((subDao, index) => /* @__PURE__ */ React63.createElement(Card10, { key: index, withBorder: true, padding: "xs", style: { backgroundColor: "#2a2a2a", borderColor: "#333" } }, /* @__PURE__ */ React63.createElement(Group17, { justify: "space-between" }, /* @__PURE__ */ React63.createElement(Text35, { size: "sm", style: { color: "#f1f3f5" } }, subDao.address), /* @__PURE__ */ React63.createElement(Button9, { size: "xs", variant: "subtle", onClick: () => handleRemoveFromRemoveList(index), style: { color: "#ff6b6b" } }, "Remove")))), /* @__PURE__ */ React63.createElement(Group17, { grow: true }, /* @__PURE__ */ React63.createElement(TextInput21, { placeholder: "SubDAO Address to Remove", value: newRemoveAddress, onChange: (e) => setNewRemoveAddress(e.currentTarget.value), styles: inputStyles15 }), /* @__PURE__ */ React63.createElement(
|
|
4988
5074
|
Button9,
|
|
4989
5075
|
{
|
|
4990
5076
|
size: "sm",
|
|
@@ -5000,7 +5086,7 @@ var ManageSubDaosActionForm = ({ data, onChange }) => {
|
|
|
5000
5086
|
|
|
5001
5087
|
// src/mantine/blocks/proposal/actions-components/forms/UpdateInfoActionForm.tsx
|
|
5002
5088
|
import React64 from "react";
|
|
5003
|
-
import { Stack as
|
|
5089
|
+
import { Stack as Stack48, TextInput as TextInput22, Textarea as Textarea10, Checkbox as Checkbox5 } from "@mantine/core";
|
|
5004
5090
|
var inputStyles16 = {
|
|
5005
5091
|
label: { color: "#adb5bd" },
|
|
5006
5092
|
input: {
|
|
@@ -5013,7 +5099,7 @@ var inputStyles16 = {
|
|
|
5013
5099
|
}
|
|
5014
5100
|
};
|
|
5015
5101
|
var UpdateInfoActionForm = ({ data, onChange }) => {
|
|
5016
|
-
return /* @__PURE__ */ React64.createElement(
|
|
5102
|
+
return /* @__PURE__ */ React64.createElement(Stack48, { gap: "md" }, /* @__PURE__ */ React64.createElement(TextInput22, { label: "DAO Name", placeholder: "My DAO", value: data.name, onChange: (e) => onChange({ ...data, name: e.currentTarget.value }), required: true, styles: inputStyles16 }), /* @__PURE__ */ React64.createElement(
|
|
5017
5103
|
Textarea10,
|
|
5018
5104
|
{
|
|
5019
5105
|
label: "Description",
|
|
@@ -5068,7 +5154,7 @@ var UpdateInfoActionForm = ({ data, onChange }) => {
|
|
|
5068
5154
|
|
|
5069
5155
|
// src/mantine/blocks/proposal/actions-components/forms/ManageStorageItemsActionForm.tsx
|
|
5070
5156
|
import React65 from "react";
|
|
5071
|
-
import { Stack as
|
|
5157
|
+
import { Stack as Stack49, TextInput as TextInput23, Radio as Radio3, Group as Group18, Textarea as Textarea11 } from "@mantine/core";
|
|
5072
5158
|
var inputStyles17 = {
|
|
5073
5159
|
label: { color: "#adb5bd" },
|
|
5074
5160
|
input: {
|
|
@@ -5081,7 +5167,7 @@ var inputStyles17 = {
|
|
|
5081
5167
|
}
|
|
5082
5168
|
};
|
|
5083
5169
|
var ManageStorageItemsActionForm = ({ data, onChange }) => {
|
|
5084
|
-
return /* @__PURE__ */ React65.createElement(
|
|
5170
|
+
return /* @__PURE__ */ React65.createElement(Stack49, { gap: "md" }, /* @__PURE__ */ React65.createElement(Radio3.Group, { label: "Action", value: data.setting ? "set" : "remove", onChange: (value) => onChange({ ...data, setting: value === "set" }) }, /* @__PURE__ */ React65.createElement(Group18, { mt: "xs" }, /* @__PURE__ */ React65.createElement(
|
|
5085
5171
|
Radio3,
|
|
5086
5172
|
{
|
|
5087
5173
|
value: "set",
|
|
@@ -5116,8 +5202,8 @@ var ManageStorageItemsActionForm = ({ data, onChange }) => {
|
|
|
5116
5202
|
};
|
|
5117
5203
|
|
|
5118
5204
|
// src/mantine/blocks/proposal/actions-components/forms/DaoAdminExecActionForm.tsx
|
|
5119
|
-
import React66, { useState as
|
|
5120
|
-
import { Stack as
|
|
5205
|
+
import React66, { useState as useState15 } from "react";
|
|
5206
|
+
import { Stack as Stack50, TextInput as TextInput24, Button as Button10, Group as Group19, Text as Text36, Card as Card11, Textarea as Textarea12 } from "@mantine/core";
|
|
5121
5207
|
var inputStyles18 = {
|
|
5122
5208
|
label: { color: "#adb5bd" },
|
|
5123
5209
|
input: {
|
|
@@ -5130,7 +5216,7 @@ var inputStyles18 = {
|
|
|
5130
5216
|
}
|
|
5131
5217
|
};
|
|
5132
5218
|
var DaoAdminExecActionForm = ({ data, onChange }) => {
|
|
5133
|
-
const [newMsg, setNewMsg] =
|
|
5219
|
+
const [newMsg, setNewMsg] = useState15("");
|
|
5134
5220
|
const handleAddMessage = () => {
|
|
5135
5221
|
if (newMsg) {
|
|
5136
5222
|
try {
|
|
@@ -5150,7 +5236,7 @@ var DaoAdminExecActionForm = ({ data, onChange }) => {
|
|
|
5150
5236
|
msgs: (data.msgs || []).filter((_, i) => i !== index)
|
|
5151
5237
|
});
|
|
5152
5238
|
};
|
|
5153
|
-
return /* @__PURE__ */ React66.createElement(
|
|
5239
|
+
return /* @__PURE__ */ React66.createElement(Stack50, { gap: "md" }, /* @__PURE__ */ React66.createElement(
|
|
5154
5240
|
TextInput24,
|
|
5155
5241
|
{
|
|
5156
5242
|
label: "Core Address",
|
|
@@ -5160,7 +5246,7 @@ var DaoAdminExecActionForm = ({ data, onChange }) => {
|
|
|
5160
5246
|
required: true,
|
|
5161
5247
|
styles: inputStyles18
|
|
5162
5248
|
}
|
|
5163
|
-
), /* @__PURE__ */ React66.createElement(
|
|
5249
|
+
), /* @__PURE__ */ React66.createElement(Stack50, { gap: "xs" }, /* @__PURE__ */ React66.createElement(Text36, { size: "sm", fw: 500, style: { color: "#adb5bd" } }, "Messages to Execute"), (data.msgs || []).map((msg, index) => /* @__PURE__ */ React66.createElement(Card11, { key: index, withBorder: true, padding: "xs", style: { backgroundColor: "#2a2a2a", borderColor: "#333" } }, /* @__PURE__ */ React66.createElement(Group19, { justify: "space-between" }, /* @__PURE__ */ React66.createElement(Text36, { size: "sm", style: { color: "#f1f3f5" } }, "Message ", index + 1), /* @__PURE__ */ React66.createElement(Button10, { size: "xs", variant: "subtle", onClick: () => handleRemoveMessage(index), style: { color: "#ff6b6b" } }, "Remove")), /* @__PURE__ */ React66.createElement(Text36, { size: "xs", style: { color: "#adb5bd", fontFamily: "monospace" } }, JSON.stringify(msg, null, 2).substring(0, 100), "..."))), /* @__PURE__ */ React66.createElement(
|
|
5164
5250
|
Textarea12,
|
|
5165
5251
|
{
|
|
5166
5252
|
placeholder: 'Add cosmos message as JSON:\\n{"bank": {"send": {"to_address": "ixo1...", "amount": [{"denom": "uixo", "amount": "1000"}]}}}',
|
|
@@ -5185,7 +5271,7 @@ var DaoAdminExecActionForm = ({ data, onChange }) => {
|
|
|
5185
5271
|
|
|
5186
5272
|
// src/mantine/blocks/proposal/actions-components/forms/AcceptToMarketplaceActionForm.tsx
|
|
5187
5273
|
import React67 from "react";
|
|
5188
|
-
import { Stack as
|
|
5274
|
+
import { Stack as Stack51, TextInput as TextInput25 } from "@mantine/core";
|
|
5189
5275
|
var inputStyles19 = {
|
|
5190
5276
|
label: { color: "#adb5bd" },
|
|
5191
5277
|
input: {
|
|
@@ -5198,7 +5284,7 @@ var inputStyles19 = {
|
|
|
5198
5284
|
}
|
|
5199
5285
|
};
|
|
5200
5286
|
var AcceptToMarketplaceActionForm = ({ data, onChange }) => {
|
|
5201
|
-
return /* @__PURE__ */ React67.createElement(
|
|
5287
|
+
return /* @__PURE__ */ React67.createElement(Stack51, { gap: "md" }, /* @__PURE__ */ React67.createElement(TextInput25, { label: "DID", placeholder: "did:ixo:...", value: data.did, onChange: (e) => onChange({ ...data, did: e.currentTarget.value }), required: true, styles: inputStyles19 }), /* @__PURE__ */ React67.createElement(
|
|
5202
5288
|
TextInput25,
|
|
5203
5289
|
{
|
|
5204
5290
|
label: "Relayer Node DID",
|
|
@@ -5223,7 +5309,7 @@ var AcceptToMarketplaceActionForm = ({ data, onChange }) => {
|
|
|
5223
5309
|
|
|
5224
5310
|
// src/mantine/blocks/proposal/actions-components/forms/CreateEntityActionForm.tsx
|
|
5225
5311
|
import React68 from "react";
|
|
5226
|
-
import { Stack as
|
|
5312
|
+
import { Stack as Stack52, Textarea as Textarea13, Alert as Alert7, Text as Text37 } from "@mantine/core";
|
|
5227
5313
|
var inputStyles20 = {
|
|
5228
5314
|
label: { color: "#adb5bd" },
|
|
5229
5315
|
input: {
|
|
@@ -5243,7 +5329,7 @@ var CreateEntityActionForm = ({ data, onChange }) => {
|
|
|
5243
5329
|
} catch {
|
|
5244
5330
|
}
|
|
5245
5331
|
};
|
|
5246
|
-
return /* @__PURE__ */ React68.createElement(
|
|
5332
|
+
return /* @__PURE__ */ React68.createElement(Stack52, { gap: "md" }, /* @__PURE__ */ React68.createElement(Alert7, { color: "blue", style: { backgroundColor: "#2a2a2a", borderColor: "#4dabf7" } }, /* @__PURE__ */ React68.createElement(Text37, { size: "sm", style: { color: "#4dabf7" } }, "This is a complex entity creation action. Please provide the complete entity data as JSON.")), /* @__PURE__ */ React68.createElement(
|
|
5247
5333
|
Textarea13,
|
|
5248
5334
|
{
|
|
5249
5335
|
label: "Entity Data (JSON)",
|
|
@@ -5259,7 +5345,7 @@ var CreateEntityActionForm = ({ data, onChange }) => {
|
|
|
5259
5345
|
|
|
5260
5346
|
// src/mantine/blocks/proposal/actions-components/forms/UpdateVotingConfigActionForm.tsx
|
|
5261
5347
|
import React69 from "react";
|
|
5262
|
-
import { Stack as
|
|
5348
|
+
import { Stack as Stack53, Checkbox as Checkbox6, Select as Select6, NumberInput as NumberInput7, Group as Group20 } from "@mantine/core";
|
|
5263
5349
|
var inputStyles21 = {
|
|
5264
5350
|
label: { color: "#adb5bd" },
|
|
5265
5351
|
input: {
|
|
@@ -5272,7 +5358,7 @@ var inputStyles21 = {
|
|
|
5272
5358
|
}
|
|
5273
5359
|
};
|
|
5274
5360
|
var UpdateVotingConfigActionForm = ({ data, onChange }) => {
|
|
5275
|
-
return /* @__PURE__ */ React69.createElement(
|
|
5361
|
+
return /* @__PURE__ */ React69.createElement(Stack53, { gap: "md" }, /* @__PURE__ */ React69.createElement(
|
|
5276
5362
|
Checkbox6,
|
|
5277
5363
|
{
|
|
5278
5364
|
label: "Only members can execute",
|
|
@@ -5342,7 +5428,7 @@ var UpdateVotingConfigActionForm = ({ data, onChange }) => {
|
|
|
5342
5428
|
suffix: "%",
|
|
5343
5429
|
styles: inputStyles21
|
|
5344
5430
|
}
|
|
5345
|
-
)), /* @__PURE__ */ React69.createElement(
|
|
5431
|
+
)), /* @__PURE__ */ React69.createElement(Group20, { grow: true }, /* @__PURE__ */ React69.createElement(
|
|
5346
5432
|
NumberInput7,
|
|
5347
5433
|
{
|
|
5348
5434
|
label: "Proposal Duration",
|
|
@@ -5382,7 +5468,7 @@ var UpdateVotingConfigActionForm = ({ data, onChange }) => {
|
|
|
5382
5468
|
|
|
5383
5469
|
// src/mantine/blocks/proposal/actions-components/forms/UpdatePreProposeConfigActionForm.tsx
|
|
5384
5470
|
import React70 from "react";
|
|
5385
|
-
import { Stack as
|
|
5471
|
+
import { Stack as Stack54, Checkbox as Checkbox7, TextInput as TextInput26, Select as Select7, Textarea as Textarea14 } from "@mantine/core";
|
|
5386
5472
|
var inputStyles22 = {
|
|
5387
5473
|
label: { color: "#adb5bd" },
|
|
5388
5474
|
input: {
|
|
@@ -5395,7 +5481,7 @@ var inputStyles22 = {
|
|
|
5395
5481
|
}
|
|
5396
5482
|
};
|
|
5397
5483
|
var UpdatePreProposeConfigActionForm = ({ data, onChange }) => {
|
|
5398
|
-
return /* @__PURE__ */ React70.createElement(
|
|
5484
|
+
return /* @__PURE__ */ React70.createElement(Stack54, { gap: "md" }, /* @__PURE__ */ React70.createElement(
|
|
5399
5485
|
Checkbox7,
|
|
5400
5486
|
{
|
|
5401
5487
|
label: "Anyone can propose",
|
|
@@ -5496,7 +5582,7 @@ var UpdatePreProposeConfigActionForm = ({ data, onChange }) => {
|
|
|
5496
5582
|
|
|
5497
5583
|
// src/mantine/blocks/proposal/actions-components/forms/GovernanceVoteActionForm.tsx
|
|
5498
5584
|
import React71 from "react";
|
|
5499
|
-
import { Stack as
|
|
5585
|
+
import { Stack as Stack55, TextInput as TextInput27, Select as Select8 } from "@mantine/core";
|
|
5500
5586
|
var inputStyles23 = {
|
|
5501
5587
|
label: { color: "#adb5bd" },
|
|
5502
5588
|
input: {
|
|
@@ -5515,7 +5601,7 @@ var GovernanceVoteActionForm = ({ data, onChange }) => {
|
|
|
5515
5601
|
{ value: "3", label: "No" },
|
|
5516
5602
|
{ value: "4", label: "No with Veto" }
|
|
5517
5603
|
];
|
|
5518
|
-
return /* @__PURE__ */ React71.createElement(
|
|
5604
|
+
return /* @__PURE__ */ React71.createElement(Stack55, { gap: "md" }, /* @__PURE__ */ React71.createElement(
|
|
5519
5605
|
TextInput27,
|
|
5520
5606
|
{
|
|
5521
5607
|
label: "Proposal ID",
|
|
@@ -5540,7 +5626,7 @@ var GovernanceVoteActionForm = ({ data, onChange }) => {
|
|
|
5540
5626
|
|
|
5541
5627
|
// src/mantine/blocks/proposal/actions-components/forms/WithdrawTokenSwapActionForm.tsx
|
|
5542
5628
|
import React72 from "react";
|
|
5543
|
-
import { Stack as
|
|
5629
|
+
import { Stack as Stack56, TextInput as TextInput28, Checkbox as Checkbox8 } from "@mantine/core";
|
|
5544
5630
|
var inputStyles24 = {
|
|
5545
5631
|
label: { color: "#adb5bd" },
|
|
5546
5632
|
input: {
|
|
@@ -5553,7 +5639,7 @@ var inputStyles24 = {
|
|
|
5553
5639
|
}
|
|
5554
5640
|
};
|
|
5555
5641
|
var WithdrawTokenSwapActionForm = ({ data, onChange }) => {
|
|
5556
|
-
return /* @__PURE__ */ React72.createElement(
|
|
5642
|
+
return /* @__PURE__ */ React72.createElement(Stack56, { gap: "md" }, /* @__PURE__ */ React72.createElement(
|
|
5557
5643
|
Checkbox8,
|
|
5558
5644
|
{
|
|
5559
5645
|
label: "Contract chosen",
|
|
@@ -5579,7 +5665,7 @@ var WithdrawTokenSwapActionForm = ({ data, onChange }) => {
|
|
|
5579
5665
|
|
|
5580
5666
|
// src/mantine/blocks/proposal/actions-components/forms/PerformTokenSwapActionForm.tsx
|
|
5581
5667
|
import React73 from "react";
|
|
5582
|
-
import { Stack as
|
|
5668
|
+
import { Stack as Stack57, TextInput as TextInput29, Checkbox as Checkbox9, Textarea as Textarea15 } from "@mantine/core";
|
|
5583
5669
|
var inputStyles25 = {
|
|
5584
5670
|
label: { color: "#adb5bd" },
|
|
5585
5671
|
input: {
|
|
@@ -5592,7 +5678,7 @@ var inputStyles25 = {
|
|
|
5592
5678
|
}
|
|
5593
5679
|
};
|
|
5594
5680
|
var PerformTokenSwapActionForm = ({ data, onChange }) => {
|
|
5595
|
-
return /* @__PURE__ */ React73.createElement(
|
|
5681
|
+
return /* @__PURE__ */ React73.createElement(Stack57, { gap: "md" }, /* @__PURE__ */ React73.createElement(
|
|
5596
5682
|
Checkbox9,
|
|
5597
5683
|
{
|
|
5598
5684
|
label: "Contract chosen",
|
|
@@ -5650,7 +5736,7 @@ var PerformTokenSwapActionForm = ({ data, onChange }) => {
|
|
|
5650
5736
|
|
|
5651
5737
|
// src/mantine/blocks/proposal/actions-components/forms/StakeToGroupActionForm.tsx
|
|
5652
5738
|
import React74 from "react";
|
|
5653
|
-
import { Stack as
|
|
5739
|
+
import { Stack as Stack58, TextInput as TextInput30 } from "@mantine/core";
|
|
5654
5740
|
var inputStyles26 = {
|
|
5655
5741
|
label: { color: "#adb5bd" },
|
|
5656
5742
|
input: {
|
|
@@ -5663,7 +5749,7 @@ var inputStyles26 = {
|
|
|
5663
5749
|
}
|
|
5664
5750
|
};
|
|
5665
5751
|
var StakeToGroupActionForm = ({ data, onChange }) => {
|
|
5666
|
-
return /* @__PURE__ */ React74.createElement(
|
|
5752
|
+
return /* @__PURE__ */ React74.createElement(Stack58, { gap: "md" }, /* @__PURE__ */ React74.createElement(
|
|
5667
5753
|
TextInput30,
|
|
5668
5754
|
{
|
|
5669
5755
|
label: "Token Contract Address",
|
|
@@ -5688,7 +5774,7 @@ var StakeToGroupActionForm = ({ data, onChange }) => {
|
|
|
5688
5774
|
|
|
5689
5775
|
// src/mantine/blocks/proposal/actions-components/forms/SendGroupTokenActionForm.tsx
|
|
5690
5776
|
import React75 from "react";
|
|
5691
|
-
import { Stack as
|
|
5777
|
+
import { Stack as Stack59, TextInput as TextInput31 } from "@mantine/core";
|
|
5692
5778
|
var inputStyles27 = {
|
|
5693
5779
|
label: { color: "#adb5bd" },
|
|
5694
5780
|
input: {
|
|
@@ -5701,7 +5787,7 @@ var inputStyles27 = {
|
|
|
5701
5787
|
}
|
|
5702
5788
|
};
|
|
5703
5789
|
var SendGroupTokenActionForm = ({ data, onChange }) => {
|
|
5704
|
-
return /* @__PURE__ */ React75.createElement(
|
|
5790
|
+
return /* @__PURE__ */ React75.createElement(Stack59, { gap: "md" }, /* @__PURE__ */ React75.createElement(
|
|
5705
5791
|
TextInput31,
|
|
5706
5792
|
{
|
|
5707
5793
|
label: "Contract Address",
|
|
@@ -5726,7 +5812,7 @@ var SendGroupTokenActionForm = ({ data, onChange }) => {
|
|
|
5726
5812
|
|
|
5727
5813
|
// src/mantine/blocks/proposal/actions-components/forms/ValidatorActionsActionForm.tsx
|
|
5728
5814
|
import React76 from "react";
|
|
5729
|
-
import { Stack as
|
|
5815
|
+
import { Stack as Stack60, Select as Select9, Textarea as Textarea16 } from "@mantine/core";
|
|
5730
5816
|
var inputStyles28 = {
|
|
5731
5817
|
label: { color: "#adb5bd" },
|
|
5732
5818
|
input: {
|
|
@@ -5745,7 +5831,7 @@ var ValidatorActionsActionForm = ({ data, onChange }) => {
|
|
|
5745
5831
|
{ value: "/cosmos.slashing.v1beta1.MsgUnjail" /* UnjailValidator */, label: "Unjail Validator" },
|
|
5746
5832
|
{ value: "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission" /* WithdrawValidatorCommission */, label: "Withdraw Commission" }
|
|
5747
5833
|
];
|
|
5748
|
-
return /* @__PURE__ */ React76.createElement(
|
|
5834
|
+
return /* @__PURE__ */ React76.createElement(Stack60, { gap: "md" }, /* @__PURE__ */ React76.createElement(
|
|
5749
5835
|
Select9,
|
|
5750
5836
|
{
|
|
5751
5837
|
label: "Validator Action Type",
|
|
@@ -6438,8 +6524,8 @@ var ActionsPanel = ({ actions, editingIndex, onSave, onCancel, isTemplateMode =
|
|
|
6438
6524
|
const isEditing = editingIndex !== null;
|
|
6439
6525
|
const editingAction = isEditing ? actions[editingIndex] : null;
|
|
6440
6526
|
const initialActionType = editingAction?.type || "Spend";
|
|
6441
|
-
const [selectedActionType, setSelectedActionType] =
|
|
6442
|
-
const [actionData, setActionData] =
|
|
6527
|
+
const [selectedActionType, setSelectedActionType] = useState16(initialActionType);
|
|
6528
|
+
const [actionData, setActionData] = useState16(() => {
|
|
6443
6529
|
if (editingAction) {
|
|
6444
6530
|
return editingAction.data;
|
|
6445
6531
|
}
|
|
@@ -6448,7 +6534,7 @@ var ActionsPanel = ({ actions, editingIndex, onSave, onCancel, isTemplateMode =
|
|
|
6448
6534
|
});
|
|
6449
6535
|
const currentActionConfig = getActionConfig(selectedActionType);
|
|
6450
6536
|
const categorizedActions = useMemo10(() => getCategorizedActions(), []);
|
|
6451
|
-
|
|
6537
|
+
useEffect11(() => {
|
|
6452
6538
|
if (!isEditing) {
|
|
6453
6539
|
const config = getActionConfig(selectedActionType);
|
|
6454
6540
|
if (config) {
|
|
@@ -6471,7 +6557,7 @@ var ActionsPanel = ({ actions, editingIndex, onSave, onCancel, isTemplateMode =
|
|
|
6471
6557
|
};
|
|
6472
6558
|
const renderActionForm = () => {
|
|
6473
6559
|
if (!currentActionConfig) {
|
|
6474
|
-
return /* @__PURE__ */ React77.createElement(
|
|
6560
|
+
return /* @__PURE__ */ React77.createElement(Alert8, { color: "red", style: { backgroundColor: "#2a2a2a", borderColor: "#ff6b6b" } }, /* @__PURE__ */ React77.createElement(Text38, { size: "sm", style: { color: "#ff6b6b" } }, "Unknown action type selected"));
|
|
6475
6561
|
}
|
|
6476
6562
|
const FormComponent = currentActionConfig.FormComponent;
|
|
6477
6563
|
return /* @__PURE__ */ React77.createElement(FormComponent, { data: actionData, onChange: setActionData, isTemplateMode });
|
|
@@ -6489,7 +6575,7 @@ var ActionsPanel = ({ actions, editingIndex, onSave, onCancel, isTemplateMode =
|
|
|
6489
6575
|
};
|
|
6490
6576
|
return colors[category] || "#6b7280";
|
|
6491
6577
|
};
|
|
6492
|
-
return /* @__PURE__ */ React77.createElement(
|
|
6578
|
+
return /* @__PURE__ */ React77.createElement(Stack61, { style: { backgroundColor: "#1a1a1a", color: "#f1f3f5", height: "100%" } }, /* @__PURE__ */ React77.createElement(Text38, { size: "lg", fw: 600, style: { color: "#f1f3f5" } }, isEditing ? "Edit Action" : "Add New Action"), !isEditing ? /* @__PURE__ */ React77.createElement(Stack61, { gap: "md" }, /* @__PURE__ */ React77.createElement(Text38, { size: "sm", fw: 500, style: { color: "#adb5bd" } }, "Select Action Type"), /* @__PURE__ */ React77.createElement(
|
|
6493
6579
|
Tabs2,
|
|
6494
6580
|
{
|
|
6495
6581
|
defaultValue: ACTION_CATEGORIES[0].id,
|
|
@@ -6510,7 +6596,7 @@ var ActionsPanel = ({ actions, editingIndex, onSave, onCancel, isTemplateMode =
|
|
|
6510
6596
|
panel: { paddingTop: "md" }
|
|
6511
6597
|
}
|
|
6512
6598
|
},
|
|
6513
|
-
/* @__PURE__ */ React77.createElement(Tabs2.List, null, ACTION_CATEGORIES.map((category) => /* @__PURE__ */ React77.createElement(Tabs2.Tab, { key: category.id, value: category.id }, /* @__PURE__ */ React77.createElement(
|
|
6599
|
+
/* @__PURE__ */ React77.createElement(Tabs2.List, null, ACTION_CATEGORIES.map((category) => /* @__PURE__ */ React77.createElement(Tabs2.Tab, { key: category.id, value: category.id }, /* @__PURE__ */ React77.createElement(Group21, { gap: "xs" }, /* @__PURE__ */ React77.createElement("span", null, category.icon), /* @__PURE__ */ React77.createElement("span", null, category.label))))),
|
|
6514
6600
|
ACTION_CATEGORIES.map((category) => /* @__PURE__ */ React77.createElement(Tabs2.Panel, { key: category.id, value: category.id, mt: 10 }, /* @__PURE__ */ React77.createElement(SimpleGrid, { cols: 2, spacing: "xs" }, (categorizedActions.get(category.id) || []).map((config) => /* @__PURE__ */ React77.createElement(
|
|
6515
6601
|
Paper5,
|
|
6516
6602
|
{
|
|
@@ -6525,7 +6611,7 @@ var ActionsPanel = ({ actions, editingIndex, onSave, onCancel, isTemplateMode =
|
|
|
6525
6611
|
},
|
|
6526
6612
|
onClick: () => setSelectedActionType(config.value)
|
|
6527
6613
|
},
|
|
6528
|
-
/* @__PURE__ */ React77.createElement(
|
|
6614
|
+
/* @__PURE__ */ React77.createElement(Stack61, { gap: "xs" }, /* @__PURE__ */ React77.createElement(Group21, { justify: "space-between" }, /* @__PURE__ */ React77.createElement(Text38, { size: "sm", fw: 500, style: { color: "#f1f3f5" } }, config.label), selectedActionType === config.value && /* @__PURE__ */ React77.createElement(Badge8, { size: "xs", style: { backgroundColor: "#4dabf7" } }, "Selected")), config.description && /* @__PURE__ */ React77.createElement(Text38, { size: "xs", style: { color: "#adb5bd" } }, config.description))
|
|
6529
6615
|
)))))
|
|
6530
6616
|
)) : /* @__PURE__ */ React77.createElement(
|
|
6531
6617
|
Card12,
|
|
@@ -6537,7 +6623,7 @@ var ActionsPanel = ({ actions, editingIndex, onSave, onCancel, isTemplateMode =
|
|
|
6537
6623
|
borderColor: "#333"
|
|
6538
6624
|
}
|
|
6539
6625
|
},
|
|
6540
|
-
/* @__PURE__ */ React77.createElement(
|
|
6626
|
+
/* @__PURE__ */ React77.createElement(Group21, { justify: "space-between" }, /* @__PURE__ */ React77.createElement(Group21, { gap: "xs" }, /* @__PURE__ */ React77.createElement(
|
|
6541
6627
|
Badge8,
|
|
6542
6628
|
{
|
|
6543
6629
|
size: "sm",
|
|
@@ -6547,8 +6633,8 @@ var ActionsPanel = ({ actions, editingIndex, onSave, onCancel, isTemplateMode =
|
|
|
6547
6633
|
}
|
|
6548
6634
|
},
|
|
6549
6635
|
currentActionConfig?.label || selectedActionType
|
|
6550
|
-
), /* @__PURE__ */ React77.createElement(
|
|
6551
|
-
), /* @__PURE__ */ React77.createElement(Divider4, { color: "#333" }), /* @__PURE__ */ React77.createElement(ScrollArea3, { style: { flex: 1 } }, renderActionForm()), /* @__PURE__ */ React77.createElement(Divider4, { color: "#333" }), /* @__PURE__ */ React77.createElement(
|
|
6636
|
+
), /* @__PURE__ */ React77.createElement(Text38, { size: "sm", style: { color: "#adb5bd" } }, "(Editing)")))
|
|
6637
|
+
), /* @__PURE__ */ React77.createElement(Divider4, { color: "#333" }), /* @__PURE__ */ React77.createElement(ScrollArea3, { style: { flex: 1 } }, renderActionForm()), /* @__PURE__ */ React77.createElement(Divider4, { color: "#333" }), /* @__PURE__ */ React77.createElement(Stack61, { gap: "xs" }, /* @__PURE__ */ React77.createElement(Text38, { size: "sm", fw: 500, style: { color: "#adb5bd" } }, "Current Actions (", actions.length, ")"), /* @__PURE__ */ React77.createElement(ScrollArea3, { h: 100 }, /* @__PURE__ */ React77.createElement(Stack61, { gap: "xs" }, actions.map((action, index) => {
|
|
6552
6638
|
const config = getActionConfig(action.type);
|
|
6553
6639
|
return /* @__PURE__ */ React77.createElement(
|
|
6554
6640
|
Card12,
|
|
@@ -6563,7 +6649,7 @@ var ActionsPanel = ({ actions, editingIndex, onSave, onCancel, isTemplateMode =
|
|
|
6563
6649
|
opacity: index === editingIndex ? 0.7 : 1
|
|
6564
6650
|
}
|
|
6565
6651
|
},
|
|
6566
|
-
/* @__PURE__ */ React77.createElement(
|
|
6652
|
+
/* @__PURE__ */ React77.createElement(Group21, { gap: "xs" }, /* @__PURE__ */ React77.createElement(
|
|
6567
6653
|
Badge8,
|
|
6568
6654
|
{
|
|
6569
6655
|
size: "sm",
|
|
@@ -6573,9 +6659,9 @@ var ActionsPanel = ({ actions, editingIndex, onSave, onCancel, isTemplateMode =
|
|
|
6573
6659
|
}
|
|
6574
6660
|
},
|
|
6575
6661
|
config?.label || action.type
|
|
6576
|
-
), /* @__PURE__ */ React77.createElement(
|
|
6662
|
+
), /* @__PURE__ */ React77.createElement(Text38, { size: "sm", style: { color: "#adb5bd" } }, config?.getSummary(action.data) || "Action"), index === editingIndex && /* @__PURE__ */ React77.createElement(Badge8, { size: "xs", style: { backgroundColor: "#4dabf7", color: "#fff" } }, "Editing"))
|
|
6577
6663
|
);
|
|
6578
|
-
})))), /* @__PURE__ */ React77.createElement(
|
|
6664
|
+
})))), /* @__PURE__ */ React77.createElement(Group21, { justify: "flex-end", mt: "md" }, /* @__PURE__ */ React77.createElement(
|
|
6579
6665
|
Button11,
|
|
6580
6666
|
{
|
|
6581
6667
|
variant: "default",
|
|
@@ -6612,8 +6698,8 @@ var ActionsPanel = ({ actions, editingIndex, onSave, onCancel, isTemplateMode =
|
|
|
6612
6698
|
|
|
6613
6699
|
// src/mantine/blocks/proposal/template/ActionsTab.tsx
|
|
6614
6700
|
var ActionsTab = ({ actions, onActionsChange, editor, block }) => {
|
|
6615
|
-
const [isEditorVisible, setIsEditorVisible] =
|
|
6616
|
-
const [editingIndex, setEditingIndex] =
|
|
6701
|
+
const [isEditorVisible, setIsEditorVisible] = useState17(false);
|
|
6702
|
+
const [editingIndex, setEditingIndex] = useState17(null);
|
|
6617
6703
|
const parseActions = (actionsJson) => {
|
|
6618
6704
|
if (!actionsJson) return [];
|
|
6619
6705
|
try {
|
|
@@ -6624,7 +6710,7 @@ var ActionsTab = ({ actions, onActionsChange, editor, block }) => {
|
|
|
6624
6710
|
}
|
|
6625
6711
|
};
|
|
6626
6712
|
const currentActions = parseActions(actions);
|
|
6627
|
-
|
|
6713
|
+
useEffect12(() => {
|
|
6628
6714
|
if (currentActions.length === 0 && !isEditorVisible) {
|
|
6629
6715
|
setEditingIndex(null);
|
|
6630
6716
|
setIsEditorVisible(true);
|
|
@@ -6663,7 +6749,7 @@ var ActionsTab = ({ actions, onActionsChange, editor, block }) => {
|
|
|
6663
6749
|
setIsEditorVisible(false);
|
|
6664
6750
|
setEditingIndex(null);
|
|
6665
6751
|
}, []);
|
|
6666
|
-
return /* @__PURE__ */ React78.createElement(
|
|
6752
|
+
return /* @__PURE__ */ React78.createElement(Stack62, { gap: "md" }, /* @__PURE__ */ React78.createElement(ActionsCard, { actions: currentActions, isSelected: false, onClick: () => {
|
|
6667
6753
|
}, onEditAction: handleEditAction, onRemoveAction: handleRemoveAction }), isEditorVisible && /* @__PURE__ */ React78.createElement(
|
|
6668
6754
|
Card13,
|
|
6669
6755
|
{
|
|
@@ -6681,9 +6767,9 @@ var ActionsTab = ({ actions, onActionsChange, editor, block }) => {
|
|
|
6681
6767
|
|
|
6682
6768
|
// src/mantine/blocks/proposal/template/VoteTab.tsx
|
|
6683
6769
|
import React79 from "react";
|
|
6684
|
-
import { Stack as
|
|
6770
|
+
import { Stack as Stack63, TextInput as TextInput32 } from "@mantine/core";
|
|
6685
6771
|
var VoteTab = ({ voteTitle, voteSubtitle, voteIcon, onVoteTitleChange, onVoteSubtitleChange, onVoteIconChange }) => {
|
|
6686
|
-
return /* @__PURE__ */ React79.createElement(
|
|
6772
|
+
return /* @__PURE__ */ React79.createElement(Stack63, { gap: "md" }, /* @__PURE__ */ React79.createElement(TextInput32, { label: "Vote Button Title", placeholder: "Vote on this proposal", value: voteTitle, onChange: (event) => onVoteTitleChange(event.currentTarget.value) }), /* @__PURE__ */ React79.createElement(TextInput32, { label: "Vote Button Subtitle", placeholder: "Cast your vote", value: voteSubtitle, onChange: (event) => onVoteSubtitleChange(event.currentTarget.value) }), /* @__PURE__ */ React79.createElement(TextInput32, { label: "Vote Icon", placeholder: "checklist", value: voteIcon, onChange: (event) => onVoteIconChange(event.currentTarget.value) }));
|
|
6687
6773
|
};
|
|
6688
6774
|
|
|
6689
6775
|
// src/mantine/blocks/proposal/template/TemplateConfig.tsx
|
|
@@ -6771,13 +6857,13 @@ var TemplateConfig3 = ({ editor, block }) => {
|
|
|
6771
6857
|
};
|
|
6772
6858
|
|
|
6773
6859
|
// src/mantine/blocks/proposal/template/TemplateView.tsx
|
|
6774
|
-
import { Card as Card14, Group as
|
|
6860
|
+
import { Card as Card14, Group as Group22, Stack as Stack64, Text as Text39, ActionIcon as ActionIcon8 } from "@mantine/core";
|
|
6775
6861
|
var PROPOSAL_TEMPLATE_PANEL_ID = "proposal-template-panel";
|
|
6776
6862
|
var ProposalTemplateView = ({ editor, block }) => {
|
|
6777
6863
|
const panelId = `${PROPOSAL_TEMPLATE_PANEL_ID}-${block.id}`;
|
|
6778
6864
|
const panelContent = useMemo11(() => /* @__PURE__ */ React81.createElement(TemplateConfig3, { editor, block }), [editor, block]);
|
|
6779
6865
|
const { open } = usePanel(panelId, panelContent);
|
|
6780
|
-
return /* @__PURE__ */ React81.createElement(Card14, { withBorder: true, padding: "md", radius: "md", style: { width: "100%", cursor: "pointer" }, onClick: open }, /* @__PURE__ */ React81.createElement(
|
|
6866
|
+
return /* @__PURE__ */ React81.createElement(Card14, { withBorder: true, padding: "md", radius: "md", style: { width: "100%", cursor: "pointer" }, onClick: open }, /* @__PURE__ */ React81.createElement(Group22, { wrap: "nowrap", justify: "space-between", align: "center" }, /* @__PURE__ */ React81.createElement(Group22, { wrap: "nowrap", align: "center" }, /* @__PURE__ */ React81.createElement(ActionIcon8, { variant: "light", color: "blue", size: "lg", radius: "xl", style: { flexShrink: 0 } }, getIcon(block.props.icon, 18, 1.5, "file-text")), /* @__PURE__ */ React81.createElement(Stack64, { gap: "xs", style: { flex: 1 } }, /* @__PURE__ */ React81.createElement(Text39, { fw: 500, size: "sm", contentEditable: false }, block.props.title || "Proposal Title"), /* @__PURE__ */ React81.createElement(Text39, { size: "xs", c: "dimmed", contentEditable: false }, block.props.description || "Proposal description"))), /* @__PURE__ */ React81.createElement(Text39, { size: "xs", c: "dimmed", contentEditable: false }, block.props.status || "draft")));
|
|
6781
6867
|
};
|
|
6782
6868
|
|
|
6783
6869
|
// src/mantine/blocks/proposal/flow/FlowView.tsx
|
|
@@ -6785,7 +6871,7 @@ import React86, { useMemo as useMemo12 } from "react";
|
|
|
6785
6871
|
|
|
6786
6872
|
// src/mantine/blocks/proposal/components/OnChainProposalCard.tsx
|
|
6787
6873
|
import React82 from "react";
|
|
6788
|
-
import { Card as Card15, Group as
|
|
6874
|
+
import { Card as Card15, Group as Group23, Stack as Stack65, Text as Text40, Skeleton, Badge as Badge9, Button as Button13, ActionIcon as ActionIcon9 } from "@mantine/core";
|
|
6789
6875
|
var statusColor = {
|
|
6790
6876
|
open: "#4dabf7",
|
|
6791
6877
|
passed: "#51cf66",
|
|
@@ -6827,9 +6913,9 @@ var OnChainProposalCard = ({
|
|
|
6827
6913
|
},
|
|
6828
6914
|
onClick
|
|
6829
6915
|
},
|
|
6830
|
-
isFetching && /* @__PURE__ */ React82.createElement(
|
|
6831
|
-
error && /* @__PURE__ */ React82.createElement(
|
|
6832
|
-
!isFetching && /* @__PURE__ */ React82.createElement(
|
|
6916
|
+
isFetching && /* @__PURE__ */ React82.createElement(Stack65, null, /* @__PURE__ */ React82.createElement(Skeleton, { height: 20, width: "70%" }), /* @__PURE__ */ React82.createElement(Skeleton, { height: 16 }), /* @__PURE__ */ React82.createElement(Skeleton, { height: 16, width: "40%" })),
|
|
6917
|
+
error && /* @__PURE__ */ React82.createElement(Text40, { size: "sm", c: "red" }, typeof error === "string" ? error : error.message || "An error occurred while loading the proposal."),
|
|
6918
|
+
!isFetching && /* @__PURE__ */ React82.createElement(Group23, { justify: "space-between", align: "flex-start" }, /* @__PURE__ */ React82.createElement(Group23, { align: "flex-start", gap: "md", style: { flex: 1 } }, /* @__PURE__ */ React82.createElement(ActionIcon9, { variant: "light", color: "blue", size: "xl", radius: "xl", style: { flexShrink: 0 } }, getIcon(icon, 24, 1.5, "file-text")), /* @__PURE__ */ React82.createElement(Stack65, { gap: "xs", style: { flex: 1 } }, /* @__PURE__ */ React82.createElement(Group23, { gap: "xs" }, /* @__PURE__ */ React82.createElement(Text40, { size: "md", fw: 600 }, title || "Proposal"), /* @__PURE__ */ React82.createElement(Badge9, { color: statusColor[status], variant: "filled", size: "sm", radius: "sm" }, status.replace(/_/g, " ").toUpperCase())), /* @__PURE__ */ React82.createElement(Text40, { size: "sm", c: "dimmed" }, getDisplayDescription(description)))), /* @__PURE__ */ React82.createElement(Group23, { gap: "xs" }, voteEnabled && onVote && status === "open" && /* @__PURE__ */ React82.createElement(
|
|
6833
6919
|
Button13,
|
|
6834
6920
|
{
|
|
6835
6921
|
size: "sm",
|
|
@@ -6861,11 +6947,11 @@ var OnChainProposalCard = ({
|
|
|
6861
6947
|
};
|
|
6862
6948
|
|
|
6863
6949
|
// src/mantine/blocks/proposal/flow/FlowConfig.tsx
|
|
6864
|
-
import React85, { useCallback as useCallback15, useState as
|
|
6865
|
-
import { Paper as Paper7, CloseButton as CloseButton5, Title as Title6, Stack as
|
|
6950
|
+
import React85, { useCallback as useCallback15, useState as useState22, useEffect as useEffect16 } from "react";
|
|
6951
|
+
import { Paper as Paper7, CloseButton as CloseButton5, Title as Title6, Stack as Stack68, TextInput as TextInput33, Textarea as Textarea18, Button as Button16, Text as Text43, Card as Card18, Select as Select10, Loader as Loader5, SegmentedControl as SegmentedControl5 } from "@mantine/core";
|
|
6866
6952
|
|
|
6867
6953
|
// src/mantine/blocks/proposal/flow/useFlowBusinessLogic.ts
|
|
6868
|
-
import { useEffect as
|
|
6954
|
+
import { useEffect as useEffect13, useState as useState18 } from "react";
|
|
6869
6955
|
var CHAIN_STATUSES = ["open", "passed", "rejected", "executed", "closed", "execution_failed", "veto_timelock"];
|
|
6870
6956
|
var isChainStatus = (value) => {
|
|
6871
6957
|
return CHAIN_STATUSES.includes(value);
|
|
@@ -6875,9 +6961,9 @@ var parseStatus = (value) => {
|
|
|
6875
6961
|
return isChainStatus(value) ? value : null;
|
|
6876
6962
|
};
|
|
6877
6963
|
var useFlowBusinessLogic = ({ block, editor }) => {
|
|
6878
|
-
const [proposalContractAddress, setProposalContractAddress] =
|
|
6879
|
-
const [isExecuting, setIsExecuting] =
|
|
6880
|
-
const [executionError, setExecutionError] =
|
|
6964
|
+
const [proposalContractAddress, setProposalContractAddress] = useState18(null);
|
|
6965
|
+
const [isExecuting, setIsExecuting] = useState18(false);
|
|
6966
|
+
const [executionError, setExecutionError] = useState18(null);
|
|
6881
6967
|
let handlers = null;
|
|
6882
6968
|
try {
|
|
6883
6969
|
handlers = useBlocknoteHandlers();
|
|
@@ -6908,7 +6994,7 @@ var useFlowBusinessLogic = ({ block, editor }) => {
|
|
|
6908
6994
|
props: { ...block.props, ...nextProps }
|
|
6909
6995
|
});
|
|
6910
6996
|
};
|
|
6911
|
-
|
|
6997
|
+
useEffect13(() => {
|
|
6912
6998
|
if (!handlers || !coreAddress || !proposalId) {
|
|
6913
6999
|
setProposalContractAddress(null);
|
|
6914
7000
|
return;
|
|
@@ -6931,7 +7017,7 @@ var useFlowBusinessLogic = ({ block, editor }) => {
|
|
|
6931
7017
|
isCancelled = true;
|
|
6932
7018
|
};
|
|
6933
7019
|
}, [handlers, coreAddress, proposalId]);
|
|
6934
|
-
|
|
7020
|
+
useEffect13(() => {
|
|
6935
7021
|
if (!proposal) return;
|
|
6936
7022
|
const chainStatus = proposal.proposal.status;
|
|
6937
7023
|
const parsedStatus = parseStatus(chainStatus);
|
|
@@ -7015,11 +7101,11 @@ var useFlowBusinessLogic = ({ block, editor }) => {
|
|
|
7015
7101
|
};
|
|
7016
7102
|
|
|
7017
7103
|
// src/mantine/blocks/proposal/flow/useVoteBusinessLogic.ts
|
|
7018
|
-
import { useState as
|
|
7104
|
+
import { useState as useState19, useEffect as useEffect14 } from "react";
|
|
7019
7105
|
var useVoteBusinessLogic = ({ block, editor }) => {
|
|
7020
|
-
const [localError, setLocalError] =
|
|
7021
|
-
const [userVote, setUserVote] =
|
|
7022
|
-
const [proposalContractAddress, setProposalContractAddress] =
|
|
7106
|
+
const [localError, setLocalError] = useState19(null);
|
|
7107
|
+
const [userVote, setUserVote] = useState19(null);
|
|
7108
|
+
const [proposalContractAddress, setProposalContractAddress] = useState19(null);
|
|
7023
7109
|
let handlers = null;
|
|
7024
7110
|
try {
|
|
7025
7111
|
handlers = useBlocknoteHandlers();
|
|
@@ -7031,7 +7117,7 @@ var useVoteBusinessLogic = ({ block, editor }) => {
|
|
|
7031
7117
|
const description = block.props.description || "";
|
|
7032
7118
|
const status = block.props.status || "draft";
|
|
7033
7119
|
const coreAddress = block.props.coreAddress || "";
|
|
7034
|
-
|
|
7120
|
+
useEffect14(() => {
|
|
7035
7121
|
if (!handlers || !coreAddress || !proposalId) {
|
|
7036
7122
|
setProposalContractAddress(null);
|
|
7037
7123
|
return;
|
|
@@ -7054,7 +7140,7 @@ var useVoteBusinessLogic = ({ block, editor }) => {
|
|
|
7054
7140
|
isCancelled = true;
|
|
7055
7141
|
};
|
|
7056
7142
|
}, [handlers, coreAddress, proposalId]);
|
|
7057
|
-
|
|
7143
|
+
useEffect14(() => {
|
|
7058
7144
|
if (!handlers || !proposalContractAddress || !proposalId) {
|
|
7059
7145
|
return;
|
|
7060
7146
|
}
|
|
@@ -7102,8 +7188,8 @@ var useVoteBusinessLogic = ({ block, editor }) => {
|
|
|
7102
7188
|
};
|
|
7103
7189
|
|
|
7104
7190
|
// src/mantine/blocks/proposal/flow/VoteGeneralTab.tsx
|
|
7105
|
-
import React83, { useState as
|
|
7106
|
-
import { Stack as
|
|
7191
|
+
import React83, { useState as useState20 } from "react";
|
|
7192
|
+
import { Stack as Stack66, Text as Text41, Group as Group24, Card as Card16, Button as Button14, Progress as Progress2, Box as Box18, Textarea as Textarea17, Tooltip as Tooltip3 } from "@mantine/core";
|
|
7107
7193
|
var getVoteIcon = (voteType) => {
|
|
7108
7194
|
switch (voteType) {
|
|
7109
7195
|
case "yes":
|
|
@@ -7129,8 +7215,8 @@ var FlowGeneralTab = ({
|
|
|
7129
7215
|
isDisabled
|
|
7130
7216
|
}) => {
|
|
7131
7217
|
const disabled = isDisabled?.isDisabled === "disable";
|
|
7132
|
-
const [selectedVote, setSelectedVote] =
|
|
7133
|
-
const [rationale, setRationale] =
|
|
7218
|
+
const [selectedVote, setSelectedVote] = useState20("");
|
|
7219
|
+
const [rationale, setRationale] = useState20("");
|
|
7134
7220
|
const hasSubmittedProposal = Boolean(proposalId);
|
|
7135
7221
|
const hasVoted = Boolean(userVote?.vote);
|
|
7136
7222
|
const handleSlideToSign = () => {
|
|
@@ -7145,7 +7231,7 @@ var FlowGeneralTab = ({
|
|
|
7145
7231
|
setRationale("");
|
|
7146
7232
|
}
|
|
7147
7233
|
};
|
|
7148
|
-
return /* @__PURE__ */ React83.createElement(
|
|
7234
|
+
return /* @__PURE__ */ React83.createElement(Stack66, { gap: "lg" }, !hasSubmittedProposal && /* @__PURE__ */ React83.createElement(
|
|
7149
7235
|
Card16,
|
|
7150
7236
|
{
|
|
7151
7237
|
padding: "md",
|
|
@@ -7156,8 +7242,8 @@ var FlowGeneralTab = ({
|
|
|
7156
7242
|
color: "#f1f3f5"
|
|
7157
7243
|
}
|
|
7158
7244
|
},
|
|
7159
|
-
/* @__PURE__ */ React83.createElement(
|
|
7160
|
-
|
|
7245
|
+
/* @__PURE__ */ React83.createElement(Group24, { gap: "xs", align: "center" }, /* @__PURE__ */ React83.createElement(
|
|
7246
|
+
Box18,
|
|
7161
7247
|
{
|
|
7162
7248
|
style: {
|
|
7163
7249
|
width: 8,
|
|
@@ -7166,8 +7252,8 @@ var FlowGeneralTab = ({
|
|
|
7166
7252
|
borderRadius: "50%"
|
|
7167
7253
|
}
|
|
7168
7254
|
}
|
|
7169
|
-
), /* @__PURE__ */ React83.createElement(
|
|
7170
|
-
/* @__PURE__ */ React83.createElement(
|
|
7255
|
+
), /* @__PURE__ */ React83.createElement(Text41, { size: "sm", fw: 500, style: { color: "#ffd43b" } }, "Waiting for Proposal Submission")),
|
|
7256
|
+
/* @__PURE__ */ React83.createElement(Text41, { size: "xs", style: { color: "#adb5bd", marginTop: 4 } }, "The connected proposal needs to be submitted before voting can begin.")
|
|
7171
7257
|
), /* @__PURE__ */ React83.createElement(
|
|
7172
7258
|
Card16,
|
|
7173
7259
|
{
|
|
@@ -7180,8 +7266,8 @@ var FlowGeneralTab = ({
|
|
|
7180
7266
|
opacity: !hasSubmittedProposal ? 0.6 : 1
|
|
7181
7267
|
}
|
|
7182
7268
|
},
|
|
7183
|
-
/* @__PURE__ */ React83.createElement(
|
|
7184
|
-
|
|
7269
|
+
/* @__PURE__ */ React83.createElement(Stack66, { gap: "xs" }, /* @__PURE__ */ React83.createElement(Group24, { justify: "space-between" }, /* @__PURE__ */ React83.createElement(Group24, { gap: "xs" }, /* @__PURE__ */ React83.createElement(
|
|
7270
|
+
Box18,
|
|
7185
7271
|
{
|
|
7186
7272
|
w: 8,
|
|
7187
7273
|
h: 8,
|
|
@@ -7190,8 +7276,8 @@ var FlowGeneralTab = ({
|
|
|
7190
7276
|
borderRadius: "50%"
|
|
7191
7277
|
}
|
|
7192
7278
|
}
|
|
7193
|
-
), /* @__PURE__ */ React83.createElement(
|
|
7194
|
-
|
|
7279
|
+
), /* @__PURE__ */ React83.createElement(Text41, { size: "sm", style: { color: "#adb5bd" } }, "Status")), /* @__PURE__ */ React83.createElement(Text41, { size: "sm", fw: 500, style: { color: "#f1f3f5" } }, hasSubmittedProposal ? proposalStatus === "open" ? "Active" : proposalStatus || "Active" : "Waiting")), /* @__PURE__ */ React83.createElement(Group24, { justify: "space-between" }, /* @__PURE__ */ React83.createElement(Group24, { gap: "xs" }, /* @__PURE__ */ React83.createElement(Box18, { w: 8, h: 8, style: { backgroundColor: "#adb5bd", borderRadius: "50%" } }), /* @__PURE__ */ React83.createElement(Text41, { size: "sm", style: { color: "#adb5bd" } }, "Proposal ID")), /* @__PURE__ */ React83.createElement(Text41, { size: "sm", fw: 500, style: { color: "#f1f3f5" } }, hasSubmittedProposal ? `#${proposalId}` : "TBD")), /* @__PURE__ */ React83.createElement(Group24, { justify: "space-between" }, /* @__PURE__ */ React83.createElement(Group24, { gap: "xs" }, /* @__PURE__ */ React83.createElement(Box18, { w: 8, h: 8, style: { backgroundColor: "#adb5bd", borderRadius: "50%" } }), /* @__PURE__ */ React83.createElement(Text41, { size: "sm", style: { color: "#adb5bd" } }, "Title")), /* @__PURE__ */ React83.createElement(
|
|
7280
|
+
Text41,
|
|
7195
7281
|
{
|
|
7196
7282
|
size: "sm",
|
|
7197
7283
|
fw: 500,
|
|
@@ -7200,8 +7286,8 @@ var FlowGeneralTab = ({
|
|
|
7200
7286
|
}
|
|
7201
7287
|
},
|
|
7202
7288
|
hasSubmittedProposal ? proposalTitle || "Untitled" : "N/A"
|
|
7203
|
-
)), /* @__PURE__ */ React83.createElement(
|
|
7204
|
-
/* @__PURE__ */ React83.createElement(
|
|
7289
|
+
)), /* @__PURE__ */ React83.createElement(Group24, { justify: "space-between" }, /* @__PURE__ */ React83.createElement(Group24, { gap: "xs" }, /* @__PURE__ */ React83.createElement(Box18, { w: 8, h: 8, style: { backgroundColor: "#adb5bd", borderRadius: "50%" } }), /* @__PURE__ */ React83.createElement(Text41, { size: "sm", style: { color: "#adb5bd" } }, "Description")), /* @__PURE__ */ React83.createElement(Text41, { size: "sm", fw: 500, style: { color: "#f1f3f5" }, title: proposalDescription }, hasSubmittedProposal ? proposalDescription ? proposalDescription.length > 30 ? proposalDescription.substring(0, 30) + "..." : proposalDescription : "No description" : "N/A")), /* @__PURE__ */ React83.createElement(Group24, { justify: "space-between" }, /* @__PURE__ */ React83.createElement(Group24, { gap: "xs" }, /* @__PURE__ */ React83.createElement(Box18, { w: 8, h: 8, style: { backgroundColor: "#adb5bd", borderRadius: "50%" } }), /* @__PURE__ */ React83.createElement(Text41, { size: "sm", style: { color: "#adb5bd" } }, "My Vote")), /* @__PURE__ */ React83.createElement(Text41, { size: "sm", fw: 500, style: { color: "#f1f3f5" } }, hasSubmittedProposal ? userVote?.vote ? userVote.vote.vote : "Pending" : "N/A"))),
|
|
7290
|
+
/* @__PURE__ */ React83.createElement(Stack66, { gap: "xs" }, /* @__PURE__ */ React83.createElement(Text41, { size: "sm", style: { color: "#adb5bd" } }, hasSubmittedProposal ? "Voting is open" : "Voting pending"), /* @__PURE__ */ React83.createElement(
|
|
7205
7291
|
Progress2,
|
|
7206
7292
|
{
|
|
7207
7293
|
value: hasSubmittedProposal ? 75 : 0,
|
|
@@ -7214,7 +7300,7 @@ var FlowGeneralTab = ({
|
|
|
7214
7300
|
}
|
|
7215
7301
|
}
|
|
7216
7302
|
))
|
|
7217
|
-
), hasSubmittedProposal && !hasVoted && (status === "open" || proposalStatus === "open") && /* @__PURE__ */ React83.createElement(
|
|
7303
|
+
), hasSubmittedProposal && !hasVoted && (status === "open" || proposalStatus === "open") && /* @__PURE__ */ React83.createElement(Stack66, { gap: "lg" }, disabled && isDisabled?.message && /* @__PURE__ */ React83.createElement(
|
|
7218
7304
|
Card16,
|
|
7219
7305
|
{
|
|
7220
7306
|
padding: "md",
|
|
@@ -7225,8 +7311,8 @@ var FlowGeneralTab = ({
|
|
|
7225
7311
|
color: "#f1f3f5"
|
|
7226
7312
|
}
|
|
7227
7313
|
},
|
|
7228
|
-
/* @__PURE__ */ React83.createElement(
|
|
7229
|
-
|
|
7314
|
+
/* @__PURE__ */ React83.createElement(Group24, { gap: "xs", align: "center" }, /* @__PURE__ */ React83.createElement(
|
|
7315
|
+
Box18,
|
|
7230
7316
|
{
|
|
7231
7317
|
style: {
|
|
7232
7318
|
width: 8,
|
|
@@ -7235,8 +7321,8 @@ var FlowGeneralTab = ({
|
|
|
7235
7321
|
borderRadius: "50%"
|
|
7236
7322
|
}
|
|
7237
7323
|
}
|
|
7238
|
-
), /* @__PURE__ */ React83.createElement(
|
|
7239
|
-
), /* @__PURE__ */ React83.createElement(
|
|
7324
|
+
), /* @__PURE__ */ React83.createElement(Text41, { size: "sm", fw: 500, style: { color: "#ffd43b" } }, isDisabled.message))
|
|
7325
|
+
), /* @__PURE__ */ React83.createElement(Stack66, { gap: "md" }, ["yes", "no", "no_with_veto", "abstain"].map((voteType) => /* @__PURE__ */ React83.createElement(Tooltip3, { key: voteType, label: disabled ? isDisabled?.message : void 0, disabled: !disabled, position: "top" }, /* @__PURE__ */ React83.createElement(
|
|
7240
7326
|
Button14,
|
|
7241
7327
|
{
|
|
7242
7328
|
variant: "outline",
|
|
@@ -7255,8 +7341,8 @@ var FlowGeneralTab = ({
|
|
|
7255
7341
|
opacity: disabled ? 0.5 : 1
|
|
7256
7342
|
}
|
|
7257
7343
|
},
|
|
7258
|
-
/* @__PURE__ */ React83.createElement(
|
|
7259
|
-
)))), /* @__PURE__ */ React83.createElement(
|
|
7344
|
+
/* @__PURE__ */ React83.createElement(Text41, { fw: 500, tt: "capitalize", style: { textAlign: "left" } }, voteType === "no_with_veto" ? "No with Veto" : voteType)
|
|
7345
|
+
)))), /* @__PURE__ */ React83.createElement(Stack66, { gap: "xs" }, /* @__PURE__ */ React83.createElement(Text41, { size: "sm", style: { color: "#adb5bd" } }, "Rationale (optional)"), /* @__PURE__ */ React83.createElement(
|
|
7260
7346
|
Textarea17,
|
|
7261
7347
|
{
|
|
7262
7348
|
value: rationale,
|
|
@@ -7283,8 +7369,8 @@ var FlowGeneralTab = ({
|
|
|
7283
7369
|
border: "1px solid #333"
|
|
7284
7370
|
}
|
|
7285
7371
|
},
|
|
7286
|
-
/* @__PURE__ */ React83.createElement(
|
|
7287
|
-
), !hasSubmittedProposal && /* @__PURE__ */ React83.createElement(
|
|
7372
|
+
/* @__PURE__ */ React83.createElement(Stack66, { gap: "xs" }, /* @__PURE__ */ React83.createElement(Text41, { fw: 500, size: "sm", style: { color: "#f1f3f5" } }, "Proposal Executed"), /* @__PURE__ */ React83.createElement(Text41, { size: "sm", style: { color: "#adb5bd" } }, "This proposal has been successfully executed."))
|
|
7373
|
+
), !hasSubmittedProposal && /* @__PURE__ */ React83.createElement(Stack66, { gap: "lg" }, /* @__PURE__ */ React83.createElement(Stack66, { gap: "md" }, ["yes", "no", "no_with_veto", "abstain"].map((voteType) => /* @__PURE__ */ React83.createElement(Tooltip3, { key: voteType, label: "Proposal must be submitted before voting", position: "top" }, /* @__PURE__ */ React83.createElement(
|
|
7288
7374
|
Button14,
|
|
7289
7375
|
{
|
|
7290
7376
|
variant: "outline",
|
|
@@ -7301,7 +7387,7 @@ var FlowGeneralTab = ({
|
|
|
7301
7387
|
opacity: 0.5
|
|
7302
7388
|
}
|
|
7303
7389
|
},
|
|
7304
|
-
/* @__PURE__ */ React83.createElement(
|
|
7390
|
+
/* @__PURE__ */ React83.createElement(Text41, { fw: 500, tt: "capitalize", style: { textAlign: "left" } }, voteType === "no_with_veto" ? "No with Veto" : voteType)
|
|
7305
7391
|
))))), hasSubmittedProposal && !hasVoted && selectedVote && (status === "open" || proposalStatus === "open") && /* @__PURE__ */ React83.createElement(Tooltip3, { label: disabled ? isDisabled?.message : "Sign to vote", position: "top" }, /* @__PURE__ */ React83.createElement("div", null, /* @__PURE__ */ React83.createElement(
|
|
7306
7392
|
Button14,
|
|
7307
7393
|
{
|
|
@@ -7329,8 +7415,8 @@ var FlowGeneralTab = ({
|
|
|
7329
7415
|
color: "#f1f3f5"
|
|
7330
7416
|
}
|
|
7331
7417
|
},
|
|
7332
|
-
/* @__PURE__ */ React83.createElement(
|
|
7333
|
-
|
|
7418
|
+
/* @__PURE__ */ React83.createElement(Stack66, { gap: "xs" }, /* @__PURE__ */ React83.createElement(Group24, { gap: "xs", align: "center" }, /* @__PURE__ */ React83.createElement(
|
|
7419
|
+
Box18,
|
|
7334
7420
|
{
|
|
7335
7421
|
style: {
|
|
7336
7422
|
width: 8,
|
|
@@ -7339,16 +7425,16 @@ var FlowGeneralTab = ({
|
|
|
7339
7425
|
borderRadius: "50%"
|
|
7340
7426
|
}
|
|
7341
7427
|
}
|
|
7342
|
-
), /* @__PURE__ */ React83.createElement(
|
|
7428
|
+
), /* @__PURE__ */ React83.createElement(Text41, { size: "sm", fw: 500, style: { color: "#51cf66" } }, "Vote Submitted")), /* @__PURE__ */ React83.createElement(Text41, { size: "xs", style: { color: "#adb5bd" } }, "You have already voted on this proposal. Your vote:", " ", /* @__PURE__ */ React83.createElement(Text41, { span: true, fw: 500, tt: "capitalize" }, userVote?.vote?.vote)))
|
|
7343
7429
|
));
|
|
7344
7430
|
};
|
|
7345
7431
|
|
|
7346
7432
|
// src/mantine/blocks/proposal/flow/ActionsTab.tsx
|
|
7347
|
-
import React84, { useCallback as useCallback14, useEffect as
|
|
7348
|
-
import { Alert as
|
|
7433
|
+
import React84, { useCallback as useCallback14, useEffect as useEffect15, useState as useState21 } from "react";
|
|
7434
|
+
import { Alert as Alert9, Button as Button15, Card as Card17, Stack as Stack67, Text as Text42 } from "@mantine/core";
|
|
7349
7435
|
var ActionsTab2 = ({ actions, onActionsChange, editor, block, isProposalCreated }) => {
|
|
7350
|
-
const [isEditorVisible, setIsEditorVisible] =
|
|
7351
|
-
const [editingIndex, setEditingIndex] =
|
|
7436
|
+
const [isEditorVisible, setIsEditorVisible] = useState21(false);
|
|
7437
|
+
const [editingIndex, setEditingIndex] = useState21(null);
|
|
7352
7438
|
const parseActions = (actionsJson) => {
|
|
7353
7439
|
if (!actionsJson) return [];
|
|
7354
7440
|
try {
|
|
@@ -7359,7 +7445,7 @@ var ActionsTab2 = ({ actions, onActionsChange, editor, block, isProposalCreated
|
|
|
7359
7445
|
}
|
|
7360
7446
|
};
|
|
7361
7447
|
const currentActions = parseActions(actions);
|
|
7362
|
-
|
|
7448
|
+
useEffect15(() => {
|
|
7363
7449
|
if (!isProposalCreated && currentActions.length === 0 && !isEditorVisible) {
|
|
7364
7450
|
setEditingIndex(null);
|
|
7365
7451
|
setIsEditorVisible(true);
|
|
@@ -7404,7 +7490,7 @@ var ActionsTab2 = ({ actions, onActionsChange, editor, block, isProposalCreated
|
|
|
7404
7490
|
setIsEditorVisible(false);
|
|
7405
7491
|
setEditingIndex(null);
|
|
7406
7492
|
}, []);
|
|
7407
|
-
return /* @__PURE__ */ React84.createElement(
|
|
7493
|
+
return /* @__PURE__ */ React84.createElement(Stack67, { gap: "md" }, isProposalCreated && /* @__PURE__ */ React84.createElement(Alert9, { color: "yellow", title: "Actions Locked" }, /* @__PURE__ */ React84.createElement(Text42, { size: "sm" }, "Actions cannot be edited after the proposal has been created. These actions are now part of the on-chain proposal.")), /* @__PURE__ */ React84.createElement(Stack67, { gap: "sm" }, !isProposalCreated && /* @__PURE__ */ React84.createElement(
|
|
7408
7494
|
Button15,
|
|
7409
7495
|
{
|
|
7410
7496
|
onClick: handleAddAction,
|
|
@@ -7447,12 +7533,12 @@ var FlowConfig = ({ editor, block }) => {
|
|
|
7447
7533
|
const { closePanel } = usePanelStore();
|
|
7448
7534
|
const handlers = useBlocknoteHandlers();
|
|
7449
7535
|
const coreAddress = block.props.coreAddress || "";
|
|
7450
|
-
const [errors, setErrors] =
|
|
7451
|
-
const [isCreating, setIsCreating] =
|
|
7452
|
-
const [groups, setGroups] =
|
|
7453
|
-
const [loadingGroups, setLoadingGroups] =
|
|
7454
|
-
const [inputMode, setInputMode] =
|
|
7455
|
-
const [manualAddress, setManualAddress] =
|
|
7536
|
+
const [errors, setErrors] = useState22({});
|
|
7537
|
+
const [isCreating, setIsCreating] = useState22(false);
|
|
7538
|
+
const [groups, setGroups] = useState22([]);
|
|
7539
|
+
const [loadingGroups, setLoadingGroups] = useState22(false);
|
|
7540
|
+
const [inputMode, setInputMode] = useState22("select");
|
|
7541
|
+
const [manualAddress, setManualAddress] = useState22("");
|
|
7456
7542
|
const { createProposal, title, description, proposalId } = useFlowBusinessLogic({
|
|
7457
7543
|
block,
|
|
7458
7544
|
editor
|
|
@@ -7470,7 +7556,7 @@ var FlowConfig = ({ editor, block }) => {
|
|
|
7470
7556
|
},
|
|
7471
7557
|
[editor, block]
|
|
7472
7558
|
);
|
|
7473
|
-
|
|
7559
|
+
useEffect16(() => {
|
|
7474
7560
|
if (coreAddress) {
|
|
7475
7561
|
const matchesGroup = groups.some((g) => g.coreAddress === coreAddress);
|
|
7476
7562
|
if (matchesGroup) {
|
|
@@ -7481,7 +7567,7 @@ var FlowConfig = ({ editor, block }) => {
|
|
|
7481
7567
|
}
|
|
7482
7568
|
}
|
|
7483
7569
|
}, [coreAddress, groups]);
|
|
7484
|
-
|
|
7570
|
+
useEffect16(() => {
|
|
7485
7571
|
const fetchGroups = async () => {
|
|
7486
7572
|
if (!handlers?.getDAOGroups) {
|
|
7487
7573
|
console.warn("getDAOGroups handler not available");
|
|
@@ -7525,7 +7611,7 @@ var FlowConfig = ({ editor, block }) => {
|
|
|
7525
7611
|
setIsCreating(false);
|
|
7526
7612
|
}
|
|
7527
7613
|
};
|
|
7528
|
-
const createProposalTab = /* @__PURE__ */ React85.createElement(
|
|
7614
|
+
const createProposalTab = /* @__PURE__ */ React85.createElement(Stack68, { gap: "lg" }, /* @__PURE__ */ React85.createElement(Stack68, { gap: "xs" }, /* @__PURE__ */ React85.createElement(Text43, { size: "sm", fw: 600 }, "DAO Group"), /* @__PURE__ */ React85.createElement(
|
|
7529
7615
|
SegmentedControl5,
|
|
7530
7616
|
{
|
|
7531
7617
|
value: inputMode,
|
|
@@ -7555,7 +7641,7 @@ var FlowConfig = ({ editor, block }) => {
|
|
|
7555
7641
|
label: group.name
|
|
7556
7642
|
})),
|
|
7557
7643
|
disabled: loadingGroups || isProposalCreated,
|
|
7558
|
-
rightSection: loadingGroups ? /* @__PURE__ */ React85.createElement(
|
|
7644
|
+
rightSection: loadingGroups ? /* @__PURE__ */ React85.createElement(Loader5, { size: "xs" }) : void 0,
|
|
7559
7645
|
searchable: true
|
|
7560
7646
|
}
|
|
7561
7647
|
) : /* @__PURE__ */ React85.createElement(
|
|
@@ -7570,7 +7656,7 @@ var FlowConfig = ({ editor, block }) => {
|
|
|
7570
7656
|
},
|
|
7571
7657
|
disabled: isProposalCreated
|
|
7572
7658
|
}
|
|
7573
|
-
), coreAddress && /* @__PURE__ */ React85.createElement(Card18, { padding: "sm", radius: "md", withBorder: true }, /* @__PURE__ */ React85.createElement(
|
|
7659
|
+
), coreAddress && /* @__PURE__ */ React85.createElement(Card18, { padding: "sm", radius: "md", withBorder: true }, /* @__PURE__ */ React85.createElement(Text43, { size: "xs", c: "dimmed" }, "Core Address:", " ", /* @__PURE__ */ React85.createElement(Text43, { span: true, ff: "monospace", c: "bright" }, coreAddress.slice(0, 20), "...", coreAddress.slice(-10))))), /* @__PURE__ */ React85.createElement(
|
|
7574
7660
|
TextInput33,
|
|
7575
7661
|
{
|
|
7576
7662
|
label: "Title",
|
|
@@ -7593,7 +7679,7 @@ var FlowConfig = ({ editor, block }) => {
|
|
|
7593
7679
|
required: true,
|
|
7594
7680
|
disabled: isProposalCreated
|
|
7595
7681
|
}
|
|
7596
|
-
), errors.general && /* @__PURE__ */ React85.createElement(
|
|
7682
|
+
), errors.general && /* @__PURE__ */ React85.createElement(Text43, { size: "sm", c: "red" }, errors.general), isProposalCreated && /* @__PURE__ */ React85.createElement(Card18, { padding: "md", radius: "md", withBorder: true, style: { borderColor: "var(--mantine-color-green-6)" } }, /* @__PURE__ */ React85.createElement(Text43, { fw: 500, size: "sm", c: "green" }, "Proposal Created Successfully"), /* @__PURE__ */ React85.createElement(Text43, { size: "sm", c: "dimmed" }, "Your proposal has been created and is now open for voting.")), /* @__PURE__ */ React85.createElement(Button16, { fullWidth: true, onClick: handleCreateProposal, disabled: isProposalCreated, loading: isCreating }, isProposalCreated ? "Proposal Created" : "Create Proposal"));
|
|
7597
7683
|
const handleActionsChange = useCallback15(
|
|
7598
7684
|
(newActions) => {
|
|
7599
7685
|
updateProp("actions", JSON.stringify(newActions));
|
|
@@ -7781,19 +7867,19 @@ import React93, { useCallback as useCallback17, useMemo as useMemo15 } from "rea
|
|
|
7781
7867
|
import { Paper as Paper10, CloseButton as CloseButton6, Title as Title7 } from "@mantine/core";
|
|
7782
7868
|
|
|
7783
7869
|
// src/mantine/blocks/apiRequest/template/GeneralTab.tsx
|
|
7784
|
-
import React91, { useEffect as
|
|
7785
|
-
import { Divider as Divider5, Select as Select11, Stack as
|
|
7870
|
+
import React91, { useEffect as useEffect17, useState as useState25 } from "react";
|
|
7871
|
+
import { Divider as Divider5, Select as Select11, Stack as Stack70, Text as Text45, TextInput as TextInput34, Textarea as Textarea19, Button as Button18, Group as Group27, ActionIcon as ActionIcon12, Paper as Paper8 } from "@mantine/core";
|
|
7786
7872
|
import { IconTrash, IconPlus } from "@tabler/icons-react";
|
|
7787
7873
|
|
|
7788
7874
|
// src/mantine/components/DataInput/DataInput.tsx
|
|
7789
|
-
import React90, { useState as
|
|
7790
|
-
import { Input as Input2, ActionIcon as ActionIcon11, Tooltip as Tooltip5, Badge as Badge11, Group as
|
|
7875
|
+
import React90, { useState as useState24, useCallback as useCallback16, useMemo as useMemo14 } from "react";
|
|
7876
|
+
import { Input as Input2, ActionIcon as ActionIcon11, Tooltip as Tooltip5, Badge as Badge11, Group as Group26 } from "@mantine/core";
|
|
7791
7877
|
import { IconVariable, IconX as IconX2 } from "@tabler/icons-react";
|
|
7792
7878
|
|
|
7793
7879
|
// src/mantine/components/DataInput/BlockPropSelector.tsx
|
|
7794
|
-
import React89, { useState as
|
|
7795
|
-
import { Popover, Text as
|
|
7796
|
-
import { IconSearch, IconX, IconCircle, IconChevronRight, IconArrowLeft } from "@tabler/icons-react";
|
|
7880
|
+
import React89, { useState as useState23, useMemo as useMemo13 } from "react";
|
|
7881
|
+
import { Popover, Text as Text44, Stack as Stack69, Group as Group25, ActionIcon as ActionIcon10, Input, ScrollArea as ScrollArea4, Badge as Badge10, Box as Box19, Tooltip as Tooltip4 } from "@mantine/core";
|
|
7882
|
+
import { IconSearch, IconX, IconCircle, IconChevronRight as IconChevronRight2, IconArrowLeft } from "@tabler/icons-react";
|
|
7797
7883
|
function buildPropertyTree(properties) {
|
|
7798
7884
|
const root = [];
|
|
7799
7885
|
properties.forEach((prop) => {
|
|
@@ -7842,9 +7928,9 @@ function getBlockTypeColor(blockType) {
|
|
|
7842
7928
|
return colorMap[blockType] || "gray";
|
|
7843
7929
|
}
|
|
7844
7930
|
function BlockPropSelector({ children, opened, onClose, onSelect, editorDocument, currentBlockId }) {
|
|
7845
|
-
const [searchQuery, setSearchQuery] =
|
|
7846
|
-
const [selectedBlock, setSelectedBlock] =
|
|
7847
|
-
const [navigationPath, setNavigationPath] =
|
|
7931
|
+
const [searchQuery, setSearchQuery] = useState23("");
|
|
7932
|
+
const [selectedBlock, setSelectedBlock] = useState23(null);
|
|
7933
|
+
const [navigationPath, setNavigationPath] = useState23([]);
|
|
7848
7934
|
const availableBlocks = useMemo13(() => {
|
|
7849
7935
|
if (!editorDocument) return [];
|
|
7850
7936
|
return editorDocument.filter((block) => {
|
|
@@ -7915,7 +8001,7 @@ function BlockPropSelector({ children, opened, onClose, onSelect, editorDocument
|
|
|
7915
8001
|
setSearchQuery("");
|
|
7916
8002
|
onClose();
|
|
7917
8003
|
};
|
|
7918
|
-
return /* @__PURE__ */ React89.createElement(Popover, { opened, onClose: handleClose, position: "bottom-end", width: 420, shadow: "md", withinPortal: true }, /* @__PURE__ */ React89.createElement(Popover.Target, null, children), /* @__PURE__ */ React89.createElement(Popover.Dropdown, { p: "md" }, /* @__PURE__ */ React89.createElement(
|
|
8004
|
+
return /* @__PURE__ */ React89.createElement(Popover, { opened, onClose: handleClose, position: "bottom-end", width: 420, shadow: "md", withinPortal: true }, /* @__PURE__ */ React89.createElement(Popover.Target, null, children), /* @__PURE__ */ React89.createElement(Popover.Dropdown, { p: "md" }, /* @__PURE__ */ React89.createElement(Stack69, { gap: "md" }, /* @__PURE__ */ React89.createElement(Group25, { justify: "space-between", align: "center" }, /* @__PURE__ */ React89.createElement(Group25, { gap: "xs" }, (selectedBlock || navigationPath.length > 0) && /* @__PURE__ */ React89.createElement(ActionIcon10, { variant: "subtle", size: "sm", onClick: handleBack }, /* @__PURE__ */ React89.createElement(IconArrowLeft, { size: 16 })), /* @__PURE__ */ React89.createElement(Text44, { fw: 600, size: "sm" }, !selectedBlock ? "Select a Block" : navigationPath.length === 0 ? `${selectedBlock.displayName} - Select Property` : `${navigationPath[navigationPath.length - 1].displayName}`)), /* @__PURE__ */ React89.createElement(ActionIcon10, { variant: "subtle", size: "sm", onClick: handleClose }, /* @__PURE__ */ React89.createElement(IconX, { size: 16 }))), !selectedBlock && /* @__PURE__ */ React89.createElement(
|
|
7919
8005
|
Input,
|
|
7920
8006
|
{
|
|
7921
8007
|
placeholder: "Search blocks and properties...",
|
|
@@ -7927,8 +8013,8 @@ function BlockPropSelector({ children, opened, onClose, onSelect, editorDocument
|
|
|
7927
8013
|
}
|
|
7928
8014
|
), /* @__PURE__ */ React89.createElement(ScrollArea4, { h: 300, type: "auto" }, !selectedBlock ? (
|
|
7929
8015
|
// Block selection view
|
|
7930
|
-
filteredBlocks.length === 0 ? /* @__PURE__ */ React89.createElement(
|
|
7931
|
-
|
|
8016
|
+
filteredBlocks.length === 0 ? /* @__PURE__ */ React89.createElement(Text44, { c: "dimmed", ta: "center", py: "xl", size: "sm" }, availableBlocks.length === 0 ? "No blocks with referenceable properties found" : "No blocks match your search") : /* @__PURE__ */ React89.createElement(Stack69, { gap: "sm" }, filteredBlocks.map((block) => /* @__PURE__ */ React89.createElement(
|
|
8017
|
+
Box19,
|
|
7932
8018
|
{
|
|
7933
8019
|
key: block.id,
|
|
7934
8020
|
onClick: () => handleBlockSelect(block),
|
|
@@ -7948,19 +8034,19 @@ function BlockPropSelector({ children, opened, onClose, onSelect, editorDocument
|
|
|
7948
8034
|
e.currentTarget.style.borderColor = "var(--mantine-color-gray-3)";
|
|
7949
8035
|
}
|
|
7950
8036
|
},
|
|
7951
|
-
/* @__PURE__ */ React89.createElement(
|
|
8037
|
+
/* @__PURE__ */ React89.createElement(Group25, { gap: "xs", justify: "space-between" }, /* @__PURE__ */ React89.createElement(Group25, { gap: "xs" }, /* @__PURE__ */ React89.createElement(
|
|
7952
8038
|
IconCircle,
|
|
7953
8039
|
{
|
|
7954
8040
|
size: 10,
|
|
7955
8041
|
fill: `var(--mantine-color-${getBlockTypeColor(block.type)}-6)`,
|
|
7956
8042
|
color: `var(--mantine-color-${getBlockTypeColor(block.type)}-6)`
|
|
7957
8043
|
}
|
|
7958
|
-
), /* @__PURE__ */ React89.createElement(
|
|
8044
|
+
), /* @__PURE__ */ React89.createElement(Text44, { fw: 500, size: "sm" }, block.displayName), /* @__PURE__ */ React89.createElement(Badge10, { size: "xs", variant: "light", color: getBlockTypeColor(block.type) }, block.type)), /* @__PURE__ */ React89.createElement(IconChevronRight2, { size: 16, color: "var(--mantine-color-gray-5)" }))
|
|
7959
8045
|
)))
|
|
7960
8046
|
) : (
|
|
7961
8047
|
// Property navigation view
|
|
7962
|
-
currentNodes.length === 0 ? /* @__PURE__ */ React89.createElement(
|
|
7963
|
-
|
|
8048
|
+
currentNodes.length === 0 ? /* @__PURE__ */ React89.createElement(Text44, { c: "dimmed", ta: "center", py: "xl", size: "sm" }, "No properties available") : /* @__PURE__ */ React89.createElement(Stack69, { gap: "xs" }, currentNodes.map((node, index) => /* @__PURE__ */ React89.createElement(Tooltip4, { key: index, label: node.isLeaf ? `Select ${node.displayName}` : `Navigate into ${node.displayName}`, position: "left", withArrow: true }, /* @__PURE__ */ React89.createElement(
|
|
8049
|
+
Box19,
|
|
7964
8050
|
{
|
|
7965
8051
|
onClick: () => handleNodeClick(node),
|
|
7966
8052
|
style: {
|
|
@@ -7979,7 +8065,7 @@ function BlockPropSelector({ children, opened, onClose, onSelect, editorDocument
|
|
|
7979
8065
|
e.currentTarget.style.borderColor = "transparent";
|
|
7980
8066
|
}
|
|
7981
8067
|
},
|
|
7982
|
-
/* @__PURE__ */ React89.createElement(
|
|
8068
|
+
/* @__PURE__ */ React89.createElement(Group25, { gap: "xs", justify: "space-between" }, /* @__PURE__ */ React89.createElement(Group25, { gap: "xs" }, /* @__PURE__ */ React89.createElement(Text44, { size: "sm" }, node.displayName), /* @__PURE__ */ React89.createElement(Badge10, { size: "xs", variant: "dot", color: "gray" }, node.type)), !node.isLeaf && /* @__PURE__ */ React89.createElement(IconChevronRight2, { size: 16, color: "var(--mantine-color-gray-5)" }))
|
|
7983
8069
|
))))
|
|
7984
8070
|
)))));
|
|
7985
8071
|
}
|
|
@@ -8089,7 +8175,7 @@ function DataInput({
|
|
|
8089
8175
|
required,
|
|
8090
8176
|
size = "sm"
|
|
8091
8177
|
}) {
|
|
8092
|
-
const [selectorOpened, setSelectorOpened] =
|
|
8178
|
+
const [selectorOpened, setSelectorOpened] = useState24(false);
|
|
8093
8179
|
const containsReferences = useMemo14(() => {
|
|
8094
8180
|
return hasReferences(value);
|
|
8095
8181
|
}, [value]);
|
|
@@ -8128,7 +8214,7 @@ function DataInput({
|
|
|
8128
8214
|
size,
|
|
8129
8215
|
style: { width: "100%" },
|
|
8130
8216
|
rightSectionPointerEvents: "all",
|
|
8131
|
-
rightSection: /* @__PURE__ */ React90.createElement(
|
|
8217
|
+
rightSection: /* @__PURE__ */ React90.createElement(Group26, { gap: 4, wrap: "nowrap" }, containsReferences && /* @__PURE__ */ React90.createElement(Tooltip5, { label: "Click to clear all references", position: "left" }, /* @__PURE__ */ React90.createElement(Badge11, { size: "sm", variant: "light", color: "blue", style: { cursor: "pointer" }, onClick: handleClearReferences, leftSection: /* @__PURE__ */ React90.createElement(IconX2, { size: 10 }) }, references.length, " ref", references.length !== 1 ? "s" : "")), /* @__PURE__ */ React90.createElement(
|
|
8132
8218
|
BlockPropSelector,
|
|
8133
8219
|
{
|
|
8134
8220
|
opened: selectorOpened,
|
|
@@ -8170,18 +8256,18 @@ var GeneralTab4 = ({
|
|
|
8170
8256
|
editor,
|
|
8171
8257
|
blockId
|
|
8172
8258
|
}) => {
|
|
8173
|
-
const [localTitle, setLocalTitle] =
|
|
8174
|
-
const [localDescription, setLocalDescription] =
|
|
8175
|
-
const [localEndpoint, setLocalEndpoint] =
|
|
8176
|
-
const [localMethod, setLocalMethod] =
|
|
8177
|
-
const [localHeaders, setLocalHeaders] =
|
|
8178
|
-
const [localBody, setLocalBody] =
|
|
8179
|
-
|
|
8180
|
-
|
|
8181
|
-
|
|
8182
|
-
|
|
8183
|
-
|
|
8184
|
-
|
|
8259
|
+
const [localTitle, setLocalTitle] = useState25(title || "");
|
|
8260
|
+
const [localDescription, setLocalDescription] = useState25(description || "");
|
|
8261
|
+
const [localEndpoint, setLocalEndpoint] = useState25(endpoint || "");
|
|
8262
|
+
const [localMethod, setLocalMethod] = useState25(method || "GET");
|
|
8263
|
+
const [localHeaders, setLocalHeaders] = useState25(headers || []);
|
|
8264
|
+
const [localBody, setLocalBody] = useState25(body || []);
|
|
8265
|
+
useEffect17(() => setLocalTitle(title || ""), [title]);
|
|
8266
|
+
useEffect17(() => setLocalDescription(description || ""), [description]);
|
|
8267
|
+
useEffect17(() => setLocalEndpoint(endpoint || ""), [endpoint]);
|
|
8268
|
+
useEffect17(() => setLocalMethod(method || "GET"), [method]);
|
|
8269
|
+
useEffect17(() => setLocalHeaders(headers || []), [headers]);
|
|
8270
|
+
useEffect17(() => setLocalBody(body || []), [body]);
|
|
8185
8271
|
const handleAddHeader = () => {
|
|
8186
8272
|
const newHeaders = [...localHeaders, { key: "", value: "" }];
|
|
8187
8273
|
setLocalHeaders(newHeaders);
|
|
@@ -8214,7 +8300,7 @@ var GeneralTab4 = ({
|
|
|
8214
8300
|
setLocalBody(newBody);
|
|
8215
8301
|
onBodyChange(newBody);
|
|
8216
8302
|
};
|
|
8217
|
-
return /* @__PURE__ */ React91.createElement(
|
|
8303
|
+
return /* @__PURE__ */ React91.createElement(Stack70, { gap: "lg" }, /* @__PURE__ */ React91.createElement(Stack70, { gap: "xs" }, /* @__PURE__ */ React91.createElement(Text45, { size: "sm", fw: 600 }, "Title"), /* @__PURE__ */ React91.createElement(
|
|
8218
8304
|
TextInput34,
|
|
8219
8305
|
{
|
|
8220
8306
|
placeholder: "e.g. Submit User Data",
|
|
@@ -8225,7 +8311,7 @@ var GeneralTab4 = ({
|
|
|
8225
8311
|
onTitleChange(newTitle);
|
|
8226
8312
|
}
|
|
8227
8313
|
}
|
|
8228
|
-
)), /* @__PURE__ */ React91.createElement(
|
|
8314
|
+
)), /* @__PURE__ */ React91.createElement(Stack70, { gap: "xs" }, /* @__PURE__ */ React91.createElement(Text45, { size: "sm", fw: 600 }, "Description"), /* @__PURE__ */ React91.createElement(
|
|
8229
8315
|
Textarea19,
|
|
8230
8316
|
{
|
|
8231
8317
|
placeholder: "Describe what this API request does",
|
|
@@ -8237,7 +8323,7 @@ var GeneralTab4 = ({
|
|
|
8237
8323
|
onDescriptionChange(newDescription);
|
|
8238
8324
|
}
|
|
8239
8325
|
}
|
|
8240
|
-
)), /* @__PURE__ */ React91.createElement(Divider5, { variant: "dashed" }), /* @__PURE__ */ React91.createElement(
|
|
8326
|
+
)), /* @__PURE__ */ React91.createElement(Divider5, { variant: "dashed" }), /* @__PURE__ */ React91.createElement(Stack70, { gap: "xs" }, /* @__PURE__ */ React91.createElement(Text45, { size: "sm", fw: 600 }, "HTTP Method"), /* @__PURE__ */ React91.createElement(
|
|
8241
8327
|
Select11,
|
|
8242
8328
|
{
|
|
8243
8329
|
value: localMethod,
|
|
@@ -8254,7 +8340,7 @@ var GeneralTab4 = ({
|
|
|
8254
8340
|
{ value: "PATCH", label: "PATCH" }
|
|
8255
8341
|
]
|
|
8256
8342
|
}
|
|
8257
|
-
)), /* @__PURE__ */ React91.createElement(
|
|
8343
|
+
)), /* @__PURE__ */ React91.createElement(Stack70, { gap: "xs" }, /* @__PURE__ */ React91.createElement(Text45, { size: "sm", fw: 600 }, "Endpoint URL"), /* @__PURE__ */ React91.createElement(
|
|
8258
8344
|
TextInput34,
|
|
8259
8345
|
{
|
|
8260
8346
|
placeholder: "https://api.example.com/endpoint",
|
|
@@ -8265,7 +8351,7 @@ var GeneralTab4 = ({
|
|
|
8265
8351
|
onEndpointChange(newEndpoint);
|
|
8266
8352
|
}
|
|
8267
8353
|
}
|
|
8268
|
-
)), /* @__PURE__ */ React91.createElement(Divider5, { variant: "dashed" }), /* @__PURE__ */ React91.createElement(
|
|
8354
|
+
)), /* @__PURE__ */ React91.createElement(Divider5, { variant: "dashed" }), /* @__PURE__ */ React91.createElement(Stack70, { gap: "xs" }, /* @__PURE__ */ React91.createElement(Group27, { justify: "space-between" }, /* @__PURE__ */ React91.createElement(Text45, { size: "sm", fw: 600 }, "Request Headers"), /* @__PURE__ */ React91.createElement(Button18, { size: "xs", variant: "light", leftSection: /* @__PURE__ */ React91.createElement(IconPlus, { size: 14 }), onClick: handleAddHeader }, "Add Header")), /* @__PURE__ */ React91.createElement(Text45, { size: "xs" }, "Add custom headers to your API request (e.g., Authorization, Content-Type)"), localHeaders.length > 0 && /* @__PURE__ */ React91.createElement(Stack70, { gap: "xs" }, localHeaders.map((header, index) => /* @__PURE__ */ React91.createElement(Paper8, { key: index, p: "xs" }, /* @__PURE__ */ React91.createElement(Group27, { gap: "xs", align: "flex-start" }, /* @__PURE__ */ React91.createElement(
|
|
8269
8355
|
DataInput,
|
|
8270
8356
|
{
|
|
8271
8357
|
placeholder: "Header key (e.g., Authorization)",
|
|
@@ -8285,7 +8371,7 @@ var GeneralTab4 = ({
|
|
|
8285
8371
|
currentBlockId: blockId,
|
|
8286
8372
|
size: "sm"
|
|
8287
8373
|
}
|
|
8288
|
-
), /* @__PURE__ */ React91.createElement(ActionIcon12, { color: "red", variant: "subtle", onClick: () => handleRemoveHeader(index) }, /* @__PURE__ */ React91.createElement(IconTrash, { size: 16 }))))))), /* @__PURE__ */ React91.createElement(Divider5, { variant: "dashed" }), /* @__PURE__ */ React91.createElement(
|
|
8374
|
+
), /* @__PURE__ */ React91.createElement(ActionIcon12, { color: "red", variant: "subtle", onClick: () => handleRemoveHeader(index) }, /* @__PURE__ */ React91.createElement(IconTrash, { size: 16 }))))))), /* @__PURE__ */ React91.createElement(Divider5, { variant: "dashed" }), /* @__PURE__ */ React91.createElement(Stack70, { gap: "xs" }, /* @__PURE__ */ React91.createElement(Group27, { justify: "space-between" }, /* @__PURE__ */ React91.createElement(Text45, { size: "sm", fw: 600 }, "Request Body (JSON)"), /* @__PURE__ */ React91.createElement(Button18, { size: "xs", variant: "light", leftSection: /* @__PURE__ */ React91.createElement(IconPlus, { size: 14 }), onClick: handleAddBodyField }, "Add Field")), /* @__PURE__ */ React91.createElement(Text45, { size: "xs" }, "Build your JSON request body as key-value pairs"), localBody.length > 0 && /* @__PURE__ */ React91.createElement(Stack70, { gap: "xs" }, localBody.map((field, index) => /* @__PURE__ */ React91.createElement(Paper8, { key: index, p: "xs" }, /* @__PURE__ */ React91.createElement(Group27, { gap: "xs", align: "flex-start" }, /* @__PURE__ */ React91.createElement(
|
|
8289
8375
|
DataInput,
|
|
8290
8376
|
{
|
|
8291
8377
|
placeholder: "Field key (e.g., name)",
|
|
@@ -8310,7 +8396,7 @@ var GeneralTab4 = ({
|
|
|
8310
8396
|
|
|
8311
8397
|
// src/mantine/blocks/apiRequest/template/ResponseSchemaTab.tsx
|
|
8312
8398
|
import React92 from "react";
|
|
8313
|
-
import { Stack as
|
|
8399
|
+
import { Stack as Stack71, Text as Text46, Button as Button19, Group as Group28, ActionIcon as ActionIcon13, Paper as Paper9, TextInput as TextInput35, Select as Select12, Textarea as Textarea20, Alert as Alert10, Code } from "@mantine/core";
|
|
8314
8400
|
import { IconTrash as IconTrash2, IconPlus as IconPlus2, IconInfoCircle } from "@tabler/icons-react";
|
|
8315
8401
|
var ResponseSchemaTab = ({ schema, onSchemaChange, blockId }) => {
|
|
8316
8402
|
const fields = schema?.fields || [];
|
|
@@ -8335,7 +8421,7 @@ var ResponseSchemaTab = ({ schema, onSchemaChange, blockId }) => {
|
|
|
8335
8421
|
newFields[index] = { ...newFields[index], [key]: value };
|
|
8336
8422
|
onSchemaChange({ fields: newFields });
|
|
8337
8423
|
};
|
|
8338
|
-
return /* @__PURE__ */ React92.createElement(
|
|
8424
|
+
return /* @__PURE__ */ React92.createElement(Stack71, { gap: "lg" }, /* @__PURE__ */ React92.createElement(Alert10, { icon: /* @__PURE__ */ React92.createElement(IconInfoCircle, { size: 16 }), title: "Response Schema", color: "blue" }, /* @__PURE__ */ React92.createElement(Text46, { size: "xs" }, "Define the expected structure of your API response. This allows other blocks to reference specific fields from the response data using the DataInput component.")), /* @__PURE__ */ React92.createElement(Stack71, { gap: "xs" }, /* @__PURE__ */ React92.createElement(Text46, { size: "sm", fw: 600 }, "How it works"), /* @__PURE__ */ React92.createElement(Text46, { size: "xs", c: "dimmed" }, "1. Define response fields using dot notation (e.g., ", /* @__PURE__ */ React92.createElement(Code, null, "customer.email"), ")"), /* @__PURE__ */ React92.createElement(Text46, { size: "xs", c: "dimmed" }, "2. Fields become available in DataInput selectors across other blocks"), /* @__PURE__ */ React92.createElement(Text46, { size: "xs", c: "dimmed" }, "3. Reference them like: ", /* @__PURE__ */ React92.createElement(Code, null, `{{${blockId}.response.customer.email}}`))), /* @__PURE__ */ React92.createElement(Stack71, { gap: "xs" }, /* @__PURE__ */ React92.createElement(Group28, { justify: "space-between" }, /* @__PURE__ */ React92.createElement(Text46, { size: "sm", fw: 600 }, "Response Fields"), /* @__PURE__ */ React92.createElement(Button19, { size: "xs", variant: "light", leftSection: /* @__PURE__ */ React92.createElement(IconPlus2, { size: 14 }), onClick: handleAddField }, "Add Field")), fields.length === 0 ? /* @__PURE__ */ React92.createElement(Paper9, { p: "md", withBorder: true, style: { backgroundColor: "var(--mantine-color-gray-0)" } }, /* @__PURE__ */ React92.createElement(Text46, { size: "sm", c: "dimmed", ta: "center" }, 'No response fields defined yet. Click "Add Field" to start defining your response structure.')) : /* @__PURE__ */ React92.createElement(Stack71, { gap: "md" }, fields.map((field, index) => /* @__PURE__ */ React92.createElement(Paper9, { key: index, p: "md", withBorder: true }, /* @__PURE__ */ React92.createElement(Stack71, { gap: "sm" }, /* @__PURE__ */ React92.createElement(Group28, { justify: "space-between", align: "flex-start" }, /* @__PURE__ */ React92.createElement(Text46, { size: "sm", fw: 500 }, "Field ", index + 1), /* @__PURE__ */ React92.createElement(ActionIcon13, { color: "red", variant: "subtle", onClick: () => handleRemoveField(index) }, /* @__PURE__ */ React92.createElement(IconTrash2, { size: 16 }))), /* @__PURE__ */ React92.createElement(
|
|
8339
8425
|
TextInput35,
|
|
8340
8426
|
{
|
|
8341
8427
|
label: "Field Path",
|
|
@@ -8383,7 +8469,7 @@ var ResponseSchemaTab = ({ schema, onSchemaChange, blockId }) => {
|
|
|
8383
8469
|
minRows: 2,
|
|
8384
8470
|
size: "sm"
|
|
8385
8471
|
}
|
|
8386
|
-
), field.path && field.displayName && /* @__PURE__ */ React92.createElement(
|
|
8472
|
+
), field.path && field.displayName && /* @__PURE__ */ React92.createElement(Stack71, { gap: 4 }, /* @__PURE__ */ React92.createElement(Text46, { size: "xs", c: "dimmed" }, "Reference format:"), /* @__PURE__ */ React92.createElement(Code, { block: true, style: { fontSize: "11px" } }, `{{${blockId}.response.${field.path}}}`))))))), fields.length === 0 && /* @__PURE__ */ React92.createElement(Stack71, { gap: "xs" }, /* @__PURE__ */ React92.createElement(Text46, { size: "sm", fw: 600 }, "Example Schema"), /* @__PURE__ */ React92.createElement(Text46, { size: "xs", c: "dimmed" }, "For a typical API response like:"), /* @__PURE__ */ React92.createElement(Code, { block: true, style: { fontSize: "11px" } }, `{
|
|
8387
8473
|
"customer": {
|
|
8388
8474
|
"email": "user@example.com",
|
|
8389
8475
|
"name": "John Doe"
|
|
@@ -8392,7 +8478,7 @@ var ResponseSchemaTab = ({ schema, onSchemaChange, blockId }) => {
|
|
|
8392
8478
|
"id": "l1v6r07b",
|
|
8393
8479
|
"name": "Product-1"
|
|
8394
8480
|
}
|
|
8395
|
-
}`), /* @__PURE__ */ React92.createElement(
|
|
8481
|
+
}`), /* @__PURE__ */ React92.createElement(Text46, { size: "xs", c: "dimmed" }, "You would define fields like:"), /* @__PURE__ */ React92.createElement(Text46, { size: "xs", c: "dimmed" }, "\u2022 Path: ", /* @__PURE__ */ React92.createElement(Code, null, "customer.email"), ', Display Name: "Customer Email", Type: string'), /* @__PURE__ */ React92.createElement(Text46, { size: "xs", c: "dimmed" }, "\u2022 Path: ", /* @__PURE__ */ React92.createElement(Code, null, "customer.name"), ', Display Name: "Customer Name", Type: string'), /* @__PURE__ */ React92.createElement(Text46, { size: "xs", c: "dimmed" }, "\u2022 Path: ", /* @__PURE__ */ React92.createElement(Code, null, "product.id"), ', Display Name: "Product ID", Type: string'), /* @__PURE__ */ React92.createElement(Text46, { size: "xs", c: "dimmed" }, "\u2022 Path: ", /* @__PURE__ */ React92.createElement(Code, null, "product.name"), ', Display Name: "Product Name", Type: string')));
|
|
8396
8482
|
};
|
|
8397
8483
|
|
|
8398
8484
|
// src/mantine/blocks/apiRequest/template/TemplateConfig.tsx
|
|
@@ -8518,7 +8604,7 @@ var TemplateConfig4 = ({ editor, block }) => {
|
|
|
8518
8604
|
};
|
|
8519
8605
|
|
|
8520
8606
|
// src/mantine/blocks/apiRequest/template/TemplateView.tsx
|
|
8521
|
-
import { Card as Card19, Group as
|
|
8607
|
+
import { Card as Card19, Group as Group29, Stack as Stack72, Text as Text47, ActionIcon as ActionIcon14, Badge as Badge12 } from "@mantine/core";
|
|
8522
8608
|
var API_REQUEST_TEMPLATE_PANEL_ID = "api-request-template-panel";
|
|
8523
8609
|
var ApiRequestTemplateView = ({ editor, block }) => {
|
|
8524
8610
|
const panelId = `${API_REQUEST_TEMPLATE_PANEL_ID}-${block.id}`;
|
|
@@ -8542,18 +8628,18 @@ var ApiRequestTemplateView = ({ editor, block }) => {
|
|
|
8542
8628
|
return "gray";
|
|
8543
8629
|
}
|
|
8544
8630
|
};
|
|
8545
|
-
return /* @__PURE__ */ React94.createElement(Card19, { withBorder: true, padding: "md", radius: "md", style: { width: "100%", cursor: "pointer", position: "relative" }, onClick: open }, /* @__PURE__ */ React94.createElement(Badge12, { size: "xs", variant: "light", color: "gray", style: { position: "absolute", top: 8, right: 8 } }, "Template"), /* @__PURE__ */ React94.createElement(
|
|
8631
|
+
return /* @__PURE__ */ React94.createElement(Card19, { withBorder: true, padding: "md", radius: "md", style: { width: "100%", cursor: "pointer", position: "relative" }, onClick: open }, /* @__PURE__ */ React94.createElement(Badge12, { size: "xs", variant: "light", color: "gray", style: { position: "absolute", top: 8, right: 8 } }, "Template"), /* @__PURE__ */ React94.createElement(Group29, { wrap: "nowrap", justify: "space-between", align: "center" }, /* @__PURE__ */ React94.createElement(Group29, { wrap: "nowrap", align: "center" }, /* @__PURE__ */ React94.createElement(ActionIcon14, { variant: "light", color: "violet", size: "lg", radius: "xl", style: { flexShrink: 0 } }, getIcon(block.props.icon, 18, 1.5, "square-check")), /* @__PURE__ */ React94.createElement(Stack72, { gap: "xs", style: { flex: 1 } }, /* @__PURE__ */ React94.createElement(Group29, { gap: "xs", wrap: "nowrap" }, /* @__PURE__ */ React94.createElement(Badge12, { size: "sm", variant: "filled", color: getMethodColor(method) }, method), /* @__PURE__ */ React94.createElement(Text47, { fw: 500, size: "sm", contentEditable: false }, block.props.title || "API Request")), /* @__PURE__ */ React94.createElement(Text47, { size: "xs", c: "dimmed", contentEditable: false, lineClamp: 1 }, endpoint), block.props.description && /* @__PURE__ */ React94.createElement(Text47, { size: "xs", c: "dimmed", contentEditable: false }, block.props.description)))));
|
|
8546
8632
|
};
|
|
8547
8633
|
|
|
8548
8634
|
// src/mantine/blocks/apiRequest/flow/FlowView.tsx
|
|
8549
|
-
import React95, { useState as
|
|
8550
|
-
import { Card as Card20, Group as
|
|
8551
|
-
import { IconSend, IconChevronDown as
|
|
8635
|
+
import React95, { useState as useState26 } from "react";
|
|
8636
|
+
import { Card as Card20, Group as Group30, Stack as Stack73, Text as Text48, ActionIcon as ActionIcon15, Tooltip as Tooltip6, Button as Button20, Badge as Badge13, Collapse as Collapse3, Code as Code2, Loader as Loader6, Alert as Alert11 } from "@mantine/core";
|
|
8637
|
+
import { IconSend, IconChevronDown as IconChevronDown3, IconChevronUp as IconChevronUp2, IconAlertTriangle } from "@tabler/icons-react";
|
|
8552
8638
|
var ApiRequestFlowView = ({ editor, block, isDisabled }) => {
|
|
8553
8639
|
const disabled = isDisabled?.isDisabled === "disable";
|
|
8554
|
-
const [isLoading, setIsLoading] =
|
|
8555
|
-
const [showDetails, setShowDetails] =
|
|
8556
|
-
const [validationWarnings, setValidationWarnings] =
|
|
8640
|
+
const [isLoading, setIsLoading] = useState26(false);
|
|
8641
|
+
const [showDetails, setShowDetails] = useState26(false);
|
|
8642
|
+
const [validationWarnings, setValidationWarnings] = useState26([]);
|
|
8557
8643
|
const method = block.props.method || "GET";
|
|
8558
8644
|
const endpoint = block.props.endpoint || "";
|
|
8559
8645
|
const headers = (() => {
|
|
@@ -8681,15 +8767,15 @@ var ApiRequestFlowView = ({ editor, block, isDisabled }) => {
|
|
|
8681
8767
|
size: "sm",
|
|
8682
8768
|
variant: "light",
|
|
8683
8769
|
color: getMethodColor(method),
|
|
8684
|
-
leftSection: isLoading ? /* @__PURE__ */ React95.createElement(
|
|
8770
|
+
leftSection: isLoading ? /* @__PURE__ */ React95.createElement(Loader6, { size: 14 }) : /* @__PURE__ */ React95.createElement(IconSend, { size: 14 }),
|
|
8685
8771
|
onClick: handleExecuteRequest,
|
|
8686
8772
|
disabled: disabled || isLoading || !endpoint,
|
|
8687
8773
|
style: { flexShrink: 0 }
|
|
8688
8774
|
},
|
|
8689
8775
|
isLoading ? "Sending..." : "Execute"
|
|
8690
8776
|
);
|
|
8691
|
-
return /* @__PURE__ */ React95.createElement(Card20, { withBorder: true, padding: "md", radius: "md", style: { width: "100%" } }, /* @__PURE__ */ React95.createElement(
|
|
8692
|
-
|
|
8777
|
+
return /* @__PURE__ */ React95.createElement(Card20, { withBorder: true, padding: "md", radius: "md", style: { width: "100%" } }, /* @__PURE__ */ React95.createElement(Stack73, { gap: "md" }, /* @__PURE__ */ React95.createElement(Group30, { wrap: "nowrap", justify: "space-between", align: "flex-start" }, /* @__PURE__ */ React95.createElement(Group30, { wrap: "nowrap", align: "flex-start", style: { flex: 1 } }, /* @__PURE__ */ React95.createElement(ActionIcon15, { variant: "light", color: "violet", size: "lg", radius: "xl", style: { flexShrink: 0 } }, getIcon(block.props.icon, 18, 1.5, "square-check")), /* @__PURE__ */ React95.createElement(Stack73, { gap: "xs", style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ React95.createElement(Group30, { gap: "xs", wrap: "nowrap" }, /* @__PURE__ */ React95.createElement(Badge13, { size: "sm", variant: "filled", color: getMethodColor(method) }, method), /* @__PURE__ */ React95.createElement(Text48, { fw: 500, size: "sm", contentEditable: false }, block.props.title || "API Request"), status !== "idle" && /* @__PURE__ */ React95.createElement(Badge13, { size: "xs", variant: "dot", color: getStatusColor(status) }, status)), /* @__PURE__ */ React95.createElement(
|
|
8778
|
+
Text48,
|
|
8693
8779
|
{
|
|
8694
8780
|
size: "xs",
|
|
8695
8781
|
c: "dimmed",
|
|
@@ -8701,7 +8787,7 @@ var ApiRequestFlowView = ({ editor, block, isDisabled }) => {
|
|
|
8701
8787
|
}
|
|
8702
8788
|
},
|
|
8703
8789
|
endpoint || "No endpoint configured"
|
|
8704
|
-
), block.props.description && /* @__PURE__ */ React95.createElement(
|
|
8790
|
+
), block.props.description && /* @__PURE__ */ React95.createElement(Text48, { size: "xs", c: "dimmed", contentEditable: false }, block.props.description))), /* @__PURE__ */ React95.createElement(Group30, { gap: "xs", style: { flexShrink: 0 } }, disabled && isDisabled?.message ? /* @__PURE__ */ React95.createElement(Tooltip6, { label: isDisabled.message, position: "left", withArrow: true }, executeButton) : executeButton, /* @__PURE__ */ React95.createElement(ActionIcon15, { variant: "subtle", onClick: () => setShowDetails(!showDetails), disabled: headers.length === 0 && body.length === 0 && !response }, showDetails ? /* @__PURE__ */ React95.createElement(IconChevronUp2, { size: 16 }) : /* @__PURE__ */ React95.createElement(IconChevronDown3, { size: 16 })))), /* @__PURE__ */ React95.createElement(Collapse3, { in: showDetails }, /* @__PURE__ */ React95.createElement(Stack73, { gap: "md" }, validationWarnings.length > 0 && /* @__PURE__ */ React95.createElement(Alert11, { icon: /* @__PURE__ */ React95.createElement(IconAlertTriangle, { size: 16 }), title: "Schema Validation Warnings", color: "yellow" }, /* @__PURE__ */ React95.createElement(Stack73, { gap: "xs" }, /* @__PURE__ */ React95.createElement(Text48, { size: "xs" }, "The API response does not match the defined schema:"), validationWarnings.map((warning, index) => /* @__PURE__ */ React95.createElement(Text48, { key: index, size: "xs", c: "dimmed" }, "\u2022 ", warning)))), headers.length > 0 && /* @__PURE__ */ React95.createElement(Stack73, { gap: "xs" }, /* @__PURE__ */ React95.createElement(Text48, { size: "xs", fw: 600, c: "dimmed" }, "Headers:"), /* @__PURE__ */ React95.createElement(Code2, { block: true, style: { fontSize: "11px" } }, JSON.stringify(
|
|
8705
8791
|
headers.reduce(
|
|
8706
8792
|
(acc, h) => {
|
|
8707
8793
|
if (h.key && h.value) acc[h.key] = h.value;
|
|
@@ -8711,7 +8797,7 @@ var ApiRequestFlowView = ({ editor, block, isDisabled }) => {
|
|
|
8711
8797
|
),
|
|
8712
8798
|
null,
|
|
8713
8799
|
2
|
|
8714
|
-
))), method !== "GET" && body.length > 0 && /* @__PURE__ */ React95.createElement(
|
|
8800
|
+
))), method !== "GET" && body.length > 0 && /* @__PURE__ */ React95.createElement(Stack73, { gap: "xs" }, /* @__PURE__ */ React95.createElement(Text48, { size: "xs", fw: 600, c: "dimmed" }, "Body:"), /* @__PURE__ */ React95.createElement(Code2, { block: true, style: { fontSize: "11px" } }, JSON.stringify(
|
|
8715
8801
|
body.reduce(
|
|
8716
8802
|
(acc, b) => {
|
|
8717
8803
|
if (b.key && b.value) acc[b.key] = b.value;
|
|
@@ -8721,7 +8807,7 @@ var ApiRequestFlowView = ({ editor, block, isDisabled }) => {
|
|
|
8721
8807
|
),
|
|
8722
8808
|
null,
|
|
8723
8809
|
2
|
|
8724
|
-
))), response && /* @__PURE__ */ React95.createElement(
|
|
8810
|
+
))), response && /* @__PURE__ */ React95.createElement(Stack73, { gap: "xs" }, /* @__PURE__ */ React95.createElement(Text48, { size: "xs", fw: 600, c: "dimmed" }, "Response:"), status === "error" ? /* @__PURE__ */ React95.createElement(Alert11, { color: "red", title: "Error", styles: { message: { fontSize: "11px" } } }, /* @__PURE__ */ React95.createElement(Code2, { block: true, style: { fontSize: "11px" } }, response)) : /* @__PURE__ */ React95.createElement(Code2, { block: true, style: { fontSize: "11px", maxHeight: "300px", overflow: "auto" } }, response))))));
|
|
8725
8811
|
};
|
|
8726
8812
|
|
|
8727
8813
|
// src/mantine/blocks/apiRequest/ApiRequestBlock.tsx
|
|
@@ -8804,30 +8890,30 @@ var ApiRequestBlockSpec = createReactBlockSpec5(
|
|
|
8804
8890
|
);
|
|
8805
8891
|
|
|
8806
8892
|
// src/mantine/blocks/enumChecklist/EnumChecklistBlock.tsx
|
|
8807
|
-
import React104, { useState as
|
|
8893
|
+
import React104, { useState as useState28, useEffect as useEffect18, useMemo as useMemo17, useCallback as useCallback18 } from "react";
|
|
8808
8894
|
import { createReactBlockSpec as createReactBlockSpec6 } from "@blocknote/react";
|
|
8809
|
-
import { Stack as
|
|
8895
|
+
import { Stack as Stack79, Text as Text54, Button as Button25, ActionIcon as ActionIcon16, Center as Center3, Flex as Flex21 } from "@mantine/core";
|
|
8810
8896
|
|
|
8811
8897
|
// src/mantine/blocks/enumChecklist/oracle_personalities/index.tsx
|
|
8812
8898
|
import React98 from "react";
|
|
8813
|
-
import { Box as
|
|
8899
|
+
import { Box as Box20, Flex as Flex20, Stack as Stack74, Text as Text49, Image as Image13 } from "@mantine/core";
|
|
8814
8900
|
function OraclePersonalitiesEnumList({ selectionMode, isItemChecked, onItemCheck, items }) {
|
|
8815
8901
|
if (!items || items.length === 0) {
|
|
8816
|
-
return /* @__PURE__ */ React98.createElement(
|
|
8902
|
+
return /* @__PURE__ */ React98.createElement(Text49, { size: "sm", c: "dimmed", ta: "center", py: "md" }, "No assets found");
|
|
8817
8903
|
}
|
|
8818
|
-
const rows = items.map(({ id, name, description, voice, icon }) => /* @__PURE__ */ React98.createElement(ListItemContainer, { key: id }, /* @__PURE__ */ React98.createElement(Flex20, { align: "center", gap: "sm" }, /* @__PURE__ */ React98.createElement(Image13, { radius: 16, w: 62, h: 62, src: icon, alt: name }), /* @__PURE__ */ React98.createElement(
|
|
8819
|
-
return /* @__PURE__ */ React98.createElement(
|
|
8904
|
+
const rows = items.map(({ id, name, description, voice, icon }) => /* @__PURE__ */ React98.createElement(ListItemContainer, { key: id }, /* @__PURE__ */ React98.createElement(Flex20, { align: "center", gap: "sm" }, /* @__PURE__ */ React98.createElement(Image13, { radius: 16, w: 62, h: 62, src: icon, alt: name }), /* @__PURE__ */ React98.createElement(Stack74, { gap: 0 }, /* @__PURE__ */ React98.createElement(Text49, { size: "sm", fw: 500 }, name || "-"), description !== void 0 && /* @__PURE__ */ React98.createElement(Text49, { size: "sm", c: "dimmed" }, description))), /* @__PURE__ */ React98.createElement(Flex20, { align: "center", gap: "md" }, /* @__PURE__ */ React98.createElement(Stack74, { ta: "right", gap: 0 }, /* @__PURE__ */ React98.createElement(Text49, { size: "sm", fw: 500 }, "Voice"), /* @__PURE__ */ React98.createElement(Text49, { size: "sm", c: "dimmed" }, voice)), selectionMode && /* @__PURE__ */ React98.createElement(ListItemCheckbox, { ariaLabel: `Select oracle ${name}`, checked: isItemChecked?.(id), onCheck: (checked) => onItemCheck?.(id, checked) }))));
|
|
8905
|
+
return /* @__PURE__ */ React98.createElement(Box20, { flex: 1 }, /* @__PURE__ */ React98.createElement(Stack74, null, rows));
|
|
8820
8906
|
}
|
|
8821
8907
|
|
|
8822
8908
|
// src/mantine/blocks/enumChecklist/EnumChecklistConfigModal.tsx
|
|
8823
|
-
import React103, { useState as
|
|
8824
|
-
import { Modal, Group as
|
|
8909
|
+
import React103, { useState as useState27 } from "react";
|
|
8910
|
+
import { Modal, Group as Group34, Box as Box22 } from "@mantine/core";
|
|
8825
8911
|
|
|
8826
8912
|
// src/mantine/blocks/list/modal/ModalNavigation.tsx
|
|
8827
8913
|
import React99 from "react";
|
|
8828
|
-
import { Stack as
|
|
8914
|
+
import { Stack as Stack75, Button as Button21, Text as Text50 } from "@mantine/core";
|
|
8829
8915
|
var ModalNavigation = ({ steps, activeStep, onStepChange, showUpdateButton = false, onUpdateBlock }) => {
|
|
8830
|
-
return /* @__PURE__ */ React99.createElement(
|
|
8916
|
+
return /* @__PURE__ */ React99.createElement(Stack75, { gap: "xs", style: { height: "100%" } }, /* @__PURE__ */ React99.createElement(Stack75, { gap: "xs", style: { flex: 1 } }, steps.map((step) => /* @__PURE__ */ React99.createElement(
|
|
8831
8917
|
Button21,
|
|
8832
8918
|
{
|
|
8833
8919
|
key: step.id,
|
|
@@ -8845,13 +8931,13 @@ var ModalNavigation = ({ steps, activeStep, onStepChange, showUpdateButton = fal
|
|
|
8845
8931
|
}
|
|
8846
8932
|
}
|
|
8847
8933
|
},
|
|
8848
|
-
/* @__PURE__ */ React99.createElement(
|
|
8934
|
+
/* @__PURE__ */ React99.createElement(Stack75, { gap: 2, align: "flex-start" }, /* @__PURE__ */ React99.createElement(Text50, { size: "sm", fw: 500 }, step.label), /* @__PURE__ */ React99.createElement(Text50, { size: "xs", opacity: 0.7 }, step.description))
|
|
8849
8935
|
))), showUpdateButton && /* @__PURE__ */ React99.createElement(Button21, { variant: "filled", color: "blue", onClick: onUpdateBlock, style: { marginTop: "auto" } }, "Update Block"));
|
|
8850
8936
|
};
|
|
8851
8937
|
|
|
8852
8938
|
// src/mantine/blocks/enumChecklist/EnumChecklistTypeSelection.tsx
|
|
8853
8939
|
import React100 from "react";
|
|
8854
|
-
import { Stack as
|
|
8940
|
+
import { Stack as Stack76, Card as Card21, Group as Group31, Text as Text51, Box as Box21, Button as Button22 } from "@mantine/core";
|
|
8855
8941
|
|
|
8856
8942
|
// src/mantine/blocks/enumChecklist/oracle_personalities/config.ts
|
|
8857
8943
|
var oraclePersonalitiesMetadata = {
|
|
@@ -8980,7 +9066,7 @@ function getEnumListItems(type) {
|
|
|
8980
9066
|
// src/mantine/blocks/enumChecklist/EnumChecklistTypeSelection.tsx
|
|
8981
9067
|
var EnumChecklistTypeSelection = ({ selectedType, onTypeSelect, onNext }) => {
|
|
8982
9068
|
const enumListsMeta = getEnumListTypesMetadata();
|
|
8983
|
-
return /* @__PURE__ */ React100.createElement(
|
|
9069
|
+
return /* @__PURE__ */ React100.createElement(Stack76, { gap: "md" }, /* @__PURE__ */ React100.createElement("div", null, /* @__PURE__ */ React100.createElement(Text51, { size: "lg", fw: 600, mb: "xs" }, "Choose List Type"), /* @__PURE__ */ React100.createElement(Text51, { size: "sm", c: "dimmed" }, "Select the type of list you want to create")), /* @__PURE__ */ React100.createElement(Stack76, { gap: "sm" }, enumListsMeta.map((enumChecklistMeta) => /* @__PURE__ */ React100.createElement(
|
|
8984
9070
|
Card21,
|
|
8985
9071
|
{
|
|
8986
9072
|
key: enumChecklistMeta.id,
|
|
@@ -8993,8 +9079,8 @@ var EnumChecklistTypeSelection = ({ selectedType, onTypeSelect, onNext }) => {
|
|
|
8993
9079
|
},
|
|
8994
9080
|
onClick: () => onTypeSelect(enumChecklistMeta.id)
|
|
8995
9081
|
},
|
|
8996
|
-
/* @__PURE__ */ React100.createElement(
|
|
8997
|
-
|
|
9082
|
+
/* @__PURE__ */ React100.createElement(Group31, { gap: "md", align: "flex-start" }, /* @__PURE__ */ React100.createElement(
|
|
9083
|
+
Box21,
|
|
8998
9084
|
{
|
|
8999
9085
|
style: {
|
|
9000
9086
|
width: 48,
|
|
@@ -9009,13 +9095,13 @@ var EnumChecklistTypeSelection = ({ selectedType, onTypeSelect, onNext }) => {
|
|
|
9009
9095
|
}
|
|
9010
9096
|
},
|
|
9011
9097
|
enumChecklistMeta.icon
|
|
9012
|
-
), /* @__PURE__ */ React100.createElement(
|
|
9013
|
-
))), /* @__PURE__ */ React100.createElement(
|
|
9098
|
+
), /* @__PURE__ */ React100.createElement(Stack76, { gap: 2, style: { flex: 1 } }, /* @__PURE__ */ React100.createElement(Text51, { size: "md", fw: 600 }, enumChecklistMeta.name), /* @__PURE__ */ React100.createElement(Text51, { size: "sm", c: "dimmed" }, enumChecklistMeta.description)))
|
|
9099
|
+
))), /* @__PURE__ */ React100.createElement(Group31, { justify: "flex-end", mt: "md" }, /* @__PURE__ */ React100.createElement(Button22, { onClick: onNext, disabled: !selectedType }, "Next")));
|
|
9014
9100
|
};
|
|
9015
9101
|
|
|
9016
9102
|
// src/mantine/blocks/enumChecklist/EnumChecklistPreviewStep.tsx
|
|
9017
9103
|
import React101 from "react";
|
|
9018
|
-
import { Stack as
|
|
9104
|
+
import { Stack as Stack77, Text as Text52, Button as Button23, Group as Group32 } from "@mantine/core";
|
|
9019
9105
|
var EnumChecklistPreviewStep = ({ listType, onAddToBlock, onPrev }) => {
|
|
9020
9106
|
const renderListComponent = () => {
|
|
9021
9107
|
switch (listType) {
|
|
@@ -9025,12 +9111,12 @@ var EnumChecklistPreviewStep = ({ listType, onAddToBlock, onPrev }) => {
|
|
|
9025
9111
|
return null;
|
|
9026
9112
|
}
|
|
9027
9113
|
};
|
|
9028
|
-
return /* @__PURE__ */ React101.createElement(
|
|
9114
|
+
return /* @__PURE__ */ React101.createElement(Stack77, { gap: "md" }, /* @__PURE__ */ React101.createElement("div", null, /* @__PURE__ */ React101.createElement(Text52, { size: "lg", fw: 600, mb: "xs" }, "Preview ", getEnumListNameByType(listType)), /* @__PURE__ */ React101.createElement(Text52, { size: "sm", c: "dimmed" }, "Preview how your list will look with the current configuration")), /* @__PURE__ */ React101.createElement("div", { style: { maxHeight: "400px", overflow: "auto" } }, renderListComponent()), /* @__PURE__ */ React101.createElement(Group32, { justify: "space-between", mt: "md" }, /* @__PURE__ */ React101.createElement(Button23, { variant: "subtle", onClick: onPrev }, "Previous"), /* @__PURE__ */ React101.createElement(Button23, { onClick: onAddToBlock }, "Add to Block")));
|
|
9029
9115
|
};
|
|
9030
9116
|
|
|
9031
9117
|
// src/mantine/blocks/enumChecklist/EnumChecklistConfigurationStep.tsx
|
|
9032
9118
|
import React102 from "react";
|
|
9033
|
-
import { Stack as
|
|
9119
|
+
import { Stack as Stack78, TextInput as TextInput36, Text as Text53, Button as Button24, Group as Group33, Switch as Switch4, Select as Select13 } from "@mantine/core";
|
|
9034
9120
|
var EnumChecklistConfigurationStep = ({ enumChecklistType: listType, config, onConfigChange, onPrev, onNext, isValid }) => {
|
|
9035
9121
|
const typeConfig = ENUM_LIST_CONFIG[listType];
|
|
9036
9122
|
const configFields = getEnumListTypesConfigFields(listType);
|
|
@@ -9085,14 +9171,14 @@ var EnumChecklistConfigurationStep = ({ enumChecklistType: listType, config, onC
|
|
|
9085
9171
|
);
|
|
9086
9172
|
}
|
|
9087
9173
|
};
|
|
9088
|
-
return /* @__PURE__ */ React102.createElement(
|
|
9174
|
+
return /* @__PURE__ */ React102.createElement(Stack78, { gap: "md" }, /* @__PURE__ */ React102.createElement("div", null, /* @__PURE__ */ React102.createElement(Text53, { size: "lg", fw: 600, mb: "xs" }, "Configure ", typeConfig.metadata.name), /* @__PURE__ */ React102.createElement(Text53, { size: "sm", c: "dimmed" }, typeConfig.metadata.description)), /* @__PURE__ */ React102.createElement(Stack78, { gap: "sm" }, configFields.map((field) => /* @__PURE__ */ React102.createElement("div", { key: field.key }, renderListConfigField(field)))), /* @__PURE__ */ React102.createElement(Group33, { justify: "space-between", mt: "md" }, /* @__PURE__ */ React102.createElement(Button24, { variant: "subtle", onClick: onPrev }, "Previous"), /* @__PURE__ */ React102.createElement(Button24, { onClick: onNext, disabled: !isValid }, "Next")));
|
|
9089
9175
|
};
|
|
9090
9176
|
|
|
9091
9177
|
// src/mantine/blocks/enumChecklist/EnumChecklistConfigModal.tsx
|
|
9092
9178
|
var EnumChecklistConfigModal = ({ opened, onClose, onSave, initialConfig }) => {
|
|
9093
|
-
const [activeStep, setActiveStep] =
|
|
9094
|
-
const [selectedType, setSelectedType] =
|
|
9095
|
-
const [config, setConfig] =
|
|
9179
|
+
const [activeStep, setActiveStep] = useState27("type");
|
|
9180
|
+
const [selectedType, setSelectedType] = useState27(initialConfig?.listType || null);
|
|
9181
|
+
const [config, setConfig] = useState27(initialConfig?.listConfig || {});
|
|
9096
9182
|
const handleTypeSelect = (type) => {
|
|
9097
9183
|
setSelectedType(type);
|
|
9098
9184
|
const configFieldsByType = getEnumListTypesConfigFields(type);
|
|
@@ -9166,14 +9252,14 @@ var EnumChecklistConfigModal = ({ opened, onClose, onSave, initialConfig }) => {
|
|
|
9166
9252
|
return null;
|
|
9167
9253
|
}
|
|
9168
9254
|
};
|
|
9169
|
-
return /* @__PURE__ */ React103.createElement(Modal, { opened, onClose: handleClose, title: "Configure Enum Checklist Block", size: "xl" }, /* @__PURE__ */ React103.createElement(
|
|
9255
|
+
return /* @__PURE__ */ React103.createElement(Modal, { opened, onClose: handleClose, title: "Configure Enum Checklist Block", size: "xl" }, /* @__PURE__ */ React103.createElement(Group34, { align: "flex-start", gap: "lg", style: { minHeight: "400px" } }, /* @__PURE__ */ React103.createElement(Box22, { style: { width: "200px", flexShrink: 0, height: "400px", display: "flex" } }, /* @__PURE__ */ React103.createElement(ModalNavigation, { steps, activeStep, onStepChange: setActiveStep, showUpdateButton: selectedType !== null, onUpdateBlock: handleAddToBlock })), /* @__PURE__ */ React103.createElement(Box22, { style: { flex: 1 } }, renderStepContent())));
|
|
9170
9256
|
};
|
|
9171
9257
|
|
|
9172
9258
|
// src/mantine/blocks/enumChecklist/EnumChecklistBlock.tsx
|
|
9173
9259
|
var IconSettings2 = () => /* @__PURE__ */ React104.createElement("span", null, "\u2699\uFE0F");
|
|
9174
9260
|
var EnumChecklistBlockType = "enumChecklist";
|
|
9175
9261
|
var EnumChecklistBlockContent = ({ block, editor }) => {
|
|
9176
|
-
const [modalOpened, setModalOpened] =
|
|
9262
|
+
const [modalOpened, setModalOpened] = useState28(false);
|
|
9177
9263
|
const { editable } = useBlocknoteContext();
|
|
9178
9264
|
const listType = block.props.listType && block.props.listType !== "" ? block.props.listType : null;
|
|
9179
9265
|
const listConfig = useMemo17(() => {
|
|
@@ -9198,7 +9284,7 @@ var EnumChecklistBlockContent = ({ block, editor }) => {
|
|
|
9198
9284
|
}
|
|
9199
9285
|
return /* @__PURE__ */ new Set();
|
|
9200
9286
|
}, [block.props.selectedIds]);
|
|
9201
|
-
|
|
9287
|
+
useEffect18(() => {
|
|
9202
9288
|
if (listConfig?.selection_mode === "single" && selectedIds.size > 1) {
|
|
9203
9289
|
const arr = Array.from(selectedIds);
|
|
9204
9290
|
const lastSelected = arr.length > 0 ? arr[arr.length - 1] : void 0;
|
|
@@ -9269,7 +9355,7 @@ var EnumChecklistBlockContent = ({ block, editor }) => {
|
|
|
9269
9355
|
return null;
|
|
9270
9356
|
}
|
|
9271
9357
|
};
|
|
9272
|
-
return /* @__PURE__ */ React104.createElement(
|
|
9358
|
+
return /* @__PURE__ */ React104.createElement(Stack79, { w: "100%" }, listType && /* @__PURE__ */ React104.createElement(Flex21, { align: "center", justify: "space-between", gap: "xs" }, /* @__PURE__ */ React104.createElement(Text54, null, getEnumListNameByType(listType)), listConfig.listSelectionMode && /* @__PURE__ */ React104.createElement(Text54, { lh: 0.5, c: "dimmed" }, listConfig?.selection_mode === "single" ? "Single Selection" : "Multi Selection"), editable && /* @__PURE__ */ React104.createElement(Flex21, { justify: listType ? "space-between" : "flex-end" }, /* @__PURE__ */ React104.createElement(Flex21, { gap: "xs" }, /* @__PURE__ */ React104.createElement(ActionIcon16, { variant: "subtle", size: "sm", onClick: () => setModalOpened(true) }, /* @__PURE__ */ React104.createElement(IconSettings2, null))))), /* @__PURE__ */ React104.createElement(Flex21, { flex: 1 }, !listType ? /* @__PURE__ */ React104.createElement(Center3, { py: "xl" }, /* @__PURE__ */ React104.createElement(Stack79, { align: "center", gap: "sm" }, /* @__PURE__ */ React104.createElement(Text54, { size: "sm", c: "dimmed", ta: "center" }, "No list type configured"), /* @__PURE__ */ React104.createElement(Button25, { size: "sm", variant: "light", onClick: () => setModalOpened(true) }, "Configure List"))) : /* @__PURE__ */ React104.createElement(Stack79, { gap: "md", flex: 1 }, renderListComponent())), /* @__PURE__ */ React104.createElement(
|
|
9273
9359
|
EnumChecklistConfigModal,
|
|
9274
9360
|
{
|
|
9275
9361
|
opened: modalOpened,
|
|
@@ -9320,8 +9406,8 @@ import React106, { useCallback as useCallback19 } from "react";
|
|
|
9320
9406
|
import { Paper as Paper12, CloseButton as CloseButton7, Title as Title8 } from "@mantine/core";
|
|
9321
9407
|
|
|
9322
9408
|
// src/mantine/blocks/notify/template/GeneralTab.tsx
|
|
9323
|
-
import React105, { useEffect as
|
|
9324
|
-
import { Divider as Divider6, Select as Select14, Stack as
|
|
9409
|
+
import React105, { useEffect as useEffect19, useState as useState29 } from "react";
|
|
9410
|
+
import { Divider as Divider6, Select as Select14, Stack as Stack80, Text as Text55, TextInput as TextInput37, Textarea as Textarea21, Button as Button26, Group as Group35, ActionIcon as ActionIcon17, Paper as Paper11 } from "@mantine/core";
|
|
9325
9411
|
import { IconTrash as IconTrash3, IconPlus as IconPlus3 } from "@tabler/icons-react";
|
|
9326
9412
|
var GeneralTab5 = ({
|
|
9327
9413
|
title,
|
|
@@ -9349,28 +9435,28 @@ var GeneralTab5 = ({
|
|
|
9349
9435
|
editor,
|
|
9350
9436
|
blockId
|
|
9351
9437
|
}) => {
|
|
9352
|
-
const [localTitle, setLocalTitle] =
|
|
9353
|
-
const [localDescription, setLocalDescription] =
|
|
9354
|
-
const [localChannel, setLocalChannel] =
|
|
9355
|
-
const [localTo, setLocalTo] =
|
|
9356
|
-
const [localCc, setLocalCc] =
|
|
9357
|
-
const [localBcc, setLocalBcc] =
|
|
9358
|
-
const [localSubject, setLocalSubject] =
|
|
9359
|
-
const [localBody, setLocalBody] =
|
|
9360
|
-
const [localBodyType, setLocalBodyType] =
|
|
9361
|
-
const [localFrom, setLocalFrom] =
|
|
9362
|
-
const [localReplyTo, setLocalReplyTo] =
|
|
9363
|
-
|
|
9364
|
-
|
|
9365
|
-
|
|
9366
|
-
|
|
9367
|
-
|
|
9368
|
-
|
|
9369
|
-
|
|
9370
|
-
|
|
9371
|
-
|
|
9372
|
-
|
|
9373
|
-
|
|
9438
|
+
const [localTitle, setLocalTitle] = useState29(title || "");
|
|
9439
|
+
const [localDescription, setLocalDescription] = useState29(description || "");
|
|
9440
|
+
const [localChannel, setLocalChannel] = useState29(channel || "email");
|
|
9441
|
+
const [localTo, setLocalTo] = useState29(to || []);
|
|
9442
|
+
const [localCc, setLocalCc] = useState29(cc || []);
|
|
9443
|
+
const [localBcc, setLocalBcc] = useState29(bcc || []);
|
|
9444
|
+
const [localSubject, setLocalSubject] = useState29(subject || "");
|
|
9445
|
+
const [localBody, setLocalBody] = useState29(body || "");
|
|
9446
|
+
const [localBodyType, setLocalBodyType] = useState29(bodyType || "text");
|
|
9447
|
+
const [localFrom, setLocalFrom] = useState29(from || "");
|
|
9448
|
+
const [localReplyTo, setLocalReplyTo] = useState29(replyTo || "");
|
|
9449
|
+
useEffect19(() => setLocalTitle(title || ""), [title]);
|
|
9450
|
+
useEffect19(() => setLocalDescription(description || ""), [description]);
|
|
9451
|
+
useEffect19(() => setLocalChannel(channel || "email"), [channel]);
|
|
9452
|
+
useEffect19(() => setLocalTo(to || []), [to]);
|
|
9453
|
+
useEffect19(() => setLocalCc(cc || []), [cc]);
|
|
9454
|
+
useEffect19(() => setLocalBcc(bcc || []), [bcc]);
|
|
9455
|
+
useEffect19(() => setLocalSubject(subject || ""), [subject]);
|
|
9456
|
+
useEffect19(() => setLocalBody(body || ""), [body]);
|
|
9457
|
+
useEffect19(() => setLocalBodyType(bodyType || "text"), [bodyType]);
|
|
9458
|
+
useEffect19(() => setLocalFrom(from || ""), [from]);
|
|
9459
|
+
useEffect19(() => setLocalReplyTo(replyTo || ""), [replyTo]);
|
|
9374
9460
|
const handleAddRecipient = (type) => {
|
|
9375
9461
|
const setter = type === "to" ? setLocalTo : type === "cc" ? setLocalCc : setLocalBcc;
|
|
9376
9462
|
const callback = type === "to" ? onToChange : type === "cc" ? onCcChange : onBccChange;
|
|
@@ -9396,7 +9482,7 @@ var GeneralTab5 = ({
|
|
|
9396
9482
|
setter(newRecipients);
|
|
9397
9483
|
callback(newRecipients);
|
|
9398
9484
|
};
|
|
9399
|
-
return /* @__PURE__ */ React105.createElement(
|
|
9485
|
+
return /* @__PURE__ */ React105.createElement(Stack80, { gap: "lg" }, /* @__PURE__ */ React105.createElement(Stack80, { gap: "xs" }, /* @__PURE__ */ React105.createElement(Text55, { size: "sm", fw: 600 }, "Title"), /* @__PURE__ */ React105.createElement(
|
|
9400
9486
|
TextInput37,
|
|
9401
9487
|
{
|
|
9402
9488
|
placeholder: "e.g. Welcome Email",
|
|
@@ -9407,7 +9493,7 @@ var GeneralTab5 = ({
|
|
|
9407
9493
|
onTitleChange(newTitle);
|
|
9408
9494
|
}
|
|
9409
9495
|
}
|
|
9410
|
-
)), /* @__PURE__ */ React105.createElement(
|
|
9496
|
+
)), /* @__PURE__ */ React105.createElement(Stack80, { gap: "xs" }, /* @__PURE__ */ React105.createElement(Text55, { size: "sm", fw: 600 }, "Description"), /* @__PURE__ */ React105.createElement(
|
|
9411
9497
|
Textarea21,
|
|
9412
9498
|
{
|
|
9413
9499
|
placeholder: "Describe what this notification does",
|
|
@@ -9419,7 +9505,7 @@ var GeneralTab5 = ({
|
|
|
9419
9505
|
onDescriptionChange(newDescription);
|
|
9420
9506
|
}
|
|
9421
9507
|
}
|
|
9422
|
-
)), /* @__PURE__ */ React105.createElement(Divider6, { variant: "dashed" }), /* @__PURE__ */ React105.createElement(
|
|
9508
|
+
)), /* @__PURE__ */ React105.createElement(Divider6, { variant: "dashed" }), /* @__PURE__ */ React105.createElement(Stack80, { gap: "xs" }, /* @__PURE__ */ React105.createElement(Text55, { size: "sm", fw: 600 }, "Channel"), /* @__PURE__ */ React105.createElement(
|
|
9423
9509
|
Select14,
|
|
9424
9510
|
{
|
|
9425
9511
|
value: localChannel,
|
|
@@ -9435,7 +9521,7 @@ var GeneralTab5 = ({
|
|
|
9435
9521
|
{ value: "rcs", label: "RCS (Coming Soon)", disabled: true }
|
|
9436
9522
|
]
|
|
9437
9523
|
}
|
|
9438
|
-
)), /* @__PURE__ */ React105.createElement(Divider6, { variant: "dashed" }), localChannel === "email" && /* @__PURE__ */ React105.createElement(React105.Fragment, null, /* @__PURE__ */ React105.createElement(
|
|
9524
|
+
)), /* @__PURE__ */ React105.createElement(Divider6, { variant: "dashed" }), localChannel === "email" && /* @__PURE__ */ React105.createElement(React105.Fragment, null, /* @__PURE__ */ React105.createElement(Stack80, { gap: "xs" }, /* @__PURE__ */ React105.createElement(Group35, { justify: "space-between" }, /* @__PURE__ */ React105.createElement(Text55, { size: "sm", fw: 600 }, "To (Recipients)"), /* @__PURE__ */ React105.createElement(Button26, { size: "xs", leftSection: /* @__PURE__ */ React105.createElement(IconPlus3, { size: 14 }), onClick: () => handleAddRecipient("to") }, "Add")), localTo.length === 0 && /* @__PURE__ */ React105.createElement(Text55, { size: "xs", c: "dimmed" }, "No recipients added yet"), /* @__PURE__ */ React105.createElement(Stack80, { gap: "xs" }, localTo.map((recipient, index) => /* @__PURE__ */ React105.createElement(Paper11, { key: index, p: "xs", withBorder: true }, /* @__PURE__ */ React105.createElement(Group35, { gap: "xs", wrap: "nowrap", align: "flex-start" }, /* @__PURE__ */ React105.createElement(
|
|
9439
9525
|
DataInput,
|
|
9440
9526
|
{
|
|
9441
9527
|
placeholder: "email@example.com or reference",
|
|
@@ -9445,7 +9531,7 @@ var GeneralTab5 = ({
|
|
|
9445
9531
|
currentBlockId: blockId,
|
|
9446
9532
|
size: "sm"
|
|
9447
9533
|
}
|
|
9448
|
-
), /* @__PURE__ */ React105.createElement(ActionIcon17, { color: "red", variant: "light", onClick: () => handleRemoveRecipient("to", index) }, /* @__PURE__ */ React105.createElement(IconTrash3, { size: 16 }))))))), /* @__PURE__ */ React105.createElement(
|
|
9534
|
+
), /* @__PURE__ */ React105.createElement(ActionIcon17, { color: "red", variant: "light", onClick: () => handleRemoveRecipient("to", index) }, /* @__PURE__ */ React105.createElement(IconTrash3, { size: 16 }))))))), /* @__PURE__ */ React105.createElement(Stack80, { gap: "xs" }, /* @__PURE__ */ React105.createElement(Group35, { justify: "space-between" }, /* @__PURE__ */ React105.createElement(Text55, { size: "sm", fw: 600 }, "CC (Optional)"), /* @__PURE__ */ React105.createElement(Button26, { size: "xs", leftSection: /* @__PURE__ */ React105.createElement(IconPlus3, { size: 14 }), onClick: () => handleAddRecipient("cc") }, "Add")), localCc.length > 0 && /* @__PURE__ */ React105.createElement(Stack80, { gap: "xs" }, localCc.map((recipient, index) => /* @__PURE__ */ React105.createElement(Paper11, { key: index, p: "xs", withBorder: true }, /* @__PURE__ */ React105.createElement(Group35, { gap: "xs", wrap: "nowrap", align: "flex-start" }, /* @__PURE__ */ React105.createElement(
|
|
9449
9535
|
DataInput,
|
|
9450
9536
|
{
|
|
9451
9537
|
placeholder: "email@example.com or reference",
|
|
@@ -9455,7 +9541,7 @@ var GeneralTab5 = ({
|
|
|
9455
9541
|
currentBlockId: blockId,
|
|
9456
9542
|
size: "sm"
|
|
9457
9543
|
}
|
|
9458
|
-
), /* @__PURE__ */ React105.createElement(ActionIcon17, { color: "red", variant: "light", onClick: () => handleRemoveRecipient("cc", index) }, /* @__PURE__ */ React105.createElement(IconTrash3, { size: 16 }))))))), /* @__PURE__ */ React105.createElement(
|
|
9544
|
+
), /* @__PURE__ */ React105.createElement(ActionIcon17, { color: "red", variant: "light", onClick: () => handleRemoveRecipient("cc", index) }, /* @__PURE__ */ React105.createElement(IconTrash3, { size: 16 }))))))), /* @__PURE__ */ React105.createElement(Stack80, { gap: "xs" }, /* @__PURE__ */ React105.createElement(Group35, { justify: "space-between" }, /* @__PURE__ */ React105.createElement(Text55, { size: "sm", fw: 600 }, "BCC (Optional)"), /* @__PURE__ */ React105.createElement(Button26, { size: "xs", leftSection: /* @__PURE__ */ React105.createElement(IconPlus3, { size: 14 }), onClick: () => handleAddRecipient("bcc") }, "Add")), localBcc.length > 0 && /* @__PURE__ */ React105.createElement(Stack80, { gap: "xs" }, localBcc.map((recipient, index) => /* @__PURE__ */ React105.createElement(Paper11, { key: index, p: "xs", withBorder: true }, /* @__PURE__ */ React105.createElement(Group35, { gap: "xs", wrap: "nowrap", align: "flex-start" }, /* @__PURE__ */ React105.createElement(
|
|
9459
9545
|
DataInput,
|
|
9460
9546
|
{
|
|
9461
9547
|
placeholder: "email@example.com or reference",
|
|
@@ -9465,7 +9551,7 @@ var GeneralTab5 = ({
|
|
|
9465
9551
|
currentBlockId: blockId,
|
|
9466
9552
|
size: "sm"
|
|
9467
9553
|
}
|
|
9468
|
-
), /* @__PURE__ */ React105.createElement(ActionIcon17, { color: "red", variant: "light", onClick: () => handleRemoveRecipient("bcc", index) }, /* @__PURE__ */ React105.createElement(IconTrash3, { size: 16 }))))))), /* @__PURE__ */ React105.createElement(Divider6, { variant: "dashed" }), /* @__PURE__ */ React105.createElement(
|
|
9554
|
+
), /* @__PURE__ */ React105.createElement(ActionIcon17, { color: "red", variant: "light", onClick: () => handleRemoveRecipient("bcc", index) }, /* @__PURE__ */ React105.createElement(IconTrash3, { size: 16 }))))))), /* @__PURE__ */ React105.createElement(Divider6, { variant: "dashed" }), /* @__PURE__ */ React105.createElement(Stack80, { gap: "xs" }, /* @__PURE__ */ React105.createElement(Text55, { size: "sm", fw: 600 }, "From (Optional)"), /* @__PURE__ */ React105.createElement(
|
|
9469
9555
|
TextInput37,
|
|
9470
9556
|
{
|
|
9471
9557
|
placeholder: "sender@example.com",
|
|
@@ -9476,7 +9562,7 @@ var GeneralTab5 = ({
|
|
|
9476
9562
|
onFromChange(newFrom);
|
|
9477
9563
|
}
|
|
9478
9564
|
}
|
|
9479
|
-
), /* @__PURE__ */ React105.createElement(
|
|
9565
|
+
), /* @__PURE__ */ React105.createElement(Text55, { size: "xs", c: "dimmed" }, "Custom sender email address")), /* @__PURE__ */ React105.createElement(Stack80, { gap: "xs" }, /* @__PURE__ */ React105.createElement(Text55, { size: "sm", fw: 600 }, "Reply-To (Optional)"), /* @__PURE__ */ React105.createElement(
|
|
9480
9566
|
TextInput37,
|
|
9481
9567
|
{
|
|
9482
9568
|
placeholder: "reply@example.com",
|
|
@@ -9487,7 +9573,7 @@ var GeneralTab5 = ({
|
|
|
9487
9573
|
onReplyToChange(newReplyTo);
|
|
9488
9574
|
}
|
|
9489
9575
|
}
|
|
9490
|
-
), /* @__PURE__ */ React105.createElement(
|
|
9576
|
+
), /* @__PURE__ */ React105.createElement(Text55, { size: "xs", c: "dimmed" }, "Where replies should be sent")), /* @__PURE__ */ React105.createElement(Divider6, { variant: "dashed" }), /* @__PURE__ */ React105.createElement(Stack80, { gap: "xs" }, /* @__PURE__ */ React105.createElement(Text55, { size: "sm", fw: 600 }, "Subject"), /* @__PURE__ */ React105.createElement(
|
|
9491
9577
|
TextInput37,
|
|
9492
9578
|
{
|
|
9493
9579
|
placeholder: "Email subject line",
|
|
@@ -9498,7 +9584,7 @@ var GeneralTab5 = ({
|
|
|
9498
9584
|
onSubjectChange(newSubject);
|
|
9499
9585
|
}
|
|
9500
9586
|
}
|
|
9501
|
-
)), /* @__PURE__ */ React105.createElement(
|
|
9587
|
+
)), /* @__PURE__ */ React105.createElement(Stack80, { gap: "xs" }, /* @__PURE__ */ React105.createElement(Text55, { size: "sm", fw: 600 }, "Body Type"), /* @__PURE__ */ React105.createElement(
|
|
9502
9588
|
Select14,
|
|
9503
9589
|
{
|
|
9504
9590
|
value: localBodyType,
|
|
@@ -9512,7 +9598,7 @@ var GeneralTab5 = ({
|
|
|
9512
9598
|
{ value: "html", label: "HTML" }
|
|
9513
9599
|
]
|
|
9514
9600
|
}
|
|
9515
|
-
)), /* @__PURE__ */ React105.createElement(
|
|
9601
|
+
)), /* @__PURE__ */ React105.createElement(Stack80, { gap: "xs" }, /* @__PURE__ */ React105.createElement(Text55, { size: "sm", fw: 600 }, "Body"), /* @__PURE__ */ React105.createElement(
|
|
9516
9602
|
Textarea21,
|
|
9517
9603
|
{
|
|
9518
9604
|
placeholder: localBodyType === "html" ? "<h1>Hello!</h1><p>Welcome to our service.</p>" : "Email body content",
|
|
@@ -9524,7 +9610,7 @@ var GeneralTab5 = ({
|
|
|
9524
9610
|
onBodyChange(newBody);
|
|
9525
9611
|
}
|
|
9526
9612
|
}
|
|
9527
|
-
), /* @__PURE__ */ React105.createElement(
|
|
9613
|
+
), /* @__PURE__ */ React105.createElement(Text55, { size: "xs", c: "dimmed" }, localBodyType === "html" ? "HTML content for the email body" : "Plain text content for the email body"))));
|
|
9528
9614
|
};
|
|
9529
9615
|
|
|
9530
9616
|
// src/mantine/blocks/notify/template/TemplateConfig.tsx
|
|
@@ -9646,7 +9732,7 @@ var TemplateConfig5 = ({ editor, block }) => {
|
|
|
9646
9732
|
};
|
|
9647
9733
|
|
|
9648
9734
|
// src/mantine/blocks/notify/template/TemplateView.tsx
|
|
9649
|
-
import { Card as Card22, Group as
|
|
9735
|
+
import { Card as Card22, Group as Group36, Stack as Stack81, Text as Text56, ActionIcon as ActionIcon18, Badge as Badge14 } from "@mantine/core";
|
|
9650
9736
|
var NOTIFY_TEMPLATE_PANEL_ID = "notify-template-panel";
|
|
9651
9737
|
var NotifyTemplateView = ({ editor, block }) => {
|
|
9652
9738
|
const panelId = `${NOTIFY_TEMPLATE_PANEL_ID}-${block.id}`;
|
|
@@ -9675,17 +9761,17 @@ var NotifyTemplateView = ({ editor, block }) => {
|
|
|
9675
9761
|
return "gray";
|
|
9676
9762
|
}
|
|
9677
9763
|
};
|
|
9678
|
-
return /* @__PURE__ */ React107.createElement(Card22, { withBorder: true, padding: "md", radius: "md", style: { width: "100%", cursor: "pointer", position: "relative" }, onClick: open }, /* @__PURE__ */ React107.createElement(Badge14, { size: "xs", variant: "light", color: "gray", style: { position: "absolute", top: 8, right: 8 } }, "Template"), /* @__PURE__ */ React107.createElement(
|
|
9764
|
+
return /* @__PURE__ */ React107.createElement(Card22, { withBorder: true, padding: "md", radius: "md", style: { width: "100%", cursor: "pointer", position: "relative" }, onClick: open }, /* @__PURE__ */ React107.createElement(Badge14, { size: "xs", variant: "light", color: "gray", style: { position: "absolute", top: 8, right: 8 } }, "Template"), /* @__PURE__ */ React107.createElement(Group36, { wrap: "nowrap", justify: "space-between", align: "center" }, /* @__PURE__ */ React107.createElement(Group36, { wrap: "nowrap", align: "center" }, /* @__PURE__ */ React107.createElement(ActionIcon18, { variant: "light", color: getChannelColor(channel), size: "lg", radius: "xl", style: { flexShrink: 0 } }, getIcon(block.props.icon, 18, 1.5, "bell")), /* @__PURE__ */ React107.createElement(Stack81, { gap: "xs", style: { flex: 1 } }, /* @__PURE__ */ React107.createElement(Group36, { gap: "xs", wrap: "nowrap" }, /* @__PURE__ */ React107.createElement(Badge14, { size: "sm", variant: "filled", color: getChannelColor(channel) }, channel.toUpperCase()), /* @__PURE__ */ React107.createElement(Text56, { fw: 500, size: "sm", contentEditable: false }, block.props.title || "Notification")), /* @__PURE__ */ React107.createElement(Text56, { size: "xs", c: "dimmed", contentEditable: false, lineClamp: 1 }, to.length > 0 ? `To: ${to.join(", ")}` : "Click to configure recipients"), block.props.description && /* @__PURE__ */ React107.createElement(Text56, { size: "xs", c: "dimmed", contentEditable: false }, block.props.description)))));
|
|
9679
9765
|
};
|
|
9680
9766
|
|
|
9681
9767
|
// src/mantine/blocks/notify/flow/FlowView.tsx
|
|
9682
|
-
import React108, { useState as
|
|
9683
|
-
import { Card as Card23, Group as
|
|
9684
|
-
import { IconSend as IconSend2, IconChevronDown as
|
|
9768
|
+
import React108, { useState as useState30 } from "react";
|
|
9769
|
+
import { Card as Card23, Group as Group37, Stack as Stack82, Text as Text57, ActionIcon as ActionIcon19, Tooltip as Tooltip7, Button as Button27, Badge as Badge15, Collapse as Collapse4, Alert as Alert12, Loader as Loader7, Code as Code3 } from "@mantine/core";
|
|
9770
|
+
import { IconSend as IconSend2, IconChevronDown as IconChevronDown4, IconChevronUp as IconChevronUp3, IconCheck, IconX as IconX3 } from "@tabler/icons-react";
|
|
9685
9771
|
var NotifyFlowView = ({ editor, block, isDisabled }) => {
|
|
9686
9772
|
const disabled = isDisabled?.isDisabled === "disable";
|
|
9687
|
-
const [isLoading, setIsLoading] =
|
|
9688
|
-
const [showDetails, setShowDetails] =
|
|
9773
|
+
const [isLoading, setIsLoading] = useState30(false);
|
|
9774
|
+
const [showDetails, setShowDetails] = useState30(false);
|
|
9689
9775
|
let handlers = null;
|
|
9690
9776
|
try {
|
|
9691
9777
|
handlers = useBlocknoteHandlers();
|
|
@@ -9800,14 +9886,14 @@ var NotifyFlowView = ({ editor, block, isDisabled }) => {
|
|
|
9800
9886
|
size: "sm",
|
|
9801
9887
|
variant: "light",
|
|
9802
9888
|
color: getChannelColor(channel),
|
|
9803
|
-
leftSection: isLoading ? /* @__PURE__ */ React108.createElement(
|
|
9889
|
+
leftSection: isLoading ? /* @__PURE__ */ React108.createElement(Loader7, { size: 14 }) : status === "sent" ? /* @__PURE__ */ React108.createElement(IconCheck, { size: 14 }) : /* @__PURE__ */ React108.createElement(IconSend2, { size: 14 }),
|
|
9804
9890
|
onClick: handleSendNotification,
|
|
9805
9891
|
disabled: !canSend,
|
|
9806
9892
|
style: { flexShrink: 0 }
|
|
9807
9893
|
},
|
|
9808
9894
|
isLoading ? "Sending..." : status === "sent" ? "Sent" : "Send"
|
|
9809
9895
|
);
|
|
9810
|
-
return /* @__PURE__ */ React108.createElement(Card23, { withBorder: true, padding: "md", radius: "md", style: { width: "100%" } }, /* @__PURE__ */ React108.createElement(
|
|
9896
|
+
return /* @__PURE__ */ React108.createElement(Card23, { withBorder: true, padding: "md", radius: "md", style: { width: "100%" } }, /* @__PURE__ */ React108.createElement(Stack82, { gap: "md" }, /* @__PURE__ */ React108.createElement(Group37, { wrap: "nowrap", justify: "space-between", align: "flex-start" }, /* @__PURE__ */ React108.createElement(Group37, { wrap: "nowrap", align: "flex-start", style: { flex: 1 } }, /* @__PURE__ */ React108.createElement(ActionIcon19, { variant: "light", color: getChannelColor(channel), size: "lg", radius: "xl", style: { flexShrink: 0 } }, getIcon(block.props.icon, 18, 1.5, "bell")), /* @__PURE__ */ React108.createElement(Stack82, { gap: "xs", style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ React108.createElement(Group37, { gap: "xs", wrap: "nowrap" }, /* @__PURE__ */ React108.createElement(Badge15, { size: "sm", variant: "filled", color: getChannelColor(channel) }, channel.toUpperCase()), /* @__PURE__ */ React108.createElement(Text57, { fw: 500, size: "sm", contentEditable: false }, block.props.title || "Notification"), status !== "idle" && /* @__PURE__ */ React108.createElement(Badge15, { size: "xs", variant: "dot", color: getStatusColor(status) }, status)), /* @__PURE__ */ React108.createElement(Text57, { size: "xs", c: "dimmed", contentEditable: false, lineClamp: 1 }, to.length > 0 ? `To: ${to.slice(0, 2).join(", ")}${to.length > 2 ? ` +${to.length - 2} more` : ""}` : "No recipients"), block.props.description && /* @__PURE__ */ React108.createElement(Text57, { size: "xs", c: "dimmed", contentEditable: false }, block.props.description))), /* @__PURE__ */ React108.createElement(Group37, { gap: "xs", style: { flexShrink: 0 } }, disabled && isDisabled?.message ? /* @__PURE__ */ React108.createElement(Tooltip7, { label: isDisabled.message, position: "left", withArrow: true }, sendButton) : sendButton, /* @__PURE__ */ React108.createElement(ActionIcon19, { variant: "subtle", onClick: () => setShowDetails(!showDetails) }, showDetails ? /* @__PURE__ */ React108.createElement(IconChevronUp3, { size: 16 }) : /* @__PURE__ */ React108.createElement(IconChevronDown4, { size: 16 })))), status === "failed" && block.props.errorMessage && /* @__PURE__ */ React108.createElement(Alert12, { color: "red", icon: /* @__PURE__ */ React108.createElement(IconX3, { size: 16 }), title: "Failed to send", styles: { message: { fontSize: "12px" } } }, block.props.errorMessage), status === "sent" && block.props.messageId && /* @__PURE__ */ React108.createElement(Alert12, { color: "green", icon: /* @__PURE__ */ React108.createElement(IconCheck, { size: 16 }), title: "Sent successfully", styles: { message: { fontSize: "12px" } } }, "Message ID: ", block.props.messageId, block.props.sentAt && /* @__PURE__ */ React108.createElement(React108.Fragment, null, /* @__PURE__ */ React108.createElement("br", null), "Sent at: ", new Date(block.props.sentAt).toLocaleString())), /* @__PURE__ */ React108.createElement(Collapse4, { in: showDetails }, /* @__PURE__ */ React108.createElement(Stack82, { gap: "md" }, channel === "email" && /* @__PURE__ */ React108.createElement(React108.Fragment, null, /* @__PURE__ */ React108.createElement(Stack82, { gap: "xs" }, /* @__PURE__ */ React108.createElement(Text57, { size: "xs", fw: 600, c: "dimmed" }, "Recipients:"), /* @__PURE__ */ React108.createElement(Code3, { block: true, style: { fontSize: "11px" } }, JSON.stringify(
|
|
9811
9897
|
{
|
|
9812
9898
|
to: to.filter((e) => e.trim() !== ""),
|
|
9813
9899
|
...cc.length > 0 && { cc: cc.filter((e) => e.trim() !== "") },
|
|
@@ -9815,7 +9901,7 @@ var NotifyFlowView = ({ editor, block, isDisabled }) => {
|
|
|
9815
9901
|
},
|
|
9816
9902
|
null,
|
|
9817
9903
|
2
|
|
9818
|
-
))), block.props.subject && /* @__PURE__ */ React108.createElement(
|
|
9904
|
+
))), block.props.subject && /* @__PURE__ */ React108.createElement(Stack82, { gap: "xs" }, /* @__PURE__ */ React108.createElement(Text57, { size: "xs", fw: 600, c: "dimmed" }, "Subject:"), /* @__PURE__ */ React108.createElement(Text57, { size: "xs" }, block.props.subject)), block.props.body && /* @__PURE__ */ React108.createElement(Stack82, { gap: "xs" }, /* @__PURE__ */ React108.createElement(Text57, { size: "xs", fw: 600, c: "dimmed" }, "Body (", block.props.bodyType || "text", "):"), /* @__PURE__ */ React108.createElement(Code3, { block: true, style: { fontSize: "11px", maxHeight: "200px", overflow: "auto" } }, block.props.body)), (block.props.from || block.props.replyTo) && /* @__PURE__ */ React108.createElement(Stack82, { gap: "xs" }, /* @__PURE__ */ React108.createElement(Text57, { size: "xs", fw: 600, c: "dimmed" }, "Additional:"), /* @__PURE__ */ React108.createElement(Code3, { block: true, style: { fontSize: "11px" } }, JSON.stringify(
|
|
9819
9905
|
{
|
|
9820
9906
|
...block.props.from && { from: block.props.from },
|
|
9821
9907
|
...block.props.replyTo && { replyTo: block.props.replyTo }
|
|
@@ -9900,19 +9986,19 @@ import React118 from "react";
|
|
|
9900
9986
|
|
|
9901
9987
|
// src/mantine/blocks/claim/template/TemplateView.tsx
|
|
9902
9988
|
import React114, { useMemo as useMemo20 } from "react";
|
|
9903
|
-
import { Card as Card24, Group as
|
|
9989
|
+
import { Card as Card24, Group as Group39, Stack as Stack85, Text as Text60, ActionIcon as ActionIcon20, Badge as Badge16 } from "@mantine/core";
|
|
9904
9990
|
|
|
9905
9991
|
// src/mantine/blocks/claim/template/TemplateConfig.tsx
|
|
9906
9992
|
import React113, { useCallback as useCallback21 } from "react";
|
|
9907
9993
|
import { Paper as Paper13, CloseButton as CloseButton8, Title as Title9 } from "@mantine/core";
|
|
9908
9994
|
|
|
9909
9995
|
// src/mantine/blocks/claim/template/GeneralTab.tsx
|
|
9910
|
-
import React112, { useEffect as
|
|
9911
|
-
import { Stack as
|
|
9996
|
+
import React112, { useEffect as useEffect21, useState as useState32, useCallback as useCallback20, useMemo as useMemo19 } from "react";
|
|
9997
|
+
import { Stack as Stack84, Text as Text59, TextInput as TextInput39, Textarea as Textarea22 } from "@mantine/core";
|
|
9912
9998
|
|
|
9913
9999
|
// src/mantine/components/CollectionSelector.tsx
|
|
9914
|
-
import React111, { useState as
|
|
9915
|
-
import { Stack as
|
|
10000
|
+
import React111, { useState as useState31, useEffect as useEffect20 } from "react";
|
|
10001
|
+
import { Stack as Stack83, Text as Text58, TextInput as TextInput38, Button as Button28, Group as Group38, Checkbox as Checkbox10, Loader as Loader8, Alert as Alert13 } from "@mantine/core";
|
|
9916
10002
|
var CollectionSelector = ({
|
|
9917
10003
|
did,
|
|
9918
10004
|
selectedCollections,
|
|
@@ -9923,11 +10009,11 @@ var CollectionSelector = ({
|
|
|
9923
10009
|
}) => {
|
|
9924
10010
|
console.log("[CollectionSelector] Rendered with selectedCollections:", selectedCollections);
|
|
9925
10011
|
const handlers = useBlocknoteHandlers();
|
|
9926
|
-
const [localDid, setLocalDid] =
|
|
9927
|
-
const [collections, setCollections] =
|
|
9928
|
-
const [loading, setLoading] =
|
|
9929
|
-
const [error, setError] =
|
|
9930
|
-
|
|
10012
|
+
const [localDid, setLocalDid] = useState31(did || "");
|
|
10013
|
+
const [collections, setCollections] = useState31([]);
|
|
10014
|
+
const [loading, setLoading] = useState31(false);
|
|
10015
|
+
const [error, setError] = useState31(null);
|
|
10016
|
+
useEffect20(() => {
|
|
9931
10017
|
setLocalDid(did || "");
|
|
9932
10018
|
}, [did]);
|
|
9933
10019
|
const handleDidChange = (value) => {
|
|
@@ -9972,7 +10058,7 @@ var CollectionSelector = ({
|
|
|
9972
10058
|
if (!collection) return "Unnamed Collection";
|
|
9973
10059
|
return collection.protocol?.profile?.name || collection.name || "Unnamed Collection";
|
|
9974
10060
|
};
|
|
9975
|
-
return /* @__PURE__ */ React111.createElement(
|
|
10061
|
+
return /* @__PURE__ */ React111.createElement(Stack83, { gap: "lg" }, /* @__PURE__ */ React111.createElement(Stack83, { gap: "xs" }, /* @__PURE__ */ React111.createElement(Text58, { size: "sm", fw: 600 }, "DID"), /* @__PURE__ */ React111.createElement(Group38, { gap: "xs", align: "flex-start", wrap: "nowrap" }, /* @__PURE__ */ React111.createElement(
|
|
9976
10062
|
TextInput38,
|
|
9977
10063
|
{
|
|
9978
10064
|
placeholder: "Enter DID",
|
|
@@ -9981,18 +10067,18 @@ var CollectionSelector = ({
|
|
|
9981
10067
|
description: "The DID identifier for fetching claim collections",
|
|
9982
10068
|
style: { flex: 1 }
|
|
9983
10069
|
}
|
|
9984
|
-
), /* @__PURE__ */ React111.createElement(Button28, { onClick: handleGetCollections, disabled: !localDid.trim() || loading, style: { marginTop: "1px" } }, loading ? /* @__PURE__ */ React111.createElement(
|
|
10070
|
+
), /* @__PURE__ */ React111.createElement(Button28, { onClick: handleGetCollections, disabled: !localDid.trim() || loading, style: { marginTop: "1px" } }, loading ? /* @__PURE__ */ React111.createElement(Loader8, { size: "xs", color: "white" }) : "Get Collections"))), error && /* @__PURE__ */ React111.createElement(Alert13, { color: "red", title: "Error" }, error), collections && collections.length > 0 && /* @__PURE__ */ React111.createElement(Stack83, { gap: "xs" }, /* @__PURE__ */ React111.createElement(Text58, { size: "sm", fw: 600 }, "Claim Collections"), /* @__PURE__ */ React111.createElement(Stack83, { gap: "sm" }, collections.map((collection) => {
|
|
9985
10071
|
if (!collection || !collection.id) return null;
|
|
9986
10072
|
return /* @__PURE__ */ React111.createElement(
|
|
9987
10073
|
Checkbox10,
|
|
9988
10074
|
{
|
|
9989
10075
|
key: collection.id,
|
|
9990
|
-
label: /* @__PURE__ */ React111.createElement(
|
|
10076
|
+
label: /* @__PURE__ */ React111.createElement(Stack83, { gap: 2 }, /* @__PURE__ */ React111.createElement(Text58, { size: "sm", fw: 500 }, getCollectionName(collection)), /* @__PURE__ */ React111.createElement(Text58, { size: "xs", c: "dimmed", style: { fontFamily: "monospace" } }, "ID: ", collection.id), collection.description && /* @__PURE__ */ React111.createElement(Text58, { size: "xs", c: "dimmed" }, collection.description)),
|
|
9991
10077
|
checked: selectedCollections?.includes(collection.id) ?? false,
|
|
9992
10078
|
onChange: () => handleToggleCollection(collection.id)
|
|
9993
10079
|
}
|
|
9994
10080
|
);
|
|
9995
|
-
}))), selectedCollections && selectedCollections.length > 0 && /* @__PURE__ */ React111.createElement(
|
|
10081
|
+
}))), selectedCollections && selectedCollections.length > 0 && /* @__PURE__ */ React111.createElement(Stack83, { gap: "xs" }, /* @__PURE__ */ React111.createElement(Text58, { size: "sm", c: "dimmed" }, selectedCollections.length, " collection", selectedCollections.length !== 1 ? "s" : "", " selected")));
|
|
9996
10082
|
};
|
|
9997
10083
|
|
|
9998
10084
|
// src/mantine/blocks/claim/template/GeneralTab.tsx
|
|
@@ -10008,12 +10094,12 @@ var GeneralTab6 = ({
|
|
|
10008
10094
|
onSelectedCollectionsChange,
|
|
10009
10095
|
onAdminAddressChange
|
|
10010
10096
|
}) => {
|
|
10011
|
-
const [localTitle, setLocalTitle] =
|
|
10012
|
-
const [localDescription, setLocalDescription] =
|
|
10013
|
-
|
|
10097
|
+
const [localTitle, setLocalTitle] = useState32(title || "");
|
|
10098
|
+
const [localDescription, setLocalDescription] = useState32(description || "");
|
|
10099
|
+
useEffect21(() => {
|
|
10014
10100
|
setLocalTitle(title || "");
|
|
10015
10101
|
}, [title]);
|
|
10016
|
-
|
|
10102
|
+
useEffect21(() => {
|
|
10017
10103
|
setLocalDescription(description || "");
|
|
10018
10104
|
}, [description]);
|
|
10019
10105
|
const parsedSelectedCollections = useMemo19(() => {
|
|
@@ -10040,7 +10126,7 @@ var GeneralTab6 = ({
|
|
|
10040
10126
|
},
|
|
10041
10127
|
[onAdminAddressChange]
|
|
10042
10128
|
);
|
|
10043
|
-
return /* @__PURE__ */ React112.createElement(
|
|
10129
|
+
return /* @__PURE__ */ React112.createElement(Stack84, { gap: "lg" }, /* @__PURE__ */ React112.createElement(Stack84, { gap: "xs" }, /* @__PURE__ */ React112.createElement(Text59, { size: "sm", fw: 600 }, "Title"), /* @__PURE__ */ React112.createElement(
|
|
10044
10130
|
TextInput39,
|
|
10045
10131
|
{
|
|
10046
10132
|
placeholder: "e.g. Claim Title",
|
|
@@ -10051,7 +10137,7 @@ var GeneralTab6 = ({
|
|
|
10051
10137
|
onTitleChange(newTitle);
|
|
10052
10138
|
}
|
|
10053
10139
|
}
|
|
10054
|
-
)), /* @__PURE__ */ React112.createElement(
|
|
10140
|
+
)), /* @__PURE__ */ React112.createElement(Stack84, { gap: "xs" }, /* @__PURE__ */ React112.createElement(Text59, { size: "sm", fw: 600 }, "Description"), /* @__PURE__ */ React112.createElement(
|
|
10055
10141
|
Textarea22,
|
|
10056
10142
|
{
|
|
10057
10143
|
placeholder: "Describe what this claim is about",
|
|
@@ -10151,21 +10237,21 @@ var ClaimTemplateView = ({ editor, block }) => {
|
|
|
10151
10237
|
const panelId = `${CLAIM_TEMPLATE_PANEL_ID}-${block.id}`;
|
|
10152
10238
|
const panelContent = useMemo20(() => /* @__PURE__ */ React114.createElement(TemplateConfig6, { editor, block }), [editor, block]);
|
|
10153
10239
|
const { open } = usePanel(panelId, panelContent);
|
|
10154
|
-
return /* @__PURE__ */ React114.createElement(Card24, { withBorder: true, padding: "md", radius: "md", style: { width: "100%", cursor: "pointer", position: "relative" }, onClick: open }, /* @__PURE__ */ React114.createElement(Badge16, { size: "xs", variant: "light", color: "gray", style: { position: "absolute", top: 8, right: 8 } }, "Template"), /* @__PURE__ */ React114.createElement(
|
|
10240
|
+
return /* @__PURE__ */ React114.createElement(Card24, { withBorder: true, padding: "md", radius: "md", style: { width: "100%", cursor: "pointer", position: "relative" }, onClick: open }, /* @__PURE__ */ React114.createElement(Badge16, { size: "xs", variant: "light", color: "gray", style: { position: "absolute", top: 8, right: 8 } }, "Template"), /* @__PURE__ */ React114.createElement(Group39, { wrap: "nowrap", justify: "space-between", align: "center" }, /* @__PURE__ */ React114.createElement(Group39, { wrap: "nowrap", align: "center" }, /* @__PURE__ */ React114.createElement(ActionIcon20, { variant: "light", color: "blue", size: "lg", radius: "xl", style: { flexShrink: 0 } }, getIcon(block.props.icon, 18, 1.5, "square-check")), /* @__PURE__ */ React114.createElement(Stack85, { gap: "xs", style: { flex: 1 } }, /* @__PURE__ */ React114.createElement(Text60, { fw: 500, size: "sm", contentEditable: false }, block.props.title || "Claim Title"), /* @__PURE__ */ React114.createElement(Text60, { size: "xs", c: "dimmed", contentEditable: false }, block.props.description || "Claim description")))));
|
|
10155
10241
|
};
|
|
10156
10242
|
|
|
10157
10243
|
// src/mantine/blocks/claim/flow/FlowView.tsx
|
|
10158
|
-
import React117, { useState as
|
|
10159
|
-
import { Stack as
|
|
10244
|
+
import React117, { useState as useState35, useEffect as useEffect24, useMemo as useMemo23, useCallback as useCallback23 } from "react";
|
|
10245
|
+
import { Stack as Stack88, Text as Text63, Loader as Loader11, Center as Center5, Alert as Alert15, Title as Title11, Flex as Flex22, ActionIcon as ActionIcon23 } from "@mantine/core";
|
|
10160
10246
|
import { IconSettings as IconSettings3, IconRefresh as IconRefresh2, IconAlertCircle as IconAlertCircle3 } from "@tabler/icons-react";
|
|
10161
10247
|
|
|
10162
10248
|
// src/mantine/blocks/claim/flow/ClaimCollectionsList.tsx
|
|
10163
|
-
import React116, { useMemo as useMemo22, useState as
|
|
10164
|
-
import { Stack as
|
|
10249
|
+
import React116, { useMemo as useMemo22, useState as useState34, useEffect as useEffect23 } from "react";
|
|
10250
|
+
import { Stack as Stack87, Text as Text62, ActionIcon as ActionIcon22, Tooltip as Tooltip8, Loader as Loader10, Center as Center4 } from "@mantine/core";
|
|
10165
10251
|
|
|
10166
10252
|
// src/mantine/blocks/claim/flow/ClaimsListSheet.tsx
|
|
10167
|
-
import React115, { useState as
|
|
10168
|
-
import { CloseButton as CloseButton9, Title as Title10, Loader as
|
|
10253
|
+
import React115, { useState as useState33, useEffect as useEffect22, useCallback as useCallback22, useMemo as useMemo21 } from "react";
|
|
10254
|
+
import { CloseButton as CloseButton9, Title as Title10, Loader as Loader9, Stack as Stack86, Text as Text61, Button as Button29, ActionIcon as ActionIcon21, Alert as Alert14 } from "@mantine/core";
|
|
10169
10255
|
import { IconArrowLeft as IconArrowLeft2, IconAlertCircle as IconAlertCircle2 } from "@tabler/icons-react";
|
|
10170
10256
|
import { Survey, SurveyModel } from "@ixo/surveys";
|
|
10171
10257
|
|
|
@@ -10332,13 +10418,13 @@ var surveyTheme = {
|
|
|
10332
10418
|
var ClaimsListSheet = ({ collectionId, collectionName, deedId, adminAddress, userAddress, onSubmitComplete }) => {
|
|
10333
10419
|
const { closePanel } = usePanelStore();
|
|
10334
10420
|
const handlers = useBlocknoteHandlers();
|
|
10335
|
-
const [viewMode, setViewMode] =
|
|
10336
|
-
const [claims, setClaims] =
|
|
10337
|
-
const [loading, setLoading] =
|
|
10338
|
-
const [error, setError] =
|
|
10339
|
-
const [surveyJson, setSurveyJson] =
|
|
10340
|
-
const [surveyLoading, setSurveyLoading] =
|
|
10341
|
-
const [surveyError, setSurveyError] =
|
|
10421
|
+
const [viewMode, setViewMode] = useState33("list");
|
|
10422
|
+
const [claims, setClaims] = useState33([]);
|
|
10423
|
+
const [loading, setLoading] = useState33(true);
|
|
10424
|
+
const [error, setError] = useState33(null);
|
|
10425
|
+
const [surveyJson, setSurveyJson] = useState33(null);
|
|
10426
|
+
const [surveyLoading, setSurveyLoading] = useState33(false);
|
|
10427
|
+
const [surveyError, setSurveyError] = useState33(null);
|
|
10342
10428
|
const fetchClaims = useCallback22(async () => {
|
|
10343
10429
|
try {
|
|
10344
10430
|
setLoading(true);
|
|
@@ -10373,7 +10459,7 @@ var ClaimsListSheet = ({ collectionId, collectionName, deedId, adminAddress, use
|
|
|
10373
10459
|
setSurveyLoading(false);
|
|
10374
10460
|
}
|
|
10375
10461
|
}, [deedId, handlers]);
|
|
10376
|
-
|
|
10462
|
+
useEffect22(() => {
|
|
10377
10463
|
fetchClaims();
|
|
10378
10464
|
}, [fetchClaims]);
|
|
10379
10465
|
const surveyModel = useMemo21(() => {
|
|
@@ -10414,7 +10500,7 @@ var ClaimsListSheet = ({ collectionId, collectionName, deedId, adminAddress, use
|
|
|
10414
10500
|
},
|
|
10415
10501
|
[handlers, deedId, collectionId, adminAddress, closePanel, onSubmitComplete]
|
|
10416
10502
|
);
|
|
10417
|
-
|
|
10503
|
+
useEffect22(() => {
|
|
10418
10504
|
if (surveyModel) {
|
|
10419
10505
|
surveyModel.onComplete.add(handleSurveyComplete);
|
|
10420
10506
|
return () => {
|
|
@@ -10511,9 +10597,9 @@ var ClaimsListSheet = ({ collectionId, collectionName, deedId, adminAddress, use
|
|
|
10511
10597
|
pointerEvents: viewMode === "list" ? "auto" : "none"
|
|
10512
10598
|
}
|
|
10513
10599
|
},
|
|
10514
|
-
/* @__PURE__ */ React115.createElement(
|
|
10600
|
+
/* @__PURE__ */ React115.createElement(Stack86, { gap: "md", style: { flex: 1 } }, /* @__PURE__ */ React115.createElement(Button29, { onClick: handleNewClaim, fullWidth: true }, "New Claim"), loading ? /* @__PURE__ */ React115.createElement(Stack86, { align: "center", justify: "center", style: { flex: 1 } }, /* @__PURE__ */ React115.createElement(Loader9, { size: "lg" }), /* @__PURE__ */ React115.createElement(Text61, { size: "sm", c: "dimmed" }, "Loading claims...")) : error ? /* @__PURE__ */ React115.createElement(Alert14, { color: "red", title: "Failed to load claims", icon: /* @__PURE__ */ React115.createElement(IconAlertCircle2, { size: 18 }) }, /* @__PURE__ */ React115.createElement(Text61, { size: "sm" }, error)) : claims.length === 0 ? /* @__PURE__ */ React115.createElement(Stack86, { align: "center", justify: "center", style: { flex: 1 } }, /* @__PURE__ */ React115.createElement(Text61, { size: "sm", c: "dimmed", ta: "center" }, 'No claims found. Click "New Claim" to submit your first claim.')) : /* @__PURE__ */ React115.createElement(Stack86, { gap: "xs" }, claims.map((claim) => {
|
|
10515
10601
|
const status = getClaimStatus(claim.paymentsStatus);
|
|
10516
|
-
return /* @__PURE__ */ React115.createElement(ListItemContainer, { key: claim.claimId }, /* @__PURE__ */ React115.createElement(
|
|
10602
|
+
return /* @__PURE__ */ React115.createElement(ListItemContainer, { key: claim.claimId }, /* @__PURE__ */ React115.createElement(Stack86, { gap: 4, style: { flex: 1 } }, /* @__PURE__ */ React115.createElement(Text61, { size: "sm", fw: 500 }, "Claim #", claim.claimId.slice(-8)), /* @__PURE__ */ React115.createElement(Text61, { size: "xs", c: "dimmed" }, "Submitted: ", formatDate(claim.submissionDate))), /* @__PURE__ */ React115.createElement(Text61, { size: "xs", fw: 500, c: getStatusColor(status) }, status.toUpperCase()));
|
|
10517
10603
|
})))
|
|
10518
10604
|
),
|
|
10519
10605
|
/* @__PURE__ */ React115.createElement(
|
|
@@ -10534,7 +10620,7 @@ var ClaimsListSheet = ({ collectionId, collectionName, deedId, adminAddress, use
|
|
|
10534
10620
|
pointerEvents: viewMode === "survey" ? "auto" : "none"
|
|
10535
10621
|
}
|
|
10536
10622
|
},
|
|
10537
|
-
/* @__PURE__ */ React115.createElement("div", null, surveyLoading && /* @__PURE__ */ React115.createElement(
|
|
10623
|
+
/* @__PURE__ */ React115.createElement("div", null, surveyLoading && /* @__PURE__ */ React115.createElement(Stack86, { align: "center", justify: "center", style: { height: "100%" } }, /* @__PURE__ */ React115.createElement(Loader9, { size: "lg" }), /* @__PURE__ */ React115.createElement(Text61, { size: "sm", c: "dimmed" }, "Loading survey template...")), surveyError && /* @__PURE__ */ React115.createElement(Stack86, { align: "center", justify: "center", style: { height: "100%", padding: "1rem" } }, /* @__PURE__ */ React115.createElement(Text61, { size: "sm", c: "red" }, surveyError)), !surveyLoading && !surveyError && surveyModel && /* @__PURE__ */ React115.createElement(Survey, { model: surveyModel }))
|
|
10538
10624
|
)
|
|
10539
10625
|
)
|
|
10540
10626
|
);
|
|
@@ -10572,13 +10658,13 @@ var CollectionItem = ({ collection, deedId, adminAddress, userRole, onRefresh })
|
|
|
10572
10658
|
openClaimsPanel();
|
|
10573
10659
|
}
|
|
10574
10660
|
};
|
|
10575
|
-
return /* @__PURE__ */ React116.createElement("div", { style: { opacity: canAccessClaims ? 1 : 0.5 } }, /* @__PURE__ */ React116.createElement(ListItemContainer, null, /* @__PURE__ */ React116.createElement(
|
|
10661
|
+
return /* @__PURE__ */ React116.createElement("div", { style: { opacity: canAccessClaims ? 1 : 0.5 } }, /* @__PURE__ */ React116.createElement(ListItemContainer, null, /* @__PURE__ */ React116.createElement(Stack87, { gap: 4, style: { flex: 1 } }, /* @__PURE__ */ React116.createElement(Text62, { size: "sm", fw: 500, c: canAccessClaims ? void 0 : "dimmed" }, getCollectionName(collection)), collection.description && /* @__PURE__ */ React116.createElement(Text62, { size: "xs", c: "dimmed" }, collection.description)), /* @__PURE__ */ React116.createElement(Tooltip8, { label: "You need to apply to be a service agent first", disabled: canAccessClaims, position: "left", withArrow: true }, /* @__PURE__ */ React116.createElement(ActionIcon22, { variant: "subtle", size: "lg", onClick: handleClick, disabled: !canAccessClaims, style: { cursor: canAccessClaims ? "pointer" : "not-allowed" } }, /* @__PURE__ */ React116.createElement(IconArrowRight2, { size: 20 })))));
|
|
10576
10662
|
};
|
|
10577
10663
|
var ClaimCollectionsList = ({ collections, deedId, adminAddress, userAddress, onRefresh }) => {
|
|
10578
10664
|
const handlers = useBlocknoteHandlers();
|
|
10579
|
-
const [userRoles, setUserRoles] =
|
|
10580
|
-
const [loadingRoles, setLoadingRoles] =
|
|
10581
|
-
|
|
10665
|
+
const [userRoles, setUserRoles] = useState34({});
|
|
10666
|
+
const [loadingRoles, setLoadingRoles] = useState34(true);
|
|
10667
|
+
useEffect23(() => {
|
|
10582
10668
|
const fetchUserRoles = async () => {
|
|
10583
10669
|
if (!collections || collections.length === 0 || !userAddress || !adminAddress) {
|
|
10584
10670
|
setLoadingRoles(false);
|
|
@@ -10613,12 +10699,12 @@ var ClaimCollectionsList = ({ collections, deedId, adminAddress, userAddress, on
|
|
|
10613
10699
|
fetchUserRoles();
|
|
10614
10700
|
}, [collections, userAddress, adminAddress, handlers, deedId]);
|
|
10615
10701
|
if (!collections || collections.length === 0) {
|
|
10616
|
-
return /* @__PURE__ */ React116.createElement(
|
|
10702
|
+
return /* @__PURE__ */ React116.createElement(Text62, { size: "sm", c: "dimmed", ta: "center", py: "md" }, "No claim collections found");
|
|
10617
10703
|
}
|
|
10618
10704
|
if (loadingRoles) {
|
|
10619
|
-
return /* @__PURE__ */ React116.createElement(Center4, { py: "md" }, /* @__PURE__ */ React116.createElement(
|
|
10705
|
+
return /* @__PURE__ */ React116.createElement(Center4, { py: "md" }, /* @__PURE__ */ React116.createElement(Loader10, { size: "sm" }));
|
|
10620
10706
|
}
|
|
10621
|
-
return /* @__PURE__ */ React116.createElement(
|
|
10707
|
+
return /* @__PURE__ */ React116.createElement(Stack87, { gap: "md", px: 5 }, collections.map((collection) => /* @__PURE__ */ React116.createElement(CollectionItem, { key: collection.id, collection, deedId, adminAddress, userRole: userRoles[collection.id] || null, onRefresh })));
|
|
10622
10708
|
};
|
|
10623
10709
|
|
|
10624
10710
|
// src/mantine/blocks/claim/flow/FlowView.tsx
|
|
@@ -10627,9 +10713,9 @@ var ClaimFlowView = ({ editor, block }) => {
|
|
|
10627
10713
|
const { editable } = useBlocknoteContext();
|
|
10628
10714
|
const handlers = useBlocknoteHandlers();
|
|
10629
10715
|
const currentUser = handlers.getCurrentUser();
|
|
10630
|
-
const [collections, setCollections] =
|
|
10631
|
-
const [loading, setLoading] =
|
|
10632
|
-
const [error, setError] =
|
|
10716
|
+
const [collections, setCollections] = useState35([]);
|
|
10717
|
+
const [loading, setLoading] = useState35(false);
|
|
10718
|
+
const [error, setError] = useState35(null);
|
|
10633
10719
|
const panelId = `${CLAIM_FLOW_PANEL_ID}-${block.id}`;
|
|
10634
10720
|
const panelContent = useMemo23(() => /* @__PURE__ */ React117.createElement(TemplateConfig6, { editor, block }), [editor, block]);
|
|
10635
10721
|
const { open } = usePanel(panelId, panelContent);
|
|
@@ -10669,16 +10755,16 @@ var ClaimFlowView = ({ editor, block }) => {
|
|
|
10669
10755
|
setLoading(false);
|
|
10670
10756
|
}
|
|
10671
10757
|
}, [did, selectedCollectionIds, handlers, editor, block]);
|
|
10672
|
-
|
|
10758
|
+
useEffect24(() => {
|
|
10673
10759
|
fetchCollections();
|
|
10674
10760
|
}, [fetchCollections]);
|
|
10675
10761
|
if (!did) {
|
|
10676
|
-
return /* @__PURE__ */ React117.createElement(Center5, { py: "xl" }, /* @__PURE__ */ React117.createElement(
|
|
10762
|
+
return /* @__PURE__ */ React117.createElement(Center5, { py: "xl" }, /* @__PURE__ */ React117.createElement(Text63, { size: "sm", c: "dimmed" }, "Please configure the claim block in template mode first"));
|
|
10677
10763
|
}
|
|
10678
10764
|
if (selectedCollectionIds.length === 0) {
|
|
10679
|
-
return /* @__PURE__ */ React117.createElement(Center5, { py: "xl" }, /* @__PURE__ */ React117.createElement(
|
|
10765
|
+
return /* @__PURE__ */ React117.createElement(Center5, { py: "xl" }, /* @__PURE__ */ React117.createElement(Text63, { size: "sm", c: "dimmed" }, "No claim collections selected"));
|
|
10680
10766
|
}
|
|
10681
|
-
return /* @__PURE__ */ React117.createElement(
|
|
10767
|
+
return /* @__PURE__ */ React117.createElement(Stack88, { w: "100%" }, /* @__PURE__ */ React117.createElement(Flex22, { px: 5, align: "center", justify: "space-between" }, /* @__PURE__ */ React117.createElement(Title11, { order: 4 }, "Submit Claims"), /* @__PURE__ */ React117.createElement(Flex22, { gap: "xs" }, /* @__PURE__ */ React117.createElement(ActionIcon23, { variant: "subtle", size: "sm", onClick: fetchCollections, loading }, /* @__PURE__ */ React117.createElement(IconRefresh2, { size: 18 })), editable && /* @__PURE__ */ React117.createElement(ActionIcon23, { variant: "subtle", size: "sm", onClick: open }, /* @__PURE__ */ React117.createElement(IconSettings3, { size: 18 })))), loading ? /* @__PURE__ */ React117.createElement(Center5, { py: "xl" }, /* @__PURE__ */ React117.createElement(Loader11, { size: "md" })) : error ? /* @__PURE__ */ React117.createElement(Alert15, { color: "red", title: "Failed to load collections", icon: /* @__PURE__ */ React117.createElement(IconAlertCircle3, { size: 18 }) }, /* @__PURE__ */ React117.createElement(Text63, { size: "sm" }, error)) : /* @__PURE__ */ React117.createElement(ClaimCollectionsList, { collections, deedId: did, adminAddress, userAddress: currentUser.address, onRefresh: fetchCollections }));
|
|
10682
10768
|
};
|
|
10683
10769
|
|
|
10684
10770
|
// src/mantine/blocks/claim/ClaimBlock.tsx
|
|
@@ -10721,25 +10807,25 @@ import React129 from "react";
|
|
|
10721
10807
|
|
|
10722
10808
|
// src/mantine/blocks/bid/template/TemplateView.tsx
|
|
10723
10809
|
import React123, { useMemo as useMemo25 } from "react";
|
|
10724
|
-
import { Card as Card25, Group as
|
|
10810
|
+
import { Card as Card25, Group as Group40, Stack as Stack90, Text as Text65, ActionIcon as ActionIcon24, Badge as Badge17 } from "@mantine/core";
|
|
10725
10811
|
|
|
10726
10812
|
// src/mantine/blocks/bid/template/TemplateConfig.tsx
|
|
10727
10813
|
import React122, { useCallback as useCallback25 } from "react";
|
|
10728
10814
|
import { Paper as Paper14, CloseButton as CloseButton10, Title as Title12 } from "@mantine/core";
|
|
10729
10815
|
|
|
10730
10816
|
// src/mantine/blocks/bid/template/GeneralTab.tsx
|
|
10731
|
-
import React120, { useEffect as
|
|
10732
|
-
import { Stack as
|
|
10817
|
+
import React120, { useEffect as useEffect25, useState as useState36 } from "react";
|
|
10818
|
+
import { Stack as Stack89, Text as Text64, TextInput as TextInput40, Textarea as Textarea23 } from "@mantine/core";
|
|
10733
10819
|
var GeneralTab7 = ({ title, description, onTitleChange, onDescriptionChange }) => {
|
|
10734
|
-
const [localTitle, setLocalTitle] =
|
|
10735
|
-
const [localDescription, setLocalDescription] =
|
|
10736
|
-
|
|
10820
|
+
const [localTitle, setLocalTitle] = useState36(title || "");
|
|
10821
|
+
const [localDescription, setLocalDescription] = useState36(description || "");
|
|
10822
|
+
useEffect25(() => {
|
|
10737
10823
|
setLocalTitle(title || "");
|
|
10738
10824
|
}, [title]);
|
|
10739
|
-
|
|
10825
|
+
useEffect25(() => {
|
|
10740
10826
|
setLocalDescription(description || "");
|
|
10741
10827
|
}, [description]);
|
|
10742
|
-
return /* @__PURE__ */ React120.createElement(
|
|
10828
|
+
return /* @__PURE__ */ React120.createElement(Stack89, { gap: "lg" }, /* @__PURE__ */ React120.createElement(Stack89, { gap: "xs" }, /* @__PURE__ */ React120.createElement(Text64, { size: "sm", fw: 600 }, "Title"), /* @__PURE__ */ React120.createElement(
|
|
10743
10829
|
TextInput40,
|
|
10744
10830
|
{
|
|
10745
10831
|
placeholder: "e.g. Bid Title",
|
|
@@ -10750,7 +10836,7 @@ var GeneralTab7 = ({ title, description, onTitleChange, onDescriptionChange }) =
|
|
|
10750
10836
|
onTitleChange(newTitle);
|
|
10751
10837
|
}
|
|
10752
10838
|
}
|
|
10753
|
-
)), /* @__PURE__ */ React120.createElement(
|
|
10839
|
+
)), /* @__PURE__ */ React120.createElement(Stack89, { gap: "xs" }, /* @__PURE__ */ React120.createElement(Text64, { size: "sm", fw: 600 }, "Description"), /* @__PURE__ */ React120.createElement(
|
|
10754
10840
|
Textarea23,
|
|
10755
10841
|
{
|
|
10756
10842
|
placeholder: "Describe what this bid is about",
|
|
@@ -10894,22 +10980,22 @@ var BidTemplateView = ({ editor, block }) => {
|
|
|
10894
10980
|
}
|
|
10895
10981
|
}, [block.props.selectedCollections]);
|
|
10896
10982
|
const didDisplay = block.props.did ? `${block.props.did.substring(0, 15)}...${block.props.did.substring(block.props.did.length - 10)}` : "No DID configured";
|
|
10897
|
-
return /* @__PURE__ */ React123.createElement(Card25, { withBorder: true, padding: "md", radius: "md", style: { width: "100%", cursor: "pointer", position: "relative" }, onClick: open }, /* @__PURE__ */ React123.createElement(Badge17, { size: "xs", variant: "light", color: "gray", style: { position: "absolute", top: 8, right: 8 } }, "Template"), /* @__PURE__ */ React123.createElement(
|
|
10983
|
+
return /* @__PURE__ */ React123.createElement(Card25, { withBorder: true, padding: "md", radius: "md", style: { width: "100%", cursor: "pointer", position: "relative" }, onClick: open }, /* @__PURE__ */ React123.createElement(Badge17, { size: "xs", variant: "light", color: "gray", style: { position: "absolute", top: 8, right: 8 } }, "Template"), /* @__PURE__ */ React123.createElement(Group40, { wrap: "nowrap", justify: "space-between", align: "center" }, /* @__PURE__ */ React123.createElement(Group40, { wrap: "nowrap", align: "center" }, /* @__PURE__ */ React123.createElement(ActionIcon24, { variant: "light", color: "blue", size: "lg", radius: "xl", style: { flexShrink: 0 } }, getIcon("dollar-sign", 18, 1.5)), /* @__PURE__ */ React123.createElement(Stack90, { gap: "xs", style: { flex: 1 } }, /* @__PURE__ */ React123.createElement(Text65, { fw: 500, size: "sm", contentEditable: false }, "Bid Block"), /* @__PURE__ */ React123.createElement(Text65, { size: "xs", c: "dimmed", contentEditable: false }, block.props.did ? didDisplay : "Configure bid settings"), selectedCollectionsCount > 0 && /* @__PURE__ */ React123.createElement(Text65, { size: "xs", c: "blue", contentEditable: false }, selectedCollectionsCount, " collection", selectedCollectionsCount !== 1 ? "s" : "", " selected")))));
|
|
10898
10984
|
};
|
|
10899
10985
|
|
|
10900
10986
|
// src/mantine/blocks/bid/flow/FlowView.tsx
|
|
10901
|
-
import React128, { useState as
|
|
10902
|
-
import { Stack as
|
|
10987
|
+
import React128, { useState as useState41, useEffect as useEffect30, useMemo as useMemo30, useCallback as useCallback28 } from "react";
|
|
10988
|
+
import { Stack as Stack95, Text as Text70, Loader as Loader16, Center as Center8, Alert as Alert18, Title as Title15, Flex as Flex23, ActionIcon as ActionIcon27 } from "@mantine/core";
|
|
10903
10989
|
import { IconSettings as IconSettings4, IconRefresh as IconRefresh3, IconAlertCircle as IconAlertCircle6 } from "@tabler/icons-react";
|
|
10904
10990
|
|
|
10905
10991
|
// src/mantine/blocks/bid/flow/ClaimCollectionsList.tsx
|
|
10906
|
-
import React127, { useMemo as useMemo29, useState as
|
|
10907
|
-
import { Stack as
|
|
10908
|
-
import { IconChevronDown as
|
|
10992
|
+
import React127, { useMemo as useMemo29, useState as useState40, useEffect as useEffect29 } from "react";
|
|
10993
|
+
import { Stack as Stack94, Text as Text69, Button as Button31, Menu as Menu2, Badge as Badge20, Collapse as Collapse5, Loader as Loader15, Center as Center7, ActionIcon as ActionIcon26 } from "@mantine/core";
|
|
10994
|
+
import { IconChevronDown as IconChevronDown5, IconArrowDown as IconArrowDown3, IconArrowUp as IconArrowUp3 } from "@tabler/icons-react";
|
|
10909
10995
|
|
|
10910
10996
|
// src/mantine/blocks/bid/flow/BidSurveyPanel.tsx
|
|
10911
|
-
import React124, { useMemo as useMemo26, useState as
|
|
10912
|
-
import { Paper as Paper15, CloseButton as CloseButton11, Title as Title13, Loader as
|
|
10997
|
+
import React124, { useMemo as useMemo26, useState as useState37, useEffect as useEffect26, useCallback as useCallback26 } from "react";
|
|
10998
|
+
import { Paper as Paper15, CloseButton as CloseButton11, Title as Title13, Loader as Loader12, Stack as Stack91, Text as Text66 } from "@mantine/core";
|
|
10913
10999
|
import { Survey as Survey2, SurveyModel as SurveyModel2 } from "@ixo/surveys";
|
|
10914
11000
|
var SURVEY_THEME_VARIABLES = Object.entries(surveyTheme.cssVariables ?? {}).reduce((acc, [key, value]) => {
|
|
10915
11001
|
acc[key] = value;
|
|
@@ -10920,11 +11006,11 @@ var SURVEY_THEME_FOREGROUND = SURVEY_THEME_VARIABLES["--sjs-general-forecolor"]
|
|
|
10920
11006
|
var BidSurveyPanel = ({ deedId, collectionId, role, onSubmitComplete }) => {
|
|
10921
11007
|
const { closePanel } = usePanelStore();
|
|
10922
11008
|
const handlers = useBlocknoteHandlers();
|
|
10923
|
-
const [surveyJson, setSurveyJson] =
|
|
10924
|
-
const [loading, setLoading] =
|
|
10925
|
-
const [error, setError] =
|
|
11009
|
+
const [surveyJson, setSurveyJson] = useState37(null);
|
|
11010
|
+
const [loading, setLoading] = useState37(true);
|
|
11011
|
+
const [error, setError] = useState37(null);
|
|
10926
11012
|
const roleLabel = role === "service_agent" ? "Service Agent" : "Evaluation Agent";
|
|
10927
|
-
|
|
11013
|
+
useEffect26(() => {
|
|
10928
11014
|
const fetchSurveyTemplate = async () => {
|
|
10929
11015
|
try {
|
|
10930
11016
|
setLoading(true);
|
|
@@ -10983,7 +11069,7 @@ var BidSurveyPanel = ({ deedId, collectionId, role, onSubmitComplete }) => {
|
|
|
10983
11069
|
},
|
|
10984
11070
|
[handlers, collectionId, role, closePanel, onSubmitComplete]
|
|
10985
11071
|
);
|
|
10986
|
-
|
|
11072
|
+
useEffect26(() => {
|
|
10987
11073
|
if (surveyModel) {
|
|
10988
11074
|
surveyModel.onComplete.add(handleSurveyComplete);
|
|
10989
11075
|
return () => {
|
|
@@ -11016,18 +11102,18 @@ var BidSurveyPanel = ({ deedId, collectionId, role, onSubmitComplete }) => {
|
|
|
11016
11102
|
/* @__PURE__ */ React124.createElement(Title13, { order: 3 }, roleLabel, " Application"),
|
|
11017
11103
|
/* @__PURE__ */ React124.createElement(CloseButton11, { onClick: closePanel })
|
|
11018
11104
|
),
|
|
11019
|
-
/* @__PURE__ */ React124.createElement("div", { style: surveyContainerStyle }, loading && /* @__PURE__ */ React124.createElement(
|
|
11105
|
+
/* @__PURE__ */ React124.createElement("div", { style: surveyContainerStyle }, loading && /* @__PURE__ */ React124.createElement(Stack91, { align: "center", justify: "center", style: { height: "100%" } }, /* @__PURE__ */ React124.createElement(Loader12, { size: "lg" }), /* @__PURE__ */ React124.createElement(Text66, { size: "sm", c: "dimmed" }, "Loading survey template...")), error && /* @__PURE__ */ React124.createElement(Stack91, { align: "center", justify: "center", style: { height: "100%", padding: "1rem" } }, /* @__PURE__ */ React124.createElement(Text66, { size: "sm", c: "red" }, error)), !loading && !error && surveyModel && /* @__PURE__ */ React124.createElement(Survey2, { model: surveyModel }))
|
|
11020
11106
|
);
|
|
11021
11107
|
};
|
|
11022
11108
|
|
|
11023
11109
|
// src/mantine/blocks/bid/flow/BidsList.tsx
|
|
11024
|
-
import React126, { useState as
|
|
11025
|
-
import { Stack as
|
|
11110
|
+
import React126, { useState as useState39, useEffect as useEffect28, useMemo as useMemo28, useCallback as useCallback27 } from "react";
|
|
11111
|
+
import { Stack as Stack93, Text as Text68, Loader as Loader14, Center as Center6, Alert as Alert17, Badge as Badge19, Group as Group42, ActionIcon as ActionIcon25 } from "@mantine/core";
|
|
11026
11112
|
import { IconAlertCircle as IconAlertCircle5, IconArrowRight as IconArrowRight3 } from "@tabler/icons-react";
|
|
11027
11113
|
|
|
11028
11114
|
// src/mantine/blocks/bid/flow/BidViewPanel.tsx
|
|
11029
|
-
import React125, { useMemo as useMemo27, useState as
|
|
11030
|
-
import { Paper as Paper16, CloseButton as CloseButton12, Title as Title14, Loader as
|
|
11115
|
+
import React125, { useMemo as useMemo27, useState as useState38, useEffect as useEffect27 } from "react";
|
|
11116
|
+
import { Paper as Paper16, CloseButton as CloseButton12, Title as Title14, Loader as Loader13, Stack as Stack92, Text as Text67, Badge as Badge18, Button as Button30, Group as Group41, Modal as Modal2, Textarea as Textarea24, Alert as Alert16 } from "@mantine/core";
|
|
11031
11117
|
import { Survey as Survey3, SurveyModel as SurveyModel3 } from "@ixo/surveys";
|
|
11032
11118
|
import { IconCheck as IconCheck2, IconX as IconX4, IconAlertCircle as IconAlertCircle4 } from "@tabler/icons-react";
|
|
11033
11119
|
var SURVEY_THEME_VARIABLES2 = Object.entries(surveyTheme.cssVariables ?? {}).reduce((acc, [key, value]) => {
|
|
@@ -11039,14 +11125,14 @@ var SURVEY_THEME_FOREGROUND2 = SURVEY_THEME_VARIABLES2["--sjs-general-forecolor"
|
|
|
11039
11125
|
var BidViewPanel = ({ bid, deedId, adminAddress, onRefresh }) => {
|
|
11040
11126
|
const { closePanel } = usePanelStore();
|
|
11041
11127
|
const handlers = useBlocknoteHandlers();
|
|
11042
|
-
const [surveyJson, setSurveyJson] =
|
|
11043
|
-
const [loading, setLoading] =
|
|
11044
|
-
const [error, setError] =
|
|
11045
|
-
const [actionLoading, setActionLoading] =
|
|
11046
|
-
const [actionError, setActionError] =
|
|
11047
|
-
const [rejectModalOpen, setRejectModalOpen] =
|
|
11048
|
-
const [rejectReason, setRejectReason] =
|
|
11049
|
-
|
|
11128
|
+
const [surveyJson, setSurveyJson] = useState38(null);
|
|
11129
|
+
const [loading, setLoading] = useState38(true);
|
|
11130
|
+
const [error, setError] = useState38(null);
|
|
11131
|
+
const [actionLoading, setActionLoading] = useState38(false);
|
|
11132
|
+
const [actionError, setActionError] = useState38(null);
|
|
11133
|
+
const [rejectModalOpen, setRejectModalOpen] = useState38(false);
|
|
11134
|
+
const [rejectReason, setRejectReason] = useState38("");
|
|
11135
|
+
useEffect27(() => {
|
|
11050
11136
|
const fetchSurveyTemplate = async () => {
|
|
11051
11137
|
try {
|
|
11052
11138
|
setLoading(true);
|
|
@@ -11203,21 +11289,21 @@ var BidViewPanel = ({ bid, deedId, adminAddress, onRefresh }) => {
|
|
|
11203
11289
|
marginBottom: "1rem"
|
|
11204
11290
|
}
|
|
11205
11291
|
},
|
|
11206
|
-
/* @__PURE__ */ React125.createElement(
|
|
11292
|
+
/* @__PURE__ */ React125.createElement(Stack92, { gap: "xs" }, /* @__PURE__ */ React125.createElement(Title14, { order: 3 }, getRoleLabel(bid.role), " Bid"), getRoleBadge(bid.role)),
|
|
11207
11293
|
/* @__PURE__ */ React125.createElement(CloseButton12, { onClick: closePanel })
|
|
11208
11294
|
),
|
|
11209
|
-
!loading && !error && /* @__PURE__ */ React125.createElement(
|
|
11210
|
-
/* @__PURE__ */ React125.createElement("div", { style: surveyContainerStyle }, loading && /* @__PURE__ */ React125.createElement(
|
|
11211
|
-
/* @__PURE__ */ React125.createElement(Modal2, { opened: rejectModalOpen, onClose: () => setRejectModalOpen(false), title: "Reject Bid", centered: true }, /* @__PURE__ */ React125.createElement(
|
|
11295
|
+
!loading && !error && /* @__PURE__ */ React125.createElement(Stack92, { gap: "md", mb: "md" }, actionError && /* @__PURE__ */ React125.createElement(Alert16, { color: "red", icon: /* @__PURE__ */ React125.createElement(IconAlertCircle4, { size: 16 }), onClose: () => setActionError(null), withCloseButton: true }, actionError), /* @__PURE__ */ React125.createElement(Group41, { justify: "flex-end" }, /* @__PURE__ */ React125.createElement(Button30, { variant: "outline", color: "red", leftSection: /* @__PURE__ */ React125.createElement(IconX4, { size: 16 }), onClick: openRejectModal, loading: actionLoading, disabled: actionLoading }, "Reject"), /* @__PURE__ */ React125.createElement(Button30, { variant: "filled", color: "green", leftSection: /* @__PURE__ */ React125.createElement(IconCheck2, { size: 16 }), onClick: handleApproveBid, loading: actionLoading, disabled: actionLoading }, "Approve"))),
|
|
11296
|
+
/* @__PURE__ */ React125.createElement("div", { style: surveyContainerStyle }, loading && /* @__PURE__ */ React125.createElement(Stack92, { align: "center", justify: "center", style: { height: "100%" } }, /* @__PURE__ */ React125.createElement(Loader13, { size: "lg" }), /* @__PURE__ */ React125.createElement(Text67, { size: "sm", c: "dimmed" }, "Loading bid details...")), error && /* @__PURE__ */ React125.createElement(Stack92, { align: "center", justify: "center", style: { height: "100%", padding: "1rem" } }, /* @__PURE__ */ React125.createElement(Text67, { size: "sm", c: "red" }, error)), !loading && !error && surveyModel && /* @__PURE__ */ React125.createElement(Survey3, { model: surveyModel })),
|
|
11297
|
+
/* @__PURE__ */ React125.createElement(Modal2, { opened: rejectModalOpen, onClose: () => setRejectModalOpen(false), title: "Reject Bid", centered: true }, /* @__PURE__ */ React125.createElement(Stack92, { gap: "md" }, /* @__PURE__ */ React125.createElement(Text67, { size: "sm" }, "Please provide a reason for rejecting this bid:"), /* @__PURE__ */ React125.createElement(Textarea24, { placeholder: "Enter rejection reason...", value: rejectReason, onChange: (e) => setRejectReason(e.currentTarget.value), minRows: 3 }), /* @__PURE__ */ React125.createElement(Group41, { justify: "flex-end" }, /* @__PURE__ */ React125.createElement(Button30, { variant: "outline", onClick: () => setRejectModalOpen(false), disabled: actionLoading }, "Cancel"), /* @__PURE__ */ React125.createElement(Button30, { color: "red", onClick: handleRejectBid, loading: actionLoading, disabled: !rejectReason.trim() }, "Reject Bid"))))
|
|
11212
11298
|
);
|
|
11213
11299
|
};
|
|
11214
11300
|
|
|
11215
11301
|
// src/mantine/blocks/bid/flow/BidsList.tsx
|
|
11216
11302
|
var BidItem = ({ bid, deedId, adminAddress, onRefresh }) => {
|
|
11217
11303
|
const handlers = useBlocknoteHandlers();
|
|
11218
|
-
const [userProfile, setUserProfile] =
|
|
11219
|
-
const [loadingProfile, setLoadingProfile] =
|
|
11220
|
-
|
|
11304
|
+
const [userProfile, setUserProfile] = useState39(null);
|
|
11305
|
+
const [loadingProfile, setLoadingProfile] = useState39(false);
|
|
11306
|
+
useEffect28(() => {
|
|
11221
11307
|
const fetchUserProfile = async () => {
|
|
11222
11308
|
if (!bid.did) return;
|
|
11223
11309
|
try {
|
|
@@ -11270,13 +11356,13 @@ var BidItem = ({ bid, deedId, adminAddress, onRefresh }) => {
|
|
|
11270
11356
|
const displayDate = bid.created || "";
|
|
11271
11357
|
const displayStatus = bid.status;
|
|
11272
11358
|
const displayReason = bid.reason;
|
|
11273
|
-
return /* @__PURE__ */ React126.createElement(ListItemContainer, null, /* @__PURE__ */ React126.createElement(
|
|
11359
|
+
return /* @__PURE__ */ React126.createElement(ListItemContainer, null, /* @__PURE__ */ React126.createElement(Stack93, { gap: 4, style: { flex: 1 } }, /* @__PURE__ */ React126.createElement(Group42, { gap: "xs" }, /* @__PURE__ */ React126.createElement(Text68, { size: "xs", fw: 500 }, loadingProfile ? "Loading..." : displayName), userProfile?.verified && /* @__PURE__ */ React126.createElement(Text68, { size: "xs", c: "blue", fw: 600, title: "Verified user" }, "\u2713"), getRoleBadge(bid.role)), /* @__PURE__ */ React126.createElement(Text68, { size: "xs", c: "dimmed" }, "Submitted: ", formatDate(displayDate)), displayStatus === "rejected" && displayReason && /* @__PURE__ */ React126.createElement(Text68, { size: "xs", c: "red" }, "Reason: ", displayReason)), /* @__PURE__ */ React126.createElement(Group42, { gap: "xs" }, displayStatus && getStatusBadge(displayStatus), /* @__PURE__ */ React126.createElement(ActionIcon25, { variant: "subtle", size: "lg", onClick: openBidPanel }, /* @__PURE__ */ React126.createElement(IconArrowRight3, { size: 20 }))));
|
|
11274
11360
|
};
|
|
11275
11361
|
var BidsList = ({ collectionId, deedId, adminAddress, onRefresh }) => {
|
|
11276
11362
|
const handlers = useBlocknoteHandlers();
|
|
11277
|
-
const [bids, setBids] =
|
|
11278
|
-
const [loading, setLoading] =
|
|
11279
|
-
const [error, setError] =
|
|
11363
|
+
const [bids, setBids] = useState39([]);
|
|
11364
|
+
const [loading, setLoading] = useState39(true);
|
|
11365
|
+
const [error, setError] = useState39(null);
|
|
11280
11366
|
const fetchBids = useCallback27(async () => {
|
|
11281
11367
|
if (!collectionId) {
|
|
11282
11368
|
setLoading(false);
|
|
@@ -11295,7 +11381,7 @@ var BidsList = ({ collectionId, deedId, adminAddress, onRefresh }) => {
|
|
|
11295
11381
|
setLoading(false);
|
|
11296
11382
|
}
|
|
11297
11383
|
}, [collectionId, handlers]);
|
|
11298
|
-
|
|
11384
|
+
useEffect28(() => {
|
|
11299
11385
|
fetchBids();
|
|
11300
11386
|
}, [fetchBids]);
|
|
11301
11387
|
const handleRefresh = useCallback27(() => {
|
|
@@ -11303,20 +11389,20 @@ var BidsList = ({ collectionId, deedId, adminAddress, onRefresh }) => {
|
|
|
11303
11389
|
onRefresh();
|
|
11304
11390
|
}, [fetchBids, onRefresh]);
|
|
11305
11391
|
if (loading) {
|
|
11306
|
-
return /* @__PURE__ */ React126.createElement(Center6, { py: "md" }, /* @__PURE__ */ React126.createElement(
|
|
11392
|
+
return /* @__PURE__ */ React126.createElement(Center6, { py: "md" }, /* @__PURE__ */ React126.createElement(Loader14, { size: "sm" }));
|
|
11307
11393
|
}
|
|
11308
11394
|
if (error) {
|
|
11309
|
-
return /* @__PURE__ */ React126.createElement(
|
|
11395
|
+
return /* @__PURE__ */ React126.createElement(Alert17, { color: "red", icon: /* @__PURE__ */ React126.createElement(IconAlertCircle5, { size: 16 }), py: "xs" }, /* @__PURE__ */ React126.createElement(Text68, { size: "xs" }, error));
|
|
11310
11396
|
}
|
|
11311
11397
|
if (!bids || bids.length === 0) {
|
|
11312
|
-
return /* @__PURE__ */ React126.createElement(
|
|
11398
|
+
return /* @__PURE__ */ React126.createElement(Text68, { size: "xs", c: "dimmed", ta: "center", py: "sm" }, "No bids submitted yet");
|
|
11313
11399
|
}
|
|
11314
|
-
return /* @__PURE__ */ React126.createElement(
|
|
11400
|
+
return /* @__PURE__ */ React126.createElement(Stack93, { gap: "xs", pl: "md" }, bids.map((bid) => /* @__PURE__ */ React126.createElement(BidItem, { key: bid.id, bid, deedId, adminAddress, onRefresh: handleRefresh })));
|
|
11315
11401
|
};
|
|
11316
11402
|
|
|
11317
11403
|
// src/mantine/blocks/bid/flow/ClaimCollectionsList.tsx
|
|
11318
11404
|
var CollectionItem2 = ({ collection, deedId, adminAddress, userRole, onRefresh }) => {
|
|
11319
|
-
const [isExpanded, setIsExpanded] =
|
|
11405
|
+
const [isExpanded, setIsExpanded] = useState40(false);
|
|
11320
11406
|
const getCollectionName = (collection2) => {
|
|
11321
11407
|
return collection2.protocol?.profile?.name || collection2.name || "Unnamed Collection";
|
|
11322
11408
|
};
|
|
@@ -11364,16 +11450,16 @@ var CollectionItem2 = ({ collection, deedId, adminAddress, userRole, onRefresh }
|
|
|
11364
11450
|
} else if (userRole === "SA" /* ServiceProvider */ || userRole === "EA" /* Evaluator */) {
|
|
11365
11451
|
return getRoleBadge(userRole);
|
|
11366
11452
|
} else {
|
|
11367
|
-
return /* @__PURE__ */ React127.createElement(Menu2, { shadow: "md", width: 200 }, /* @__PURE__ */ React127.createElement(Menu2.Target, null, /* @__PURE__ */ React127.createElement(Button31, { size: "xs", variant: "light", rightSection: /* @__PURE__ */ React127.createElement(
|
|
11453
|
+
return /* @__PURE__ */ React127.createElement(Menu2, { shadow: "md", width: 200 }, /* @__PURE__ */ React127.createElement(Menu2.Target, null, /* @__PURE__ */ React127.createElement(Button31, { size: "xs", variant: "light", rightSection: /* @__PURE__ */ React127.createElement(IconChevronDown5, { size: 14 }) }, "Apply")), /* @__PURE__ */ React127.createElement(Menu2.Dropdown, null, /* @__PURE__ */ React127.createElement(Menu2.Label, null, "Select Role"), /* @__PURE__ */ React127.createElement(Menu2.Item, { onClick: openServiceAgent }, "Service Agent"), /* @__PURE__ */ React127.createElement(Menu2.Item, { onClick: openEvaluationAgent }, "Evaluation Agent")));
|
|
11368
11454
|
}
|
|
11369
11455
|
};
|
|
11370
|
-
return /* @__PURE__ */ React127.createElement(
|
|
11456
|
+
return /* @__PURE__ */ React127.createElement(Stack94, { gap: "xs" }, /* @__PURE__ */ React127.createElement(ListItemContainer, null, /* @__PURE__ */ React127.createElement(Stack94, { gap: 4, style: { flex: 1 } }, /* @__PURE__ */ React127.createElement(Text69, { size: "sm", fw: 500 }, getCollectionName(collection)), collection.description && /* @__PURE__ */ React127.createElement(Text69, { size: "xs", c: "dimmed" }, collection.description)), renderActionButton()), userRole === "PO" /* Owner */ && /* @__PURE__ */ React127.createElement(Collapse5, { in: isExpanded }, /* @__PURE__ */ React127.createElement(BidsList, { collectionId: collection.id, deedId, adminAddress, onRefresh })));
|
|
11371
11457
|
};
|
|
11372
11458
|
var ClaimCollectionsList2 = ({ collections, deedId, adminAddress, userAddress, onRefresh }) => {
|
|
11373
11459
|
const handlers = useBlocknoteHandlers();
|
|
11374
|
-
const [userRoles, setUserRoles] =
|
|
11375
|
-
const [loadingRoles, setLoadingRoles] =
|
|
11376
|
-
|
|
11460
|
+
const [userRoles, setUserRoles] = useState40({});
|
|
11461
|
+
const [loadingRoles, setLoadingRoles] = useState40(true);
|
|
11462
|
+
useEffect29(() => {
|
|
11377
11463
|
const fetchUserRoles = async () => {
|
|
11378
11464
|
if (!collections || collections.length === 0 || !userAddress || !adminAddress) {
|
|
11379
11465
|
setLoadingRoles(false);
|
|
@@ -11408,12 +11494,12 @@ var ClaimCollectionsList2 = ({ collections, deedId, adminAddress, userAddress, o
|
|
|
11408
11494
|
fetchUserRoles();
|
|
11409
11495
|
}, [collections, userAddress, adminAddress, handlers, deedId]);
|
|
11410
11496
|
if (!collections || collections.length === 0) {
|
|
11411
|
-
return /* @__PURE__ */ React127.createElement(
|
|
11497
|
+
return /* @__PURE__ */ React127.createElement(Text69, { size: "sm", c: "dimmed", ta: "center", py: "md" }, "No claim collections found");
|
|
11412
11498
|
}
|
|
11413
11499
|
if (loadingRoles) {
|
|
11414
|
-
return /* @__PURE__ */ React127.createElement(Center7, { py: "md" }, /* @__PURE__ */ React127.createElement(
|
|
11500
|
+
return /* @__PURE__ */ React127.createElement(Center7, { py: "md" }, /* @__PURE__ */ React127.createElement(Loader15, { size: "sm" }));
|
|
11415
11501
|
}
|
|
11416
|
-
return /* @__PURE__ */ React127.createElement(
|
|
11502
|
+
return /* @__PURE__ */ React127.createElement(Stack94, { gap: "md", px: 5 }, collections.map((collection) => /* @__PURE__ */ React127.createElement(CollectionItem2, { key: collection.id, collection, deedId, adminAddress, userRole: userRoles[collection.id] || null, onRefresh })));
|
|
11417
11503
|
};
|
|
11418
11504
|
|
|
11419
11505
|
// src/mantine/blocks/bid/flow/FlowView.tsx
|
|
@@ -11421,10 +11507,10 @@ var BID_FLOW_PANEL_ID = "bid-flow-panel";
|
|
|
11421
11507
|
var BidFlowView = ({ editor, block }) => {
|
|
11422
11508
|
const { editable } = useBlocknoteContext();
|
|
11423
11509
|
const handlers = useBlocknoteHandlers();
|
|
11424
|
-
const [collections, setCollections] =
|
|
11425
|
-
const [loading, setLoading] =
|
|
11426
|
-
const [error, setError] =
|
|
11427
|
-
const [userAddress, setUserAddress] =
|
|
11510
|
+
const [collections, setCollections] = useState41([]);
|
|
11511
|
+
const [loading, setLoading] = useState41(false);
|
|
11512
|
+
const [error, setError] = useState41(null);
|
|
11513
|
+
const [userAddress, setUserAddress] = useState41("");
|
|
11428
11514
|
const panelId = `${BID_FLOW_PANEL_ID}-${block.id}`;
|
|
11429
11515
|
const panelContent = useMemo30(() => /* @__PURE__ */ React128.createElement(TemplateConfig7, { editor, block }), [editor, block]);
|
|
11430
11516
|
const { open } = usePanel(panelId, panelContent);
|
|
@@ -11437,7 +11523,7 @@ var BidFlowView = ({ editor, block }) => {
|
|
|
11437
11523
|
}, [block.props.selectedCollections]);
|
|
11438
11524
|
const did = block.props.did;
|
|
11439
11525
|
const adminAddress = block.props.adminAddress || "";
|
|
11440
|
-
|
|
11526
|
+
useEffect30(() => {
|
|
11441
11527
|
const fetchUserAddress = () => {
|
|
11442
11528
|
try {
|
|
11443
11529
|
const user = handlers.getCurrentUser();
|
|
@@ -11476,16 +11562,16 @@ var BidFlowView = ({ editor, block }) => {
|
|
|
11476
11562
|
setLoading(false);
|
|
11477
11563
|
}
|
|
11478
11564
|
}, [did, selectedCollectionIds, handlers, editor, block]);
|
|
11479
|
-
|
|
11565
|
+
useEffect30(() => {
|
|
11480
11566
|
fetchCollections();
|
|
11481
11567
|
}, [fetchCollections]);
|
|
11482
11568
|
if (!did) {
|
|
11483
|
-
return /* @__PURE__ */ React128.createElement(Center8, { py: "xl" }, /* @__PURE__ */ React128.createElement(
|
|
11569
|
+
return /* @__PURE__ */ React128.createElement(Center8, { py: "xl" }, /* @__PURE__ */ React128.createElement(Text70, { size: "sm", c: "dimmed" }, "Please configure the bid block in template mode first"));
|
|
11484
11570
|
}
|
|
11485
11571
|
if (selectedCollectionIds.length === 0) {
|
|
11486
|
-
return /* @__PURE__ */ React128.createElement(Center8, { py: "xl" }, /* @__PURE__ */ React128.createElement(
|
|
11572
|
+
return /* @__PURE__ */ React128.createElement(Center8, { py: "xl" }, /* @__PURE__ */ React128.createElement(Text70, { size: "sm", c: "dimmed" }, "No claim collections selected"));
|
|
11487
11573
|
}
|
|
11488
|
-
return /* @__PURE__ */ React128.createElement(
|
|
11574
|
+
return /* @__PURE__ */ React128.createElement(Stack95, { w: "100%" }, /* @__PURE__ */ React128.createElement(Flex23, { px: 5, align: "center", justify: "space-between" }, /* @__PURE__ */ React128.createElement(Title15, { order: 4 }, "Bid Application"), /* @__PURE__ */ React128.createElement(Flex23, { gap: "xs" }, /* @__PURE__ */ React128.createElement(ActionIcon27, { variant: "subtle", size: "sm", onClick: fetchCollections, loading }, /* @__PURE__ */ React128.createElement(IconRefresh3, { size: 18 })), editable && /* @__PURE__ */ React128.createElement(ActionIcon27, { variant: "subtle", size: "sm", onClick: open }, /* @__PURE__ */ React128.createElement(IconSettings4, { size: 18 })))), loading ? /* @__PURE__ */ React128.createElement(Center8, { py: "xl" }, /* @__PURE__ */ React128.createElement(Loader16, { size: "md" })) : error ? /* @__PURE__ */ React128.createElement(Alert18, { color: "red", title: "Failed to load collections", icon: /* @__PURE__ */ React128.createElement(IconAlertCircle6, { size: 18 }) }, /* @__PURE__ */ React128.createElement(Text70, { size: "sm" }, error)) : /* @__PURE__ */ React128.createElement(ClaimCollectionsList2, { collections, deedId: did, adminAddress, userAddress, onRefresh: fetchCollections }));
|
|
11489
11575
|
};
|
|
11490
11576
|
|
|
11491
11577
|
// src/mantine/blocks/bid/BidBlock.tsx
|
|
@@ -11523,15 +11609,15 @@ import React137 from "react";
|
|
|
11523
11609
|
|
|
11524
11610
|
// src/mantine/blocks/evaluator/template/TemplateView.tsx
|
|
11525
11611
|
import React133, { useMemo as useMemo32 } from "react";
|
|
11526
|
-
import { Card as Card26, Group as
|
|
11612
|
+
import { Card as Card26, Group as Group43, Stack as Stack97, Text as Text72, ActionIcon as ActionIcon28, Badge as Badge21 } from "@mantine/core";
|
|
11527
11613
|
|
|
11528
11614
|
// src/mantine/blocks/evaluator/template/TemplateConfig.tsx
|
|
11529
11615
|
import React132, { useCallback as useCallback30 } from "react";
|
|
11530
11616
|
import { Paper as Paper17, CloseButton as CloseButton13, Title as Title16 } from "@mantine/core";
|
|
11531
11617
|
|
|
11532
11618
|
// src/mantine/blocks/evaluator/template/GeneralTab.tsx
|
|
11533
|
-
import React131, { useEffect as
|
|
11534
|
-
import { Stack as
|
|
11619
|
+
import React131, { useEffect as useEffect31, useState as useState42, useCallback as useCallback29, useMemo as useMemo31 } from "react";
|
|
11620
|
+
import { Stack as Stack96, Text as Text71, TextInput as TextInput41, Textarea as Textarea25 } from "@mantine/core";
|
|
11535
11621
|
var GeneralTab8 = ({
|
|
11536
11622
|
title,
|
|
11537
11623
|
description,
|
|
@@ -11544,12 +11630,12 @@ var GeneralTab8 = ({
|
|
|
11544
11630
|
onSelectedCollectionsChange,
|
|
11545
11631
|
onAdminAddressChange
|
|
11546
11632
|
}) => {
|
|
11547
|
-
const [localTitle, setLocalTitle] =
|
|
11548
|
-
const [localDescription, setLocalDescription] =
|
|
11549
|
-
|
|
11633
|
+
const [localTitle, setLocalTitle] = useState42(title || "");
|
|
11634
|
+
const [localDescription, setLocalDescription] = useState42(description || "");
|
|
11635
|
+
useEffect31(() => {
|
|
11550
11636
|
setLocalTitle(title || "");
|
|
11551
11637
|
}, [title]);
|
|
11552
|
-
|
|
11638
|
+
useEffect31(() => {
|
|
11553
11639
|
setLocalDescription(description || "");
|
|
11554
11640
|
}, [description]);
|
|
11555
11641
|
const parsedSelectedCollections = useMemo31(() => {
|
|
@@ -11576,7 +11662,7 @@ var GeneralTab8 = ({
|
|
|
11576
11662
|
},
|
|
11577
11663
|
[onAdminAddressChange]
|
|
11578
11664
|
);
|
|
11579
|
-
return /* @__PURE__ */ React131.createElement(
|
|
11665
|
+
return /* @__PURE__ */ React131.createElement(Stack96, { gap: "lg" }, /* @__PURE__ */ React131.createElement(Stack96, { gap: "xs" }, /* @__PURE__ */ React131.createElement(Text71, { size: "sm", fw: 600 }, "Title"), /* @__PURE__ */ React131.createElement(
|
|
11580
11666
|
TextInput41,
|
|
11581
11667
|
{
|
|
11582
11668
|
placeholder: "e.g. Evaluator Title",
|
|
@@ -11587,7 +11673,7 @@ var GeneralTab8 = ({
|
|
|
11587
11673
|
onTitleChange(newTitle);
|
|
11588
11674
|
}
|
|
11589
11675
|
}
|
|
11590
|
-
)), /* @__PURE__ */ React131.createElement(
|
|
11676
|
+
)), /* @__PURE__ */ React131.createElement(Stack96, { gap: "xs" }, /* @__PURE__ */ React131.createElement(Text71, { size: "sm", fw: 600 }, "Description"), /* @__PURE__ */ React131.createElement(
|
|
11591
11677
|
Textarea25,
|
|
11592
11678
|
{
|
|
11593
11679
|
placeholder: "Describe what this evaluator block is about",
|
|
@@ -11687,21 +11773,21 @@ var EvaluatorTemplateView = ({ editor, block }) => {
|
|
|
11687
11773
|
const panelId = `${EVALUATOR_TEMPLATE_PANEL_ID}-${block.id}`;
|
|
11688
11774
|
const panelContent = useMemo32(() => /* @__PURE__ */ React133.createElement(TemplateConfig8, { editor, block }), [editor, block]);
|
|
11689
11775
|
const { open } = usePanel(panelId, panelContent);
|
|
11690
|
-
return /* @__PURE__ */ React133.createElement(Card26, { withBorder: true, padding: "md", radius: "md", style: { width: "100%", cursor: "pointer", position: "relative" }, onClick: open }, /* @__PURE__ */ React133.createElement(Badge21, { size: "xs", variant: "light", color: "gray", style: { position: "absolute", top: 8, right: 8 } }, "Template"), /* @__PURE__ */ React133.createElement(
|
|
11776
|
+
return /* @__PURE__ */ React133.createElement(Card26, { withBorder: true, padding: "md", radius: "md", style: { width: "100%", cursor: "pointer", position: "relative" }, onClick: open }, /* @__PURE__ */ React133.createElement(Badge21, { size: "xs", variant: "light", color: "gray", style: { position: "absolute", top: 8, right: 8 } }, "Template"), /* @__PURE__ */ React133.createElement(Group43, { wrap: "nowrap", justify: "space-between", align: "center" }, /* @__PURE__ */ React133.createElement(Group43, { wrap: "nowrap", align: "center" }, /* @__PURE__ */ React133.createElement(ActionIcon28, { variant: "light", color: "blue", size: "lg", radius: "xl", style: { flexShrink: 0 } }, getIcon(block.props.icon, 18, 1.5, "checklist")), /* @__PURE__ */ React133.createElement(Stack97, { gap: "xs", style: { flex: 1 } }, /* @__PURE__ */ React133.createElement(Text72, { fw: 500, size: "sm", contentEditable: false }, block.props.title || "Evaluator Title"), /* @__PURE__ */ React133.createElement(Text72, { size: "xs", c: "dimmed", contentEditable: false }, block.props.description || "Evaluator description")))));
|
|
11691
11777
|
};
|
|
11692
11778
|
|
|
11693
11779
|
// src/mantine/blocks/evaluator/flow/FlowView.tsx
|
|
11694
|
-
import React136, { useState as
|
|
11695
|
-
import { Stack as
|
|
11780
|
+
import React136, { useState as useState45, useEffect as useEffect34, useMemo as useMemo35, useCallback as useCallback32 } from "react";
|
|
11781
|
+
import { Stack as Stack100, Text as Text75, Loader as Loader19, Center as Center10, Alert as Alert20, Title as Title18, Flex as Flex24, ActionIcon as ActionIcon31 } from "@mantine/core";
|
|
11696
11782
|
import { IconSettings as IconSettings5, IconRefresh as IconRefresh5, IconAlertCircle as IconAlertCircle8 } from "@tabler/icons-react";
|
|
11697
11783
|
|
|
11698
11784
|
// src/mantine/blocks/evaluator/flow/ClaimCollectionsList.tsx
|
|
11699
|
-
import React135, { useMemo as useMemo34, useState as
|
|
11700
|
-
import { Stack as
|
|
11785
|
+
import React135, { useMemo as useMemo34, useState as useState44, useEffect as useEffect33 } from "react";
|
|
11786
|
+
import { Stack as Stack99, Text as Text74, ActionIcon as ActionIcon30, Tooltip as Tooltip9, Loader as Loader18, Center as Center9 } from "@mantine/core";
|
|
11701
11787
|
|
|
11702
11788
|
// src/mantine/blocks/evaluator/flow/ClaimsList.tsx
|
|
11703
|
-
import React134, { useState as
|
|
11704
|
-
import { Paper as Paper18, CloseButton as CloseButton14, Title as Title17, Loader as
|
|
11789
|
+
import React134, { useState as useState43, useEffect as useEffect32, useCallback as useCallback31, useMemo as useMemo33 } from "react";
|
|
11790
|
+
import { Paper as Paper18, CloseButton as CloseButton14, Title as Title17, Loader as Loader17, Stack as Stack98, Text as Text73, ActionIcon as ActionIcon29, Alert as Alert19, Badge as Badge22, Group as Group44, Button as Button32, Divider as Divider7 } from "@mantine/core";
|
|
11705
11791
|
import { IconAlertCircle as IconAlertCircle7, IconArrowRight as IconArrowRight4, IconRefresh as IconRefresh4, IconArrowLeft as IconArrowLeft3 } from "@tabler/icons-react";
|
|
11706
11792
|
import { Survey as Survey4, SurveyModel as SurveyModel4 } from "@ixo/surveys";
|
|
11707
11793
|
|
|
@@ -11873,16 +11959,16 @@ var SURVEY_THEME_FOREGROUND3 = SURVEY_THEME_VARIABLES3["--sjs-general-forecolor"
|
|
|
11873
11959
|
var ClaimsList = ({ collectionId, collectionName, deedId, adminAddress, onEvaluationComplete }) => {
|
|
11874
11960
|
const { closePanel } = usePanelStore();
|
|
11875
11961
|
const handlers = useBlocknoteHandlers();
|
|
11876
|
-
const [viewMode, setViewMode] =
|
|
11877
|
-
const [claims, setClaims] =
|
|
11878
|
-
const [loading, setLoading] =
|
|
11879
|
-
const [error, setError] =
|
|
11880
|
-
const [selectedClaim, setSelectedClaim] =
|
|
11881
|
-
const [claimData, setClaimData] =
|
|
11882
|
-
const [surveyJson, setSurveyJson] =
|
|
11883
|
-
const [surveyLoading, setSurveyLoading] =
|
|
11884
|
-
const [surveyError, setSurveyError] =
|
|
11885
|
-
const [evaluating, setEvaluating] =
|
|
11962
|
+
const [viewMode, setViewMode] = useState43("list");
|
|
11963
|
+
const [claims, setClaims] = useState43([]);
|
|
11964
|
+
const [loading, setLoading] = useState43(true);
|
|
11965
|
+
const [error, setError] = useState43(null);
|
|
11966
|
+
const [selectedClaim, setSelectedClaim] = useState43(null);
|
|
11967
|
+
const [claimData, setClaimData] = useState43(null);
|
|
11968
|
+
const [surveyJson, setSurveyJson] = useState43(null);
|
|
11969
|
+
const [surveyLoading, setSurveyLoading] = useState43(false);
|
|
11970
|
+
const [surveyError, setSurveyError] = useState43(null);
|
|
11971
|
+
const [evaluating, setEvaluating] = useState43(false);
|
|
11886
11972
|
const fetchClaims = useCallback31(async () => {
|
|
11887
11973
|
try {
|
|
11888
11974
|
setLoading(true);
|
|
@@ -11899,7 +11985,7 @@ var ClaimsList = ({ collectionId, collectionName, deedId, adminAddress, onEvalua
|
|
|
11899
11985
|
setLoading(false);
|
|
11900
11986
|
}
|
|
11901
11987
|
}, [collectionId, handlers]);
|
|
11902
|
-
|
|
11988
|
+
useEffect32(() => {
|
|
11903
11989
|
fetchClaims();
|
|
11904
11990
|
}, [fetchClaims]);
|
|
11905
11991
|
const fetchClaimAndSurvey = useCallback31(
|
|
@@ -12032,7 +12118,7 @@ var ClaimsList = ({ collectionId, collectionName, deedId, adminAddress, onEvalua
|
|
|
12032
12118
|
}
|
|
12033
12119
|
},
|
|
12034
12120
|
/* @__PURE__ */ React134.createElement("div", { style: { display: "flex", alignItems: "center", gap: "0.5rem" } }, viewMode === "survey" && /* @__PURE__ */ React134.createElement(ActionIcon29, { variant: "subtle", onClick: handleBackToList }, /* @__PURE__ */ React134.createElement(IconArrowLeft3, { size: 20 })), /* @__PURE__ */ React134.createElement(Title17, { order: 3 }, viewMode === "list" ? `${collectionName} - Claims` : `Evaluate Claim #${selectedClaim?.claimId.slice(-8)}`), viewMode === "list" && !loading && claims.length > 0 && /* @__PURE__ */ React134.createElement(Badge22, { size: "lg", variant: "light" }, claims.length)),
|
|
12035
|
-
/* @__PURE__ */ React134.createElement(
|
|
12121
|
+
/* @__PURE__ */ React134.createElement(Group44, { gap: "xs" }, viewMode === "list" && /* @__PURE__ */ React134.createElement(ActionIcon29, { variant: "subtle", onClick: fetchClaims, loading, title: "Refresh claims" }, /* @__PURE__ */ React134.createElement(IconRefresh4, { size: 18 })), /* @__PURE__ */ React134.createElement(CloseButton14, { onClick: closePanel }))
|
|
12036
12122
|
),
|
|
12037
12123
|
/* @__PURE__ */ React134.createElement(
|
|
12038
12124
|
"div",
|
|
@@ -12061,7 +12147,7 @@ var ClaimsList = ({ collectionId, collectionName, deedId, adminAddress, onEvalua
|
|
|
12061
12147
|
pointerEvents: viewMode === "list" ? "auto" : "none"
|
|
12062
12148
|
}
|
|
12063
12149
|
},
|
|
12064
|
-
/* @__PURE__ */ React134.createElement(
|
|
12150
|
+
/* @__PURE__ */ React134.createElement(Stack98, { gap: "md", style: { flex: 1 } }, loading ? /* @__PURE__ */ React134.createElement(Stack98, { align: "center", justify: "center", style: { flex: 1 } }, /* @__PURE__ */ React134.createElement(Loader17, { size: "lg" }), /* @__PURE__ */ React134.createElement(Text73, { size: "sm", c: "dimmed" }, "Loading claims...")) : error ? /* @__PURE__ */ React134.createElement(Alert19, { color: "red", title: "Failed to load claims", icon: /* @__PURE__ */ React134.createElement(IconAlertCircle7, { size: 18 }) }, /* @__PURE__ */ React134.createElement(Text73, { size: "sm" }, error)) : claims.length === 0 ? /* @__PURE__ */ React134.createElement(Stack98, { align: "center", justify: "center", style: { flex: 1 } }, /* @__PURE__ */ React134.createElement(Text73, { size: "sm", c: "dimmed", ta: "center" }, "No claims found for this collection.")) : /* @__PURE__ */ React134.createElement(Stack98, { gap: "xs" }, claims.map((claim) => /* @__PURE__ */ React134.createElement(ClaimListItem, { key: claim.claimId, claim, onViewClaim: () => handleViewClaim(claim) }))))
|
|
12065
12151
|
),
|
|
12066
12152
|
/* @__PURE__ */ React134.createElement(
|
|
12067
12153
|
"div",
|
|
@@ -12081,16 +12167,16 @@ var ClaimsList = ({ collectionId, collectionName, deedId, adminAddress, onEvalua
|
|
|
12081
12167
|
pointerEvents: viewMode === "survey" ? "auto" : "none"
|
|
12082
12168
|
}
|
|
12083
12169
|
},
|
|
12084
|
-
surveyLoading ? /* @__PURE__ */ React134.createElement(
|
|
12170
|
+
surveyLoading ? /* @__PURE__ */ React134.createElement(Stack98, { align: "center", justify: "center", style: { flex: 1 } }, /* @__PURE__ */ React134.createElement(Loader17, { size: "lg" }), /* @__PURE__ */ React134.createElement(Text73, { size: "sm", c: "dimmed" }, "Loading claim data...")) : surveyError ? /* @__PURE__ */ React134.createElement(Stack98, { style: { flex: 1 } }, /* @__PURE__ */ React134.createElement(Alert19, { color: "red", title: "Failed to load claim data", icon: /* @__PURE__ */ React134.createElement(IconAlertCircle7, { size: 18 }) }, /* @__PURE__ */ React134.createElement(Text73, { size: "sm" }, surveyError))) : /* @__PURE__ */ React134.createElement(React134.Fragment, null, /* @__PURE__ */ React134.createElement("div", { style: surveyContainerStyle }, surveyModel && /* @__PURE__ */ React134.createElement(Survey4, { model: surveyModel })), /* @__PURE__ */ React134.createElement(Divider7, { my: "md" }), /* @__PURE__ */ React134.createElement(Stack98, { gap: "sm" }, /* @__PURE__ */ React134.createElement(Button32, { color: "green", onClick: handleApprove, loading: evaluating, disabled: evaluating }, "Approve Claim"), /* @__PURE__ */ React134.createElement(Button32, { color: "red", variant: "outline", onClick: handleReject, loading: evaluating, disabled: evaluating }, "Reject Claim")))
|
|
12085
12171
|
)
|
|
12086
12172
|
)
|
|
12087
12173
|
);
|
|
12088
12174
|
};
|
|
12089
12175
|
var ClaimListItem = ({ claim, onViewClaim }) => {
|
|
12090
12176
|
const handlers = useBlocknoteHandlers();
|
|
12091
|
-
const [userProfile, setUserProfile] =
|
|
12092
|
-
const [loadingProfile, setLoadingProfile] =
|
|
12093
|
-
|
|
12177
|
+
const [userProfile, setUserProfile] = useState43(null);
|
|
12178
|
+
const [loadingProfile, setLoadingProfile] = useState43(false);
|
|
12179
|
+
useEffect32(() => {
|
|
12094
12180
|
const fetchUserProfile = async () => {
|
|
12095
12181
|
if (!claim.agentDid) return;
|
|
12096
12182
|
try {
|
|
@@ -12157,7 +12243,7 @@ var ClaimListItem = ({ claim, onViewClaim }) => {
|
|
|
12157
12243
|
tabIndex: 0,
|
|
12158
12244
|
style: { cursor: "pointer" }
|
|
12159
12245
|
},
|
|
12160
|
-
/* @__PURE__ */ React134.createElement(ListItemContainer, null, /* @__PURE__ */ React134.createElement(
|
|
12246
|
+
/* @__PURE__ */ React134.createElement(ListItemContainer, null, /* @__PURE__ */ React134.createElement(Stack98, { gap: 4, style: { flex: 1 } }, /* @__PURE__ */ React134.createElement(Text73, { size: "sm", fw: 500 }, "Claim #", claim.claimId.slice(-8)), /* @__PURE__ */ React134.createElement(Text73, { size: "xs", c: "dimmed" }, "Submitted: ", formatDate(claim.submissionDate || claim.submittedAt)), claim.agentDid && /* @__PURE__ */ React134.createElement(Group44, { gap: 4 }, /* @__PURE__ */ React134.createElement(Text73, { size: "xs", c: "dimmed" }, "Agent: ", loadingProfile ? "Loading..." : displayName), userProfile?.verified && /* @__PURE__ */ React134.createElement(Text73, { size: "xs", c: "blue", fw: 600, title: "Verified user" }, "\u2713"))), /* @__PURE__ */ React134.createElement(Stack98, { gap: 4, align: "flex-end" }, /* @__PURE__ */ React134.createElement(Badge22, { color: claimStatus.color, size: "sm" }, claimStatus.status), /* @__PURE__ */ React134.createElement(ActionIcon29, { variant: "subtle", size: "sm" }, /* @__PURE__ */ React134.createElement(IconArrowRight4, { size: 16 }))))
|
|
12161
12247
|
);
|
|
12162
12248
|
};
|
|
12163
12249
|
|
|
@@ -12193,13 +12279,13 @@ var CollectionItem3 = ({ collection, deedId, adminAddress, userRole, onRefresh }
|
|
|
12193
12279
|
openClaimsPanel();
|
|
12194
12280
|
}
|
|
12195
12281
|
};
|
|
12196
|
-
return /* @__PURE__ */ React135.createElement("div", { style: { opacity: canEvaluateClaims ? 1 : 0.5 } }, /* @__PURE__ */ React135.createElement(ListItemContainer, null, /* @__PURE__ */ React135.createElement(
|
|
12282
|
+
return /* @__PURE__ */ React135.createElement("div", { style: { opacity: canEvaluateClaims ? 1 : 0.5 } }, /* @__PURE__ */ React135.createElement(ListItemContainer, null, /* @__PURE__ */ React135.createElement(Stack99, { gap: 4, style: { flex: 1 } }, /* @__PURE__ */ React135.createElement(Text74, { size: "sm", fw: 500, c: canEvaluateClaims ? void 0 : "dimmed" }, getCollectionName(collection)), collection.description && /* @__PURE__ */ React135.createElement(Text74, { size: "xs", c: "dimmed" }, collection.description)), /* @__PURE__ */ React135.createElement(Tooltip9, { label: "You need to be an evaluator agent to review claims", disabled: canEvaluateClaims, position: "left", withArrow: true }, /* @__PURE__ */ React135.createElement(ActionIcon30, { variant: "subtle", size: "lg", onClick: handleClick, disabled: !canEvaluateClaims, style: { cursor: canEvaluateClaims ? "pointer" : "not-allowed" } }, /* @__PURE__ */ React135.createElement(IconArrowRight5, { size: 20 })))));
|
|
12197
12283
|
};
|
|
12198
12284
|
var ClaimCollectionsList3 = ({ collections, deedId, adminAddress, userAddress, onRefresh }) => {
|
|
12199
12285
|
const handlers = useBlocknoteHandlers();
|
|
12200
|
-
const [userRoles, setUserRoles] =
|
|
12201
|
-
const [loadingRoles, setLoadingRoles] =
|
|
12202
|
-
|
|
12286
|
+
const [userRoles, setUserRoles] = useState44({});
|
|
12287
|
+
const [loadingRoles, setLoadingRoles] = useState44(true);
|
|
12288
|
+
useEffect33(() => {
|
|
12203
12289
|
const fetchUserRoles = async () => {
|
|
12204
12290
|
if (!collections || collections.length === 0 || !userAddress || !adminAddress) {
|
|
12205
12291
|
setLoadingRoles(false);
|
|
@@ -12234,12 +12320,12 @@ var ClaimCollectionsList3 = ({ collections, deedId, adminAddress, userAddress, o
|
|
|
12234
12320
|
fetchUserRoles();
|
|
12235
12321
|
}, [collections, userAddress, adminAddress, handlers, deedId]);
|
|
12236
12322
|
if (!collections || collections.length === 0) {
|
|
12237
|
-
return /* @__PURE__ */ React135.createElement(
|
|
12323
|
+
return /* @__PURE__ */ React135.createElement(Text74, { size: "sm", c: "dimmed", ta: "center", py: "md" }, "No claim collections found");
|
|
12238
12324
|
}
|
|
12239
12325
|
if (loadingRoles) {
|
|
12240
|
-
return /* @__PURE__ */ React135.createElement(Center9, { py: "md" }, /* @__PURE__ */ React135.createElement(
|
|
12326
|
+
return /* @__PURE__ */ React135.createElement(Center9, { py: "md" }, /* @__PURE__ */ React135.createElement(Loader18, { size: "sm" }));
|
|
12241
12327
|
}
|
|
12242
|
-
return /* @__PURE__ */ React135.createElement(
|
|
12328
|
+
return /* @__PURE__ */ React135.createElement(Stack99, { gap: "md", px: 5 }, collections.map((collection) => /* @__PURE__ */ React135.createElement(CollectionItem3, { key: collection.id, collection, deedId, adminAddress, userRole: userRoles[collection.id] || null, onRefresh })));
|
|
12243
12329
|
};
|
|
12244
12330
|
|
|
12245
12331
|
// src/mantine/blocks/evaluator/flow/FlowView.tsx
|
|
@@ -12247,9 +12333,9 @@ var EvaluatorFlowView = ({ editor, block }) => {
|
|
|
12247
12333
|
const { editable } = useBlocknoteContext();
|
|
12248
12334
|
const handlers = useBlocknoteHandlers();
|
|
12249
12335
|
const currentUser = handlers.getCurrentUser();
|
|
12250
|
-
const [collections, setCollections] =
|
|
12251
|
-
const [loading, setLoading] =
|
|
12252
|
-
const [error, setError] =
|
|
12336
|
+
const [collections, setCollections] = useState45([]);
|
|
12337
|
+
const [loading, setLoading] = useState45(false);
|
|
12338
|
+
const [error, setError] = useState45(null);
|
|
12253
12339
|
const selectedCollectionIds = useMemo35(() => {
|
|
12254
12340
|
try {
|
|
12255
12341
|
return JSON.parse(block.props.selectedCollections || "[]");
|
|
@@ -12286,16 +12372,16 @@ var EvaluatorFlowView = ({ editor, block }) => {
|
|
|
12286
12372
|
setLoading(false);
|
|
12287
12373
|
}
|
|
12288
12374
|
}, [did, selectedCollectionIds, handlers, editor, block]);
|
|
12289
|
-
|
|
12375
|
+
useEffect34(() => {
|
|
12290
12376
|
fetchCollections();
|
|
12291
12377
|
}, [fetchCollections]);
|
|
12292
12378
|
if (!did) {
|
|
12293
|
-
return /* @__PURE__ */ React136.createElement(Center10, { py: "xl" }, /* @__PURE__ */ React136.createElement(
|
|
12379
|
+
return /* @__PURE__ */ React136.createElement(Center10, { py: "xl" }, /* @__PURE__ */ React136.createElement(Text75, { size: "sm", c: "dimmed" }, "Please configure the evaluator block in template mode first"));
|
|
12294
12380
|
}
|
|
12295
12381
|
if (selectedCollectionIds.length === 0) {
|
|
12296
|
-
return /* @__PURE__ */ React136.createElement(Center10, { py: "xl" }, /* @__PURE__ */ React136.createElement(
|
|
12382
|
+
return /* @__PURE__ */ React136.createElement(Center10, { py: "xl" }, /* @__PURE__ */ React136.createElement(Text75, { size: "sm", c: "dimmed" }, "No claim collections selected"));
|
|
12297
12383
|
}
|
|
12298
|
-
return /* @__PURE__ */ React136.createElement(
|
|
12384
|
+
return /* @__PURE__ */ React136.createElement(Stack100, { w: "100%" }, /* @__PURE__ */ React136.createElement(Flex24, { px: 5, align: "center", justify: "space-between" }, /* @__PURE__ */ React136.createElement(Title18, { order: 4 }, "Evaluate Claims"), /* @__PURE__ */ React136.createElement(Flex24, { gap: "xs" }, /* @__PURE__ */ React136.createElement(ActionIcon31, { variant: "subtle", size: "sm", onClick: fetchCollections, loading }, /* @__PURE__ */ React136.createElement(IconRefresh5, { size: 18 })), editable && /* @__PURE__ */ React136.createElement(ActionIcon31, { variant: "subtle", size: "sm" }, /* @__PURE__ */ React136.createElement(IconSettings5, { size: 18 })))), loading ? /* @__PURE__ */ React136.createElement(Center10, { py: "xl" }, /* @__PURE__ */ React136.createElement(Loader19, { size: "md" })) : error ? /* @__PURE__ */ React136.createElement(Alert20, { color: "red", title: "Failed to load collections", icon: /* @__PURE__ */ React136.createElement(IconAlertCircle8, { size: 18 }) }, /* @__PURE__ */ React136.createElement(Text75, { size: "sm" }, error)) : /* @__PURE__ */ React136.createElement(ClaimCollectionsList3, { collections, deedId: did, adminAddress, userAddress: currentUser.address, onRefresh: fetchCollections }));
|
|
12299
12385
|
};
|
|
12300
12386
|
|
|
12301
12387
|
// src/mantine/blocks/evaluator/EvaluatorBlock.tsx
|
|
@@ -12333,11 +12419,11 @@ var EvaluatorBlockSpec = createReactBlockSpec10(
|
|
|
12333
12419
|
|
|
12334
12420
|
// src/mantine/blocks/list/ui/ListBlocksToolbar.tsx
|
|
12335
12421
|
import React139 from "react";
|
|
12336
|
-
import { ActionIcon as ActionIcon32, Group as
|
|
12337
|
-
import { IconChevronUp as IconChevronUp4, IconChevronDown as
|
|
12422
|
+
import { ActionIcon as ActionIcon32, Group as Group45, Tooltip as Tooltip10 } from "@mantine/core";
|
|
12423
|
+
import { IconChevronUp as IconChevronUp4, IconChevronDown as IconChevronDown6 } from "@tabler/icons-react";
|
|
12338
12424
|
var ListBlocksToolbar = () => {
|
|
12339
12425
|
const { broadcastCollapse } = useListBlocksUI();
|
|
12340
|
-
return /* @__PURE__ */ React139.createElement(
|
|
12426
|
+
return /* @__PURE__ */ React139.createElement(Group45, { gap: "xs" }, /* @__PURE__ */ React139.createElement(Tooltip10, { label: "Collapse all lists", withArrow: true }, /* @__PURE__ */ React139.createElement(ActionIcon32, { c: "dimmed", variant: "subtle", size: "sm", "aria-label": "Collapse all lists", onClick: () => broadcastCollapse("collapse") }, /* @__PURE__ */ React139.createElement(IconChevronUp4, { size: 18 }))), /* @__PURE__ */ React139.createElement(Tooltip10, { label: "Expand all lists", withArrow: true }, /* @__PURE__ */ React139.createElement(ActionIcon32, { c: "dimmed", variant: "subtle", size: "sm", "aria-label": "Expand all lists", onClick: () => broadcastCollapse("expand") }, /* @__PURE__ */ React139.createElement(IconChevronDown6, { size: 18 }))));
|
|
12341
12427
|
};
|
|
12342
12428
|
|
|
12343
12429
|
// src/mantine/blocks/registry/blockRegistry.ts
|
|
@@ -12493,7 +12579,7 @@ blockRegistry.register({
|
|
|
12493
12579
|
});
|
|
12494
12580
|
|
|
12495
12581
|
// src/mantine/blocks/hooks/useBlockDependencies.ts
|
|
12496
|
-
import { useMemo as useMemo36, useEffect as
|
|
12582
|
+
import { useMemo as useMemo36, useEffect as useEffect35, useState as useState46, useCallback as useCallback33 } from "react";
|
|
12497
12583
|
|
|
12498
12584
|
// src/mantine/blocks/hooks/useDependsOn.ts
|
|
12499
12585
|
import { useMemo as useMemo37 } from "react";
|
|
@@ -12590,9 +12676,7 @@ var getExtraSlashMenuItems = (editor) => {
|
|
|
12590
12676
|
[
|
|
12591
12677
|
{
|
|
12592
12678
|
type: "overview",
|
|
12593
|
-
props: {
|
|
12594
|
-
did: ""
|
|
12595
|
-
}
|
|
12679
|
+
props: {}
|
|
12596
12680
|
}
|
|
12597
12681
|
],
|
|
12598
12682
|
editor.getTextCursorPosition().block,
|
|
@@ -12601,7 +12685,7 @@ var getExtraSlashMenuItems = (editor) => {
|
|
|
12601
12685
|
},
|
|
12602
12686
|
aliases: ["overview", "overview-block", "data-overview"],
|
|
12603
12687
|
group: "Domains",
|
|
12604
|
-
subtext: "Create an overview from
|
|
12688
|
+
subtext: "Create an overview from domain card data"
|
|
12605
12689
|
},
|
|
12606
12690
|
{
|
|
12607
12691
|
title: "Proposal",
|
|
@@ -12827,11 +12911,11 @@ import { useCreateBlockNote as useCreateBlockNote2 } from "@blocknote/react";
|
|
|
12827
12911
|
import { BlockNoteSchema as BlockNoteSchema2, defaultBlockSpecs as defaultBlockSpecs2, defaultInlineContentSpecs as defaultInlineContentSpecs2, defaultStyleSpecs as defaultStyleSpecs2 } from "@blocknote/core";
|
|
12828
12912
|
|
|
12829
12913
|
// src/core/hooks/useMatrixProvider.ts
|
|
12830
|
-
import { useEffect as
|
|
12914
|
+
import { useEffect as useEffect36, useState as useState47, useRef as useRef4, useCallback as useCallback34, useMemo as useMemo38 } from "react";
|
|
12831
12915
|
import { MatrixProvider } from "@ixo/matrix-crdt";
|
|
12832
12916
|
function useMatrixProvider({ matrixClient, roomId, yDoc }) {
|
|
12833
|
-
const [matrixProvider, setProvider] =
|
|
12834
|
-
const [status, setStatus] =
|
|
12917
|
+
const [matrixProvider, setProvider] = useState47(null);
|
|
12918
|
+
const [status, setStatus] = useState47("disconnected");
|
|
12835
12919
|
const isMountedRef = useRef4(true);
|
|
12836
12920
|
const providerRef = useRef4(null);
|
|
12837
12921
|
const retryTimeoutRef = useRef4(null);
|
|
@@ -12897,7 +12981,7 @@ function useMatrixProvider({ matrixClient, roomId, yDoc }) {
|
|
|
12897
12981
|
}
|
|
12898
12982
|
}
|
|
12899
12983
|
}, [matrixClient, providerOptions, handleDocumentAvailable, handleDocumentUnavailable, handleCanWriteChanged]);
|
|
12900
|
-
|
|
12984
|
+
useEffect36(() => {
|
|
12901
12985
|
isMountedRef.current = true;
|
|
12902
12986
|
initProvider();
|
|
12903
12987
|
return () => {
|
|
@@ -12914,7 +12998,7 @@ function useMatrixProvider({ matrixClient, roomId, yDoc }) {
|
|
|
12914
12998
|
setStatus("disconnected");
|
|
12915
12999
|
};
|
|
12916
13000
|
}, [initProvider]);
|
|
12917
|
-
|
|
13001
|
+
useEffect36(() => {
|
|
12918
13002
|
return () => {
|
|
12919
13003
|
isMountedRef.current = false;
|
|
12920
13004
|
};
|
|
@@ -12933,7 +13017,7 @@ function useCollaborativeYDoc(_options) {
|
|
|
12933
13017
|
}
|
|
12934
13018
|
|
|
12935
13019
|
// src/mantine/hooks/useCollaborativeIxoEditor.ts
|
|
12936
|
-
import { useMemo as useMemo40, useEffect as
|
|
13020
|
+
import { useMemo as useMemo40, useEffect as useEffect37 } from "react";
|
|
12937
13021
|
function useCreateCollaborativeIxoEditor(options) {
|
|
12938
13022
|
const yDoc = useCollaborativeYDoc(options);
|
|
12939
13023
|
const {
|
|
@@ -13080,13 +13164,57 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
13080
13164
|
ixoEditor.getFlow = () => {
|
|
13081
13165
|
return flowArray.toArray();
|
|
13082
13166
|
};
|
|
13167
|
+
ixoEditor.setCoverImage = (imageData) => {
|
|
13168
|
+
console.log("[setCoverImage] Called with:", imageData);
|
|
13169
|
+
console.log("[setCoverImage] Permissions:", permissions);
|
|
13170
|
+
if (!permissions.write) {
|
|
13171
|
+
console.warn("[setCoverImage] Cannot set cover image: write permission denied");
|
|
13172
|
+
return;
|
|
13173
|
+
}
|
|
13174
|
+
if (imageData === void 0 || imageData === null) {
|
|
13175
|
+
console.log("[setCoverImage] Removing coverImage from yDoc root...");
|
|
13176
|
+
root.delete("coverImage");
|
|
13177
|
+
console.log("[setCoverImage] Delete complete. Verifying:", root.get("coverImage"));
|
|
13178
|
+
} else {
|
|
13179
|
+
console.log("[setCoverImage] Setting coverImage in yDoc root...");
|
|
13180
|
+
root.set("coverImage", imageData);
|
|
13181
|
+
console.log("[setCoverImage] Set complete. Verifying:", root.get("coverImage"));
|
|
13182
|
+
}
|
|
13183
|
+
};
|
|
13184
|
+
ixoEditor.getCoverImage = () => {
|
|
13185
|
+
const result = root.get("coverImage");
|
|
13186
|
+
console.log("[getCoverImage] Retrieved:", result);
|
|
13187
|
+
return result;
|
|
13188
|
+
};
|
|
13189
|
+
ixoEditor.setLogo = (imageData) => {
|
|
13190
|
+
console.log("[setLogo] Called with:", imageData);
|
|
13191
|
+
console.log("[setLogo] Permissions:", permissions);
|
|
13192
|
+
if (!permissions.write) {
|
|
13193
|
+
console.warn("[setLogo] Cannot set logo: write permission denied");
|
|
13194
|
+
return;
|
|
13195
|
+
}
|
|
13196
|
+
if (imageData === void 0 || imageData === null) {
|
|
13197
|
+
console.log("[setLogo] Removing logo from yDoc root...");
|
|
13198
|
+
root.delete("logo");
|
|
13199
|
+
console.log("[setLogo] Delete complete. Verifying:", root.get("logo"));
|
|
13200
|
+
} else {
|
|
13201
|
+
console.log("[setLogo] Setting logo in yDoc root...");
|
|
13202
|
+
root.set("logo", imageData);
|
|
13203
|
+
console.log("[setLogo] Set complete. Verifying:", root.get("logo"));
|
|
13204
|
+
}
|
|
13205
|
+
};
|
|
13206
|
+
ixoEditor.getLogo = () => {
|
|
13207
|
+
const result = root.get("logo");
|
|
13208
|
+
console.log("[getLogo] Retrieved:", result);
|
|
13209
|
+
return result;
|
|
13210
|
+
};
|
|
13083
13211
|
}
|
|
13084
|
-
|
|
13212
|
+
useEffect37(() => {
|
|
13085
13213
|
if (ixoEditor) {
|
|
13086
13214
|
ixoEditor.isEditable = editable;
|
|
13087
13215
|
}
|
|
13088
13216
|
}, [ixoEditor, editable]);
|
|
13089
|
-
|
|
13217
|
+
useEffect37(() => {
|
|
13090
13218
|
if (connectionStatus !== "connected") {
|
|
13091
13219
|
return;
|
|
13092
13220
|
}
|
|
@@ -13117,16 +13245,268 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
13117
13245
|
};
|
|
13118
13246
|
}
|
|
13119
13247
|
|
|
13248
|
+
// src/mantine/components/CoverImage.tsx
|
|
13249
|
+
import React140, { useState as useState48, useRef as useRef5, useEffect as useEffect38 } from "react";
|
|
13250
|
+
import { Box as Box23, Button as Button33, Group as Group46 } from "@mantine/core";
|
|
13251
|
+
function CoverImage({ coverImageUrl, logoUrl }) {
|
|
13252
|
+
const { editor, handlers, editable } = useBlocknoteContext();
|
|
13253
|
+
const [isHovering, setIsHovering] = useState48(false);
|
|
13254
|
+
const [isRepositioning, setIsRepositioning] = useState48(false);
|
|
13255
|
+
const [coverPosition, setCoverPosition] = useState48(50);
|
|
13256
|
+
const fileInputRef = useRef5(null);
|
|
13257
|
+
const [coverImageData, setCoverImageData] = useState48(editor?.getCoverImage?.());
|
|
13258
|
+
const [logoData, setLogoData] = useState48(editor?.getLogo?.());
|
|
13259
|
+
useEffect38(() => {
|
|
13260
|
+
if (!editor?._yRoot) {
|
|
13261
|
+
console.log("CoverImage: No yRoot available");
|
|
13262
|
+
return;
|
|
13263
|
+
}
|
|
13264
|
+
const root = editor._yRoot;
|
|
13265
|
+
const observer = () => {
|
|
13266
|
+
const cover = root.get("coverImage");
|
|
13267
|
+
const logo = root.get("logo");
|
|
13268
|
+
console.log("CoverImage: Observer triggered", { cover, logo });
|
|
13269
|
+
setCoverImageData(cover);
|
|
13270
|
+
setLogoData(logo);
|
|
13271
|
+
};
|
|
13272
|
+
console.log("CoverImage: Setting up observer, initial values...");
|
|
13273
|
+
observer();
|
|
13274
|
+
root.observe(observer);
|
|
13275
|
+
return () => {
|
|
13276
|
+
console.log("CoverImage: Cleaning up observer");
|
|
13277
|
+
root.unobserve(observer);
|
|
13278
|
+
};
|
|
13279
|
+
}, [editor]);
|
|
13280
|
+
const coverUrl = coverImageData?.url || coverImageUrl;
|
|
13281
|
+
const logoSrc = logoData?.url || logoUrl;
|
|
13282
|
+
const hasCover = !!coverUrl;
|
|
13283
|
+
console.log("CoverImage: Render state", {
|
|
13284
|
+
coverImageData,
|
|
13285
|
+
logoData,
|
|
13286
|
+
coverUrl,
|
|
13287
|
+
logoSrc,
|
|
13288
|
+
hasCover,
|
|
13289
|
+
editable
|
|
13290
|
+
});
|
|
13291
|
+
const handleFileSelect = async (event, type) => {
|
|
13292
|
+
const file = event.target.files?.[0];
|
|
13293
|
+
if (!file || !handlers?.publicFileUpload || !editor) {
|
|
13294
|
+
console.log("CoverImage: Missing dependencies", { file: !!file, handlers: !!handlers?.publicFileUpload, editor: !!editor });
|
|
13295
|
+
return;
|
|
13296
|
+
}
|
|
13297
|
+
try {
|
|
13298
|
+
console.log("CoverImage: Uploading file...", { type, fileName: file.name });
|
|
13299
|
+
const uploadedData = await handlers.publicFileUpload(file);
|
|
13300
|
+
console.log("CoverImage: Upload successful", uploadedData);
|
|
13301
|
+
if (type === "cover") {
|
|
13302
|
+
editor.setCoverImage?.(uploadedData);
|
|
13303
|
+
console.log("CoverImage: setCoverImage called, checking if set...", editor.getCoverImage?.());
|
|
13304
|
+
} else {
|
|
13305
|
+
editor.setLogo?.(uploadedData);
|
|
13306
|
+
console.log("CoverImage: setLogo called, checking if set...", editor.getLogo?.());
|
|
13307
|
+
}
|
|
13308
|
+
} catch (error) {
|
|
13309
|
+
console.error("CoverImage: Failed to upload file:", error);
|
|
13310
|
+
}
|
|
13311
|
+
};
|
|
13312
|
+
const handleAddCover = () => {
|
|
13313
|
+
fileInputRef.current?.click();
|
|
13314
|
+
};
|
|
13315
|
+
const handleChangeCover = () => {
|
|
13316
|
+
fileInputRef.current?.click();
|
|
13317
|
+
};
|
|
13318
|
+
const handleReposition = () => {
|
|
13319
|
+
setIsRepositioning(!isRepositioning);
|
|
13320
|
+
};
|
|
13321
|
+
const handleRemoveCover = () => {
|
|
13322
|
+
if (!editor) return;
|
|
13323
|
+
console.log("CoverImage: Removing cover image...");
|
|
13324
|
+
editor.setCoverImage?.(void 0);
|
|
13325
|
+
};
|
|
13326
|
+
const handleMouseMove = (e) => {
|
|
13327
|
+
if (!isRepositioning) return;
|
|
13328
|
+
const rect = e.currentTarget.getBoundingClientRect();
|
|
13329
|
+
const y = e.clientY - rect.top;
|
|
13330
|
+
const percentage = y / rect.height * 100;
|
|
13331
|
+
setCoverPosition(Math.max(0, Math.min(100, percentage)));
|
|
13332
|
+
};
|
|
13333
|
+
if (!editable && !hasCover) {
|
|
13334
|
+
return null;
|
|
13335
|
+
}
|
|
13336
|
+
if (!hasCover) {
|
|
13337
|
+
return /* @__PURE__ */ React140.createElement(
|
|
13338
|
+
Box23,
|
|
13339
|
+
{
|
|
13340
|
+
style: {
|
|
13341
|
+
position: "relative",
|
|
13342
|
+
width: "100%",
|
|
13343
|
+
height: "60px",
|
|
13344
|
+
backgroundColor: "#1f1f1f"
|
|
13345
|
+
},
|
|
13346
|
+
onMouseEnter: () => editable && setIsHovering(true),
|
|
13347
|
+
onMouseLeave: () => editable && setIsHovering(false)
|
|
13348
|
+
},
|
|
13349
|
+
/* @__PURE__ */ React140.createElement("input", { ref: fileInputRef, type: "file", accept: "image/*", style: { display: "none" }, onChange: (e) => handleFileSelect(e, "cover") }),
|
|
13350
|
+
editable && isHovering && /* @__PURE__ */ React140.createElement(
|
|
13351
|
+
Button33,
|
|
13352
|
+
{
|
|
13353
|
+
variant: "filled",
|
|
13354
|
+
size: "xs",
|
|
13355
|
+
onClick: handleAddCover,
|
|
13356
|
+
style: {
|
|
13357
|
+
position: "absolute",
|
|
13358
|
+
top: "0",
|
|
13359
|
+
right: "60px",
|
|
13360
|
+
zIndex: 10,
|
|
13361
|
+
backgroundColor: "rgba(255, 255, 255, 0.9)",
|
|
13362
|
+
color: "#37352f",
|
|
13363
|
+
fontSize: "12px",
|
|
13364
|
+
fontWeight: 500,
|
|
13365
|
+
padding: "4px 8px",
|
|
13366
|
+
height: "auto"
|
|
13367
|
+
}
|
|
13368
|
+
},
|
|
13369
|
+
"Add cover"
|
|
13370
|
+
)
|
|
13371
|
+
);
|
|
13372
|
+
}
|
|
13373
|
+
return /* @__PURE__ */ React140.createElement(
|
|
13374
|
+
Box23,
|
|
13375
|
+
{
|
|
13376
|
+
style: {
|
|
13377
|
+
position: "relative",
|
|
13378
|
+
width: "100%",
|
|
13379
|
+
marginBottom: logoSrc ? "48px" : "0",
|
|
13380
|
+
// Space for logo overlap only if logo exists
|
|
13381
|
+
cursor: isRepositioning ? "ns-resize" : "default"
|
|
13382
|
+
},
|
|
13383
|
+
onMouseEnter: () => editable && setIsHovering(true),
|
|
13384
|
+
onMouseLeave: () => {
|
|
13385
|
+
if (editable) {
|
|
13386
|
+
setIsHovering(false);
|
|
13387
|
+
setIsRepositioning(false);
|
|
13388
|
+
}
|
|
13389
|
+
},
|
|
13390
|
+
onMouseMove: handleMouseMove,
|
|
13391
|
+
onClick: () => isRepositioning && setIsRepositioning(false)
|
|
13392
|
+
},
|
|
13393
|
+
/* @__PURE__ */ React140.createElement(
|
|
13394
|
+
"img",
|
|
13395
|
+
{
|
|
13396
|
+
src: coverUrl,
|
|
13397
|
+
alt: "Cover",
|
|
13398
|
+
style: {
|
|
13399
|
+
display: "block",
|
|
13400
|
+
objectFit: "cover",
|
|
13401
|
+
borderRadius: "0px",
|
|
13402
|
+
width: "100%",
|
|
13403
|
+
height: "30vh",
|
|
13404
|
+
maxHeight: "280px",
|
|
13405
|
+
opacity: 1,
|
|
13406
|
+
objectPosition: `center ${coverPosition}%`,
|
|
13407
|
+
pointerEvents: isRepositioning ? "none" : "auto"
|
|
13408
|
+
}
|
|
13409
|
+
}
|
|
13410
|
+
),
|
|
13411
|
+
editable && isHovering && /* @__PURE__ */ React140.createElement(
|
|
13412
|
+
Group46,
|
|
13413
|
+
{
|
|
13414
|
+
gap: "xs",
|
|
13415
|
+
style: {
|
|
13416
|
+
position: "absolute",
|
|
13417
|
+
top: "12px",
|
|
13418
|
+
right: "12px",
|
|
13419
|
+
zIndex: 10
|
|
13420
|
+
}
|
|
13421
|
+
},
|
|
13422
|
+
/* @__PURE__ */ React140.createElement(
|
|
13423
|
+
Button33,
|
|
13424
|
+
{
|
|
13425
|
+
variant: "filled",
|
|
13426
|
+
size: "xs",
|
|
13427
|
+
onClick: handleChangeCover,
|
|
13428
|
+
style: {
|
|
13429
|
+
backgroundColor: "rgba(255, 255, 255, 0.9)",
|
|
13430
|
+
color: "#37352f",
|
|
13431
|
+
fontSize: "12px",
|
|
13432
|
+
fontWeight: 500,
|
|
13433
|
+
padding: "4px 8px",
|
|
13434
|
+
height: "auto"
|
|
13435
|
+
}
|
|
13436
|
+
},
|
|
13437
|
+
"Change cover"
|
|
13438
|
+
),
|
|
13439
|
+
/* @__PURE__ */ React140.createElement(
|
|
13440
|
+
Button33,
|
|
13441
|
+
{
|
|
13442
|
+
variant: "filled",
|
|
13443
|
+
size: "xs",
|
|
13444
|
+
onClick: handleReposition,
|
|
13445
|
+
style: {
|
|
13446
|
+
backgroundColor: isRepositioning ? "rgba(55, 53, 47, 0.9)" : "rgba(255, 255, 255, 0.9)",
|
|
13447
|
+
color: isRepositioning ? "white" : "#37352f",
|
|
13448
|
+
fontSize: "12px",
|
|
13449
|
+
fontWeight: 500,
|
|
13450
|
+
padding: "4px 8px",
|
|
13451
|
+
height: "auto"
|
|
13452
|
+
}
|
|
13453
|
+
},
|
|
13454
|
+
isRepositioning ? "Done" : "Reposition"
|
|
13455
|
+
),
|
|
13456
|
+
/* @__PURE__ */ React140.createElement(
|
|
13457
|
+
Button33,
|
|
13458
|
+
{
|
|
13459
|
+
variant: "filled",
|
|
13460
|
+
size: "xs",
|
|
13461
|
+
onClick: handleRemoveCover,
|
|
13462
|
+
style: {
|
|
13463
|
+
backgroundColor: "rgba(255, 255, 255, 0.9)",
|
|
13464
|
+
color: "#37352f",
|
|
13465
|
+
fontSize: "12px",
|
|
13466
|
+
fontWeight: 500,
|
|
13467
|
+
padding: "4px 8px",
|
|
13468
|
+
height: "auto"
|
|
13469
|
+
}
|
|
13470
|
+
},
|
|
13471
|
+
"Remove"
|
|
13472
|
+
)
|
|
13473
|
+
),
|
|
13474
|
+
logoSrc && /* @__PURE__ */ React140.createElement(
|
|
13475
|
+
"img",
|
|
13476
|
+
{
|
|
13477
|
+
src: logoSrc,
|
|
13478
|
+
alt: "Logo",
|
|
13479
|
+
style: {
|
|
13480
|
+
position: "absolute",
|
|
13481
|
+
bottom: "-39px",
|
|
13482
|
+
// Half of logo height to create overlap effect
|
|
13483
|
+
insetInlineStart: "96px",
|
|
13484
|
+
// Left padding similar to Notion
|
|
13485
|
+
opacity: 1,
|
|
13486
|
+
width: "78px",
|
|
13487
|
+
height: "78px",
|
|
13488
|
+
transition: "opacity 100ms ease-in",
|
|
13489
|
+
borderRadius: "3px",
|
|
13490
|
+
boxShadow: "0 1px 2px rgba(0, 0, 0, 0.1)",
|
|
13491
|
+
backgroundColor: "white",
|
|
13492
|
+
objectFit: "cover"
|
|
13493
|
+
}
|
|
13494
|
+
}
|
|
13495
|
+
),
|
|
13496
|
+
/* @__PURE__ */ React140.createElement("input", { ref: fileInputRef, type: "file", accept: "image/*", style: { display: "none" }, onChange: (e) => handleFileSelect(e, "cover") })
|
|
13497
|
+
);
|
|
13498
|
+
}
|
|
13499
|
+
|
|
13120
13500
|
// src/mantine/IxoEditor.tsx
|
|
13121
|
-
import
|
|
13501
|
+
import React142 from "react";
|
|
13122
13502
|
import { getDefaultReactSlashMenuItems, SuggestionMenuController } from "@blocknote/react";
|
|
13123
13503
|
import { BlockNoteView } from "@blocknote/mantine";
|
|
13124
13504
|
import { filterSuggestionItems } from "@blocknote/core";
|
|
13125
|
-
import { Flex as Flex25, MantineProvider, Text as
|
|
13505
|
+
import { Flex as Flex25, MantineProvider, Text as Text76 } from "@mantine/core";
|
|
13126
13506
|
|
|
13127
13507
|
// src/mantine/components/PanelContent.tsx
|
|
13128
|
-
import
|
|
13129
|
-
import { Box as
|
|
13508
|
+
import React141 from "react";
|
|
13509
|
+
import { Box as Box24 } from "@mantine/core";
|
|
13130
13510
|
var panelStyles = {
|
|
13131
13511
|
light: {
|
|
13132
13512
|
backgroundColor: "#ffffff",
|
|
@@ -13153,8 +13533,8 @@ function PanelContent({ theme }) {
|
|
|
13153
13533
|
const { activePanel, registeredPanels } = usePanelStore();
|
|
13154
13534
|
const isOpen = activePanel !== null;
|
|
13155
13535
|
const content = activePanel ? registeredPanels.get(activePanel) : null;
|
|
13156
|
-
return /* @__PURE__ */
|
|
13157
|
-
|
|
13536
|
+
return /* @__PURE__ */ React141.createElement(
|
|
13537
|
+
Box24,
|
|
13158
13538
|
{
|
|
13159
13539
|
pos: "sticky",
|
|
13160
13540
|
right: 0,
|
|
@@ -13180,9 +13560,12 @@ function IxoEditorContent({
|
|
|
13180
13560
|
className,
|
|
13181
13561
|
onChange,
|
|
13182
13562
|
onSelectionChange,
|
|
13183
|
-
|
|
13563
|
+
isPanelVisible = true,
|
|
13564
|
+
children,
|
|
13565
|
+
coverImageUrl,
|
|
13566
|
+
logoUrl
|
|
13184
13567
|
}) {
|
|
13185
|
-
return /* @__PURE__ */
|
|
13568
|
+
return /* @__PURE__ */ React142.createElement("div", { style: { display: "flex", height: "100%" } }, /* @__PURE__ */ React142.createElement("div", { className: `ixo-editor ixo-editor--theme-${config.theme} ${className}`, style: { flex: 1 } }, /* @__PURE__ */ React142.createElement(CoverImage, { coverImageUrl, logoUrl }), /* @__PURE__ */ React142.createElement(
|
|
13186
13569
|
BlockNoteView,
|
|
13187
13570
|
{
|
|
13188
13571
|
editor,
|
|
@@ -13197,7 +13580,7 @@ function IxoEditorContent({
|
|
|
13197
13580
|
onChange,
|
|
13198
13581
|
onSelectionChange
|
|
13199
13582
|
},
|
|
13200
|
-
config.slashMenu && /* @__PURE__ */
|
|
13583
|
+
config.slashMenu && /* @__PURE__ */ React142.createElement(
|
|
13201
13584
|
SuggestionMenuController,
|
|
13202
13585
|
{
|
|
13203
13586
|
triggerCharacter: "/",
|
|
@@ -13209,7 +13592,7 @@ function IxoEditorContent({
|
|
|
13209
13592
|
}
|
|
13210
13593
|
),
|
|
13211
13594
|
children
|
|
13212
|
-
)), /* @__PURE__ */
|
|
13595
|
+
)), isPanelVisible && /* @__PURE__ */ React142.createElement(PanelContent, { theme: config.theme }));
|
|
13213
13596
|
}
|
|
13214
13597
|
function IxoEditor({
|
|
13215
13598
|
editor,
|
|
@@ -13221,7 +13604,9 @@ function IxoEditor({
|
|
|
13221
13604
|
mantineTheme,
|
|
13222
13605
|
handlers,
|
|
13223
13606
|
blockRequirements,
|
|
13224
|
-
isPanelVisible
|
|
13607
|
+
isPanelVisible,
|
|
13608
|
+
coverImageUrl,
|
|
13609
|
+
logoUrl
|
|
13225
13610
|
}) {
|
|
13226
13611
|
if (!editor) {
|
|
13227
13612
|
return null;
|
|
@@ -13236,7 +13621,7 @@ function IxoEditor({
|
|
|
13236
13621
|
tableHandles: true
|
|
13237
13622
|
};
|
|
13238
13623
|
const isEditable = editable;
|
|
13239
|
-
const editorContent = /* @__PURE__ */
|
|
13624
|
+
const editorContent = /* @__PURE__ */ React142.createElement(BlocknoteProvider, { editor, handlers, blockRequirements, editable: isEditable }, /* @__PURE__ */ React142.createElement(ListBlocksUIProvider, null, /* @__PURE__ */ React142.createElement(Flex25, { pr: 25, justify: "flex-end", align: "center", gap: "xs" }, /* @__PURE__ */ React142.createElement(Text76, { size: "xs", c: "dimmed", tt: "uppercase" }, "Global actions"), /* @__PURE__ */ React142.createElement(ListBlocksToolbar, null)), /* @__PURE__ */ React142.createElement(
|
|
13240
13625
|
IxoEditorContent,
|
|
13241
13626
|
{
|
|
13242
13627
|
isPanelVisible,
|
|
@@ -13245,12 +13630,14 @@ function IxoEditor({
|
|
|
13245
13630
|
isEditable,
|
|
13246
13631
|
className,
|
|
13247
13632
|
onChange,
|
|
13248
|
-
onSelectionChange
|
|
13633
|
+
onSelectionChange,
|
|
13634
|
+
coverImageUrl,
|
|
13635
|
+
logoUrl
|
|
13249
13636
|
},
|
|
13250
13637
|
children
|
|
13251
13638
|
)));
|
|
13252
13639
|
if (mantineTheme) {
|
|
13253
|
-
return /* @__PURE__ */
|
|
13640
|
+
return /* @__PURE__ */ React142.createElement(MantineProvider, { theme: mantineTheme }, editorContent);
|
|
13254
13641
|
}
|
|
13255
13642
|
return editorContent;
|
|
13256
13643
|
}
|
|
@@ -13331,9 +13718,10 @@ export {
|
|
|
13331
13718
|
getExtraSlashMenuItems,
|
|
13332
13719
|
useCreateIxoEditor,
|
|
13333
13720
|
useCreateCollaborativeIxoEditor,
|
|
13721
|
+
CoverImage,
|
|
13334
13722
|
IxoEditor,
|
|
13335
13723
|
GraphQLClient,
|
|
13336
13724
|
ixoGraphQLClient,
|
|
13337
13725
|
getEntity
|
|
13338
13726
|
};
|
|
13339
|
-
//# sourceMappingURL=chunk-
|
|
13727
|
+
//# sourceMappingURL=chunk-22UP3RB4.mjs.map
|