@ixo/editor 1.2.0 → 1.3.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-R6LZUDT7.mjs → chunk-N4T5JPKZ.mjs} +1956 -678
- package/dist/chunk-N4T5JPKZ.mjs.map +1 -0
- package/dist/index.d.ts +229 -6
- package/dist/index.mjs +1 -1
- package/dist/mantine/index.mjs +1 -1
- package/package.json +1 -1
- package/dist/chunk-R6LZUDT7.mjs.map +0 -1
|
@@ -1563,13 +1563,13 @@ var CheckboxBlockSpec = createReactBlockSpec(
|
|
|
1563
1563
|
);
|
|
1564
1564
|
|
|
1565
1565
|
// src/mantine/blocks/list/ListBlock.tsx
|
|
1566
|
-
import
|
|
1566
|
+
import React36, { useState as useState6, useEffect as useEffect6, useMemo as useMemo6, useCallback as useCallback8 } from "react";
|
|
1567
1567
|
import { createReactBlockSpec as createReactBlockSpec2 } from "@blocknote/react";
|
|
1568
|
-
import { Group as
|
|
1568
|
+
import { Group as Group8, Stack as Stack23, Text as Text23, Button as Button8, ActionIcon as ActionIcon3, Alert as Alert4, Loader as Loader2, Center as Center2, Flex as Flex13 } from "@mantine/core";
|
|
1569
1569
|
|
|
1570
1570
|
// src/mantine/blocks/list/modal/ListConfigModal.tsx
|
|
1571
|
-
import
|
|
1572
|
-
import { Modal, Group as
|
|
1571
|
+
import React33, { useState as useState5 } from "react";
|
|
1572
|
+
import { Modal, Group as Group7, Box as Box13 } from "@mantine/core";
|
|
1573
1573
|
|
|
1574
1574
|
// src/mantine/blocks/list/modal/ListTypeSelectionStep.tsx
|
|
1575
1575
|
import React14 from "react";
|
|
@@ -1593,6 +1593,16 @@ var linkedResourcesConfigFields = [
|
|
|
1593
1593
|
}
|
|
1594
1594
|
];
|
|
1595
1595
|
var linkedResourcesHandlerKey = "getEntity";
|
|
1596
|
+
var linkedResourcesFilterFields = [
|
|
1597
|
+
{ key: "encrypted", label: "Private", type: true },
|
|
1598
|
+
{ key: "encrypted", label: "Public", type: false }
|
|
1599
|
+
];
|
|
1600
|
+
var linkedResourcesSortFields = [
|
|
1601
|
+
{ key: "description", label: "Description", type: "string" },
|
|
1602
|
+
{ key: "type", label: "Type", type: "string" },
|
|
1603
|
+
{ key: "mediaType", label: "Media Type", type: "string" },
|
|
1604
|
+
{ key: "serviceEndpoint", label: "Service Endpoint", type: "string" }
|
|
1605
|
+
];
|
|
1596
1606
|
|
|
1597
1607
|
// src/mantine/blocks/list/assets/config.ts
|
|
1598
1608
|
var assetsMetadata = {
|
|
@@ -1609,17 +1619,27 @@ var assetsConfigFields = [
|
|
|
1609
1619
|
type: "text",
|
|
1610
1620
|
placeholder: "did:ixo:entity:collection123",
|
|
1611
1621
|
required: true
|
|
1612
|
-
},
|
|
1613
|
-
{
|
|
1614
|
-
key: "showTableHeaders",
|
|
1615
|
-
label: "Show Table Headers",
|
|
1616
|
-
description: "Display column headers in the assets table",
|
|
1617
|
-
type: "switch",
|
|
1618
|
-
required: false,
|
|
1619
|
-
defaultValue: true
|
|
1620
1622
|
}
|
|
1623
|
+
// {
|
|
1624
|
+
// key: 'showTableHeaders',
|
|
1625
|
+
// label: 'Show Table Headers',
|
|
1626
|
+
// description: 'Display column headers in the assets table',
|
|
1627
|
+
// type: 'switch',
|
|
1628
|
+
// required: false,
|
|
1629
|
+
// defaultValue: true,
|
|
1630
|
+
// },
|
|
1621
1631
|
];
|
|
1622
1632
|
var assetsHandlerKey = "getAssets";
|
|
1633
|
+
var assetsSortFields = [
|
|
1634
|
+
{ key: "price", label: "Price", type: "number" },
|
|
1635
|
+
{ key: "totalCarbon", label: "Total Carbon", type: "number" },
|
|
1636
|
+
{ key: "name", label: "Name", type: "string" },
|
|
1637
|
+
{ key: "alsoKnownAs", label: "Also Known As", type: "string" }
|
|
1638
|
+
];
|
|
1639
|
+
var assetsFilterFields = [
|
|
1640
|
+
{ key: "available", label: "Available", type: true },
|
|
1641
|
+
{ key: "available", label: "Unavailable", type: false }
|
|
1642
|
+
];
|
|
1623
1643
|
|
|
1624
1644
|
// src/mantine/blocks/list/transactions/config.ts
|
|
1625
1645
|
var transactionsMetadata = {
|
|
@@ -1639,23 +1659,331 @@ var transactionsConfigFields = [
|
|
|
1639
1659
|
}
|
|
1640
1660
|
];
|
|
1641
1661
|
var transactionsHandlerKey = "getTransactions";
|
|
1662
|
+
var transactionsSortFields = [
|
|
1663
|
+
{ key: "time", label: "Time", type: "date" },
|
|
1664
|
+
{ key: "typeUrl", label: "Type", type: "string" },
|
|
1665
|
+
{ key: "transactionHash", label: "Transaction Hash", type: "string" },
|
|
1666
|
+
{ key: "memo", label: "Memo", type: "string" }
|
|
1667
|
+
];
|
|
1668
|
+
|
|
1669
|
+
// src/mantine/blocks/list/collections/config.ts
|
|
1670
|
+
var collectionsMetadata = {
|
|
1671
|
+
id: "collections",
|
|
1672
|
+
name: "Collections",
|
|
1673
|
+
description: "Display collections from a registry",
|
|
1674
|
+
icon: "\u{1F4BE}"
|
|
1675
|
+
};
|
|
1676
|
+
var collectionsConfigFields = [
|
|
1677
|
+
{
|
|
1678
|
+
key: "relayedNodeDid",
|
|
1679
|
+
label: "Relayed Node DID",
|
|
1680
|
+
description: "The DID of the relayed node to fetch collections from",
|
|
1681
|
+
type: "text",
|
|
1682
|
+
required: true
|
|
1683
|
+
}
|
|
1684
|
+
];
|
|
1685
|
+
var collectionsSortFields = [
|
|
1686
|
+
{
|
|
1687
|
+
key: "price",
|
|
1688
|
+
label: "Price",
|
|
1689
|
+
type: "number"
|
|
1690
|
+
},
|
|
1691
|
+
{
|
|
1692
|
+
key: "totalAssets",
|
|
1693
|
+
label: "Total Assets",
|
|
1694
|
+
type: "number"
|
|
1695
|
+
}
|
|
1696
|
+
];
|
|
1697
|
+
var collectionsHandlerKey = "getCollections";
|
|
1698
|
+
|
|
1699
|
+
// src/mantine/blocks/list/investments/config.ts
|
|
1700
|
+
var investmentsMetadata = {
|
|
1701
|
+
id: "investments",
|
|
1702
|
+
name: "Investments",
|
|
1703
|
+
description: "Display investment opportunities from a registry",
|
|
1704
|
+
icon: "\u{1F4B0}"
|
|
1705
|
+
};
|
|
1706
|
+
var investmentsConfigFields = [
|
|
1707
|
+
{
|
|
1708
|
+
key: "relayedNodeDid",
|
|
1709
|
+
label: "Relayed Node DID",
|
|
1710
|
+
description: "The DID of the relayed node to fetch investments from",
|
|
1711
|
+
type: "text",
|
|
1712
|
+
required: true
|
|
1713
|
+
}
|
|
1714
|
+
];
|
|
1715
|
+
var investmentsSortFields = [
|
|
1716
|
+
{ key: "currentAmount", label: "Current Amount", type: "number" },
|
|
1717
|
+
{ key: "maxAmount", label: "Max Amount", type: "number" },
|
|
1718
|
+
{ key: "price", label: "Price", type: "number" },
|
|
1719
|
+
{ key: "status", label: "Status", type: "string" },
|
|
1720
|
+
{ key: "name", label: "Name", type: "string" }
|
|
1721
|
+
];
|
|
1722
|
+
var investmentsFilterFields = [
|
|
1723
|
+
{ key: "isSubscribed", label: "Subscribed", type: true },
|
|
1724
|
+
{ key: "isSubscribed", label: "Not Subscribed", type: false },
|
|
1725
|
+
{ key: "isOpen", label: "Open", type: true },
|
|
1726
|
+
{ key: "isOpen", label: "Closed", type: false }
|
|
1727
|
+
];
|
|
1728
|
+
var investmentsHandlerKey = "getInvestments";
|
|
1729
|
+
|
|
1730
|
+
// src/mantine/blocks/list/oracles/config.ts
|
|
1731
|
+
var oraclesMetadata = {
|
|
1732
|
+
id: "oracles",
|
|
1733
|
+
name: "Oracles",
|
|
1734
|
+
description: "Display oracles available in the registry",
|
|
1735
|
+
icon: "\u{1F9D9}"
|
|
1736
|
+
};
|
|
1737
|
+
var oraclesConfigFields = [
|
|
1738
|
+
{
|
|
1739
|
+
key: "relayedNodeDid",
|
|
1740
|
+
label: "Relayed Node DID",
|
|
1741
|
+
description: "The DID of the relayed node to fetch oracles from",
|
|
1742
|
+
type: "text",
|
|
1743
|
+
required: true
|
|
1744
|
+
}
|
|
1745
|
+
];
|
|
1746
|
+
var oraclesSortFields = [
|
|
1747
|
+
{ key: "minPoints", label: "Min Points", type: "number" },
|
|
1748
|
+
{ key: "maxPoints", label: "Max Points", type: "number" },
|
|
1749
|
+
{ key: "flowsAmount", label: "Flows Amount", type: "number" },
|
|
1750
|
+
{ key: "name", label: "Name", type: "string" },
|
|
1751
|
+
{ key: "brand", label: "Brand", type: "string" }
|
|
1752
|
+
];
|
|
1753
|
+
var oraclesFilterFields = [
|
|
1754
|
+
{ key: "isActive", label: "Active", type: true },
|
|
1755
|
+
{ key: "isActive", label: "Inactive", type: false },
|
|
1756
|
+
{ key: "isInvited", label: "Invited", type: true },
|
|
1757
|
+
{ key: "isInvited", label: "Not Invited", type: false }
|
|
1758
|
+
];
|
|
1759
|
+
var oraclesHandlerKey = "getOracles";
|
|
1760
|
+
|
|
1761
|
+
// src/mantine/blocks/list/pods/config.ts
|
|
1762
|
+
var podsMetadata = {
|
|
1763
|
+
id: "pods",
|
|
1764
|
+
name: "PODs",
|
|
1765
|
+
description: "Display PODs from a registry",
|
|
1766
|
+
icon: "\u{1F465}"
|
|
1767
|
+
};
|
|
1768
|
+
var podsConfigFields = [
|
|
1769
|
+
{
|
|
1770
|
+
key: "relayedNodeDid",
|
|
1771
|
+
label: "Relayed Node DID",
|
|
1772
|
+
description: "The DID of the relayed node to fetch PODs from",
|
|
1773
|
+
type: "text",
|
|
1774
|
+
required: true
|
|
1775
|
+
}
|
|
1776
|
+
];
|
|
1777
|
+
var podsSortFields = [
|
|
1778
|
+
{ key: "members", label: "Members", type: "number" },
|
|
1779
|
+
{ key: "totalProposals", label: "Total Proposals", type: "number" },
|
|
1780
|
+
{ key: "startDate", label: "Start Date", type: "date" },
|
|
1781
|
+
{ key: "endDate", label: "End Date", type: "date" },
|
|
1782
|
+
{ key: "name", label: "Name", type: "string" }
|
|
1783
|
+
];
|
|
1784
|
+
var podsFilterFields = [
|
|
1785
|
+
{ key: "isMember", label: "Member", type: true },
|
|
1786
|
+
{ key: "isMember", label: "Other", type: false }
|
|
1787
|
+
];
|
|
1788
|
+
var podsHandlerKey = "getPODs";
|
|
1789
|
+
|
|
1790
|
+
// src/mantine/blocks/list/proposals/config.ts
|
|
1791
|
+
var proposalsMetadata = {
|
|
1792
|
+
id: "proposals",
|
|
1793
|
+
name: "Proposals",
|
|
1794
|
+
description: "Display proposals from a registry",
|
|
1795
|
+
icon: "\u{1F4DC}"
|
|
1796
|
+
};
|
|
1797
|
+
var proposalsConfigFields = [
|
|
1798
|
+
{
|
|
1799
|
+
key: "relayedNodeDid",
|
|
1800
|
+
label: "Relayed Node DID",
|
|
1801
|
+
description: "The DID of the relayed node to fetch proposals from",
|
|
1802
|
+
type: "text",
|
|
1803
|
+
required: true
|
|
1804
|
+
}
|
|
1805
|
+
];
|
|
1806
|
+
var proposalsFilterFields = [
|
|
1807
|
+
{ key: "isVotedOn", label: "Is Voted", type: true },
|
|
1808
|
+
{ key: "isVotedOn", label: "Not Voted", type: false }
|
|
1809
|
+
];
|
|
1810
|
+
var proposalsSortFields = [
|
|
1811
|
+
{ key: "status", label: "Status", type: "string" },
|
|
1812
|
+
{ key: "name", label: "Name", type: "string" }
|
|
1813
|
+
];
|
|
1814
|
+
var proposalsHandlerKey = "getProposals";
|
|
1815
|
+
|
|
1816
|
+
// src/mantine/blocks/list/requests/config.ts
|
|
1817
|
+
var requestsMetadata = {
|
|
1818
|
+
id: "requests",
|
|
1819
|
+
name: "Requests",
|
|
1820
|
+
description: "Display open requests from a registry",
|
|
1821
|
+
icon: "\u{1F4E9}"
|
|
1822
|
+
};
|
|
1823
|
+
var requestsConfigFields = [
|
|
1824
|
+
{
|
|
1825
|
+
key: "relayedNodeDid",
|
|
1826
|
+
label: "Relayed Node DID",
|
|
1827
|
+
description: "The DID of the relayed node to fetch requests from",
|
|
1828
|
+
type: "text",
|
|
1829
|
+
required: true
|
|
1830
|
+
}
|
|
1831
|
+
];
|
|
1832
|
+
var requestsSortFields = [
|
|
1833
|
+
{ key: "budget", label: "Budget", type: "number" },
|
|
1834
|
+
{ key: "totalApplications", label: "Total Applications", type: "number" },
|
|
1835
|
+
{ key: "name", label: "Name", type: "string" },
|
|
1836
|
+
{ key: "brand", label: "Brand", type: "string" }
|
|
1837
|
+
];
|
|
1838
|
+
var requestsFilterFields = [
|
|
1839
|
+
{ key: "isMember", label: "Member", type: true },
|
|
1840
|
+
{ key: "isMember", label: "Other", type: false }
|
|
1841
|
+
];
|
|
1842
|
+
var requestsHandlerKey = "getRequests";
|
|
1843
|
+
|
|
1844
|
+
// src/mantine/blocks/list/members/config.ts
|
|
1845
|
+
var groupMembersMetadata = {
|
|
1846
|
+
id: "group_members",
|
|
1847
|
+
name: "Group Members",
|
|
1848
|
+
description: "Display Group members",
|
|
1849
|
+
icon: "\u{1F464}"
|
|
1850
|
+
};
|
|
1851
|
+
var groupMembersConfigFields = [
|
|
1852
|
+
{
|
|
1853
|
+
key: "address",
|
|
1854
|
+
label: "Wallet Address",
|
|
1855
|
+
description: "Your wallet address to determine your membership",
|
|
1856
|
+
type: "text",
|
|
1857
|
+
required: true
|
|
1858
|
+
},
|
|
1859
|
+
{
|
|
1860
|
+
key: "groupCoreAddress",
|
|
1861
|
+
label: "Group Core Address",
|
|
1862
|
+
description: "The Core Address of the group to fetch members from",
|
|
1863
|
+
type: "text",
|
|
1864
|
+
required: true
|
|
1865
|
+
},
|
|
1866
|
+
{
|
|
1867
|
+
key: "withBalance",
|
|
1868
|
+
label: "With Balance",
|
|
1869
|
+
description: "Whether to include the balance of the members",
|
|
1870
|
+
type: "switch",
|
|
1871
|
+
required: false
|
|
1872
|
+
}
|
|
1873
|
+
];
|
|
1874
|
+
var groupMembersSortFields = [
|
|
1875
|
+
{ key: "username", label: "Username", type: "string" },
|
|
1876
|
+
{ key: "percentage", label: "Share %", type: "string" },
|
|
1877
|
+
{ key: "role", label: "Role", type: "string" }
|
|
1878
|
+
];
|
|
1879
|
+
var groupMembersHandlerKey = "getGroupMembers";
|
|
1880
|
+
|
|
1881
|
+
// src/mantine/blocks/list/validators/config.ts
|
|
1882
|
+
var validatorsMetadata = {
|
|
1883
|
+
id: "validators",
|
|
1884
|
+
name: "Validators",
|
|
1885
|
+
description: "Display staking validators",
|
|
1886
|
+
icon: "\u2705"
|
|
1887
|
+
};
|
|
1888
|
+
var validatorsConfigFields = [
|
|
1889
|
+
{
|
|
1890
|
+
key: "relayedNodeDid",
|
|
1891
|
+
label: "Relayed Node DID",
|
|
1892
|
+
description: "The DID of the relayed node to fetch validators from",
|
|
1893
|
+
type: "text",
|
|
1894
|
+
required: true
|
|
1895
|
+
}
|
|
1896
|
+
];
|
|
1897
|
+
var validatorsSortFields = [
|
|
1898
|
+
{ key: "name", label: "Name", type: "string" },
|
|
1899
|
+
{ key: "amount", label: "Amount", type: "number" },
|
|
1900
|
+
{ key: "commission", label: "Commission", type: "number" }
|
|
1901
|
+
];
|
|
1902
|
+
var validatorsFilterFields = [
|
|
1903
|
+
{ key: "isActive", label: "Active", type: true },
|
|
1904
|
+
{ key: "isStaked", label: "Staked", type: true },
|
|
1905
|
+
{ key: "isBonding", label: "Bonding", type: true }
|
|
1906
|
+
];
|
|
1907
|
+
var validatorsHandlerKey = "getValidators";
|
|
1642
1908
|
|
|
1643
1909
|
// src/mantine/blocks/list/registry.ts
|
|
1644
1910
|
var listTypeRegistry = {
|
|
1645
1911
|
linked_resources: {
|
|
1646
1912
|
metadata: linkedResourcesMetadata,
|
|
1647
1913
|
configFields: linkedResourcesConfigFields,
|
|
1914
|
+
sortFields: linkedResourcesSortFields,
|
|
1915
|
+
filterFields: linkedResourcesFilterFields,
|
|
1648
1916
|
handlerKey: linkedResourcesHandlerKey
|
|
1649
1917
|
},
|
|
1650
1918
|
assets: {
|
|
1651
1919
|
metadata: assetsMetadata,
|
|
1652
1920
|
configFields: assetsConfigFields,
|
|
1921
|
+
sortFields: assetsSortFields,
|
|
1922
|
+
filterFields: assetsFilterFields,
|
|
1653
1923
|
handlerKey: assetsHandlerKey
|
|
1654
1924
|
},
|
|
1655
1925
|
transactions: {
|
|
1656
1926
|
metadata: transactionsMetadata,
|
|
1657
1927
|
configFields: transactionsConfigFields,
|
|
1928
|
+
sortFields: transactionsSortFields,
|
|
1929
|
+
filterFields: [],
|
|
1658
1930
|
handlerKey: transactionsHandlerKey
|
|
1931
|
+
},
|
|
1932
|
+
collections: {
|
|
1933
|
+
metadata: collectionsMetadata,
|
|
1934
|
+
configFields: collectionsConfigFields,
|
|
1935
|
+
sortFields: collectionsSortFields,
|
|
1936
|
+
filterFields: [],
|
|
1937
|
+
handlerKey: collectionsHandlerKey
|
|
1938
|
+
},
|
|
1939
|
+
investments: {
|
|
1940
|
+
metadata: investmentsMetadata,
|
|
1941
|
+
configFields: investmentsConfigFields,
|
|
1942
|
+
sortFields: investmentsSortFields,
|
|
1943
|
+
filterFields: investmentsFilterFields,
|
|
1944
|
+
handlerKey: investmentsHandlerKey
|
|
1945
|
+
},
|
|
1946
|
+
oracles: {
|
|
1947
|
+
metadata: oraclesMetadata,
|
|
1948
|
+
configFields: oraclesConfigFields,
|
|
1949
|
+
sortFields: oraclesSortFields,
|
|
1950
|
+
filterFields: oraclesFilterFields,
|
|
1951
|
+
handlerKey: oraclesHandlerKey
|
|
1952
|
+
},
|
|
1953
|
+
pods: {
|
|
1954
|
+
metadata: podsMetadata,
|
|
1955
|
+
configFields: podsConfigFields,
|
|
1956
|
+
sortFields: podsSortFields,
|
|
1957
|
+
filterFields: podsFilterFields,
|
|
1958
|
+
handlerKey: podsHandlerKey
|
|
1959
|
+
},
|
|
1960
|
+
proposals: {
|
|
1961
|
+
metadata: proposalsMetadata,
|
|
1962
|
+
configFields: proposalsConfigFields,
|
|
1963
|
+
sortFields: proposalsSortFields,
|
|
1964
|
+
filterFields: proposalsFilterFields,
|
|
1965
|
+
handlerKey: proposalsHandlerKey
|
|
1966
|
+
},
|
|
1967
|
+
requests: {
|
|
1968
|
+
metadata: requestsMetadata,
|
|
1969
|
+
configFields: requestsConfigFields,
|
|
1970
|
+
sortFields: requestsSortFields,
|
|
1971
|
+
filterFields: requestsFilterFields,
|
|
1972
|
+
handlerKey: requestsHandlerKey
|
|
1973
|
+
},
|
|
1974
|
+
group_members: {
|
|
1975
|
+
metadata: groupMembersMetadata,
|
|
1976
|
+
configFields: groupMembersConfigFields,
|
|
1977
|
+
sortFields: groupMembersSortFields,
|
|
1978
|
+
filterFields: [],
|
|
1979
|
+
handlerKey: groupMembersHandlerKey
|
|
1980
|
+
},
|
|
1981
|
+
validators: {
|
|
1982
|
+
metadata: validatorsMetadata,
|
|
1983
|
+
configFields: validatorsConfigFields,
|
|
1984
|
+
sortFields: validatorsSortFields,
|
|
1985
|
+
filterFields: validatorsFilterFields,
|
|
1986
|
+
handlerKey: validatorsHandlerKey
|
|
1659
1987
|
}
|
|
1660
1988
|
};
|
|
1661
1989
|
var getAllListTypes = () => {
|
|
@@ -1664,13 +1992,12 @@ var getAllListTypes = () => {
|
|
|
1664
1992
|
var getListTypeConfig = (type) => {
|
|
1665
1993
|
return listTypeRegistry[type];
|
|
1666
1994
|
};
|
|
1995
|
+
var getListNameByType = (type) => {
|
|
1996
|
+
return listTypeRegistry[type].metadata.name;
|
|
1997
|
+
};
|
|
1667
1998
|
|
|
1668
1999
|
// src/mantine/blocks/list/modal/ListTypeSelectionStep.tsx
|
|
1669
|
-
var ListTypeSelectionStep = ({
|
|
1670
|
-
selectedType,
|
|
1671
|
-
onTypeSelect,
|
|
1672
|
-
onNext
|
|
1673
|
-
}) => {
|
|
2000
|
+
var ListTypeSelectionStep = ({ selectedType, onTypeSelect, onNext }) => {
|
|
1674
2001
|
const listTypes = getAllListTypes();
|
|
1675
2002
|
return /* @__PURE__ */ React14.createElement(Stack8, { gap: "md" }, /* @__PURE__ */ React14.createElement("div", null, /* @__PURE__ */ React14.createElement(Text6, { size: "lg", fw: 600, mb: "xs" }, "Choose List Type"), /* @__PURE__ */ React14.createElement(Text6, { size: "sm", c: "dimmed" }, "Select the type of list you want to create")), /* @__PURE__ */ React14.createElement(Stack8, { gap: "sm" }, listTypes.map((listType) => /* @__PURE__ */ React14.createElement(
|
|
1676
2003
|
Card4,
|
|
@@ -1679,7 +2006,7 @@ var ListTypeSelectionStep = ({
|
|
|
1679
2006
|
padding: "md",
|
|
1680
2007
|
radius: "md",
|
|
1681
2008
|
withBorder: true,
|
|
1682
|
-
bg: selectedType === listType.id ? "var(--mantine-color-
|
|
2009
|
+
bg: selectedType === listType.id ? "var(--mantine-color-gray-8)" : "transparent",
|
|
1683
2010
|
style: {
|
|
1684
2011
|
cursor: "pointer"
|
|
1685
2012
|
},
|
|
@@ -1708,14 +2035,7 @@ var ListTypeSelectionStep = ({
|
|
|
1708
2035
|
// src/mantine/blocks/list/modal/ListConfigurationStep.tsx
|
|
1709
2036
|
import React15 from "react";
|
|
1710
2037
|
import { Stack as Stack9, TextInput as TextInput4, Text as Text7, Button as Button5, Group as Group5, Switch as Switch3 } from "@mantine/core";
|
|
1711
|
-
var ListConfigurationStep = ({
|
|
1712
|
-
listType,
|
|
1713
|
-
config,
|
|
1714
|
-
onConfigChange,
|
|
1715
|
-
onPrev,
|
|
1716
|
-
onNext,
|
|
1717
|
-
isValid
|
|
1718
|
-
}) => {
|
|
2038
|
+
var ListConfigurationStep = ({ listType, config, onConfigChange, onPrev, onNext, isValid }) => {
|
|
1719
2039
|
const typeConfig = getListTypeConfig(listType);
|
|
1720
2040
|
const handlers = useBlocknoteHandlers();
|
|
1721
2041
|
const handleAutoFill = async () => {
|
|
@@ -1728,73 +2048,169 @@ var ListConfigurationStep = ({
|
|
|
1728
2048
|
}
|
|
1729
2049
|
}
|
|
1730
2050
|
};
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
2051
|
+
const renderListConfigField = (field) => {
|
|
2052
|
+
switch (field.type) {
|
|
2053
|
+
case "text":
|
|
2054
|
+
return /* @__PURE__ */ React15.createElement(
|
|
2055
|
+
TextInput4,
|
|
2056
|
+
{
|
|
2057
|
+
label: field.label,
|
|
2058
|
+
description: field.description,
|
|
2059
|
+
placeholder: field.placeholder,
|
|
2060
|
+
value: config[field.key] || "",
|
|
2061
|
+
onChange: (e) => onConfigChange(field.key, e.target.value),
|
|
2062
|
+
required: field.required
|
|
2063
|
+
}
|
|
2064
|
+
);
|
|
2065
|
+
case "switch":
|
|
2066
|
+
return /* @__PURE__ */ React15.createElement(
|
|
2067
|
+
Switch3,
|
|
2068
|
+
{
|
|
2069
|
+
label: field.label,
|
|
2070
|
+
description: field.description,
|
|
2071
|
+
checked: config[field.key] !== void 0 ? config[field.key] : field.defaultValue || false,
|
|
2072
|
+
onChange: (event) => onConfigChange(field.key, event.currentTarget.checked)
|
|
2073
|
+
}
|
|
2074
|
+
);
|
|
2075
|
+
default:
|
|
2076
|
+
return /* @__PURE__ */ React15.createElement(
|
|
2077
|
+
TextInput4,
|
|
2078
|
+
{
|
|
2079
|
+
label: field.label,
|
|
2080
|
+
description: field.description,
|
|
2081
|
+
placeholder: field.placeholder,
|
|
2082
|
+
value: config[field.key] || "",
|
|
2083
|
+
onChange: (e) => onConfigChange(field.key, e.target.value),
|
|
2084
|
+
required: field.required
|
|
2085
|
+
}
|
|
2086
|
+
);
|
|
1748
2087
|
}
|
|
1749
|
-
|
|
2088
|
+
};
|
|
2089
|
+
return /* @__PURE__ */ React15.createElement(Stack9, { gap: "md" }, /* @__PURE__ */ React15.createElement("div", null, /* @__PURE__ */ React15.createElement(Text7, { size: "lg", fw: 600, mb: "xs" }, "Configure ", typeConfig.metadata.name), /* @__PURE__ */ React15.createElement(Text7, { size: "sm", c: "dimmed" }, typeConfig.metadata.description)), /* @__PURE__ */ React15.createElement(Stack9, { gap: "sm" }, typeConfig.configFields.map((field) => /* @__PURE__ */ React15.createElement("div", { key: field.key }, renderListConfigField(field), field.key === "address" && listType === "transactions" && /* @__PURE__ */ React15.createElement(Button5, { size: "xs", variant: "subtle", mt: "xs", onClick: handleAutoFill }, "Use Current User Address")))), /* @__PURE__ */ React15.createElement(Group5, { justify: "space-between", mt: "md" }, /* @__PURE__ */ React15.createElement(Button5, { variant: "subtle", onClick: onPrev }, "Previous"), /* @__PURE__ */ React15.createElement(Button5, { onClick: onNext, disabled: !isValid }, "Next")));
|
|
1750
2090
|
};
|
|
1751
2091
|
|
|
1752
2092
|
// src/mantine/blocks/list/modal/ListPreviewStep.tsx
|
|
1753
|
-
import
|
|
1754
|
-
import { Stack as
|
|
2093
|
+
import React31, { useState as useState4, useEffect as useEffect5 } from "react";
|
|
2094
|
+
import { Stack as Stack21, Text as Text19, Button as Button6, Alert as Alert3, Loader, Center, Group as Group6 } from "@mantine/core";
|
|
1755
2095
|
|
|
1756
2096
|
// src/mantine/blocks/list/linked_resources/LinkedResourcesList.tsx
|
|
2097
|
+
import React19 from "react";
|
|
2098
|
+
import { Stack as Stack10, Text as Text8, Box as Box2, Flex as Flex2 } from "@mantine/core";
|
|
2099
|
+
|
|
2100
|
+
// src/core/lib/getMediaTypeIcon.tsx
|
|
2101
|
+
import { IconArchive, IconDeviceAudioTape, IconFileTypeXml, IconImageInPicture, IconPdf, IconFile, IconJson, IconVideo } from "@tabler/icons-react";
|
|
1757
2102
|
import React16 from "react";
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
}
|
|
1763
|
-
if (
|
|
1764
|
-
return /* @__PURE__ */ React16.createElement(
|
|
2103
|
+
function getMediaTypeIcon(mediaType, props = {}) {
|
|
2104
|
+
const normalizedType = mediaType?.toLowerCase() || "";
|
|
2105
|
+
if (normalizedType.startsWith("image/")) {
|
|
2106
|
+
return /* @__PURE__ */ React16.createElement(IconImageInPicture, { ...props });
|
|
2107
|
+
}
|
|
2108
|
+
if (normalizedType.startsWith("video/")) {
|
|
2109
|
+
return /* @__PURE__ */ React16.createElement(IconVideo, { ...props });
|
|
2110
|
+
}
|
|
2111
|
+
if (normalizedType.startsWith("audio/")) {
|
|
2112
|
+
return /* @__PURE__ */ React16.createElement(IconDeviceAudioTape, { ...props });
|
|
2113
|
+
}
|
|
2114
|
+
if (normalizedType.includes("pdf") || normalizedType === "application/pdf") {
|
|
2115
|
+
return /* @__PURE__ */ React16.createElement(IconPdf, { ...props });
|
|
2116
|
+
}
|
|
2117
|
+
if (normalizedType.includes("json") || normalizedType === "application/json" || normalizedType === "text/json") {
|
|
2118
|
+
return /* @__PURE__ */ React16.createElement(IconJson, { ...props });
|
|
2119
|
+
}
|
|
2120
|
+
if (normalizedType.includes("xml") || normalizedType === "application/xml" || normalizedType === "text/xml" || normalizedType === "application/rss+xml" || normalizedType === "application/atom+xml") {
|
|
2121
|
+
return /* @__PURE__ */ React16.createElement(IconFileTypeXml, { ...props });
|
|
2122
|
+
}
|
|
2123
|
+
if (normalizedType.includes("zip") || normalizedType.includes("rar") || normalizedType.includes("tar") || normalizedType.includes("gzip") || normalizedType.includes("7z") || normalizedType === "application/x-compressed" || normalizedType === "application/x-zip-compressed" || normalizedType === "multipart/x-zip") {
|
|
2124
|
+
return /* @__PURE__ */ React16.createElement(IconArchive, { ...props });
|
|
2125
|
+
}
|
|
2126
|
+
if (normalizedType.startsWith("text/") || normalizedType.includes("document") || normalizedType.includes("word") || normalizedType.includes("excel") || normalizedType.includes("powerpoint") || normalizedType.includes("spreadsheet") || normalizedType.includes("presentation")) {
|
|
2127
|
+
return /* @__PURE__ */ React16.createElement(IconFile, { ...props });
|
|
1765
2128
|
}
|
|
1766
|
-
return /* @__PURE__ */ React16.createElement(
|
|
2129
|
+
return /* @__PURE__ */ React16.createElement(IconVideo, { ...props });
|
|
2130
|
+
}
|
|
2131
|
+
|
|
2132
|
+
// src/mantine/blocks/list/ListItemContainer.tsx
|
|
2133
|
+
import { Flex } from "@mantine/core";
|
|
2134
|
+
import React17 from "react";
|
|
2135
|
+
function ListItemContainer({ children }) {
|
|
2136
|
+
return /* @__PURE__ */ React17.createElement(Flex, { styles: { root: { borderRadius: 16, border: `1px solid rgba(255, 255, 255, 0.06)` } }, p: 20, bg: "rgba(255, 255, 255, 0.02)", justify: "space-between" }, children);
|
|
2137
|
+
}
|
|
2138
|
+
|
|
2139
|
+
// src/mantine/blocks/list/ListItemCheckbox.tsx
|
|
2140
|
+
import React18 from "react";
|
|
2141
|
+
import { Checkbox as Checkbox3 } from "@mantine/core";
|
|
2142
|
+
function ListItemCheckbox({ checked, onCheck, ariaLabel }) {
|
|
2143
|
+
return /* @__PURE__ */ React18.createElement(
|
|
2144
|
+
Checkbox3,
|
|
2145
|
+
{
|
|
2146
|
+
"aria-label": ariaLabel || "Select row",
|
|
2147
|
+
checked,
|
|
2148
|
+
onChange: (e) => onCheck?.(e.currentTarget.checked),
|
|
2149
|
+
size: "md",
|
|
2150
|
+
color: "rgb(0, 255, 157)",
|
|
2151
|
+
styles: {
|
|
2152
|
+
input: {
|
|
2153
|
+
width: 22,
|
|
2154
|
+
height: 22
|
|
2155
|
+
}
|
|
2156
|
+
}
|
|
2157
|
+
}
|
|
2158
|
+
);
|
|
2159
|
+
}
|
|
2160
|
+
|
|
2161
|
+
// src/mantine/blocks/list/linked_resources/LinkedResourcesList.tsx
|
|
2162
|
+
var LinkedResourcesList = ({ items, mods, isItemChecked, onItemCheck, config: _config }) => {
|
|
2163
|
+
if (!items || items.length === 0) {
|
|
2164
|
+
return /* @__PURE__ */ React19.createElement(Text8, { size: "sm", c: "dimmed", ta: "center", py: "md" }, "No linked resources found");
|
|
2165
|
+
}
|
|
2166
|
+
const rows = items.map((item, index) => {
|
|
1767
2167
|
const title = item.description || item.id || `Resource ${index + 1}`;
|
|
1768
|
-
return /* @__PURE__ */
|
|
1769
|
-
|
|
2168
|
+
return /* @__PURE__ */ React19.createElement(ListItemContainer, { key: item.id || index }, /* @__PURE__ */ React19.createElement(Flex2, { align: "center", gap: "sm" }, /* @__PURE__ */ React19.createElement(
|
|
2169
|
+
Box2,
|
|
1770
2170
|
{
|
|
1771
|
-
key: item.id || index,
|
|
1772
|
-
padding: "sm",
|
|
1773
|
-
radius: "md",
|
|
1774
2171
|
style: {
|
|
1775
|
-
|
|
2172
|
+
width: 32,
|
|
2173
|
+
height: 32,
|
|
2174
|
+
borderRadius: 6,
|
|
2175
|
+
backgroundColor: "var(--mantine-color-gray-1)",
|
|
2176
|
+
border: "1px solid var(--mantine-color-gray-3)",
|
|
2177
|
+
display: "flex",
|
|
2178
|
+
alignItems: "center",
|
|
2179
|
+
justifyContent: "center"
|
|
1776
2180
|
}
|
|
1777
2181
|
},
|
|
1778
|
-
|
|
1779
|
-
)
|
|
1780
|
-
|
|
2182
|
+
getMediaTypeIcon(item.mediaType, { size: 16 })
|
|
2183
|
+
), /* @__PURE__ */ React19.createElement(Stack10, { gap: 0 }, /* @__PURE__ */ React19.createElement(Text8, { size: "sm" }, title), item.type && /* @__PURE__ */ React19.createElement(Text8, { size: "xs", c: "dimmed" }, item.type))), /* @__PURE__ */ React19.createElement(Flex2, { align: "center", gap: "md" }, /* @__PURE__ */ React19.createElement(Stack10, { ta: "right", gap: 0 }, /* @__PURE__ */ React19.createElement(Text8, { size: "sm" }, item.encrypted === "true" ? "Private" : "Public"), /* @__PURE__ */ React19.createElement(Text8, { size: "xs", c: "dimmed" }, item.encrypted === "true" ? "Ask for access" : "Accessible")), mods && /* @__PURE__ */ React19.createElement(
|
|
2184
|
+
ListItemCheckbox,
|
|
2185
|
+
{
|
|
2186
|
+
ariaLabel: `Select resource ${item.id}`,
|
|
2187
|
+
checked: item.id ? isItemChecked?.(item.id) : false,
|
|
2188
|
+
onCheck: (checked) => item.id && onItemCheck?.(item.id, checked)
|
|
2189
|
+
}
|
|
2190
|
+
)));
|
|
2191
|
+
});
|
|
2192
|
+
return /* @__PURE__ */ React19.createElement(Box2, { flex: 1 }, /* @__PURE__ */ React19.createElement(Stack10, null, rows));
|
|
1781
2193
|
};
|
|
1782
2194
|
|
|
1783
2195
|
// src/mantine/blocks/list/assets/AssetsList.tsx
|
|
1784
|
-
import
|
|
1785
|
-
import {
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
2196
|
+
import React20 from "react";
|
|
2197
|
+
import { Text as Text9, Box as Box3, Stack as Stack11, Flex as Flex3, Image } from "@mantine/core";
|
|
2198
|
+
|
|
2199
|
+
// src/core/lib/formatters.ts
|
|
2200
|
+
var formatNumber = (value) => typeof value === "number" ? value.toLocaleString() : "-";
|
|
2201
|
+
|
|
2202
|
+
// src/mantine/blocks/list/assets/AssetsList.tsx
|
|
2203
|
+
var AssetsList = ({ items, mods, isItemChecked, onItemCheck }) => {
|
|
2204
|
+
if (!items || items.length === 0) {
|
|
2205
|
+
return /* @__PURE__ */ React20.createElement(Text9, { size: "sm", c: "dimmed", ta: "center", py: "md" }, "No assets found");
|
|
1790
2206
|
}
|
|
1791
|
-
const rows =
|
|
1792
|
-
return /* @__PURE__ */
|
|
2207
|
+
const rows = items.map((asset) => /* @__PURE__ */ React20.createElement(ListItemContainer, { key: asset.did }, /* @__PURE__ */ React20.createElement(Flex3, { align: "center", gap: "sm" }, /* @__PURE__ */ React20.createElement(Image, { radius: 16, w: 32, h: 32, src: asset.icon }), /* @__PURE__ */ React20.createElement(Stack11, { gap: 0 }, /* @__PURE__ */ React20.createElement(Text9, { size: "sm" }, asset.name || "-", " ", asset.alsoKnownAs || "-"), asset.totalCarbon !== void 0 && /* @__PURE__ */ React20.createElement(Text9, { size: "sm", c: "dimmed" }, formatNumber(asset.totalCarbon), " CARBON"))), /* @__PURE__ */ React20.createElement(Flex3, { align: "center", gap: "md" }, /* @__PURE__ */ React20.createElement(Stack11, { ta: "right", gap: 0 }, /* @__PURE__ */ React20.createElement(Text9, { size: "sm" }, asset.currency || "", formatNumber(asset.price)), /* @__PURE__ */ React20.createElement(Text9, { size: "sm", c: "dimmed" }, asset.available ? "Available" : "Unavailable")), mods && /* @__PURE__ */ React20.createElement(ListItemCheckbox, { ariaLabel: `Select asset ${asset.did}`, checked: isItemChecked?.(asset.did), onCheck: (checked) => onItemCheck?.(asset.did, checked) }))));
|
|
2208
|
+
return /* @__PURE__ */ React20.createElement(Box3, { flex: 1 }, /* @__PURE__ */ React20.createElement(Stack11, null, rows));
|
|
1793
2209
|
};
|
|
1794
2210
|
|
|
1795
2211
|
// src/mantine/blocks/list/transactions/TransactionsList.tsx
|
|
1796
|
-
import
|
|
1797
|
-
import {
|
|
2212
|
+
import React21 from "react";
|
|
2213
|
+
import { Text as Text10, Badge as Badge2, Tooltip as Tooltip2, Box as Box4, Flex as Flex4, Stack as Stack12 } from "@mantine/core";
|
|
1798
2214
|
var formatTime = (timeStr) => {
|
|
1799
2215
|
try {
|
|
1800
2216
|
const date = new Date(timeStr);
|
|
@@ -1807,33 +2223,160 @@ var truncateHash = (hash, length = 8) => {
|
|
|
1807
2223
|
if (hash.length <= length * 2) return hash;
|
|
1808
2224
|
return `${hash.slice(0, length)}...${hash.slice(-length)}`;
|
|
1809
2225
|
};
|
|
1810
|
-
var TransactionsList = ({
|
|
1811
|
-
if (!
|
|
1812
|
-
return /* @__PURE__ */
|
|
2226
|
+
var TransactionsList = ({ items, mods, isItemChecked, onItemCheck, config: _config }) => {
|
|
2227
|
+
if (!items || items.length === 0) {
|
|
2228
|
+
return /* @__PURE__ */ React21.createElement(Text10, { size: "sm", c: "dimmed", ta: "center", py: "md" }, "No transactions found");
|
|
1813
2229
|
}
|
|
1814
|
-
const rows =
|
|
1815
|
-
|
|
2230
|
+
const rows = items.map((transaction, index) => /* @__PURE__ */ React21.createElement(ListItemContainer, { key: transaction.transactionHash || index }, /* @__PURE__ */ React21.createElement(Flex4, { align: "center", gap: "sm" }, /* @__PURE__ */ React21.createElement(Stack12, { gap: 2 }, /* @__PURE__ */ React21.createElement(Tooltip2, { label: transaction.transactionHash, position: "top" }, /* @__PURE__ */ React21.createElement(Text10, { size: "sm", style: { fontFamily: "monospace" } }, truncateHash(transaction.transactionHash))), /* @__PURE__ */ React21.createElement(Text10, { size: "sm", c: "dimmed" }, transaction.memo || "-"))), /* @__PURE__ */ React21.createElement(Flex4, { align: "center", gap: "md" }, /* @__PURE__ */ React21.createElement(Stack12, { ta: "right", gap: 2 }, /* @__PURE__ */ React21.createElement(Badge2, { size: "sm", variant: "light", color: "blue", style: { fontFamily: "monospace", fontSize: "10px" } }, transaction.typeUrl), /* @__PURE__ */ React21.createElement(Text10, { size: "xs", c: "dimmed" }, formatTime(transaction.time))), mods && /* @__PURE__ */ React21.createElement(
|
|
2231
|
+
ListItemCheckbox,
|
|
1816
2232
|
{
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
2233
|
+
ariaLabel: `Select transaction ${transaction.transactionHash}`,
|
|
2234
|
+
checked: isItemChecked?.(transaction.transactionHash),
|
|
2235
|
+
onCheck: (checked) => onItemCheck?.(transaction.transactionHash, checked)
|
|
2236
|
+
}
|
|
2237
|
+
))));
|
|
2238
|
+
return /* @__PURE__ */ React21.createElement(Box4, { flex: 1 }, /* @__PURE__ */ React21.createElement(Stack12, null, rows));
|
|
2239
|
+
};
|
|
2240
|
+
|
|
2241
|
+
// src/mantine/blocks/list/collections/CollectionsList.tsx
|
|
2242
|
+
import React22 from "react";
|
|
2243
|
+
import { Text as Text11, Box as Box5, Image as Image2, Stack as Stack13, Flex as Flex5 } from "@mantine/core";
|
|
2244
|
+
var CollectionsList = ({ items, mods, isItemChecked, onItemCheck }) => {
|
|
2245
|
+
if (!items || items.length === 0) {
|
|
2246
|
+
return /* @__PURE__ */ React22.createElement(Text11, { size: "sm", c: "dimmed", ta: "center", py: "md" }, "No collections found");
|
|
2247
|
+
}
|
|
2248
|
+
const rows = items.map((collection) => /* @__PURE__ */ React22.createElement(ListItemContainer, { key: collection.did }, /* @__PURE__ */ React22.createElement(Flex5, { align: "center", gap: "sm" }, /* @__PURE__ */ React22.createElement(Image2, { radius: 16, w: 32, h: 32, src: collection.icon }), /* @__PURE__ */ React22.createElement(Stack13, { gap: 0 }, /* @__PURE__ */ React22.createElement(Text11, { size: "sm" }, collection.name || "-"), /* @__PURE__ */ React22.createElement(Text11, { size: "sm", c: "dimmed" }, collection.brand || "-"))), /* @__PURE__ */ React22.createElement(Flex5, { align: "center", gap: "md" }, /* @__PURE__ */ React22.createElement(Stack13, { ta: "right", gap: 0 }, /* @__PURE__ */ React22.createElement(Text11, { size: "sm" }, collection.totalAssets || "-", " Assets"), /* @__PURE__ */ React22.createElement(Text11, { size: "sm", c: "dimmed" }, collection.currency || "-", collection.price || "-")), mods && /* @__PURE__ */ React22.createElement(
|
|
2249
|
+
ListItemCheckbox,
|
|
2250
|
+
{
|
|
2251
|
+
ariaLabel: `Select collection ${collection.did}`,
|
|
2252
|
+
checked: isItemChecked?.(collection.did),
|
|
2253
|
+
onCheck: (checked) => onItemCheck?.(collection.did, checked)
|
|
2254
|
+
}
|
|
2255
|
+
))));
|
|
2256
|
+
return /* @__PURE__ */ React22.createElement(Box5, { flex: 1 }, /* @__PURE__ */ React22.createElement(Stack13, null, rows));
|
|
2257
|
+
};
|
|
2258
|
+
|
|
2259
|
+
// src/mantine/blocks/list/investments/InvestmentsList.tsx
|
|
2260
|
+
import React23 from "react";
|
|
2261
|
+
import { Text as Text12, Box as Box6, Image as Image3, Stack as Stack14, Flex as Flex6, Progress } from "@mantine/core";
|
|
2262
|
+
var InvestmentsList = ({ items, mods, isItemChecked, onItemCheck }) => {
|
|
2263
|
+
if (!items || items.length === 0) {
|
|
2264
|
+
return /* @__PURE__ */ React23.createElement(Text12, { size: "sm", c: "dimmed", ta: "center", py: "md" }, "No investments found");
|
|
2265
|
+
}
|
|
2266
|
+
const rows = items.map((investment) => /* @__PURE__ */ React23.createElement(ListItemContainer, { key: investment.did }, /* @__PURE__ */ React23.createElement(Flex6, { align: "center", gap: "sm" }, /* @__PURE__ */ React23.createElement(Image3, { radius: 16, w: 32, h: 32, src: investment.icon }), /* @__PURE__ */ React23.createElement(Stack14, { gap: 0 }, /* @__PURE__ */ React23.createElement(Text12, { size: "sm" }, investment.name || "-"), /* @__PURE__ */ React23.createElement(Text12, { size: "sm", c: "dimmed" }, investment.brand || "-"))), /* @__PURE__ */ React23.createElement(Flex6, { align: "center", gap: "md" }, /* @__PURE__ */ React23.createElement(Stack14, { ta: "right", gap: 0 }, /* @__PURE__ */ React23.createElement(Flex6, { gap: "5px" }, /* @__PURE__ */ React23.createElement(Text12, { size: "sm" }, investment.currency + formatNumber(investment.currentAmount)), /* @__PURE__ */ React23.createElement(Text12, { size: "sm", c: "dimmed" }, "/ ", investment.currency + formatNumber(investment.maxAmount))), /* @__PURE__ */ React23.createElement(Text12, { size: "xs", c: "dimmed" }, /* @__PURE__ */ React23.createElement(Progress, { color: "rgb(0, 255, 157)", radius: "xl", size: "lg", value: investment.currentAmount * 100 / investment.maxAmount }))), mods && /* @__PURE__ */ React23.createElement(
|
|
2267
|
+
ListItemCheckbox,
|
|
2268
|
+
{
|
|
2269
|
+
ariaLabel: `Select investment ${investment.did}`,
|
|
2270
|
+
checked: isItemChecked?.(investment.did),
|
|
2271
|
+
onCheck: (checked) => onItemCheck?.(investment.did, checked)
|
|
2272
|
+
}
|
|
2273
|
+
))));
|
|
2274
|
+
return /* @__PURE__ */ React23.createElement(Box6, { flex: 1 }, /* @__PURE__ */ React23.createElement(Stack14, null, rows));
|
|
2275
|
+
};
|
|
2276
|
+
|
|
2277
|
+
// src/mantine/blocks/list/oracles/OraclesList.tsx
|
|
2278
|
+
import React24 from "react";
|
|
2279
|
+
import { Text as Text13, Box as Box7, Image as Image4, Stack as Stack15, Flex as Flex7 } from "@mantine/core";
|
|
2280
|
+
var OraclesList = ({ items, mods, isItemChecked, onItemCheck }) => {
|
|
2281
|
+
if (!items || items.length === 0) {
|
|
2282
|
+
return /* @__PURE__ */ React24.createElement(Text13, { size: "sm", c: "dimmed", ta: "center", py: "md" }, "No oracles found");
|
|
2283
|
+
}
|
|
2284
|
+
const rows = items.map((oracle) => /* @__PURE__ */ React24.createElement(ListItemContainer, { key: oracle.did }, /* @__PURE__ */ React24.createElement(Flex7, { align: "center", gap: "sm" }, /* @__PURE__ */ React24.createElement(Image4, { radius: 16, w: 32, h: 32, src: oracle.icon }), /* @__PURE__ */ React24.createElement(Stack15, { gap: 0 }, /* @__PURE__ */ React24.createElement(Text13, { size: "sm" }, oracle.name || "-"), /* @__PURE__ */ React24.createElement(Text13, { size: "sm", c: "dimmed" }, oracle.brand || "-"))), /* @__PURE__ */ React24.createElement(Flex7, { align: "center", gap: "md" }, /* @__PURE__ */ React24.createElement(Stack15, { ta: "right", gap: 0 }, /* @__PURE__ */ React24.createElement(Text13, { size: "sm" }, oracle.currency || "-"), /* @__PURE__ */ React24.createElement(Text13, { size: "xs", c: "dimmed" }, oracle.minPoints, " - ", oracle.maxPoints, " pts"), /* @__PURE__ */ React24.createElement(Text13, { size: "xs", c: "dimmed" }, oracle.flowsAmount, " Flows")), mods && /* @__PURE__ */ React24.createElement(ListItemCheckbox, { ariaLabel: `Select oracle ${oracle.did}`, checked: isItemChecked?.(oracle.did), onCheck: (checked) => onItemCheck?.(oracle.did, checked) }))));
|
|
2285
|
+
return /* @__PURE__ */ React24.createElement(Box7, { flex: 1 }, /* @__PURE__ */ React24.createElement(Stack15, null, rows));
|
|
2286
|
+
};
|
|
2287
|
+
|
|
2288
|
+
// src/mantine/blocks/list/pods/PODsList.tsx
|
|
2289
|
+
import React25 from "react";
|
|
2290
|
+
import { Text as Text14, Box as Box8, Image as Image5, Stack as Stack16, Flex as Flex8 } from "@mantine/core";
|
|
2291
|
+
var PodsList = ({ items, mods, isItemChecked, onItemCheck }) => {
|
|
2292
|
+
if (!items || items.length === 0) {
|
|
2293
|
+
return /* @__PURE__ */ React25.createElement(Text14, { size: "sm", c: "dimmed", ta: "center", py: "md" }, "No PODs found");
|
|
2294
|
+
}
|
|
2295
|
+
const rows = items.map((pod) => /* @__PURE__ */ React25.createElement(ListItemContainer, { key: pod.did }, /* @__PURE__ */ React25.createElement(Flex8, { align: "center", gap: "sm" }, /* @__PURE__ */ React25.createElement(Image5, { radius: 16, w: 32, h: 32, src: pod.icon }), /* @__PURE__ */ React25.createElement(Stack16, { gap: 0 }, /* @__PURE__ */ React25.createElement(Text14, { size: "sm" }, pod.name || "-"), /* @__PURE__ */ React25.createElement(Text14, { size: "sm", c: "dimmed" }, pod.startDate, " \u2192 ", pod.endDate))), /* @__PURE__ */ React25.createElement(Flex8, { align: "center", gap: "md" }, /* @__PURE__ */ React25.createElement(Stack16, { ta: "right", gap: 0 }, /* @__PURE__ */ React25.createElement(Text14, { size: "sm" }, pod.members, " Members"), /* @__PURE__ */ React25.createElement(Text14, { size: "sm", c: "dimmed" }, pod.totalProposals, " Proposals")), mods && /* @__PURE__ */ React25.createElement(ListItemCheckbox, { ariaLabel: `Select pod ${pod.did}`, checked: isItemChecked?.(pod.did), onCheck: (checked) => onItemCheck?.(pod.did, checked) }))));
|
|
2296
|
+
return /* @__PURE__ */ React25.createElement(Box8, { flex: 1 }, /* @__PURE__ */ React25.createElement(Stack16, null, rows));
|
|
2297
|
+
};
|
|
2298
|
+
|
|
2299
|
+
// src/mantine/blocks/list/proposals/CollectionsList.tsx
|
|
2300
|
+
import React26 from "react";
|
|
2301
|
+
import { Text as Text15, Box as Box9, Image as Image6, Stack as Stack17, Flex as Flex9, Badge as Badge3 } from "@mantine/core";
|
|
2302
|
+
var ProposalsList = ({ items, mods, isItemChecked, onItemCheck }) => {
|
|
2303
|
+
if (!items || items.length === 0) {
|
|
2304
|
+
return /* @__PURE__ */ React26.createElement(Text15, { size: "sm", c: "dimmed", ta: "center", py: "md" }, "No proposals found");
|
|
2305
|
+
}
|
|
2306
|
+
const rows = items.map((proposal) => /* @__PURE__ */ React26.createElement(ListItemContainer, { key: proposal.did }, /* @__PURE__ */ React26.createElement(Flex9, { align: "center", gap: "sm" }, /* @__PURE__ */ React26.createElement(Image6, { radius: 16, w: 32, h: 32, src: proposal.icon }), /* @__PURE__ */ React26.createElement(Stack17, { gap: 0 }, /* @__PURE__ */ React26.createElement(Text15, { size: "sm" }, proposal.name || "-"), /* @__PURE__ */ React26.createElement(Text15, { size: "xs", c: "dimmed" }, proposal.description || "-"))), /* @__PURE__ */ React26.createElement(Flex9, { align: "center", gap: "md" }, /* @__PURE__ */ React26.createElement(Stack17, { ta: "right", gap: 0 }, /* @__PURE__ */ React26.createElement(Badge3, { size: "sm", variant: "light", color: "blue", style: { fontFamily: "monospace", fontSize: "10px" } }, proposal.status), /* @__PURE__ */ React26.createElement(Text15, { size: "sm", c: "dimmed" }, proposal.isVotedOn ? "Voted" : "Not voted")), mods && /* @__PURE__ */ React26.createElement(ListItemCheckbox, { ariaLabel: `Select proposal ${proposal.did}`, checked: isItemChecked?.(proposal.did), onCheck: (checked) => onItemCheck?.(proposal.did, checked) }))));
|
|
2307
|
+
return /* @__PURE__ */ React26.createElement(Box9, { flex: 1 }, /* @__PURE__ */ React26.createElement(Stack17, null, rows));
|
|
2308
|
+
};
|
|
2309
|
+
|
|
2310
|
+
// src/mantine/blocks/list/requests/RequestsList.tsx
|
|
2311
|
+
import React27 from "react";
|
|
2312
|
+
import { Text as Text16, Box as Box10, Image as Image7, Stack as Stack18, Flex as Flex10 } from "@mantine/core";
|
|
2313
|
+
var RequestsList = ({ items, mods, isItemChecked, onItemCheck }) => {
|
|
2314
|
+
if (!items || items.length === 0) {
|
|
2315
|
+
return /* @__PURE__ */ React27.createElement(Text16, { size: "sm", c: "dimmed", ta: "center", py: "md" }, "No requests found");
|
|
2316
|
+
}
|
|
2317
|
+
const rows = items.map((request) => /* @__PURE__ */ React27.createElement(ListItemContainer, { key: request.did }, /* @__PURE__ */ React27.createElement(Flex10, { align: "center", gap: "sm" }, /* @__PURE__ */ React27.createElement(Image7, { radius: 16, w: 32, h: 32, src: request.icon }), /* @__PURE__ */ React27.createElement(Stack18, { gap: 0 }, /* @__PURE__ */ React27.createElement(Text16, { size: "sm" }, request.name || "-"), /* @__PURE__ */ React27.createElement(Text16, { size: "sm", c: "dimmed" }, request.brand || "-"))), /* @__PURE__ */ React27.createElement(Flex10, { align: "center", gap: "md" }, /* @__PURE__ */ React27.createElement(Stack18, { ta: "right", gap: 0 }, /* @__PURE__ */ React27.createElement(Text16, { size: "sm", c: "dimmed" }, request.currency || "", request.budget ?? "-"), /* @__PURE__ */ React27.createElement(Text16, { size: "xs", c: "dimmed" }, request.totalApplications ?? 0, " Applications")), mods && /* @__PURE__ */ React27.createElement(ListItemCheckbox, { ariaLabel: `Select request ${request.did}`, checked: isItemChecked?.(request.did), onCheck: (checked) => onItemCheck?.(request.did, checked) }))));
|
|
2318
|
+
return /* @__PURE__ */ React27.createElement(Box10, { flex: 1 }, /* @__PURE__ */ React27.createElement(Stack18, null, rows));
|
|
1825
2319
|
};
|
|
1826
2320
|
|
|
2321
|
+
// src/mantine/blocks/list/members/MembersList.tsx
|
|
2322
|
+
import React28 from "react";
|
|
2323
|
+
import { Text as Text17, Box as Box11, Image as Image8, Stack as Stack19, Flex as Flex11 } from "@mantine/core";
|
|
2324
|
+
var MembersList = ({ items, mods, isItemChecked, onItemCheck }) => {
|
|
2325
|
+
if (!items || items.length === 0) {
|
|
2326
|
+
return /* @__PURE__ */ React28.createElement(Text17, { size: "sm", c: "dimmed", ta: "center", py: "md" }, "No members found");
|
|
2327
|
+
}
|
|
2328
|
+
const rows = items.map((member) => /* @__PURE__ */ React28.createElement(ListItemContainer, { key: member.did }, /* @__PURE__ */ React28.createElement(Flex11, { align: "center", gap: "sm" }, /* @__PURE__ */ React28.createElement(Image8, { radius: 16, w: 32, h: 32, src: member.icon }), /* @__PURE__ */ React28.createElement(Stack19, { gap: 0 }, /* @__PURE__ */ React28.createElement(Text17, { size: "sm" }, member.username || "-"), /* @__PURE__ */ React28.createElement(Text17, { size: "xs", c: "dimmed" }, member.address || "-"))), /* @__PURE__ */ React28.createElement(Flex11, { align: "center", gap: "md" }, /* @__PURE__ */ React28.createElement(Stack19, { ta: "right", gap: 0 }, /* @__PURE__ */ React28.createElement(Text17, { size: "sm" }, member.percentage), /* @__PURE__ */ React28.createElement(Text17, { size: "sm", c: "dimmed" }, member.role)), mods && /* @__PURE__ */ React28.createElement(ListItemCheckbox, { ariaLabel: `Select member ${member.did}`, checked: isItemChecked?.(member.did), onCheck: (checked) => onItemCheck?.(member.did, checked) }))));
|
|
2329
|
+
return /* @__PURE__ */ React28.createElement(Box11, { flex: 1 }, /* @__PURE__ */ React28.createElement(Stack19, null, rows));
|
|
2330
|
+
};
|
|
2331
|
+
|
|
2332
|
+
// src/mantine/blocks/list/validators/ValidatorsList.tsx
|
|
2333
|
+
import React29 from "react";
|
|
2334
|
+
import { Text as Text18, Box as Box12, Image as Image9, Stack as Stack20, Flex as Flex12 } from "@mantine/core";
|
|
2335
|
+
var ValidatorsList = ({ items, mods, isItemChecked, onItemCheck }) => {
|
|
2336
|
+
if (!items || items.length === 0) {
|
|
2337
|
+
return /* @__PURE__ */ React29.createElement(Text18, { size: "sm", c: "dimmed", ta: "center", py: "md" }, "No validators found");
|
|
2338
|
+
}
|
|
2339
|
+
const rows = items.map((v) => /* @__PURE__ */ React29.createElement(ListItemContainer, { key: v.did }, /* @__PURE__ */ React29.createElement(Flex12, { align: "center", gap: "sm" }, /* @__PURE__ */ React29.createElement(Image9, { radius: 16, w: 32, h: 32, src: v.icon }), /* @__PURE__ */ React29.createElement(Stack20, { gap: 0 }, /* @__PURE__ */ React29.createElement(Text18, { size: "sm" }, v.name || "-"), /* @__PURE__ */ React29.createElement(Text18, { size: "xs", c: "dimmed" }, v.description || "-"))), /* @__PURE__ */ React29.createElement(Flex12, { align: "center", gap: "md" }, /* @__PURE__ */ React29.createElement(Stack20, { ta: "right", gap: 0 }, /* @__PURE__ */ React29.createElement(Text18, { size: "sm" }, formatNumber(v.amount), " ", v.currency), /* @__PURE__ */ React29.createElement(Text18, { size: "sm", c: "dimmed" }, v.commission, "% fee"), /* @__PURE__ */ React29.createElement(Text18, { size: "xs", c: "dimmed" }, v.isActive ? "Active" : "Inactive", " \u2022 ", v.isStaked ? "Staked" : "Not staked", " \u2022 ", v.isBonding ? "Bonding" : "Not bonding")), mods && /* @__PURE__ */ React29.createElement(ListItemCheckbox, { ariaLabel: `Select validator ${v.did}`, checked: isItemChecked?.(v.did), onCheck: (checked) => onItemCheck?.(v.did, checked) }))));
|
|
2340
|
+
return /* @__PURE__ */ React29.createElement(Box12, { flex: 1 }, /* @__PURE__ */ React29.createElement(Stack20, null, rows));
|
|
2341
|
+
};
|
|
2342
|
+
|
|
2343
|
+
// src/mantine/blocks/list/ListPagination.tsx
|
|
2344
|
+
import React30 from "react";
|
|
2345
|
+
import { Pagination } from "@mantine/core";
|
|
2346
|
+
function ListPagination({ page, setPage, totalPages }) {
|
|
2347
|
+
return /* @__PURE__ */ React30.createElement(
|
|
2348
|
+
Pagination,
|
|
2349
|
+
{
|
|
2350
|
+
value: page,
|
|
2351
|
+
onChange: setPage,
|
|
2352
|
+
total: totalPages,
|
|
2353
|
+
siblings: 1,
|
|
2354
|
+
radius: 8,
|
|
2355
|
+
color: "rgba(255, 255, 255, 0.08)",
|
|
2356
|
+
boundaries: 0,
|
|
2357
|
+
mx: "auto",
|
|
2358
|
+
styles: {
|
|
2359
|
+
dots: { display: "none" },
|
|
2360
|
+
control: {
|
|
2361
|
+
padding: 0,
|
|
2362
|
+
border: 0,
|
|
2363
|
+
color: "#868e96"
|
|
2364
|
+
}
|
|
2365
|
+
}
|
|
2366
|
+
}
|
|
2367
|
+
);
|
|
2368
|
+
}
|
|
2369
|
+
|
|
2370
|
+
// src/core/constants.ts
|
|
2371
|
+
var DEFAULT_PAGE_SIZE = 5;
|
|
2372
|
+
|
|
1827
2373
|
// src/mantine/blocks/list/modal/ListPreviewStep.tsx
|
|
1828
|
-
var ListPreviewStep = ({
|
|
1829
|
-
listType,
|
|
1830
|
-
config,
|
|
1831
|
-
onAddToBlock,
|
|
1832
|
-
onPrev
|
|
1833
|
-
}) => {
|
|
2374
|
+
var ListPreviewStep = ({ listType, config, onAddToBlock, onPrev }) => {
|
|
1834
2375
|
const [data, setData] = useState4(null);
|
|
1835
2376
|
const [loading, setLoading] = useState4(false);
|
|
1836
2377
|
const [error, setError] = useState4(null);
|
|
2378
|
+
const [page, setPage] = useState4(1);
|
|
2379
|
+
const [totalPages, setTotalPages] = useState4(0);
|
|
1837
2380
|
const typeConfig = getListTypeConfig(listType);
|
|
1838
2381
|
const handlers = useBlocknoteHandlers();
|
|
1839
2382
|
const fetchData = async () => {
|
|
@@ -1850,13 +2393,55 @@ var ListPreviewStep = ({
|
|
|
1850
2393
|
break;
|
|
1851
2394
|
case "assets":
|
|
1852
2395
|
if (!config.collectionDid) throw new Error("Collection DID is required");
|
|
1853
|
-
result = await handlers.getAssets(config.collectionDid);
|
|
1854
|
-
setData({ items: result });
|
|
2396
|
+
result = await handlers.getAssets(config.collectionDid, page);
|
|
2397
|
+
setData({ items: result.data });
|
|
1855
2398
|
break;
|
|
1856
2399
|
case "transactions":
|
|
1857
2400
|
if (!config.address) throw new Error("Address is required");
|
|
1858
|
-
result = await handlers.getTransactions(config.address);
|
|
1859
|
-
|
|
2401
|
+
result = await handlers.getTransactions(config.address, page);
|
|
2402
|
+
setTotalPages(Math.ceil(result.totalCount / DEFAULT_PAGE_SIZE));
|
|
2403
|
+
setData({ items: result.data });
|
|
2404
|
+
break;
|
|
2405
|
+
case "collections":
|
|
2406
|
+
if (!config.relayedNodeDid) throw new Error("Relayer is required");
|
|
2407
|
+
result = await handlers.getCollections(config.relayedNodeDid, page);
|
|
2408
|
+
setData({ items: result.data });
|
|
2409
|
+
break;
|
|
2410
|
+
case "investments":
|
|
2411
|
+
if (!config.relayedNodeDid) throw new Error("Relayer is required");
|
|
2412
|
+
result = await handlers.getInvestments(config.relayedNodeDid, page);
|
|
2413
|
+
setData({ items: result.data });
|
|
2414
|
+
break;
|
|
2415
|
+
case "oracles":
|
|
2416
|
+
if (!config.relayedNodeDid) throw new Error("Relayer is required");
|
|
2417
|
+
result = await handlers.getOracles(config.relayedNodeDid, page);
|
|
2418
|
+
setData({ items: result.data });
|
|
2419
|
+
break;
|
|
2420
|
+
case "pods":
|
|
2421
|
+
if (!config.relayedNodeDid) throw new Error("Relayer is required");
|
|
2422
|
+
result = await handlers.getPODs(config.relayedNodeDid, page);
|
|
2423
|
+
setData({ items: result.data });
|
|
2424
|
+
break;
|
|
2425
|
+
case "proposals":
|
|
2426
|
+
if (!config.relayedNodeDid) throw new Error("Relayer is required");
|
|
2427
|
+
result = await handlers.getProposals(config.relayedNodeDid, page);
|
|
2428
|
+
setData({ items: result.data });
|
|
2429
|
+
break;
|
|
2430
|
+
case "requests":
|
|
2431
|
+
if (!config.relayedNodeDid) throw new Error("Relayer is required");
|
|
2432
|
+
result = await handlers.getRequests(config.relayedNodeDid, page);
|
|
2433
|
+
setData({ items: result.data });
|
|
2434
|
+
break;
|
|
2435
|
+
case "group_members":
|
|
2436
|
+
if (!config.address) throw new Error("Address is required");
|
|
2437
|
+
if (!config.groupCoreAddress) throw new Error("Group Core Address is required");
|
|
2438
|
+
result = await handlers.getMembers(config.address, config.groupCoreAddress, config.withBalance, page);
|
|
2439
|
+
setData({ items: result.data });
|
|
2440
|
+
break;
|
|
2441
|
+
case "validators":
|
|
2442
|
+
if (!config.relayedNodeDid) throw new Error("Relayer is required");
|
|
2443
|
+
result = await handlers.getValidators(config.relayedNodeDid, page);
|
|
2444
|
+
setData({ items: result.data });
|
|
1860
2445
|
break;
|
|
1861
2446
|
default:
|
|
1862
2447
|
throw new Error(`Unknown list type: ${listType}`);
|
|
@@ -1869,26 +2454,42 @@ var ListPreviewStep = ({
|
|
|
1869
2454
|
};
|
|
1870
2455
|
useEffect5(() => {
|
|
1871
2456
|
fetchData();
|
|
1872
|
-
}, [listType, config]);
|
|
2457
|
+
}, [listType, page, config]);
|
|
1873
2458
|
const renderListComponent = () => {
|
|
1874
2459
|
if (!data) return null;
|
|
1875
2460
|
switch (listType) {
|
|
1876
2461
|
case "linked_resources":
|
|
1877
|
-
return /* @__PURE__ */
|
|
2462
|
+
return /* @__PURE__ */ React31.createElement(LinkedResourcesList, { items: data.items, config });
|
|
1878
2463
|
case "assets":
|
|
1879
|
-
return /* @__PURE__ */
|
|
2464
|
+
return /* @__PURE__ */ React31.createElement(AssetsList, { items: data.items, config });
|
|
1880
2465
|
case "transactions":
|
|
1881
|
-
return /* @__PURE__ */
|
|
2466
|
+
return /* @__PURE__ */ React31.createElement(TransactionsList, { items: data.items, config });
|
|
2467
|
+
case "collections":
|
|
2468
|
+
return /* @__PURE__ */ React31.createElement(CollectionsList, { items: data.items });
|
|
2469
|
+
case "investments":
|
|
2470
|
+
return /* @__PURE__ */ React31.createElement(InvestmentsList, { items: data.items });
|
|
2471
|
+
case "oracles":
|
|
2472
|
+
return /* @__PURE__ */ React31.createElement(OraclesList, { items: data.items });
|
|
2473
|
+
case "pods":
|
|
2474
|
+
return /* @__PURE__ */ React31.createElement(PodsList, { items: data.items });
|
|
2475
|
+
case "proposals":
|
|
2476
|
+
return /* @__PURE__ */ React31.createElement(ProposalsList, { items: data.items });
|
|
2477
|
+
case "requests":
|
|
2478
|
+
return /* @__PURE__ */ React31.createElement(RequestsList, { items: data.items });
|
|
2479
|
+
case "group_members":
|
|
2480
|
+
return /* @__PURE__ */ React31.createElement(MembersList, { items: data.items });
|
|
2481
|
+
case "validators":
|
|
2482
|
+
return /* @__PURE__ */ React31.createElement(ValidatorsList, { items: data.items });
|
|
1882
2483
|
default:
|
|
1883
2484
|
return null;
|
|
1884
2485
|
}
|
|
1885
2486
|
};
|
|
1886
|
-
return /* @__PURE__ */
|
|
2487
|
+
return /* @__PURE__ */ React31.createElement(Stack21, { gap: "md" }, /* @__PURE__ */ React31.createElement("div", null, /* @__PURE__ */ React31.createElement(Text19, { size: "lg", fw: 600, mb: "xs" }, "Preview ", typeConfig.metadata.name), /* @__PURE__ */ React31.createElement(Text19, { size: "sm", c: "dimmed" }, "Preview how your list will look with the current configuration")), loading && /* @__PURE__ */ React31.createElement(Center, { py: "xl" }, /* @__PURE__ */ React31.createElement(Stack21, { align: "center", gap: "sm" }, /* @__PURE__ */ React31.createElement(Loader, { size: "md" }), /* @__PURE__ */ React31.createElement(Text19, { size: "sm", c: "dimmed" }, "Loading preview..."))), error && /* @__PURE__ */ React31.createElement(Alert3, { color: "red", title: "Failed to load preview" }, /* @__PURE__ */ React31.createElement(Stack21, { gap: "xs" }, /* @__PURE__ */ React31.createElement(Text19, { size: "sm" }, error), /* @__PURE__ */ React31.createElement(Button6, { size: "xs", variant: "subtle", onClick: fetchData }, "Retry"))), !loading && !error && data && /* @__PURE__ */ React31.createElement(React31.Fragment, null, /* @__PURE__ */ React31.createElement("div", { style: { maxHeight: "400px", overflow: "auto" } }, renderListComponent()), /* @__PURE__ */ React31.createElement(ListPagination, { page, setPage, totalPages })), /* @__PURE__ */ React31.createElement(Group6, { justify: "space-between", mt: "md" }, /* @__PURE__ */ React31.createElement(Button6, { variant: "subtle", onClick: onPrev }, "Previous"), /* @__PURE__ */ React31.createElement(Button6, { onClick: onAddToBlock }, "Add to Block")));
|
|
1887
2488
|
};
|
|
1888
2489
|
|
|
1889
2490
|
// src/mantine/blocks/list/modal/ModalNavigation.tsx
|
|
1890
|
-
import
|
|
1891
|
-
import { Stack as
|
|
2491
|
+
import React32 from "react";
|
|
2492
|
+
import { Stack as Stack22, Button as Button7, Text as Text20 } from "@mantine/core";
|
|
1892
2493
|
var ModalNavigation = ({
|
|
1893
2494
|
steps,
|
|
1894
2495
|
activeStep,
|
|
@@ -1896,7 +2497,7 @@ var ModalNavigation = ({
|
|
|
1896
2497
|
showUpdateButton = false,
|
|
1897
2498
|
onUpdateBlock
|
|
1898
2499
|
}) => {
|
|
1899
|
-
return /* @__PURE__ */
|
|
2500
|
+
return /* @__PURE__ */ React32.createElement(Stack22, { gap: "xs", style: { height: "100%" } }, /* @__PURE__ */ React32.createElement(Stack22, { gap: "xs", style: { flex: 1 } }, steps.map((step) => /* @__PURE__ */ React32.createElement(
|
|
1900
2501
|
Button7,
|
|
1901
2502
|
{
|
|
1902
2503
|
key: step.id,
|
|
@@ -1914,20 +2515,17 @@ var ModalNavigation = ({
|
|
|
1914
2515
|
}
|
|
1915
2516
|
}
|
|
1916
2517
|
},
|
|
1917
|
-
/* @__PURE__ */
|
|
1918
|
-
))), showUpdateButton && /* @__PURE__ */
|
|
2518
|
+
/* @__PURE__ */ React32.createElement(Stack22, { gap: 2, align: "flex-start" }, /* @__PURE__ */ React32.createElement(Text20, { size: "sm", fw: 500 }, step.label), /* @__PURE__ */ React32.createElement(Text20, { size: "xs", opacity: 0.7 }, step.description))
|
|
2519
|
+
))), showUpdateButton && /* @__PURE__ */ React32.createElement(Button7, { variant: "filled", color: "blue", onClick: onUpdateBlock, style: { marginTop: "auto" } }, "Update Block"));
|
|
1919
2520
|
};
|
|
1920
2521
|
|
|
1921
2522
|
// src/mantine/blocks/list/modal/ListConfigModal.tsx
|
|
1922
|
-
var ListConfigModal = ({
|
|
1923
|
-
opened,
|
|
1924
|
-
onClose,
|
|
1925
|
-
onSave,
|
|
1926
|
-
initialConfig
|
|
1927
|
-
}) => {
|
|
2523
|
+
var ListConfigModal = ({ opened, onClose, onSave, initialConfig }) => {
|
|
1928
2524
|
const [activeStep, setActiveStep] = useState5("type");
|
|
1929
2525
|
const [selectedType, setSelectedType] = useState5(initialConfig?.type || null);
|
|
1930
2526
|
const [config, setConfig] = useState5(initialConfig?.config || {});
|
|
2527
|
+
const [sortConfig, setSortConfig] = useState5(initialConfig?.sortOptions || {});
|
|
2528
|
+
const [filterConfig, setFilterConfig] = useState5(initialConfig?.filterOptions || {});
|
|
1931
2529
|
const handleTypeSelect = (type) => {
|
|
1932
2530
|
setSelectedType(type);
|
|
1933
2531
|
const typeConfig = getListTypeConfig(type);
|
|
@@ -1937,6 +2535,8 @@ var ListConfigModal = ({
|
|
|
1937
2535
|
defaultConfig[field.key] = field.defaultValue;
|
|
1938
2536
|
}
|
|
1939
2537
|
});
|
|
2538
|
+
setSortConfig(typeConfig.sortFields);
|
|
2539
|
+
setFilterConfig(typeConfig.filterFields);
|
|
1940
2540
|
setConfig(defaultConfig);
|
|
1941
2541
|
};
|
|
1942
2542
|
const handleConfigChange = (key, value) => {
|
|
@@ -1946,7 +2546,11 @@ var ListConfigModal = ({
|
|
|
1946
2546
|
if (selectedType && config) {
|
|
1947
2547
|
onSave({
|
|
1948
2548
|
type: selectedType,
|
|
1949
|
-
config
|
|
2549
|
+
config,
|
|
2550
|
+
sortOptions: sortConfig,
|
|
2551
|
+
filterOptions: filterConfig,
|
|
2552
|
+
filter: null,
|
|
2553
|
+
sort: null
|
|
1950
2554
|
});
|
|
1951
2555
|
onClose();
|
|
1952
2556
|
}
|
|
@@ -1954,9 +2558,7 @@ var ListConfigModal = ({
|
|
|
1954
2558
|
const isConfigValid = () => {
|
|
1955
2559
|
if (!selectedType) return false;
|
|
1956
2560
|
const typeConfig = getListTypeConfig(selectedType);
|
|
1957
|
-
return typeConfig.configFields.every(
|
|
1958
|
-
(field) => !field.required || config[field.key] && config[field.key].trim() !== ""
|
|
1959
|
-
);
|
|
2561
|
+
return typeConfig.configFields.every((field) => !field.required || config[field.key] && config[field.key].trim() !== "");
|
|
1960
2562
|
};
|
|
1961
2563
|
const handleClose = () => {
|
|
1962
2564
|
setActiveStep("type");
|
|
@@ -1987,16 +2589,9 @@ var ListConfigModal = ({
|
|
|
1987
2589
|
const renderStepContent = () => {
|
|
1988
2590
|
switch (activeStep) {
|
|
1989
2591
|
case "type":
|
|
1990
|
-
return /* @__PURE__ */
|
|
1991
|
-
ListTypeSelectionStep,
|
|
1992
|
-
{
|
|
1993
|
-
selectedType,
|
|
1994
|
-
onTypeSelect: handleTypeSelect,
|
|
1995
|
-
onNext: () => setActiveStep("configure")
|
|
1996
|
-
}
|
|
1997
|
-
);
|
|
2592
|
+
return /* @__PURE__ */ React33.createElement(ListTypeSelectionStep, { selectedType, onTypeSelect: handleTypeSelect, onNext: () => setActiveStep("configure") });
|
|
1998
2593
|
case "configure":
|
|
1999
|
-
return selectedType ? /* @__PURE__ */
|
|
2594
|
+
return selectedType ? /* @__PURE__ */ React33.createElement(
|
|
2000
2595
|
ListConfigurationStep,
|
|
2001
2596
|
{
|
|
2002
2597
|
listType: selectedType,
|
|
@@ -2008,20 +2603,12 @@ var ListConfigModal = ({
|
|
|
2008
2603
|
}
|
|
2009
2604
|
) : null;
|
|
2010
2605
|
case "preview":
|
|
2011
|
-
return selectedType ? /* @__PURE__ */
|
|
2012
|
-
ListPreviewStep,
|
|
2013
|
-
{
|
|
2014
|
-
listType: selectedType,
|
|
2015
|
-
config,
|
|
2016
|
-
onAddToBlock: handleAddToBlock,
|
|
2017
|
-
onPrev: () => setActiveStep("configure")
|
|
2018
|
-
}
|
|
2019
|
-
) : null;
|
|
2606
|
+
return selectedType ? /* @__PURE__ */ React33.createElement(ListPreviewStep, { listSortConfig: null, listType: selectedType, config, onAddToBlock: handleAddToBlock, onPrev: () => setActiveStep("configure") }) : null;
|
|
2020
2607
|
default:
|
|
2021
2608
|
return null;
|
|
2022
2609
|
}
|
|
2023
2610
|
};
|
|
2024
|
-
return /* @__PURE__ */
|
|
2611
|
+
return /* @__PURE__ */ React33.createElement(Modal, { opened, onClose: handleClose, title: "Configure List Block", size: "xl" }, /* @__PURE__ */ React33.createElement(Group7, { align: "flex-start", gap: "lg", style: { minHeight: "400px" } }, /* @__PURE__ */ React33.createElement(Box13, { style: { width: "200px", flexShrink: 0, height: "400px", display: "flex" } }, /* @__PURE__ */ React33.createElement(
|
|
2025
2612
|
ModalNavigation,
|
|
2026
2613
|
{
|
|
2027
2614
|
steps,
|
|
@@ -2030,19 +2617,154 @@ var ListConfigModal = ({
|
|
|
2030
2617
|
showUpdateButton: selectedType !== null && isConfigValid(),
|
|
2031
2618
|
onUpdateBlock: handleAddToBlock
|
|
2032
2619
|
}
|
|
2033
|
-
)), /* @__PURE__ */
|
|
2620
|
+
)), /* @__PURE__ */ React33.createElement(Box13, { style: { flex: 1 } }, renderStepContent())));
|
|
2621
|
+
};
|
|
2622
|
+
|
|
2623
|
+
// src/mantine/blocks/list/ListActionsMenu.tsx
|
|
2624
|
+
import React34 from "react";
|
|
2625
|
+
import { Menu, Text as Text21 } from "@mantine/core";
|
|
2626
|
+
import { IconArrowDown, IconArrowUp, IconAdjustments, IconCheckbox as IconCheckbox2, IconAdjustmentsHorizontal } from "@tabler/icons-react";
|
|
2627
|
+
var ListActionsMenu = ({ options, selectionMode, onSelectActionClick, value, onChange }) => {
|
|
2628
|
+
const renderItem = (opt, direction) => {
|
|
2629
|
+
const isActive = value?.key === opt.key && value?.direction === direction;
|
|
2630
|
+
const Icon = direction === "asc" ? IconArrowUp : IconArrowDown;
|
|
2631
|
+
return /* @__PURE__ */ React34.createElement(
|
|
2632
|
+
Menu.Item,
|
|
2633
|
+
{
|
|
2634
|
+
key: `${opt.key}-${direction}`,
|
|
2635
|
+
leftSection: /* @__PURE__ */ React34.createElement(Icon, { size: 16 }),
|
|
2636
|
+
onClick: () => {
|
|
2637
|
+
console.log("Changing sort: ", direction);
|
|
2638
|
+
onChange({ key: opt.key, direction });
|
|
2639
|
+
},
|
|
2640
|
+
"data-active": isActive
|
|
2641
|
+
},
|
|
2642
|
+
opt.label
|
|
2643
|
+
);
|
|
2644
|
+
};
|
|
2645
|
+
return /* @__PURE__ */ React34.createElement(Menu, { shadow: "md", width: 220 }, /* @__PURE__ */ React34.createElement(Menu.Target, null, /* @__PURE__ */ React34.createElement(Text21, { style: { cursor: "pointer" } }, /* @__PURE__ */ React34.createElement(IconAdjustmentsHorizontal, { size: 20 }))), /* @__PURE__ */ React34.createElement(Menu.Dropdown, null, /* @__PURE__ */ React34.createElement(Menu.Label, null, /* @__PURE__ */ React34.createElement(Text21, { c: "dimmed" }, "Order By")), options.map((opt) => /* @__PURE__ */ React34.createElement(React34.Fragment, { key: opt.key }, renderItem(opt, "desc"), renderItem(opt, "asc"))), /* @__PURE__ */ React34.createElement(Menu.Divider, null), /* @__PURE__ */ React34.createElement(Menu.Item, { leftSection: /* @__PURE__ */ React34.createElement(IconAdjustments, { size: 16 }) }, "Smart Filter"), /* @__PURE__ */ React34.createElement(Menu.Divider, null), /* @__PURE__ */ React34.createElement(Menu.Item, { onClick: () => onSelectActionClick(selectionMode === "single" ? null : "single"), leftSection: /* @__PURE__ */ React34.createElement(IconCheckbox2, { size: 16 }) }, "Single Select"), /* @__PURE__ */ React34.createElement(Menu.Item, { onClick: () => onSelectActionClick(selectionMode === "multi" ? null : "multi"), leftSection: /* @__PURE__ */ React34.createElement(IconCheckbox2, { size: 16 }) }, "Multi Select")));
|
|
2034
2646
|
};
|
|
2035
2647
|
|
|
2648
|
+
// src/core/lib/sortListItems.ts
|
|
2649
|
+
function sortListItems(data, sortOption) {
|
|
2650
|
+
if (!sortOption) return data.items;
|
|
2651
|
+
const field = sortOption.key;
|
|
2652
|
+
const dir = sortOption.direction === "asc" ? 1 : -1;
|
|
2653
|
+
return [...data.items].sort((a, b) => {
|
|
2654
|
+
const aVal = a?.[field];
|
|
2655
|
+
const bVal = b?.[field];
|
|
2656
|
+
if (aVal == null && bVal == null) return 0;
|
|
2657
|
+
if (aVal == null) return 1;
|
|
2658
|
+
if (bVal == null) return -1;
|
|
2659
|
+
if (typeof aVal === "number" && typeof bVal === "number") return (aVal - bVal) * dir;
|
|
2660
|
+
const aNum = Number(aVal);
|
|
2661
|
+
const bNum = Number(bVal);
|
|
2662
|
+
if (!Number.isNaN(aNum) && !Number.isNaN(bNum)) return (aNum - bNum) * dir;
|
|
2663
|
+
return String(aVal).localeCompare(String(bVal)) * dir;
|
|
2664
|
+
});
|
|
2665
|
+
}
|
|
2666
|
+
|
|
2667
|
+
// src/mantine/blocks/list/FilterTab.tsx
|
|
2668
|
+
import React35 from "react";
|
|
2669
|
+
import { UnstyledButton, Text as Text22 } from "@mantine/core";
|
|
2670
|
+
function FilterTab({ onClick, label, isActive }) {
|
|
2671
|
+
return /* @__PURE__ */ React35.createElement(
|
|
2672
|
+
UnstyledButton,
|
|
2673
|
+
{
|
|
2674
|
+
onClick,
|
|
2675
|
+
role: "tab",
|
|
2676
|
+
"aria-selected": isActive,
|
|
2677
|
+
styles: {
|
|
2678
|
+
root: {
|
|
2679
|
+
display: "inline-flex",
|
|
2680
|
+
alignItems: "center",
|
|
2681
|
+
justifyContent: "center",
|
|
2682
|
+
paddingInline: 16,
|
|
2683
|
+
paddingBlock: 10,
|
|
2684
|
+
borderRadius: 16,
|
|
2685
|
+
background: isActive ? "rgba(255, 255, 255, 0.12)" : "transparent",
|
|
2686
|
+
transition: "background 120ms ease"
|
|
2687
|
+
}
|
|
2688
|
+
},
|
|
2689
|
+
onKeyDown: (e) => {
|
|
2690
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
2691
|
+
e.preventDefault();
|
|
2692
|
+
onClick();
|
|
2693
|
+
}
|
|
2694
|
+
},
|
|
2695
|
+
onMouseEnter: (e) => {
|
|
2696
|
+
if (!isActive) e.currentTarget.style.background = "rgba(255, 255, 255, 0.06)";
|
|
2697
|
+
},
|
|
2698
|
+
onMouseLeave: (e) => {
|
|
2699
|
+
if (!isActive) e.currentTarget.style.background = "transparent";
|
|
2700
|
+
}
|
|
2701
|
+
},
|
|
2702
|
+
/* @__PURE__ */ React35.createElement(Text22, { size: "sm", fw: 500 }, label)
|
|
2703
|
+
);
|
|
2704
|
+
}
|
|
2705
|
+
|
|
2706
|
+
// src/core/lib/filterListItems.ts
|
|
2707
|
+
function filterListItems(items, filterOption) {
|
|
2708
|
+
if (!filterOption) return items;
|
|
2709
|
+
const field = filterOption.key;
|
|
2710
|
+
return [...items].filter((item) => {
|
|
2711
|
+
const raw = item?.[field];
|
|
2712
|
+
if (raw === null || raw === void 0) return false;
|
|
2713
|
+
const itemValue = typeof raw === "string" ? raw.trim().toLowerCase() === "true" ? true : raw.trim().toLowerCase() === "false" ? false : raw : raw;
|
|
2714
|
+
return itemValue === filterOption.value;
|
|
2715
|
+
});
|
|
2716
|
+
}
|
|
2717
|
+
|
|
2036
2718
|
// src/mantine/blocks/list/ListBlock.tsx
|
|
2037
|
-
|
|
2038
|
-
var
|
|
2039
|
-
var
|
|
2719
|
+
import { IconArrowDown as IconArrowDown2, IconArrowUp as IconArrowUp2 } from "@tabler/icons-react";
|
|
2720
|
+
var IconSettings = () => /* @__PURE__ */ React36.createElement("span", null, "\u2699\uFE0F");
|
|
2721
|
+
var IconRefresh = () => /* @__PURE__ */ React36.createElement("span", null, "\u{1F504}");
|
|
2722
|
+
var IconAlertCircle = () => /* @__PURE__ */ React36.createElement("span", null, "\u26A0\uFE0F");
|
|
2040
2723
|
var ListBlockContent = ({ block, editor }) => {
|
|
2041
2724
|
const [modalOpened, setModalOpened] = useState6(false);
|
|
2042
2725
|
const [data, setData] = useState6(null);
|
|
2043
2726
|
const [loading, setLoading] = useState6(false);
|
|
2044
2727
|
const [error, setError] = useState6(null);
|
|
2045
2728
|
const [showErrorDetails, setShowErrorDetails] = useState6(false);
|
|
2729
|
+
const [page, setPage] = useState6(1);
|
|
2730
|
+
const [selectionMode, setSelectionMode] = useState6(null);
|
|
2731
|
+
const [totalPages, setTotalPages] = useState6(0);
|
|
2732
|
+
const [selectedIds, setSelectedIds] = useState6(/* @__PURE__ */ new Set());
|
|
2733
|
+
const { editable } = useBlocknoteContext();
|
|
2734
|
+
useEffect6(() => {
|
|
2735
|
+
if (selectionMode === "single" && selectedIds.size > 1) {
|
|
2736
|
+
const arr = Array.from(selectedIds);
|
|
2737
|
+
const lastSelected = arr.length > 0 ? arr[arr.length - 1] : void 0;
|
|
2738
|
+
setSelectedIds(new Set(lastSelected ? [lastSelected] : []));
|
|
2739
|
+
}
|
|
2740
|
+
}, [selectionMode, selectedIds]);
|
|
2741
|
+
const isItemChecked = useCallback8(
|
|
2742
|
+
(id) => {
|
|
2743
|
+
return selectedIds.has(id);
|
|
2744
|
+
},
|
|
2745
|
+
[selectedIds]
|
|
2746
|
+
);
|
|
2747
|
+
const onItemCheck = useCallback8(
|
|
2748
|
+
(id, checked) => {
|
|
2749
|
+
setSelectedIds((prev) => {
|
|
2750
|
+
const nextSelectedIds = new Set(prev);
|
|
2751
|
+
if (selectionMode === "single") {
|
|
2752
|
+
if (checked) {
|
|
2753
|
+
return /* @__PURE__ */ new Set([id]);
|
|
2754
|
+
}
|
|
2755
|
+
nextSelectedIds.delete(id);
|
|
2756
|
+
return nextSelectedIds;
|
|
2757
|
+
}
|
|
2758
|
+
if (checked) {
|
|
2759
|
+
nextSelectedIds.add(id);
|
|
2760
|
+
} else {
|
|
2761
|
+
nextSelectedIds.delete(id);
|
|
2762
|
+
}
|
|
2763
|
+
return nextSelectedIds;
|
|
2764
|
+
});
|
|
2765
|
+
},
|
|
2766
|
+
[selectionMode]
|
|
2767
|
+
);
|
|
2046
2768
|
const handlers = useBlocknoteHandlers();
|
|
2047
2769
|
const listType = block.props.listType && block.props.listType !== "" ? block.props.listType : null;
|
|
2048
2770
|
const listConfig = useMemo6(() => {
|
|
@@ -2056,6 +2778,50 @@ var ListBlockContent = ({ block, editor }) => {
|
|
|
2056
2778
|
}
|
|
2057
2779
|
return {};
|
|
2058
2780
|
}, [block.props.listConfig]);
|
|
2781
|
+
const listSortConfigOptions = useMemo6(() => {
|
|
2782
|
+
if (block.props.sortOptions && block.props.sortOptions !== "{}") {
|
|
2783
|
+
try {
|
|
2784
|
+
return JSON.parse(block.props.sortOptions);
|
|
2785
|
+
} catch (error2) {
|
|
2786
|
+
console.error("Failed to parse listSortConfigOptions:", error2);
|
|
2787
|
+
return {};
|
|
2788
|
+
}
|
|
2789
|
+
}
|
|
2790
|
+
return {};
|
|
2791
|
+
}, [block.props.sortOptions]);
|
|
2792
|
+
const listFilterConfigOptions = useMemo6(() => {
|
|
2793
|
+
if (block.props.filterOptions && block.props.filterOptions !== "{}") {
|
|
2794
|
+
try {
|
|
2795
|
+
return JSON.parse(block.props.filterOptions);
|
|
2796
|
+
} catch (error2) {
|
|
2797
|
+
console.error("Failed to parse listSortConfigOptions:", error2);
|
|
2798
|
+
return {};
|
|
2799
|
+
}
|
|
2800
|
+
}
|
|
2801
|
+
return {};
|
|
2802
|
+
}, [block.props.filterOptions]);
|
|
2803
|
+
const listFilterConfig = useMemo6(() => {
|
|
2804
|
+
if (block.props.filter && block.props.filter !== "{}") {
|
|
2805
|
+
try {
|
|
2806
|
+
return JSON.parse(block.props.filter);
|
|
2807
|
+
} catch (error2) {
|
|
2808
|
+
console.error("Failed to parse listSortConfigOptions:", error2);
|
|
2809
|
+
return {};
|
|
2810
|
+
}
|
|
2811
|
+
}
|
|
2812
|
+
return {};
|
|
2813
|
+
}, [block.props.filter]);
|
|
2814
|
+
const listSortConfig = useMemo6(() => {
|
|
2815
|
+
if (block.props.sort && block.props.sort !== "{}") {
|
|
2816
|
+
try {
|
|
2817
|
+
return JSON.parse(block.props.sort);
|
|
2818
|
+
} catch (error2) {
|
|
2819
|
+
console.error("Failed to parse listSortConfig:", error2);
|
|
2820
|
+
return {};
|
|
2821
|
+
}
|
|
2822
|
+
}
|
|
2823
|
+
return {};
|
|
2824
|
+
}, [block.props.sort]);
|
|
2059
2825
|
const updateProps = (props) => {
|
|
2060
2826
|
editor.updateBlock(block, {
|
|
2061
2827
|
props: {
|
|
@@ -2078,13 +2844,55 @@ var ListBlockContent = ({ block, editor }) => {
|
|
|
2078
2844
|
break;
|
|
2079
2845
|
case "assets":
|
|
2080
2846
|
if (!listConfig.collectionDid) throw new Error("Collection DID is required");
|
|
2081
|
-
result = await handlers.getAssets(listConfig.collectionDid);
|
|
2082
|
-
setData({ items: result });
|
|
2847
|
+
result = await handlers.getAssets(listConfig.collectionDid, page);
|
|
2848
|
+
setData({ items: result.data });
|
|
2083
2849
|
break;
|
|
2084
2850
|
case "transactions":
|
|
2085
2851
|
if (!listConfig.address) throw new Error("Address is required");
|
|
2086
|
-
result = await handlers.getTransactions(listConfig.address);
|
|
2087
|
-
|
|
2852
|
+
result = await handlers.getTransactions(listConfig.address, page);
|
|
2853
|
+
setTotalPages(Math.ceil(result.totalCount / DEFAULT_PAGE_SIZE));
|
|
2854
|
+
setData({ items: result.data });
|
|
2855
|
+
break;
|
|
2856
|
+
case "collections":
|
|
2857
|
+
if (!listConfig.relayedNodeDid) throw new Error("Relayer is required");
|
|
2858
|
+
result = await handlers.getCollections(listConfig.relayedNodeDid, page);
|
|
2859
|
+
setData({ items: result.data });
|
|
2860
|
+
break;
|
|
2861
|
+
case "investments":
|
|
2862
|
+
if (!listConfig.relayedNodeDid) throw new Error("Relayer is required");
|
|
2863
|
+
result = await handlers.getInvestments(listConfig.relayedNodeDid, page);
|
|
2864
|
+
setData({ items: result.data });
|
|
2865
|
+
break;
|
|
2866
|
+
case "oracles":
|
|
2867
|
+
if (!listConfig.relayedNodeDid) throw new Error("Relayer is required");
|
|
2868
|
+
result = await handlers.getOracles(listConfig.relayedNodeDid, page);
|
|
2869
|
+
setData({ items: result.data });
|
|
2870
|
+
break;
|
|
2871
|
+
case "pods":
|
|
2872
|
+
if (!listConfig.relayedNodeDid) throw new Error("Relayer is required");
|
|
2873
|
+
result = await handlers.getPODs(listConfig.relayedNodeDid, page);
|
|
2874
|
+
setData({ items: result.data });
|
|
2875
|
+
break;
|
|
2876
|
+
case "proposals":
|
|
2877
|
+
if (!listConfig.relayedNodeDid) throw new Error("Relayer is required");
|
|
2878
|
+
result = await handlers.getProposals(listConfig.relayedNodeDid, page);
|
|
2879
|
+
setData({ items: result.data });
|
|
2880
|
+
break;
|
|
2881
|
+
case "requests":
|
|
2882
|
+
if (!listConfig.relayedNodeDid) throw new Error("Relayer is required");
|
|
2883
|
+
result = await handlers.getRequests(listConfig.relayedNodeDid, page);
|
|
2884
|
+
setData({ items: result.data });
|
|
2885
|
+
break;
|
|
2886
|
+
case "group_members":
|
|
2887
|
+
if (!listConfig.address) throw new Error("Address is required");
|
|
2888
|
+
if (!listConfig.groupCoreAddress) throw new Error("Group Core Address is required");
|
|
2889
|
+
result = await handlers.getMembers(listConfig.address, listConfig.groupCoreAddress, listConfig.withBalance, page);
|
|
2890
|
+
setData({ items: result.data });
|
|
2891
|
+
break;
|
|
2892
|
+
case "validators":
|
|
2893
|
+
if (!listConfig.relayedNodeDid) throw new Error("Relayer is required");
|
|
2894
|
+
result = await handlers.getValidators(listConfig.relayedNodeDid, page);
|
|
2895
|
+
setData({ items: result.data });
|
|
2088
2896
|
break;
|
|
2089
2897
|
default:
|
|
2090
2898
|
throw new Error(`Unknown list type: ${listType}`);
|
|
@@ -2094,48 +2902,112 @@ var ListBlockContent = ({ block, editor }) => {
|
|
|
2094
2902
|
} finally {
|
|
2095
2903
|
setLoading(false);
|
|
2096
2904
|
}
|
|
2097
|
-
}, [handlers, listType, listConfig]);
|
|
2905
|
+
}, [handlers, page, listType, listConfig]);
|
|
2098
2906
|
useEffect6(() => {
|
|
2099
2907
|
if (listType && listConfig) {
|
|
2100
2908
|
console.log("[ListBlockContent] useEffect", listType, listConfig);
|
|
2101
2909
|
fetchData();
|
|
2102
2910
|
}
|
|
2103
|
-
}, [listType, listConfig]);
|
|
2911
|
+
}, [listType, page, listConfig]);
|
|
2104
2912
|
const handleConfigSave = (config) => {
|
|
2105
2913
|
console.log("[ListBlockContent] handleConfigSave", config);
|
|
2106
|
-
updateProps({
|
|
2914
|
+
updateProps({
|
|
2915
|
+
listType: config.type,
|
|
2916
|
+
listConfig: JSON.stringify(config.config),
|
|
2917
|
+
sortOptions: JSON.stringify(config.sortOptions),
|
|
2918
|
+
sort: JSON.stringify(config.sort),
|
|
2919
|
+
filterOptions: JSON.stringify(config.filterOptions),
|
|
2920
|
+
filter: JSON.stringify(config.filter)
|
|
2921
|
+
});
|
|
2107
2922
|
setModalOpened(false);
|
|
2108
2923
|
};
|
|
2924
|
+
const handleFilterChange = (filterOption) => {
|
|
2925
|
+
if (filterOption?.key === listFilterConfig?.key && filterOption?.value === listFilterConfig?.value) {
|
|
2926
|
+
return updateProps({ filter: null });
|
|
2927
|
+
}
|
|
2928
|
+
updateProps({ filter: JSON.stringify(filterOption) });
|
|
2929
|
+
};
|
|
2930
|
+
const handleSortChange = (sortOption) => {
|
|
2931
|
+
if (sortOption?.key === listSortConfig?.key && sortOption?.direction === listSortConfig?.direction) {
|
|
2932
|
+
return updateProps({ sort: null });
|
|
2933
|
+
}
|
|
2934
|
+
updateProps({ sort: JSON.stringify(sortOption) });
|
|
2935
|
+
};
|
|
2936
|
+
const sortedData = useMemo6(() => {
|
|
2937
|
+
if (!data) return null;
|
|
2938
|
+
return sortListItems(data, listSortConfig);
|
|
2939
|
+
}, [data?.items, listSortConfig]);
|
|
2940
|
+
const filteredData = useMemo6(() => {
|
|
2941
|
+
if (!listFilterConfig?.key) return sortedData;
|
|
2942
|
+
if (!sortedData) return null;
|
|
2943
|
+
return filterListItems(sortedData, listFilterConfig);
|
|
2944
|
+
}, [data?.items, sortedData, listFilterConfig]);
|
|
2109
2945
|
const renderListComponent = () => {
|
|
2110
|
-
if (!
|
|
2946
|
+
if (!filteredData || !listType) return null;
|
|
2111
2947
|
console.log("[ListBlockContent] renderListComponent", data, listType);
|
|
2112
2948
|
switch (listType) {
|
|
2113
2949
|
case "linked_resources":
|
|
2114
|
-
return /* @__PURE__ */
|
|
2950
|
+
return /* @__PURE__ */ React36.createElement(LinkedResourcesList, { items: filteredData, config: listConfig, mods: selectionMode, isItemChecked, onItemCheck });
|
|
2115
2951
|
case "assets":
|
|
2116
|
-
return /* @__PURE__ */
|
|
2952
|
+
return /* @__PURE__ */ React36.createElement(AssetsList, { items: filteredData, config: listConfig, mods: selectionMode, isItemChecked, onItemCheck });
|
|
2117
2953
|
case "transactions":
|
|
2118
|
-
return /* @__PURE__ */
|
|
2954
|
+
return /* @__PURE__ */ React36.createElement(TransactionsList, { items: filteredData, config: listConfig, mods: selectionMode, isItemChecked, onItemCheck });
|
|
2955
|
+
case "collections":
|
|
2956
|
+
return /* @__PURE__ */ React36.createElement(CollectionsList, { items: filteredData, mods: selectionMode, isItemChecked, onItemCheck });
|
|
2957
|
+
case "investments":
|
|
2958
|
+
return /* @__PURE__ */ React36.createElement(InvestmentsList, { items: filteredData, mods: selectionMode, isItemChecked, onItemCheck });
|
|
2959
|
+
case "oracles":
|
|
2960
|
+
return /* @__PURE__ */ React36.createElement(OraclesList, { items: filteredData, mods: selectionMode, isItemChecked, onItemCheck });
|
|
2961
|
+
case "pods":
|
|
2962
|
+
return /* @__PURE__ */ React36.createElement(PodsList, { items: filteredData, mods: selectionMode, isItemChecked, onItemCheck });
|
|
2963
|
+
case "proposals":
|
|
2964
|
+
return /* @__PURE__ */ React36.createElement(ProposalsList, { items: filteredData, mods: selectionMode, isItemChecked, onItemCheck });
|
|
2965
|
+
case "requests":
|
|
2966
|
+
return /* @__PURE__ */ React36.createElement(RequestsList, { items: filteredData, mods: selectionMode, isItemChecked, onItemCheck });
|
|
2967
|
+
case "group_members":
|
|
2968
|
+
return /* @__PURE__ */ React36.createElement(MembersList, { items: filteredData, mods: selectionMode, isItemChecked, onItemCheck });
|
|
2969
|
+
case "validators":
|
|
2970
|
+
return /* @__PURE__ */ React36.createElement(ValidatorsList, { items: filteredData, mods: selectionMode, isItemChecked, onItemCheck });
|
|
2119
2971
|
default:
|
|
2120
2972
|
return null;
|
|
2121
2973
|
}
|
|
2122
2974
|
};
|
|
2123
|
-
return /* @__PURE__ */
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2975
|
+
return /* @__PURE__ */ React36.createElement(Stack23, { mih: listType && totalPages !== 0 ? 700 : void 0, w: "100%" }, listType && /* @__PURE__ */ React36.createElement(Flex13, { align: "center", gap: "xs" }, /* @__PURE__ */ React36.createElement(Text23, null, getListNameByType(listType)), listSortConfig?.key && /* @__PURE__ */ React36.createElement(Flex13, { align: "center" }, /* @__PURE__ */ React36.createElement(Text23, { size: "xs", c: "dimmed" }, listSortConfig.key?.replace(/([A-Z])/g, " $1").replace(
|
|
2976
|
+
/^./,
|
|
2977
|
+
(str) => str.toUpperCase()
|
|
2978
|
+
), " "), /* @__PURE__ */ React36.createElement(Text23, { lh: 0.5, c: "dimmed" }, listSortConfig.direction === "asc" && /* @__PURE__ */ React36.createElement(IconArrowUp2, { size: 18 }), listSortConfig.direction === "desc" && /* @__PURE__ */ React36.createElement(IconArrowDown2, { size: 18 }))), selectionMode && /* @__PURE__ */ React36.createElement(Text23, { lh: 0.5, c: "dimmed" }, selectionMode === "single" ? "Single Selection" : "Multi Selection")), /* @__PURE__ */ React36.createElement(Flex13, { justify: listType ? "space-between" : "flex-end" }, /* @__PURE__ */ React36.createElement(Flex13, { gap: "xs", align: "center" }, listType && /* @__PURE__ */ React36.createElement(FilterTab, { key: "All", label: "All", isActive: !listFilterConfig?.key, onClick: () => handleFilterChange(null) }), Array.isArray(listFilterConfigOptions) && listFilterConfigOptions.length > 0 && listFilterConfigOptions.map(({ key, label, type }) => /* @__PURE__ */ React36.createElement(
|
|
2979
|
+
FilterTab,
|
|
2980
|
+
{
|
|
2981
|
+
key: label,
|
|
2982
|
+
label,
|
|
2983
|
+
isActive: listFilterConfig?.key === key && listFilterConfig?.value === type,
|
|
2984
|
+
onClick: () => handleFilterChange({ key, value: type })
|
|
2985
|
+
}
|
|
2986
|
+
))), /* @__PURE__ */ React36.createElement(Flex13, { gap: "xs" }, listType && editable && /* @__PURE__ */ React36.createElement(ActionIcon3, { variant: "subtle", size: "sm", onClick: fetchData, loading }, /* @__PURE__ */ React36.createElement(IconRefresh, null)), editable && /* @__PURE__ */ React36.createElement(ActionIcon3, { variant: "subtle", size: "sm", onClick: () => setModalOpened(true) }, /* @__PURE__ */ React36.createElement(IconSettings, null)), listType && listConfig && listSortConfigOptions && listSortConfigOptions?.length > 0 && /* @__PURE__ */ React36.createElement(
|
|
2987
|
+
ListActionsMenu,
|
|
2988
|
+
{
|
|
2989
|
+
onSelectActionClick: (mode) => setSelectionMode(mode),
|
|
2990
|
+
selectionMode,
|
|
2991
|
+
options: listSortConfigOptions,
|
|
2992
|
+
value: listSortConfig,
|
|
2993
|
+
onChange: (sortOption) => handleSortChange(sortOption)
|
|
2994
|
+
}
|
|
2995
|
+
))), /* @__PURE__ */ React36.createElement(Flex13, { flex: 1 }, !listType ? /* @__PURE__ */ React36.createElement(Center2, { py: "xl" }, /* @__PURE__ */ React36.createElement(Stack23, { align: "center", gap: "sm" }, /* @__PURE__ */ React36.createElement(Text23, { size: "sm", c: "dimmed", ta: "center" }, "No list type configured"), /* @__PURE__ */ React36.createElement(Button8, { size: "sm", variant: "light", onClick: () => setModalOpened(true) }, "Configure List"))) : loading ? /* @__PURE__ */ React36.createElement(Center2, { py: "xl", w: "100%" }, /* @__PURE__ */ React36.createElement(Loader2, { size: "md", mx: "auto" })) : error ? /* @__PURE__ */ React36.createElement(Alert4, { color: "red", title: "Failed to load data", icon: /* @__PURE__ */ React36.createElement(IconAlertCircle, null) }, /* @__PURE__ */ React36.createElement(Stack23, { gap: "xs" }, /* @__PURE__ */ React36.createElement(Text23, { size: "sm" }, showErrorDetails ? error : "Unable to fetch list data"), /* @__PURE__ */ React36.createElement(Group8, { gap: "xs" }, /* @__PURE__ */ React36.createElement(Button8, { size: "xs", variant: "subtle", onClick: fetchData }, "Retry"), /* @__PURE__ */ React36.createElement(Button8, { size: "xs", variant: "subtle", onClick: () => setShowErrorDetails(!showErrorDetails) }, showErrorDetails ? "Hide" : "Show", " Details")))) : /* @__PURE__ */ React36.createElement(Stack23, { gap: "md", flex: 1 }, renderListComponent(), /* @__PURE__ */ React36.createElement(
|
|
2996
|
+
ListPagination,
|
|
2997
|
+
{
|
|
2998
|
+
page,
|
|
2999
|
+
setPage: (page2) => {
|
|
3000
|
+
setPage(page2);
|
|
3001
|
+
},
|
|
3002
|
+
totalPages
|
|
3003
|
+
}
|
|
3004
|
+
))), /* @__PURE__ */ React36.createElement(
|
|
2133
3005
|
ListConfigModal,
|
|
2134
3006
|
{
|
|
2135
3007
|
opened: modalOpened,
|
|
2136
3008
|
onClose: () => setModalOpened(false),
|
|
2137
3009
|
onSave: handleConfigSave,
|
|
2138
|
-
initialConfig: listType && listConfig ? { type: listType, config: listConfig } : null
|
|
3010
|
+
initialConfig: listType && listConfig ? { type: listType, config: listConfig, sort: null, filter: null, filterOptions: listFilterConfigOptions, sortOptions: listSortConfigOptions } : null
|
|
2139
3011
|
}
|
|
2140
3012
|
));
|
|
2141
3013
|
};
|
|
@@ -2143,12 +3015,21 @@ var ListBlock = createReactBlockSpec2(
|
|
|
2143
3015
|
{
|
|
2144
3016
|
type: "list",
|
|
2145
3017
|
propSchema: {
|
|
2146
|
-
// title: {
|
|
2147
|
-
// default: '',
|
|
2148
|
-
// },
|
|
2149
3018
|
listType: {
|
|
2150
3019
|
default: ""
|
|
2151
3020
|
},
|
|
3021
|
+
sort: {
|
|
3022
|
+
default: "{}"
|
|
3023
|
+
},
|
|
3024
|
+
filter: {
|
|
3025
|
+
default: "{}"
|
|
3026
|
+
},
|
|
3027
|
+
filterOptions: {
|
|
3028
|
+
default: "{}"
|
|
3029
|
+
},
|
|
3030
|
+
sortOptions: {
|
|
3031
|
+
default: "{}"
|
|
3032
|
+
},
|
|
2152
3033
|
listConfig: {
|
|
2153
3034
|
default: "{}"
|
|
2154
3035
|
}
|
|
@@ -2156,15 +3037,15 @@ var ListBlock = createReactBlockSpec2(
|
|
|
2156
3037
|
content: "none"
|
|
2157
3038
|
},
|
|
2158
3039
|
{
|
|
2159
|
-
render: (props) => /* @__PURE__ */
|
|
3040
|
+
render: (props) => /* @__PURE__ */ React36.createElement(ListBlockContent, { ...props })
|
|
2160
3041
|
}
|
|
2161
3042
|
);
|
|
2162
3043
|
|
|
2163
3044
|
// src/mantine/blocks/overview/OverviewBlock.tsx
|
|
2164
|
-
import
|
|
3045
|
+
import React37 from "react";
|
|
2165
3046
|
import { createReactBlockSpec as createReactBlockSpec3 } from "@blocknote/react";
|
|
2166
3047
|
var OverviewBlockContent = ({ block, editor }) => {
|
|
2167
|
-
return /* @__PURE__ */
|
|
3048
|
+
return /* @__PURE__ */ React37.createElement(
|
|
2168
3049
|
"div",
|
|
2169
3050
|
{
|
|
2170
3051
|
style: {
|
|
@@ -2176,7 +3057,7 @@ var OverviewBlockContent = ({ block, editor }) => {
|
|
|
2176
3057
|
border: "1px solid #e5e7eb"
|
|
2177
3058
|
}
|
|
2178
3059
|
},
|
|
2179
|
-
/* @__PURE__ */
|
|
3060
|
+
/* @__PURE__ */ React37.createElement("div", { style: { marginBottom: "12px" } }, /* @__PURE__ */ React37.createElement(
|
|
2180
3061
|
"input",
|
|
2181
3062
|
{
|
|
2182
3063
|
type: "text",
|
|
@@ -2202,7 +3083,7 @@ var OverviewBlockContent = ({ block, editor }) => {
|
|
|
2202
3083
|
}
|
|
2203
3084
|
}
|
|
2204
3085
|
)),
|
|
2205
|
-
/* @__PURE__ */
|
|
3086
|
+
/* @__PURE__ */ React37.createElement("div", { style: { minHeight: "40px", color: "#6b7280" } }, block.props.did ? /* @__PURE__ */ React37.createElement("p", null, "Loading overview for DID: ", block.props.did) : /* @__PURE__ */ React37.createElement("p", null, "Enter a DID to load overview data"))
|
|
2206
3087
|
);
|
|
2207
3088
|
};
|
|
2208
3089
|
var OverviewBlock = createReactBlockSpec3(
|
|
@@ -2216,7 +3097,7 @@ var OverviewBlock = createReactBlockSpec3(
|
|
|
2216
3097
|
content: "none"
|
|
2217
3098
|
},
|
|
2218
3099
|
{
|
|
2219
|
-
render: (props) => /* @__PURE__ */
|
|
3100
|
+
render: (props) => /* @__PURE__ */ React37.createElement(OverviewBlockContent, { ...props })
|
|
2220
3101
|
}
|
|
2221
3102
|
);
|
|
2222
3103
|
|
|
@@ -2244,11 +3125,7 @@ var ValidatorActionType = /* @__PURE__ */ ((ValidatorActionType2) => {
|
|
|
2244
3125
|
|
|
2245
3126
|
// src/mantine/context/hooks/useSharedProposal.ts
|
|
2246
3127
|
import { useState as useState7, useEffect as useEffect7, useCallback as useCallback9 } from "react";
|
|
2247
|
-
var useSharedProposal = ({
|
|
2248
|
-
proposalId,
|
|
2249
|
-
contractAddress,
|
|
2250
|
-
autoFetch = true
|
|
2251
|
-
}) => {
|
|
3128
|
+
var useSharedProposal = ({ proposalId, contractAddress, autoFetch = true }) => {
|
|
2252
3129
|
const { sharedProposals, fetchSharedProposal, invalidateProposal, subscribeToProposal } = useBlocknoteContext();
|
|
2253
3130
|
const [localProposal, setLocalProposal] = useState7(null);
|
|
2254
3131
|
const cacheKey = `${contractAddress}:${proposalId}`;
|
|
@@ -2264,14 +3141,8 @@ var useSharedProposal = ({
|
|
|
2264
3141
|
setLocalProposal(proposal);
|
|
2265
3142
|
}
|
|
2266
3143
|
}, [subscribeToProposal, cacheKey]);
|
|
2267
|
-
const refetch = useCallback9(
|
|
2268
|
-
|
|
2269
|
-
[fetchSharedProposal, proposalId, contractAddress]
|
|
2270
|
-
);
|
|
2271
|
-
const invalidate = useCallback9(
|
|
2272
|
-
() => invalidateProposal(proposalId),
|
|
2273
|
-
[invalidateProposal, proposalId]
|
|
2274
|
-
);
|
|
3144
|
+
const refetch = useCallback9(() => fetchSharedProposal(proposalId, contractAddress, true), [fetchSharedProposal, proposalId, contractAddress]);
|
|
3145
|
+
const invalidate = useCallback9(() => invalidateProposal(proposalId), [invalidateProposal, proposalId]);
|
|
2275
3146
|
return {
|
|
2276
3147
|
proposal: localProposal,
|
|
2277
3148
|
loading: sharedProposals[cacheKey]?.loading ?? false,
|
|
@@ -2282,22 +3153,22 @@ var useSharedProposal = ({
|
|
|
2282
3153
|
};
|
|
2283
3154
|
|
|
2284
3155
|
// src/mantine/blocks/proposalVote/ProposalVoteBlockSpec.tsx
|
|
2285
|
-
import
|
|
3156
|
+
import React45 from "react";
|
|
2286
3157
|
import { createReactBlockSpec as createReactBlockSpec4 } from "@blocknote/react";
|
|
2287
3158
|
|
|
2288
3159
|
// src/mantine/blocks/proposalVote/ProposalVoteBlock.tsx
|
|
2289
|
-
import
|
|
3160
|
+
import React44 from "react";
|
|
2290
3161
|
|
|
2291
3162
|
// src/mantine/blocks/proposalVote/template/TemplateView.tsx
|
|
2292
|
-
import
|
|
3163
|
+
import React40, { useMemo as useMemo8 } from "react";
|
|
2293
3164
|
|
|
2294
3165
|
// src/mantine/blocks/proposalVote/template/TemplateConfig.tsx
|
|
2295
|
-
import
|
|
3166
|
+
import React39, { useCallback as useCallback10, useState as useState9 } from "react";
|
|
2296
3167
|
import { Paper as Paper2, CloseButton as CloseButton2, Title as Title2 } from "@mantine/core";
|
|
2297
3168
|
|
|
2298
3169
|
// src/mantine/blocks/proposalVote/template/GeneralTab.tsx
|
|
2299
|
-
import
|
|
2300
|
-
import { Stack as
|
|
3170
|
+
import React38, { useState as useState8, useEffect as useEffect8, useMemo as useMemo7 } from "react";
|
|
3171
|
+
import { Stack as Stack24, Text as Text24, Group as Group9, Card as Card5, Button as Button9, Select as Select3 } from "@mantine/core";
|
|
2301
3172
|
|
|
2302
3173
|
// src/mantine/blocks/stores/dependencyHelpers.ts
|
|
2303
3174
|
function getDependencies(block) {
|
|
@@ -2432,8 +3303,8 @@ var GeneralTab2 = ({ block, editor, proposal }) => {
|
|
|
2432
3303
|
});
|
|
2433
3304
|
}
|
|
2434
3305
|
};
|
|
2435
|
-
return /* @__PURE__ */
|
|
2436
|
-
|
|
3306
|
+
return /* @__PURE__ */ React38.createElement(Stack24, { gap: "lg" }, blockSupportsDependencies && showDependencyDropdown && /* @__PURE__ */ React38.createElement(Stack24, { gap: "md" }, /* @__PURE__ */ React38.createElement(
|
|
3307
|
+
Card5,
|
|
2437
3308
|
{
|
|
2438
3309
|
padding: "md",
|
|
2439
3310
|
radius: "md",
|
|
@@ -2443,9 +3314,9 @@ var GeneralTab2 = ({ block, editor, proposal }) => {
|
|
|
2443
3314
|
color: "#f1f3f5"
|
|
2444
3315
|
}
|
|
2445
3316
|
},
|
|
2446
|
-
/* @__PURE__ */
|
|
2447
|
-
/* @__PURE__ */
|
|
2448
|
-
), /* @__PURE__ */
|
|
3317
|
+
/* @__PURE__ */ React38.createElement(Text24, { size: "sm", fw: 500, style: { color: "#ffd43b" } }, "\u26A0\uFE0F No Proposal Connected"),
|
|
3318
|
+
/* @__PURE__ */ React38.createElement(Text24, { size: "xs", style: { color: "#adb5bd", marginTop: 4 } }, "Please select a proposal block to connect this vote to.")
|
|
3319
|
+
), /* @__PURE__ */ React38.createElement(Text24, { size: "sm", fw: 500, style: { color: "#adb5bd" } }, "Select Proposal to Vote On"), /* @__PURE__ */ React38.createElement(
|
|
2449
3320
|
Select3,
|
|
2450
3321
|
{
|
|
2451
3322
|
value: selectedDependency,
|
|
@@ -2480,7 +3351,7 @@ var GeneralTab2 = ({ block, editor, proposal }) => {
|
|
|
2480
3351
|
}
|
|
2481
3352
|
}
|
|
2482
3353
|
}
|
|
2483
|
-
), availableBlocks.length === 0 && /* @__PURE__ */
|
|
3354
|
+
), availableBlocks.length === 0 && /* @__PURE__ */ React38.createElement(Text24, { size: "xs", style: { color: "#868e96" } }, "No proposals available. Create a proposal first.")), blockSupportsDependencies && hasDependency && /* @__PURE__ */ React38.createElement(Stack24, { gap: "md" }, /* @__PURE__ */ React38.createElement(Group9, { justify: "space-between", align: "center" }, /* @__PURE__ */ React38.createElement(Text24, { size: "sm", fw: 500, style: { color: "#adb5bd" } }, "Connected Proposal"), /* @__PURE__ */ React38.createElement(
|
|
2484
3355
|
Button9,
|
|
2485
3356
|
{
|
|
2486
3357
|
variant: "subtle",
|
|
@@ -2489,15 +3360,15 @@ var GeneralTab2 = ({ block, editor, proposal }) => {
|
|
|
2489
3360
|
onClick: () => handleUpdateDependency(null)
|
|
2490
3361
|
},
|
|
2491
3362
|
"Disconnect"
|
|
2492
|
-
)), /* @__PURE__ */
|
|
2493
|
-
|
|
3363
|
+
)), /* @__PURE__ */ React38.createElement(
|
|
3364
|
+
Card5,
|
|
2494
3365
|
{
|
|
2495
3366
|
padding: "sm",
|
|
2496
3367
|
radius: "md",
|
|
2497
3368
|
style: { backgroundColor: "#2a2a2a", border: "1px solid #333" }
|
|
2498
3369
|
},
|
|
2499
|
-
/* @__PURE__ */
|
|
2500
|
-
proposal?.proposal?.description && /* @__PURE__ */
|
|
3370
|
+
/* @__PURE__ */ React38.createElement(Text24, { size: "sm", fw: 500, style: { color: "#f1f3f5" } }, proposal?.proposal?.title || "Connected Proposal"),
|
|
3371
|
+
proposal?.proposal?.description && /* @__PURE__ */ React38.createElement(Text24, { size: "xs", style: { color: "#adb5bd" } }, proposal.proposal.description)
|
|
2501
3372
|
)));
|
|
2502
3373
|
};
|
|
2503
3374
|
|
|
@@ -2531,7 +3402,7 @@ var TemplateConfig2 = ({ editor, block }) => {
|
|
|
2531
3402
|
autoFetch: false
|
|
2532
3403
|
// Don't auto-fetch in template mode
|
|
2533
3404
|
});
|
|
2534
|
-
return /* @__PURE__ */
|
|
3405
|
+
return /* @__PURE__ */ React39.createElement(
|
|
2535
3406
|
Paper2,
|
|
2536
3407
|
{
|
|
2537
3408
|
p: "md",
|
|
@@ -2542,7 +3413,7 @@ var TemplateConfig2 = ({ editor, block }) => {
|
|
|
2542
3413
|
flexDirection: "column"
|
|
2543
3414
|
}
|
|
2544
3415
|
},
|
|
2545
|
-
/* @__PURE__ */
|
|
3416
|
+
/* @__PURE__ */ React39.createElement(
|
|
2546
3417
|
"div",
|
|
2547
3418
|
{
|
|
2548
3419
|
style: {
|
|
@@ -2552,17 +3423,17 @@ var TemplateConfig2 = ({ editor, block }) => {
|
|
|
2552
3423
|
marginBottom: "1rem"
|
|
2553
3424
|
}
|
|
2554
3425
|
},
|
|
2555
|
-
/* @__PURE__ */
|
|
2556
|
-
/* @__PURE__ */
|
|
3426
|
+
/* @__PURE__ */ React39.createElement(Title2, { order: 3 }, "Proposal Vote Settings"),
|
|
3427
|
+
/* @__PURE__ */ React39.createElement(CloseButton2, { onClick: closePanel })
|
|
2557
3428
|
),
|
|
2558
|
-
/* @__PURE__ */
|
|
3429
|
+
/* @__PURE__ */ React39.createElement(
|
|
2559
3430
|
ReusablePanel,
|
|
2560
3431
|
{
|
|
2561
3432
|
extraTabs: [
|
|
2562
3433
|
{
|
|
2563
3434
|
label: "General",
|
|
2564
3435
|
value: "general",
|
|
2565
|
-
content: /* @__PURE__ */
|
|
3436
|
+
content: /* @__PURE__ */ React39.createElement(
|
|
2566
3437
|
GeneralTab2,
|
|
2567
3438
|
{
|
|
2568
3439
|
block,
|
|
@@ -2581,7 +3452,7 @@ var TemplateConfig2 = ({ editor, block }) => {
|
|
|
2581
3452
|
};
|
|
2582
3453
|
|
|
2583
3454
|
// src/mantine/blocks/proposalVote/template/TemplateView.tsx
|
|
2584
|
-
import { Card as
|
|
3455
|
+
import { Card as Card6, Group as Group10, Stack as Stack25, Text as Text25, ActionIcon as ActionIcon4, Badge as Badge4 } from "@mantine/core";
|
|
2585
3456
|
var PROPOSAL_VOTE_TEMPLATE_PANEL_ID = "proposal-vote-template-panel";
|
|
2586
3457
|
var getStatusColor = (status) => {
|
|
2587
3458
|
switch (status) {
|
|
@@ -2602,12 +3473,12 @@ var getStatusColor = (status) => {
|
|
|
2602
3473
|
var ProposalVoteTemplateView = ({ editor, block }) => {
|
|
2603
3474
|
const panelId = `${PROPOSAL_VOTE_TEMPLATE_PANEL_ID}-${block.id}`;
|
|
2604
3475
|
const panelContent = useMemo8(
|
|
2605
|
-
() => /* @__PURE__ */
|
|
3476
|
+
() => /* @__PURE__ */ React40.createElement(TemplateConfig2, { editor, block }),
|
|
2606
3477
|
[editor, block]
|
|
2607
3478
|
);
|
|
2608
3479
|
const { open } = usePanel(panelId, panelContent);
|
|
2609
|
-
return /* @__PURE__ */
|
|
2610
|
-
|
|
3480
|
+
return /* @__PURE__ */ React40.createElement(
|
|
3481
|
+
Card6,
|
|
2611
3482
|
{
|
|
2612
3483
|
withBorder: true,
|
|
2613
3484
|
padding: "md",
|
|
@@ -2615,20 +3486,20 @@ var ProposalVoteTemplateView = ({ editor, block }) => {
|
|
|
2615
3486
|
style: { width: "100%", cursor: "pointer" },
|
|
2616
3487
|
onClick: open
|
|
2617
3488
|
},
|
|
2618
|
-
/* @__PURE__ */
|
|
3489
|
+
/* @__PURE__ */ React40.createElement(Group10, { wrap: "nowrap", justify: "space-between", align: "center" }, /* @__PURE__ */ React40.createElement(Group10, { wrap: "nowrap", align: "center" }, /* @__PURE__ */ React40.createElement(ActionIcon4, { variant: "light", color: "blue", size: "lg", radius: "xl", style: { flexShrink: 0 } }, getIcon(block.props.icon, 18, 1.5, "checklist")), /* @__PURE__ */ React40.createElement(Stack25, { gap: "xs", style: { flex: 1 } }, /* @__PURE__ */ React40.createElement(Text25, { fw: 500, size: "sm", contentEditable: false }, block.props.title || "Proposal Vote"), /* @__PURE__ */ React40.createElement(Text25, { size: "xs", c: "dimmed", contentEditable: false }, block.props.subtitle || "Cast your vote"))), /* @__PURE__ */ React40.createElement(Badge4, { color: getStatusColor(block.props.status || "open"), variant: "filled", size: "sm" }, (block.props.status || "open").toUpperCase()))
|
|
2619
3490
|
);
|
|
2620
3491
|
};
|
|
2621
3492
|
|
|
2622
3493
|
// src/mantine/blocks/proposalVote/flow/FlowView.tsx
|
|
2623
|
-
import
|
|
3494
|
+
import React43, { useMemo as useMemo12 } from "react";
|
|
2624
3495
|
|
|
2625
3496
|
// src/mantine/blocks/proposalVote/flow/FlowConfig.tsx
|
|
2626
|
-
import
|
|
3497
|
+
import React42 from "react";
|
|
2627
3498
|
import { Paper as Paper3, CloseButton as CloseButton3, Title as Title3 } from "@mantine/core";
|
|
2628
3499
|
|
|
2629
3500
|
// src/mantine/blocks/proposalVote/flow/GeneralTab.tsx
|
|
2630
|
-
import
|
|
2631
|
-
import { Stack as
|
|
3501
|
+
import React41, { useState as useState10 } from "react";
|
|
3502
|
+
import { Stack as Stack26, Text as Text26, Group as Group11, Card as Card7, Button as Button10, Progress as Progress2, Box as Box14, Textarea as Textarea2, Tooltip as Tooltip3 } from "@mantine/core";
|
|
2632
3503
|
var calculateTimeRemaining = (proposal) => {
|
|
2633
3504
|
if (!proposal?.proposal.expiration || "never" in proposal.proposal.expiration) {
|
|
2634
3505
|
return "Never expires";
|
|
@@ -2704,8 +3575,8 @@ var FlowGeneralTab = ({
|
|
|
2704
3575
|
}
|
|
2705
3576
|
};
|
|
2706
3577
|
const hasDependency = Boolean(proposal);
|
|
2707
|
-
return /* @__PURE__ */
|
|
2708
|
-
|
|
3578
|
+
return /* @__PURE__ */ React41.createElement(Stack26, { gap: "lg" }, !hasSubmittedProposal && /* @__PURE__ */ React41.createElement(
|
|
3579
|
+
Card7,
|
|
2709
3580
|
{
|
|
2710
3581
|
padding: "md",
|
|
2711
3582
|
radius: "md",
|
|
@@ -2715,8 +3586,8 @@ var FlowGeneralTab = ({
|
|
|
2715
3586
|
color: "#f1f3f5"
|
|
2716
3587
|
}
|
|
2717
3588
|
},
|
|
2718
|
-
/* @__PURE__ */
|
|
2719
|
-
|
|
3589
|
+
/* @__PURE__ */ React41.createElement(Group11, { gap: "xs", align: "center" }, /* @__PURE__ */ React41.createElement(
|
|
3590
|
+
Box14,
|
|
2720
3591
|
{
|
|
2721
3592
|
style: {
|
|
2722
3593
|
width: 8,
|
|
@@ -2725,10 +3596,10 @@ var FlowGeneralTab = ({
|
|
|
2725
3596
|
borderRadius: "50%"
|
|
2726
3597
|
}
|
|
2727
3598
|
}
|
|
2728
|
-
), /* @__PURE__ */
|
|
2729
|
-
/* @__PURE__ */
|
|
2730
|
-
), /* @__PURE__ */
|
|
2731
|
-
|
|
3599
|
+
), /* @__PURE__ */ React41.createElement(Text26, { size: "sm", fw: 500, style: { color: "#ffd43b" } }, "Waiting for Proposal Submission")),
|
|
3600
|
+
/* @__PURE__ */ React41.createElement(Text26, { size: "xs", style: { color: "#adb5bd", marginTop: 4 } }, "The connected proposal needs to be submitted before voting can begin.")
|
|
3601
|
+
), /* @__PURE__ */ React41.createElement(
|
|
3602
|
+
Card7,
|
|
2732
3603
|
{
|
|
2733
3604
|
padding: "lg",
|
|
2734
3605
|
radius: "md",
|
|
@@ -2739,8 +3610,8 @@ var FlowGeneralTab = ({
|
|
|
2739
3610
|
opacity: !hasSubmittedProposal ? 0.6 : 1
|
|
2740
3611
|
}
|
|
2741
3612
|
},
|
|
2742
|
-
/* @__PURE__ */
|
|
2743
|
-
|
|
3613
|
+
/* @__PURE__ */ React41.createElement(Stack26, { gap: "xs" }, /* @__PURE__ */ React41.createElement(Group11, { justify: "space-between" }, /* @__PURE__ */ React41.createElement(Group11, { gap: "xs" }, /* @__PURE__ */ React41.createElement(
|
|
3614
|
+
Box14,
|
|
2744
3615
|
{
|
|
2745
3616
|
w: 8,
|
|
2746
3617
|
h: 8,
|
|
@@ -2749,8 +3620,8 @@ var FlowGeneralTab = ({
|
|
|
2749
3620
|
borderRadius: "50%"
|
|
2750
3621
|
}
|
|
2751
3622
|
}
|
|
2752
|
-
), /* @__PURE__ */
|
|
2753
|
-
|
|
3623
|
+
), /* @__PURE__ */ React41.createElement(Text26, { size: "sm", style: { color: "#adb5bd" } }, "Status")), /* @__PURE__ */ React41.createElement(Text26, { size: "sm", fw: 500, style: { color: "#f1f3f5" } }, hasSubmittedProposal ? proposal?.proposal.status === "open" ? "Active" : proposal?.proposal.status || "Active" : "Waiting")), /* @__PURE__ */ React41.createElement(Group11, { justify: "space-between" }, /* @__PURE__ */ React41.createElement(Group11, { gap: "xs" }, /* @__PURE__ */ React41.createElement(Box14, { w: 8, h: 8, style: { backgroundColor: "#adb5bd", borderRadius: "50%" } }), /* @__PURE__ */ React41.createElement(Text26, { size: "sm", style: { color: "#adb5bd" } }, "Ends in")), /* @__PURE__ */ React41.createElement(Text26, { size: "sm", fw: 500, style: { color: "#f1f3f5" } }, hasSubmittedProposal ? calculateTimeRemaining(proposal) : "TBD")), /* @__PURE__ */ React41.createElement(Group11, { justify: "space-between" }, /* @__PURE__ */ React41.createElement(Group11, { gap: "xs" }, /* @__PURE__ */ React41.createElement(Box14, { w: 8, h: 8, style: { backgroundColor: "#adb5bd", borderRadius: "50%" } }), /* @__PURE__ */ React41.createElement(Text26, { size: "sm", style: { color: "#adb5bd" } }, "Outcome")), /* @__PURE__ */ React41.createElement(
|
|
3624
|
+
Text26,
|
|
2754
3625
|
{
|
|
2755
3626
|
size: "sm",
|
|
2756
3627
|
fw: 500,
|
|
@@ -2759,9 +3630,9 @@ var FlowGeneralTab = ({
|
|
|
2759
3630
|
}
|
|
2760
3631
|
},
|
|
2761
3632
|
hasSubmittedProposal ? calculateOutcome(proposal) : "N/A"
|
|
2762
|
-
)), /* @__PURE__ */
|
|
2763
|
-
/* @__PURE__ */
|
|
2764
|
-
|
|
3633
|
+
)), /* @__PURE__ */ React41.createElement(Group11, { justify: "space-between" }, /* @__PURE__ */ React41.createElement(Group11, { gap: "xs" }, /* @__PURE__ */ React41.createElement(Box14, { w: 8, h: 8, style: { backgroundColor: "#adb5bd", borderRadius: "50%" } }), /* @__PURE__ */ React41.createElement(Text26, { size: "sm", style: { color: "#adb5bd" } }, "My Vote")), /* @__PURE__ */ React41.createElement(Text26, { size: "sm", fw: 500, style: { color: "#f1f3f5" } }, hasSubmittedProposal ? userVote?.vote ? userVote.vote.vote : "Pending" : "N/A"))),
|
|
3634
|
+
/* @__PURE__ */ React41.createElement(Stack26, { gap: "xs" }, /* @__PURE__ */ React41.createElement(Text26, { size: "sm", style: { color: "#adb5bd" } }, hasSubmittedProposal ? "Voting is open" : "Voting pending"), /* @__PURE__ */ React41.createElement(
|
|
3635
|
+
Progress2,
|
|
2765
3636
|
{
|
|
2766
3637
|
value: hasSubmittedProposal ? 75 : 0,
|
|
2767
3638
|
size: "md",
|
|
@@ -2773,8 +3644,8 @@ var FlowGeneralTab = ({
|
|
|
2773
3644
|
}
|
|
2774
3645
|
}
|
|
2775
3646
|
))
|
|
2776
|
-
), hasDependency && hasSubmittedProposal && (status === "open" || proposal?.proposal.status === "open") && /* @__PURE__ */
|
|
2777
|
-
|
|
3647
|
+
), hasDependency && hasSubmittedProposal && (status === "open" || proposal?.proposal.status === "open") && /* @__PURE__ */ React41.createElement(Stack26, { gap: "lg" }, disabled && isDisabled?.message && /* @__PURE__ */ React41.createElement(
|
|
3648
|
+
Card7,
|
|
2778
3649
|
{
|
|
2779
3650
|
padding: "md",
|
|
2780
3651
|
radius: "md",
|
|
@@ -2784,8 +3655,8 @@ var FlowGeneralTab = ({
|
|
|
2784
3655
|
color: "#f1f3f5"
|
|
2785
3656
|
}
|
|
2786
3657
|
},
|
|
2787
|
-
/* @__PURE__ */
|
|
2788
|
-
|
|
3658
|
+
/* @__PURE__ */ React41.createElement(Group11, { gap: "xs", align: "center" }, /* @__PURE__ */ React41.createElement(
|
|
3659
|
+
Box14,
|
|
2789
3660
|
{
|
|
2790
3661
|
style: {
|
|
2791
3662
|
width: 8,
|
|
@@ -2794,8 +3665,8 @@ var FlowGeneralTab = ({
|
|
|
2794
3665
|
borderRadius: "50%"
|
|
2795
3666
|
}
|
|
2796
3667
|
}
|
|
2797
|
-
), /* @__PURE__ */
|
|
2798
|
-
), /* @__PURE__ */
|
|
3668
|
+
), /* @__PURE__ */ React41.createElement(Text26, { size: "sm", fw: 500, style: { color: "#ffd43b" } }, isDisabled.message))
|
|
3669
|
+
), /* @__PURE__ */ React41.createElement(Stack26, { gap: "md" }, ["yes", "no", "no_with_veto", "abstain"].map((voteType) => /* @__PURE__ */ React41.createElement(
|
|
2799
3670
|
Tooltip3,
|
|
2800
3671
|
{
|
|
2801
3672
|
key: voteType,
|
|
@@ -2803,7 +3674,7 @@ var FlowGeneralTab = ({
|
|
|
2803
3674
|
disabled: !disabled,
|
|
2804
3675
|
position: "top"
|
|
2805
3676
|
},
|
|
2806
|
-
/* @__PURE__ */
|
|
3677
|
+
/* @__PURE__ */ React41.createElement(
|
|
2807
3678
|
Button10,
|
|
2808
3679
|
{
|
|
2809
3680
|
variant: "outline",
|
|
@@ -2822,9 +3693,9 @@ var FlowGeneralTab = ({
|
|
|
2822
3693
|
opacity: disabled ? 0.5 : 1
|
|
2823
3694
|
}
|
|
2824
3695
|
},
|
|
2825
|
-
/* @__PURE__ */
|
|
3696
|
+
/* @__PURE__ */ React41.createElement(Text26, { fw: 500, tt: "capitalize", style: { textAlign: "left" } }, voteType === "no_with_veto" ? "No with Veto" : voteType)
|
|
2826
3697
|
)
|
|
2827
|
-
))), /* @__PURE__ */
|
|
3698
|
+
))), /* @__PURE__ */ React41.createElement(Stack26, { gap: "xs" }, /* @__PURE__ */ React41.createElement(Text26, { size: "sm", style: { color: "#adb5bd" } }, "Rationale (optional)"), /* @__PURE__ */ React41.createElement(
|
|
2828
3699
|
Textarea2,
|
|
2829
3700
|
{
|
|
2830
3701
|
value: rationale,
|
|
@@ -2841,8 +3712,8 @@ var FlowGeneralTab = ({
|
|
|
2841
3712
|
}
|
|
2842
3713
|
}
|
|
2843
3714
|
}
|
|
2844
|
-
))), (status === "executed" || proposal?.proposal.status === "executed") && /* @__PURE__ */
|
|
2845
|
-
|
|
3715
|
+
))), (status === "executed" || proposal?.proposal.status === "executed") && /* @__PURE__ */ React41.createElement(
|
|
3716
|
+
Card7,
|
|
2846
3717
|
{
|
|
2847
3718
|
padding: "md",
|
|
2848
3719
|
radius: "md",
|
|
@@ -2851,15 +3722,15 @@ var FlowGeneralTab = ({
|
|
|
2851
3722
|
border: "1px solid #333"
|
|
2852
3723
|
}
|
|
2853
3724
|
},
|
|
2854
|
-
/* @__PURE__ */
|
|
2855
|
-
), hasDependency && !hasSubmittedProposal && /* @__PURE__ */
|
|
3725
|
+
/* @__PURE__ */ React41.createElement(Stack26, { gap: "xs" }, /* @__PURE__ */ React41.createElement(Text26, { fw: 500, size: "sm", style: { color: "#f1f3f5" } }, "Proposal Executed"), /* @__PURE__ */ React41.createElement(Text26, { size: "sm", style: { color: "#adb5bd" } }, "This proposal has been successfully executed."))
|
|
3726
|
+
), hasDependency && !hasSubmittedProposal && /* @__PURE__ */ React41.createElement(Stack26, { gap: "lg" }, /* @__PURE__ */ React41.createElement(Stack26, { gap: "md" }, ["yes", "no", "no_with_veto", "abstain"].map((voteType) => /* @__PURE__ */ React41.createElement(
|
|
2856
3727
|
Tooltip3,
|
|
2857
3728
|
{
|
|
2858
3729
|
key: voteType,
|
|
2859
3730
|
label: "Proposal must be submitted before voting",
|
|
2860
3731
|
position: "top"
|
|
2861
3732
|
},
|
|
2862
|
-
/* @__PURE__ */
|
|
3733
|
+
/* @__PURE__ */ React41.createElement(
|
|
2863
3734
|
Button10,
|
|
2864
3735
|
{
|
|
2865
3736
|
variant: "outline",
|
|
@@ -2876,9 +3747,9 @@ var FlowGeneralTab = ({
|
|
|
2876
3747
|
opacity: 0.5
|
|
2877
3748
|
}
|
|
2878
3749
|
},
|
|
2879
|
-
/* @__PURE__ */
|
|
3750
|
+
/* @__PURE__ */ React41.createElement(Text26, { fw: 500, tt: "capitalize", style: { textAlign: "left" } }, voteType === "no_with_veto" ? "No with Veto" : voteType)
|
|
2880
3751
|
)
|
|
2881
|
-
)))), hasDependency && hasSubmittedProposal && selectedVote && (status === "open" || proposal?.proposal.status === "open") && /* @__PURE__ */
|
|
3752
|
+
)))), hasDependency && hasSubmittedProposal && selectedVote && (status === "open" || proposal?.proposal.status === "open") && /* @__PURE__ */ React41.createElement(Tooltip3, { label: disabled ? isDisabled?.message : "Sign to vote", position: "top" }, /* @__PURE__ */ React41.createElement("div", null, /* @__PURE__ */ React41.createElement(
|
|
2882
3753
|
Button10,
|
|
2883
3754
|
{
|
|
2884
3755
|
size: "sm",
|
|
@@ -2909,7 +3780,7 @@ var FlowConfig = ({
|
|
|
2909
3780
|
isDisabled
|
|
2910
3781
|
}) => {
|
|
2911
3782
|
const { closePanel } = usePanelStore();
|
|
2912
|
-
return /* @__PURE__ */
|
|
3783
|
+
return /* @__PURE__ */ React42.createElement(
|
|
2913
3784
|
Paper3,
|
|
2914
3785
|
{
|
|
2915
3786
|
p: "md",
|
|
@@ -2920,7 +3791,7 @@ var FlowConfig = ({
|
|
|
2920
3791
|
flexDirection: "column"
|
|
2921
3792
|
}
|
|
2922
3793
|
},
|
|
2923
|
-
/* @__PURE__ */
|
|
3794
|
+
/* @__PURE__ */ React42.createElement(
|
|
2924
3795
|
"div",
|
|
2925
3796
|
{
|
|
2926
3797
|
style: {
|
|
@@ -2930,17 +3801,17 @@ var FlowConfig = ({
|
|
|
2930
3801
|
marginBottom: "1rem"
|
|
2931
3802
|
}
|
|
2932
3803
|
},
|
|
2933
|
-
/* @__PURE__ */
|
|
2934
|
-
/* @__PURE__ */
|
|
3804
|
+
/* @__PURE__ */ React42.createElement(Title3, { order: 3 }, "Proposal Vote"),
|
|
3805
|
+
/* @__PURE__ */ React42.createElement(CloseButton3, { onClick: closePanel })
|
|
2935
3806
|
),
|
|
2936
|
-
/* @__PURE__ */
|
|
3807
|
+
/* @__PURE__ */ React42.createElement(
|
|
2937
3808
|
ReusablePanel,
|
|
2938
3809
|
{
|
|
2939
3810
|
extraTabs: [
|
|
2940
3811
|
{
|
|
2941
3812
|
label: "General",
|
|
2942
3813
|
value: "general",
|
|
2943
|
-
content: /* @__PURE__ */
|
|
3814
|
+
content: /* @__PURE__ */ React42.createElement(
|
|
2944
3815
|
FlowGeneralTab,
|
|
2945
3816
|
{
|
|
2946
3817
|
proposal,
|
|
@@ -2961,7 +3832,7 @@ var FlowConfig = ({
|
|
|
2961
3832
|
};
|
|
2962
3833
|
|
|
2963
3834
|
// src/mantine/blocks/proposalVote/flow/FlowView.tsx
|
|
2964
|
-
import { Card as
|
|
3835
|
+
import { Card as Card8, Group as Group12, Stack as Stack27, Text as Text27, ActionIcon as ActionIcon5, Alert as Alert5, Skeleton, Badge as Badge5 } from "@mantine/core";
|
|
2965
3836
|
|
|
2966
3837
|
// src/mantine/blocks/proposalVote/flow/useFlowBusinessLogic.ts
|
|
2967
3838
|
import { useEffect as useEffect9, useState as useState11, useMemo as useMemo11 } from "react";
|
|
@@ -3215,7 +4086,7 @@ var ProposalVoteFlowView = ({ block, editor, isDisabled }) => {
|
|
|
3215
4086
|
handleVote
|
|
3216
4087
|
} = useFlowBusinessLogic({ block, editor });
|
|
3217
4088
|
const panelContent = useMemo12(
|
|
3218
|
-
() => /* @__PURE__ */
|
|
4089
|
+
() => /* @__PURE__ */ React43.createElement(
|
|
3219
4090
|
FlowConfig,
|
|
3220
4091
|
{
|
|
3221
4092
|
proposal,
|
|
@@ -3240,8 +4111,8 @@ var ProposalVoteFlowView = ({ block, editor, isDisabled }) => {
|
|
|
3240
4111
|
]
|
|
3241
4112
|
);
|
|
3242
4113
|
const { open } = usePanel(panelId, panelContent);
|
|
3243
|
-
return /* @__PURE__ */
|
|
3244
|
-
|
|
4114
|
+
return /* @__PURE__ */ React43.createElement(
|
|
4115
|
+
Card8,
|
|
3245
4116
|
{
|
|
3246
4117
|
withBorder: true,
|
|
3247
4118
|
padding: "md",
|
|
@@ -3249,9 +4120,9 @@ var ProposalVoteFlowView = ({ block, editor, isDisabled }) => {
|
|
|
3249
4120
|
style: { width: "100%", cursor: "pointer" },
|
|
3250
4121
|
onClick: open
|
|
3251
4122
|
},
|
|
3252
|
-
loading && /* @__PURE__ */
|
|
3253
|
-
(error || localError) && /* @__PURE__ */
|
|
3254
|
-
!loading && !error && !localError && /* @__PURE__ */
|
|
4123
|
+
loading && /* @__PURE__ */ React43.createElement(Stack27, null, /* @__PURE__ */ React43.createElement(Skeleton, { height: 20, width: "70%" }), /* @__PURE__ */ React43.createElement(Skeleton, { height: 16 }), /* @__PURE__ */ React43.createElement(Skeleton, { height: 16, width: "40%" })),
|
|
4124
|
+
(error || localError) && /* @__PURE__ */ React43.createElement(Alert5, { color: "red", title: "Error", mb: "md" }, String(error || localError)),
|
|
4125
|
+
!loading && !error && !localError && /* @__PURE__ */ React43.createElement(Group12, { wrap: "nowrap", justify: "space-between", align: "center" }, /* @__PURE__ */ React43.createElement(Group12, { wrap: "nowrap", align: "center" }, /* @__PURE__ */ React43.createElement(
|
|
3255
4126
|
ActionIcon5,
|
|
3256
4127
|
{
|
|
3257
4128
|
variant: "light",
|
|
@@ -3261,7 +4132,7 @@ var ProposalVoteFlowView = ({ block, editor, isDisabled }) => {
|
|
|
3261
4132
|
style: { flexShrink: 0 }
|
|
3262
4133
|
},
|
|
3263
4134
|
getIcon(icon, 24, 1.5, "checklist")
|
|
3264
|
-
), /* @__PURE__ */
|
|
4135
|
+
), /* @__PURE__ */ React43.createElement(Stack27, { gap: "xs", style: { flex: 1 } }, /* @__PURE__ */ React43.createElement(Text27, { fw: 500, size: "sm", contentEditable: false }, proposal?.proposal?.title || title || "Proposal Vote"), /* @__PURE__ */ React43.createElement(Text27, { size: "xs", c: "dimmed", contentEditable: false }, proposal?.proposal?.description || subtitle || "Cast your vote"))), /* @__PURE__ */ React43.createElement(Badge5, { color: getStatusColor2(status), variant: "filled", size: "sm" }, status.toUpperCase()))
|
|
3265
4136
|
);
|
|
3266
4137
|
};
|
|
3267
4138
|
|
|
@@ -3271,7 +4142,7 @@ function ProposalVoteBlock({ editor, block }) {
|
|
|
3271
4142
|
const { actions } = useBlockConditions(block, editor);
|
|
3272
4143
|
console.log("Rendering ProposalVoteBlock with actions:", actions);
|
|
3273
4144
|
if (editable) {
|
|
3274
|
-
return /* @__PURE__ */
|
|
4145
|
+
return /* @__PURE__ */ React44.createElement(ProposalVoteTemplateView, { editor, block });
|
|
3275
4146
|
}
|
|
3276
4147
|
const conditionConfig = parseConditionConfig(block.props.conditions);
|
|
3277
4148
|
const hasVisibility = hasVisibilityConditions(conditionConfig);
|
|
@@ -3291,7 +4162,7 @@ function ProposalVoteBlock({ editor, block }) {
|
|
|
3291
4162
|
shouldDisable,
|
|
3292
4163
|
actions
|
|
3293
4164
|
});
|
|
3294
|
-
return /* @__PURE__ */
|
|
4165
|
+
return /* @__PURE__ */ React44.createElement(
|
|
3295
4166
|
ProposalVoteFlowView,
|
|
3296
4167
|
{
|
|
3297
4168
|
block,
|
|
@@ -3360,28 +4231,28 @@ var ProposalVoteBlockSpec = createReactBlockSpec4(
|
|
|
3360
4231
|
{
|
|
3361
4232
|
render: (props) => {
|
|
3362
4233
|
const ixoProps = props;
|
|
3363
|
-
return /* @__PURE__ */
|
|
4234
|
+
return /* @__PURE__ */ React45.createElement(ProposalVoteBlock, { ...ixoProps });
|
|
3364
4235
|
}
|
|
3365
4236
|
}
|
|
3366
4237
|
);
|
|
3367
4238
|
|
|
3368
4239
|
// src/mantine/blocks/proposal/ProposalBlockSpec.tsx
|
|
3369
|
-
import
|
|
4240
|
+
import React53 from "react";
|
|
3370
4241
|
import { createReactBlockSpec as createReactBlockSpec5 } from "@blocknote/react";
|
|
3371
4242
|
|
|
3372
4243
|
// src/mantine/blocks/proposal/ProposalBlock.tsx
|
|
3373
|
-
import
|
|
4244
|
+
import React52 from "react";
|
|
3374
4245
|
|
|
3375
4246
|
// src/mantine/blocks/proposal/template/TemplateView.tsx
|
|
3376
|
-
import
|
|
4247
|
+
import React48, { useMemo as useMemo13 } from "react";
|
|
3377
4248
|
|
|
3378
4249
|
// src/mantine/blocks/proposal/template/TemplateConfig.tsx
|
|
3379
|
-
import
|
|
4250
|
+
import React47, { useCallback as useCallback11 } from "react";
|
|
3380
4251
|
import { Paper as Paper4, CloseButton as CloseButton4, Title as Title4 } from "@mantine/core";
|
|
3381
4252
|
|
|
3382
4253
|
// src/mantine/blocks/proposal/template/GeneralTab.tsx
|
|
3383
|
-
import
|
|
3384
|
-
import { Stack as
|
|
4254
|
+
import React46, { useEffect as useEffect10, useState as useState12 } from "react";
|
|
4255
|
+
import { Stack as Stack28, Text as Text28, TextInput as TextInput5, Textarea as Textarea3 } from "@mantine/core";
|
|
3385
4256
|
var GeneralTab3 = ({
|
|
3386
4257
|
title,
|
|
3387
4258
|
description,
|
|
@@ -3402,7 +4273,7 @@ var GeneralTab3 = ({
|
|
|
3402
4273
|
useEffect10(() => {
|
|
3403
4274
|
setLocalIcon(icon || "\u{1F4DD}");
|
|
3404
4275
|
}, [icon]);
|
|
3405
|
-
return /* @__PURE__ */
|
|
4276
|
+
return /* @__PURE__ */ React46.createElement(Stack28, { gap: "lg" }, /* @__PURE__ */ React46.createElement(Stack28, { gap: "xs" }, /* @__PURE__ */ React46.createElement(Text28, { size: "sm", fw: 600, style: { color: "#f1f3f5" } }, "Title"), /* @__PURE__ */ React46.createElement(
|
|
3406
4277
|
TextInput5,
|
|
3407
4278
|
{
|
|
3408
4279
|
placeholder: "e.g. Proposal Title",
|
|
@@ -3420,7 +4291,7 @@ var GeneralTab3 = ({
|
|
|
3420
4291
|
}
|
|
3421
4292
|
}
|
|
3422
4293
|
}
|
|
3423
|
-
)), /* @__PURE__ */
|
|
4294
|
+
)), /* @__PURE__ */ React46.createElement(Stack28, { gap: "xs" }, /* @__PURE__ */ React46.createElement(Text28, { size: "sm", fw: 600, style: { color: "#f1f3f5" } }, "Icon"), /* @__PURE__ */ React46.createElement(
|
|
3424
4295
|
TextInput5,
|
|
3425
4296
|
{
|
|
3426
4297
|
placeholder: "e.g. \u{1F4DD}",
|
|
@@ -3440,7 +4311,7 @@ var GeneralTab3 = ({
|
|
|
3440
4311
|
}
|
|
3441
4312
|
}
|
|
3442
4313
|
}
|
|
3443
|
-
)), /* @__PURE__ */
|
|
4314
|
+
)), /* @__PURE__ */ React46.createElement(Stack28, { gap: "xs" }, /* @__PURE__ */ React46.createElement(Text28, { size: "sm", fw: 600, style: { color: "#f1f3f5" } }, "Description"), /* @__PURE__ */ React46.createElement(
|
|
3444
4315
|
Textarea3,
|
|
3445
4316
|
{
|
|
3446
4317
|
placeholder: "Describe what this proposal is about",
|
|
@@ -3476,7 +4347,7 @@ var TemplateConfig3 = ({ editor, block }) => {
|
|
|
3476
4347
|
},
|
|
3477
4348
|
[editor, block]
|
|
3478
4349
|
);
|
|
3479
|
-
return /* @__PURE__ */
|
|
4350
|
+
return /* @__PURE__ */ React47.createElement(
|
|
3480
4351
|
Paper4,
|
|
3481
4352
|
{
|
|
3482
4353
|
p: "md",
|
|
@@ -3487,7 +4358,7 @@ var TemplateConfig3 = ({ editor, block }) => {
|
|
|
3487
4358
|
flexDirection: "column"
|
|
3488
4359
|
}
|
|
3489
4360
|
},
|
|
3490
|
-
/* @__PURE__ */
|
|
4361
|
+
/* @__PURE__ */ React47.createElement(
|
|
3491
4362
|
"div",
|
|
3492
4363
|
{
|
|
3493
4364
|
style: {
|
|
@@ -3497,17 +4368,17 @@ var TemplateConfig3 = ({ editor, block }) => {
|
|
|
3497
4368
|
marginBottom: "1rem"
|
|
3498
4369
|
}
|
|
3499
4370
|
},
|
|
3500
|
-
/* @__PURE__ */
|
|
3501
|
-
/* @__PURE__ */
|
|
4371
|
+
/* @__PURE__ */ React47.createElement(Title4, { order: 3 }, "Proposal Settings"),
|
|
4372
|
+
/* @__PURE__ */ React47.createElement(CloseButton4, { onClick: closePanel })
|
|
3502
4373
|
),
|
|
3503
|
-
/* @__PURE__ */
|
|
4374
|
+
/* @__PURE__ */ React47.createElement(
|
|
3504
4375
|
ReusablePanel,
|
|
3505
4376
|
{
|
|
3506
4377
|
extraTabs: [
|
|
3507
4378
|
{
|
|
3508
4379
|
label: "General",
|
|
3509
4380
|
value: "general",
|
|
3510
|
-
content: /* @__PURE__ */
|
|
4381
|
+
content: /* @__PURE__ */ React47.createElement(
|
|
3511
4382
|
GeneralTab3,
|
|
3512
4383
|
{
|
|
3513
4384
|
title: block.props.title || "",
|
|
@@ -3527,17 +4398,17 @@ var TemplateConfig3 = ({ editor, block }) => {
|
|
|
3527
4398
|
};
|
|
3528
4399
|
|
|
3529
4400
|
// src/mantine/blocks/proposal/template/TemplateView.tsx
|
|
3530
|
-
import { Card as
|
|
4401
|
+
import { Card as Card9, Group as Group13, Stack as Stack29, Text as Text29, ActionIcon as ActionIcon6 } from "@mantine/core";
|
|
3531
4402
|
var PROPOSAL_TEMPLATE_PANEL_ID = "proposal-template-panel";
|
|
3532
4403
|
var ProposalTemplateView = ({ editor, block }) => {
|
|
3533
4404
|
const panelId = `${PROPOSAL_TEMPLATE_PANEL_ID}-${block.id}`;
|
|
3534
4405
|
const panelContent = useMemo13(
|
|
3535
|
-
() => /* @__PURE__ */
|
|
4406
|
+
() => /* @__PURE__ */ React48.createElement(TemplateConfig3, { editor, block }),
|
|
3536
4407
|
[editor, block]
|
|
3537
4408
|
);
|
|
3538
4409
|
const { open } = usePanel(panelId, panelContent);
|
|
3539
|
-
return /* @__PURE__ */
|
|
3540
|
-
|
|
4410
|
+
return /* @__PURE__ */ React48.createElement(
|
|
4411
|
+
Card9,
|
|
3541
4412
|
{
|
|
3542
4413
|
withBorder: true,
|
|
3543
4414
|
padding: "md",
|
|
@@ -3545,16 +4416,16 @@ var ProposalTemplateView = ({ editor, block }) => {
|
|
|
3545
4416
|
style: { width: "100%", cursor: "pointer" },
|
|
3546
4417
|
onClick: open
|
|
3547
4418
|
},
|
|
3548
|
-
/* @__PURE__ */
|
|
4419
|
+
/* @__PURE__ */ React48.createElement(Group13, { wrap: "nowrap", justify: "space-between", align: "center" }, /* @__PURE__ */ React48.createElement(Group13, { wrap: "nowrap", align: "center" }, /* @__PURE__ */ React48.createElement(ActionIcon6, { variant: "light", color: "blue", size: "lg", radius: "xl", style: { flexShrink: 0 } }, getIcon(block.props.icon, 18, 1.5, "file-text")), /* @__PURE__ */ React48.createElement(Stack29, { gap: "xs", style: { flex: 1 } }, /* @__PURE__ */ React48.createElement(Text29, { fw: 500, size: "sm", contentEditable: false }, block.props.title || "Proposal Title"), /* @__PURE__ */ React48.createElement(Text29, { size: "xs", c: "dimmed", contentEditable: false }, block.props.description || "Proposal description"))), /* @__PURE__ */ React48.createElement(Text29, { size: "xs", c: "dimmed", contentEditable: false }, block.props.status || "draft"))
|
|
3549
4420
|
);
|
|
3550
4421
|
};
|
|
3551
4422
|
|
|
3552
4423
|
// src/mantine/blocks/proposal/flow/FlowView.tsx
|
|
3553
|
-
import
|
|
4424
|
+
import React51, { useMemo as useMemo14 } from "react";
|
|
3554
4425
|
|
|
3555
4426
|
// src/mantine/blocks/proposal/components/OnChainProposalCard.tsx
|
|
3556
|
-
import
|
|
3557
|
-
import { Card as
|
|
4427
|
+
import React49 from "react";
|
|
4428
|
+
import { Card as Card10, Group as Group14, Stack as Stack30, Text as Text30, Skeleton as Skeleton2, Badge as Badge6, Button as Button11, ActionIcon as ActionIcon7 } from "@mantine/core";
|
|
3558
4429
|
var statusColor = {
|
|
3559
4430
|
open: "#4dabf7",
|
|
3560
4431
|
passed: "#51cf66",
|
|
@@ -3584,8 +4455,8 @@ var OnChainProposalCard = ({
|
|
|
3584
4455
|
onExecute,
|
|
3585
4456
|
isExecuting = false
|
|
3586
4457
|
}) => {
|
|
3587
|
-
return /* @__PURE__ */
|
|
3588
|
-
|
|
4458
|
+
return /* @__PURE__ */ React49.createElement(
|
|
4459
|
+
Card10,
|
|
3589
4460
|
{
|
|
3590
4461
|
shadow: "sm",
|
|
3591
4462
|
padding: "lg",
|
|
@@ -3597,19 +4468,9 @@ var OnChainProposalCard = ({
|
|
|
3597
4468
|
},
|
|
3598
4469
|
onClick
|
|
3599
4470
|
},
|
|
3600
|
-
isFetching && /* @__PURE__ */
|
|
3601
|
-
error && /* @__PURE__ */
|
|
3602
|
-
!isFetching && /* @__PURE__ */
|
|
3603
|
-
ActionIcon7,
|
|
3604
|
-
{
|
|
3605
|
-
variant: "light",
|
|
3606
|
-
color: "blue",
|
|
3607
|
-
size: "xl",
|
|
3608
|
-
radius: "xl",
|
|
3609
|
-
style: { flexShrink: 0 }
|
|
3610
|
-
},
|
|
3611
|
-
getIcon(icon, 24, 1.5, "file-text")
|
|
3612
|
-
), /* @__PURE__ */ React35.createElement(Stack20, { gap: "xs", style: { flex: 1 } }, /* @__PURE__ */ React35.createElement(Group15, { gap: "xs" }, /* @__PURE__ */ React35.createElement(Text20, { size: "md", fw: 600 }, title || "Proposal"), /* @__PURE__ */ React35.createElement(Badge5, { color: statusColor[status], variant: "filled", size: "sm", radius: "sm" }, status.replace(/_/g, " ").toUpperCase())), /* @__PURE__ */ React35.createElement(Text20, { size: "sm", c: "dimmed" }, getDisplayDescription(description)), status === "passed" && onExecute && /* @__PURE__ */ React35.createElement(
|
|
4471
|
+
isFetching && /* @__PURE__ */ React49.createElement(Stack30, null, /* @__PURE__ */ React49.createElement(Skeleton2, { height: 20, width: "70%" }), /* @__PURE__ */ React49.createElement(Skeleton2, { height: 16 }), /* @__PURE__ */ React49.createElement(Skeleton2, { height: 16, width: "40%" })),
|
|
4472
|
+
error && /* @__PURE__ */ React49.createElement(Text30, { size: "sm", c: "red" }, typeof error === "string" ? error : error.message || "An error occurred while loading the proposal."),
|
|
4473
|
+
!isFetching && /* @__PURE__ */ React49.createElement(Group14, { justify: "space-between", align: "flex-start" }, /* @__PURE__ */ React49.createElement(Group14, { align: "flex-start", gap: "md", style: { flex: 1 } }, /* @__PURE__ */ React49.createElement(ActionIcon7, { variant: "light", color: "blue", size: "xl", radius: "xl", style: { flexShrink: 0 } }, getIcon(icon, 24, 1.5, "file-text")), /* @__PURE__ */ React49.createElement(Stack30, { gap: "xs", style: { flex: 1 } }, /* @__PURE__ */ React49.createElement(Group14, { gap: "xs" }, /* @__PURE__ */ React49.createElement(Text30, { size: "md", fw: 600 }, title || "Proposal"), /* @__PURE__ */ React49.createElement(Badge6, { color: statusColor[status], variant: "filled", size: "sm", radius: "sm" }, status.replace(/_/g, " ").toUpperCase())), /* @__PURE__ */ React49.createElement(Text30, { size: "sm", c: "dimmed" }, getDisplayDescription(description)), status === "passed" && onExecute && /* @__PURE__ */ React49.createElement(
|
|
3613
4474
|
Button11,
|
|
3614
4475
|
{
|
|
3615
4476
|
size: "sm",
|
|
@@ -3629,17 +4490,17 @@ var OnChainProposalCard = ({
|
|
|
3629
4490
|
};
|
|
3630
4491
|
|
|
3631
4492
|
// src/mantine/blocks/proposal/flow/FlowConfig.tsx
|
|
3632
|
-
import
|
|
4493
|
+
import React50, { useCallback as useCallback12, useState as useState14 } from "react";
|
|
3633
4494
|
import {
|
|
3634
4495
|
Paper as Paper5,
|
|
3635
4496
|
CloseButton as CloseButton5,
|
|
3636
4497
|
Title as Title5,
|
|
3637
|
-
Stack as
|
|
4498
|
+
Stack as Stack31,
|
|
3638
4499
|
TextInput as TextInput6,
|
|
3639
4500
|
Textarea as Textarea4,
|
|
3640
4501
|
Button as Button12,
|
|
3641
|
-
Text as
|
|
3642
|
-
Card as
|
|
4502
|
+
Text as Text31,
|
|
4503
|
+
Card as Card11
|
|
3643
4504
|
} from "@mantine/core";
|
|
3644
4505
|
|
|
3645
4506
|
// src/mantine/blocks/proposal/flow/useFlowBusinessLogic.ts
|
|
@@ -3836,7 +4697,7 @@ var FlowConfig2 = ({ editor, block }) => {
|
|
|
3836
4697
|
setIsCreating(false);
|
|
3837
4698
|
}
|
|
3838
4699
|
};
|
|
3839
|
-
return /* @__PURE__ */
|
|
4700
|
+
return /* @__PURE__ */ React50.createElement(
|
|
3840
4701
|
Paper5,
|
|
3841
4702
|
{
|
|
3842
4703
|
p: "md",
|
|
@@ -3847,7 +4708,7 @@ var FlowConfig2 = ({ editor, block }) => {
|
|
|
3847
4708
|
flexDirection: "column"
|
|
3848
4709
|
}
|
|
3849
4710
|
},
|
|
3850
|
-
/* @__PURE__ */
|
|
4711
|
+
/* @__PURE__ */ React50.createElement(
|
|
3851
4712
|
"div",
|
|
3852
4713
|
{
|
|
3853
4714
|
style: {
|
|
@@ -3857,10 +4718,10 @@ var FlowConfig2 = ({ editor, block }) => {
|
|
|
3857
4718
|
marginBottom: "1rem"
|
|
3858
4719
|
}
|
|
3859
4720
|
},
|
|
3860
|
-
/* @__PURE__ */
|
|
3861
|
-
/* @__PURE__ */
|
|
4721
|
+
/* @__PURE__ */ React50.createElement(Title5, { order: 3 }, "Create Proposal"),
|
|
4722
|
+
/* @__PURE__ */ React50.createElement(CloseButton5, { onClick: closePanel })
|
|
3862
4723
|
),
|
|
3863
|
-
/* @__PURE__ */
|
|
4724
|
+
/* @__PURE__ */ React50.createElement(Stack31, { gap: "lg", style: { flex: 1, overflow: "auto" } }, coreAddress && /* @__PURE__ */ React50.createElement(Card11, { padding: "sm", radius: "md", withBorder: true }, /* @__PURE__ */ React50.createElement(Text31, { size: "xs", c: "dimmed" }, "Core Address:", " ", /* @__PURE__ */ React50.createElement(Text31, { span: true, ff: "monospace", c: "bright" }, coreAddress.slice(0, 20), "...", coreAddress.slice(-10)))), /* @__PURE__ */ React50.createElement(
|
|
3864
4725
|
TextInput6,
|
|
3865
4726
|
{
|
|
3866
4727
|
label: "Title",
|
|
@@ -3871,7 +4732,7 @@ var FlowConfig2 = ({ editor, block }) => {
|
|
|
3871
4732
|
required: true,
|
|
3872
4733
|
disabled: isProposalCreated
|
|
3873
4734
|
}
|
|
3874
|
-
), /* @__PURE__ */
|
|
4735
|
+
), /* @__PURE__ */ React50.createElement(
|
|
3875
4736
|
Textarea4,
|
|
3876
4737
|
{
|
|
3877
4738
|
label: "Description",
|
|
@@ -3883,17 +4744,17 @@ var FlowConfig2 = ({ editor, block }) => {
|
|
|
3883
4744
|
required: true,
|
|
3884
4745
|
disabled: isProposalCreated
|
|
3885
4746
|
}
|
|
3886
|
-
), errors.general && /* @__PURE__ */
|
|
3887
|
-
|
|
4747
|
+
), errors.general && /* @__PURE__ */ React50.createElement(Text31, { size: "sm", c: "red" }, errors.general), isProposalCreated && /* @__PURE__ */ React50.createElement(
|
|
4748
|
+
Card11,
|
|
3888
4749
|
{
|
|
3889
4750
|
padding: "md",
|
|
3890
4751
|
radius: "md",
|
|
3891
4752
|
withBorder: true,
|
|
3892
4753
|
style: { borderColor: "var(--mantine-color-green-6)" }
|
|
3893
4754
|
},
|
|
3894
|
-
/* @__PURE__ */
|
|
3895
|
-
/* @__PURE__ */
|
|
3896
|
-
), /* @__PURE__ */
|
|
4755
|
+
/* @__PURE__ */ React50.createElement(Text31, { fw: 500, size: "sm", c: "green" }, "Proposal Created Successfully"),
|
|
4756
|
+
/* @__PURE__ */ React50.createElement(Text31, { size: "sm", c: "dimmed" }, "Your proposal has been created and is now open for voting.")
|
|
4757
|
+
), /* @__PURE__ */ React50.createElement(
|
|
3897
4758
|
Button12,
|
|
3898
4759
|
{
|
|
3899
4760
|
fullWidth: true,
|
|
@@ -3923,9 +4784,9 @@ var ProposalFlowView = ({ block, editor }) => {
|
|
|
3923
4784
|
handleExecuteProposal,
|
|
3924
4785
|
handleIconChange
|
|
3925
4786
|
} = useFlowBusinessLogic2({ block, editor });
|
|
3926
|
-
const panelContent = useMemo14(() => /* @__PURE__ */
|
|
4787
|
+
const panelContent = useMemo14(() => /* @__PURE__ */ React51.createElement(FlowConfig2, { editor, block }), [editor, block]);
|
|
3927
4788
|
const { open } = usePanel(panelId, panelContent);
|
|
3928
|
-
return /* @__PURE__ */
|
|
4789
|
+
return /* @__PURE__ */ React51.createElement(
|
|
3929
4790
|
OnChainProposalCard,
|
|
3930
4791
|
{
|
|
3931
4792
|
title,
|
|
@@ -3947,9 +4808,9 @@ var ProposalFlowView = ({ block, editor }) => {
|
|
|
3947
4808
|
// src/mantine/blocks/proposal/ProposalBlock.tsx
|
|
3948
4809
|
function ProposalBlock({ editor, block }) {
|
|
3949
4810
|
if (editor.isEditable) {
|
|
3950
|
-
return /* @__PURE__ */
|
|
4811
|
+
return /* @__PURE__ */ React52.createElement(ProposalTemplateView, { editor, block });
|
|
3951
4812
|
}
|
|
3952
|
-
return /* @__PURE__ */
|
|
4813
|
+
return /* @__PURE__ */ React52.createElement(ProposalFlowView, { block, editor });
|
|
3953
4814
|
}
|
|
3954
4815
|
|
|
3955
4816
|
// src/mantine/blocks/proposal/ProposalBlockSpec.tsx
|
|
@@ -3988,31 +4849,21 @@ var ProposalBlockSpec = createReactBlockSpec5(
|
|
|
3988
4849
|
{
|
|
3989
4850
|
render: (props) => {
|
|
3990
4851
|
const ixoProps = props;
|
|
3991
|
-
return /* @__PURE__ */
|
|
4852
|
+
return /* @__PURE__ */ React53.createElement(ProposalBlock, { ...ixoProps });
|
|
3992
4853
|
}
|
|
3993
4854
|
}
|
|
3994
4855
|
);
|
|
3995
4856
|
|
|
3996
4857
|
// src/mantine/blocks/proposalActions/ProposalActionsBlockSpec.tsx
|
|
3997
|
-
import
|
|
4858
|
+
import React56 from "react";
|
|
3998
4859
|
import { createReactBlockSpec as createReactBlockSpec6 } from "@blocknote/react";
|
|
3999
4860
|
|
|
4000
4861
|
// src/mantine/blocks/proposalActions/ProposalActionsBlock.tsx
|
|
4001
|
-
import
|
|
4862
|
+
import React55, { useCallback as useCallback13 } from "react";
|
|
4002
4863
|
|
|
4003
4864
|
// src/mantine/blocks/proposalActions/components/ActionsCard.tsx
|
|
4004
|
-
import
|
|
4005
|
-
import {
|
|
4006
|
-
Card as Card13,
|
|
4007
|
-
Group as Group16,
|
|
4008
|
-
Text as Text22,
|
|
4009
|
-
Badge as Badge6,
|
|
4010
|
-
Stack as Stack22,
|
|
4011
|
-
ActionIcon as ActionIcon8,
|
|
4012
|
-
Button as Button13,
|
|
4013
|
-
Box as Box7,
|
|
4014
|
-
ScrollArea as ScrollArea3
|
|
4015
|
-
} from "@mantine/core";
|
|
4865
|
+
import React54 from "react";
|
|
4866
|
+
import { Card as Card12, Group as Group15, Text as Text32, Badge as Badge7, Stack as Stack32, ActionIcon as ActionIcon8, Button as Button13, Box as Box16, ScrollArea } from "@mantine/core";
|
|
4016
4867
|
var getActionSummary = (action) => {
|
|
4017
4868
|
switch (action.type) {
|
|
4018
4869
|
case "Spend":
|
|
@@ -4037,22 +4888,15 @@ var getActionTypeColor = (type) => {
|
|
|
4037
4888
|
return "#868e96";
|
|
4038
4889
|
}
|
|
4039
4890
|
};
|
|
4040
|
-
var ActionsCard = ({
|
|
4041
|
-
actions,
|
|
4042
|
-
isSelected,
|
|
4043
|
-
onClick,
|
|
4044
|
-
onAddAction,
|
|
4045
|
-
onEditAction,
|
|
4046
|
-
onRemoveAction
|
|
4047
|
-
}) => {
|
|
4891
|
+
var ActionsCard = ({ actions, isSelected, onClick, onAddAction, onEditAction, onRemoveAction }) => {
|
|
4048
4892
|
const handleCardClick = (e) => {
|
|
4049
4893
|
if (e.target.closest(".action-button")) {
|
|
4050
4894
|
return;
|
|
4051
4895
|
}
|
|
4052
4896
|
onClick();
|
|
4053
4897
|
};
|
|
4054
|
-
return /* @__PURE__ */
|
|
4055
|
-
|
|
4898
|
+
return /* @__PURE__ */ React54.createElement(
|
|
4899
|
+
Card12,
|
|
4056
4900
|
{
|
|
4057
4901
|
shadow: "sm",
|
|
4058
4902
|
padding: "lg",
|
|
@@ -4068,8 +4912,8 @@ var ActionsCard = ({
|
|
|
4068
4912
|
},
|
|
4069
4913
|
onClick: handleCardClick
|
|
4070
4914
|
},
|
|
4071
|
-
/* @__PURE__ */
|
|
4072
|
-
|
|
4915
|
+
/* @__PURE__ */ React54.createElement(Group15, { justify: "space-between", align: "flex-start" }, /* @__PURE__ */ React54.createElement(Group15, { align: "flex-start", gap: "md", style: { flex: 1 } }, /* @__PURE__ */ React54.createElement(
|
|
4916
|
+
Box16,
|
|
4073
4917
|
{
|
|
4074
4918
|
style: {
|
|
4075
4919
|
width: 48,
|
|
@@ -4084,7 +4928,7 @@ var ActionsCard = ({
|
|
|
4084
4928
|
}
|
|
4085
4929
|
},
|
|
4086
4930
|
"\u{1F4CB}"
|
|
4087
|
-
), /* @__PURE__ */
|
|
4931
|
+
), /* @__PURE__ */ React54.createElement(Stack32, { gap: "xs", style: { flex: 1 } }, /* @__PURE__ */ React54.createElement(Group15, { justify: "space-between", align: "center" }, /* @__PURE__ */ React54.createElement(Text32, { size: "md", fw: 600, style: { color: "#f1f3f5" } }, "Proposal Actions (", actions.length, ")"), /* @__PURE__ */ React54.createElement(
|
|
4088
4932
|
Button13,
|
|
4089
4933
|
{
|
|
4090
4934
|
size: "xs",
|
|
@@ -4101,8 +4945,8 @@ var ActionsCard = ({
|
|
|
4101
4945
|
}
|
|
4102
4946
|
},
|
|
4103
4947
|
"Add Action"
|
|
4104
|
-
)), actions.length === 0 ? /* @__PURE__ */
|
|
4105
|
-
|
|
4948
|
+
)), actions.length === 0 ? /* @__PURE__ */ React54.createElement(Text32, { size: "sm", style: { color: "#868e96" } }, 'No actions added yet. Click "Add Action" to get started.') : /* @__PURE__ */ React54.createElement(ScrollArea, { h: actions.length > 3 ? 150 : void 0, style: { marginTop: 8 } }, /* @__PURE__ */ React54.createElement(Stack32, { gap: "xs" }, actions.map((action, index) => /* @__PURE__ */ React54.createElement(
|
|
4949
|
+
Card12,
|
|
4106
4950
|
{
|
|
4107
4951
|
key: index,
|
|
4108
4952
|
withBorder: true,
|
|
@@ -4112,8 +4956,8 @@ var ActionsCard = ({
|
|
|
4112
4956
|
borderColor: "#333"
|
|
4113
4957
|
}
|
|
4114
4958
|
},
|
|
4115
|
-
/* @__PURE__ */
|
|
4116
|
-
|
|
4959
|
+
/* @__PURE__ */ React54.createElement(Group15, { justify: "space-between", align: "center" }, /* @__PURE__ */ React54.createElement(Group15, { gap: "xs", style: { flex: 1 } }, /* @__PURE__ */ React54.createElement(
|
|
4960
|
+
Badge7,
|
|
4117
4961
|
{
|
|
4118
4962
|
size: "sm",
|
|
4119
4963
|
variant: "light",
|
|
@@ -4123,7 +4967,7 @@ var ActionsCard = ({
|
|
|
4123
4967
|
}
|
|
4124
4968
|
},
|
|
4125
4969
|
action.type
|
|
4126
|
-
), /* @__PURE__ */
|
|
4970
|
+
), /* @__PURE__ */ React54.createElement(Text32, { size: "sm", style: { color: "#adb5bd" } }, getActionSummary(action))), /* @__PURE__ */ React54.createElement(Group15, { gap: 4 }, /* @__PURE__ */ React54.createElement(
|
|
4127
4971
|
ActionIcon8,
|
|
4128
4972
|
{
|
|
4129
4973
|
size: "sm",
|
|
@@ -4136,7 +4980,7 @@ var ActionsCard = ({
|
|
|
4136
4980
|
style: { color: "#4dabf7" }
|
|
4137
4981
|
},
|
|
4138
4982
|
"\u270F\uFE0F"
|
|
4139
|
-
), /* @__PURE__ */
|
|
4983
|
+
), /* @__PURE__ */ React54.createElement(
|
|
4140
4984
|
ActionIcon8,
|
|
4141
4985
|
{
|
|
4142
4986
|
size: "sm",
|
|
@@ -4193,17 +5037,7 @@ var ProposalActionsBlock = ({ block, editor }) => {
|
|
|
4193
5037
|
);
|
|
4194
5038
|
const handleCardClick = useCallback13(() => {
|
|
4195
5039
|
}, []);
|
|
4196
|
-
return /* @__PURE__ */
|
|
4197
|
-
ActionsCard,
|
|
4198
|
-
{
|
|
4199
|
-
actions,
|
|
4200
|
-
isSelected: true,
|
|
4201
|
-
onClick: handleCardClick,
|
|
4202
|
-
onAddAction: handleAddAction,
|
|
4203
|
-
onEditAction: handleEditAction,
|
|
4204
|
-
onRemoveAction: handleRemoveAction
|
|
4205
|
-
}
|
|
4206
|
-
);
|
|
5040
|
+
return /* @__PURE__ */ React55.createElement(ActionsCard, { actions, isSelected: true, onClick: handleCardClick, onAddAction: handleAddAction, onEditAction: handleEditAction, onRemoveAction: handleRemoveAction });
|
|
4207
5041
|
};
|
|
4208
5042
|
|
|
4209
5043
|
// src/mantine/blocks/proposalActions/ProposalActionsBlockSpec.tsx
|
|
@@ -4241,33 +5075,19 @@ var ProposalActionsBlockSpec = createReactBlockSpec6(
|
|
|
4241
5075
|
content: "none"
|
|
4242
5076
|
},
|
|
4243
5077
|
{
|
|
4244
|
-
render: (props) => /* @__PURE__ */
|
|
5078
|
+
render: (props) => /* @__PURE__ */ React56.createElement(ProposalActionsBlock, { ...props })
|
|
4245
5079
|
}
|
|
4246
5080
|
);
|
|
4247
5081
|
|
|
4248
5082
|
// src/mantine/blocks/proposalActions/ProposalActionsDrawer.tsx
|
|
4249
|
-
import
|
|
4250
|
-
import {
|
|
4251
|
-
Stack as Stack53,
|
|
4252
|
-
Select as Select10,
|
|
4253
|
-
Button as Button19,
|
|
4254
|
-
Group as Group27,
|
|
4255
|
-
Text as Text30,
|
|
4256
|
-
Card as Card19,
|
|
4257
|
-
Badge as Badge9,
|
|
4258
|
-
Divider as Divider3,
|
|
4259
|
-
ScrollArea as ScrollArea5,
|
|
4260
|
-
Alert as Alert8,
|
|
4261
|
-
Tabs as Tabs2,
|
|
4262
|
-
SimpleGrid,
|
|
4263
|
-
Paper as Paper6
|
|
4264
|
-
} from "@mantine/core";
|
|
5083
|
+
import React87, { useState as useState21, useEffect as useEffect13, useMemo as useMemo15 } from "react";
|
|
5084
|
+
import { Stack as Stack63, Select as Select10, Button as Button19, Group as Group26, Text as Text40, Card as Card18, Badge as Badge10, Divider as Divider3, ScrollArea as ScrollArea3, Alert as Alert8, Tabs as Tabs2, SimpleGrid, Paper as Paper6 } from "@mantine/core";
|
|
4265
5085
|
|
|
4266
5086
|
// src/mantine/blocks/proposalActions/components/SpendActionForm.tsx
|
|
4267
|
-
import
|
|
4268
|
-
import { TextInput as TextInput7, Stack as
|
|
5087
|
+
import React57 from "react";
|
|
5088
|
+
import { TextInput as TextInput7, Stack as Stack33 } from "@mantine/core";
|
|
4269
5089
|
var SpendActionForm = ({ data, onChange }) => {
|
|
4270
|
-
return /* @__PURE__ */
|
|
5090
|
+
return /* @__PURE__ */ React57.createElement(Stack33, null, /* @__PURE__ */ React57.createElement(
|
|
4271
5091
|
TextInput7,
|
|
4272
5092
|
{
|
|
4273
5093
|
label: "Recipient Address",
|
|
@@ -4287,7 +5107,7 @@ var SpendActionForm = ({ data, onChange }) => {
|
|
|
4287
5107
|
}
|
|
4288
5108
|
}
|
|
4289
5109
|
}
|
|
4290
|
-
), /* @__PURE__ */
|
|
5110
|
+
), /* @__PURE__ */ React57.createElement(
|
|
4291
5111
|
TextInput7,
|
|
4292
5112
|
{
|
|
4293
5113
|
label: "Denomination",
|
|
@@ -4307,7 +5127,7 @@ var SpendActionForm = ({ data, onChange }) => {
|
|
|
4307
5127
|
}
|
|
4308
5128
|
}
|
|
4309
5129
|
}
|
|
4310
|
-
), /* @__PURE__ */
|
|
5130
|
+
), /* @__PURE__ */ React57.createElement(
|
|
4311
5131
|
TextInput7,
|
|
4312
5132
|
{
|
|
4313
5133
|
label: "Amount",
|
|
@@ -4331,24 +5151,9 @@ var SpendActionForm = ({ data, onChange }) => {
|
|
|
4331
5151
|
};
|
|
4332
5152
|
|
|
4333
5153
|
// src/mantine/blocks/proposalActions/components/UpdateMembersActionForm.tsx
|
|
4334
|
-
import
|
|
4335
|
-
import {
|
|
4336
|
-
|
|
4337
|
-
TextInput as TextInput8,
|
|
4338
|
-
NumberInput as NumberInput2,
|
|
4339
|
-
Button as Button14,
|
|
4340
|
-
Group as Group17,
|
|
4341
|
-
Text as Text23,
|
|
4342
|
-
Card as Card14,
|
|
4343
|
-
Badge as Badge7,
|
|
4344
|
-
ActionIcon as ActionIcon9,
|
|
4345
|
-
Divider as Divider2,
|
|
4346
|
-
ScrollArea as ScrollArea4
|
|
4347
|
-
} from "@mantine/core";
|
|
4348
|
-
var UpdateMembersActionForm = ({
|
|
4349
|
-
data,
|
|
4350
|
-
onChange
|
|
4351
|
-
}) => {
|
|
5154
|
+
import React58, { useState as useState15 } from "react";
|
|
5155
|
+
import { Stack as Stack34, TextInput as TextInput8, NumberInput as NumberInput2, Button as Button14, Group as Group16, Text as Text33, Card as Card13, Badge as Badge8, ActionIcon as ActionIcon9, Divider as Divider2, ScrollArea as ScrollArea2 } from "@mantine/core";
|
|
5156
|
+
var UpdateMembersActionForm = ({ data, onChange }) => {
|
|
4352
5157
|
const [newMember, setNewMember] = useState15({ address: "", weight: 1 });
|
|
4353
5158
|
const [newRemoveAddress, setNewRemoveAddress] = useState15("");
|
|
4354
5159
|
const handleAddMember = () => {
|
|
@@ -4390,8 +5195,8 @@ var UpdateMembersActionForm = ({
|
|
|
4390
5195
|
}
|
|
4391
5196
|
}
|
|
4392
5197
|
};
|
|
4393
|
-
return /* @__PURE__ */
|
|
4394
|
-
|
|
5198
|
+
return /* @__PURE__ */ React58.createElement(Stack34, null, /* @__PURE__ */ React58.createElement(Stack34, { gap: "xs" }, /* @__PURE__ */ React58.createElement(Text33, { size: "sm", fw: 500, style: { color: "#adb5bd" } }, "Members to Add"), /* @__PURE__ */ React58.createElement(ScrollArea2, { h: 150 }, /* @__PURE__ */ React58.createElement(Stack34, { gap: "xs" }, (data.add || []).map((member, index) => /* @__PURE__ */ React58.createElement(
|
|
5199
|
+
Card13,
|
|
4395
5200
|
{
|
|
4396
5201
|
key: index,
|
|
4397
5202
|
withBorder: true,
|
|
@@ -4401,8 +5206,8 @@ var UpdateMembersActionForm = ({
|
|
|
4401
5206
|
borderColor: "#333"
|
|
4402
5207
|
}
|
|
4403
5208
|
},
|
|
4404
|
-
/* @__PURE__ */
|
|
4405
|
-
|
|
5209
|
+
/* @__PURE__ */ React58.createElement(Group16, { justify: "space-between" }, /* @__PURE__ */ React58.createElement("div", null, /* @__PURE__ */ React58.createElement(Text33, { size: "sm", fw: 500, style: { color: "#f1f3f5" } }, member.address.slice(0, 20), "..."), /* @__PURE__ */ React58.createElement(
|
|
5210
|
+
Badge8,
|
|
4406
5211
|
{
|
|
4407
5212
|
size: "sm",
|
|
4408
5213
|
style: {
|
|
@@ -4412,25 +5217,8 @@ var UpdateMembersActionForm = ({
|
|
|
4412
5217
|
},
|
|
4413
5218
|
"Weight: ",
|
|
4414
5219
|
member.weight
|
|
4415
|
-
)), /* @__PURE__ */
|
|
4416
|
-
|
|
4417
|
-
{
|
|
4418
|
-
size: "sm",
|
|
4419
|
-
variant: "subtle",
|
|
4420
|
-
onClick: () => handleRemoveMember(index),
|
|
4421
|
-
style: { color: "#ff6b6b" }
|
|
4422
|
-
},
|
|
4423
|
-
"\u{1F5D1}\uFE0F"
|
|
4424
|
-
))
|
|
4425
|
-
)))), /* @__PURE__ */ React44.createElement(Group17, { grow: true }, /* @__PURE__ */ React44.createElement(
|
|
4426
|
-
TextInput8,
|
|
4427
|
-
{
|
|
4428
|
-
placeholder: "Member address",
|
|
4429
|
-
value: newMember.address,
|
|
4430
|
-
onChange: (e) => setNewMember({ ...newMember, address: e.currentTarget.value }),
|
|
4431
|
-
styles: inputStyles29
|
|
4432
|
-
}
|
|
4433
|
-
), /* @__PURE__ */ React44.createElement(
|
|
5220
|
+
)), /* @__PURE__ */ React58.createElement(ActionIcon9, { size: "sm", variant: "subtle", onClick: () => handleRemoveMember(index), style: { color: "#ff6b6b" } }, "\u{1F5D1}\uFE0F"))
|
|
5221
|
+
)))), /* @__PURE__ */ React58.createElement(Group16, { grow: true }, /* @__PURE__ */ React58.createElement(TextInput8, { placeholder: "Member address", value: newMember.address, onChange: (e) => setNewMember({ ...newMember, address: e.currentTarget.value }), styles: inputStyles29 }), /* @__PURE__ */ React58.createElement(
|
|
4434
5222
|
NumberInput2,
|
|
4435
5223
|
{
|
|
4436
5224
|
placeholder: "Weight",
|
|
@@ -4439,7 +5227,7 @@ var UpdateMembersActionForm = ({
|
|
|
4439
5227
|
min: 1,
|
|
4440
5228
|
styles: inputStyles29
|
|
4441
5229
|
}
|
|
4442
|
-
), /* @__PURE__ */
|
|
5230
|
+
), /* @__PURE__ */ React58.createElement(
|
|
4443
5231
|
Button14,
|
|
4444
5232
|
{
|
|
4445
5233
|
size: "sm",
|
|
@@ -4452,8 +5240,8 @@ var UpdateMembersActionForm = ({
|
|
|
4452
5240
|
}
|
|
4453
5241
|
},
|
|
4454
5242
|
"\u2795 Add"
|
|
4455
|
-
))), /* @__PURE__ */
|
|
4456
|
-
|
|
5243
|
+
))), /* @__PURE__ */ React58.createElement(Divider2, { color: "#333" }), /* @__PURE__ */ React58.createElement(Stack34, { gap: "xs" }, /* @__PURE__ */ React58.createElement(Text33, { size: "sm", fw: 500, style: { color: "#adb5bd" } }, "Members to Remove"), /* @__PURE__ */ React58.createElement(ScrollArea2, { h: 100 }, /* @__PURE__ */ React58.createElement(Stack34, { gap: "xs" }, (data.remove || []).map((item, index) => /* @__PURE__ */ React58.createElement(
|
|
5244
|
+
Card13,
|
|
4457
5245
|
{
|
|
4458
5246
|
key: index,
|
|
4459
5247
|
withBorder: true,
|
|
@@ -4463,25 +5251,8 @@ var UpdateMembersActionForm = ({
|
|
|
4463
5251
|
borderColor: "#333"
|
|
4464
5252
|
}
|
|
4465
5253
|
},
|
|
4466
|
-
/* @__PURE__ */
|
|
4467
|
-
|
|
4468
|
-
{
|
|
4469
|
-
size: "sm",
|
|
4470
|
-
variant: "subtle",
|
|
4471
|
-
onClick: () => handleRemoveRemoveAddress(index),
|
|
4472
|
-
style: { color: "#ff6b6b" }
|
|
4473
|
-
},
|
|
4474
|
-
"\u{1F5D1}\uFE0F"
|
|
4475
|
-
))
|
|
4476
|
-
)))), /* @__PURE__ */ React44.createElement(Group17, { grow: true }, /* @__PURE__ */ React44.createElement(
|
|
4477
|
-
TextInput8,
|
|
4478
|
-
{
|
|
4479
|
-
placeholder: "Address to remove",
|
|
4480
|
-
value: newRemoveAddress,
|
|
4481
|
-
onChange: (e) => setNewRemoveAddress(e.currentTarget.value),
|
|
4482
|
-
styles: inputStyles29
|
|
4483
|
-
}
|
|
4484
|
-
), /* @__PURE__ */ React44.createElement(
|
|
5254
|
+
/* @__PURE__ */ React58.createElement(Group16, { justify: "space-between" }, /* @__PURE__ */ React58.createElement(Text33, { size: "sm", style: { color: "#adb5bd" } }, item.addr.slice(0, 30), "..."), /* @__PURE__ */ React58.createElement(ActionIcon9, { size: "sm", variant: "subtle", onClick: () => handleRemoveRemoveAddress(index), style: { color: "#ff6b6b" } }, "\u{1F5D1}\uFE0F"))
|
|
5255
|
+
)))), /* @__PURE__ */ React58.createElement(Group16, { grow: true }, /* @__PURE__ */ React58.createElement(TextInput8, { placeholder: "Address to remove", value: newRemoveAddress, onChange: (e) => setNewRemoveAddress(e.currentTarget.value), styles: inputStyles29 }), /* @__PURE__ */ React58.createElement(
|
|
4485
5256
|
Button14,
|
|
4486
5257
|
{
|
|
4487
5258
|
size: "sm",
|
|
@@ -4498,8 +5269,8 @@ var UpdateMembersActionForm = ({
|
|
|
4498
5269
|
};
|
|
4499
5270
|
|
|
4500
5271
|
// src/mantine/blocks/proposalActions/components/StakeActionForm.tsx
|
|
4501
|
-
import
|
|
4502
|
-
import { Stack as
|
|
5272
|
+
import React59 from "react";
|
|
5273
|
+
import { Stack as Stack35, TextInput as TextInput9, Select as Select4, NumberInput as NumberInput3 } from "@mantine/core";
|
|
4503
5274
|
var stakeTypeOptions = [
|
|
4504
5275
|
{ value: StakeType.Delegate, label: "Delegate" },
|
|
4505
5276
|
{ value: StakeType.Undelegate, label: "Undelegate" },
|
|
@@ -4544,7 +5315,7 @@ var selectStyles = {
|
|
|
4544
5315
|
var StakeActionForm = ({ data, onChange }) => {
|
|
4545
5316
|
const isRedelegate = data.stakeType === StakeType.Redelegate;
|
|
4546
5317
|
const needsAmount = data.stakeType !== StakeType.WithdrawDelegatorReward;
|
|
4547
|
-
return /* @__PURE__ */
|
|
5318
|
+
return /* @__PURE__ */ React59.createElement(Stack35, { gap: "md" }, /* @__PURE__ */ React59.createElement(
|
|
4548
5319
|
Select4,
|
|
4549
5320
|
{
|
|
4550
5321
|
label: "Stake Type",
|
|
@@ -4554,7 +5325,7 @@ var StakeActionForm = ({ data, onChange }) => {
|
|
|
4554
5325
|
required: true,
|
|
4555
5326
|
styles: selectStyles
|
|
4556
5327
|
}
|
|
4557
|
-
), /* @__PURE__ */
|
|
5328
|
+
), /* @__PURE__ */ React59.createElement(
|
|
4558
5329
|
TextInput9,
|
|
4559
5330
|
{
|
|
4560
5331
|
label: "Validator Address",
|
|
@@ -4564,7 +5335,7 @@ var StakeActionForm = ({ data, onChange }) => {
|
|
|
4564
5335
|
required: true,
|
|
4565
5336
|
styles: inputStyles
|
|
4566
5337
|
}
|
|
4567
|
-
), isRedelegate && /* @__PURE__ */
|
|
5338
|
+
), isRedelegate && /* @__PURE__ */ React59.createElement(
|
|
4568
5339
|
TextInput9,
|
|
4569
5340
|
{
|
|
4570
5341
|
label: "Destination Validator Address",
|
|
@@ -4574,7 +5345,7 @@ var StakeActionForm = ({ data, onChange }) => {
|
|
|
4574
5345
|
required: true,
|
|
4575
5346
|
styles: inputStyles
|
|
4576
5347
|
}
|
|
4577
|
-
), needsAmount && /* @__PURE__ */
|
|
5348
|
+
), needsAmount && /* @__PURE__ */ React59.createElement(React59.Fragment, null, /* @__PURE__ */ React59.createElement(
|
|
4578
5349
|
NumberInput3,
|
|
4579
5350
|
{
|
|
4580
5351
|
label: "Amount",
|
|
@@ -4586,7 +5357,7 @@ var StakeActionForm = ({ data, onChange }) => {
|
|
|
4586
5357
|
required: true,
|
|
4587
5358
|
styles: inputStyles
|
|
4588
5359
|
}
|
|
4589
|
-
), /* @__PURE__ */
|
|
5360
|
+
), /* @__PURE__ */ React59.createElement(
|
|
4590
5361
|
Select4,
|
|
4591
5362
|
{
|
|
4592
5363
|
label: "Denomination",
|
|
@@ -4603,8 +5374,8 @@ var StakeActionForm = ({ data, onChange }) => {
|
|
|
4603
5374
|
};
|
|
4604
5375
|
|
|
4605
5376
|
// src/mantine/blocks/proposalActions/components/JoinActionForm.tsx
|
|
4606
|
-
import
|
|
4607
|
-
import { Stack as
|
|
5377
|
+
import React60 from "react";
|
|
5378
|
+
import { Stack as Stack36, TextInput as TextInput10 } from "@mantine/core";
|
|
4608
5379
|
var inputStyles2 = {
|
|
4609
5380
|
label: { color: "#adb5bd" },
|
|
4610
5381
|
input: {
|
|
@@ -4617,7 +5388,7 @@ var inputStyles2 = {
|
|
|
4617
5388
|
}
|
|
4618
5389
|
};
|
|
4619
5390
|
var JoinActionForm = ({ data, onChange }) => {
|
|
4620
|
-
return /* @__PURE__ */
|
|
5391
|
+
return /* @__PURE__ */ React60.createElement(Stack36, { gap: "md" }, /* @__PURE__ */ React60.createElement(
|
|
4621
5392
|
TextInput10,
|
|
4622
5393
|
{
|
|
4623
5394
|
label: "ID",
|
|
@@ -4627,7 +5398,7 @@ var JoinActionForm = ({ data, onChange }) => {
|
|
|
4627
5398
|
required: true,
|
|
4628
5399
|
styles: inputStyles2
|
|
4629
5400
|
}
|
|
4630
|
-
), /* @__PURE__ */
|
|
5401
|
+
), /* @__PURE__ */ React60.createElement(
|
|
4631
5402
|
TextInput10,
|
|
4632
5403
|
{
|
|
4633
5404
|
label: "Core Address",
|
|
@@ -4637,7 +5408,7 @@ var JoinActionForm = ({ data, onChange }) => {
|
|
|
4637
5408
|
required: true,
|
|
4638
5409
|
styles: inputStyles2
|
|
4639
5410
|
}
|
|
4640
|
-
), /* @__PURE__ */
|
|
5411
|
+
), /* @__PURE__ */ React60.createElement(
|
|
4641
5412
|
TextInput10,
|
|
4642
5413
|
{
|
|
4643
5414
|
label: "Address",
|
|
@@ -4651,8 +5422,8 @@ var JoinActionForm = ({ data, onChange }) => {
|
|
|
4651
5422
|
};
|
|
4652
5423
|
|
|
4653
5424
|
// src/mantine/blocks/proposalActions/components/forms/MintActionForm.tsx
|
|
4654
|
-
import
|
|
4655
|
-
import { Stack as
|
|
5425
|
+
import React61 from "react";
|
|
5426
|
+
import { Stack as Stack37, TextInput as TextInput11, NumberInput as NumberInput4 } from "@mantine/core";
|
|
4656
5427
|
var inputStyles3 = {
|
|
4657
5428
|
label: { color: "#adb5bd" },
|
|
4658
5429
|
input: {
|
|
@@ -4665,7 +5436,7 @@ var inputStyles3 = {
|
|
|
4665
5436
|
}
|
|
4666
5437
|
};
|
|
4667
5438
|
var MintActionForm = ({ data, onChange }) => {
|
|
4668
|
-
return /* @__PURE__ */
|
|
5439
|
+
return /* @__PURE__ */ React61.createElement(Stack37, { gap: "md" }, /* @__PURE__ */ React61.createElement(
|
|
4669
5440
|
TextInput11,
|
|
4670
5441
|
{
|
|
4671
5442
|
label: "Recipient Address",
|
|
@@ -4675,7 +5446,7 @@ var MintActionForm = ({ data, onChange }) => {
|
|
|
4675
5446
|
required: true,
|
|
4676
5447
|
styles: inputStyles3
|
|
4677
5448
|
}
|
|
4678
|
-
), /* @__PURE__ */
|
|
5449
|
+
), /* @__PURE__ */ React61.createElement(
|
|
4679
5450
|
NumberInput4,
|
|
4680
5451
|
{
|
|
4681
5452
|
label: "Amount",
|
|
@@ -4691,8 +5462,8 @@ var MintActionForm = ({ data, onChange }) => {
|
|
|
4691
5462
|
};
|
|
4692
5463
|
|
|
4693
5464
|
// src/mantine/blocks/proposalActions/components/forms/ExecuteActionForm.tsx
|
|
4694
|
-
import
|
|
4695
|
-
import { Stack as
|
|
5465
|
+
import React62, { useState as useState16 } from "react";
|
|
5466
|
+
import { Stack as Stack38, TextInput as TextInput12, Textarea as Textarea5, Button as Button15, Group as Group17, Text as Text34, Card as Card14 } from "@mantine/core";
|
|
4696
5467
|
var inputStyles4 = {
|
|
4697
5468
|
label: { color: "#adb5bd" },
|
|
4698
5469
|
input: {
|
|
@@ -4729,7 +5500,7 @@ var ExecuteActionForm = ({ data, onChange }) => {
|
|
|
4729
5500
|
return data.message;
|
|
4730
5501
|
}
|
|
4731
5502
|
};
|
|
4732
|
-
return /* @__PURE__ */
|
|
5503
|
+
return /* @__PURE__ */ React62.createElement(Stack38, { gap: "md" }, /* @__PURE__ */ React62.createElement(
|
|
4733
5504
|
TextInput12,
|
|
4734
5505
|
{
|
|
4735
5506
|
label: "Contract Address",
|
|
@@ -4739,7 +5510,7 @@ var ExecuteActionForm = ({ data, onChange }) => {
|
|
|
4739
5510
|
required: true,
|
|
4740
5511
|
styles: inputStyles4
|
|
4741
5512
|
}
|
|
4742
|
-
), /* @__PURE__ */
|
|
5513
|
+
), /* @__PURE__ */ React62.createElement(
|
|
4743
5514
|
Textarea5,
|
|
4744
5515
|
{
|
|
4745
5516
|
label: "Message (JSON)",
|
|
@@ -4750,15 +5521,15 @@ var ExecuteActionForm = ({ data, onChange }) => {
|
|
|
4750
5521
|
required: true,
|
|
4751
5522
|
styles: inputStyles4
|
|
4752
5523
|
}
|
|
4753
|
-
), /* @__PURE__ */
|
|
4754
|
-
|
|
5524
|
+
), /* @__PURE__ */ React62.createElement(Stack38, { gap: "xs" }, /* @__PURE__ */ React62.createElement(Text34, { size: "sm", fw: 500, style: { color: "#adb5bd" } }, "Funds (Optional)"), (data.funds || []).map((fund, index) => /* @__PURE__ */ React62.createElement(
|
|
5525
|
+
Card14,
|
|
4755
5526
|
{
|
|
4756
5527
|
key: index,
|
|
4757
5528
|
withBorder: true,
|
|
4758
5529
|
padding: "xs",
|
|
4759
5530
|
style: { backgroundColor: "#2a2a2a", borderColor: "#333" }
|
|
4760
5531
|
},
|
|
4761
|
-
/* @__PURE__ */
|
|
5532
|
+
/* @__PURE__ */ React62.createElement(Group17, { justify: "space-between" }, /* @__PURE__ */ React62.createElement(Text34, { size: "sm", style: { color: "#f1f3f5" } }, fund.amount, " ", fund.denom), /* @__PURE__ */ React62.createElement(
|
|
4762
5533
|
Button15,
|
|
4763
5534
|
{
|
|
4764
5535
|
size: "xs",
|
|
@@ -4768,7 +5539,7 @@ var ExecuteActionForm = ({ data, onChange }) => {
|
|
|
4768
5539
|
},
|
|
4769
5540
|
"Remove"
|
|
4770
5541
|
))
|
|
4771
|
-
)), /* @__PURE__ */
|
|
5542
|
+
)), /* @__PURE__ */ React62.createElement(Group17, { grow: true }, /* @__PURE__ */ React62.createElement(
|
|
4772
5543
|
TextInput12,
|
|
4773
5544
|
{
|
|
4774
5545
|
placeholder: "Amount",
|
|
@@ -4776,7 +5547,7 @@ var ExecuteActionForm = ({ data, onChange }) => {
|
|
|
4776
5547
|
onChange: (e) => setNewFund({ ...newFund, amount: e.currentTarget.value }),
|
|
4777
5548
|
styles: inputStyles4
|
|
4778
5549
|
}
|
|
4779
|
-
), /* @__PURE__ */
|
|
5550
|
+
), /* @__PURE__ */ React62.createElement(
|
|
4780
5551
|
TextInput12,
|
|
4781
5552
|
{
|
|
4782
5553
|
placeholder: "Denom (e.g., uixo)",
|
|
@@ -4784,7 +5555,7 @@ var ExecuteActionForm = ({ data, onChange }) => {
|
|
|
4784
5555
|
onChange: (e) => setNewFund({ ...newFund, denom: e.currentTarget.value }),
|
|
4785
5556
|
styles: inputStyles4
|
|
4786
5557
|
}
|
|
4787
|
-
), /* @__PURE__ */
|
|
5558
|
+
), /* @__PURE__ */ React62.createElement(
|
|
4788
5559
|
Button15,
|
|
4789
5560
|
{
|
|
4790
5561
|
size: "sm",
|
|
@@ -4799,9 +5570,9 @@ var ExecuteActionForm = ({ data, onChange }) => {
|
|
|
4799
5570
|
};
|
|
4800
5571
|
|
|
4801
5572
|
// src/mantine/blocks/proposalActions/components/forms/CustomActionForm.tsx
|
|
4802
|
-
import
|
|
4803
|
-
import { Stack as
|
|
4804
|
-
import { Group as
|
|
5573
|
+
import React63, { useState as useState17, useEffect as useEffect12 } from "react";
|
|
5574
|
+
import { Stack as Stack39, Textarea as Textarea6, Alert as Alert6, Text as Text35, Badge as Badge9 } from "@mantine/core";
|
|
5575
|
+
import { Group as Group18 } from "@mantine/core";
|
|
4805
5576
|
var inputStyles5 = {
|
|
4806
5577
|
label: { color: "#adb5bd" },
|
|
4807
5578
|
input: {
|
|
@@ -4837,8 +5608,8 @@ var CustomActionForm = ({ data, onChange }) => {
|
|
|
4837
5608
|
return data.message;
|
|
4838
5609
|
}
|
|
4839
5610
|
};
|
|
4840
|
-
return /* @__PURE__ */
|
|
4841
|
-
|
|
5611
|
+
return /* @__PURE__ */ React63.createElement(Stack39, { gap: "md" }, /* @__PURE__ */ React63.createElement(Alert6, { color: "yellow", style: { backgroundColor: "#2a2a2a", borderColor: "#ffd43b" } }, /* @__PURE__ */ React63.createElement(Text35, { size: "sm", style: { color: "#ffd43b" } }, "\u26A0\uFE0F Custom actions require valid JSON messages. Supports both Wasm and Stargate message formats.")), /* @__PURE__ */ React63.createElement("div", null, /* @__PURE__ */ React63.createElement(Group18, { gap: "xs", mb: "xs" }, /* @__PURE__ */ React63.createElement(Text35, { size: "sm", fw: 500, style: { color: "#adb5bd" } }, "Custom Message (JSON)"), /* @__PURE__ */ React63.createElement(
|
|
5612
|
+
Badge9,
|
|
4842
5613
|
{
|
|
4843
5614
|
size: "sm",
|
|
4844
5615
|
style: {
|
|
@@ -4847,7 +5618,7 @@ var CustomActionForm = ({ data, onChange }) => {
|
|
|
4847
5618
|
}
|
|
4848
5619
|
},
|
|
4849
5620
|
isValid ? "Valid JSON" : "Invalid JSON"
|
|
4850
|
-
)), /* @__PURE__ */
|
|
5621
|
+
)), /* @__PURE__ */ React63.createElement(
|
|
4851
5622
|
Textarea6,
|
|
4852
5623
|
{
|
|
4853
5624
|
placeholder: `Example Wasm message:
|
|
@@ -4880,8 +5651,8 @@ Example Stargate message:
|
|
|
4880
5651
|
};
|
|
4881
5652
|
|
|
4882
5653
|
// src/mantine/blocks/proposalActions/components/forms/AuthzExecActionForm.tsx
|
|
4883
|
-
import
|
|
4884
|
-
import { Stack as
|
|
5654
|
+
import React64 from "react";
|
|
5655
|
+
import { Stack as Stack40, Select as Select5, TextInput as TextInput13, Textarea as Textarea7 } from "@mantine/core";
|
|
4885
5656
|
var inputStyles6 = {
|
|
4886
5657
|
label: { color: "#adb5bd" },
|
|
4887
5658
|
input: {
|
|
@@ -4919,7 +5690,7 @@ var AuthzExecActionForm = ({
|
|
|
4919
5690
|
onChange({ ...data, [field]: value });
|
|
4920
5691
|
}
|
|
4921
5692
|
};
|
|
4922
|
-
return /* @__PURE__ */
|
|
5693
|
+
return /* @__PURE__ */ React64.createElement(Stack40, { gap: "md" }, /* @__PURE__ */ React64.createElement(
|
|
4923
5694
|
Select5,
|
|
4924
5695
|
{
|
|
4925
5696
|
label: "Action Type",
|
|
@@ -4930,7 +5701,7 @@ var AuthzExecActionForm = ({
|
|
|
4930
5701
|
required: true,
|
|
4931
5702
|
styles: inputStyles6
|
|
4932
5703
|
}
|
|
4933
|
-
), data.authzExecActionType === AuthzExecActionTypes.Delegate && /* @__PURE__ */
|
|
5704
|
+
), data.authzExecActionType === AuthzExecActionTypes.Delegate && /* @__PURE__ */ React64.createElement(
|
|
4934
5705
|
Textarea7,
|
|
4935
5706
|
{
|
|
4936
5707
|
label: "Delegate Message (JSON)",
|
|
@@ -4940,7 +5711,7 @@ var AuthzExecActionForm = ({
|
|
|
4940
5711
|
minRows: 4,
|
|
4941
5712
|
styles: inputStyles6
|
|
4942
5713
|
}
|
|
4943
|
-
), data.authzExecActionType === AuthzExecActionTypes.Undelegate && /* @__PURE__ */
|
|
5714
|
+
), data.authzExecActionType === AuthzExecActionTypes.Undelegate && /* @__PURE__ */ React64.createElement(
|
|
4944
5715
|
Textarea7,
|
|
4945
5716
|
{
|
|
4946
5717
|
label: "Undelegate Message (JSON)",
|
|
@@ -4950,7 +5721,7 @@ var AuthzExecActionForm = ({
|
|
|
4950
5721
|
minRows: 4,
|
|
4951
5722
|
styles: inputStyles6
|
|
4952
5723
|
}
|
|
4953
|
-
), data.authzExecActionType === AuthzExecActionTypes.Redelegate && /* @__PURE__ */
|
|
5724
|
+
), data.authzExecActionType === AuthzExecActionTypes.Redelegate && /* @__PURE__ */ React64.createElement(
|
|
4954
5725
|
Textarea7,
|
|
4955
5726
|
{
|
|
4956
5727
|
label: "Redelegate Message (JSON)",
|
|
@@ -4960,7 +5731,7 @@ var AuthzExecActionForm = ({
|
|
|
4960
5731
|
minRows: 4,
|
|
4961
5732
|
styles: inputStyles6
|
|
4962
5733
|
}
|
|
4963
|
-
), data.authzExecActionType === AuthzExecActionTypes.ClaimRewards && /* @__PURE__ */
|
|
5734
|
+
), data.authzExecActionType === AuthzExecActionTypes.ClaimRewards && /* @__PURE__ */ React64.createElement(
|
|
4964
5735
|
Textarea7,
|
|
4965
5736
|
{
|
|
4966
5737
|
label: "Claim Rewards Message (JSON)",
|
|
@@ -4970,7 +5741,7 @@ var AuthzExecActionForm = ({
|
|
|
4970
5741
|
minRows: 3,
|
|
4971
5742
|
styles: inputStyles6
|
|
4972
5743
|
}
|
|
4973
|
-
), data.authzExecActionType === AuthzExecActionTypes.Custom && /* @__PURE__ */
|
|
5744
|
+
), data.authzExecActionType === AuthzExecActionTypes.Custom && /* @__PURE__ */ React64.createElement(
|
|
4974
5745
|
TextInput13,
|
|
4975
5746
|
{
|
|
4976
5747
|
label: "Custom Message",
|
|
@@ -4983,8 +5754,8 @@ var AuthzExecActionForm = ({
|
|
|
4983
5754
|
};
|
|
4984
5755
|
|
|
4985
5756
|
// src/mantine/blocks/proposalActions/components/forms/AuthzGrantActionForm.tsx
|
|
4986
|
-
import
|
|
4987
|
-
import { Stack as
|
|
5757
|
+
import React65 from "react";
|
|
5758
|
+
import { Stack as Stack41, TextInput as TextInput14 } from "@mantine/core";
|
|
4988
5759
|
var inputStyles7 = {
|
|
4989
5760
|
label: { color: "#adb5bd" },
|
|
4990
5761
|
input: {
|
|
@@ -4997,7 +5768,7 @@ var inputStyles7 = {
|
|
|
4997
5768
|
}
|
|
4998
5769
|
};
|
|
4999
5770
|
var AuthzGrantActionForm = ({ data, onChange }) => {
|
|
5000
|
-
return /* @__PURE__ */
|
|
5771
|
+
return /* @__PURE__ */ React65.createElement(Stack41, { gap: "md" }, /* @__PURE__ */ React65.createElement(
|
|
5001
5772
|
TextInput14,
|
|
5002
5773
|
{
|
|
5003
5774
|
label: "Type URL",
|
|
@@ -5007,7 +5778,7 @@ var AuthzGrantActionForm = ({ data, onChange }) => {
|
|
|
5007
5778
|
required: true,
|
|
5008
5779
|
styles: inputStyles7
|
|
5009
5780
|
}
|
|
5010
|
-
), /* @__PURE__ */
|
|
5781
|
+
), /* @__PURE__ */ React65.createElement(
|
|
5011
5782
|
TextInput14,
|
|
5012
5783
|
{
|
|
5013
5784
|
label: "Grantee Address",
|
|
@@ -5020,7 +5791,7 @@ var AuthzGrantActionForm = ({ data, onChange }) => {
|
|
|
5020
5791
|
required: true,
|
|
5021
5792
|
styles: inputStyles7
|
|
5022
5793
|
}
|
|
5023
|
-
), /* @__PURE__ */
|
|
5794
|
+
), /* @__PURE__ */ React65.createElement(
|
|
5024
5795
|
TextInput14,
|
|
5025
5796
|
{
|
|
5026
5797
|
label: "Message Type URL",
|
|
@@ -5037,8 +5808,8 @@ var AuthzGrantActionForm = ({ data, onChange }) => {
|
|
|
5037
5808
|
};
|
|
5038
5809
|
|
|
5039
5810
|
// src/mantine/blocks/proposalActions/components/forms/BurnNftActionForm.tsx
|
|
5040
|
-
import
|
|
5041
|
-
import { Stack as
|
|
5811
|
+
import React66 from "react";
|
|
5812
|
+
import { Stack as Stack42, TextInput as TextInput15 } from "@mantine/core";
|
|
5042
5813
|
var inputStyles8 = {
|
|
5043
5814
|
label: { color: "#adb5bd" },
|
|
5044
5815
|
input: {
|
|
@@ -5051,7 +5822,7 @@ var inputStyles8 = {
|
|
|
5051
5822
|
}
|
|
5052
5823
|
};
|
|
5053
5824
|
var BurnNftActionForm = ({ data, onChange }) => {
|
|
5054
|
-
return /* @__PURE__ */
|
|
5825
|
+
return /* @__PURE__ */ React66.createElement(Stack42, { gap: "md" }, /* @__PURE__ */ React66.createElement(
|
|
5055
5826
|
TextInput15,
|
|
5056
5827
|
{
|
|
5057
5828
|
label: "Collection Address",
|
|
@@ -5061,7 +5832,7 @@ var BurnNftActionForm = ({ data, onChange }) => {
|
|
|
5061
5832
|
required: true,
|
|
5062
5833
|
styles: inputStyles8
|
|
5063
5834
|
}
|
|
5064
|
-
), /* @__PURE__ */
|
|
5835
|
+
), /* @__PURE__ */ React66.createElement(
|
|
5065
5836
|
TextInput15,
|
|
5066
5837
|
{
|
|
5067
5838
|
label: "Token ID",
|
|
@@ -5075,8 +5846,8 @@ var BurnNftActionForm = ({ data, onChange }) => {
|
|
|
5075
5846
|
};
|
|
5076
5847
|
|
|
5077
5848
|
// src/mantine/blocks/proposalActions/components/forms/TransferNftActionForm.tsx
|
|
5078
|
-
import
|
|
5079
|
-
import { Stack as
|
|
5849
|
+
import React67 from "react";
|
|
5850
|
+
import { Stack as Stack43, TextInput as TextInput16, Checkbox as Checkbox4, Textarea as Textarea8 } from "@mantine/core";
|
|
5080
5851
|
var inputStyles9 = {
|
|
5081
5852
|
label: { color: "#adb5bd" },
|
|
5082
5853
|
input: {
|
|
@@ -5092,7 +5863,7 @@ var TransferNftActionForm = ({
|
|
|
5092
5863
|
data,
|
|
5093
5864
|
onChange
|
|
5094
5865
|
}) => {
|
|
5095
|
-
return /* @__PURE__ */
|
|
5866
|
+
return /* @__PURE__ */ React67.createElement(Stack43, { gap: "md" }, /* @__PURE__ */ React67.createElement(
|
|
5096
5867
|
TextInput16,
|
|
5097
5868
|
{
|
|
5098
5869
|
label: "Collection Address",
|
|
@@ -5102,7 +5873,7 @@ var TransferNftActionForm = ({
|
|
|
5102
5873
|
required: true,
|
|
5103
5874
|
styles: inputStyles9
|
|
5104
5875
|
}
|
|
5105
|
-
), /* @__PURE__ */
|
|
5876
|
+
), /* @__PURE__ */ React67.createElement(
|
|
5106
5877
|
TextInput16,
|
|
5107
5878
|
{
|
|
5108
5879
|
label: "Token ID",
|
|
@@ -5112,7 +5883,7 @@ var TransferNftActionForm = ({
|
|
|
5112
5883
|
required: true,
|
|
5113
5884
|
styles: inputStyles9
|
|
5114
5885
|
}
|
|
5115
|
-
), /* @__PURE__ */
|
|
5886
|
+
), /* @__PURE__ */ React67.createElement(
|
|
5116
5887
|
TextInput16,
|
|
5117
5888
|
{
|
|
5118
5889
|
label: "Recipient Address",
|
|
@@ -5122,8 +5893,8 @@ var TransferNftActionForm = ({
|
|
|
5122
5893
|
required: true,
|
|
5123
5894
|
styles: inputStyles9
|
|
5124
5895
|
}
|
|
5125
|
-
), /* @__PURE__ */
|
|
5126
|
-
|
|
5896
|
+
), /* @__PURE__ */ React67.createElement(
|
|
5897
|
+
Checkbox4,
|
|
5127
5898
|
{
|
|
5128
5899
|
label: "Execute Smart Contract",
|
|
5129
5900
|
checked: data.executeSmartContract,
|
|
@@ -5133,7 +5904,7 @@ var TransferNftActionForm = ({
|
|
|
5133
5904
|
input: { backgroundColor: "#2a2a2a", borderColor: "#333" }
|
|
5134
5905
|
}
|
|
5135
5906
|
}
|
|
5136
|
-
), data.executeSmartContract && /* @__PURE__ */
|
|
5907
|
+
), data.executeSmartContract && /* @__PURE__ */ React67.createElement(
|
|
5137
5908
|
Textarea8,
|
|
5138
5909
|
{
|
|
5139
5910
|
label: "Smart Contract Message (JSON)",
|
|
@@ -5147,8 +5918,8 @@ var TransferNftActionForm = ({
|
|
|
5147
5918
|
};
|
|
5148
5919
|
|
|
5149
5920
|
// src/mantine/blocks/proposalActions/components/forms/ManageCw721ActionForm.tsx
|
|
5150
|
-
import
|
|
5151
|
-
import { Stack as
|
|
5921
|
+
import React68 from "react";
|
|
5922
|
+
import { Stack as Stack44, TextInput as TextInput17, Radio, Group as Group19 } from "@mantine/core";
|
|
5152
5923
|
var inputStyles10 = {
|
|
5153
5924
|
label: { color: "#adb5bd" },
|
|
5154
5925
|
input: {
|
|
@@ -5164,14 +5935,14 @@ var ManageCw721ActionForm = ({
|
|
|
5164
5935
|
data,
|
|
5165
5936
|
onChange
|
|
5166
5937
|
}) => {
|
|
5167
|
-
return /* @__PURE__ */
|
|
5938
|
+
return /* @__PURE__ */ React68.createElement(Stack44, { gap: "md" }, /* @__PURE__ */ React68.createElement(
|
|
5168
5939
|
Radio.Group,
|
|
5169
5940
|
{
|
|
5170
5941
|
label: "Action",
|
|
5171
5942
|
value: data.adding ? "add" : "remove",
|
|
5172
5943
|
onChange: (value) => onChange({ ...data, adding: value === "add" })
|
|
5173
5944
|
},
|
|
5174
|
-
/* @__PURE__ */
|
|
5945
|
+
/* @__PURE__ */ React68.createElement(Group19, { mt: "xs" }, /* @__PURE__ */ React68.createElement(
|
|
5175
5946
|
Radio,
|
|
5176
5947
|
{
|
|
5177
5948
|
value: "add",
|
|
@@ -5181,7 +5952,7 @@ var ManageCw721ActionForm = ({
|
|
|
5181
5952
|
radio: { backgroundColor: "#2a2a2a", borderColor: "#333" }
|
|
5182
5953
|
}
|
|
5183
5954
|
}
|
|
5184
|
-
), /* @__PURE__ */
|
|
5955
|
+
), /* @__PURE__ */ React68.createElement(
|
|
5185
5956
|
Radio,
|
|
5186
5957
|
{
|
|
5187
5958
|
value: "remove",
|
|
@@ -5192,7 +5963,7 @@ var ManageCw721ActionForm = ({
|
|
|
5192
5963
|
}
|
|
5193
5964
|
}
|
|
5194
5965
|
))
|
|
5195
|
-
), /* @__PURE__ */
|
|
5966
|
+
), /* @__PURE__ */ React68.createElement(
|
|
5196
5967
|
TextInput17,
|
|
5197
5968
|
{
|
|
5198
5969
|
label: "NFT Contract Address",
|
|
@@ -5206,8 +5977,8 @@ var ManageCw721ActionForm = ({
|
|
|
5206
5977
|
};
|
|
5207
5978
|
|
|
5208
5979
|
// src/mantine/blocks/proposalActions/components/forms/InstantiateActionForm.tsx
|
|
5209
|
-
import
|
|
5210
|
-
import { Stack as
|
|
5980
|
+
import React69, { useState as useState18 } from "react";
|
|
5981
|
+
import { Stack as Stack45, TextInput as TextInput18, Textarea as Textarea9, NumberInput as NumberInput5, Button as Button16, Group as Group20, Text as Text36, Card as Card15 } from "@mantine/core";
|
|
5211
5982
|
var inputStyles11 = {
|
|
5212
5983
|
label: { color: "#adb5bd" },
|
|
5213
5984
|
input: {
|
|
@@ -5247,7 +6018,7 @@ var InstantiateActionForm = ({
|
|
|
5247
6018
|
return data.message;
|
|
5248
6019
|
}
|
|
5249
6020
|
};
|
|
5250
|
-
return /* @__PURE__ */
|
|
6021
|
+
return /* @__PURE__ */ React69.createElement(Stack45, { gap: "md" }, /* @__PURE__ */ React69.createElement(
|
|
5251
6022
|
TextInput18,
|
|
5252
6023
|
{
|
|
5253
6024
|
label: "Admin Address",
|
|
@@ -5257,7 +6028,7 @@ var InstantiateActionForm = ({
|
|
|
5257
6028
|
required: true,
|
|
5258
6029
|
styles: inputStyles11
|
|
5259
6030
|
}
|
|
5260
|
-
), /* @__PURE__ */
|
|
6031
|
+
), /* @__PURE__ */ React69.createElement(
|
|
5261
6032
|
NumberInput5,
|
|
5262
6033
|
{
|
|
5263
6034
|
label: "Code ID",
|
|
@@ -5268,7 +6039,7 @@ var InstantiateActionForm = ({
|
|
|
5268
6039
|
required: true,
|
|
5269
6040
|
styles: inputStyles11
|
|
5270
6041
|
}
|
|
5271
|
-
), /* @__PURE__ */
|
|
6042
|
+
), /* @__PURE__ */ React69.createElement(
|
|
5272
6043
|
TextInput18,
|
|
5273
6044
|
{
|
|
5274
6045
|
label: "Label",
|
|
@@ -5278,7 +6049,7 @@ var InstantiateActionForm = ({
|
|
|
5278
6049
|
required: true,
|
|
5279
6050
|
styles: inputStyles11
|
|
5280
6051
|
}
|
|
5281
|
-
), /* @__PURE__ */
|
|
6052
|
+
), /* @__PURE__ */ React69.createElement(
|
|
5282
6053
|
Textarea9,
|
|
5283
6054
|
{
|
|
5284
6055
|
label: "Instantiate Message (JSON)",
|
|
@@ -5289,15 +6060,15 @@ var InstantiateActionForm = ({
|
|
|
5289
6060
|
required: true,
|
|
5290
6061
|
styles: inputStyles11
|
|
5291
6062
|
}
|
|
5292
|
-
), /* @__PURE__ */
|
|
5293
|
-
|
|
6063
|
+
), /* @__PURE__ */ React69.createElement(Stack45, { gap: "xs" }, /* @__PURE__ */ React69.createElement(Text36, { size: "sm", fw: 500, style: { color: "#adb5bd" } }, "Funds (Optional)"), (data.funds || []).map((fund, index) => /* @__PURE__ */ React69.createElement(
|
|
6064
|
+
Card15,
|
|
5294
6065
|
{
|
|
5295
6066
|
key: index,
|
|
5296
6067
|
withBorder: true,
|
|
5297
6068
|
padding: "xs",
|
|
5298
6069
|
style: { backgroundColor: "#2a2a2a", borderColor: "#333" }
|
|
5299
6070
|
},
|
|
5300
|
-
/* @__PURE__ */
|
|
6071
|
+
/* @__PURE__ */ React69.createElement(Group20, { justify: "space-between" }, /* @__PURE__ */ React69.createElement(Text36, { size: "sm", style: { color: "#f1f3f5" } }, fund.amount, " ", fund.denom), /* @__PURE__ */ React69.createElement(
|
|
5301
6072
|
Button16,
|
|
5302
6073
|
{
|
|
5303
6074
|
size: "xs",
|
|
@@ -5307,7 +6078,7 @@ var InstantiateActionForm = ({
|
|
|
5307
6078
|
},
|
|
5308
6079
|
"Remove"
|
|
5309
6080
|
))
|
|
5310
|
-
)), /* @__PURE__ */
|
|
6081
|
+
)), /* @__PURE__ */ React69.createElement(Group20, { grow: true }, /* @__PURE__ */ React69.createElement(
|
|
5311
6082
|
TextInput18,
|
|
5312
6083
|
{
|
|
5313
6084
|
placeholder: "Amount",
|
|
@@ -5315,7 +6086,7 @@ var InstantiateActionForm = ({
|
|
|
5315
6086
|
onChange: (e) => setNewFund({ ...newFund, amount: e.currentTarget.value }),
|
|
5316
6087
|
styles: inputStyles11
|
|
5317
6088
|
}
|
|
5318
|
-
), /* @__PURE__ */
|
|
6089
|
+
), /* @__PURE__ */ React69.createElement(
|
|
5319
6090
|
TextInput18,
|
|
5320
6091
|
{
|
|
5321
6092
|
placeholder: "Denom (e.g., uixo)",
|
|
@@ -5323,7 +6094,7 @@ var InstantiateActionForm = ({
|
|
|
5323
6094
|
onChange: (e) => setNewFund({ ...newFund, denom: e.currentTarget.value }),
|
|
5324
6095
|
styles: inputStyles11
|
|
5325
6096
|
}
|
|
5326
|
-
), /* @__PURE__ */
|
|
6097
|
+
), /* @__PURE__ */ React69.createElement(
|
|
5327
6098
|
Button16,
|
|
5328
6099
|
{
|
|
5329
6100
|
size: "sm",
|
|
@@ -5338,8 +6109,8 @@ var InstantiateActionForm = ({
|
|
|
5338
6109
|
};
|
|
5339
6110
|
|
|
5340
6111
|
// src/mantine/blocks/proposalActions/components/forms/MigrateActionForm.tsx
|
|
5341
|
-
import
|
|
5342
|
-
import { Stack as
|
|
6112
|
+
import React70 from "react";
|
|
6113
|
+
import { Stack as Stack46, TextInput as TextInput19, Textarea as Textarea10, NumberInput as NumberInput6 } from "@mantine/core";
|
|
5343
6114
|
var inputStyles12 = {
|
|
5344
6115
|
label: { color: "#adb5bd" },
|
|
5345
6116
|
input: {
|
|
@@ -5360,7 +6131,7 @@ var MigrateActionForm = ({ data, onChange }) => {
|
|
|
5360
6131
|
return data.msg;
|
|
5361
6132
|
}
|
|
5362
6133
|
};
|
|
5363
|
-
return /* @__PURE__ */
|
|
6134
|
+
return /* @__PURE__ */ React70.createElement(Stack46, { gap: "md" }, /* @__PURE__ */ React70.createElement(
|
|
5364
6135
|
TextInput19,
|
|
5365
6136
|
{
|
|
5366
6137
|
label: "Contract Address",
|
|
@@ -5370,7 +6141,7 @@ var MigrateActionForm = ({ data, onChange }) => {
|
|
|
5370
6141
|
required: true,
|
|
5371
6142
|
styles: inputStyles12
|
|
5372
6143
|
}
|
|
5373
|
-
), /* @__PURE__ */
|
|
6144
|
+
), /* @__PURE__ */ React70.createElement(
|
|
5374
6145
|
NumberInput6,
|
|
5375
6146
|
{
|
|
5376
6147
|
label: "New Code ID",
|
|
@@ -5381,7 +6152,7 @@ var MigrateActionForm = ({ data, onChange }) => {
|
|
|
5381
6152
|
required: true,
|
|
5382
6153
|
styles: inputStyles12
|
|
5383
6154
|
}
|
|
5384
|
-
), /* @__PURE__ */
|
|
6155
|
+
), /* @__PURE__ */ React70.createElement(
|
|
5385
6156
|
Textarea10,
|
|
5386
6157
|
{
|
|
5387
6158
|
label: "Migration Message (JSON)",
|
|
@@ -5396,8 +6167,8 @@ var MigrateActionForm = ({ data, onChange }) => {
|
|
|
5396
6167
|
};
|
|
5397
6168
|
|
|
5398
6169
|
// src/mantine/blocks/proposalActions/components/forms/UpdateAdminActionForm.tsx
|
|
5399
|
-
import
|
|
5400
|
-
import { Stack as
|
|
6170
|
+
import React71 from "react";
|
|
6171
|
+
import { Stack as Stack47, TextInput as TextInput20 } from "@mantine/core";
|
|
5401
6172
|
var inputStyles13 = {
|
|
5402
6173
|
label: { color: "#adb5bd" },
|
|
5403
6174
|
input: {
|
|
@@ -5413,7 +6184,7 @@ var UpdateAdminActionForm = ({
|
|
|
5413
6184
|
data,
|
|
5414
6185
|
onChange
|
|
5415
6186
|
}) => {
|
|
5416
|
-
return /* @__PURE__ */
|
|
6187
|
+
return /* @__PURE__ */ React71.createElement(Stack47, { gap: "md" }, /* @__PURE__ */ React71.createElement(
|
|
5417
6188
|
TextInput20,
|
|
5418
6189
|
{
|
|
5419
6190
|
label: "Contract Address",
|
|
@@ -5423,7 +6194,7 @@ var UpdateAdminActionForm = ({
|
|
|
5423
6194
|
required: true,
|
|
5424
6195
|
styles: inputStyles13
|
|
5425
6196
|
}
|
|
5426
|
-
), /* @__PURE__ */
|
|
6197
|
+
), /* @__PURE__ */ React71.createElement(
|
|
5427
6198
|
TextInput20,
|
|
5428
6199
|
{
|
|
5429
6200
|
label: "New Admin Address",
|
|
@@ -5437,8 +6208,8 @@ var UpdateAdminActionForm = ({
|
|
|
5437
6208
|
};
|
|
5438
6209
|
|
|
5439
6210
|
// src/mantine/blocks/proposalActions/components/forms/ManageCw20ActionForm.tsx
|
|
5440
|
-
import
|
|
5441
|
-
import { Stack as
|
|
6211
|
+
import React72 from "react";
|
|
6212
|
+
import { Stack as Stack48, TextInput as TextInput21, Radio as Radio2, Group as Group21 } from "@mantine/core";
|
|
5442
6213
|
var inputStyles14 = {
|
|
5443
6214
|
label: { color: "#adb5bd" },
|
|
5444
6215
|
input: {
|
|
@@ -5454,14 +6225,14 @@ var ManageCw20ActionForm = ({
|
|
|
5454
6225
|
data,
|
|
5455
6226
|
onChange
|
|
5456
6227
|
}) => {
|
|
5457
|
-
return /* @__PURE__ */
|
|
6228
|
+
return /* @__PURE__ */ React72.createElement(Stack48, { gap: "md" }, /* @__PURE__ */ React72.createElement(
|
|
5458
6229
|
Radio2.Group,
|
|
5459
6230
|
{
|
|
5460
6231
|
label: "Action",
|
|
5461
6232
|
value: data.adding ? "add" : "remove",
|
|
5462
6233
|
onChange: (value) => onChange({ ...data, adding: value === "add" })
|
|
5463
6234
|
},
|
|
5464
|
-
/* @__PURE__ */
|
|
6235
|
+
/* @__PURE__ */ React72.createElement(Group21, { mt: "xs" }, /* @__PURE__ */ React72.createElement(
|
|
5465
6236
|
Radio2,
|
|
5466
6237
|
{
|
|
5467
6238
|
value: "add",
|
|
@@ -5471,7 +6242,7 @@ var ManageCw20ActionForm = ({
|
|
|
5471
6242
|
radio: { backgroundColor: "#2a2a2a", borderColor: "#333" }
|
|
5472
6243
|
}
|
|
5473
6244
|
}
|
|
5474
|
-
), /* @__PURE__ */
|
|
6245
|
+
), /* @__PURE__ */ React72.createElement(
|
|
5475
6246
|
Radio2,
|
|
5476
6247
|
{
|
|
5477
6248
|
value: "remove",
|
|
@@ -5482,7 +6253,7 @@ var ManageCw20ActionForm = ({
|
|
|
5482
6253
|
}
|
|
5483
6254
|
}
|
|
5484
6255
|
))
|
|
5485
|
-
), /* @__PURE__ */
|
|
6256
|
+
), /* @__PURE__ */ React72.createElement(
|
|
5486
6257
|
TextInput21,
|
|
5487
6258
|
{
|
|
5488
6259
|
label: "Token Contract Address",
|
|
@@ -5496,8 +6267,8 @@ var ManageCw20ActionForm = ({
|
|
|
5496
6267
|
};
|
|
5497
6268
|
|
|
5498
6269
|
// src/mantine/blocks/proposalActions/components/forms/ManageSubDaosActionForm.tsx
|
|
5499
|
-
import
|
|
5500
|
-
import { Stack as
|
|
6270
|
+
import React73, { useState as useState19 } from "react";
|
|
6271
|
+
import { Stack as Stack49, TextInput as TextInput22, Button as Button17, Group as Group22, Text as Text37, Card as Card16, Textarea as Textarea11 } from "@mantine/core";
|
|
5501
6272
|
var inputStyles15 = {
|
|
5502
6273
|
label: { color: "#adb5bd" },
|
|
5503
6274
|
input: {
|
|
@@ -5545,15 +6316,15 @@ var ManageSubDaosActionForm = ({
|
|
|
5545
6316
|
toRemove: (data.toRemove || []).filter((_, i) => i !== index)
|
|
5546
6317
|
});
|
|
5547
6318
|
};
|
|
5548
|
-
return /* @__PURE__ */
|
|
5549
|
-
|
|
6319
|
+
return /* @__PURE__ */ React73.createElement(Stack49, { gap: "md" }, /* @__PURE__ */ React73.createElement(Stack49, { gap: "xs" }, /* @__PURE__ */ React73.createElement(Text37, { size: "sm", fw: 500, style: { color: "#adb5bd" } }, "SubDAOs to Add"), (data.toAdd || []).map((subDao, index) => /* @__PURE__ */ React73.createElement(
|
|
6320
|
+
Card16,
|
|
5550
6321
|
{
|
|
5551
6322
|
key: index,
|
|
5552
6323
|
withBorder: true,
|
|
5553
6324
|
padding: "xs",
|
|
5554
6325
|
style: { backgroundColor: "#2a2a2a", borderColor: "#333" }
|
|
5555
6326
|
},
|
|
5556
|
-
/* @__PURE__ */
|
|
6327
|
+
/* @__PURE__ */ React73.createElement(Stack49, { gap: "xs" }, /* @__PURE__ */ React73.createElement(Group22, { justify: "space-between" }, /* @__PURE__ */ React73.createElement(Text37, { size: "sm", style: { color: "#f1f3f5" } }, subDao.addr), /* @__PURE__ */ React73.createElement(
|
|
5557
6328
|
Button17,
|
|
5558
6329
|
{
|
|
5559
6330
|
size: "xs",
|
|
@@ -5562,8 +6333,8 @@ var ManageSubDaosActionForm = ({
|
|
|
5562
6333
|
style: { color: "#ff6b6b" }
|
|
5563
6334
|
},
|
|
5564
6335
|
"Remove"
|
|
5565
|
-
)), subDao.charter && /* @__PURE__ */
|
|
5566
|
-
)), /* @__PURE__ */
|
|
6336
|
+
)), subDao.charter && /* @__PURE__ */ React73.createElement(Text37, { size: "xs", style: { color: "#adb5bd" } }, "Charter: ", subDao.charter))
|
|
6337
|
+
)), /* @__PURE__ */ React73.createElement(Stack49, { gap: "xs" }, /* @__PURE__ */ React73.createElement(
|
|
5567
6338
|
TextInput22,
|
|
5568
6339
|
{
|
|
5569
6340
|
placeholder: "SubDAO Address",
|
|
@@ -5571,7 +6342,7 @@ var ManageSubDaosActionForm = ({
|
|
|
5571
6342
|
onChange: (e) => setNewSubDao({ ...newSubDao, addr: e.currentTarget.value }),
|
|
5572
6343
|
styles: inputStyles15
|
|
5573
6344
|
}
|
|
5574
|
-
), /* @__PURE__ */
|
|
6345
|
+
), /* @__PURE__ */ React73.createElement(
|
|
5575
6346
|
Textarea11,
|
|
5576
6347
|
{
|
|
5577
6348
|
placeholder: "Charter (optional)",
|
|
@@ -5580,7 +6351,7 @@ var ManageSubDaosActionForm = ({
|
|
|
5580
6351
|
minRows: 2,
|
|
5581
6352
|
styles: inputStyles15
|
|
5582
6353
|
}
|
|
5583
|
-
), /* @__PURE__ */
|
|
6354
|
+
), /* @__PURE__ */ React73.createElement(
|
|
5584
6355
|
Button17,
|
|
5585
6356
|
{
|
|
5586
6357
|
size: "sm",
|
|
@@ -5591,15 +6362,15 @@ var ManageSubDaosActionForm = ({
|
|
|
5591
6362
|
}
|
|
5592
6363
|
},
|
|
5593
6364
|
"Add SubDAO"
|
|
5594
|
-
))), /* @__PURE__ */
|
|
5595
|
-
|
|
6365
|
+
))), /* @__PURE__ */ React73.createElement(Stack49, { gap: "xs" }, /* @__PURE__ */ React73.createElement(Text37, { size: "sm", fw: 500, style: { color: "#adb5bd" } }, "SubDAOs to Remove"), (data.toRemove || []).map((subDao, index) => /* @__PURE__ */ React73.createElement(
|
|
6366
|
+
Card16,
|
|
5596
6367
|
{
|
|
5597
6368
|
key: index,
|
|
5598
6369
|
withBorder: true,
|
|
5599
6370
|
padding: "xs",
|
|
5600
6371
|
style: { backgroundColor: "#2a2a2a", borderColor: "#333" }
|
|
5601
6372
|
},
|
|
5602
|
-
/* @__PURE__ */
|
|
6373
|
+
/* @__PURE__ */ React73.createElement(Group22, { justify: "space-between" }, /* @__PURE__ */ React73.createElement(Text37, { size: "sm", style: { color: "#f1f3f5" } }, subDao.address), /* @__PURE__ */ React73.createElement(
|
|
5603
6374
|
Button17,
|
|
5604
6375
|
{
|
|
5605
6376
|
size: "xs",
|
|
@@ -5609,7 +6380,7 @@ var ManageSubDaosActionForm = ({
|
|
|
5609
6380
|
},
|
|
5610
6381
|
"Remove"
|
|
5611
6382
|
))
|
|
5612
|
-
)), /* @__PURE__ */
|
|
6383
|
+
)), /* @__PURE__ */ React73.createElement(Group22, { grow: true }, /* @__PURE__ */ React73.createElement(
|
|
5613
6384
|
TextInput22,
|
|
5614
6385
|
{
|
|
5615
6386
|
placeholder: "SubDAO Address to Remove",
|
|
@@ -5617,7 +6388,7 @@ var ManageSubDaosActionForm = ({
|
|
|
5617
6388
|
onChange: (e) => setNewRemoveAddress(e.currentTarget.value),
|
|
5618
6389
|
styles: inputStyles15
|
|
5619
6390
|
}
|
|
5620
|
-
), /* @__PURE__ */
|
|
6391
|
+
), /* @__PURE__ */ React73.createElement(
|
|
5621
6392
|
Button17,
|
|
5622
6393
|
{
|
|
5623
6394
|
size: "sm",
|
|
@@ -5632,8 +6403,8 @@ var ManageSubDaosActionForm = ({
|
|
|
5632
6403
|
};
|
|
5633
6404
|
|
|
5634
6405
|
// src/mantine/blocks/proposalActions/components/forms/UpdateInfoActionForm.tsx
|
|
5635
|
-
import
|
|
5636
|
-
import { Stack as
|
|
6406
|
+
import React74 from "react";
|
|
6407
|
+
import { Stack as Stack50, TextInput as TextInput23, Textarea as Textarea12, Checkbox as Checkbox5 } from "@mantine/core";
|
|
5637
6408
|
var inputStyles16 = {
|
|
5638
6409
|
label: { color: "#adb5bd" },
|
|
5639
6410
|
input: {
|
|
@@ -5649,7 +6420,7 @@ var UpdateInfoActionForm = ({
|
|
|
5649
6420
|
data,
|
|
5650
6421
|
onChange
|
|
5651
6422
|
}) => {
|
|
5652
|
-
return /* @__PURE__ */
|
|
6423
|
+
return /* @__PURE__ */ React74.createElement(Stack50, { gap: "md" }, /* @__PURE__ */ React74.createElement(
|
|
5653
6424
|
TextInput23,
|
|
5654
6425
|
{
|
|
5655
6426
|
label: "DAO Name",
|
|
@@ -5659,7 +6430,7 @@ var UpdateInfoActionForm = ({
|
|
|
5659
6430
|
required: true,
|
|
5660
6431
|
styles: inputStyles16
|
|
5661
6432
|
}
|
|
5662
|
-
), /* @__PURE__ */
|
|
6433
|
+
), /* @__PURE__ */ React74.createElement(
|
|
5663
6434
|
Textarea12,
|
|
5664
6435
|
{
|
|
5665
6436
|
label: "Description",
|
|
@@ -5669,7 +6440,7 @@ var UpdateInfoActionForm = ({
|
|
|
5669
6440
|
minRows: 3,
|
|
5670
6441
|
styles: inputStyles16
|
|
5671
6442
|
}
|
|
5672
|
-
), /* @__PURE__ */
|
|
6443
|
+
), /* @__PURE__ */ React74.createElement(
|
|
5673
6444
|
TextInput23,
|
|
5674
6445
|
{
|
|
5675
6446
|
label: "Image URL (Optional)",
|
|
@@ -5678,7 +6449,7 @@ var UpdateInfoActionForm = ({
|
|
|
5678
6449
|
onChange: (e) => onChange({ ...data, image_url: e.currentTarget.value || null }),
|
|
5679
6450
|
styles: inputStyles16
|
|
5680
6451
|
}
|
|
5681
|
-
), /* @__PURE__ */
|
|
6452
|
+
), /* @__PURE__ */ React74.createElement(
|
|
5682
6453
|
TextInput23,
|
|
5683
6454
|
{
|
|
5684
6455
|
label: "DAO URI (Optional)",
|
|
@@ -5687,8 +6458,8 @@ var UpdateInfoActionForm = ({
|
|
|
5687
6458
|
onChange: (e) => onChange({ ...data, dao_uri: e.currentTarget.value || null }),
|
|
5688
6459
|
styles: inputStyles16
|
|
5689
6460
|
}
|
|
5690
|
-
), /* @__PURE__ */
|
|
5691
|
-
|
|
6461
|
+
), /* @__PURE__ */ React74.createElement(
|
|
6462
|
+
Checkbox5,
|
|
5692
6463
|
{
|
|
5693
6464
|
label: "Automatically add CW20 tokens",
|
|
5694
6465
|
checked: data.automatically_add_cw20s,
|
|
@@ -5698,8 +6469,8 @@ var UpdateInfoActionForm = ({
|
|
|
5698
6469
|
input: { backgroundColor: "#2a2a2a", borderColor: "#333" }
|
|
5699
6470
|
}
|
|
5700
6471
|
}
|
|
5701
|
-
), /* @__PURE__ */
|
|
5702
|
-
|
|
6472
|
+
), /* @__PURE__ */ React74.createElement(
|
|
6473
|
+
Checkbox5,
|
|
5703
6474
|
{
|
|
5704
6475
|
label: "Automatically add CW721 NFTs",
|
|
5705
6476
|
checked: data.automatically_add_cw721s,
|
|
@@ -5713,8 +6484,8 @@ var UpdateInfoActionForm = ({
|
|
|
5713
6484
|
};
|
|
5714
6485
|
|
|
5715
6486
|
// src/mantine/blocks/proposalActions/components/forms/ManageStorageItemsActionForm.tsx
|
|
5716
|
-
import
|
|
5717
|
-
import { Stack as
|
|
6487
|
+
import React75 from "react";
|
|
6488
|
+
import { Stack as Stack51, TextInput as TextInput24, Radio as Radio3, Group as Group23, Textarea as Textarea13 } from "@mantine/core";
|
|
5718
6489
|
var inputStyles17 = {
|
|
5719
6490
|
label: { color: "#adb5bd" },
|
|
5720
6491
|
input: {
|
|
@@ -5730,14 +6501,14 @@ var ManageStorageItemsActionForm = ({
|
|
|
5730
6501
|
data,
|
|
5731
6502
|
onChange
|
|
5732
6503
|
}) => {
|
|
5733
|
-
return /* @__PURE__ */
|
|
6504
|
+
return /* @__PURE__ */ React75.createElement(Stack51, { gap: "md" }, /* @__PURE__ */ React75.createElement(
|
|
5734
6505
|
Radio3.Group,
|
|
5735
6506
|
{
|
|
5736
6507
|
label: "Action",
|
|
5737
6508
|
value: data.setting ? "set" : "remove",
|
|
5738
6509
|
onChange: (value) => onChange({ ...data, setting: value === "set" })
|
|
5739
6510
|
},
|
|
5740
|
-
/* @__PURE__ */
|
|
6511
|
+
/* @__PURE__ */ React75.createElement(Group23, { mt: "xs" }, /* @__PURE__ */ React75.createElement(
|
|
5741
6512
|
Radio3,
|
|
5742
6513
|
{
|
|
5743
6514
|
value: "set",
|
|
@@ -5747,7 +6518,7 @@ var ManageStorageItemsActionForm = ({
|
|
|
5747
6518
|
radio: { backgroundColor: "#2a2a2a", borderColor: "#333" }
|
|
5748
6519
|
}
|
|
5749
6520
|
}
|
|
5750
|
-
), /* @__PURE__ */
|
|
6521
|
+
), /* @__PURE__ */ React75.createElement(
|
|
5751
6522
|
Radio3,
|
|
5752
6523
|
{
|
|
5753
6524
|
value: "remove",
|
|
@@ -5758,7 +6529,7 @@ var ManageStorageItemsActionForm = ({
|
|
|
5758
6529
|
}
|
|
5759
6530
|
}
|
|
5760
6531
|
))
|
|
5761
|
-
), /* @__PURE__ */
|
|
6532
|
+
), /* @__PURE__ */ React75.createElement(
|
|
5762
6533
|
TextInput24,
|
|
5763
6534
|
{
|
|
5764
6535
|
label: "Storage Key",
|
|
@@ -5768,7 +6539,7 @@ var ManageStorageItemsActionForm = ({
|
|
|
5768
6539
|
required: true,
|
|
5769
6540
|
styles: inputStyles17
|
|
5770
6541
|
}
|
|
5771
|
-
), data.setting && /* @__PURE__ */
|
|
6542
|
+
), data.setting && /* @__PURE__ */ React75.createElement(
|
|
5772
6543
|
Textarea13,
|
|
5773
6544
|
{
|
|
5774
6545
|
label: "Storage Value",
|
|
@@ -5783,8 +6554,8 @@ var ManageStorageItemsActionForm = ({
|
|
|
5783
6554
|
};
|
|
5784
6555
|
|
|
5785
6556
|
// src/mantine/blocks/proposalActions/components/forms/DaoAdminExecActionForm.tsx
|
|
5786
|
-
import
|
|
5787
|
-
import { Stack as
|
|
6557
|
+
import React76, { useState as useState20 } from "react";
|
|
6558
|
+
import { Stack as Stack52, TextInput as TextInput25, Button as Button18, Group as Group24, Text as Text38, Card as Card17, Textarea as Textarea14 } from "@mantine/core";
|
|
5788
6559
|
var inputStyles18 = {
|
|
5789
6560
|
label: { color: "#adb5bd" },
|
|
5790
6561
|
input: {
|
|
@@ -5820,7 +6591,7 @@ var DaoAdminExecActionForm = ({
|
|
|
5820
6591
|
msgs: (data.msgs || []).filter((_, i) => i !== index)
|
|
5821
6592
|
});
|
|
5822
6593
|
};
|
|
5823
|
-
return /* @__PURE__ */
|
|
6594
|
+
return /* @__PURE__ */ React76.createElement(Stack52, { gap: "md" }, /* @__PURE__ */ React76.createElement(
|
|
5824
6595
|
TextInput25,
|
|
5825
6596
|
{
|
|
5826
6597
|
label: "Core Address",
|
|
@@ -5830,15 +6601,15 @@ var DaoAdminExecActionForm = ({
|
|
|
5830
6601
|
required: true,
|
|
5831
6602
|
styles: inputStyles18
|
|
5832
6603
|
}
|
|
5833
|
-
), /* @__PURE__ */
|
|
5834
|
-
|
|
6604
|
+
), /* @__PURE__ */ React76.createElement(Stack52, { gap: "xs" }, /* @__PURE__ */ React76.createElement(Text38, { size: "sm", fw: 500, style: { color: "#adb5bd" } }, "Messages to Execute"), (data.msgs || []).map((msg, index) => /* @__PURE__ */ React76.createElement(
|
|
6605
|
+
Card17,
|
|
5835
6606
|
{
|
|
5836
6607
|
key: index,
|
|
5837
6608
|
withBorder: true,
|
|
5838
6609
|
padding: "xs",
|
|
5839
6610
|
style: { backgroundColor: "#2a2a2a", borderColor: "#333" }
|
|
5840
6611
|
},
|
|
5841
|
-
/* @__PURE__ */
|
|
6612
|
+
/* @__PURE__ */ React76.createElement(Group24, { justify: "space-between" }, /* @__PURE__ */ React76.createElement(Text38, { size: "sm", style: { color: "#f1f3f5" } }, "Message ", index + 1), /* @__PURE__ */ React76.createElement(
|
|
5842
6613
|
Button18,
|
|
5843
6614
|
{
|
|
5844
6615
|
size: "xs",
|
|
@@ -5848,8 +6619,8 @@ var DaoAdminExecActionForm = ({
|
|
|
5848
6619
|
},
|
|
5849
6620
|
"Remove"
|
|
5850
6621
|
)),
|
|
5851
|
-
/* @__PURE__ */
|
|
5852
|
-
)), /* @__PURE__ */
|
|
6622
|
+
/* @__PURE__ */ React76.createElement(Text38, { size: "xs", style: { color: "#adb5bd", fontFamily: "monospace" } }, JSON.stringify(msg, null, 2).substring(0, 100), "...")
|
|
6623
|
+
)), /* @__PURE__ */ React76.createElement(
|
|
5853
6624
|
Textarea14,
|
|
5854
6625
|
{
|
|
5855
6626
|
placeholder: 'Add cosmos message as JSON:\\n{"bank": {"send": {"to_address": "ixo1...", "amount": [{"denom": "uixo", "amount": "1000"}]}}}',
|
|
@@ -5858,7 +6629,7 @@ var DaoAdminExecActionForm = ({
|
|
|
5858
6629
|
minRows: 4,
|
|
5859
6630
|
styles: inputStyles18
|
|
5860
6631
|
}
|
|
5861
|
-
), /* @__PURE__ */
|
|
6632
|
+
), /* @__PURE__ */ React76.createElement(
|
|
5862
6633
|
Button18,
|
|
5863
6634
|
{
|
|
5864
6635
|
size: "sm",
|
|
@@ -5873,8 +6644,8 @@ var DaoAdminExecActionForm = ({
|
|
|
5873
6644
|
};
|
|
5874
6645
|
|
|
5875
6646
|
// src/mantine/blocks/proposalActions/components/forms/AcceptToMarketplaceActionForm.tsx
|
|
5876
|
-
import
|
|
5877
|
-
import { Stack as
|
|
6647
|
+
import React77 from "react";
|
|
6648
|
+
import { Stack as Stack53, TextInput as TextInput26 } from "@mantine/core";
|
|
5878
6649
|
var inputStyles19 = {
|
|
5879
6650
|
label: { color: "#adb5bd" },
|
|
5880
6651
|
input: {
|
|
@@ -5890,7 +6661,7 @@ var AcceptToMarketplaceActionForm = ({
|
|
|
5890
6661
|
data,
|
|
5891
6662
|
onChange
|
|
5892
6663
|
}) => {
|
|
5893
|
-
return /* @__PURE__ */
|
|
6664
|
+
return /* @__PURE__ */ React77.createElement(Stack53, { gap: "md" }, /* @__PURE__ */ React77.createElement(
|
|
5894
6665
|
TextInput26,
|
|
5895
6666
|
{
|
|
5896
6667
|
label: "DID",
|
|
@@ -5900,7 +6671,7 @@ var AcceptToMarketplaceActionForm = ({
|
|
|
5900
6671
|
required: true,
|
|
5901
6672
|
styles: inputStyles19
|
|
5902
6673
|
}
|
|
5903
|
-
), /* @__PURE__ */
|
|
6674
|
+
), /* @__PURE__ */ React77.createElement(
|
|
5904
6675
|
TextInput26,
|
|
5905
6676
|
{
|
|
5906
6677
|
label: "Relayer Node DID",
|
|
@@ -5910,7 +6681,7 @@ var AcceptToMarketplaceActionForm = ({
|
|
|
5910
6681
|
required: true,
|
|
5911
6682
|
styles: inputStyles19
|
|
5912
6683
|
}
|
|
5913
|
-
), /* @__PURE__ */
|
|
6684
|
+
), /* @__PURE__ */ React77.createElement(
|
|
5914
6685
|
TextInput26,
|
|
5915
6686
|
{
|
|
5916
6687
|
label: "Relayer Node Address",
|
|
@@ -5924,8 +6695,8 @@ var AcceptToMarketplaceActionForm = ({
|
|
|
5924
6695
|
};
|
|
5925
6696
|
|
|
5926
6697
|
// src/mantine/blocks/proposalActions/components/forms/CreateEntityActionForm.tsx
|
|
5927
|
-
import
|
|
5928
|
-
import { Stack as
|
|
6698
|
+
import React78 from "react";
|
|
6699
|
+
import { Stack as Stack54, Textarea as Textarea15, Alert as Alert7, Text as Text39 } from "@mantine/core";
|
|
5929
6700
|
var inputStyles20 = {
|
|
5930
6701
|
label: { color: "#adb5bd" },
|
|
5931
6702
|
input: {
|
|
@@ -5945,7 +6716,7 @@ var CreateEntityActionForm = ({ data, onChange }) => {
|
|
|
5945
6716
|
} catch {
|
|
5946
6717
|
}
|
|
5947
6718
|
};
|
|
5948
|
-
return /* @__PURE__ */
|
|
6719
|
+
return /* @__PURE__ */ React78.createElement(Stack54, { gap: "md" }, /* @__PURE__ */ React78.createElement(Alert7, { color: "blue", style: { backgroundColor: "#2a2a2a", borderColor: "#4dabf7" } }, /* @__PURE__ */ React78.createElement(Text39, { size: "sm", style: { color: "#4dabf7" } }, "This is a complex entity creation action. Please provide the complete entity data as JSON.")), /* @__PURE__ */ React78.createElement(
|
|
5949
6720
|
Textarea15,
|
|
5950
6721
|
{
|
|
5951
6722
|
label: "Entity Data (JSON)",
|
|
@@ -5960,8 +6731,8 @@ var CreateEntityActionForm = ({ data, onChange }) => {
|
|
|
5960
6731
|
};
|
|
5961
6732
|
|
|
5962
6733
|
// src/mantine/blocks/proposalActions/components/forms/UpdateVotingConfigActionForm.tsx
|
|
5963
|
-
import
|
|
5964
|
-
import { Stack as
|
|
6734
|
+
import React79 from "react";
|
|
6735
|
+
import { Stack as Stack55, Checkbox as Checkbox6, Select as Select6, NumberInput as NumberInput7, Group as Group25 } from "@mantine/core";
|
|
5965
6736
|
var inputStyles21 = {
|
|
5966
6737
|
label: { color: "#adb5bd" },
|
|
5967
6738
|
input: {
|
|
@@ -5977,8 +6748,8 @@ var UpdateVotingConfigActionForm = ({
|
|
|
5977
6748
|
data,
|
|
5978
6749
|
onChange
|
|
5979
6750
|
}) => {
|
|
5980
|
-
return /* @__PURE__ */
|
|
5981
|
-
|
|
6751
|
+
return /* @__PURE__ */ React79.createElement(Stack55, { gap: "md" }, /* @__PURE__ */ React79.createElement(
|
|
6752
|
+
Checkbox6,
|
|
5982
6753
|
{
|
|
5983
6754
|
label: "Only members can execute",
|
|
5984
6755
|
checked: data.onlyMembersExecute,
|
|
@@ -5988,7 +6759,7 @@ var UpdateVotingConfigActionForm = ({
|
|
|
5988
6759
|
input: { backgroundColor: "#2a2a2a", borderColor: "#333" }
|
|
5989
6760
|
}
|
|
5990
6761
|
}
|
|
5991
|
-
), /* @__PURE__ */
|
|
6762
|
+
), /* @__PURE__ */ React79.createElement(
|
|
5992
6763
|
Select6,
|
|
5993
6764
|
{
|
|
5994
6765
|
label: "Threshold Type",
|
|
@@ -6000,7 +6771,7 @@ var UpdateVotingConfigActionForm = ({
|
|
|
6000
6771
|
],
|
|
6001
6772
|
styles: inputStyles21
|
|
6002
6773
|
}
|
|
6003
|
-
), data.thresholdType === "%" && /* @__PURE__ */
|
|
6774
|
+
), data.thresholdType === "%" && /* @__PURE__ */ React79.createElement(
|
|
6004
6775
|
NumberInput7,
|
|
6005
6776
|
{
|
|
6006
6777
|
label: "Threshold Percentage",
|
|
@@ -6012,8 +6783,8 @@ var UpdateVotingConfigActionForm = ({
|
|
|
6012
6783
|
suffix: "%",
|
|
6013
6784
|
styles: inputStyles21
|
|
6014
6785
|
}
|
|
6015
|
-
), /* @__PURE__ */
|
|
6016
|
-
|
|
6786
|
+
), /* @__PURE__ */ React79.createElement(
|
|
6787
|
+
Checkbox6,
|
|
6017
6788
|
{
|
|
6018
6789
|
label: "Enable Quorum",
|
|
6019
6790
|
checked: data.quorumEnabled,
|
|
@@ -6023,7 +6794,7 @@ var UpdateVotingConfigActionForm = ({
|
|
|
6023
6794
|
input: { backgroundColor: "#2a2a2a", borderColor: "#333" }
|
|
6024
6795
|
}
|
|
6025
6796
|
}
|
|
6026
|
-
), data.quorumEnabled && /* @__PURE__ */
|
|
6797
|
+
), data.quorumEnabled && /* @__PURE__ */ React79.createElement(React79.Fragment, null, /* @__PURE__ */ React79.createElement(
|
|
6027
6798
|
Select6,
|
|
6028
6799
|
{
|
|
6029
6800
|
label: "Quorum Type",
|
|
@@ -6035,7 +6806,7 @@ var UpdateVotingConfigActionForm = ({
|
|
|
6035
6806
|
],
|
|
6036
6807
|
styles: inputStyles21
|
|
6037
6808
|
}
|
|
6038
|
-
), data.quorumType === "%" && /* @__PURE__ */
|
|
6809
|
+
), data.quorumType === "%" && /* @__PURE__ */ React79.createElement(
|
|
6039
6810
|
NumberInput7,
|
|
6040
6811
|
{
|
|
6041
6812
|
label: "Quorum Percentage",
|
|
@@ -6047,7 +6818,7 @@ var UpdateVotingConfigActionForm = ({
|
|
|
6047
6818
|
suffix: "%",
|
|
6048
6819
|
styles: inputStyles21
|
|
6049
6820
|
}
|
|
6050
|
-
)), /* @__PURE__ */
|
|
6821
|
+
)), /* @__PURE__ */ React79.createElement(Group25, { grow: true }, /* @__PURE__ */ React79.createElement(
|
|
6051
6822
|
NumberInput7,
|
|
6052
6823
|
{
|
|
6053
6824
|
label: "Proposal Duration",
|
|
@@ -6057,7 +6828,7 @@ var UpdateVotingConfigActionForm = ({
|
|
|
6057
6828
|
min: 1,
|
|
6058
6829
|
styles: inputStyles21
|
|
6059
6830
|
}
|
|
6060
|
-
), /* @__PURE__ */
|
|
6831
|
+
), /* @__PURE__ */ React79.createElement(
|
|
6061
6832
|
Select6,
|
|
6062
6833
|
{
|
|
6063
6834
|
label: "Duration Units",
|
|
@@ -6071,8 +6842,8 @@ var UpdateVotingConfigActionForm = ({
|
|
|
6071
6842
|
],
|
|
6072
6843
|
styles: inputStyles21
|
|
6073
6844
|
}
|
|
6074
|
-
)), /* @__PURE__ */
|
|
6075
|
-
|
|
6845
|
+
)), /* @__PURE__ */ React79.createElement(
|
|
6846
|
+
Checkbox6,
|
|
6076
6847
|
{
|
|
6077
6848
|
label: "Allow revoting",
|
|
6078
6849
|
checked: data.allowRevoting,
|
|
@@ -6086,8 +6857,8 @@ var UpdateVotingConfigActionForm = ({
|
|
|
6086
6857
|
};
|
|
6087
6858
|
|
|
6088
6859
|
// src/mantine/blocks/proposalActions/components/forms/UpdatePreProposeConfigActionForm.tsx
|
|
6089
|
-
import
|
|
6090
|
-
import { Stack as
|
|
6860
|
+
import React80 from "react";
|
|
6861
|
+
import { Stack as Stack56, Checkbox as Checkbox7, TextInput as TextInput27, Select as Select7, Textarea as Textarea16 } from "@mantine/core";
|
|
6091
6862
|
var inputStyles22 = {
|
|
6092
6863
|
label: { color: "#adb5bd" },
|
|
6093
6864
|
input: {
|
|
@@ -6100,8 +6871,8 @@ var inputStyles22 = {
|
|
|
6100
6871
|
}
|
|
6101
6872
|
};
|
|
6102
6873
|
var UpdatePreProposeConfigActionForm = ({ data, onChange }) => {
|
|
6103
|
-
return /* @__PURE__ */
|
|
6104
|
-
|
|
6874
|
+
return /* @__PURE__ */ React80.createElement(Stack56, { gap: "md" }, /* @__PURE__ */ React80.createElement(
|
|
6875
|
+
Checkbox7,
|
|
6105
6876
|
{
|
|
6106
6877
|
label: "Anyone can propose",
|
|
6107
6878
|
checked: data.anyoneCanPropose,
|
|
@@ -6111,8 +6882,8 @@ var UpdatePreProposeConfigActionForm = ({ data, onChange }) => {
|
|
|
6111
6882
|
input: { backgroundColor: "#2a2a2a", borderColor: "#333" }
|
|
6112
6883
|
}
|
|
6113
6884
|
}
|
|
6114
|
-
), /* @__PURE__ */
|
|
6115
|
-
|
|
6885
|
+
), /* @__PURE__ */ React80.createElement(
|
|
6886
|
+
Checkbox7,
|
|
6116
6887
|
{
|
|
6117
6888
|
label: "Deposit required",
|
|
6118
6889
|
checked: data.depositRequired,
|
|
@@ -6122,7 +6893,7 @@ var UpdatePreProposeConfigActionForm = ({ data, onChange }) => {
|
|
|
6122
6893
|
input: { backgroundColor: "#2a2a2a", borderColor: "#333" }
|
|
6123
6894
|
}
|
|
6124
6895
|
}
|
|
6125
|
-
), data.depositRequired && /* @__PURE__ */
|
|
6896
|
+
), data.depositRequired && /* @__PURE__ */ React80.createElement(React80.Fragment, null, /* @__PURE__ */ React80.createElement(
|
|
6126
6897
|
TextInput27,
|
|
6127
6898
|
{
|
|
6128
6899
|
label: "Deposit Amount",
|
|
@@ -6135,7 +6906,7 @@ var UpdatePreProposeConfigActionForm = ({ data, onChange }) => {
|
|
|
6135
6906
|
required: true,
|
|
6136
6907
|
styles: inputStyles22
|
|
6137
6908
|
}
|
|
6138
|
-
), /* @__PURE__ */
|
|
6909
|
+
), /* @__PURE__ */ React80.createElement(
|
|
6139
6910
|
Select7,
|
|
6140
6911
|
{
|
|
6141
6912
|
label: "Deposit Type",
|
|
@@ -6151,7 +6922,7 @@ var UpdatePreProposeConfigActionForm = ({ data, onChange }) => {
|
|
|
6151
6922
|
],
|
|
6152
6923
|
styles: inputStyles22
|
|
6153
6924
|
}
|
|
6154
|
-
), /* @__PURE__ */
|
|
6925
|
+
), /* @__PURE__ */ React80.createElement(
|
|
6155
6926
|
TextInput27,
|
|
6156
6927
|
{
|
|
6157
6928
|
label: "Token Denomination or Address",
|
|
@@ -6164,7 +6935,7 @@ var UpdatePreProposeConfigActionForm = ({ data, onChange }) => {
|
|
|
6164
6935
|
required: true,
|
|
6165
6936
|
styles: inputStyles22
|
|
6166
6937
|
}
|
|
6167
|
-
), /* @__PURE__ */
|
|
6938
|
+
), /* @__PURE__ */ React80.createElement(
|
|
6168
6939
|
TextInput27,
|
|
6169
6940
|
{
|
|
6170
6941
|
label: "Refund Policy",
|
|
@@ -6177,7 +6948,7 @@ var UpdatePreProposeConfigActionForm = ({ data, onChange }) => {
|
|
|
6177
6948
|
required: true,
|
|
6178
6949
|
styles: inputStyles22
|
|
6179
6950
|
}
|
|
6180
|
-
), data.depositInfo.type !== "native" && /* @__PURE__ */
|
|
6951
|
+
), data.depositInfo.type !== "native" && /* @__PURE__ */ React80.createElement(
|
|
6181
6952
|
Textarea16,
|
|
6182
6953
|
{
|
|
6183
6954
|
label: "Token Configuration (JSON)",
|
|
@@ -6200,8 +6971,8 @@ var UpdatePreProposeConfigActionForm = ({ data, onChange }) => {
|
|
|
6200
6971
|
};
|
|
6201
6972
|
|
|
6202
6973
|
// src/mantine/blocks/proposalActions/components/forms/GovernanceVoteActionForm.tsx
|
|
6203
|
-
import
|
|
6204
|
-
import { Stack as
|
|
6974
|
+
import React81 from "react";
|
|
6975
|
+
import { Stack as Stack57, TextInput as TextInput28, Select as Select8 } from "@mantine/core";
|
|
6205
6976
|
var inputStyles23 = {
|
|
6206
6977
|
label: { color: "#adb5bd" },
|
|
6207
6978
|
input: {
|
|
@@ -6223,7 +6994,7 @@ var GovernanceVoteActionForm = ({
|
|
|
6223
6994
|
{ value: "3", label: "No" },
|
|
6224
6995
|
{ value: "4", label: "No with Veto" }
|
|
6225
6996
|
];
|
|
6226
|
-
return /* @__PURE__ */
|
|
6997
|
+
return /* @__PURE__ */ React81.createElement(Stack57, { gap: "md" }, /* @__PURE__ */ React81.createElement(
|
|
6227
6998
|
TextInput28,
|
|
6228
6999
|
{
|
|
6229
7000
|
label: "Proposal ID",
|
|
@@ -6233,7 +7004,7 @@ var GovernanceVoteActionForm = ({
|
|
|
6233
7004
|
required: true,
|
|
6234
7005
|
styles: inputStyles23
|
|
6235
7006
|
}
|
|
6236
|
-
), /* @__PURE__ */
|
|
7007
|
+
), /* @__PURE__ */ React81.createElement(
|
|
6237
7008
|
Select8,
|
|
6238
7009
|
{
|
|
6239
7010
|
label: "Vote Option",
|
|
@@ -6247,8 +7018,8 @@ var GovernanceVoteActionForm = ({
|
|
|
6247
7018
|
};
|
|
6248
7019
|
|
|
6249
7020
|
// src/mantine/blocks/proposalActions/components/forms/WithdrawTokenSwapActionForm.tsx
|
|
6250
|
-
import
|
|
6251
|
-
import { Stack as
|
|
7021
|
+
import React82 from "react";
|
|
7022
|
+
import { Stack as Stack58, TextInput as TextInput29, Checkbox as Checkbox8 } from "@mantine/core";
|
|
6252
7023
|
var inputStyles24 = {
|
|
6253
7024
|
label: { color: "#adb5bd" },
|
|
6254
7025
|
input: {
|
|
@@ -6264,8 +7035,8 @@ var WithdrawTokenSwapActionForm = ({
|
|
|
6264
7035
|
data,
|
|
6265
7036
|
onChange
|
|
6266
7037
|
}) => {
|
|
6267
|
-
return /* @__PURE__ */
|
|
6268
|
-
|
|
7038
|
+
return /* @__PURE__ */ React82.createElement(Stack58, { gap: "md" }, /* @__PURE__ */ React82.createElement(
|
|
7039
|
+
Checkbox8,
|
|
6269
7040
|
{
|
|
6270
7041
|
label: "Contract chosen",
|
|
6271
7042
|
checked: data.contractChosen,
|
|
@@ -6275,7 +7046,7 @@ var WithdrawTokenSwapActionForm = ({
|
|
|
6275
7046
|
input: { backgroundColor: "#2a2a2a", borderColor: "#333" }
|
|
6276
7047
|
}
|
|
6277
7048
|
}
|
|
6278
|
-
), data.contractChosen && /* @__PURE__ */
|
|
7049
|
+
), data.contractChosen && /* @__PURE__ */ React82.createElement(
|
|
6279
7050
|
TextInput29,
|
|
6280
7051
|
{
|
|
6281
7052
|
label: "Token Swap Contract Address",
|
|
@@ -6289,8 +7060,8 @@ var WithdrawTokenSwapActionForm = ({
|
|
|
6289
7060
|
};
|
|
6290
7061
|
|
|
6291
7062
|
// src/mantine/blocks/proposalActions/components/forms/PerformTokenSwapActionForm.tsx
|
|
6292
|
-
import
|
|
6293
|
-
import { Stack as
|
|
7063
|
+
import React83 from "react";
|
|
7064
|
+
import { Stack as Stack59, TextInput as TextInput30, Checkbox as Checkbox9, Textarea as Textarea17 } from "@mantine/core";
|
|
6294
7065
|
var inputStyles25 = {
|
|
6295
7066
|
label: { color: "#adb5bd" },
|
|
6296
7067
|
input: {
|
|
@@ -6306,8 +7077,8 @@ var PerformTokenSwapActionForm = ({
|
|
|
6306
7077
|
data,
|
|
6307
7078
|
onChange
|
|
6308
7079
|
}) => {
|
|
6309
|
-
return /* @__PURE__ */
|
|
6310
|
-
|
|
7080
|
+
return /* @__PURE__ */ React83.createElement(Stack59, { gap: "md" }, /* @__PURE__ */ React83.createElement(
|
|
7081
|
+
Checkbox9,
|
|
6311
7082
|
{
|
|
6312
7083
|
label: "Contract chosen",
|
|
6313
7084
|
checked: data.contractChosen,
|
|
@@ -6317,7 +7088,7 @@ var PerformTokenSwapActionForm = ({
|
|
|
6317
7088
|
input: { backgroundColor: "#2a2a2a", borderColor: "#333" }
|
|
6318
7089
|
}
|
|
6319
7090
|
}
|
|
6320
|
-
), data.contractChosen && /* @__PURE__ */
|
|
7091
|
+
), data.contractChosen && /* @__PURE__ */ React83.createElement(React83.Fragment, null, /* @__PURE__ */ React83.createElement(
|
|
6321
7092
|
TextInput30,
|
|
6322
7093
|
{
|
|
6323
7094
|
label: "Token Swap Contract Address",
|
|
@@ -6327,7 +7098,7 @@ var PerformTokenSwapActionForm = ({
|
|
|
6327
7098
|
required: true,
|
|
6328
7099
|
styles: inputStyles25
|
|
6329
7100
|
}
|
|
6330
|
-
), /* @__PURE__ */
|
|
7101
|
+
), /* @__PURE__ */ React83.createElement(
|
|
6331
7102
|
Textarea17,
|
|
6332
7103
|
{
|
|
6333
7104
|
label: "Self Party Information (JSON)",
|
|
@@ -6343,7 +7114,7 @@ var PerformTokenSwapActionForm = ({
|
|
|
6343
7114
|
minRows: 4,
|
|
6344
7115
|
styles: inputStyles25
|
|
6345
7116
|
}
|
|
6346
|
-
), /* @__PURE__ */
|
|
7117
|
+
), /* @__PURE__ */ React83.createElement(
|
|
6347
7118
|
Textarea17,
|
|
6348
7119
|
{
|
|
6349
7120
|
label: "Counterparty Information (JSON)",
|
|
@@ -6363,8 +7134,8 @@ var PerformTokenSwapActionForm = ({
|
|
|
6363
7134
|
};
|
|
6364
7135
|
|
|
6365
7136
|
// src/mantine/blocks/proposalActions/components/forms/StakeToGroupActionForm.tsx
|
|
6366
|
-
import
|
|
6367
|
-
import { Stack as
|
|
7137
|
+
import React84 from "react";
|
|
7138
|
+
import { Stack as Stack60, TextInput as TextInput31 } from "@mantine/core";
|
|
6368
7139
|
var inputStyles26 = {
|
|
6369
7140
|
label: { color: "#adb5bd" },
|
|
6370
7141
|
input: {
|
|
@@ -6380,7 +7151,7 @@ var StakeToGroupActionForm = ({
|
|
|
6380
7151
|
data,
|
|
6381
7152
|
onChange
|
|
6382
7153
|
}) => {
|
|
6383
|
-
return /* @__PURE__ */
|
|
7154
|
+
return /* @__PURE__ */ React84.createElement(Stack60, { gap: "md" }, /* @__PURE__ */ React84.createElement(
|
|
6384
7155
|
TextInput31,
|
|
6385
7156
|
{
|
|
6386
7157
|
label: "Token Contract Address",
|
|
@@ -6390,7 +7161,7 @@ var StakeToGroupActionForm = ({
|
|
|
6390
7161
|
required: true,
|
|
6391
7162
|
styles: inputStyles26
|
|
6392
7163
|
}
|
|
6393
|
-
), /* @__PURE__ */
|
|
7164
|
+
), /* @__PURE__ */ React84.createElement(
|
|
6394
7165
|
TextInput31,
|
|
6395
7166
|
{
|
|
6396
7167
|
label: "Staking Contract Address",
|
|
@@ -6400,7 +7171,7 @@ var StakeToGroupActionForm = ({
|
|
|
6400
7171
|
required: true,
|
|
6401
7172
|
styles: inputStyles26
|
|
6402
7173
|
}
|
|
6403
|
-
), /* @__PURE__ */
|
|
7174
|
+
), /* @__PURE__ */ React84.createElement(
|
|
6404
7175
|
TextInput31,
|
|
6405
7176
|
{
|
|
6406
7177
|
label: "Amount",
|
|
@@ -6414,8 +7185,8 @@ var StakeToGroupActionForm = ({
|
|
|
6414
7185
|
};
|
|
6415
7186
|
|
|
6416
7187
|
// src/mantine/blocks/proposalActions/components/forms/SendGroupTokenActionForm.tsx
|
|
6417
|
-
import
|
|
6418
|
-
import { Stack as
|
|
7188
|
+
import React85 from "react";
|
|
7189
|
+
import { Stack as Stack61, TextInput as TextInput32 } from "@mantine/core";
|
|
6419
7190
|
var inputStyles27 = {
|
|
6420
7191
|
label: { color: "#adb5bd" },
|
|
6421
7192
|
input: {
|
|
@@ -6431,7 +7202,7 @@ var SendGroupTokenActionForm = ({
|
|
|
6431
7202
|
data,
|
|
6432
7203
|
onChange
|
|
6433
7204
|
}) => {
|
|
6434
|
-
return /* @__PURE__ */
|
|
7205
|
+
return /* @__PURE__ */ React85.createElement(Stack61, { gap: "md" }, /* @__PURE__ */ React85.createElement(
|
|
6435
7206
|
TextInput32,
|
|
6436
7207
|
{
|
|
6437
7208
|
label: "Contract Address",
|
|
@@ -6441,7 +7212,7 @@ var SendGroupTokenActionForm = ({
|
|
|
6441
7212
|
required: true,
|
|
6442
7213
|
styles: inputStyles27
|
|
6443
7214
|
}
|
|
6444
|
-
), /* @__PURE__ */
|
|
7215
|
+
), /* @__PURE__ */ React85.createElement(
|
|
6445
7216
|
TextInput32,
|
|
6446
7217
|
{
|
|
6447
7218
|
label: "Recipient Address",
|
|
@@ -6451,7 +7222,7 @@ var SendGroupTokenActionForm = ({
|
|
|
6451
7222
|
required: true,
|
|
6452
7223
|
styles: inputStyles27
|
|
6453
7224
|
}
|
|
6454
|
-
), /* @__PURE__ */
|
|
7225
|
+
), /* @__PURE__ */ React85.createElement(
|
|
6455
7226
|
TextInput32,
|
|
6456
7227
|
{
|
|
6457
7228
|
label: "Amount",
|
|
@@ -6465,8 +7236,8 @@ var SendGroupTokenActionForm = ({
|
|
|
6465
7236
|
};
|
|
6466
7237
|
|
|
6467
7238
|
// src/mantine/blocks/proposalActions/components/forms/ValidatorActionsActionForm.tsx
|
|
6468
|
-
import
|
|
6469
|
-
import { Stack as
|
|
7239
|
+
import React86 from "react";
|
|
7240
|
+
import { Stack as Stack62, Select as Select9, Textarea as Textarea18 } from "@mantine/core";
|
|
6470
7241
|
var inputStyles28 = {
|
|
6471
7242
|
label: { color: "#adb5bd" },
|
|
6472
7243
|
input: {
|
|
@@ -6488,7 +7259,7 @@ var ValidatorActionsActionForm = ({
|
|
|
6488
7259
|
{ value: "/cosmos.slashing.v1beta1.MsgUnjail" /* UnjailValidator */, label: "Unjail Validator" },
|
|
6489
7260
|
{ value: "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission" /* WithdrawValidatorCommission */, label: "Withdraw Commission" }
|
|
6490
7261
|
];
|
|
6491
|
-
return /* @__PURE__ */
|
|
7262
|
+
return /* @__PURE__ */ React86.createElement(Stack62, { gap: "md" }, /* @__PURE__ */ React86.createElement(
|
|
6492
7263
|
Select9,
|
|
6493
7264
|
{
|
|
6494
7265
|
label: "Validator Action Type",
|
|
@@ -6498,7 +7269,7 @@ var ValidatorActionsActionForm = ({
|
|
|
6498
7269
|
required: true,
|
|
6499
7270
|
styles: inputStyles28
|
|
6500
7271
|
}
|
|
6501
|
-
), data.validatorActionType === "/cosmos.staking.v1beta1.MsgCreateValidator" /* CreateValidator */ && /* @__PURE__ */
|
|
7272
|
+
), data.validatorActionType === "/cosmos.staking.v1beta1.MsgCreateValidator" /* CreateValidator */ && /* @__PURE__ */ React86.createElement(
|
|
6502
7273
|
Textarea18,
|
|
6503
7274
|
{
|
|
6504
7275
|
label: "Create Validator Message (JSON)",
|
|
@@ -6509,7 +7280,7 @@ var ValidatorActionsActionForm = ({
|
|
|
6509
7280
|
required: true,
|
|
6510
7281
|
styles: inputStyles28
|
|
6511
7282
|
}
|
|
6512
|
-
), data.validatorActionType === "/cosmos.staking.v1beta1.MsgEditValidator" /* EditValidator */ && /* @__PURE__ */
|
|
7283
|
+
), data.validatorActionType === "/cosmos.staking.v1beta1.MsgEditValidator" /* EditValidator */ && /* @__PURE__ */ React86.createElement(
|
|
6513
7284
|
Textarea18,
|
|
6514
7285
|
{
|
|
6515
7286
|
label: "Edit Validator Message (JSON)",
|
|
@@ -7165,6 +7936,482 @@ var actionRegistry = /* @__PURE__ */ new Map([
|
|
|
7165
7936
|
]
|
|
7166
7937
|
]);
|
|
7167
7938
|
|
|
7939
|
+
// src/mantine/blocks/enumChecklist/EnumChecklistBlock.tsx
|
|
7940
|
+
import React93, { useState as useState23, useEffect as useEffect14, useMemo as useMemo16, useCallback as useCallback14 } from "react";
|
|
7941
|
+
import { createReactBlockSpec as createReactBlockSpec7 } from "@blocknote/react";
|
|
7942
|
+
import { Stack as Stack68, Text as Text45, Button as Button23, ActionIcon as ActionIcon10, Center as Center3, Flex as Flex15 } from "@mantine/core";
|
|
7943
|
+
|
|
7944
|
+
// src/mantine/blocks/enumChecklist/oracle_personalities/index.tsx
|
|
7945
|
+
import React88 from "react";
|
|
7946
|
+
import { Box as Box17, Flex as Flex14, Stack as Stack64, Text as Text41, Image as Image10 } from "@mantine/core";
|
|
7947
|
+
function OraclePersonalitiesEnumList({ selectionMode, isItemChecked, onItemCheck, items }) {
|
|
7948
|
+
if (!items || items.length === 0) {
|
|
7949
|
+
return /* @__PURE__ */ React88.createElement(Text41, { size: "sm", c: "dimmed", ta: "center", py: "md" }, "No assets found");
|
|
7950
|
+
}
|
|
7951
|
+
const rows = items.map(({ id, name, description, voice, icon }) => /* @__PURE__ */ React88.createElement(ListItemContainer, { key: id }, /* @__PURE__ */ React88.createElement(Flex14, { align: "center", gap: "sm" }, /* @__PURE__ */ React88.createElement(Image10, { radius: 16, w: 62, h: 62, src: icon, alt: name }), /* @__PURE__ */ React88.createElement(Stack64, { gap: 0 }, /* @__PURE__ */ React88.createElement(Text41, { size: "sm", fw: 500 }, name || "-"), description !== void 0 && /* @__PURE__ */ React88.createElement(Text41, { size: "sm", c: "dimmed" }, description))), /* @__PURE__ */ React88.createElement(Flex14, { align: "center", gap: "md" }, /* @__PURE__ */ React88.createElement(Stack64, { ta: "right", gap: 0 }, /* @__PURE__ */ React88.createElement(Text41, { size: "sm", fw: 500 }, "Voice"), /* @__PURE__ */ React88.createElement(Text41, { size: "sm", c: "dimmed" }, voice)), selectionMode && /* @__PURE__ */ React88.createElement(ListItemCheckbox, { ariaLabel: `Select oracle ${name}`, checked: isItemChecked?.(id), onCheck: (checked) => onItemCheck?.(id, checked) }))));
|
|
7952
|
+
return /* @__PURE__ */ React88.createElement(Box17, { flex: 1 }, /* @__PURE__ */ React88.createElement(Stack64, null, rows));
|
|
7953
|
+
}
|
|
7954
|
+
|
|
7955
|
+
// src/mantine/blocks/enumChecklist/EnumChecklistConfigModal.tsx
|
|
7956
|
+
import React92, { useState as useState22 } from "react";
|
|
7957
|
+
import { Modal as Modal2, Group as Group30, Box as Box19 } from "@mantine/core";
|
|
7958
|
+
|
|
7959
|
+
// src/mantine/blocks/enumChecklist/EnumChecklistTypeSelection.tsx
|
|
7960
|
+
import React89 from "react";
|
|
7961
|
+
import { Stack as Stack65, Card as Card19, Group as Group27, Text as Text42, Box as Box18, Button as Button20 } from "@mantine/core";
|
|
7962
|
+
|
|
7963
|
+
// src/mantine/blocks/enumChecklist/oracle_personalities/config.ts
|
|
7964
|
+
var oraclePersonalitiesMetadata = {
|
|
7965
|
+
id: "oracle_personalities",
|
|
7966
|
+
name: "Oracle Personalities",
|
|
7967
|
+
description: "Oracle Personalities",
|
|
7968
|
+
icon: "\u{1F52E}"
|
|
7969
|
+
};
|
|
7970
|
+
var oraclePersonalitiesConfigFields = [
|
|
7971
|
+
{
|
|
7972
|
+
key: "selection_mode",
|
|
7973
|
+
label: "Selection Mode",
|
|
7974
|
+
description: "Selection Mode",
|
|
7975
|
+
type: "select",
|
|
7976
|
+
options: [
|
|
7977
|
+
{ value: "single", label: "Single" },
|
|
7978
|
+
{ value: "multi", label: "Multi" }
|
|
7979
|
+
],
|
|
7980
|
+
required: false,
|
|
7981
|
+
defaultValue: null,
|
|
7982
|
+
placeholder: "Select Selection Mode"
|
|
7983
|
+
}
|
|
7984
|
+
];
|
|
7985
|
+
var oraclePersonalitiesItems = [
|
|
7986
|
+
{
|
|
7987
|
+
id: "oracle-1",
|
|
7988
|
+
name: "Sage Oracle",
|
|
7989
|
+
description: "A wise oracle providing deep insights through ancient wisdom.",
|
|
7990
|
+
voice: "Deep, measured tone with thoughtful pauses.",
|
|
7991
|
+
icon: "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSrz9RwPU6kEGEnl9Zpjx913EAUawvtOHGdXw&s"
|
|
7992
|
+
},
|
|
7993
|
+
{
|
|
7994
|
+
id: "oracle-2",
|
|
7995
|
+
name: "Mystic Oracle",
|
|
7996
|
+
description: "An enigmatic oracle channeling otherworldly knowledge.",
|
|
7997
|
+
voice: "Ethereal and mysterious with otherworldly resonance.",
|
|
7998
|
+
icon: "https://storage.hyperspace.ai/template-logos/Kj9FZMvFLrhnGUjRLwi2YKTDXcrdiSwqZr.webp"
|
|
7999
|
+
},
|
|
8000
|
+
{
|
|
8001
|
+
id: "oracle-3",
|
|
8002
|
+
name: "Scholar Oracle",
|
|
8003
|
+
description: "A methodical oracle with academic rigor and evidence-based analysis.",
|
|
8004
|
+
voice: "Clear and articulate with academic precision.",
|
|
8005
|
+
icon: "https://www.piclumen.com/wp-content/uploads/2024/11/ai-avatar-generator-mecha-woman.webp"
|
|
8006
|
+
},
|
|
8007
|
+
{
|
|
8008
|
+
id: "oracle-4",
|
|
8009
|
+
name: "Prophet Oracle",
|
|
8010
|
+
description: "A visionary oracle speaking of future possibilities.",
|
|
8011
|
+
voice: "Commanding and visionary with prophetic conviction.",
|
|
8012
|
+
icon: "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQ0jYoUJ4WrIMWfmcSpv66JqvcG6BvxlbFcrS0Vu-ACnW5f-Jwn0PzKEwNYOL8v-N0Qbms&usqp=CAU"
|
|
8013
|
+
},
|
|
8014
|
+
{
|
|
8015
|
+
id: "oracle-5",
|
|
8016
|
+
name: "Guardian Oracle",
|
|
8017
|
+
description: "A protective oracle focused on safety and security.",
|
|
8018
|
+
voice: "Steady and reassuring with guardian warmth.",
|
|
8019
|
+
icon: "https://cdn.prod.website-files.com/6600e1eab90de089c2d9c9cd/669726e1123a371667fa926c_66553f0235960af8637b5ee8_image_0KhaKlJT_1716768985301_raw.jpeg"
|
|
8020
|
+
}
|
|
8021
|
+
];
|
|
8022
|
+
|
|
8023
|
+
// src/mantine/blocks/enumChecklist/registry.ts
|
|
8024
|
+
var ENUM_LIST_CONFIG = {
|
|
8025
|
+
oracle_personalities: {
|
|
8026
|
+
name: "Oracle Personalities",
|
|
8027
|
+
metadata: oraclePersonalitiesMetadata,
|
|
8028
|
+
configFields: oraclePersonalitiesConfigFields,
|
|
8029
|
+
items: oraclePersonalitiesItems
|
|
8030
|
+
},
|
|
8031
|
+
example_list: {
|
|
8032
|
+
name: "Example List",
|
|
8033
|
+
metadata: {
|
|
8034
|
+
id: "example_list",
|
|
8035
|
+
name: "Example List",
|
|
8036
|
+
description: "An example list with different item structure",
|
|
8037
|
+
icon: "\u{1F4DD}"
|
|
8038
|
+
},
|
|
8039
|
+
configFields: [
|
|
8040
|
+
{
|
|
8041
|
+
key: "selection_mode",
|
|
8042
|
+
label: "Selection Mode",
|
|
8043
|
+
description: "Selection Mode",
|
|
8044
|
+
type: "select",
|
|
8045
|
+
options: [
|
|
8046
|
+
{ value: "single", label: "Single" },
|
|
8047
|
+
{ value: "multi", label: "Multi" }
|
|
8048
|
+
],
|
|
8049
|
+
required: false,
|
|
8050
|
+
defaultValue: "multi",
|
|
8051
|
+
placeholder: "Select Selection Mode"
|
|
8052
|
+
}
|
|
8053
|
+
],
|
|
8054
|
+
items: [
|
|
8055
|
+
{
|
|
8056
|
+
id: "example-1",
|
|
8057
|
+
name: "Example Item 1",
|
|
8058
|
+
description: "First example item",
|
|
8059
|
+
category: "urgent",
|
|
8060
|
+
priority: 1,
|
|
8061
|
+
tags: ["important", "urgent"]
|
|
8062
|
+
},
|
|
8063
|
+
{
|
|
8064
|
+
id: "example-2",
|
|
8065
|
+
name: "Example Item 2",
|
|
8066
|
+
description: "Second example item",
|
|
8067
|
+
category: "normal",
|
|
8068
|
+
priority: 2,
|
|
8069
|
+
tags: ["normal"]
|
|
8070
|
+
}
|
|
8071
|
+
]
|
|
8072
|
+
}
|
|
8073
|
+
};
|
|
8074
|
+
var getEnumListNameByType = (type) => {
|
|
8075
|
+
return ENUM_LIST_CONFIG[type].name || "";
|
|
8076
|
+
};
|
|
8077
|
+
var getEnumListTypesConfigFields = (type) => {
|
|
8078
|
+
return ENUM_LIST_CONFIG[type].configFields || [];
|
|
8079
|
+
};
|
|
8080
|
+
var getEnumListTypesMetadata = () => {
|
|
8081
|
+
return Object.values(ENUM_LIST_CONFIG).map((entry) => entry.metadata);
|
|
8082
|
+
};
|
|
8083
|
+
function getEnumListItems(type) {
|
|
8084
|
+
return ENUM_LIST_CONFIG[type].items;
|
|
8085
|
+
}
|
|
8086
|
+
|
|
8087
|
+
// src/mantine/blocks/enumChecklist/EnumChecklistTypeSelection.tsx
|
|
8088
|
+
var EnumChecklistTypeSelection = ({ selectedType, onTypeSelect, onNext }) => {
|
|
8089
|
+
const enumListsMeta = getEnumListTypesMetadata();
|
|
8090
|
+
return /* @__PURE__ */ React89.createElement(Stack65, { gap: "md" }, /* @__PURE__ */ React89.createElement("div", null, /* @__PURE__ */ React89.createElement(Text42, { size: "lg", fw: 600, mb: "xs" }, "Choose List Type"), /* @__PURE__ */ React89.createElement(Text42, { size: "sm", c: "dimmed" }, "Select the type of list you want to create")), /* @__PURE__ */ React89.createElement(Stack65, { gap: "sm" }, enumListsMeta.map((enumChecklistMeta) => /* @__PURE__ */ React89.createElement(
|
|
8091
|
+
Card19,
|
|
8092
|
+
{
|
|
8093
|
+
key: enumChecklistMeta.id,
|
|
8094
|
+
padding: "md",
|
|
8095
|
+
radius: "md",
|
|
8096
|
+
withBorder: true,
|
|
8097
|
+
bg: selectedType === enumChecklistMeta.id ? "var(--mantine-color-gray-8)" : "transparent",
|
|
8098
|
+
style: {
|
|
8099
|
+
cursor: "pointer"
|
|
8100
|
+
},
|
|
8101
|
+
onClick: () => onTypeSelect(enumChecklistMeta.id)
|
|
8102
|
+
},
|
|
8103
|
+
/* @__PURE__ */ React89.createElement(Group27, { gap: "md", align: "flex-start" }, /* @__PURE__ */ React89.createElement(
|
|
8104
|
+
Box18,
|
|
8105
|
+
{
|
|
8106
|
+
style: {
|
|
8107
|
+
width: 48,
|
|
8108
|
+
height: 48,
|
|
8109
|
+
borderRadius: "8px",
|
|
8110
|
+
display: "flex",
|
|
8111
|
+
alignItems: "center",
|
|
8112
|
+
justifyContent: "center",
|
|
8113
|
+
fontSize: "20px",
|
|
8114
|
+
backgroundColor: "var(--mantine-color-gray-1)",
|
|
8115
|
+
border: "1px solid var(--mantine-color-gray-3)"
|
|
8116
|
+
}
|
|
8117
|
+
},
|
|
8118
|
+
enumChecklistMeta.icon
|
|
8119
|
+
), /* @__PURE__ */ React89.createElement(Stack65, { gap: 2, style: { flex: 1 } }, /* @__PURE__ */ React89.createElement(Text42, { size: "md", fw: 600 }, enumChecklistMeta.name), /* @__PURE__ */ React89.createElement(Text42, { size: "sm", c: "dimmed" }, enumChecklistMeta.description)))
|
|
8120
|
+
))), /* @__PURE__ */ React89.createElement(Group27, { justify: "flex-end", mt: "md" }, /* @__PURE__ */ React89.createElement(Button20, { onClick: onNext, disabled: !selectedType }, "Next")));
|
|
8121
|
+
};
|
|
8122
|
+
|
|
8123
|
+
// src/mantine/blocks/enumChecklist/EnumChecklistPreviewStep.tsx
|
|
8124
|
+
import React90 from "react";
|
|
8125
|
+
import { Stack as Stack66, Text as Text43, Button as Button21, Group as Group28 } from "@mantine/core";
|
|
8126
|
+
var EnumChecklistPreviewStep = ({ listType, onAddToBlock, onPrev }) => {
|
|
8127
|
+
const renderListComponent = () => {
|
|
8128
|
+
switch (listType) {
|
|
8129
|
+
case "oracle_personalities":
|
|
8130
|
+
return /* @__PURE__ */ React90.createElement(OraclePersonalitiesEnumList, { items: getEnumListItems(listType) });
|
|
8131
|
+
default:
|
|
8132
|
+
return null;
|
|
8133
|
+
}
|
|
8134
|
+
};
|
|
8135
|
+
return /* @__PURE__ */ React90.createElement(Stack66, { gap: "md" }, /* @__PURE__ */ React90.createElement("div", null, /* @__PURE__ */ React90.createElement(Text43, { size: "lg", fw: 600, mb: "xs" }, "Preview ", getEnumListNameByType(listType)), /* @__PURE__ */ React90.createElement(Text43, { size: "sm", c: "dimmed" }, "Preview how your list will look with the current configuration")), /* @__PURE__ */ React90.createElement("div", { style: { maxHeight: "400px", overflow: "auto" } }, renderListComponent()), /* @__PURE__ */ React90.createElement(Group28, { justify: "space-between", mt: "md" }, /* @__PURE__ */ React90.createElement(Button21, { variant: "subtle", onClick: onPrev }, "Previous"), /* @__PURE__ */ React90.createElement(Button21, { onClick: onAddToBlock }, "Add to Block")));
|
|
8136
|
+
};
|
|
8137
|
+
|
|
8138
|
+
// src/mantine/blocks/enumChecklist/EnumChecklistConfigurationStep.tsx
|
|
8139
|
+
import React91 from "react";
|
|
8140
|
+
import { Stack as Stack67, TextInput as TextInput33, Text as Text44, Button as Button22, Group as Group29, Switch as Switch4, Select as Select11 } from "@mantine/core";
|
|
8141
|
+
var EnumChecklistConfigurationStep = ({ enumChecklistType: listType, config, onConfigChange, onPrev, onNext, isValid }) => {
|
|
8142
|
+
const typeConfig = ENUM_LIST_CONFIG[listType];
|
|
8143
|
+
const configFields = getEnumListTypesConfigFields(listType);
|
|
8144
|
+
const renderListConfigField = (field) => {
|
|
8145
|
+
switch (field.type) {
|
|
8146
|
+
case "text":
|
|
8147
|
+
return /* @__PURE__ */ React91.createElement(
|
|
8148
|
+
TextInput33,
|
|
8149
|
+
{
|
|
8150
|
+
label: field.label,
|
|
8151
|
+
description: field.description,
|
|
8152
|
+
placeholder: field.placeholder,
|
|
8153
|
+
value: config[field.key] || "",
|
|
8154
|
+
onChange: (e) => onConfigChange(field.key, e.target.value),
|
|
8155
|
+
required: field.required
|
|
8156
|
+
}
|
|
8157
|
+
);
|
|
8158
|
+
case "switch":
|
|
8159
|
+
return /* @__PURE__ */ React91.createElement(
|
|
8160
|
+
Switch4,
|
|
8161
|
+
{
|
|
8162
|
+
label: field.label,
|
|
8163
|
+
description: field.description,
|
|
8164
|
+
checked: config[field.key] !== void 0 ? config[field.key] : field.defaultValue || false,
|
|
8165
|
+
onChange: (event) => onConfigChange(field.key, event.currentTarget.checked)
|
|
8166
|
+
}
|
|
8167
|
+
);
|
|
8168
|
+
case "select":
|
|
8169
|
+
return /* @__PURE__ */ React91.createElement(
|
|
8170
|
+
Select11,
|
|
8171
|
+
{
|
|
8172
|
+
label: field.label,
|
|
8173
|
+
description: field.description,
|
|
8174
|
+
placeholder: field.placeholder,
|
|
8175
|
+
value: config[field.key] || "",
|
|
8176
|
+
onChange: (value) => onConfigChange(field.key, value),
|
|
8177
|
+
data: field.options || [],
|
|
8178
|
+
required: field.required
|
|
8179
|
+
}
|
|
8180
|
+
);
|
|
8181
|
+
default:
|
|
8182
|
+
return /* @__PURE__ */ React91.createElement(
|
|
8183
|
+
TextInput33,
|
|
8184
|
+
{
|
|
8185
|
+
label: field.label,
|
|
8186
|
+
description: field.description,
|
|
8187
|
+
placeholder: field.placeholder,
|
|
8188
|
+
value: config[field.key] || "",
|
|
8189
|
+
onChange: (e) => onConfigChange(field.key, e.target.value),
|
|
8190
|
+
required: field.required
|
|
8191
|
+
}
|
|
8192
|
+
);
|
|
8193
|
+
}
|
|
8194
|
+
};
|
|
8195
|
+
return /* @__PURE__ */ React91.createElement(Stack67, { gap: "md" }, /* @__PURE__ */ React91.createElement("div", null, /* @__PURE__ */ React91.createElement(Text44, { size: "lg", fw: 600, mb: "xs" }, "Configure ", typeConfig.metadata.name), /* @__PURE__ */ React91.createElement(Text44, { size: "sm", c: "dimmed" }, typeConfig.metadata.description)), /* @__PURE__ */ React91.createElement(Stack67, { gap: "sm" }, configFields.map((field) => /* @__PURE__ */ React91.createElement("div", { key: field.key }, renderListConfigField(field)))), /* @__PURE__ */ React91.createElement(Group29, { justify: "space-between", mt: "md" }, /* @__PURE__ */ React91.createElement(Button22, { variant: "subtle", onClick: onPrev }, "Previous"), /* @__PURE__ */ React91.createElement(Button22, { onClick: onNext, disabled: !isValid }, "Next")));
|
|
8196
|
+
};
|
|
8197
|
+
|
|
8198
|
+
// src/mantine/blocks/enumChecklist/EnumChecklistConfigModal.tsx
|
|
8199
|
+
var EnumChecklistConfigModal = ({ opened, onClose, onSave, initialConfig }) => {
|
|
8200
|
+
const [activeStep, setActiveStep] = useState22("type");
|
|
8201
|
+
const [selectedType, setSelectedType] = useState22(initialConfig?.listType || null);
|
|
8202
|
+
const [config, setConfig] = useState22(initialConfig?.listConfig || {});
|
|
8203
|
+
const handleTypeSelect = (type) => {
|
|
8204
|
+
setSelectedType(type);
|
|
8205
|
+
const configFieldsByType = getEnumListTypesConfigFields(type);
|
|
8206
|
+
const defaultConfig = {};
|
|
8207
|
+
configFieldsByType.forEach((field) => {
|
|
8208
|
+
if (field.defaultValue !== void 0) {
|
|
8209
|
+
defaultConfig[field.key] = field.defaultValue;
|
|
8210
|
+
}
|
|
8211
|
+
});
|
|
8212
|
+
setConfig(defaultConfig);
|
|
8213
|
+
};
|
|
8214
|
+
const handleAddToBlock = () => {
|
|
8215
|
+
if (selectedType) {
|
|
8216
|
+
onSave({ listType: selectedType, listConfig: config, selectedIds: [] });
|
|
8217
|
+
onClose();
|
|
8218
|
+
}
|
|
8219
|
+
};
|
|
8220
|
+
const handleConfigChange = (key, value) => {
|
|
8221
|
+
setConfig((prev) => ({ ...prev, [key]: value }));
|
|
8222
|
+
};
|
|
8223
|
+
const isConfigValid = () => {
|
|
8224
|
+
if (!selectedType) return false;
|
|
8225
|
+
const configFields = getEnumListTypesConfigFields(selectedType);
|
|
8226
|
+
return configFields.every((field) => !field.required || config[field.key] && config[field.key].trim() !== "");
|
|
8227
|
+
};
|
|
8228
|
+
const handleClose = () => {
|
|
8229
|
+
setActiveStep("type");
|
|
8230
|
+
setSelectedType(null);
|
|
8231
|
+
setConfig({});
|
|
8232
|
+
onClose();
|
|
8233
|
+
};
|
|
8234
|
+
const steps = [
|
|
8235
|
+
{
|
|
8236
|
+
id: "type",
|
|
8237
|
+
label: "Type",
|
|
8238
|
+
description: "Choose list type",
|
|
8239
|
+
disabled: false
|
|
8240
|
+
},
|
|
8241
|
+
{
|
|
8242
|
+
id: "configure",
|
|
8243
|
+
label: "Configure",
|
|
8244
|
+
description: "Set configuration",
|
|
8245
|
+
disabled: !selectedType
|
|
8246
|
+
},
|
|
8247
|
+
{
|
|
8248
|
+
id: "preview",
|
|
8249
|
+
label: "Preview",
|
|
8250
|
+
description: "Preview and add",
|
|
8251
|
+
disabled: !selectedType || !isConfigValid()
|
|
8252
|
+
}
|
|
8253
|
+
];
|
|
8254
|
+
const renderStepContent = () => {
|
|
8255
|
+
switch (activeStep) {
|
|
8256
|
+
case "type":
|
|
8257
|
+
return /* @__PURE__ */ React92.createElement(EnumChecklistTypeSelection, { selectedType, onTypeSelect: handleTypeSelect, onNext: () => setActiveStep("configure") });
|
|
8258
|
+
case "configure":
|
|
8259
|
+
return selectedType ? /* @__PURE__ */ React92.createElement(
|
|
8260
|
+
EnumChecklistConfigurationStep,
|
|
8261
|
+
{
|
|
8262
|
+
enumChecklistType: selectedType,
|
|
8263
|
+
config,
|
|
8264
|
+
onConfigChange: handleConfigChange,
|
|
8265
|
+
onNext: () => setActiveStep("preview"),
|
|
8266
|
+
onPrev: () => setActiveStep("type"),
|
|
8267
|
+
isValid: isConfigValid()
|
|
8268
|
+
}
|
|
8269
|
+
) : null;
|
|
8270
|
+
case "preview":
|
|
8271
|
+
return selectedType ? /* @__PURE__ */ React92.createElement(EnumChecklistPreviewStep, { listType: selectedType, onAddToBlock: handleAddToBlock, onPrev: () => setActiveStep("configure") }) : null;
|
|
8272
|
+
default:
|
|
8273
|
+
return null;
|
|
8274
|
+
}
|
|
8275
|
+
};
|
|
8276
|
+
return /* @__PURE__ */ React92.createElement(Modal2, { opened, onClose: handleClose, title: "Configure Enum Checklist Block", size: "xl" }, /* @__PURE__ */ React92.createElement(Group30, { align: "flex-start", gap: "lg", style: { minHeight: "400px" } }, /* @__PURE__ */ React92.createElement(Box19, { style: { width: "200px", flexShrink: 0, height: "400px", display: "flex" } }, /* @__PURE__ */ React92.createElement(ModalNavigation, { steps, activeStep, onStepChange: setActiveStep, showUpdateButton: selectedType !== null, onUpdateBlock: handleAddToBlock })), /* @__PURE__ */ React92.createElement(Box19, { style: { flex: 1 } }, renderStepContent())));
|
|
8277
|
+
};
|
|
8278
|
+
|
|
8279
|
+
// src/mantine/blocks/enumChecklist/EnumChecklistBlock.tsx
|
|
8280
|
+
var IconSettings2 = () => /* @__PURE__ */ React93.createElement("span", null, "\u2699\uFE0F");
|
|
8281
|
+
var EnumChecklistBlockType = "enumChecklist";
|
|
8282
|
+
var EnumChecklistBlockContent = ({ block, editor }) => {
|
|
8283
|
+
const [modalOpened, setModalOpened] = useState23(false);
|
|
8284
|
+
const { editable } = useBlocknoteContext();
|
|
8285
|
+
const listType = block.props.listType && block.props.listType !== "" ? block.props.listType : null;
|
|
8286
|
+
const listConfig = useMemo16(() => {
|
|
8287
|
+
if (block.props.listConfig && block.props.listConfig !== "{}") {
|
|
8288
|
+
try {
|
|
8289
|
+
return JSON.parse(block.props.listConfig);
|
|
8290
|
+
} catch (error) {
|
|
8291
|
+
console.error("Failed to parse listConfig:", error);
|
|
8292
|
+
return {};
|
|
8293
|
+
}
|
|
8294
|
+
}
|
|
8295
|
+
return {};
|
|
8296
|
+
}, [block.props.listConfig]);
|
|
8297
|
+
const selectedIds = useMemo16(() => {
|
|
8298
|
+
if (block.props.selectedIds && block.props.selectedIds !== "[]") {
|
|
8299
|
+
try {
|
|
8300
|
+
return new Set(JSON.parse(block.props.selectedIds));
|
|
8301
|
+
} catch (error) {
|
|
8302
|
+
console.error("Failed to parse selectedIds:", error);
|
|
8303
|
+
return /* @__PURE__ */ new Set();
|
|
8304
|
+
}
|
|
8305
|
+
}
|
|
8306
|
+
return /* @__PURE__ */ new Set();
|
|
8307
|
+
}, [block.props.selectedIds]);
|
|
8308
|
+
useEffect14(() => {
|
|
8309
|
+
if (listConfig?.selection_mode === "single" && selectedIds.size > 1) {
|
|
8310
|
+
const arr = Array.from(selectedIds);
|
|
8311
|
+
const lastSelected = arr.length > 0 ? arr[arr.length - 1] : void 0;
|
|
8312
|
+
updateProps({
|
|
8313
|
+
selectedIds: JSON.stringify(lastSelected ? [lastSelected] : [])
|
|
8314
|
+
});
|
|
8315
|
+
}
|
|
8316
|
+
}, [listConfig?.selection_mode, selectedIds]);
|
|
8317
|
+
const isItemChecked = useCallback14(
|
|
8318
|
+
(id) => {
|
|
8319
|
+
return selectedIds.has(id);
|
|
8320
|
+
},
|
|
8321
|
+
[selectedIds]
|
|
8322
|
+
);
|
|
8323
|
+
const onItemCheck = useCallback14(
|
|
8324
|
+
(id, checked) => {
|
|
8325
|
+
const currentSelectedIds = Array.from(selectedIds);
|
|
8326
|
+
let newSelectedIds;
|
|
8327
|
+
if (listConfig?.selection_mode === "single") {
|
|
8328
|
+
if (checked) {
|
|
8329
|
+
newSelectedIds = [id];
|
|
8330
|
+
} else {
|
|
8331
|
+
newSelectedIds = currentSelectedIds.filter((selectedId) => selectedId !== id);
|
|
8332
|
+
}
|
|
8333
|
+
} else {
|
|
8334
|
+
if (checked) {
|
|
8335
|
+
newSelectedIds = [...currentSelectedIds, id];
|
|
8336
|
+
} else {
|
|
8337
|
+
newSelectedIds = currentSelectedIds.filter((selectedId) => selectedId !== id);
|
|
8338
|
+
}
|
|
8339
|
+
}
|
|
8340
|
+
updateProps({
|
|
8341
|
+
selectedIds: JSON.stringify(newSelectedIds)
|
|
8342
|
+
});
|
|
8343
|
+
},
|
|
8344
|
+
[listConfig?.selection_mode, selectedIds]
|
|
8345
|
+
);
|
|
8346
|
+
const updateProps = (props) => {
|
|
8347
|
+
editor.updateBlock(block, {
|
|
8348
|
+
props: {
|
|
8349
|
+
...block.props,
|
|
8350
|
+
...props
|
|
8351
|
+
}
|
|
8352
|
+
});
|
|
8353
|
+
};
|
|
8354
|
+
const handleConfigSave = (config) => {
|
|
8355
|
+
updateProps({
|
|
8356
|
+
listType: config.listType,
|
|
8357
|
+
listConfig: JSON.stringify(config.listConfig),
|
|
8358
|
+
selectedIds: JSON.stringify(config.selectedIds || [])
|
|
8359
|
+
});
|
|
8360
|
+
setModalOpened(false);
|
|
8361
|
+
};
|
|
8362
|
+
const renderListComponent = () => {
|
|
8363
|
+
if (!listType) return null;
|
|
8364
|
+
switch (listType) {
|
|
8365
|
+
case "oracle_personalities":
|
|
8366
|
+
return /* @__PURE__ */ React93.createElement(
|
|
8367
|
+
OraclePersonalitiesEnumList,
|
|
8368
|
+
{
|
|
8369
|
+
items: getEnumListItems(listType),
|
|
8370
|
+
isItemChecked,
|
|
8371
|
+
onItemCheck,
|
|
8372
|
+
selectionMode: listConfig?.selection_mode
|
|
8373
|
+
}
|
|
8374
|
+
);
|
|
8375
|
+
default:
|
|
8376
|
+
return null;
|
|
8377
|
+
}
|
|
8378
|
+
};
|
|
8379
|
+
return /* @__PURE__ */ React93.createElement(Stack68, { w: "100%" }, listType && /* @__PURE__ */ React93.createElement(Flex15, { align: "center", justify: "space-between", gap: "xs" }, /* @__PURE__ */ React93.createElement(Text45, null, getEnumListNameByType(listType)), listConfig.listSelectionMode && /* @__PURE__ */ React93.createElement(Text45, { lh: 0.5, c: "dimmed" }, listConfig?.selection_mode === "single" ? "Single Selection" : "Multi Selection"), editable && /* @__PURE__ */ React93.createElement(Flex15, { justify: listType ? "space-between" : "flex-end" }, /* @__PURE__ */ React93.createElement(Flex15, { gap: "xs" }, /* @__PURE__ */ React93.createElement(ActionIcon10, { variant: "subtle", size: "sm", onClick: () => setModalOpened(true) }, /* @__PURE__ */ React93.createElement(IconSettings2, null))))), /* @__PURE__ */ React93.createElement(Flex15, { flex: 1 }, !listType ? /* @__PURE__ */ React93.createElement(Center3, { py: "xl" }, /* @__PURE__ */ React93.createElement(Stack68, { align: "center", gap: "sm" }, /* @__PURE__ */ React93.createElement(Text45, { size: "sm", c: "dimmed", ta: "center" }, "No list type configured"), /* @__PURE__ */ React93.createElement(Button23, { size: "sm", variant: "light", onClick: () => setModalOpened(true) }, "Configure List"))) : /* @__PURE__ */ React93.createElement(Stack68, { gap: "md", flex: 1 }, renderListComponent())), /* @__PURE__ */ React93.createElement(
|
|
8380
|
+
EnumChecklistConfigModal,
|
|
8381
|
+
{
|
|
8382
|
+
opened: modalOpened,
|
|
8383
|
+
onClose: () => setModalOpened(false),
|
|
8384
|
+
onSave: handleConfigSave,
|
|
8385
|
+
initialConfig: listType && listConfig ? {
|
|
8386
|
+
listType,
|
|
8387
|
+
listConfig,
|
|
8388
|
+
selectedIds: Array.from(selectedIds)
|
|
8389
|
+
} : null
|
|
8390
|
+
}
|
|
8391
|
+
));
|
|
8392
|
+
};
|
|
8393
|
+
var EnumChecklistBlock = createReactBlockSpec7(
|
|
8394
|
+
{
|
|
8395
|
+
//every block has type, responsible for slash menu label
|
|
8396
|
+
type: EnumChecklistBlockType,
|
|
8397
|
+
propSchema: {
|
|
8398
|
+
listType: {
|
|
8399
|
+
default: ""
|
|
8400
|
+
},
|
|
8401
|
+
listConfig: {
|
|
8402
|
+
default: "{}"
|
|
8403
|
+
},
|
|
8404
|
+
selectedIds: {
|
|
8405
|
+
default: "[]"
|
|
8406
|
+
}
|
|
8407
|
+
},
|
|
8408
|
+
content: "none"
|
|
8409
|
+
},
|
|
8410
|
+
{
|
|
8411
|
+
render: (props) => /* @__PURE__ */ React93.createElement(EnumChecklistBlockContent, { ...props })
|
|
8412
|
+
}
|
|
8413
|
+
);
|
|
8414
|
+
|
|
7168
8415
|
// src/mantine/blocks/registry/blockRegistry.ts
|
|
7169
8416
|
var BlockRegistry = class {
|
|
7170
8417
|
constructor() {
|
|
@@ -7249,11 +8496,21 @@ blockRegistry.register({
|
|
|
7249
8496
|
validDependencies: [],
|
|
7250
8497
|
defaultProps: {}
|
|
7251
8498
|
});
|
|
8499
|
+
blockRegistry.register({
|
|
8500
|
+
type: "enumChecklist",
|
|
8501
|
+
propSchema: {
|
|
8502
|
+
listType: "",
|
|
8503
|
+
listConfig: "{}"
|
|
8504
|
+
},
|
|
8505
|
+
validDependencies: [],
|
|
8506
|
+
defaultProps: {}
|
|
8507
|
+
});
|
|
7252
8508
|
|
|
7253
8509
|
// src/mantine/blocks/index.ts
|
|
7254
8510
|
var blockSpecs = {
|
|
7255
8511
|
checkbox: CheckboxBlockSpec,
|
|
7256
8512
|
list: ListBlock,
|
|
8513
|
+
enumChecklist: EnumChecklistBlock,
|
|
7257
8514
|
overview: OverviewBlock,
|
|
7258
8515
|
proposalVote: ProposalVoteBlockSpec,
|
|
7259
8516
|
proposal: ProposalBlockSpec,
|
|
@@ -7309,6 +8566,27 @@ var getExtraSlashMenuItems = (editor) => [
|
|
|
7309
8566
|
group: "Domains",
|
|
7310
8567
|
subtext: "Create a dynamic list from DID data"
|
|
7311
8568
|
},
|
|
8569
|
+
{
|
|
8570
|
+
title: "Enum Checklist",
|
|
8571
|
+
onItemClick: () => {
|
|
8572
|
+
editor.insertBlocks(
|
|
8573
|
+
[
|
|
8574
|
+
{
|
|
8575
|
+
type: EnumChecklistBlockType,
|
|
8576
|
+
props: {
|
|
8577
|
+
listType: "",
|
|
8578
|
+
listConfig: "{}"
|
|
8579
|
+
}
|
|
8580
|
+
}
|
|
8581
|
+
],
|
|
8582
|
+
editor.getTextCursorPosition().block,
|
|
8583
|
+
"after"
|
|
8584
|
+
);
|
|
8585
|
+
},
|
|
8586
|
+
aliases: ["enum", "enum-checklist", "enum-list", "enum-checklist-block"],
|
|
8587
|
+
group: "Domains",
|
|
8588
|
+
subtext: "Create a predefined enum checklist"
|
|
8589
|
+
},
|
|
7312
8590
|
{
|
|
7313
8591
|
title: "Overview",
|
|
7314
8592
|
onItemClick: () => {
|
|
@@ -7482,21 +8760,21 @@ import {
|
|
|
7482
8760
|
} from "@blocknote/core";
|
|
7483
8761
|
|
|
7484
8762
|
// src/core/hooks/useMatrixProvider.ts
|
|
7485
|
-
import { useEffect as
|
|
8763
|
+
import { useEffect as useEffect15, useState as useState24, useRef as useRef3, useCallback as useCallback15, useMemo as useMemo17 } from "react";
|
|
7486
8764
|
import { MatrixProvider } from "@ixo/matrix-crdt";
|
|
7487
8765
|
function useMatrixProvider({
|
|
7488
8766
|
matrixClient,
|
|
7489
8767
|
roomId,
|
|
7490
8768
|
yDoc
|
|
7491
8769
|
}) {
|
|
7492
|
-
const [matrixProvider, setProvider] =
|
|
7493
|
-
const [status, setStatus] =
|
|
8770
|
+
const [matrixProvider, setProvider] = useState24(null);
|
|
8771
|
+
const [status, setStatus] = useState24(
|
|
7494
8772
|
"disconnected"
|
|
7495
8773
|
);
|
|
7496
8774
|
const isMountedRef = useRef3(true);
|
|
7497
8775
|
const providerRef = useRef3(null);
|
|
7498
8776
|
const retryTimeoutRef = useRef3(null);
|
|
7499
|
-
const providerOptions =
|
|
8777
|
+
const providerOptions = useMemo17(
|
|
7500
8778
|
() => ({
|
|
7501
8779
|
translator: {
|
|
7502
8780
|
updateEventType: "matrix-crdt.doc_update",
|
|
@@ -7509,22 +8787,22 @@ function useMatrixProvider({
|
|
|
7509
8787
|
}),
|
|
7510
8788
|
[]
|
|
7511
8789
|
);
|
|
7512
|
-
const handleDocumentAvailable =
|
|
8790
|
+
const handleDocumentAvailable = useCallback15(() => {
|
|
7513
8791
|
if (isMountedRef.current) {
|
|
7514
8792
|
setStatus("connected");
|
|
7515
8793
|
}
|
|
7516
8794
|
}, []);
|
|
7517
|
-
const handleDocumentUnavailable =
|
|
8795
|
+
const handleDocumentUnavailable = useCallback15(() => {
|
|
7518
8796
|
if (isMountedRef.current) {
|
|
7519
8797
|
setStatus("failed");
|
|
7520
8798
|
}
|
|
7521
8799
|
}, []);
|
|
7522
|
-
const handleCanWriteChanged =
|
|
8800
|
+
const handleCanWriteChanged = useCallback15(() => {
|
|
7523
8801
|
if (isMountedRef.current && providerRef.current) {
|
|
7524
8802
|
setStatus(providerRef.current.canWrite ? "connected" : "failed");
|
|
7525
8803
|
}
|
|
7526
8804
|
}, []);
|
|
7527
|
-
const initProvider =
|
|
8805
|
+
const initProvider = useCallback15(async () => {
|
|
7528
8806
|
if (!isMountedRef.current) return;
|
|
7529
8807
|
if (retryTimeoutRef.current) {
|
|
7530
8808
|
clearTimeout(retryTimeoutRef.current);
|
|
@@ -7569,7 +8847,7 @@ function useMatrixProvider({
|
|
|
7569
8847
|
handleDocumentUnavailable,
|
|
7570
8848
|
handleCanWriteChanged
|
|
7571
8849
|
]);
|
|
7572
|
-
|
|
8850
|
+
useEffect15(() => {
|
|
7573
8851
|
isMountedRef.current = true;
|
|
7574
8852
|
initProvider();
|
|
7575
8853
|
return () => {
|
|
@@ -7586,7 +8864,7 @@ function useMatrixProvider({
|
|
|
7586
8864
|
setStatus("disconnected");
|
|
7587
8865
|
};
|
|
7588
8866
|
}, [initProvider]);
|
|
7589
|
-
|
|
8867
|
+
useEffect15(() => {
|
|
7590
8868
|
return () => {
|
|
7591
8869
|
isMountedRef.current = false;
|
|
7592
8870
|
};
|
|
@@ -7595,10 +8873,10 @@ function useMatrixProvider({
|
|
|
7595
8873
|
}
|
|
7596
8874
|
|
|
7597
8875
|
// src/mantine/hooks/useCollaborativeYDoc.ts
|
|
7598
|
-
import { useMemo as
|
|
8876
|
+
import { useMemo as useMemo18 } from "react";
|
|
7599
8877
|
import * as Y from "yjs";
|
|
7600
8878
|
function useCollaborativeYDoc(options) {
|
|
7601
|
-
return
|
|
8879
|
+
return useMemo18(() => {
|
|
7602
8880
|
const doc = new Y.Doc();
|
|
7603
8881
|
const root = doc.getMap("root");
|
|
7604
8882
|
root.set("@context", "https://ixo.world/flow/0.3");
|
|
@@ -7617,7 +8895,7 @@ function useCollaborativeYDoc(options) {
|
|
|
7617
8895
|
}
|
|
7618
8896
|
|
|
7619
8897
|
// src/mantine/hooks/useCollaborativeIxoEditor.ts
|
|
7620
|
-
import { useMemo as
|
|
8898
|
+
import { useMemo as useMemo19, useEffect as useEffect16 } from "react";
|
|
7621
8899
|
function useCreateCollaborativeIxoEditor(options) {
|
|
7622
8900
|
const yDoc = useCollaborativeYDoc(options);
|
|
7623
8901
|
const {
|
|
@@ -7634,7 +8912,7 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
7634
8912
|
user,
|
|
7635
8913
|
matrixClient
|
|
7636
8914
|
} = options || {};
|
|
7637
|
-
const memoizedUser =
|
|
8915
|
+
const memoizedUser = useMemo19(
|
|
7638
8916
|
() => ({
|
|
7639
8917
|
id: user?.id || "",
|
|
7640
8918
|
name: user?.name || "",
|
|
@@ -7649,7 +8927,7 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
7649
8927
|
matrixClient,
|
|
7650
8928
|
roomId: options.roomId
|
|
7651
8929
|
});
|
|
7652
|
-
const defaultUploadFile =
|
|
8930
|
+
const defaultUploadFile = useMemo19(
|
|
7653
8931
|
() => uploadFile || (async (file) => {
|
|
7654
8932
|
return new Promise((resolve, reject) => {
|
|
7655
8933
|
const reader = new FileReader();
|
|
@@ -7663,7 +8941,7 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
7663
8941
|
}),
|
|
7664
8942
|
[uploadFile]
|
|
7665
8943
|
);
|
|
7666
|
-
const schema =
|
|
8944
|
+
const schema = useMemo19(
|
|
7667
8945
|
() => BlockNoteSchema2.create({
|
|
7668
8946
|
blockSpecs: {
|
|
7669
8947
|
...defaultBlockSpecs2,
|
|
@@ -7678,11 +8956,11 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
7678
8956
|
}),
|
|
7679
8957
|
[]
|
|
7680
8958
|
);
|
|
7681
|
-
const root =
|
|
7682
|
-
const documentFragment =
|
|
7683
|
-
const flowArray =
|
|
7684
|
-
const userFragment =
|
|
7685
|
-
const collaborationConfig =
|
|
8959
|
+
const root = useMemo19(() => yDoc.getMap("root"), [yDoc]);
|
|
8960
|
+
const documentFragment = useMemo19(() => yDoc.getXmlFragment("document"), [yDoc]);
|
|
8961
|
+
const flowArray = useMemo19(() => yDoc.getArray("flow"), [yDoc]);
|
|
8962
|
+
const userFragment = useMemo19(() => yDoc.getMap(memoizedUser.id), [yDoc, memoizedUser.id]);
|
|
8963
|
+
const collaborationConfig = useMemo19(
|
|
7686
8964
|
() => ({
|
|
7687
8965
|
provider: matrixProvider,
|
|
7688
8966
|
fragment: documentFragment,
|
|
@@ -7694,7 +8972,7 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
7694
8972
|
}),
|
|
7695
8973
|
[matrixProvider, documentFragment, memoizedUser.name, memoizedUser.color]
|
|
7696
8974
|
);
|
|
7697
|
-
const ixoConfig =
|
|
8975
|
+
const ixoConfig = useMemo19(
|
|
7698
8976
|
() => ({
|
|
7699
8977
|
theme,
|
|
7700
8978
|
editable,
|
|
@@ -7713,7 +8991,7 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
7713
8991
|
uploadFile: defaultUploadFile,
|
|
7714
8992
|
collaboration: collaborationConfig
|
|
7715
8993
|
});
|
|
7716
|
-
const titleText =
|
|
8994
|
+
const titleText = useMemo19(() => yDoc.getText("title"), [yDoc]);
|
|
7717
8995
|
let ixoEditor;
|
|
7718
8996
|
if (editor) {
|
|
7719
8997
|
ixoEditor = editor;
|
|
@@ -7754,7 +9032,7 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
7754
9032
|
return flowArray.toArray();
|
|
7755
9033
|
};
|
|
7756
9034
|
}
|
|
7757
|
-
|
|
9035
|
+
useEffect16(() => {
|
|
7758
9036
|
if (ixoEditor) {
|
|
7759
9037
|
ixoEditor.isEditable = editable;
|
|
7760
9038
|
}
|
|
@@ -7770,19 +9048,19 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
7770
9048
|
}
|
|
7771
9049
|
|
|
7772
9050
|
// src/mantine/IxoEditor.tsx
|
|
7773
|
-
import
|
|
9051
|
+
import React95 from "react";
|
|
7774
9052
|
import { getDefaultReactSlashMenuItems, SuggestionMenuController } from "@blocknote/react";
|
|
7775
9053
|
import { BlockNoteView } from "@blocknote/mantine";
|
|
7776
9054
|
import { filterSuggestionItems } from "@blocknote/core";
|
|
7777
9055
|
import { MantineProvider } from "@mantine/core";
|
|
7778
9056
|
|
|
7779
9057
|
// src/mantine/components/PanelContent.tsx
|
|
7780
|
-
import
|
|
9058
|
+
import React94 from "react";
|
|
7781
9059
|
function PanelContent() {
|
|
7782
9060
|
const { activePanel, registeredPanels } = usePanelStore();
|
|
7783
9061
|
const isOpen = activePanel !== null;
|
|
7784
9062
|
const content = activePanel ? registeredPanels.get(activePanel) : null;
|
|
7785
|
-
return /* @__PURE__ */
|
|
9063
|
+
return /* @__PURE__ */ React94.createElement(
|
|
7786
9064
|
"div",
|
|
7787
9065
|
{
|
|
7788
9066
|
style: {
|
|
@@ -7806,13 +9084,13 @@ function IxoEditorContent({
|
|
|
7806
9084
|
onSelectionChange,
|
|
7807
9085
|
children
|
|
7808
9086
|
}) {
|
|
7809
|
-
return /* @__PURE__ */
|
|
9087
|
+
return /* @__PURE__ */ React95.createElement("div", { style: { display: "flex", height: "100%" } }, /* @__PURE__ */ React95.createElement(
|
|
7810
9088
|
"div",
|
|
7811
9089
|
{
|
|
7812
9090
|
className: `ixo-editor ixo-editor--theme-${config.theme} ${className}`,
|
|
7813
9091
|
style: { flex: 1 }
|
|
7814
9092
|
},
|
|
7815
|
-
/* @__PURE__ */
|
|
9093
|
+
/* @__PURE__ */ React95.createElement(
|
|
7816
9094
|
BlockNoteView,
|
|
7817
9095
|
{
|
|
7818
9096
|
editor,
|
|
@@ -7827,7 +9105,7 @@ function IxoEditorContent({
|
|
|
7827
9105
|
onChange,
|
|
7828
9106
|
onSelectionChange
|
|
7829
9107
|
},
|
|
7830
|
-
config.slashMenu && /* @__PURE__ */
|
|
9108
|
+
config.slashMenu && /* @__PURE__ */ React95.createElement(
|
|
7831
9109
|
SuggestionMenuController,
|
|
7832
9110
|
{
|
|
7833
9111
|
triggerCharacter: "/",
|
|
@@ -7840,7 +9118,7 @@ function IxoEditorContent({
|
|
|
7840
9118
|
),
|
|
7841
9119
|
children
|
|
7842
9120
|
)
|
|
7843
|
-
), /* @__PURE__ */
|
|
9121
|
+
), /* @__PURE__ */ React95.createElement(PanelContent, null));
|
|
7844
9122
|
}
|
|
7845
9123
|
function IxoEditor({
|
|
7846
9124
|
editor,
|
|
@@ -7866,7 +9144,7 @@ function IxoEditor({
|
|
|
7866
9144
|
tableHandles: true
|
|
7867
9145
|
};
|
|
7868
9146
|
const isEditable = editable;
|
|
7869
|
-
const editorContent = /* @__PURE__ */
|
|
9147
|
+
const editorContent = /* @__PURE__ */ React95.createElement(
|
|
7870
9148
|
BlocknoteProvider,
|
|
7871
9149
|
{
|
|
7872
9150
|
editor,
|
|
@@ -7874,7 +9152,7 @@ function IxoEditor({
|
|
|
7874
9152
|
blockRequirements,
|
|
7875
9153
|
editable: isEditable
|
|
7876
9154
|
},
|
|
7877
|
-
/* @__PURE__ */
|
|
9155
|
+
/* @__PURE__ */ React95.createElement(
|
|
7878
9156
|
IxoEditorContent,
|
|
7879
9157
|
{
|
|
7880
9158
|
editor,
|
|
@@ -7888,7 +9166,7 @@ function IxoEditor({
|
|
|
7888
9166
|
)
|
|
7889
9167
|
);
|
|
7890
9168
|
if (mantineTheme) {
|
|
7891
|
-
return /* @__PURE__ */
|
|
9169
|
+
return /* @__PURE__ */ React95.createElement(MantineProvider, { theme: mantineTheme }, editorContent);
|
|
7892
9170
|
}
|
|
7893
9171
|
return editorContent;
|
|
7894
9172
|
}
|
|
@@ -7973,4 +9251,4 @@ export {
|
|
|
7973
9251
|
ixoGraphQLClient,
|
|
7974
9252
|
getEntity
|
|
7975
9253
|
};
|
|
7976
|
-
//# sourceMappingURL=chunk-
|
|
9254
|
+
//# sourceMappingURL=chunk-N4T5JPKZ.mjs.map
|