@ixo/editor 1.8.2 → 1.10.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.
|
@@ -1330,11 +1330,11 @@ var CheckboxBlockSpec = createReactBlockSpec(
|
|
|
1330
1330
|
);
|
|
1331
1331
|
|
|
1332
1332
|
// src/mantine/blocks/list/ListBlockSpec.tsx
|
|
1333
|
-
import
|
|
1333
|
+
import React39 from "react";
|
|
1334
1334
|
import { createReactBlockSpec as createReactBlockSpec2 } from "@blocknote/react";
|
|
1335
1335
|
|
|
1336
1336
|
// src/mantine/blocks/list/ListBlock.tsx
|
|
1337
|
-
import
|
|
1337
|
+
import React38 from "react";
|
|
1338
1338
|
|
|
1339
1339
|
// src/mantine/blocks/list/template/TemplateView.tsx
|
|
1340
1340
|
import React16, { useMemo as useMemo6 } from "react";
|
|
@@ -1375,6 +1375,13 @@ var linkedResourcesSortFields = [
|
|
|
1375
1375
|
{ key: "mediaType", label: "Media Type", type: "string" },
|
|
1376
1376
|
{ key: "serviceEndpoint", label: "Service Endpoint", type: "string" }
|
|
1377
1377
|
];
|
|
1378
|
+
var linkedResourcesSelectionPanelConfig = {
|
|
1379
|
+
title: (item) => item.description || "Linked Resource",
|
|
1380
|
+
description: (item) => item.description || "No description",
|
|
1381
|
+
prompts: (item) => [{ text: `ID: ${item.id}` }, { text: `Encrypted: ${item.encrypted ? "Yes" : "No"}` }, { text: `Service Endpoint: ${item.serviceEndpoint}` }],
|
|
1382
|
+
actionSections: (item) => item.actionSections,
|
|
1383
|
+
detailsHandlerKey: "getLinkedResourceDetails"
|
|
1384
|
+
};
|
|
1378
1385
|
|
|
1379
1386
|
// src/mantine/blocks/list/assets/config.ts
|
|
1380
1387
|
var assetsMetadata = {
|
|
@@ -1412,6 +1419,13 @@ var assetsFilterFields = [
|
|
|
1412
1419
|
{ key: "available", label: "Available", type: true },
|
|
1413
1420
|
{ key: "available", label: "Unavailable", type: false }
|
|
1414
1421
|
];
|
|
1422
|
+
var assetsSelectionPanelConfig = {
|
|
1423
|
+
title: (item) => item.name || "Unnamed Asset",
|
|
1424
|
+
description: (item) => item.description || "No description",
|
|
1425
|
+
prompts: () => [{ text: `How many assets are available?` }, { text: `What are carbon credits` }],
|
|
1426
|
+
actionSections: (item) => item.actionSections,
|
|
1427
|
+
detailsHandlerKey: "getAssetDetails"
|
|
1428
|
+
};
|
|
1415
1429
|
|
|
1416
1430
|
// src/mantine/blocks/list/transactions/config.ts
|
|
1417
1431
|
var transactionsMetadata = {
|
|
@@ -1437,6 +1451,13 @@ var transactionsSortFields = [
|
|
|
1437
1451
|
{ key: "transactionHash", label: "Transaction Hash", type: "string" },
|
|
1438
1452
|
{ key: "memo", label: "Memo", type: "string" }
|
|
1439
1453
|
];
|
|
1454
|
+
var transactionsSelectionPanelConfig = {
|
|
1455
|
+
title: (item) => item.typeUrl || "Transaction",
|
|
1456
|
+
description: (item) => item.description || "No description",
|
|
1457
|
+
prompts: (item) => [{ text: `Hash: ${item.transactionHash}` }, { text: `Type: ${item.typeUrl}` }],
|
|
1458
|
+
actionSections: (item) => item.actionSections,
|
|
1459
|
+
detailsHandlerKey: "getTransactionDetails"
|
|
1460
|
+
};
|
|
1440
1461
|
|
|
1441
1462
|
// src/mantine/blocks/list/collections/config.ts
|
|
1442
1463
|
var collectionsMetadata = {
|
|
@@ -1467,6 +1488,13 @@ var collectionsSortFields = [
|
|
|
1467
1488
|
}
|
|
1468
1489
|
];
|
|
1469
1490
|
var collectionsHandlerKey = "getCollections";
|
|
1491
|
+
var collectionsSelectionPanelConfig = {
|
|
1492
|
+
title: (item) => item.name || "Unnamed Collection",
|
|
1493
|
+
description: (item) => item.description || "No description",
|
|
1494
|
+
prompts: (item) => [{ text: `DID: ${item.did}` }, { text: `Type: ${item.type}` }],
|
|
1495
|
+
actionSections: (item) => item.actionSections,
|
|
1496
|
+
detailsHandlerKey: "getCollectionDetails"
|
|
1497
|
+
};
|
|
1470
1498
|
|
|
1471
1499
|
// src/mantine/blocks/list/investments/config.ts
|
|
1472
1500
|
var investmentsMetadata = {
|
|
@@ -1498,6 +1526,17 @@ var investmentsFilterFields = [
|
|
|
1498
1526
|
{ key: "isOpen", label: "Closed", type: false }
|
|
1499
1527
|
];
|
|
1500
1528
|
var investmentsHandlerKey = "getInvestments";
|
|
1529
|
+
var investmentsSelectionPanelConfig = {
|
|
1530
|
+
title: (item) => item.name || "Investment Opportunity",
|
|
1531
|
+
description: (item) => item.description || "No description",
|
|
1532
|
+
prompts: (item) => [
|
|
1533
|
+
{ text: `Price: ${item.price} ${item.currency}` },
|
|
1534
|
+
{ text: `Subscribed: ${item.isSubscribed ? "Yes" : "No"}` },
|
|
1535
|
+
{ text: `Open: ${item.isOpen ? "Yes" : "No"}` }
|
|
1536
|
+
],
|
|
1537
|
+
actionSections: (item) => item.actionSections,
|
|
1538
|
+
detailsHandlerKey: "getInvestmentDetails"
|
|
1539
|
+
};
|
|
1501
1540
|
|
|
1502
1541
|
// src/mantine/blocks/list/oracles/config.ts
|
|
1503
1542
|
var oraclesMetadata = {
|
|
@@ -1529,6 +1568,13 @@ var oraclesFilterFields = [
|
|
|
1529
1568
|
{ key: "isInvited", label: "Not Invited", type: false }
|
|
1530
1569
|
];
|
|
1531
1570
|
var oraclesHandlerKey = "getOracles";
|
|
1571
|
+
var oraclesSelectionPanelConfig = {
|
|
1572
|
+
title: (item) => item.name || "Oracle",
|
|
1573
|
+
description: (item) => item.description || "No description",
|
|
1574
|
+
prompts: (item) => [{ text: `Flows Amount: ${item.flowsAmount}` }, { text: `Active: ${item.isActive ? "Yes" : "No"}` }, { text: `Invited: ${item.isInvited ? "Yes" : "No"}` }],
|
|
1575
|
+
actionSections: (item) => item.actionSections,
|
|
1576
|
+
detailsHandlerKey: "getOracleDetails"
|
|
1577
|
+
};
|
|
1532
1578
|
|
|
1533
1579
|
// src/mantine/blocks/list/pods/config.ts
|
|
1534
1580
|
var podsMetadata = {
|
|
@@ -1558,6 +1604,13 @@ var podsFilterFields = [
|
|
|
1558
1604
|
{ key: "isMember", label: "Other", type: false }
|
|
1559
1605
|
];
|
|
1560
1606
|
var podsHandlerKey = "getPODs";
|
|
1607
|
+
var podsSelectionPanelConfig = {
|
|
1608
|
+
title: (item) => item.name || "POD",
|
|
1609
|
+
description: (item) => item.description || "No description",
|
|
1610
|
+
prompts: (item) => [{ text: `Start Date: ${item.startDate}` }, { text: `End Date: ${item.endDate}` }, { text: `Member: ${item.isMember ? "Yes" : "No"}` }],
|
|
1611
|
+
actionSections: (item) => item.actionSections,
|
|
1612
|
+
detailsHandlerKey: "getPODDetails"
|
|
1613
|
+
};
|
|
1561
1614
|
|
|
1562
1615
|
// src/mantine/blocks/list/proposals/config.ts
|
|
1563
1616
|
var proposalsMetadata = {
|
|
@@ -1584,6 +1637,13 @@ var proposalsSortFields = [
|
|
|
1584
1637
|
{ key: "name", label: "Name", type: "string" }
|
|
1585
1638
|
];
|
|
1586
1639
|
var proposalsHandlerKey = "getProposals";
|
|
1640
|
+
var proposalsSelectionPanelConfig = {
|
|
1641
|
+
title: (item) => item.name || "Proposal",
|
|
1642
|
+
description: (item) => item.description || "No description",
|
|
1643
|
+
prompts: (item) => [{ text: `DID: ${item.did}` }, { text: `Status: ${item.status}` }],
|
|
1644
|
+
actionSections: (item) => item.actionSections,
|
|
1645
|
+
detailsHandlerKey: "getProposalDetails"
|
|
1646
|
+
};
|
|
1587
1647
|
|
|
1588
1648
|
// src/mantine/blocks/list/requests/config.ts
|
|
1589
1649
|
var requestsMetadata = {
|
|
@@ -1612,6 +1672,13 @@ var requestsFilterFields = [
|
|
|
1612
1672
|
{ key: "isMember", label: "Other", type: false }
|
|
1613
1673
|
];
|
|
1614
1674
|
var requestsHandlerKey = "getRequests";
|
|
1675
|
+
var requestsSelectionPanelConfig = {
|
|
1676
|
+
title: (item) => item.name || "Request",
|
|
1677
|
+
description: (item) => item.description || "No description",
|
|
1678
|
+
prompts: (item) => [{ text: `Total Applications: ${item.totalApplications}` }, { text: `Member: ${item.isMember ? "Yes" : "No"}` }, { text: `DID: ${item.did}` }],
|
|
1679
|
+
actionSections: (item) => item.actionSections,
|
|
1680
|
+
detailsHandlerKey: "getRequestDetails"
|
|
1681
|
+
};
|
|
1615
1682
|
|
|
1616
1683
|
// src/mantine/blocks/list/members/config.ts
|
|
1617
1684
|
var groupMembersMetadata = {
|
|
@@ -1649,6 +1716,13 @@ var groupMembersSortFields = [
|
|
|
1649
1716
|
{ key: "role", label: "Role", type: "string" }
|
|
1650
1717
|
];
|
|
1651
1718
|
var groupMembersHandlerKey = "getGroupMembers";
|
|
1719
|
+
var groupMembersSelectionPanelConfig = {
|
|
1720
|
+
title: (item) => item.username || "Unknown Member",
|
|
1721
|
+
description: (item) => item.description || "No description",
|
|
1722
|
+
prompts: (item) => [{ text: `Address: ${item.address}` }, { text: `DID: ${item.did}` }],
|
|
1723
|
+
actionSections: (item) => item.actionSections,
|
|
1724
|
+
detailsHandlerKey: "getMemberDetails"
|
|
1725
|
+
};
|
|
1652
1726
|
|
|
1653
1727
|
// src/mantine/blocks/list/validators/config.ts
|
|
1654
1728
|
var validatorsMetadata = {
|
|
@@ -1677,6 +1751,17 @@ var validatorsFilterFields = [
|
|
|
1677
1751
|
{ key: "isBonding", label: "Bonding", type: true }
|
|
1678
1752
|
];
|
|
1679
1753
|
var validatorsHandlerKey = "getValidators";
|
|
1754
|
+
var validatorsSelectionPanelConfig = {
|
|
1755
|
+
title: (item) => item.name || "Unknown Validator",
|
|
1756
|
+
description: (item) => item.description || "No description",
|
|
1757
|
+
prompts: (item) => [
|
|
1758
|
+
{ text: `Status: ${item.isActive ? "Active" : "Inactive"}` },
|
|
1759
|
+
{ text: `Staked: ${item.isStaked ? "Yes" : "No"}` },
|
|
1760
|
+
{ text: `Bonding: ${item.isBonding ? "Yes" : "No"}` }
|
|
1761
|
+
],
|
|
1762
|
+
actionSections: (item) => item.actionSections,
|
|
1763
|
+
detailsHandlerKey: "getValidatorDetails"
|
|
1764
|
+
};
|
|
1680
1765
|
|
|
1681
1766
|
// src/mantine/blocks/list/dao_members/config.ts
|
|
1682
1767
|
var daoMembersMetadata = {
|
|
@@ -1714,6 +1799,13 @@ var daoMembersSortFields = [
|
|
|
1714
1799
|
{ key: "role", label: "Role", type: "string" }
|
|
1715
1800
|
];
|
|
1716
1801
|
var daoMembersHandlerKey = "getDaoMembers";
|
|
1802
|
+
var daoMembersSelectionPanelConfig = {
|
|
1803
|
+
title: (item) => item.username || "Unknown Member",
|
|
1804
|
+
description: (item) => item.description || "No description",
|
|
1805
|
+
prompts: (item) => [{ text: `Address: ${item.address}` }, { text: `DID: ${item.did}` }],
|
|
1806
|
+
actionSections: (item) => item.actionSections,
|
|
1807
|
+
detailsHandlerKey: "getDaoMemberDetails"
|
|
1808
|
+
};
|
|
1717
1809
|
|
|
1718
1810
|
// src/mantine/blocks/list/registry.ts
|
|
1719
1811
|
var listTypeRegistry = {
|
|
@@ -1811,6 +1903,23 @@ var getListTypeConfig = (type) => {
|
|
|
1811
1903
|
var getListNameByType = (type) => {
|
|
1812
1904
|
return listTypeRegistry[type].metadata.name;
|
|
1813
1905
|
};
|
|
1906
|
+
var listSelectionPanelRegistry = {
|
|
1907
|
+
linked_resources: linkedResourcesSelectionPanelConfig,
|
|
1908
|
+
assets: assetsSelectionPanelConfig,
|
|
1909
|
+
transactions: transactionsSelectionPanelConfig,
|
|
1910
|
+
collections: collectionsSelectionPanelConfig,
|
|
1911
|
+
investments: investmentsSelectionPanelConfig,
|
|
1912
|
+
oracles: oraclesSelectionPanelConfig,
|
|
1913
|
+
pods: podsSelectionPanelConfig,
|
|
1914
|
+
proposals: proposalsSelectionPanelConfig,
|
|
1915
|
+
requests: requestsSelectionPanelConfig,
|
|
1916
|
+
group_members: groupMembersSelectionPanelConfig,
|
|
1917
|
+
validators: validatorsSelectionPanelConfig,
|
|
1918
|
+
dao_members: daoMembersSelectionPanelConfig
|
|
1919
|
+
};
|
|
1920
|
+
var getSelectionPanelConfig = (type) => {
|
|
1921
|
+
return listSelectionPanelRegistry[type];
|
|
1922
|
+
};
|
|
1814
1923
|
|
|
1815
1924
|
// src/mantine/blocks/list/template/GeneralTab.tsx
|
|
1816
1925
|
var GeneralTab2 = ({ initialConfig, onSave }) => {
|
|
@@ -2066,8 +2175,8 @@ var ListTemplateView = ({ editor, block }) => {
|
|
|
2066
2175
|
};
|
|
2067
2176
|
|
|
2068
2177
|
// src/mantine/blocks/list/flow/FlowView.tsx
|
|
2069
|
-
import
|
|
2070
|
-
import { Group as
|
|
2178
|
+
import React37, { useState as useState6, useEffect as useEffect6, useMemo as useMemo8, useCallback as useCallback9 } from "react";
|
|
2179
|
+
import { Group as Group7, Stack as Stack24, Text as Text24, ActionIcon as ActionIcon4, Alert as Alert4, Loader as Loader2, Center as Center2, Flex as Flex15, Button as Button5 } from "@mantine/core";
|
|
2071
2180
|
|
|
2072
2181
|
// src/mantine/blocks/list/linked_resources/LinkedResourcesList.tsx
|
|
2073
2182
|
import React20 from "react";
|
|
@@ -2412,7 +2521,7 @@ function filterListItems(items, filterOption) {
|
|
|
2412
2521
|
}
|
|
2413
2522
|
|
|
2414
2523
|
// src/mantine/blocks/list/flow/FlowView.tsx
|
|
2415
|
-
import { IconArrowDown as IconArrowDown2, IconArrowUp as IconArrowUp2 } from "@tabler/icons-react";
|
|
2524
|
+
import { IconArrowDown as IconArrowDown2, IconArrowRight as IconArrowRight2, IconArrowUp as IconArrowUp2 } from "@tabler/icons-react";
|
|
2416
2525
|
|
|
2417
2526
|
// src/mantine/blocks/list/ListPagination.tsx
|
|
2418
2527
|
import React33 from "react";
|
|
@@ -2462,25 +2571,214 @@ var DaoMembersList = ({ items, mods, isItemChecked, onItemCheck }) => {
|
|
|
2462
2571
|
return /* @__PURE__ */ React34.createElement(Box13, { flex: 1 }, /* @__PURE__ */ React34.createElement(Stack21, { gap: "xs" }, rows));
|
|
2463
2572
|
};
|
|
2464
2573
|
|
|
2574
|
+
// src/mantine/blocks/list/ListSelectionPanel.tsx
|
|
2575
|
+
import React36, { useState as useState5, useEffect as useEffect5, useMemo as useMemo7 } from "react";
|
|
2576
|
+
import { Paper as Paper4, CloseButton as CloseButton3, Stack as Stack23, Alert as Alert3, Text as Text23, Loader, Center } from "@mantine/core";
|
|
2577
|
+
|
|
2578
|
+
// src/mantine/blocks/list/components/SelectionPanelContent.tsx
|
|
2579
|
+
import React35 from "react";
|
|
2580
|
+
import { Stack as Stack22, Text as Text22, Title as Title3, Divider as Divider2, Flex as Flex14, Paper as Paper3, Group as Group6 } from "@mantine/core";
|
|
2581
|
+
import { useHover } from "@mantine/hooks";
|
|
2582
|
+
import { IconArrowRight, IconTarget } from "@tabler/icons-react";
|
|
2583
|
+
var SelectionPanelHeader = ({ title, description }) => {
|
|
2584
|
+
return /* @__PURE__ */ React35.createElement(Stack22, { gap: "xs" }, /* @__PURE__ */ React35.createElement(Title3, { fw: 400, order: 3 }, title), /* @__PURE__ */ React35.createElement(Text22, { c: "dimmed" }, description));
|
|
2585
|
+
};
|
|
2586
|
+
var SelectionPromptItem = ({ prompt }) => {
|
|
2587
|
+
return /* @__PURE__ */ React35.createElement(React35.Fragment, null, /* @__PURE__ */ React35.createElement(Flex14, { gap: 10 }, /* @__PURE__ */ React35.createElement(IconArrowRight, { size: 24, color: "white" }), /* @__PURE__ */ React35.createElement(Text22, null, prompt.text)), /* @__PURE__ */ React35.createElement(Divider2, { c: "dimmed", h: 1 }));
|
|
2588
|
+
};
|
|
2589
|
+
var SelectionPrompts = ({ prompts }) => {
|
|
2590
|
+
if (!prompts || prompts.length === 0) return null;
|
|
2591
|
+
return /* @__PURE__ */ React35.createElement(Stack22, { gap: "xs" }, prompts.map((prompt, index) => /* @__PURE__ */ React35.createElement(SelectionPromptItem, { key: index, prompt })));
|
|
2592
|
+
};
|
|
2593
|
+
var SelectionActionButton = ({ action, itemId, itemData }) => {
|
|
2594
|
+
const { hovered, ref } = useHover();
|
|
2595
|
+
const handleClick = () => {
|
|
2596
|
+
action.onClick(itemId, itemData);
|
|
2597
|
+
};
|
|
2598
|
+
return /* @__PURE__ */ React35.createElement(
|
|
2599
|
+
Paper3,
|
|
2600
|
+
{
|
|
2601
|
+
ref,
|
|
2602
|
+
p: "md",
|
|
2603
|
+
style: {
|
|
2604
|
+
cursor: "pointer",
|
|
2605
|
+
transition: "all 0.2s ease",
|
|
2606
|
+
backgroundColor: hovered ? "var(--mantine-color-dark-5)" : "var(--mantine-color-dark-6)",
|
|
2607
|
+
border: `1px solid ${hovered ? "var(--mantine-color-dark-3)" : "var(--mantine-color-dark-4)"}`,
|
|
2608
|
+
transform: hovered ? "translateY(-1px)" : "translateY(0)",
|
|
2609
|
+
boxShadow: hovered ? "0 4px 12px rgba(0, 0, 0, 0.15)" : "none"
|
|
2610
|
+
},
|
|
2611
|
+
onClick: handleClick
|
|
2612
|
+
},
|
|
2613
|
+
/* @__PURE__ */ React35.createElement(Group6, { justify: "space-between", align: "center" }, /* @__PURE__ */ React35.createElement(Group6, { gap: "sm" }, /* @__PURE__ */ React35.createElement(IconTarget, { size: 20, color: "var(--mantine-color-gray-3)" }), /* @__PURE__ */ React35.createElement(Text22, { size: "sm", fw: 500, c: "white" }, action.label)), /* @__PURE__ */ React35.createElement(IconArrowRight, { size: 16, color: "var(--mantine-color-gray-4)" }))
|
|
2614
|
+
);
|
|
2615
|
+
};
|
|
2616
|
+
var SelectionActionSectionComponent = ({ section, itemId, itemData }) => {
|
|
2617
|
+
if (!section.actions || section.actions.length === 0) return null;
|
|
2618
|
+
return /* @__PURE__ */ React35.createElement(Stack22, { gap: "xs" }, /* @__PURE__ */ React35.createElement(Text22, { fw: 500 }, section.title), section.description && /* @__PURE__ */ React35.createElement(Text22, { size: "sm", c: "dimmed" }, section.description), /* @__PURE__ */ React35.createElement(Stack22, { gap: "xs" }, section.actions.map((action) => /* @__PURE__ */ React35.createElement(SelectionActionButton, { key: action.id, action, itemId, itemData }))));
|
|
2619
|
+
};
|
|
2620
|
+
var SelectionActionSections = ({ sections, itemId, itemData }) => {
|
|
2621
|
+
if (!sections || sections.length === 0) return null;
|
|
2622
|
+
return /* @__PURE__ */ React35.createElement(Stack22, { gap: "md" }, sections.map((section, index) => /* @__PURE__ */ React35.createElement(React35.Fragment, { key: index }, /* @__PURE__ */ React35.createElement(SelectionActionSectionComponent, { section, itemId, itemData }), index < sections.length - 1 && /* @__PURE__ */ React35.createElement(Divider2, null))));
|
|
2623
|
+
};
|
|
2624
|
+
var SelectionPanelEmpty = ({ message = "No item selected" }) => {
|
|
2625
|
+
return /* @__PURE__ */ React35.createElement(Stack22, { gap: "md", align: "center", py: "xl" }, /* @__PURE__ */ React35.createElement(Text22, { size: "sm", c: "dimmed", ta: "center" }, message));
|
|
2626
|
+
};
|
|
2627
|
+
|
|
2628
|
+
// src/mantine/blocks/list/ListSelectionPanel.tsx
|
|
2629
|
+
var ListSelectionPanel = ({ selectedIds, listType }) => {
|
|
2630
|
+
const { closePanel } = usePanelStore();
|
|
2631
|
+
const handlers = useBlocknoteHandlers();
|
|
2632
|
+
const [itemData, setItemData] = useState5(null);
|
|
2633
|
+
const [loading, setLoading] = useState5(false);
|
|
2634
|
+
const [error, setError] = useState5(null);
|
|
2635
|
+
const selectedItemId = useMemo7(() => {
|
|
2636
|
+
if (selectedIds.size === 0) return null;
|
|
2637
|
+
const idsArray = Array.from(selectedIds);
|
|
2638
|
+
return idsArray[idsArray.length - 1];
|
|
2639
|
+
}, [selectedIds]);
|
|
2640
|
+
const panelConfig = useMemo7(() => {
|
|
2641
|
+
if (!listType) return null;
|
|
2642
|
+
return getSelectionPanelConfig(listType);
|
|
2643
|
+
}, [listType]);
|
|
2644
|
+
useEffect5(() => {
|
|
2645
|
+
const fetchItemDetails = async () => {
|
|
2646
|
+
if (!selectedItemId || !listType || !handlers || !panelConfig) {
|
|
2647
|
+
setItemData(null);
|
|
2648
|
+
return;
|
|
2649
|
+
}
|
|
2650
|
+
setLoading(true);
|
|
2651
|
+
setError(null);
|
|
2652
|
+
try {
|
|
2653
|
+
const handlerKey = panelConfig.detailsHandlerKey;
|
|
2654
|
+
const handler = handlers[handlerKey];
|
|
2655
|
+
if (typeof handler === "function") {
|
|
2656
|
+
const details = await handler(selectedItemId);
|
|
2657
|
+
setItemData(details);
|
|
2658
|
+
} else {
|
|
2659
|
+
setItemData({ id: selectedItemId });
|
|
2660
|
+
}
|
|
2661
|
+
} catch (err) {
|
|
2662
|
+
console.error("Failed to fetch item details:", err);
|
|
2663
|
+
setError(err instanceof Error ? err.message : "Failed to fetch item details");
|
|
2664
|
+
} finally {
|
|
2665
|
+
setLoading(false);
|
|
2666
|
+
}
|
|
2667
|
+
};
|
|
2668
|
+
fetchItemDetails();
|
|
2669
|
+
}, [selectedItemId, listType, handlers, panelConfig]);
|
|
2670
|
+
if (!listType || !panelConfig) {
|
|
2671
|
+
return /* @__PURE__ */ React36.createElement(
|
|
2672
|
+
Paper4,
|
|
2673
|
+
{
|
|
2674
|
+
p: "md",
|
|
2675
|
+
shadow: "sm",
|
|
2676
|
+
style: {
|
|
2677
|
+
height: "100%",
|
|
2678
|
+
display: "flex",
|
|
2679
|
+
flexDirection: "column",
|
|
2680
|
+
position: "relative"
|
|
2681
|
+
}
|
|
2682
|
+
},
|
|
2683
|
+
/* @__PURE__ */ React36.createElement(
|
|
2684
|
+
CloseButton3,
|
|
2685
|
+
{
|
|
2686
|
+
onClick: closePanel,
|
|
2687
|
+
style: {
|
|
2688
|
+
position: "absolute",
|
|
2689
|
+
top: "1rem",
|
|
2690
|
+
right: "1rem",
|
|
2691
|
+
zIndex: 1
|
|
2692
|
+
}
|
|
2693
|
+
}
|
|
2694
|
+
),
|
|
2695
|
+
/* @__PURE__ */ React36.createElement(SelectionPanelEmpty, { message: "List type not configured" })
|
|
2696
|
+
);
|
|
2697
|
+
}
|
|
2698
|
+
if (!selectedItemId) {
|
|
2699
|
+
return /* @__PURE__ */ React36.createElement(
|
|
2700
|
+
Paper4,
|
|
2701
|
+
{
|
|
2702
|
+
p: "md",
|
|
2703
|
+
shadow: "sm",
|
|
2704
|
+
style: {
|
|
2705
|
+
height: "100%",
|
|
2706
|
+
display: "flex",
|
|
2707
|
+
flexDirection: "column",
|
|
2708
|
+
position: "relative"
|
|
2709
|
+
}
|
|
2710
|
+
},
|
|
2711
|
+
/* @__PURE__ */ React36.createElement(
|
|
2712
|
+
CloseButton3,
|
|
2713
|
+
{
|
|
2714
|
+
onClick: closePanel,
|
|
2715
|
+
style: {
|
|
2716
|
+
position: "absolute",
|
|
2717
|
+
top: "1rem",
|
|
2718
|
+
right: "1rem",
|
|
2719
|
+
zIndex: 1
|
|
2720
|
+
}
|
|
2721
|
+
}
|
|
2722
|
+
),
|
|
2723
|
+
/* @__PURE__ */ React36.createElement(SelectionPanelEmpty, { message: "No item selected" })
|
|
2724
|
+
);
|
|
2725
|
+
}
|
|
2726
|
+
return /* @__PURE__ */ React36.createElement(
|
|
2727
|
+
Paper4,
|
|
2728
|
+
{
|
|
2729
|
+
p: "md",
|
|
2730
|
+
shadow: "sm",
|
|
2731
|
+
style: {
|
|
2732
|
+
height: "100%",
|
|
2733
|
+
display: "flex",
|
|
2734
|
+
flexDirection: "column",
|
|
2735
|
+
position: "relative"
|
|
2736
|
+
}
|
|
2737
|
+
},
|
|
2738
|
+
/* @__PURE__ */ React36.createElement(
|
|
2739
|
+
CloseButton3,
|
|
2740
|
+
{
|
|
2741
|
+
onClick: closePanel,
|
|
2742
|
+
style: {
|
|
2743
|
+
position: "absolute",
|
|
2744
|
+
top: "1rem",
|
|
2745
|
+
right: "1rem",
|
|
2746
|
+
zIndex: 1
|
|
2747
|
+
}
|
|
2748
|
+
}
|
|
2749
|
+
),
|
|
2750
|
+
loading ? /* @__PURE__ */ React36.createElement(Center, { h: 200 }, /* @__PURE__ */ React36.createElement(Loader, null)) : error ? /* @__PURE__ */ React36.createElement(Alert3, { color: "red", title: "Error" }, /* @__PURE__ */ React36.createElement(Text23, { size: "sm" }, error)) : itemData ? /* @__PURE__ */ React36.createElement(Stack23, { gap: "md", style: { flex: 1 } }, /* @__PURE__ */ React36.createElement(SelectionPanelHeader, { title: panelConfig.title(itemData), description: panelConfig.description(itemData) }), /* @__PURE__ */ React36.createElement(SelectionPrompts, { prompts: panelConfig.prompts(itemData) }), /* @__PURE__ */ React36.createElement(SelectionActionSections, { sections: panelConfig.actionSections(itemData), itemId: selectedItemId, itemData })) : /* @__PURE__ */ React36.createElement(SelectionPanelEmpty, { message: "Failed to load item details" })
|
|
2751
|
+
);
|
|
2752
|
+
};
|
|
2753
|
+
|
|
2465
2754
|
// src/mantine/blocks/list/flow/FlowView.tsx
|
|
2466
|
-
var IconRefresh = () => /* @__PURE__ */
|
|
2467
|
-
var IconSettings = () => /* @__PURE__ */
|
|
2468
|
-
var IconAlertCircle = () => /* @__PURE__ */
|
|
2755
|
+
var IconRefresh = () => /* @__PURE__ */ React37.createElement("span", null, "\u{1F504}");
|
|
2756
|
+
var IconSettings = () => /* @__PURE__ */ React37.createElement("span", null, "\u2699\uFE0F");
|
|
2757
|
+
var IconAlertCircle = () => /* @__PURE__ */ React37.createElement("span", null, "\u26A0\uFE0F");
|
|
2469
2758
|
var LIST_FLOW_PANEL_ID = "list-flow-panel";
|
|
2759
|
+
var LIST_SELECTION_FLOW_PANEL_ID = "list-selection-flow-panel";
|
|
2470
2760
|
var ListFlowView = ({ block, editor }) => {
|
|
2471
2761
|
const { editable } = useBlocknoteContext();
|
|
2472
|
-
const [data, setData] =
|
|
2473
|
-
const [loading, setLoading] =
|
|
2474
|
-
const [error, setError] =
|
|
2475
|
-
const [showErrorDetails, setShowErrorDetails] =
|
|
2476
|
-
const [page, setPage] =
|
|
2477
|
-
const [selectionMode, setSelectionMode] =
|
|
2478
|
-
const [totalPages, setTotalPages] =
|
|
2479
|
-
const [selectedIds, setSelectedIds] =
|
|
2762
|
+
const [data, setData] = useState6(null);
|
|
2763
|
+
const [loading, setLoading] = useState6(false);
|
|
2764
|
+
const [error, setError] = useState6(null);
|
|
2765
|
+
const [showErrorDetails, setShowErrorDetails] = useState6(false);
|
|
2766
|
+
const [page, setPage] = useState6(1);
|
|
2767
|
+
const [selectionMode, setSelectionMode] = useState6(null);
|
|
2768
|
+
const [totalPages, setTotalPages] = useState6(0);
|
|
2769
|
+
const [selectedIds, setSelectedIds] = useState6(/* @__PURE__ */ new Set());
|
|
2480
2770
|
const panelId = `${LIST_FLOW_PANEL_ID}-${block.id}`;
|
|
2481
|
-
const panelContent =
|
|
2771
|
+
const panelContent = useMemo8(() => /* @__PURE__ */ React37.createElement(TemplateConfig2, { editor, block }), [editor, block]);
|
|
2482
2772
|
const { open: openPanel } = usePanel(panelId, panelContent);
|
|
2483
|
-
|
|
2773
|
+
const handlers = useBlocknoteHandlers();
|
|
2774
|
+
const listType = block.props.listType && block.props.listType !== "" ? block.props.listType : null;
|
|
2775
|
+
const selectionPanelId = `${LIST_SELECTION_FLOW_PANEL_ID}-${block.id}`;
|
|
2776
|
+
const selectionPanelContent = useMemo8(
|
|
2777
|
+
() => /* @__PURE__ */ React37.createElement(ListSelectionPanel, { editor, block, selectedIds, listType }),
|
|
2778
|
+
[editor, block, selectedIds, listType]
|
|
2779
|
+
);
|
|
2780
|
+
const { open: openSelectionPanel } = usePanel(selectionPanelId, selectionPanelContent);
|
|
2781
|
+
useEffect6(() => {
|
|
2484
2782
|
if (selectionMode === "single" && selectedIds.size > 1) {
|
|
2485
2783
|
const arr = Array.from(selectedIds);
|
|
2486
2784
|
const lastSelected = arr.length > 0 ? arr[arr.length - 1] : void 0;
|
|
@@ -2514,9 +2812,7 @@ var ListFlowView = ({ block, editor }) => {
|
|
|
2514
2812
|
},
|
|
2515
2813
|
[selectionMode]
|
|
2516
2814
|
);
|
|
2517
|
-
const
|
|
2518
|
-
const listType = block.props.listType && block.props.listType !== "" ? block.props.listType : null;
|
|
2519
|
-
const listConfig = useMemo7(() => {
|
|
2815
|
+
const listConfig = useMemo8(() => {
|
|
2520
2816
|
if (block.props.listConfig && block.props.listConfig !== "{}") {
|
|
2521
2817
|
try {
|
|
2522
2818
|
return JSON.parse(block.props.listConfig);
|
|
@@ -2527,7 +2823,7 @@ var ListFlowView = ({ block, editor }) => {
|
|
|
2527
2823
|
}
|
|
2528
2824
|
return {};
|
|
2529
2825
|
}, [block.props.listConfig]);
|
|
2530
|
-
const listSortConfigOptions =
|
|
2826
|
+
const listSortConfigOptions = useMemo8(() => {
|
|
2531
2827
|
if (block.props.sortOptions && block.props.sortOptions !== "{}") {
|
|
2532
2828
|
try {
|
|
2533
2829
|
return JSON.parse(block.props.sortOptions);
|
|
@@ -2538,7 +2834,7 @@ var ListFlowView = ({ block, editor }) => {
|
|
|
2538
2834
|
}
|
|
2539
2835
|
return {};
|
|
2540
2836
|
}, [block.props.sortOptions]);
|
|
2541
|
-
const listFilterConfigOptions =
|
|
2837
|
+
const listFilterConfigOptions = useMemo8(() => {
|
|
2542
2838
|
if (block.props.filterOptions && block.props.filterOptions !== "{}") {
|
|
2543
2839
|
try {
|
|
2544
2840
|
return JSON.parse(block.props.filterOptions);
|
|
@@ -2549,7 +2845,7 @@ var ListFlowView = ({ block, editor }) => {
|
|
|
2549
2845
|
}
|
|
2550
2846
|
return {};
|
|
2551
2847
|
}, [block.props.filterOptions]);
|
|
2552
|
-
const listFilterConfig =
|
|
2848
|
+
const listFilterConfig = useMemo8(() => {
|
|
2553
2849
|
if (block.props.filter && block.props.filter !== "{}") {
|
|
2554
2850
|
try {
|
|
2555
2851
|
return JSON.parse(block.props.filter);
|
|
@@ -2560,7 +2856,7 @@ var ListFlowView = ({ block, editor }) => {
|
|
|
2560
2856
|
}
|
|
2561
2857
|
return {};
|
|
2562
2858
|
}, [block.props.filter]);
|
|
2563
|
-
const listSortConfig =
|
|
2859
|
+
const listSortConfig = useMemo8(() => {
|
|
2564
2860
|
if (block.props.sort && block.props.sort !== "{}") {
|
|
2565
2861
|
try {
|
|
2566
2862
|
return JSON.parse(block.props.sort);
|
|
@@ -2592,13 +2888,14 @@ var ListFlowView = ({ block, editor }) => {
|
|
|
2592
2888
|
case "linked_resources":
|
|
2593
2889
|
did = handlers.getEntityDid();
|
|
2594
2890
|
if (!did && !listConfig.did) throw new Error("DID is required");
|
|
2595
|
-
result = await handlers.getEntity(did ||
|
|
2891
|
+
result = await handlers.getEntity(listConfig.did || did);
|
|
2596
2892
|
setData({ items: result.linkedResource });
|
|
2597
2893
|
break;
|
|
2598
2894
|
case "assets":
|
|
2599
2895
|
did = handlers.getEntityDid();
|
|
2600
2896
|
if (!did && !listConfig.collectionDid) throw new Error("Collection DID is required");
|
|
2601
|
-
result = await handlers.getAssets(
|
|
2897
|
+
result = await handlers.getAssets(listConfig.collectionDid || did, page);
|
|
2898
|
+
setTotalPages(Math.ceil(result.totalCount / DEFAULT_PAGE_SIZE));
|
|
2602
2899
|
setData({ items: result.data });
|
|
2603
2900
|
break;
|
|
2604
2901
|
case "transactions":
|
|
@@ -2610,37 +2907,37 @@ var ListFlowView = ({ block, editor }) => {
|
|
|
2610
2907
|
case "collections":
|
|
2611
2908
|
did = handlers.getEntityDid();
|
|
2612
2909
|
if (!did && !listConfig.relayedNodeDid) throw new Error("Relayer is required");
|
|
2613
|
-
result = await handlers.getCollections(
|
|
2910
|
+
result = await handlers.getCollections(listConfig.relayedNodeDid || did, page);
|
|
2614
2911
|
setData({ items: result.data });
|
|
2615
2912
|
break;
|
|
2616
2913
|
case "investments":
|
|
2617
2914
|
did = handlers.getEntityDid();
|
|
2618
2915
|
if (!did && !listConfig.relayedNodeDid) throw new Error("Relayer is required");
|
|
2619
|
-
result = await handlers.getInvestments(
|
|
2916
|
+
result = await handlers.getInvestments(listConfig.relayedNodeDid || did, page);
|
|
2620
2917
|
setData({ items: result.data });
|
|
2621
2918
|
break;
|
|
2622
2919
|
case "oracles":
|
|
2623
2920
|
did = handlers.getEntityDid();
|
|
2624
2921
|
if (!did && !listConfig.relayedNodeDid) throw new Error("Relayer is required");
|
|
2625
|
-
result = await handlers.getOracles(
|
|
2922
|
+
result = await handlers.getOracles(listConfig.relayedNodeDid || did, page);
|
|
2626
2923
|
setData({ items: result.data });
|
|
2627
2924
|
break;
|
|
2628
2925
|
case "pods":
|
|
2629
2926
|
did = handlers.getEntityDid();
|
|
2630
2927
|
if (!did && !listConfig.relayedNodeDid) throw new Error("Relayer is required");
|
|
2631
|
-
result = await handlers.getPODs(
|
|
2928
|
+
result = await handlers.getPODs(listConfig.relayedNodeDid || did, page);
|
|
2632
2929
|
setData({ items: result.data });
|
|
2633
2930
|
break;
|
|
2634
2931
|
case "proposals":
|
|
2635
2932
|
did = handlers.getEntityDid();
|
|
2636
2933
|
if (!did && !listConfig.relayedNodeDid) throw new Error("Relayer is required");
|
|
2637
|
-
result = await handlers.getProposals(
|
|
2934
|
+
result = await handlers.getProposals(listConfig.relayedNodeDid || did, page);
|
|
2638
2935
|
setData({ items: result.data });
|
|
2639
2936
|
break;
|
|
2640
2937
|
case "requests":
|
|
2641
2938
|
did = handlers.getEntityDid();
|
|
2642
2939
|
if (!did && !listConfig.relayedNodeDid) throw new Error("Relayer is required");
|
|
2643
|
-
result = await handlers.getRequests(
|
|
2940
|
+
result = await handlers.getRequests(listConfig.relayedNodeDid || did, page);
|
|
2644
2941
|
setData({ items: result.data });
|
|
2645
2942
|
break;
|
|
2646
2943
|
case "group_members":
|
|
@@ -2652,15 +2949,15 @@ var ListFlowView = ({ block, editor }) => {
|
|
|
2652
2949
|
case "validators":
|
|
2653
2950
|
did = handlers.getEntityDid();
|
|
2654
2951
|
if (!did && !listConfig.relayedNodeDid) throw new Error("Relayer is required");
|
|
2655
|
-
result = await handlers.getValidators(
|
|
2952
|
+
result = await handlers.getValidators(listConfig.relayedNodeDid || did, page);
|
|
2656
2953
|
setData({ items: result.data });
|
|
2657
2954
|
break;
|
|
2658
2955
|
case "dao_members":
|
|
2659
2956
|
userAddress = handlers.getCurrentUser();
|
|
2660
|
-
groupIds = handlers.getDaoGroupsIds();
|
|
2957
|
+
groupIds = await handlers.getDaoGroupsIds();
|
|
2661
2958
|
if (!userAddress.address && !listConfig.address) throw new Error("Address is required");
|
|
2662
2959
|
if (!groupIds && !listConfig.groupIds) throw new Error("Group Ids are required");
|
|
2663
|
-
result = await handlers.getDaoMembers(
|
|
2960
|
+
result = await handlers.getDaoMembers(listConfig.address || userAddress.address, listConfig.groupIds || groupIds, listConfig.withBalance, page);
|
|
2664
2961
|
setData({ items: result.data });
|
|
2665
2962
|
break;
|
|
2666
2963
|
default:
|
|
@@ -2672,7 +2969,7 @@ var ListFlowView = ({ block, editor }) => {
|
|
|
2672
2969
|
setLoading(false);
|
|
2673
2970
|
}
|
|
2674
2971
|
}, [handlers, page, listType, listConfig]);
|
|
2675
|
-
|
|
2972
|
+
useEffect6(() => {
|
|
2676
2973
|
if (listType && listConfig) {
|
|
2677
2974
|
console.log("[ListFlowView] useEffect", listType, listConfig);
|
|
2678
2975
|
fetchData();
|
|
@@ -2690,11 +2987,11 @@ var ListFlowView = ({ block, editor }) => {
|
|
|
2690
2987
|
}
|
|
2691
2988
|
updateProps({ sort: JSON.stringify(sortOption) });
|
|
2692
2989
|
};
|
|
2693
|
-
const sortedData =
|
|
2990
|
+
const sortedData = useMemo8(() => {
|
|
2694
2991
|
if (!data) return null;
|
|
2695
2992
|
return sortListItems(data, listSortConfig);
|
|
2696
2993
|
}, [data?.items, listSortConfig]);
|
|
2697
|
-
const filteredData =
|
|
2994
|
+
const filteredData = useMemo8(() => {
|
|
2698
2995
|
if (!listFilterConfig?.key) return sortedData;
|
|
2699
2996
|
if (!sortedData) return null;
|
|
2700
2997
|
return filterListItems(sortedData, listFilterConfig);
|
|
@@ -2704,40 +3001,40 @@ var ListFlowView = ({ block, editor }) => {
|
|
|
2704
3001
|
console.log("[ListFlowView] renderListComponent", data, listType);
|
|
2705
3002
|
switch (listType) {
|
|
2706
3003
|
case "linked_resources":
|
|
2707
|
-
return /* @__PURE__ */
|
|
3004
|
+
return /* @__PURE__ */ React37.createElement(LinkedResourcesList, { items: filteredData, config: listConfig, mods: selectionMode, isItemChecked, onItemCheck });
|
|
2708
3005
|
case "assets":
|
|
2709
|
-
return /* @__PURE__ */
|
|
3006
|
+
return /* @__PURE__ */ React37.createElement(AssetsList, { items: filteredData, config: listConfig, mods: selectionMode, isItemChecked, onItemCheck });
|
|
2710
3007
|
case "transactions":
|
|
2711
|
-
return /* @__PURE__ */
|
|
3008
|
+
return /* @__PURE__ */ React37.createElement(TransactionsList, { items: filteredData, config: listConfig, mods: selectionMode, isItemChecked, onItemCheck });
|
|
2712
3009
|
case "collections":
|
|
2713
|
-
return /* @__PURE__ */
|
|
3010
|
+
return /* @__PURE__ */ React37.createElement(CollectionsList, { items: filteredData, mods: selectionMode, isItemChecked, onItemCheck });
|
|
2714
3011
|
case "investments":
|
|
2715
|
-
return /* @__PURE__ */
|
|
3012
|
+
return /* @__PURE__ */ React37.createElement(InvestmentsList, { items: filteredData, mods: selectionMode, isItemChecked, onItemCheck });
|
|
2716
3013
|
case "oracles":
|
|
2717
|
-
return /* @__PURE__ */
|
|
3014
|
+
return /* @__PURE__ */ React37.createElement(OraclesList, { items: filteredData, mods: selectionMode, isItemChecked, onItemCheck });
|
|
2718
3015
|
case "pods":
|
|
2719
|
-
return /* @__PURE__ */
|
|
3016
|
+
return /* @__PURE__ */ React37.createElement(PodsList, { items: filteredData, mods: selectionMode, isItemChecked, onItemCheck });
|
|
2720
3017
|
case "proposals":
|
|
2721
|
-
return /* @__PURE__ */
|
|
3018
|
+
return /* @__PURE__ */ React37.createElement(ProposalsList, { items: filteredData, mods: selectionMode, isItemChecked, onItemCheck });
|
|
2722
3019
|
case "requests":
|
|
2723
|
-
return /* @__PURE__ */
|
|
3020
|
+
return /* @__PURE__ */ React37.createElement(RequestsList, { items: filteredData, mods: selectionMode, isItemChecked, onItemCheck });
|
|
2724
3021
|
case "group_members":
|
|
2725
|
-
return /* @__PURE__ */
|
|
3022
|
+
return /* @__PURE__ */ React37.createElement(MembersList, { items: filteredData, mods: selectionMode, isItemChecked, onItemCheck });
|
|
2726
3023
|
case "dao_members":
|
|
2727
|
-
return /* @__PURE__ */
|
|
3024
|
+
return /* @__PURE__ */ React37.createElement(DaoMembersList, { items: filteredData, mods: selectionMode, isItemChecked, onItemCheck });
|
|
2728
3025
|
case "validators":
|
|
2729
|
-
return /* @__PURE__ */
|
|
3026
|
+
return /* @__PURE__ */ React37.createElement(ValidatorsList, { items: filteredData, mods: selectionMode, isItemChecked, onItemCheck });
|
|
2730
3027
|
default:
|
|
2731
3028
|
return null;
|
|
2732
3029
|
}
|
|
2733
3030
|
};
|
|
2734
3031
|
if (!listType) {
|
|
2735
|
-
return /* @__PURE__ */
|
|
3032
|
+
return /* @__PURE__ */ React37.createElement(Center2, { py: "xl" }, /* @__PURE__ */ React37.createElement(Text24, { size: "sm", c: "dimmed" }, "List not configured"));
|
|
2736
3033
|
}
|
|
2737
|
-
return /* @__PURE__ */
|
|
3034
|
+
return /* @__PURE__ */ React37.createElement(Stack24, { mih: totalPages !== 0 ? 700 : void 0, w: "100%" }, /* @__PURE__ */ React37.createElement(Flex15, { align: "center", gap: "xs" }, /* @__PURE__ */ React37.createElement(Text24, null, getListNameByType(listType)), listSortConfig?.key && /* @__PURE__ */ React37.createElement(Flex15, { align: "center" }, /* @__PURE__ */ React37.createElement(Text24, { size: "xs", c: "dimmed" }, listSortConfig.key?.replace(/([A-Z])/g, " $1").replace(
|
|
2738
3035
|
/^./,
|
|
2739
3036
|
(str) => str.toUpperCase()
|
|
2740
|
-
), " "), /* @__PURE__ */
|
|
3037
|
+
), " "), /* @__PURE__ */ React37.createElement(Text24, { lh: 0.5, c: "dimmed" }, listSortConfig.direction === "asc" && /* @__PURE__ */ React37.createElement(IconArrowUp2, { size: 18 }), listSortConfig.direction === "desc" && /* @__PURE__ */ React37.createElement(IconArrowDown2, { size: 18 }))), selectionMode && /* @__PURE__ */ React37.createElement(Text24, { lh: 0.5, c: "dimmed" }, selectionMode === "single" ? "Single Selection" : "Multi Selection")), /* @__PURE__ */ React37.createElement(Flex15, { justify: "space-between" }, /* @__PURE__ */ React37.createElement(Flex15, { gap: "xs", align: "center" }, /* @__PURE__ */ React37.createElement(FilterTab, { key: "All", label: "All", isActive: !listFilterConfig?.key, onClick: () => handleFilterChange(null) }), Array.isArray(listFilterConfigOptions) && listFilterConfigOptions.length > 0 && listFilterConfigOptions.map(({ key, label, type }) => /* @__PURE__ */ React37.createElement(
|
|
2741
3038
|
FilterTab,
|
|
2742
3039
|
{
|
|
2743
3040
|
key: label,
|
|
@@ -2745,7 +3042,7 @@ var ListFlowView = ({ block, editor }) => {
|
|
|
2745
3042
|
isActive: listFilterConfig?.key === key && listFilterConfig?.value === type,
|
|
2746
3043
|
onClick: () => handleFilterChange({ key, value: type })
|
|
2747
3044
|
}
|
|
2748
|
-
))), /* @__PURE__ */
|
|
3045
|
+
))), /* @__PURE__ */ React37.createElement(Flex15, { gap: "xs" }, /* @__PURE__ */ React37.createElement(ActionIcon4, { variant: "subtle", size: "sm", onClick: fetchData, loading }, /* @__PURE__ */ React37.createElement(IconRefresh, null)), editable && /* @__PURE__ */ React37.createElement(ActionIcon4, { variant: "subtle", size: "sm", onClick: openPanel }, /* @__PURE__ */ React37.createElement(IconSettings, null)), selectedIds.size > 0 && /* @__PURE__ */ React37.createElement(ActionIcon4, { variant: "subtle", size: "sm", onClick: openSelectionPanel }, /* @__PURE__ */ React37.createElement(IconArrowRight2, null)), listConfig && listSortConfigOptions && listSortConfigOptions?.length > 0 && /* @__PURE__ */ React37.createElement(
|
|
2749
3046
|
ListActionsMenu,
|
|
2750
3047
|
{
|
|
2751
3048
|
onSelectActionClick: (mode) => setSelectionMode(mode),
|
|
@@ -2754,7 +3051,7 @@ var ListFlowView = ({ block, editor }) => {
|
|
|
2754
3051
|
value: listSortConfig,
|
|
2755
3052
|
onChange: (sortOption) => handleSortChange(sortOption)
|
|
2756
3053
|
}
|
|
2757
|
-
))), /* @__PURE__ */
|
|
3054
|
+
))), /* @__PURE__ */ React37.createElement(Flex15, { flex: 1 }, loading ? /* @__PURE__ */ React37.createElement(Center2, { py: "xl", w: "100%" }, /* @__PURE__ */ React37.createElement(Loader2, { size: "md", mx: "auto" })) : error ? /* @__PURE__ */ React37.createElement(Alert4, { color: "red", title: "Failed to load data", icon: /* @__PURE__ */ React37.createElement(IconAlertCircle, null) }, /* @__PURE__ */ React37.createElement(Stack24, { gap: "xs" }, /* @__PURE__ */ React37.createElement(Text24, { size: "sm" }, showErrorDetails ? error : "Unable to fetch list data"), /* @__PURE__ */ React37.createElement(Group7, { gap: "xs" }, /* @__PURE__ */ React37.createElement(Button5, { size: "xs", variant: "subtle", onClick: fetchData }, "Retry"), /* @__PURE__ */ React37.createElement(Button5, { size: "xs", variant: "subtle", onClick: () => setShowErrorDetails(!showErrorDetails) }, showErrorDetails ? "Hide" : "Show", " Details")))) : /* @__PURE__ */ React37.createElement(Stack24, { gap: "md", flex: 1 }, renderListComponent(), /* @__PURE__ */ React37.createElement(
|
|
2758
3055
|
ListPagination,
|
|
2759
3056
|
{
|
|
2760
3057
|
page,
|
|
@@ -2772,9 +3069,9 @@ function ListBlock({ editor, block }) {
|
|
|
2772
3069
|
const listType = block.props.listType && block.props.listType !== "";
|
|
2773
3070
|
const isConfigured = listType;
|
|
2774
3071
|
if (editable && !isConfigured) {
|
|
2775
|
-
return /* @__PURE__ */
|
|
3072
|
+
return /* @__PURE__ */ React38.createElement(ListTemplateView, { editor, block });
|
|
2776
3073
|
}
|
|
2777
|
-
return /* @__PURE__ */
|
|
3074
|
+
return /* @__PURE__ */ React38.createElement(ListFlowView, { block, editor });
|
|
2778
3075
|
}
|
|
2779
3076
|
|
|
2780
3077
|
// src/mantine/blocks/list/ListBlockSpec.tsx
|
|
@@ -2809,16 +3106,16 @@ var ListBlockSpec = createReactBlockSpec2(
|
|
|
2809
3106
|
{
|
|
2810
3107
|
render: (props) => {
|
|
2811
3108
|
const ixoProps = props;
|
|
2812
|
-
return /* @__PURE__ */
|
|
3109
|
+
return /* @__PURE__ */ React39.createElement(ListBlock, { ...ixoProps });
|
|
2813
3110
|
}
|
|
2814
3111
|
}
|
|
2815
3112
|
);
|
|
2816
3113
|
|
|
2817
3114
|
// src/mantine/blocks/overview/OverviewBlock.tsx
|
|
2818
|
-
import
|
|
3115
|
+
import React40 from "react";
|
|
2819
3116
|
import { createReactBlockSpec as createReactBlockSpec3 } from "@blocknote/react";
|
|
2820
3117
|
var OverviewBlockContent = ({ block, editor }) => {
|
|
2821
|
-
return /* @__PURE__ */
|
|
3118
|
+
return /* @__PURE__ */ React40.createElement(
|
|
2822
3119
|
"div",
|
|
2823
3120
|
{
|
|
2824
3121
|
style: {
|
|
@@ -2830,7 +3127,7 @@ var OverviewBlockContent = ({ block, editor }) => {
|
|
|
2830
3127
|
border: "1px solid #e5e7eb"
|
|
2831
3128
|
}
|
|
2832
3129
|
},
|
|
2833
|
-
/* @__PURE__ */
|
|
3130
|
+
/* @__PURE__ */ React40.createElement("div", { style: { marginBottom: "12px" } }, /* @__PURE__ */ React40.createElement(
|
|
2834
3131
|
"input",
|
|
2835
3132
|
{
|
|
2836
3133
|
type: "text",
|
|
@@ -2856,7 +3153,7 @@ var OverviewBlockContent = ({ block, editor }) => {
|
|
|
2856
3153
|
}
|
|
2857
3154
|
}
|
|
2858
3155
|
)),
|
|
2859
|
-
/* @__PURE__ */
|
|
3156
|
+
/* @__PURE__ */ React40.createElement("div", { style: { minHeight: "40px", color: "#6b7280" } }, block.props.did ? /* @__PURE__ */ React40.createElement("p", null, "Loading overview for DID: ", block.props.did) : /* @__PURE__ */ React40.createElement("p", null, "Enter a DID to load overview data"))
|
|
2860
3157
|
);
|
|
2861
3158
|
};
|
|
2862
3159
|
var OverviewBlock = createReactBlockSpec3(
|
|
@@ -2870,7 +3167,7 @@ var OverviewBlock = createReactBlockSpec3(
|
|
|
2870
3167
|
content: "none"
|
|
2871
3168
|
},
|
|
2872
3169
|
{
|
|
2873
|
-
render: (props) => /* @__PURE__ */
|
|
3170
|
+
render: (props) => /* @__PURE__ */ React40.createElement(OverviewBlockContent, { ...props })
|
|
2874
3171
|
}
|
|
2875
3172
|
);
|
|
2876
3173
|
|
|
@@ -2897,18 +3194,18 @@ var ValidatorActionType = /* @__PURE__ */ ((ValidatorActionType2) => {
|
|
|
2897
3194
|
})(ValidatorActionType || {});
|
|
2898
3195
|
|
|
2899
3196
|
// src/mantine/context/hooks/useSharedProposal.ts
|
|
2900
|
-
import { useState as
|
|
3197
|
+
import { useState as useState7, useEffect as useEffect7, useCallback as useCallback10 } from "react";
|
|
2901
3198
|
var useSharedProposal = ({ proposalId, contractAddress, autoFetch = true }) => {
|
|
2902
3199
|
const { sharedProposals, fetchSharedProposal, invalidateProposal, subscribeToProposal } = useBlocknoteContext();
|
|
2903
|
-
const [localProposal, setLocalProposal] =
|
|
3200
|
+
const [localProposal, setLocalProposal] = useState7(null);
|
|
2904
3201
|
const cacheKey = `${contractAddress}:${proposalId}`;
|
|
2905
|
-
|
|
3202
|
+
useEffect7(() => {
|
|
2906
3203
|
if (!proposalId || !contractAddress || !autoFetch) return;
|
|
2907
3204
|
fetchSharedProposal(proposalId, contractAddress).then(setLocalProposal).catch((error) => {
|
|
2908
3205
|
console.error("Failed to fetch proposal:", error);
|
|
2909
3206
|
});
|
|
2910
3207
|
}, [proposalId, contractAddress, fetchSharedProposal, autoFetch]);
|
|
2911
|
-
|
|
3208
|
+
useEffect7(() => {
|
|
2912
3209
|
const proposal = subscribeToProposal(cacheKey);
|
|
2913
3210
|
if (proposal) {
|
|
2914
3211
|
setLocalProposal(proposal);
|
|
@@ -2926,32 +3223,32 @@ var useSharedProposal = ({ proposalId, contractAddress, autoFetch = true }) => {
|
|
|
2926
3223
|
};
|
|
2927
3224
|
|
|
2928
3225
|
// src/mantine/blocks/proposal/ProposalBlockSpec.tsx
|
|
2929
|
-
import
|
|
3226
|
+
import React84 from "react";
|
|
2930
3227
|
import { createReactBlockSpec as createReactBlockSpec4 } from "@blocknote/react";
|
|
2931
3228
|
|
|
2932
3229
|
// src/mantine/blocks/proposal/ProposalBlock.tsx
|
|
2933
|
-
import
|
|
3230
|
+
import React83 from "react";
|
|
2934
3231
|
|
|
2935
3232
|
// src/mantine/blocks/proposal/template/TemplateView.tsx
|
|
2936
|
-
import
|
|
3233
|
+
import React77, { useMemo as useMemo10 } from "react";
|
|
2937
3234
|
|
|
2938
3235
|
// src/mantine/blocks/proposal/template/TemplateConfig.tsx
|
|
2939
|
-
import
|
|
2940
|
-
import { Paper as
|
|
3236
|
+
import React76, { useCallback as useCallback12 } from "react";
|
|
3237
|
+
import { Paper as Paper6, CloseButton as CloseButton4, Title as Title4 } from "@mantine/core";
|
|
2941
3238
|
|
|
2942
3239
|
// src/mantine/blocks/proposal/template/GeneralTab.tsx
|
|
2943
|
-
import
|
|
2944
|
-
import { Stack as
|
|
3240
|
+
import React41, { useEffect as useEffect8, useState as useState8 } from "react";
|
|
3241
|
+
import { Stack as Stack25, Text as Text25, TextInput as TextInput5, Textarea as Textarea2 } from "@mantine/core";
|
|
2945
3242
|
var GeneralTab3 = ({ title, description, onTitleChange, onDescriptionChange }) => {
|
|
2946
|
-
const [localTitle, setLocalTitle] =
|
|
2947
|
-
const [localDescription, setLocalDescription] =
|
|
2948
|
-
|
|
3243
|
+
const [localTitle, setLocalTitle] = useState8(title || "");
|
|
3244
|
+
const [localDescription, setLocalDescription] = useState8(description || "");
|
|
3245
|
+
useEffect8(() => {
|
|
2949
3246
|
setLocalTitle(title || "");
|
|
2950
3247
|
}, [title]);
|
|
2951
|
-
|
|
3248
|
+
useEffect8(() => {
|
|
2952
3249
|
setLocalDescription(description || "");
|
|
2953
3250
|
}, [description]);
|
|
2954
|
-
return /* @__PURE__ */
|
|
3251
|
+
return /* @__PURE__ */ React41.createElement(Stack25, { gap: "lg" }, /* @__PURE__ */ React41.createElement(Stack25, { gap: "xs" }, /* @__PURE__ */ React41.createElement(Text25, { size: "sm", fw: 600 }, "Title"), /* @__PURE__ */ React41.createElement(
|
|
2955
3252
|
TextInput5,
|
|
2956
3253
|
{
|
|
2957
3254
|
placeholder: "e.g. Proposal Title",
|
|
@@ -2962,7 +3259,7 @@ var GeneralTab3 = ({ title, description, onTitleChange, onDescriptionChange }) =
|
|
|
2962
3259
|
onTitleChange(newTitle);
|
|
2963
3260
|
}
|
|
2964
3261
|
}
|
|
2965
|
-
)), /* @__PURE__ */
|
|
3262
|
+
)), /* @__PURE__ */ React41.createElement(Stack25, { gap: "xs" }, /* @__PURE__ */ React41.createElement(Text25, { size: "sm", fw: 600 }, "Description"), /* @__PURE__ */ React41.createElement(
|
|
2966
3263
|
Textarea2,
|
|
2967
3264
|
{
|
|
2968
3265
|
placeholder: "Describe what this proposal is about",
|
|
@@ -2978,12 +3275,12 @@ var GeneralTab3 = ({ title, description, onTitleChange, onDescriptionChange }) =
|
|
|
2978
3275
|
};
|
|
2979
3276
|
|
|
2980
3277
|
// src/mantine/blocks/proposal/template/ActionsTab.tsx
|
|
2981
|
-
import
|
|
2982
|
-
import { Button as Button12, Card as Card13, Stack as
|
|
3278
|
+
import React74, { useCallback as useCallback11, useEffect as useEffect11, useState as useState16 } from "react";
|
|
3279
|
+
import { Button as Button12, Card as Card13, Stack as Stack58 } from "@mantine/core";
|
|
2983
3280
|
|
|
2984
3281
|
// src/mantine/blocks/proposal/actions-components/ActionsCard.tsx
|
|
2985
|
-
import
|
|
2986
|
-
import { Card as Card6, Group as
|
|
3282
|
+
import React42 from "react";
|
|
3283
|
+
import { Card as Card6, Group as Group8, Text as Text26, Badge as Badge5, Stack as Stack26, ActionIcon as ActionIcon5, ScrollArea } from "@mantine/core";
|
|
2987
3284
|
var getActionSummary = (action) => {
|
|
2988
3285
|
switch (action.type) {
|
|
2989
3286
|
case "Spend":
|
|
@@ -3015,7 +3312,7 @@ var ActionsCard = ({ actions, isSelected, onClick, onEditAction, onRemoveAction,
|
|
|
3015
3312
|
}
|
|
3016
3313
|
onClick();
|
|
3017
3314
|
};
|
|
3018
|
-
return /* @__PURE__ */
|
|
3315
|
+
return /* @__PURE__ */ React42.createElement(
|
|
3019
3316
|
Card6,
|
|
3020
3317
|
{
|
|
3021
3318
|
shadow: "sm",
|
|
@@ -3032,7 +3329,7 @@ var ActionsCard = ({ actions, isSelected, onClick, onEditAction, onRemoveAction,
|
|
|
3032
3329
|
},
|
|
3033
3330
|
onClick: handleCardClick
|
|
3034
3331
|
},
|
|
3035
|
-
/* @__PURE__ */
|
|
3332
|
+
/* @__PURE__ */ React42.createElement(Group8, { justify: "space-between", align: "flex-start" }, /* @__PURE__ */ React42.createElement(Stack26, { gap: "xs", style: { flex: 1 } }, /* @__PURE__ */ React42.createElement(Text26, { size: "md", fw: 600, style: { color: "#f1f3f5" } }, "Proposal Actions (", actions.length, ")"), actions.length === 0 ? /* @__PURE__ */ React42.createElement(Text26, { size: "sm", style: { color: "#868e96" } }, "No actions added yet.") : /* @__PURE__ */ React42.createElement(ScrollArea, { h: actions.length > 3 ? 150 : void 0, style: { marginTop: 8 } }, /* @__PURE__ */ React42.createElement(Stack26, { gap: "xs" }, actions.map((action, index) => /* @__PURE__ */ React42.createElement(
|
|
3036
3333
|
Card6,
|
|
3037
3334
|
{
|
|
3038
3335
|
key: index,
|
|
@@ -3043,7 +3340,7 @@ var ActionsCard = ({ actions, isSelected, onClick, onEditAction, onRemoveAction,
|
|
|
3043
3340
|
borderColor: "#333"
|
|
3044
3341
|
}
|
|
3045
3342
|
},
|
|
3046
|
-
/* @__PURE__ */
|
|
3343
|
+
/* @__PURE__ */ React42.createElement(Group8, { justify: "space-between", align: "center" }, /* @__PURE__ */ React42.createElement(Group8, { gap: "xs", style: { flex: 1 } }, /* @__PURE__ */ React42.createElement(
|
|
3047
3344
|
Badge5,
|
|
3048
3345
|
{
|
|
3049
3346
|
size: "sm",
|
|
@@ -3054,7 +3351,7 @@ var ActionsCard = ({ actions, isSelected, onClick, onEditAction, onRemoveAction,
|
|
|
3054
3351
|
}
|
|
3055
3352
|
},
|
|
3056
3353
|
action.type
|
|
3057
|
-
), /* @__PURE__ */
|
|
3354
|
+
), /* @__PURE__ */ React42.createElement(Text26, { size: "sm", style: { color: "#adb5bd" } }, getActionSummary(action))), !disabled && /* @__PURE__ */ React42.createElement(Group8, { gap: 4 }, /* @__PURE__ */ React42.createElement(
|
|
3058
3355
|
ActionIcon5,
|
|
3059
3356
|
{
|
|
3060
3357
|
size: "sm",
|
|
@@ -3067,7 +3364,7 @@ var ActionsCard = ({ actions, isSelected, onClick, onEditAction, onRemoveAction,
|
|
|
3067
3364
|
style: { color: "#4dabf7" }
|
|
3068
3365
|
},
|
|
3069
3366
|
"\u270F\uFE0F"
|
|
3070
|
-
), /* @__PURE__ */
|
|
3367
|
+
), /* @__PURE__ */ React42.createElement(
|
|
3071
3368
|
ActionIcon5,
|
|
3072
3369
|
{
|
|
3073
3370
|
size: "sm",
|
|
@@ -3086,14 +3383,14 @@ var ActionsCard = ({ actions, isSelected, onClick, onEditAction, onRemoveAction,
|
|
|
3086
3383
|
};
|
|
3087
3384
|
|
|
3088
3385
|
// src/mantine/blocks/proposal/ActionsPanel.tsx
|
|
3089
|
-
import
|
|
3090
|
-
import { Stack as
|
|
3386
|
+
import React73, { useState as useState15, useEffect as useEffect10, useMemo as useMemo9 } from "react";
|
|
3387
|
+
import { Stack as Stack57, Button as Button11, Group as Group19, Text as Text34, Card as Card12, Badge as Badge8, Divider as Divider4, ScrollArea as ScrollArea3, Alert as Alert7, Tabs as Tabs2, SimpleGrid, Paper as Paper5 } from "@mantine/core";
|
|
3091
3388
|
|
|
3092
3389
|
// src/mantine/blocks/proposal/actions-components/SpendActionForm.tsx
|
|
3093
|
-
import
|
|
3094
|
-
import { TextInput as TextInput6, Stack as
|
|
3390
|
+
import React43 from "react";
|
|
3391
|
+
import { TextInput as TextInput6, Stack as Stack27 } from "@mantine/core";
|
|
3095
3392
|
var SpendActionForm = ({ data, onChange }) => {
|
|
3096
|
-
return /* @__PURE__ */
|
|
3393
|
+
return /* @__PURE__ */ React43.createElement(Stack27, null, /* @__PURE__ */ React43.createElement(
|
|
3097
3394
|
TextInput6,
|
|
3098
3395
|
{
|
|
3099
3396
|
label: "Recipient Address",
|
|
@@ -3113,7 +3410,7 @@ var SpendActionForm = ({ data, onChange }) => {
|
|
|
3113
3410
|
}
|
|
3114
3411
|
}
|
|
3115
3412
|
}
|
|
3116
|
-
), /* @__PURE__ */
|
|
3413
|
+
), /* @__PURE__ */ React43.createElement(
|
|
3117
3414
|
TextInput6,
|
|
3118
3415
|
{
|
|
3119
3416
|
label: "Denomination",
|
|
@@ -3133,7 +3430,7 @@ var SpendActionForm = ({ data, onChange }) => {
|
|
|
3133
3430
|
}
|
|
3134
3431
|
}
|
|
3135
3432
|
}
|
|
3136
|
-
), /* @__PURE__ */
|
|
3433
|
+
), /* @__PURE__ */ React43.createElement(
|
|
3137
3434
|
TextInput6,
|
|
3138
3435
|
{
|
|
3139
3436
|
label: "Amount",
|
|
@@ -3157,11 +3454,11 @@ var SpendActionForm = ({ data, onChange }) => {
|
|
|
3157
3454
|
};
|
|
3158
3455
|
|
|
3159
3456
|
// src/mantine/blocks/proposal/actions-components/UpdateMembersActionForm.tsx
|
|
3160
|
-
import
|
|
3161
|
-
import { Stack as
|
|
3457
|
+
import React44, { useState as useState9 } from "react";
|
|
3458
|
+
import { Stack as Stack28, TextInput as TextInput7, NumberInput as NumberInput2, Button as Button6, Group as Group9, Text as Text27, Card as Card7, Badge as Badge6, ActionIcon as ActionIcon6, Divider as Divider3, ScrollArea as ScrollArea2 } from "@mantine/core";
|
|
3162
3459
|
var UpdateMembersActionForm = ({ data, onChange }) => {
|
|
3163
|
-
const [newMember, setNewMember] =
|
|
3164
|
-
const [newRemoveAddress, setNewRemoveAddress] =
|
|
3460
|
+
const [newMember, setNewMember] = useState9({ addr: "", weight: 1 });
|
|
3461
|
+
const [newRemoveAddress, setNewRemoveAddress] = useState9("");
|
|
3165
3462
|
const handleAddMember = () => {
|
|
3166
3463
|
if (!newMember.addr) return;
|
|
3167
3464
|
onChange({
|
|
@@ -3201,7 +3498,7 @@ var UpdateMembersActionForm = ({ data, onChange }) => {
|
|
|
3201
3498
|
}
|
|
3202
3499
|
}
|
|
3203
3500
|
};
|
|
3204
|
-
return /* @__PURE__ */
|
|
3501
|
+
return /* @__PURE__ */ React44.createElement(Stack28, null, /* @__PURE__ */ React44.createElement(Stack28, { gap: "xs" }, /* @__PURE__ */ React44.createElement(Text27, { size: "sm", fw: 500, style: { color: "#adb5bd" } }, "Members to Add"), /* @__PURE__ */ React44.createElement(ScrollArea2, { h: 150 }, /* @__PURE__ */ React44.createElement(Stack28, { gap: "xs" }, (data.add || []).map((member, index) => /* @__PURE__ */ React44.createElement(
|
|
3205
3502
|
Card7,
|
|
3206
3503
|
{
|
|
3207
3504
|
key: index,
|
|
@@ -3212,7 +3509,7 @@ var UpdateMembersActionForm = ({ data, onChange }) => {
|
|
|
3212
3509
|
borderColor: "#333"
|
|
3213
3510
|
}
|
|
3214
3511
|
},
|
|
3215
|
-
/* @__PURE__ */
|
|
3512
|
+
/* @__PURE__ */ React44.createElement(Group9, { justify: "space-between" }, /* @__PURE__ */ React44.createElement("div", null, /* @__PURE__ */ React44.createElement(Text27, { size: "sm", fw: 500, style: { color: "#f1f3f5" } }, member.addr.slice(0, 20), "..."), /* @__PURE__ */ React44.createElement(
|
|
3216
3513
|
Badge6,
|
|
3217
3514
|
{
|
|
3218
3515
|
size: "sm",
|
|
@@ -3223,8 +3520,8 @@ var UpdateMembersActionForm = ({ data, onChange }) => {
|
|
|
3223
3520
|
},
|
|
3224
3521
|
"Weight: ",
|
|
3225
3522
|
member.weight
|
|
3226
|
-
)), /* @__PURE__ */
|
|
3227
|
-
)))), /* @__PURE__ */
|
|
3523
|
+
)), /* @__PURE__ */ React44.createElement(ActionIcon6, { size: "sm", variant: "subtle", onClick: () => handleRemoveMember(index), style: { color: "#ff6b6b" } }, "\u{1F5D1}\uFE0F"))
|
|
3524
|
+
)))), /* @__PURE__ */ React44.createElement(Group9, { grow: true }, /* @__PURE__ */ React44.createElement(TextInput7, { placeholder: "Member address", value: newMember.addr, onChange: (e) => setNewMember({ ...newMember, addr: e.currentTarget.value }), styles: inputStyles29 }), /* @__PURE__ */ React44.createElement(
|
|
3228
3525
|
NumberInput2,
|
|
3229
3526
|
{
|
|
3230
3527
|
placeholder: "Weight",
|
|
@@ -3233,7 +3530,7 @@ var UpdateMembersActionForm = ({ data, onChange }) => {
|
|
|
3233
3530
|
min: 1,
|
|
3234
3531
|
styles: inputStyles29
|
|
3235
3532
|
}
|
|
3236
|
-
), /* @__PURE__ */
|
|
3533
|
+
), /* @__PURE__ */ React44.createElement(
|
|
3237
3534
|
Button6,
|
|
3238
3535
|
{
|
|
3239
3536
|
size: "sm",
|
|
@@ -3246,7 +3543,7 @@ var UpdateMembersActionForm = ({ data, onChange }) => {
|
|
|
3246
3543
|
}
|
|
3247
3544
|
},
|
|
3248
3545
|
"\u2795 Add"
|
|
3249
|
-
))), /* @__PURE__ */
|
|
3546
|
+
))), /* @__PURE__ */ React44.createElement(Divider3, { color: "#333" }), /* @__PURE__ */ React44.createElement(Stack28, { gap: "xs" }, /* @__PURE__ */ React44.createElement(Text27, { size: "sm", fw: 500, style: { color: "#adb5bd" } }, "Members to Remove"), /* @__PURE__ */ React44.createElement(ScrollArea2, { h: 100 }, /* @__PURE__ */ React44.createElement(Stack28, { gap: "xs" }, (data.remove || []).map((item, index) => /* @__PURE__ */ React44.createElement(
|
|
3250
3547
|
Card7,
|
|
3251
3548
|
{
|
|
3252
3549
|
key: index,
|
|
@@ -3257,8 +3554,8 @@ var UpdateMembersActionForm = ({ data, onChange }) => {
|
|
|
3257
3554
|
borderColor: "#333"
|
|
3258
3555
|
}
|
|
3259
3556
|
},
|
|
3260
|
-
/* @__PURE__ */
|
|
3261
|
-
)))), /* @__PURE__ */
|
|
3557
|
+
/* @__PURE__ */ React44.createElement(Group9, { justify: "space-between" }, /* @__PURE__ */ React44.createElement(Text27, { size: "sm", style: { color: "#adb5bd" } }, item.addr.slice(0, 30), "..."), /* @__PURE__ */ React44.createElement(ActionIcon6, { size: "sm", variant: "subtle", onClick: () => handleRemoveRemoveAddress(index), style: { color: "#ff6b6b" } }, "\u{1F5D1}\uFE0F"))
|
|
3558
|
+
)))), /* @__PURE__ */ React44.createElement(Group9, { grow: true }, /* @__PURE__ */ React44.createElement(TextInput7, { placeholder: "Address to remove", value: newRemoveAddress, onChange: (e) => setNewRemoveAddress(e.currentTarget.value), styles: inputStyles29 }), /* @__PURE__ */ React44.createElement(
|
|
3262
3559
|
Button6,
|
|
3263
3560
|
{
|
|
3264
3561
|
size: "sm",
|
|
@@ -3275,8 +3572,8 @@ var UpdateMembersActionForm = ({ data, onChange }) => {
|
|
|
3275
3572
|
};
|
|
3276
3573
|
|
|
3277
3574
|
// src/mantine/blocks/proposal/actions-components/StakeActionForm.tsx
|
|
3278
|
-
import
|
|
3279
|
-
import { Stack as
|
|
3575
|
+
import React45 from "react";
|
|
3576
|
+
import { Stack as Stack29, TextInput as TextInput8, Select as Select3, NumberInput as NumberInput3 } from "@mantine/core";
|
|
3280
3577
|
var stakeTypeOptions = [
|
|
3281
3578
|
{ value: StakeType.Delegate, label: "Delegate" },
|
|
3282
3579
|
{ value: StakeType.Undelegate, label: "Undelegate" },
|
|
@@ -3321,7 +3618,7 @@ var selectStyles = {
|
|
|
3321
3618
|
var StakeActionForm = ({ data, onChange }) => {
|
|
3322
3619
|
const isRedelegate = data.stakeType === StakeType.Redelegate;
|
|
3323
3620
|
const needsAmount = data.stakeType !== StakeType.WithdrawDelegatorReward;
|
|
3324
|
-
return /* @__PURE__ */
|
|
3621
|
+
return /* @__PURE__ */ React45.createElement(Stack29, { gap: "md" }, /* @__PURE__ */ React45.createElement(
|
|
3325
3622
|
Select3,
|
|
3326
3623
|
{
|
|
3327
3624
|
label: "Stake Type",
|
|
@@ -3331,7 +3628,7 @@ var StakeActionForm = ({ data, onChange }) => {
|
|
|
3331
3628
|
required: true,
|
|
3332
3629
|
styles: selectStyles
|
|
3333
3630
|
}
|
|
3334
|
-
), /* @__PURE__ */
|
|
3631
|
+
), /* @__PURE__ */ React45.createElement(
|
|
3335
3632
|
TextInput8,
|
|
3336
3633
|
{
|
|
3337
3634
|
label: "Validator Address",
|
|
@@ -3341,7 +3638,7 @@ var StakeActionForm = ({ data, onChange }) => {
|
|
|
3341
3638
|
required: true,
|
|
3342
3639
|
styles: inputStyles
|
|
3343
3640
|
}
|
|
3344
|
-
), isRedelegate && /* @__PURE__ */
|
|
3641
|
+
), isRedelegate && /* @__PURE__ */ React45.createElement(
|
|
3345
3642
|
TextInput8,
|
|
3346
3643
|
{
|
|
3347
3644
|
label: "Destination Validator Address",
|
|
@@ -3351,7 +3648,7 @@ var StakeActionForm = ({ data, onChange }) => {
|
|
|
3351
3648
|
required: true,
|
|
3352
3649
|
styles: inputStyles
|
|
3353
3650
|
}
|
|
3354
|
-
), needsAmount && /* @__PURE__ */
|
|
3651
|
+
), needsAmount && /* @__PURE__ */ React45.createElement(React45.Fragment, null, /* @__PURE__ */ React45.createElement(
|
|
3355
3652
|
NumberInput3,
|
|
3356
3653
|
{
|
|
3357
3654
|
label: "Amount",
|
|
@@ -3363,7 +3660,7 @@ var StakeActionForm = ({ data, onChange }) => {
|
|
|
3363
3660
|
required: true,
|
|
3364
3661
|
styles: inputStyles
|
|
3365
3662
|
}
|
|
3366
|
-
), /* @__PURE__ */
|
|
3663
|
+
), /* @__PURE__ */ React45.createElement(
|
|
3367
3664
|
Select3,
|
|
3368
3665
|
{
|
|
3369
3666
|
label: "Denomination",
|
|
@@ -3380,8 +3677,8 @@ var StakeActionForm = ({ data, onChange }) => {
|
|
|
3380
3677
|
};
|
|
3381
3678
|
|
|
3382
3679
|
// src/mantine/blocks/proposal/actions-components/JoinActionForm.tsx
|
|
3383
|
-
import
|
|
3384
|
-
import { Stack as
|
|
3680
|
+
import React46 from "react";
|
|
3681
|
+
import { Stack as Stack30, TextInput as TextInput9 } from "@mantine/core";
|
|
3385
3682
|
var inputStyles2 = {
|
|
3386
3683
|
label: { color: "#adb5bd" },
|
|
3387
3684
|
input: {
|
|
@@ -3394,7 +3691,7 @@ var inputStyles2 = {
|
|
|
3394
3691
|
}
|
|
3395
3692
|
};
|
|
3396
3693
|
var JoinActionForm = ({ data, onChange }) => {
|
|
3397
|
-
return /* @__PURE__ */
|
|
3694
|
+
return /* @__PURE__ */ React46.createElement(Stack30, { gap: "md" }, /* @__PURE__ */ React46.createElement(TextInput9, { label: "ID", placeholder: "did:ixo:entity:abc123...", value: data.id, onChange: (e) => onChange({ ...data, id: e.target.value }), required: true, styles: inputStyles2 }), /* @__PURE__ */ React46.createElement(
|
|
3398
3695
|
TextInput9,
|
|
3399
3696
|
{
|
|
3400
3697
|
label: "Core Address",
|
|
@@ -3404,12 +3701,12 @@ var JoinActionForm = ({ data, onChange }) => {
|
|
|
3404
3701
|
required: true,
|
|
3405
3702
|
styles: inputStyles2
|
|
3406
3703
|
}
|
|
3407
|
-
), /* @__PURE__ */
|
|
3704
|
+
), /* @__PURE__ */ React46.createElement(TextInput9, { label: "Address", placeholder: "ixo1...", value: data.address, onChange: (e) => onChange({ ...data, address: e.target.value }), required: true, styles: inputStyles2 }));
|
|
3408
3705
|
};
|
|
3409
3706
|
|
|
3410
3707
|
// src/mantine/blocks/proposal/actions-components/forms/MintActionForm.tsx
|
|
3411
|
-
import
|
|
3412
|
-
import { Stack as
|
|
3708
|
+
import React47 from "react";
|
|
3709
|
+
import { Stack as Stack31, TextInput as TextInput10, NumberInput as NumberInput4 } from "@mantine/core";
|
|
3413
3710
|
var inputStyles3 = {
|
|
3414
3711
|
label: { color: "#adb5bd" },
|
|
3415
3712
|
input: {
|
|
@@ -3422,7 +3719,7 @@ var inputStyles3 = {
|
|
|
3422
3719
|
}
|
|
3423
3720
|
};
|
|
3424
3721
|
var MintActionForm = ({ data, onChange }) => {
|
|
3425
|
-
return /* @__PURE__ */
|
|
3722
|
+
return /* @__PURE__ */ React47.createElement(Stack31, { gap: "md" }, /* @__PURE__ */ React47.createElement(TextInput10, { label: "Recipient Address", placeholder: "ixo1...", value: data.to, onChange: (e) => onChange({ ...data, to: e.currentTarget.value }), required: true, styles: inputStyles3 }), /* @__PURE__ */ React47.createElement(
|
|
3426
3723
|
NumberInput4,
|
|
3427
3724
|
{
|
|
3428
3725
|
label: "Amount",
|
|
@@ -3438,8 +3735,8 @@ var MintActionForm = ({ data, onChange }) => {
|
|
|
3438
3735
|
};
|
|
3439
3736
|
|
|
3440
3737
|
// src/mantine/blocks/proposal/actions-components/forms/ExecuteActionForm.tsx
|
|
3441
|
-
import
|
|
3442
|
-
import { Stack as
|
|
3738
|
+
import React48, { useState as useState10 } from "react";
|
|
3739
|
+
import { Stack as Stack32, TextInput as TextInput11, Textarea as Textarea3, Button as Button7, Group as Group10, Text as Text28, Card as Card8 } from "@mantine/core";
|
|
3443
3740
|
var inputStyles4 = {
|
|
3444
3741
|
label: { color: "#adb5bd" },
|
|
3445
3742
|
input: {
|
|
@@ -3452,7 +3749,7 @@ var inputStyles4 = {
|
|
|
3452
3749
|
}
|
|
3453
3750
|
};
|
|
3454
3751
|
var ExecuteActionForm = ({ data, onChange }) => {
|
|
3455
|
-
const [newFund, setNewFund] =
|
|
3752
|
+
const [newFund, setNewFund] = useState10({ denom: "uixo", amount: "" });
|
|
3456
3753
|
const handleAddFund = () => {
|
|
3457
3754
|
if (newFund.amount && newFund.denom) {
|
|
3458
3755
|
onChange({
|
|
@@ -3476,7 +3773,7 @@ var ExecuteActionForm = ({ data, onChange }) => {
|
|
|
3476
3773
|
return data.message;
|
|
3477
3774
|
}
|
|
3478
3775
|
};
|
|
3479
|
-
return /* @__PURE__ */
|
|
3776
|
+
return /* @__PURE__ */ React48.createElement(Stack32, { gap: "md" }, /* @__PURE__ */ React48.createElement(
|
|
3480
3777
|
TextInput11,
|
|
3481
3778
|
{
|
|
3482
3779
|
label: "Contract Address",
|
|
@@ -3486,7 +3783,7 @@ var ExecuteActionForm = ({ data, onChange }) => {
|
|
|
3486
3783
|
required: true,
|
|
3487
3784
|
styles: inputStyles4
|
|
3488
3785
|
}
|
|
3489
|
-
), /* @__PURE__ */
|
|
3786
|
+
), /* @__PURE__ */ React48.createElement(
|
|
3490
3787
|
Textarea3,
|
|
3491
3788
|
{
|
|
3492
3789
|
label: "Message (JSON)",
|
|
@@ -3497,7 +3794,7 @@ var ExecuteActionForm = ({ data, onChange }) => {
|
|
|
3497
3794
|
required: true,
|
|
3498
3795
|
styles: inputStyles4
|
|
3499
3796
|
}
|
|
3500
|
-
), /* @__PURE__ */
|
|
3797
|
+
), /* @__PURE__ */ React48.createElement(Stack32, { gap: "xs" }, /* @__PURE__ */ React48.createElement(Text28, { size: "sm", fw: 500, style: { color: "#adb5bd" } }, "Funds (Optional)"), (data.funds || []).map((fund, index) => /* @__PURE__ */ React48.createElement(Card8, { key: index, withBorder: true, padding: "xs", style: { backgroundColor: "#2a2a2a", borderColor: "#333" } }, /* @__PURE__ */ React48.createElement(Group10, { justify: "space-between" }, /* @__PURE__ */ React48.createElement(Text28, { size: "sm", style: { color: "#f1f3f5" } }, fund.amount, " ", fund.denom), /* @__PURE__ */ React48.createElement(Button7, { size: "xs", variant: "subtle", onClick: () => handleRemoveFund(index), style: { color: "#ff6b6b" } }, "Remove")))), /* @__PURE__ */ React48.createElement(Group10, { grow: true }, /* @__PURE__ */ React48.createElement(TextInput11, { placeholder: "Amount", value: newFund.amount, onChange: (e) => setNewFund({ ...newFund, amount: e.currentTarget.value }), styles: inputStyles4 }), /* @__PURE__ */ React48.createElement(TextInput11, { placeholder: "Denom (e.g., uixo)", value: newFund.denom, onChange: (e) => setNewFund({ ...newFund, denom: e.currentTarget.value }), styles: inputStyles4 }), /* @__PURE__ */ React48.createElement(
|
|
3501
3798
|
Button7,
|
|
3502
3799
|
{
|
|
3503
3800
|
size: "sm",
|
|
@@ -3512,9 +3809,9 @@ var ExecuteActionForm = ({ data, onChange }) => {
|
|
|
3512
3809
|
};
|
|
3513
3810
|
|
|
3514
3811
|
// src/mantine/blocks/proposal/actions-components/forms/CustomActionForm.tsx
|
|
3515
|
-
import
|
|
3516
|
-
import { Stack as
|
|
3517
|
-
import { Group as
|
|
3812
|
+
import React49, { useState as useState11, useEffect as useEffect9 } from "react";
|
|
3813
|
+
import { Stack as Stack33, Textarea as Textarea4, Alert as Alert5, Text as Text29, Badge as Badge7 } from "@mantine/core";
|
|
3814
|
+
import { Group as Group11 } from "@mantine/core";
|
|
3518
3815
|
var inputStyles5 = {
|
|
3519
3816
|
label: { color: "#adb5bd" },
|
|
3520
3817
|
input: {
|
|
@@ -3528,9 +3825,9 @@ var inputStyles5 = {
|
|
|
3528
3825
|
}
|
|
3529
3826
|
};
|
|
3530
3827
|
var CustomActionForm = ({ data, onChange }) => {
|
|
3531
|
-
const [isValid, setIsValid] =
|
|
3532
|
-
const [error, setError] =
|
|
3533
|
-
|
|
3828
|
+
const [isValid, setIsValid] = useState11(true);
|
|
3829
|
+
const [error, setError] = useState11("");
|
|
3830
|
+
useEffect9(() => {
|
|
3534
3831
|
try {
|
|
3535
3832
|
if (data.message) {
|
|
3536
3833
|
JSON.parse(data.message);
|
|
@@ -3550,7 +3847,7 @@ var CustomActionForm = ({ data, onChange }) => {
|
|
|
3550
3847
|
return data.message;
|
|
3551
3848
|
}
|
|
3552
3849
|
};
|
|
3553
|
-
return /* @__PURE__ */
|
|
3850
|
+
return /* @__PURE__ */ React49.createElement(Stack33, { gap: "md" }, /* @__PURE__ */ React49.createElement(Alert5, { color: "yellow", style: { backgroundColor: "#2a2a2a", borderColor: "#ffd43b" } }, /* @__PURE__ */ React49.createElement(Text29, { size: "sm", style: { color: "#ffd43b" } }, "\u26A0\uFE0F Custom actions require valid JSON messages. Supports both Wasm and Stargate message formats.")), /* @__PURE__ */ React49.createElement("div", null, /* @__PURE__ */ React49.createElement(Group11, { gap: "xs", mb: "xs" }, /* @__PURE__ */ React49.createElement(Text29, { size: "sm", fw: 500, style: { color: "#adb5bd" } }, "Custom Message (JSON)"), /* @__PURE__ */ React49.createElement(
|
|
3554
3851
|
Badge7,
|
|
3555
3852
|
{
|
|
3556
3853
|
size: "sm",
|
|
@@ -3560,7 +3857,7 @@ var CustomActionForm = ({ data, onChange }) => {
|
|
|
3560
3857
|
}
|
|
3561
3858
|
},
|
|
3562
3859
|
isValid ? "Valid JSON" : "Invalid JSON"
|
|
3563
|
-
)), /* @__PURE__ */
|
|
3860
|
+
)), /* @__PURE__ */ React49.createElement(
|
|
3564
3861
|
Textarea4,
|
|
3565
3862
|
{
|
|
3566
3863
|
placeholder: `Example Wasm message:
|
|
@@ -3593,8 +3890,8 @@ Example Stargate message:
|
|
|
3593
3890
|
};
|
|
3594
3891
|
|
|
3595
3892
|
// src/mantine/blocks/proposal/actions-components/forms/AuthzExecActionForm.tsx
|
|
3596
|
-
import
|
|
3597
|
-
import { Stack as
|
|
3893
|
+
import React50 from "react";
|
|
3894
|
+
import { Stack as Stack34, Select as Select4, TextInput as TextInput12, Textarea as Textarea5 } from "@mantine/core";
|
|
3598
3895
|
var inputStyles6 = {
|
|
3599
3896
|
label: { color: "#adb5bd" },
|
|
3600
3897
|
input: {
|
|
@@ -3629,7 +3926,7 @@ var AuthzExecActionForm = ({ data, onChange }) => {
|
|
|
3629
3926
|
onChange({ ...data, [field]: value });
|
|
3630
3927
|
}
|
|
3631
3928
|
};
|
|
3632
|
-
return /* @__PURE__ */
|
|
3929
|
+
return /* @__PURE__ */ React50.createElement(Stack34, { gap: "md" }, /* @__PURE__ */ React50.createElement(
|
|
3633
3930
|
Select4,
|
|
3634
3931
|
{
|
|
3635
3932
|
label: "Action Type",
|
|
@@ -3640,7 +3937,7 @@ var AuthzExecActionForm = ({ data, onChange }) => {
|
|
|
3640
3937
|
required: true,
|
|
3641
3938
|
styles: inputStyles6
|
|
3642
3939
|
}
|
|
3643
|
-
), data.authzExecActionType === AuthzExecActionTypes.Delegate && /* @__PURE__ */
|
|
3940
|
+
), data.authzExecActionType === AuthzExecActionTypes.Delegate && /* @__PURE__ */ React50.createElement(
|
|
3644
3941
|
Textarea5,
|
|
3645
3942
|
{
|
|
3646
3943
|
label: "Delegate Message (JSON)",
|
|
@@ -3650,7 +3947,7 @@ var AuthzExecActionForm = ({ data, onChange }) => {
|
|
|
3650
3947
|
minRows: 4,
|
|
3651
3948
|
styles: inputStyles6
|
|
3652
3949
|
}
|
|
3653
|
-
), data.authzExecActionType === AuthzExecActionTypes.Undelegate && /* @__PURE__ */
|
|
3950
|
+
), data.authzExecActionType === AuthzExecActionTypes.Undelegate && /* @__PURE__ */ React50.createElement(
|
|
3654
3951
|
Textarea5,
|
|
3655
3952
|
{
|
|
3656
3953
|
label: "Undelegate Message (JSON)",
|
|
@@ -3660,7 +3957,7 @@ var AuthzExecActionForm = ({ data, onChange }) => {
|
|
|
3660
3957
|
minRows: 4,
|
|
3661
3958
|
styles: inputStyles6
|
|
3662
3959
|
}
|
|
3663
|
-
), data.authzExecActionType === AuthzExecActionTypes.Redelegate && /* @__PURE__ */
|
|
3960
|
+
), data.authzExecActionType === AuthzExecActionTypes.Redelegate && /* @__PURE__ */ React50.createElement(
|
|
3664
3961
|
Textarea5,
|
|
3665
3962
|
{
|
|
3666
3963
|
label: "Redelegate Message (JSON)",
|
|
@@ -3670,7 +3967,7 @@ var AuthzExecActionForm = ({ data, onChange }) => {
|
|
|
3670
3967
|
minRows: 4,
|
|
3671
3968
|
styles: inputStyles6
|
|
3672
3969
|
}
|
|
3673
|
-
), data.authzExecActionType === AuthzExecActionTypes.ClaimRewards && /* @__PURE__ */
|
|
3970
|
+
), data.authzExecActionType === AuthzExecActionTypes.ClaimRewards && /* @__PURE__ */ React50.createElement(
|
|
3674
3971
|
Textarea5,
|
|
3675
3972
|
{
|
|
3676
3973
|
label: "Claim Rewards Message (JSON)",
|
|
@@ -3680,7 +3977,7 @@ var AuthzExecActionForm = ({ data, onChange }) => {
|
|
|
3680
3977
|
minRows: 3,
|
|
3681
3978
|
styles: inputStyles6
|
|
3682
3979
|
}
|
|
3683
|
-
), data.authzExecActionType === AuthzExecActionTypes.Custom && /* @__PURE__ */
|
|
3980
|
+
), data.authzExecActionType === AuthzExecActionTypes.Custom && /* @__PURE__ */ React50.createElement(
|
|
3684
3981
|
TextInput12,
|
|
3685
3982
|
{
|
|
3686
3983
|
label: "Custom Message",
|
|
@@ -3693,8 +3990,8 @@ var AuthzExecActionForm = ({ data, onChange }) => {
|
|
|
3693
3990
|
};
|
|
3694
3991
|
|
|
3695
3992
|
// src/mantine/blocks/proposal/actions-components/forms/AuthzGrantActionForm.tsx
|
|
3696
|
-
import
|
|
3697
|
-
import { Stack as
|
|
3993
|
+
import React51 from "react";
|
|
3994
|
+
import { Stack as Stack35, TextInput as TextInput13 } from "@mantine/core";
|
|
3698
3995
|
var inputStyles7 = {
|
|
3699
3996
|
label: { color: "#adb5bd" },
|
|
3700
3997
|
input: {
|
|
@@ -3707,7 +4004,7 @@ var inputStyles7 = {
|
|
|
3707
4004
|
}
|
|
3708
4005
|
};
|
|
3709
4006
|
var AuthzGrantActionForm = ({ data, onChange }) => {
|
|
3710
|
-
return /* @__PURE__ */
|
|
4007
|
+
return /* @__PURE__ */ React51.createElement(Stack35, { gap: "md" }, /* @__PURE__ */ React51.createElement(
|
|
3711
4008
|
TextInput13,
|
|
3712
4009
|
{
|
|
3713
4010
|
label: "Type URL",
|
|
@@ -3717,7 +4014,7 @@ var AuthzGrantActionForm = ({ data, onChange }) => {
|
|
|
3717
4014
|
required: true,
|
|
3718
4015
|
styles: inputStyles7
|
|
3719
4016
|
}
|
|
3720
|
-
), /* @__PURE__ */
|
|
4017
|
+
), /* @__PURE__ */ React51.createElement(
|
|
3721
4018
|
TextInput13,
|
|
3722
4019
|
{
|
|
3723
4020
|
label: "Grantee Address",
|
|
@@ -3730,7 +4027,7 @@ var AuthzGrantActionForm = ({ data, onChange }) => {
|
|
|
3730
4027
|
required: true,
|
|
3731
4028
|
styles: inputStyles7
|
|
3732
4029
|
}
|
|
3733
|
-
), /* @__PURE__ */
|
|
4030
|
+
), /* @__PURE__ */ React51.createElement(
|
|
3734
4031
|
TextInput13,
|
|
3735
4032
|
{
|
|
3736
4033
|
label: "Message Type URL",
|
|
@@ -3747,8 +4044,8 @@ var AuthzGrantActionForm = ({ data, onChange }) => {
|
|
|
3747
4044
|
};
|
|
3748
4045
|
|
|
3749
4046
|
// src/mantine/blocks/proposal/actions-components/forms/BurnNftActionForm.tsx
|
|
3750
|
-
import
|
|
3751
|
-
import { Stack as
|
|
4047
|
+
import React52 from "react";
|
|
4048
|
+
import { Stack as Stack36, TextInput as TextInput14 } from "@mantine/core";
|
|
3752
4049
|
var inputStyles8 = {
|
|
3753
4050
|
label: { color: "#adb5bd" },
|
|
3754
4051
|
input: {
|
|
@@ -3761,7 +4058,7 @@ var inputStyles8 = {
|
|
|
3761
4058
|
}
|
|
3762
4059
|
};
|
|
3763
4060
|
var BurnNftActionForm = ({ data, onChange }) => {
|
|
3764
|
-
return /* @__PURE__ */
|
|
4061
|
+
return /* @__PURE__ */ React52.createElement(Stack36, { gap: "md" }, /* @__PURE__ */ React52.createElement(
|
|
3765
4062
|
TextInput14,
|
|
3766
4063
|
{
|
|
3767
4064
|
label: "Collection Address",
|
|
@@ -3771,12 +4068,12 @@ var BurnNftActionForm = ({ data, onChange }) => {
|
|
|
3771
4068
|
required: true,
|
|
3772
4069
|
styles: inputStyles8
|
|
3773
4070
|
}
|
|
3774
|
-
), /* @__PURE__ */
|
|
4071
|
+
), /* @__PURE__ */ React52.createElement(TextInput14, { label: "Token ID", placeholder: "1", value: data.tokenId, onChange: (e) => onChange({ ...data, tokenId: e.currentTarget.value }), required: true, styles: inputStyles8 }));
|
|
3775
4072
|
};
|
|
3776
4073
|
|
|
3777
4074
|
// src/mantine/blocks/proposal/actions-components/forms/TransferNftActionForm.tsx
|
|
3778
|
-
import
|
|
3779
|
-
import { Stack as
|
|
4075
|
+
import React53 from "react";
|
|
4076
|
+
import { Stack as Stack37, TextInput as TextInput15, Checkbox as Checkbox4, Textarea as Textarea6 } from "@mantine/core";
|
|
3780
4077
|
var inputStyles9 = {
|
|
3781
4078
|
label: { color: "#adb5bd" },
|
|
3782
4079
|
input: {
|
|
@@ -3789,7 +4086,7 @@ var inputStyles9 = {
|
|
|
3789
4086
|
}
|
|
3790
4087
|
};
|
|
3791
4088
|
var TransferNftActionForm = ({ data, onChange }) => {
|
|
3792
|
-
return /* @__PURE__ */
|
|
4089
|
+
return /* @__PURE__ */ React53.createElement(Stack37, { gap: "md" }, /* @__PURE__ */ React53.createElement(
|
|
3793
4090
|
TextInput15,
|
|
3794
4091
|
{
|
|
3795
4092
|
label: "Collection Address",
|
|
@@ -3799,7 +4096,7 @@ var TransferNftActionForm = ({ data, onChange }) => {
|
|
|
3799
4096
|
required: true,
|
|
3800
4097
|
styles: inputStyles9
|
|
3801
4098
|
}
|
|
3802
|
-
), /* @__PURE__ */
|
|
4099
|
+
), /* @__PURE__ */ React53.createElement(TextInput15, { label: "Token ID", placeholder: "1", value: data.tokenId, onChange: (e) => onChange({ ...data, tokenId: e.currentTarget.value }), required: true, styles: inputStyles9 }), /* @__PURE__ */ React53.createElement(
|
|
3803
4100
|
TextInput15,
|
|
3804
4101
|
{
|
|
3805
4102
|
label: "Recipient Address",
|
|
@@ -3809,7 +4106,7 @@ var TransferNftActionForm = ({ data, onChange }) => {
|
|
|
3809
4106
|
required: true,
|
|
3810
4107
|
styles: inputStyles9
|
|
3811
4108
|
}
|
|
3812
|
-
), /* @__PURE__ */
|
|
4109
|
+
), /* @__PURE__ */ React53.createElement(
|
|
3813
4110
|
Checkbox4,
|
|
3814
4111
|
{
|
|
3815
4112
|
label: "Execute Smart Contract",
|
|
@@ -3820,7 +4117,7 @@ var TransferNftActionForm = ({ data, onChange }) => {
|
|
|
3820
4117
|
input: { backgroundColor: "#2a2a2a", borderColor: "#333" }
|
|
3821
4118
|
}
|
|
3822
4119
|
}
|
|
3823
|
-
), data.executeSmartContract && /* @__PURE__ */
|
|
4120
|
+
), data.executeSmartContract && /* @__PURE__ */ React53.createElement(
|
|
3824
4121
|
Textarea6,
|
|
3825
4122
|
{
|
|
3826
4123
|
label: "Smart Contract Message (JSON)",
|
|
@@ -3834,8 +4131,8 @@ var TransferNftActionForm = ({ data, onChange }) => {
|
|
|
3834
4131
|
};
|
|
3835
4132
|
|
|
3836
4133
|
// src/mantine/blocks/proposal/actions-components/forms/ManageCw721ActionForm.tsx
|
|
3837
|
-
import
|
|
3838
|
-
import { Stack as
|
|
4134
|
+
import React54 from "react";
|
|
4135
|
+
import { Stack as Stack38, TextInput as TextInput16, Radio, Group as Group12 } from "@mantine/core";
|
|
3839
4136
|
var inputStyles10 = {
|
|
3840
4137
|
label: { color: "#adb5bd" },
|
|
3841
4138
|
input: {
|
|
@@ -3848,7 +4145,7 @@ var inputStyles10 = {
|
|
|
3848
4145
|
}
|
|
3849
4146
|
};
|
|
3850
4147
|
var ManageCw721ActionForm = ({ data, onChange }) => {
|
|
3851
|
-
return /* @__PURE__ */
|
|
4148
|
+
return /* @__PURE__ */ React54.createElement(Stack38, { gap: "md" }, /* @__PURE__ */ React54.createElement(Radio.Group, { label: "Action", value: data.adding ? "add" : "remove", onChange: (value) => onChange({ ...data, adding: value === "add" }) }, /* @__PURE__ */ React54.createElement(Group12, { mt: "xs" }, /* @__PURE__ */ React54.createElement(
|
|
3852
4149
|
Radio,
|
|
3853
4150
|
{
|
|
3854
4151
|
value: "add",
|
|
@@ -3858,7 +4155,7 @@ var ManageCw721ActionForm = ({ data, onChange }) => {
|
|
|
3858
4155
|
radio: { backgroundColor: "#2a2a2a", borderColor: "#333" }
|
|
3859
4156
|
}
|
|
3860
4157
|
}
|
|
3861
|
-
), /* @__PURE__ */
|
|
4158
|
+
), /* @__PURE__ */ React54.createElement(
|
|
3862
4159
|
Radio,
|
|
3863
4160
|
{
|
|
3864
4161
|
value: "remove",
|
|
@@ -3868,7 +4165,7 @@ var ManageCw721ActionForm = ({ data, onChange }) => {
|
|
|
3868
4165
|
radio: { backgroundColor: "#2a2a2a", borderColor: "#333" }
|
|
3869
4166
|
}
|
|
3870
4167
|
}
|
|
3871
|
-
))), /* @__PURE__ */
|
|
4168
|
+
))), /* @__PURE__ */ React54.createElement(
|
|
3872
4169
|
TextInput16,
|
|
3873
4170
|
{
|
|
3874
4171
|
label: "NFT Contract Address",
|
|
@@ -3882,8 +4179,8 @@ var ManageCw721ActionForm = ({ data, onChange }) => {
|
|
|
3882
4179
|
};
|
|
3883
4180
|
|
|
3884
4181
|
// src/mantine/blocks/proposal/actions-components/forms/InstantiateActionForm.tsx
|
|
3885
|
-
import
|
|
3886
|
-
import { Stack as
|
|
4182
|
+
import React55, { useState as useState12 } from "react";
|
|
4183
|
+
import { Stack as Stack39, TextInput as TextInput17, Textarea as Textarea7, NumberInput as NumberInput5, Button as Button8, Group as Group13, Text as Text30, Card as Card9 } from "@mantine/core";
|
|
3887
4184
|
var inputStyles11 = {
|
|
3888
4185
|
label: { color: "#adb5bd" },
|
|
3889
4186
|
input: {
|
|
@@ -3896,7 +4193,7 @@ var inputStyles11 = {
|
|
|
3896
4193
|
}
|
|
3897
4194
|
};
|
|
3898
4195
|
var InstantiateActionForm = ({ data, onChange }) => {
|
|
3899
|
-
const [newFund, setNewFund] =
|
|
4196
|
+
const [newFund, setNewFund] = useState12({ denom: "uixo", amount: "" });
|
|
3900
4197
|
const handleAddFund = () => {
|
|
3901
4198
|
if (newFund.amount && newFund.denom) {
|
|
3902
4199
|
onChange({
|
|
@@ -3920,7 +4217,7 @@ var InstantiateActionForm = ({ data, onChange }) => {
|
|
|
3920
4217
|
return data.message;
|
|
3921
4218
|
}
|
|
3922
4219
|
};
|
|
3923
|
-
return /* @__PURE__ */
|
|
4220
|
+
return /* @__PURE__ */ React55.createElement(Stack39, { gap: "md" }, /* @__PURE__ */ React55.createElement(
|
|
3924
4221
|
TextInput17,
|
|
3925
4222
|
{
|
|
3926
4223
|
label: "Admin Address",
|
|
@@ -3930,7 +4227,7 @@ var InstantiateActionForm = ({ data, onChange }) => {
|
|
|
3930
4227
|
required: true,
|
|
3931
4228
|
styles: inputStyles11
|
|
3932
4229
|
}
|
|
3933
|
-
), /* @__PURE__ */
|
|
4230
|
+
), /* @__PURE__ */ React55.createElement(
|
|
3934
4231
|
NumberInput5,
|
|
3935
4232
|
{
|
|
3936
4233
|
label: "Code ID",
|
|
@@ -3941,7 +4238,7 @@ var InstantiateActionForm = ({ data, onChange }) => {
|
|
|
3941
4238
|
required: true,
|
|
3942
4239
|
styles: inputStyles11
|
|
3943
4240
|
}
|
|
3944
|
-
), /* @__PURE__ */
|
|
4241
|
+
), /* @__PURE__ */ React55.createElement(TextInput17, { label: "Label", placeholder: "My Contract", value: data.label, onChange: (e) => onChange({ ...data, label: e.currentTarget.value }), required: true, styles: inputStyles11 }), /* @__PURE__ */ React55.createElement(
|
|
3945
4242
|
Textarea7,
|
|
3946
4243
|
{
|
|
3947
4244
|
label: "Instantiate Message (JSON)",
|
|
@@ -3952,7 +4249,7 @@ var InstantiateActionForm = ({ data, onChange }) => {
|
|
|
3952
4249
|
required: true,
|
|
3953
4250
|
styles: inputStyles11
|
|
3954
4251
|
}
|
|
3955
|
-
), /* @__PURE__ */
|
|
4252
|
+
), /* @__PURE__ */ React55.createElement(Stack39, { gap: "xs" }, /* @__PURE__ */ React55.createElement(Text30, { size: "sm", fw: 500, style: { color: "#adb5bd" } }, "Funds (Optional)"), (data.funds || []).map((fund, index) => /* @__PURE__ */ React55.createElement(Card9, { key: index, withBorder: true, padding: "xs", style: { backgroundColor: "#2a2a2a", borderColor: "#333" } }, /* @__PURE__ */ React55.createElement(Group13, { justify: "space-between" }, /* @__PURE__ */ React55.createElement(Text30, { size: "sm", style: { color: "#f1f3f5" } }, fund.amount, " ", fund.denom), /* @__PURE__ */ React55.createElement(Button8, { size: "xs", variant: "subtle", onClick: () => handleRemoveFund(index), style: { color: "#ff6b6b" } }, "Remove")))), /* @__PURE__ */ React55.createElement(Group13, { grow: true }, /* @__PURE__ */ React55.createElement(TextInput17, { placeholder: "Amount", value: newFund.amount, onChange: (e) => setNewFund({ ...newFund, amount: e.currentTarget.value }), styles: inputStyles11 }), /* @__PURE__ */ React55.createElement(TextInput17, { placeholder: "Denom (e.g., uixo)", value: newFund.denom, onChange: (e) => setNewFund({ ...newFund, denom: e.currentTarget.value }), styles: inputStyles11 }), /* @__PURE__ */ React55.createElement(
|
|
3956
4253
|
Button8,
|
|
3957
4254
|
{
|
|
3958
4255
|
size: "sm",
|
|
@@ -3967,8 +4264,8 @@ var InstantiateActionForm = ({ data, onChange }) => {
|
|
|
3967
4264
|
};
|
|
3968
4265
|
|
|
3969
4266
|
// src/mantine/blocks/proposal/actions-components/forms/MigrateActionForm.tsx
|
|
3970
|
-
import
|
|
3971
|
-
import { Stack as
|
|
4267
|
+
import React56 from "react";
|
|
4268
|
+
import { Stack as Stack40, TextInput as TextInput18, Textarea as Textarea8, NumberInput as NumberInput6 } from "@mantine/core";
|
|
3972
4269
|
var inputStyles12 = {
|
|
3973
4270
|
label: { color: "#adb5bd" },
|
|
3974
4271
|
input: {
|
|
@@ -3989,7 +4286,7 @@ var MigrateActionForm = ({ data, onChange }) => {
|
|
|
3989
4286
|
return data.msg;
|
|
3990
4287
|
}
|
|
3991
4288
|
};
|
|
3992
|
-
return /* @__PURE__ */
|
|
4289
|
+
return /* @__PURE__ */ React56.createElement(Stack40, { gap: "md" }, /* @__PURE__ */ React56.createElement(
|
|
3993
4290
|
TextInput18,
|
|
3994
4291
|
{
|
|
3995
4292
|
label: "Contract Address",
|
|
@@ -3999,7 +4296,7 @@ var MigrateActionForm = ({ data, onChange }) => {
|
|
|
3999
4296
|
required: true,
|
|
4000
4297
|
styles: inputStyles12
|
|
4001
4298
|
}
|
|
4002
|
-
), /* @__PURE__ */
|
|
4299
|
+
), /* @__PURE__ */ React56.createElement(
|
|
4003
4300
|
NumberInput6,
|
|
4004
4301
|
{
|
|
4005
4302
|
label: "New Code ID",
|
|
@@ -4010,7 +4307,7 @@ var MigrateActionForm = ({ data, onChange }) => {
|
|
|
4010
4307
|
required: true,
|
|
4011
4308
|
styles: inputStyles12
|
|
4012
4309
|
}
|
|
4013
|
-
), /* @__PURE__ */
|
|
4310
|
+
), /* @__PURE__ */ React56.createElement(
|
|
4014
4311
|
Textarea8,
|
|
4015
4312
|
{
|
|
4016
4313
|
label: "Migration Message (JSON)",
|
|
@@ -4025,8 +4322,8 @@ var MigrateActionForm = ({ data, onChange }) => {
|
|
|
4025
4322
|
};
|
|
4026
4323
|
|
|
4027
4324
|
// src/mantine/blocks/proposal/actions-components/forms/UpdateAdminActionForm.tsx
|
|
4028
|
-
import
|
|
4029
|
-
import { Stack as
|
|
4325
|
+
import React57 from "react";
|
|
4326
|
+
import { Stack as Stack41, TextInput as TextInput19 } from "@mantine/core";
|
|
4030
4327
|
var inputStyles13 = {
|
|
4031
4328
|
label: { color: "#adb5bd" },
|
|
4032
4329
|
input: {
|
|
@@ -4039,7 +4336,7 @@ var inputStyles13 = {
|
|
|
4039
4336
|
}
|
|
4040
4337
|
};
|
|
4041
4338
|
var UpdateAdminActionForm = ({ data, onChange }) => {
|
|
4042
|
-
return /* @__PURE__ */
|
|
4339
|
+
return /* @__PURE__ */ React57.createElement(Stack41, { gap: "md" }, /* @__PURE__ */ React57.createElement(
|
|
4043
4340
|
TextInput19,
|
|
4044
4341
|
{
|
|
4045
4342
|
label: "Contract Address",
|
|
@@ -4049,7 +4346,7 @@ var UpdateAdminActionForm = ({ data, onChange }) => {
|
|
|
4049
4346
|
required: true,
|
|
4050
4347
|
styles: inputStyles13
|
|
4051
4348
|
}
|
|
4052
|
-
), /* @__PURE__ */
|
|
4349
|
+
), /* @__PURE__ */ React57.createElement(
|
|
4053
4350
|
TextInput19,
|
|
4054
4351
|
{
|
|
4055
4352
|
label: "New Admin Address",
|
|
@@ -4063,8 +4360,8 @@ var UpdateAdminActionForm = ({ data, onChange }) => {
|
|
|
4063
4360
|
};
|
|
4064
4361
|
|
|
4065
4362
|
// src/mantine/blocks/proposal/actions-components/forms/ManageCw20ActionForm.tsx
|
|
4066
|
-
import
|
|
4067
|
-
import { Stack as
|
|
4363
|
+
import React58 from "react";
|
|
4364
|
+
import { Stack as Stack42, TextInput as TextInput20, Radio as Radio2, Group as Group14 } from "@mantine/core";
|
|
4068
4365
|
var inputStyles14 = {
|
|
4069
4366
|
label: { color: "#adb5bd" },
|
|
4070
4367
|
input: {
|
|
@@ -4077,7 +4374,7 @@ var inputStyles14 = {
|
|
|
4077
4374
|
}
|
|
4078
4375
|
};
|
|
4079
4376
|
var ManageCw20ActionForm = ({ data, onChange }) => {
|
|
4080
|
-
return /* @__PURE__ */
|
|
4377
|
+
return /* @__PURE__ */ React58.createElement(Stack42, { gap: "md" }, /* @__PURE__ */ React58.createElement(Radio2.Group, { label: "Action", value: data.adding ? "add" : "remove", onChange: (value) => onChange({ ...data, adding: value === "add" }) }, /* @__PURE__ */ React58.createElement(Group14, { mt: "xs" }, /* @__PURE__ */ React58.createElement(
|
|
4081
4378
|
Radio2,
|
|
4082
4379
|
{
|
|
4083
4380
|
value: "add",
|
|
@@ -4087,7 +4384,7 @@ var ManageCw20ActionForm = ({ data, onChange }) => {
|
|
|
4087
4384
|
radio: { backgroundColor: "#2a2a2a", borderColor: "#333" }
|
|
4088
4385
|
}
|
|
4089
4386
|
}
|
|
4090
|
-
), /* @__PURE__ */
|
|
4387
|
+
), /* @__PURE__ */ React58.createElement(
|
|
4091
4388
|
Radio2,
|
|
4092
4389
|
{
|
|
4093
4390
|
value: "remove",
|
|
@@ -4097,7 +4394,7 @@ var ManageCw20ActionForm = ({ data, onChange }) => {
|
|
|
4097
4394
|
radio: { backgroundColor: "#2a2a2a", borderColor: "#333" }
|
|
4098
4395
|
}
|
|
4099
4396
|
}
|
|
4100
|
-
))), /* @__PURE__ */
|
|
4397
|
+
))), /* @__PURE__ */ React58.createElement(
|
|
4101
4398
|
TextInput20,
|
|
4102
4399
|
{
|
|
4103
4400
|
label: "Token Contract Address",
|
|
@@ -4111,8 +4408,8 @@ var ManageCw20ActionForm = ({ data, onChange }) => {
|
|
|
4111
4408
|
};
|
|
4112
4409
|
|
|
4113
4410
|
// src/mantine/blocks/proposal/actions-components/forms/ManageSubDaosActionForm.tsx
|
|
4114
|
-
import
|
|
4115
|
-
import { Stack as
|
|
4411
|
+
import React59, { useState as useState13 } from "react";
|
|
4412
|
+
import { Stack as Stack43, TextInput as TextInput21, Button as Button9, Group as Group15, Text as Text31, Card as Card10, Textarea as Textarea9 } from "@mantine/core";
|
|
4116
4413
|
var inputStyles15 = {
|
|
4117
4414
|
label: { color: "#adb5bd" },
|
|
4118
4415
|
input: {
|
|
@@ -4125,8 +4422,8 @@ var inputStyles15 = {
|
|
|
4125
4422
|
}
|
|
4126
4423
|
};
|
|
4127
4424
|
var ManageSubDaosActionForm = ({ data, onChange }) => {
|
|
4128
|
-
const [newSubDao, setNewSubDao] =
|
|
4129
|
-
const [newRemoveAddress, setNewRemoveAddress] =
|
|
4425
|
+
const [newSubDao, setNewSubDao] = useState13({ addr: "", charter: "" });
|
|
4426
|
+
const [newRemoveAddress, setNewRemoveAddress] = useState13("");
|
|
4130
4427
|
const handleAddSubDao = () => {
|
|
4131
4428
|
if (newSubDao.addr) {
|
|
4132
4429
|
onChange({
|
|
@@ -4157,7 +4454,7 @@ var ManageSubDaosActionForm = ({ data, onChange }) => {
|
|
|
4157
4454
|
toRemove: (data.toRemove || []).filter((_, i) => i !== index)
|
|
4158
4455
|
});
|
|
4159
4456
|
};
|
|
4160
|
-
return /* @__PURE__ */
|
|
4457
|
+
return /* @__PURE__ */ React59.createElement(Stack43, { gap: "md" }, /* @__PURE__ */ React59.createElement(Stack43, { gap: "xs" }, /* @__PURE__ */ React59.createElement(Text31, { size: "sm", fw: 500, style: { color: "#adb5bd" } }, "SubDAOs to Add"), (data.toAdd || []).map((subDao, index) => /* @__PURE__ */ React59.createElement(Card10, { key: index, withBorder: true, padding: "xs", style: { backgroundColor: "#2a2a2a", borderColor: "#333" } }, /* @__PURE__ */ React59.createElement(Stack43, { gap: "xs" }, /* @__PURE__ */ React59.createElement(Group15, { justify: "space-between" }, /* @__PURE__ */ React59.createElement(Text31, { size: "sm", style: { color: "#f1f3f5" } }, subDao.addr), /* @__PURE__ */ React59.createElement(Button9, { size: "xs", variant: "subtle", onClick: () => handleRemoveFromAddList(index), style: { color: "#ff6b6b" } }, "Remove")), subDao.charter && /* @__PURE__ */ React59.createElement(Text31, { size: "xs", style: { color: "#adb5bd" } }, "Charter: ", subDao.charter)))), /* @__PURE__ */ React59.createElement(Stack43, { gap: "xs" }, /* @__PURE__ */ React59.createElement(TextInput21, { placeholder: "SubDAO Address", value: newSubDao.addr, onChange: (e) => setNewSubDao({ ...newSubDao, addr: e.currentTarget.value }), styles: inputStyles15 }), /* @__PURE__ */ React59.createElement(
|
|
4161
4458
|
Textarea9,
|
|
4162
4459
|
{
|
|
4163
4460
|
placeholder: "Charter (optional)",
|
|
@@ -4166,7 +4463,7 @@ var ManageSubDaosActionForm = ({ data, onChange }) => {
|
|
|
4166
4463
|
minRows: 2,
|
|
4167
4464
|
styles: inputStyles15
|
|
4168
4465
|
}
|
|
4169
|
-
), /* @__PURE__ */
|
|
4466
|
+
), /* @__PURE__ */ React59.createElement(
|
|
4170
4467
|
Button9,
|
|
4171
4468
|
{
|
|
4172
4469
|
size: "sm",
|
|
@@ -4177,7 +4474,7 @@ var ManageSubDaosActionForm = ({ data, onChange }) => {
|
|
|
4177
4474
|
}
|
|
4178
4475
|
},
|
|
4179
4476
|
"Add SubDAO"
|
|
4180
|
-
))), /* @__PURE__ */
|
|
4477
|
+
))), /* @__PURE__ */ React59.createElement(Stack43, { gap: "xs" }, /* @__PURE__ */ React59.createElement(Text31, { size: "sm", fw: 500, style: { color: "#adb5bd" } }, "SubDAOs to Remove"), (data.toRemove || []).map((subDao, index) => /* @__PURE__ */ React59.createElement(Card10, { key: index, withBorder: true, padding: "xs", style: { backgroundColor: "#2a2a2a", borderColor: "#333" } }, /* @__PURE__ */ React59.createElement(Group15, { justify: "space-between" }, /* @__PURE__ */ React59.createElement(Text31, { size: "sm", style: { color: "#f1f3f5" } }, subDao.address), /* @__PURE__ */ React59.createElement(Button9, { size: "xs", variant: "subtle", onClick: () => handleRemoveFromRemoveList(index), style: { color: "#ff6b6b" } }, "Remove")))), /* @__PURE__ */ React59.createElement(Group15, { grow: true }, /* @__PURE__ */ React59.createElement(TextInput21, { placeholder: "SubDAO Address to Remove", value: newRemoveAddress, onChange: (e) => setNewRemoveAddress(e.currentTarget.value), styles: inputStyles15 }), /* @__PURE__ */ React59.createElement(
|
|
4181
4478
|
Button9,
|
|
4182
4479
|
{
|
|
4183
4480
|
size: "sm",
|
|
@@ -4192,8 +4489,8 @@ var ManageSubDaosActionForm = ({ data, onChange }) => {
|
|
|
4192
4489
|
};
|
|
4193
4490
|
|
|
4194
4491
|
// src/mantine/blocks/proposal/actions-components/forms/UpdateInfoActionForm.tsx
|
|
4195
|
-
import
|
|
4196
|
-
import { Stack as
|
|
4492
|
+
import React60 from "react";
|
|
4493
|
+
import { Stack as Stack44, TextInput as TextInput22, Textarea as Textarea10, Checkbox as Checkbox5 } from "@mantine/core";
|
|
4197
4494
|
var inputStyles16 = {
|
|
4198
4495
|
label: { color: "#adb5bd" },
|
|
4199
4496
|
input: {
|
|
@@ -4206,7 +4503,7 @@ var inputStyles16 = {
|
|
|
4206
4503
|
}
|
|
4207
4504
|
};
|
|
4208
4505
|
var UpdateInfoActionForm = ({ data, onChange }) => {
|
|
4209
|
-
return /* @__PURE__ */
|
|
4506
|
+
return /* @__PURE__ */ React60.createElement(Stack44, { gap: "md" }, /* @__PURE__ */ React60.createElement(TextInput22, { label: "DAO Name", placeholder: "My DAO", value: data.name, onChange: (e) => onChange({ ...data, name: e.currentTarget.value }), required: true, styles: inputStyles16 }), /* @__PURE__ */ React60.createElement(
|
|
4210
4507
|
Textarea10,
|
|
4211
4508
|
{
|
|
4212
4509
|
label: "Description",
|
|
@@ -4216,7 +4513,7 @@ var UpdateInfoActionForm = ({ data, onChange }) => {
|
|
|
4216
4513
|
minRows: 3,
|
|
4217
4514
|
styles: inputStyles16
|
|
4218
4515
|
}
|
|
4219
|
-
), /* @__PURE__ */
|
|
4516
|
+
), /* @__PURE__ */ React60.createElement(
|
|
4220
4517
|
TextInput22,
|
|
4221
4518
|
{
|
|
4222
4519
|
label: "Image URL (Optional)",
|
|
@@ -4225,7 +4522,7 @@ var UpdateInfoActionForm = ({ data, onChange }) => {
|
|
|
4225
4522
|
onChange: (e) => onChange({ ...data, image_url: e.currentTarget.value || null }),
|
|
4226
4523
|
styles: inputStyles16
|
|
4227
4524
|
}
|
|
4228
|
-
), /* @__PURE__ */
|
|
4525
|
+
), /* @__PURE__ */ React60.createElement(
|
|
4229
4526
|
TextInput22,
|
|
4230
4527
|
{
|
|
4231
4528
|
label: "DAO URI (Optional)",
|
|
@@ -4234,7 +4531,7 @@ var UpdateInfoActionForm = ({ data, onChange }) => {
|
|
|
4234
4531
|
onChange: (e) => onChange({ ...data, dao_uri: e.currentTarget.value || null }),
|
|
4235
4532
|
styles: inputStyles16
|
|
4236
4533
|
}
|
|
4237
|
-
), /* @__PURE__ */
|
|
4534
|
+
), /* @__PURE__ */ React60.createElement(
|
|
4238
4535
|
Checkbox5,
|
|
4239
4536
|
{
|
|
4240
4537
|
label: "Automatically add CW20 tokens",
|
|
@@ -4245,7 +4542,7 @@ var UpdateInfoActionForm = ({ data, onChange }) => {
|
|
|
4245
4542
|
input: { backgroundColor: "#2a2a2a", borderColor: "#333" }
|
|
4246
4543
|
}
|
|
4247
4544
|
}
|
|
4248
|
-
), /* @__PURE__ */
|
|
4545
|
+
), /* @__PURE__ */ React60.createElement(
|
|
4249
4546
|
Checkbox5,
|
|
4250
4547
|
{
|
|
4251
4548
|
label: "Automatically add CW721 NFTs",
|
|
@@ -4260,8 +4557,8 @@ var UpdateInfoActionForm = ({ data, onChange }) => {
|
|
|
4260
4557
|
};
|
|
4261
4558
|
|
|
4262
4559
|
// src/mantine/blocks/proposal/actions-components/forms/ManageStorageItemsActionForm.tsx
|
|
4263
|
-
import
|
|
4264
|
-
import { Stack as
|
|
4560
|
+
import React61 from "react";
|
|
4561
|
+
import { Stack as Stack45, TextInput as TextInput23, Radio as Radio3, Group as Group16, Textarea as Textarea11 } from "@mantine/core";
|
|
4265
4562
|
var inputStyles17 = {
|
|
4266
4563
|
label: { color: "#adb5bd" },
|
|
4267
4564
|
input: {
|
|
@@ -4274,7 +4571,7 @@ var inputStyles17 = {
|
|
|
4274
4571
|
}
|
|
4275
4572
|
};
|
|
4276
4573
|
var ManageStorageItemsActionForm = ({ data, onChange }) => {
|
|
4277
|
-
return /* @__PURE__ */
|
|
4574
|
+
return /* @__PURE__ */ React61.createElement(Stack45, { gap: "md" }, /* @__PURE__ */ React61.createElement(Radio3.Group, { label: "Action", value: data.setting ? "set" : "remove", onChange: (value) => onChange({ ...data, setting: value === "set" }) }, /* @__PURE__ */ React61.createElement(Group16, { mt: "xs" }, /* @__PURE__ */ React61.createElement(
|
|
4278
4575
|
Radio3,
|
|
4279
4576
|
{
|
|
4280
4577
|
value: "set",
|
|
@@ -4284,7 +4581,7 @@ var ManageStorageItemsActionForm = ({ data, onChange }) => {
|
|
|
4284
4581
|
radio: { backgroundColor: "#2a2a2a", borderColor: "#333" }
|
|
4285
4582
|
}
|
|
4286
4583
|
}
|
|
4287
|
-
), /* @__PURE__ */
|
|
4584
|
+
), /* @__PURE__ */ React61.createElement(
|
|
4288
4585
|
Radio3,
|
|
4289
4586
|
{
|
|
4290
4587
|
value: "remove",
|
|
@@ -4294,7 +4591,7 @@ var ManageStorageItemsActionForm = ({ data, onChange }) => {
|
|
|
4294
4591
|
radio: { backgroundColor: "#2a2a2a", borderColor: "#333" }
|
|
4295
4592
|
}
|
|
4296
4593
|
}
|
|
4297
|
-
))), /* @__PURE__ */
|
|
4594
|
+
))), /* @__PURE__ */ React61.createElement(TextInput23, { label: "Storage Key", placeholder: "config_key", value: data.key, onChange: (e) => onChange({ ...data, key: e.currentTarget.value }), required: true, styles: inputStyles17 }), data.setting && /* @__PURE__ */ React61.createElement(
|
|
4298
4595
|
Textarea11,
|
|
4299
4596
|
{
|
|
4300
4597
|
label: "Storage Value",
|
|
@@ -4309,8 +4606,8 @@ var ManageStorageItemsActionForm = ({ data, onChange }) => {
|
|
|
4309
4606
|
};
|
|
4310
4607
|
|
|
4311
4608
|
// src/mantine/blocks/proposal/actions-components/forms/DaoAdminExecActionForm.tsx
|
|
4312
|
-
import
|
|
4313
|
-
import { Stack as
|
|
4609
|
+
import React62, { useState as useState14 } from "react";
|
|
4610
|
+
import { Stack as Stack46, TextInput as TextInput24, Button as Button10, Group as Group17, Text as Text32, Card as Card11, Textarea as Textarea12 } from "@mantine/core";
|
|
4314
4611
|
var inputStyles18 = {
|
|
4315
4612
|
label: { color: "#adb5bd" },
|
|
4316
4613
|
input: {
|
|
@@ -4323,7 +4620,7 @@ var inputStyles18 = {
|
|
|
4323
4620
|
}
|
|
4324
4621
|
};
|
|
4325
4622
|
var DaoAdminExecActionForm = ({ data, onChange }) => {
|
|
4326
|
-
const [newMsg, setNewMsg] =
|
|
4623
|
+
const [newMsg, setNewMsg] = useState14("");
|
|
4327
4624
|
const handleAddMessage = () => {
|
|
4328
4625
|
if (newMsg) {
|
|
4329
4626
|
try {
|
|
@@ -4343,7 +4640,7 @@ var DaoAdminExecActionForm = ({ data, onChange }) => {
|
|
|
4343
4640
|
msgs: (data.msgs || []).filter((_, i) => i !== index)
|
|
4344
4641
|
});
|
|
4345
4642
|
};
|
|
4346
|
-
return /* @__PURE__ */
|
|
4643
|
+
return /* @__PURE__ */ React62.createElement(Stack46, { gap: "md" }, /* @__PURE__ */ React62.createElement(
|
|
4347
4644
|
TextInput24,
|
|
4348
4645
|
{
|
|
4349
4646
|
label: "Core Address",
|
|
@@ -4353,7 +4650,7 @@ var DaoAdminExecActionForm = ({ data, onChange }) => {
|
|
|
4353
4650
|
required: true,
|
|
4354
4651
|
styles: inputStyles18
|
|
4355
4652
|
}
|
|
4356
|
-
), /* @__PURE__ */
|
|
4653
|
+
), /* @__PURE__ */ React62.createElement(Stack46, { gap: "xs" }, /* @__PURE__ */ React62.createElement(Text32, { size: "sm", fw: 500, style: { color: "#adb5bd" } }, "Messages to Execute"), (data.msgs || []).map((msg, index) => /* @__PURE__ */ React62.createElement(Card11, { key: index, withBorder: true, padding: "xs", style: { backgroundColor: "#2a2a2a", borderColor: "#333" } }, /* @__PURE__ */ React62.createElement(Group17, { justify: "space-between" }, /* @__PURE__ */ React62.createElement(Text32, { size: "sm", style: { color: "#f1f3f5" } }, "Message ", index + 1), /* @__PURE__ */ React62.createElement(Button10, { size: "xs", variant: "subtle", onClick: () => handleRemoveMessage(index), style: { color: "#ff6b6b" } }, "Remove")), /* @__PURE__ */ React62.createElement(Text32, { size: "xs", style: { color: "#adb5bd", fontFamily: "monospace" } }, JSON.stringify(msg, null, 2).substring(0, 100), "..."))), /* @__PURE__ */ React62.createElement(
|
|
4357
4654
|
Textarea12,
|
|
4358
4655
|
{
|
|
4359
4656
|
placeholder: 'Add cosmos message as JSON:\\n{"bank": {"send": {"to_address": "ixo1...", "amount": [{"denom": "uixo", "amount": "1000"}]}}}',
|
|
@@ -4362,7 +4659,7 @@ var DaoAdminExecActionForm = ({ data, onChange }) => {
|
|
|
4362
4659
|
minRows: 4,
|
|
4363
4660
|
styles: inputStyles18
|
|
4364
4661
|
}
|
|
4365
|
-
), /* @__PURE__ */
|
|
4662
|
+
), /* @__PURE__ */ React62.createElement(
|
|
4366
4663
|
Button10,
|
|
4367
4664
|
{
|
|
4368
4665
|
size: "sm",
|
|
@@ -4377,8 +4674,8 @@ var DaoAdminExecActionForm = ({ data, onChange }) => {
|
|
|
4377
4674
|
};
|
|
4378
4675
|
|
|
4379
4676
|
// src/mantine/blocks/proposal/actions-components/forms/AcceptToMarketplaceActionForm.tsx
|
|
4380
|
-
import
|
|
4381
|
-
import { Stack as
|
|
4677
|
+
import React63 from "react";
|
|
4678
|
+
import { Stack as Stack47, TextInput as TextInput25 } from "@mantine/core";
|
|
4382
4679
|
var inputStyles19 = {
|
|
4383
4680
|
label: { color: "#adb5bd" },
|
|
4384
4681
|
input: {
|
|
@@ -4391,7 +4688,7 @@ var inputStyles19 = {
|
|
|
4391
4688
|
}
|
|
4392
4689
|
};
|
|
4393
4690
|
var AcceptToMarketplaceActionForm = ({ data, onChange }) => {
|
|
4394
|
-
return /* @__PURE__ */
|
|
4691
|
+
return /* @__PURE__ */ React63.createElement(Stack47, { gap: "md" }, /* @__PURE__ */ React63.createElement(TextInput25, { label: "DID", placeholder: "did:ixo:...", value: data.did, onChange: (e) => onChange({ ...data, did: e.currentTarget.value }), required: true, styles: inputStyles19 }), /* @__PURE__ */ React63.createElement(
|
|
4395
4692
|
TextInput25,
|
|
4396
4693
|
{
|
|
4397
4694
|
label: "Relayer Node DID",
|
|
@@ -4401,7 +4698,7 @@ var AcceptToMarketplaceActionForm = ({ data, onChange }) => {
|
|
|
4401
4698
|
required: true,
|
|
4402
4699
|
styles: inputStyles19
|
|
4403
4700
|
}
|
|
4404
|
-
), /* @__PURE__ */
|
|
4701
|
+
), /* @__PURE__ */ React63.createElement(
|
|
4405
4702
|
TextInput25,
|
|
4406
4703
|
{
|
|
4407
4704
|
label: "Relayer Node Address",
|
|
@@ -4415,8 +4712,8 @@ var AcceptToMarketplaceActionForm = ({ data, onChange }) => {
|
|
|
4415
4712
|
};
|
|
4416
4713
|
|
|
4417
4714
|
// src/mantine/blocks/proposal/actions-components/forms/CreateEntityActionForm.tsx
|
|
4418
|
-
import
|
|
4419
|
-
import { Stack as
|
|
4715
|
+
import React64 from "react";
|
|
4716
|
+
import { Stack as Stack48, Textarea as Textarea13, Alert as Alert6, Text as Text33 } from "@mantine/core";
|
|
4420
4717
|
var inputStyles20 = {
|
|
4421
4718
|
label: { color: "#adb5bd" },
|
|
4422
4719
|
input: {
|
|
@@ -4436,7 +4733,7 @@ var CreateEntityActionForm = ({ data, onChange }) => {
|
|
|
4436
4733
|
} catch {
|
|
4437
4734
|
}
|
|
4438
4735
|
};
|
|
4439
|
-
return /* @__PURE__ */
|
|
4736
|
+
return /* @__PURE__ */ React64.createElement(Stack48, { gap: "md" }, /* @__PURE__ */ React64.createElement(Alert6, { color: "blue", style: { backgroundColor: "#2a2a2a", borderColor: "#4dabf7" } }, /* @__PURE__ */ React64.createElement(Text33, { size: "sm", style: { color: "#4dabf7" } }, "This is a complex entity creation action. Please provide the complete entity data as JSON.")), /* @__PURE__ */ React64.createElement(
|
|
4440
4737
|
Textarea13,
|
|
4441
4738
|
{
|
|
4442
4739
|
label: "Entity Data (JSON)",
|
|
@@ -4451,8 +4748,8 @@ var CreateEntityActionForm = ({ data, onChange }) => {
|
|
|
4451
4748
|
};
|
|
4452
4749
|
|
|
4453
4750
|
// src/mantine/blocks/proposal/actions-components/forms/UpdateVotingConfigActionForm.tsx
|
|
4454
|
-
import
|
|
4455
|
-
import { Stack as
|
|
4751
|
+
import React65 from "react";
|
|
4752
|
+
import { Stack as Stack49, Checkbox as Checkbox6, Select as Select5, NumberInput as NumberInput7, Group as Group18 } from "@mantine/core";
|
|
4456
4753
|
var inputStyles21 = {
|
|
4457
4754
|
label: { color: "#adb5bd" },
|
|
4458
4755
|
input: {
|
|
@@ -4465,7 +4762,7 @@ var inputStyles21 = {
|
|
|
4465
4762
|
}
|
|
4466
4763
|
};
|
|
4467
4764
|
var UpdateVotingConfigActionForm = ({ data, onChange }) => {
|
|
4468
|
-
return /* @__PURE__ */
|
|
4765
|
+
return /* @__PURE__ */ React65.createElement(Stack49, { gap: "md" }, /* @__PURE__ */ React65.createElement(
|
|
4469
4766
|
Checkbox6,
|
|
4470
4767
|
{
|
|
4471
4768
|
label: "Only members can execute",
|
|
@@ -4476,7 +4773,7 @@ var UpdateVotingConfigActionForm = ({ data, onChange }) => {
|
|
|
4476
4773
|
input: { backgroundColor: "#2a2a2a", borderColor: "#333" }
|
|
4477
4774
|
}
|
|
4478
4775
|
}
|
|
4479
|
-
), /* @__PURE__ */
|
|
4776
|
+
), /* @__PURE__ */ React65.createElement(
|
|
4480
4777
|
Select5,
|
|
4481
4778
|
{
|
|
4482
4779
|
label: "Threshold Type",
|
|
@@ -4488,7 +4785,7 @@ var UpdateVotingConfigActionForm = ({ data, onChange }) => {
|
|
|
4488
4785
|
],
|
|
4489
4786
|
styles: inputStyles21
|
|
4490
4787
|
}
|
|
4491
|
-
), data.thresholdType === "%" && /* @__PURE__ */
|
|
4788
|
+
), data.thresholdType === "%" && /* @__PURE__ */ React65.createElement(
|
|
4492
4789
|
NumberInput7,
|
|
4493
4790
|
{
|
|
4494
4791
|
label: "Threshold Percentage",
|
|
@@ -4500,7 +4797,7 @@ var UpdateVotingConfigActionForm = ({ data, onChange }) => {
|
|
|
4500
4797
|
suffix: "%",
|
|
4501
4798
|
styles: inputStyles21
|
|
4502
4799
|
}
|
|
4503
|
-
), /* @__PURE__ */
|
|
4800
|
+
), /* @__PURE__ */ React65.createElement(
|
|
4504
4801
|
Checkbox6,
|
|
4505
4802
|
{
|
|
4506
4803
|
label: "Enable Quorum",
|
|
@@ -4511,7 +4808,7 @@ var UpdateVotingConfigActionForm = ({ data, onChange }) => {
|
|
|
4511
4808
|
input: { backgroundColor: "#2a2a2a", borderColor: "#333" }
|
|
4512
4809
|
}
|
|
4513
4810
|
}
|
|
4514
|
-
), data.quorumEnabled && /* @__PURE__ */
|
|
4811
|
+
), data.quorumEnabled && /* @__PURE__ */ React65.createElement(React65.Fragment, null, /* @__PURE__ */ React65.createElement(
|
|
4515
4812
|
Select5,
|
|
4516
4813
|
{
|
|
4517
4814
|
label: "Quorum Type",
|
|
@@ -4523,7 +4820,7 @@ var UpdateVotingConfigActionForm = ({ data, onChange }) => {
|
|
|
4523
4820
|
],
|
|
4524
4821
|
styles: inputStyles21
|
|
4525
4822
|
}
|
|
4526
|
-
), data.quorumType === "%" && /* @__PURE__ */
|
|
4823
|
+
), data.quorumType === "%" && /* @__PURE__ */ React65.createElement(
|
|
4527
4824
|
NumberInput7,
|
|
4528
4825
|
{
|
|
4529
4826
|
label: "Quorum Percentage",
|
|
@@ -4535,7 +4832,7 @@ var UpdateVotingConfigActionForm = ({ data, onChange }) => {
|
|
|
4535
4832
|
suffix: "%",
|
|
4536
4833
|
styles: inputStyles21
|
|
4537
4834
|
}
|
|
4538
|
-
)), /* @__PURE__ */
|
|
4835
|
+
)), /* @__PURE__ */ React65.createElement(Group18, { grow: true }, /* @__PURE__ */ React65.createElement(
|
|
4539
4836
|
NumberInput7,
|
|
4540
4837
|
{
|
|
4541
4838
|
label: "Proposal Duration",
|
|
@@ -4545,7 +4842,7 @@ var UpdateVotingConfigActionForm = ({ data, onChange }) => {
|
|
|
4545
4842
|
min: 1,
|
|
4546
4843
|
styles: inputStyles21
|
|
4547
4844
|
}
|
|
4548
|
-
), /* @__PURE__ */
|
|
4845
|
+
), /* @__PURE__ */ React65.createElement(
|
|
4549
4846
|
Select5,
|
|
4550
4847
|
{
|
|
4551
4848
|
label: "Duration Units",
|
|
@@ -4559,7 +4856,7 @@ var UpdateVotingConfigActionForm = ({ data, onChange }) => {
|
|
|
4559
4856
|
],
|
|
4560
4857
|
styles: inputStyles21
|
|
4561
4858
|
}
|
|
4562
|
-
)), /* @__PURE__ */
|
|
4859
|
+
)), /* @__PURE__ */ React65.createElement(
|
|
4563
4860
|
Checkbox6,
|
|
4564
4861
|
{
|
|
4565
4862
|
label: "Allow revoting",
|
|
@@ -4574,8 +4871,8 @@ var UpdateVotingConfigActionForm = ({ data, onChange }) => {
|
|
|
4574
4871
|
};
|
|
4575
4872
|
|
|
4576
4873
|
// src/mantine/blocks/proposal/actions-components/forms/UpdatePreProposeConfigActionForm.tsx
|
|
4577
|
-
import
|
|
4578
|
-
import { Stack as
|
|
4874
|
+
import React66 from "react";
|
|
4875
|
+
import { Stack as Stack50, Checkbox as Checkbox7, TextInput as TextInput26, Select as Select6, Textarea as Textarea14 } from "@mantine/core";
|
|
4579
4876
|
var inputStyles22 = {
|
|
4580
4877
|
label: { color: "#adb5bd" },
|
|
4581
4878
|
input: {
|
|
@@ -4588,7 +4885,7 @@ var inputStyles22 = {
|
|
|
4588
4885
|
}
|
|
4589
4886
|
};
|
|
4590
4887
|
var UpdatePreProposeConfigActionForm = ({ data, onChange }) => {
|
|
4591
|
-
return /* @__PURE__ */
|
|
4888
|
+
return /* @__PURE__ */ React66.createElement(Stack50, { gap: "md" }, /* @__PURE__ */ React66.createElement(
|
|
4592
4889
|
Checkbox7,
|
|
4593
4890
|
{
|
|
4594
4891
|
label: "Anyone can propose",
|
|
@@ -4599,7 +4896,7 @@ var UpdatePreProposeConfigActionForm = ({ data, onChange }) => {
|
|
|
4599
4896
|
input: { backgroundColor: "#2a2a2a", borderColor: "#333" }
|
|
4600
4897
|
}
|
|
4601
4898
|
}
|
|
4602
|
-
), /* @__PURE__ */
|
|
4899
|
+
), /* @__PURE__ */ React66.createElement(
|
|
4603
4900
|
Checkbox7,
|
|
4604
4901
|
{
|
|
4605
4902
|
label: "Deposit required",
|
|
@@ -4610,7 +4907,7 @@ var UpdatePreProposeConfigActionForm = ({ data, onChange }) => {
|
|
|
4610
4907
|
input: { backgroundColor: "#2a2a2a", borderColor: "#333" }
|
|
4611
4908
|
}
|
|
4612
4909
|
}
|
|
4613
|
-
), data.depositRequired && /* @__PURE__ */
|
|
4910
|
+
), data.depositRequired && /* @__PURE__ */ React66.createElement(React66.Fragment, null, /* @__PURE__ */ React66.createElement(
|
|
4614
4911
|
TextInput26,
|
|
4615
4912
|
{
|
|
4616
4913
|
label: "Deposit Amount",
|
|
@@ -4623,7 +4920,7 @@ var UpdatePreProposeConfigActionForm = ({ data, onChange }) => {
|
|
|
4623
4920
|
required: true,
|
|
4624
4921
|
styles: inputStyles22
|
|
4625
4922
|
}
|
|
4626
|
-
), /* @__PURE__ */
|
|
4923
|
+
), /* @__PURE__ */ React66.createElement(
|
|
4627
4924
|
Select6,
|
|
4628
4925
|
{
|
|
4629
4926
|
label: "Deposit Type",
|
|
@@ -4639,7 +4936,7 @@ var UpdatePreProposeConfigActionForm = ({ data, onChange }) => {
|
|
|
4639
4936
|
],
|
|
4640
4937
|
styles: inputStyles22
|
|
4641
4938
|
}
|
|
4642
|
-
), /* @__PURE__ */
|
|
4939
|
+
), /* @__PURE__ */ React66.createElement(
|
|
4643
4940
|
TextInput26,
|
|
4644
4941
|
{
|
|
4645
4942
|
label: "Token Denomination or Address",
|
|
@@ -4652,7 +4949,7 @@ var UpdatePreProposeConfigActionForm = ({ data, onChange }) => {
|
|
|
4652
4949
|
required: true,
|
|
4653
4950
|
styles: inputStyles22
|
|
4654
4951
|
}
|
|
4655
|
-
), /* @__PURE__ */
|
|
4952
|
+
), /* @__PURE__ */ React66.createElement(
|
|
4656
4953
|
TextInput26,
|
|
4657
4954
|
{
|
|
4658
4955
|
label: "Refund Policy",
|
|
@@ -4665,7 +4962,7 @@ var UpdatePreProposeConfigActionForm = ({ data, onChange }) => {
|
|
|
4665
4962
|
required: true,
|
|
4666
4963
|
styles: inputStyles22
|
|
4667
4964
|
}
|
|
4668
|
-
), data.depositInfo.type !== "native" && /* @__PURE__ */
|
|
4965
|
+
), data.depositInfo.type !== "native" && /* @__PURE__ */ React66.createElement(
|
|
4669
4966
|
Textarea14,
|
|
4670
4967
|
{
|
|
4671
4968
|
label: "Token Configuration (JSON)",
|
|
@@ -4688,8 +4985,8 @@ var UpdatePreProposeConfigActionForm = ({ data, onChange }) => {
|
|
|
4688
4985
|
};
|
|
4689
4986
|
|
|
4690
4987
|
// src/mantine/blocks/proposal/actions-components/forms/GovernanceVoteActionForm.tsx
|
|
4691
|
-
import
|
|
4692
|
-
import { Stack as
|
|
4988
|
+
import React67 from "react";
|
|
4989
|
+
import { Stack as Stack51, TextInput as TextInput27, Select as Select7 } from "@mantine/core";
|
|
4693
4990
|
var inputStyles23 = {
|
|
4694
4991
|
label: { color: "#adb5bd" },
|
|
4695
4992
|
input: {
|
|
@@ -4708,7 +5005,7 @@ var GovernanceVoteActionForm = ({ data, onChange }) => {
|
|
|
4708
5005
|
{ value: "3", label: "No" },
|
|
4709
5006
|
{ value: "4", label: "No with Veto" }
|
|
4710
5007
|
];
|
|
4711
|
-
return /* @__PURE__ */
|
|
5008
|
+
return /* @__PURE__ */ React67.createElement(Stack51, { gap: "md" }, /* @__PURE__ */ React67.createElement(
|
|
4712
5009
|
TextInput27,
|
|
4713
5010
|
{
|
|
4714
5011
|
label: "Proposal ID",
|
|
@@ -4718,7 +5015,7 @@ var GovernanceVoteActionForm = ({ data, onChange }) => {
|
|
|
4718
5015
|
required: true,
|
|
4719
5016
|
styles: inputStyles23
|
|
4720
5017
|
}
|
|
4721
|
-
), /* @__PURE__ */
|
|
5018
|
+
), /* @__PURE__ */ React67.createElement(
|
|
4722
5019
|
Select7,
|
|
4723
5020
|
{
|
|
4724
5021
|
label: "Vote Option",
|
|
@@ -4732,8 +5029,8 @@ var GovernanceVoteActionForm = ({ data, onChange }) => {
|
|
|
4732
5029
|
};
|
|
4733
5030
|
|
|
4734
5031
|
// src/mantine/blocks/proposal/actions-components/forms/WithdrawTokenSwapActionForm.tsx
|
|
4735
|
-
import
|
|
4736
|
-
import { Stack as
|
|
5032
|
+
import React68 from "react";
|
|
5033
|
+
import { Stack as Stack52, TextInput as TextInput28, Checkbox as Checkbox8 } from "@mantine/core";
|
|
4737
5034
|
var inputStyles24 = {
|
|
4738
5035
|
label: { color: "#adb5bd" },
|
|
4739
5036
|
input: {
|
|
@@ -4746,7 +5043,7 @@ var inputStyles24 = {
|
|
|
4746
5043
|
}
|
|
4747
5044
|
};
|
|
4748
5045
|
var WithdrawTokenSwapActionForm = ({ data, onChange }) => {
|
|
4749
|
-
return /* @__PURE__ */
|
|
5046
|
+
return /* @__PURE__ */ React68.createElement(Stack52, { gap: "md" }, /* @__PURE__ */ React68.createElement(
|
|
4750
5047
|
Checkbox8,
|
|
4751
5048
|
{
|
|
4752
5049
|
label: "Contract chosen",
|
|
@@ -4757,7 +5054,7 @@ var WithdrawTokenSwapActionForm = ({ data, onChange }) => {
|
|
|
4757
5054
|
input: { backgroundColor: "#2a2a2a", borderColor: "#333" }
|
|
4758
5055
|
}
|
|
4759
5056
|
}
|
|
4760
|
-
), data.contractChosen && /* @__PURE__ */
|
|
5057
|
+
), data.contractChosen && /* @__PURE__ */ React68.createElement(
|
|
4761
5058
|
TextInput28,
|
|
4762
5059
|
{
|
|
4763
5060
|
label: "Token Swap Contract Address",
|
|
@@ -4771,8 +5068,8 @@ var WithdrawTokenSwapActionForm = ({ data, onChange }) => {
|
|
|
4771
5068
|
};
|
|
4772
5069
|
|
|
4773
5070
|
// src/mantine/blocks/proposal/actions-components/forms/PerformTokenSwapActionForm.tsx
|
|
4774
|
-
import
|
|
4775
|
-
import { Stack as
|
|
5071
|
+
import React69 from "react";
|
|
5072
|
+
import { Stack as Stack53, TextInput as TextInput29, Checkbox as Checkbox9, Textarea as Textarea15 } from "@mantine/core";
|
|
4776
5073
|
var inputStyles25 = {
|
|
4777
5074
|
label: { color: "#adb5bd" },
|
|
4778
5075
|
input: {
|
|
@@ -4785,7 +5082,7 @@ var inputStyles25 = {
|
|
|
4785
5082
|
}
|
|
4786
5083
|
};
|
|
4787
5084
|
var PerformTokenSwapActionForm = ({ data, onChange }) => {
|
|
4788
|
-
return /* @__PURE__ */
|
|
5085
|
+
return /* @__PURE__ */ React69.createElement(Stack53, { gap: "md" }, /* @__PURE__ */ React69.createElement(
|
|
4789
5086
|
Checkbox9,
|
|
4790
5087
|
{
|
|
4791
5088
|
label: "Contract chosen",
|
|
@@ -4796,7 +5093,7 @@ var PerformTokenSwapActionForm = ({ data, onChange }) => {
|
|
|
4796
5093
|
input: { backgroundColor: "#2a2a2a", borderColor: "#333" }
|
|
4797
5094
|
}
|
|
4798
5095
|
}
|
|
4799
|
-
), data.contractChosen && /* @__PURE__ */
|
|
5096
|
+
), data.contractChosen && /* @__PURE__ */ React69.createElement(React69.Fragment, null, /* @__PURE__ */ React69.createElement(
|
|
4800
5097
|
TextInput29,
|
|
4801
5098
|
{
|
|
4802
5099
|
label: "Token Swap Contract Address",
|
|
@@ -4806,7 +5103,7 @@ var PerformTokenSwapActionForm = ({ data, onChange }) => {
|
|
|
4806
5103
|
required: true,
|
|
4807
5104
|
styles: inputStyles25
|
|
4808
5105
|
}
|
|
4809
|
-
), /* @__PURE__ */
|
|
5106
|
+
), /* @__PURE__ */ React69.createElement(
|
|
4810
5107
|
Textarea15,
|
|
4811
5108
|
{
|
|
4812
5109
|
label: "Self Party Information (JSON)",
|
|
@@ -4822,7 +5119,7 @@ var PerformTokenSwapActionForm = ({ data, onChange }) => {
|
|
|
4822
5119
|
minRows: 4,
|
|
4823
5120
|
styles: inputStyles25
|
|
4824
5121
|
}
|
|
4825
|
-
), /* @__PURE__ */
|
|
5122
|
+
), /* @__PURE__ */ React69.createElement(
|
|
4826
5123
|
Textarea15,
|
|
4827
5124
|
{
|
|
4828
5125
|
label: "Counterparty Information (JSON)",
|
|
@@ -4842,8 +5139,8 @@ var PerformTokenSwapActionForm = ({ data, onChange }) => {
|
|
|
4842
5139
|
};
|
|
4843
5140
|
|
|
4844
5141
|
// src/mantine/blocks/proposal/actions-components/forms/StakeToGroupActionForm.tsx
|
|
4845
|
-
import
|
|
4846
|
-
import { Stack as
|
|
5142
|
+
import React70 from "react";
|
|
5143
|
+
import { Stack as Stack54, TextInput as TextInput30 } from "@mantine/core";
|
|
4847
5144
|
var inputStyles26 = {
|
|
4848
5145
|
label: { color: "#adb5bd" },
|
|
4849
5146
|
input: {
|
|
@@ -4856,7 +5153,7 @@ var inputStyles26 = {
|
|
|
4856
5153
|
}
|
|
4857
5154
|
};
|
|
4858
5155
|
var StakeToGroupActionForm = ({ data, onChange }) => {
|
|
4859
|
-
return /* @__PURE__ */
|
|
5156
|
+
return /* @__PURE__ */ React70.createElement(Stack54, { gap: "md" }, /* @__PURE__ */ React70.createElement(
|
|
4860
5157
|
TextInput30,
|
|
4861
5158
|
{
|
|
4862
5159
|
label: "Token Contract Address",
|
|
@@ -4866,7 +5163,7 @@ var StakeToGroupActionForm = ({ data, onChange }) => {
|
|
|
4866
5163
|
required: true,
|
|
4867
5164
|
styles: inputStyles26
|
|
4868
5165
|
}
|
|
4869
|
-
), /* @__PURE__ */
|
|
5166
|
+
), /* @__PURE__ */ React70.createElement(
|
|
4870
5167
|
TextInput30,
|
|
4871
5168
|
{
|
|
4872
5169
|
label: "Staking Contract Address",
|
|
@@ -4876,12 +5173,12 @@ var StakeToGroupActionForm = ({ data, onChange }) => {
|
|
|
4876
5173
|
required: true,
|
|
4877
5174
|
styles: inputStyles26
|
|
4878
5175
|
}
|
|
4879
|
-
), /* @__PURE__ */
|
|
5176
|
+
), /* @__PURE__ */ React70.createElement(TextInput30, { label: "Amount", placeholder: "1000", value: data.amount, onChange: (e) => onChange({ ...data, amount: e.currentTarget.value }), required: true, styles: inputStyles26 }));
|
|
4880
5177
|
};
|
|
4881
5178
|
|
|
4882
5179
|
// src/mantine/blocks/proposal/actions-components/forms/SendGroupTokenActionForm.tsx
|
|
4883
|
-
import
|
|
4884
|
-
import { Stack as
|
|
5180
|
+
import React71 from "react";
|
|
5181
|
+
import { Stack as Stack55, TextInput as TextInput31 } from "@mantine/core";
|
|
4885
5182
|
var inputStyles27 = {
|
|
4886
5183
|
label: { color: "#adb5bd" },
|
|
4887
5184
|
input: {
|
|
@@ -4894,7 +5191,7 @@ var inputStyles27 = {
|
|
|
4894
5191
|
}
|
|
4895
5192
|
};
|
|
4896
5193
|
var SendGroupTokenActionForm = ({ data, onChange }) => {
|
|
4897
|
-
return /* @__PURE__ */
|
|
5194
|
+
return /* @__PURE__ */ React71.createElement(Stack55, { gap: "md" }, /* @__PURE__ */ React71.createElement(
|
|
4898
5195
|
TextInput31,
|
|
4899
5196
|
{
|
|
4900
5197
|
label: "Contract Address",
|
|
@@ -4904,7 +5201,7 @@ var SendGroupTokenActionForm = ({ data, onChange }) => {
|
|
|
4904
5201
|
required: true,
|
|
4905
5202
|
styles: inputStyles27
|
|
4906
5203
|
}
|
|
4907
|
-
), /* @__PURE__ */
|
|
5204
|
+
), /* @__PURE__ */ React71.createElement(
|
|
4908
5205
|
TextInput31,
|
|
4909
5206
|
{
|
|
4910
5207
|
label: "Recipient Address",
|
|
@@ -4914,12 +5211,12 @@ var SendGroupTokenActionForm = ({ data, onChange }) => {
|
|
|
4914
5211
|
required: true,
|
|
4915
5212
|
styles: inputStyles27
|
|
4916
5213
|
}
|
|
4917
|
-
), /* @__PURE__ */
|
|
5214
|
+
), /* @__PURE__ */ React71.createElement(TextInput31, { label: "Amount", placeholder: "1000", value: data.amount, onChange: (e) => onChange({ ...data, amount: e.currentTarget.value }), required: true, styles: inputStyles27 }));
|
|
4918
5215
|
};
|
|
4919
5216
|
|
|
4920
5217
|
// src/mantine/blocks/proposal/actions-components/forms/ValidatorActionsActionForm.tsx
|
|
4921
|
-
import
|
|
4922
|
-
import { Stack as
|
|
5218
|
+
import React72 from "react";
|
|
5219
|
+
import { Stack as Stack56, Select as Select8, Textarea as Textarea16 } from "@mantine/core";
|
|
4923
5220
|
var inputStyles28 = {
|
|
4924
5221
|
label: { color: "#adb5bd" },
|
|
4925
5222
|
input: {
|
|
@@ -4938,7 +5235,7 @@ var ValidatorActionsActionForm = ({ data, onChange }) => {
|
|
|
4938
5235
|
{ value: "/cosmos.slashing.v1beta1.MsgUnjail" /* UnjailValidator */, label: "Unjail Validator" },
|
|
4939
5236
|
{ value: "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission" /* WithdrawValidatorCommission */, label: "Withdraw Commission" }
|
|
4940
5237
|
];
|
|
4941
|
-
return /* @__PURE__ */
|
|
5238
|
+
return /* @__PURE__ */ React72.createElement(Stack56, { gap: "md" }, /* @__PURE__ */ React72.createElement(
|
|
4942
5239
|
Select8,
|
|
4943
5240
|
{
|
|
4944
5241
|
label: "Validator Action Type",
|
|
@@ -4948,7 +5245,7 @@ var ValidatorActionsActionForm = ({ data, onChange }) => {
|
|
|
4948
5245
|
required: true,
|
|
4949
5246
|
styles: inputStyles28
|
|
4950
5247
|
}
|
|
4951
|
-
), data.validatorActionType === "/cosmos.staking.v1beta1.MsgCreateValidator" /* CreateValidator */ && /* @__PURE__ */
|
|
5248
|
+
), data.validatorActionType === "/cosmos.staking.v1beta1.MsgCreateValidator" /* CreateValidator */ && /* @__PURE__ */ React72.createElement(
|
|
4952
5249
|
Textarea16,
|
|
4953
5250
|
{
|
|
4954
5251
|
label: "Create Validator Message (JSON)",
|
|
@@ -4959,7 +5256,7 @@ var ValidatorActionsActionForm = ({ data, onChange }) => {
|
|
|
4959
5256
|
required: true,
|
|
4960
5257
|
styles: inputStyles28
|
|
4961
5258
|
}
|
|
4962
|
-
), data.validatorActionType === "/cosmos.staking.v1beta1.MsgEditValidator" /* EditValidator */ && /* @__PURE__ */
|
|
5259
|
+
), data.validatorActionType === "/cosmos.staking.v1beta1.MsgEditValidator" /* EditValidator */ && /* @__PURE__ */ React72.createElement(
|
|
4963
5260
|
Textarea16,
|
|
4964
5261
|
{
|
|
4965
5262
|
label: "Edit Validator Message (JSON)",
|
|
@@ -5631,8 +5928,8 @@ var ActionsPanel = ({ actions, editingIndex, onSave, onCancel, isTemplateMode =
|
|
|
5631
5928
|
const isEditing = editingIndex !== null;
|
|
5632
5929
|
const editingAction = isEditing ? actions[editingIndex] : null;
|
|
5633
5930
|
const initialActionType = editingAction?.type || "Spend";
|
|
5634
|
-
const [selectedActionType, setSelectedActionType] =
|
|
5635
|
-
const [actionData, setActionData] =
|
|
5931
|
+
const [selectedActionType, setSelectedActionType] = useState15(initialActionType);
|
|
5932
|
+
const [actionData, setActionData] = useState15(() => {
|
|
5636
5933
|
if (editingAction) {
|
|
5637
5934
|
return editingAction.data;
|
|
5638
5935
|
}
|
|
@@ -5640,8 +5937,8 @@ var ActionsPanel = ({ actions, editingIndex, onSave, onCancel, isTemplateMode =
|
|
|
5640
5937
|
return config?.getDefaultData() || {};
|
|
5641
5938
|
});
|
|
5642
5939
|
const currentActionConfig = getActionConfig(selectedActionType);
|
|
5643
|
-
const categorizedActions =
|
|
5644
|
-
|
|
5940
|
+
const categorizedActions = useMemo9(() => getCategorizedActions(), []);
|
|
5941
|
+
useEffect10(() => {
|
|
5645
5942
|
if (!isEditing) {
|
|
5646
5943
|
const config = getActionConfig(selectedActionType);
|
|
5647
5944
|
if (config) {
|
|
@@ -5664,10 +5961,10 @@ var ActionsPanel = ({ actions, editingIndex, onSave, onCancel, isTemplateMode =
|
|
|
5664
5961
|
};
|
|
5665
5962
|
const renderActionForm = () => {
|
|
5666
5963
|
if (!currentActionConfig) {
|
|
5667
|
-
return /* @__PURE__ */
|
|
5964
|
+
return /* @__PURE__ */ React73.createElement(Alert7, { color: "red", style: { backgroundColor: "#2a2a2a", borderColor: "#ff6b6b" } }, /* @__PURE__ */ React73.createElement(Text34, { size: "sm", style: { color: "#ff6b6b" } }, "Unknown action type selected"));
|
|
5668
5965
|
}
|
|
5669
5966
|
const FormComponent = currentActionConfig.FormComponent;
|
|
5670
|
-
return /* @__PURE__ */
|
|
5967
|
+
return /* @__PURE__ */ React73.createElement(FormComponent, { data: actionData, onChange: setActionData, isTemplateMode });
|
|
5671
5968
|
};
|
|
5672
5969
|
const getCategoryColor = (category) => {
|
|
5673
5970
|
const colors = {
|
|
@@ -5682,7 +5979,7 @@ var ActionsPanel = ({ actions, editingIndex, onSave, onCancel, isTemplateMode =
|
|
|
5682
5979
|
};
|
|
5683
5980
|
return colors[category] || "#6b7280";
|
|
5684
5981
|
};
|
|
5685
|
-
return /* @__PURE__ */
|
|
5982
|
+
return /* @__PURE__ */ React73.createElement(Stack57, { style: { backgroundColor: "#1a1a1a", color: "#f1f3f5", height: "100%" } }, /* @__PURE__ */ React73.createElement(Text34, { size: "lg", fw: 600, style: { color: "#f1f3f5" } }, isEditing ? "Edit Action" : "Add New Action"), !isEditing ? /* @__PURE__ */ React73.createElement(Stack57, { gap: "md" }, /* @__PURE__ */ React73.createElement(Text34, { size: "sm", fw: 500, style: { color: "#adb5bd" } }, "Select Action Type"), /* @__PURE__ */ React73.createElement(
|
|
5686
5983
|
Tabs2,
|
|
5687
5984
|
{
|
|
5688
5985
|
defaultValue: ACTION_CATEGORIES[0].id,
|
|
@@ -5703,9 +6000,9 @@ var ActionsPanel = ({ actions, editingIndex, onSave, onCancel, isTemplateMode =
|
|
|
5703
6000
|
panel: { paddingTop: "md" }
|
|
5704
6001
|
}
|
|
5705
6002
|
},
|
|
5706
|
-
/* @__PURE__ */
|
|
5707
|
-
ACTION_CATEGORIES.map((category) => /* @__PURE__ */
|
|
5708
|
-
|
|
6003
|
+
/* @__PURE__ */ React73.createElement(Tabs2.List, null, ACTION_CATEGORIES.map((category) => /* @__PURE__ */ React73.createElement(Tabs2.Tab, { key: category.id, value: category.id }, /* @__PURE__ */ React73.createElement(Group19, { gap: "xs" }, /* @__PURE__ */ React73.createElement("span", null, category.icon), /* @__PURE__ */ React73.createElement("span", null, category.label))))),
|
|
6004
|
+
ACTION_CATEGORIES.map((category) => /* @__PURE__ */ React73.createElement(Tabs2.Panel, { key: category.id, value: category.id }, /* @__PURE__ */ React73.createElement(SimpleGrid, { cols: 2, spacing: "xs" }, (categorizedActions.get(category.id) || []).map((config) => /* @__PURE__ */ React73.createElement(
|
|
6005
|
+
Paper5,
|
|
5709
6006
|
{
|
|
5710
6007
|
key: config.value,
|
|
5711
6008
|
withBorder: true,
|
|
@@ -5718,9 +6015,9 @@ var ActionsPanel = ({ actions, editingIndex, onSave, onCancel, isTemplateMode =
|
|
|
5718
6015
|
},
|
|
5719
6016
|
onClick: () => setSelectedActionType(config.value)
|
|
5720
6017
|
},
|
|
5721
|
-
/* @__PURE__ */
|
|
6018
|
+
/* @__PURE__ */ React73.createElement(Stack57, { gap: "xs" }, /* @__PURE__ */ React73.createElement(Group19, { justify: "space-between" }, /* @__PURE__ */ React73.createElement(Text34, { size: "sm", fw: 500, style: { color: "#f1f3f5" } }, config.label), selectedActionType === config.value && /* @__PURE__ */ React73.createElement(Badge8, { size: "xs", style: { backgroundColor: "#4dabf7" } }, "Selected")), config.description && /* @__PURE__ */ React73.createElement(Text34, { size: "xs", style: { color: "#adb5bd" } }, config.description))
|
|
5722
6019
|
)))))
|
|
5723
|
-
)) : /* @__PURE__ */
|
|
6020
|
+
)) : /* @__PURE__ */ React73.createElement(
|
|
5724
6021
|
Card12,
|
|
5725
6022
|
{
|
|
5726
6023
|
withBorder: true,
|
|
@@ -5730,7 +6027,7 @@ var ActionsPanel = ({ actions, editingIndex, onSave, onCancel, isTemplateMode =
|
|
|
5730
6027
|
borderColor: "#333"
|
|
5731
6028
|
}
|
|
5732
6029
|
},
|
|
5733
|
-
/* @__PURE__ */
|
|
6030
|
+
/* @__PURE__ */ React73.createElement(Group19, { justify: "space-between" }, /* @__PURE__ */ React73.createElement(Group19, { gap: "xs" }, /* @__PURE__ */ React73.createElement(
|
|
5734
6031
|
Badge8,
|
|
5735
6032
|
{
|
|
5736
6033
|
size: "sm",
|
|
@@ -5740,10 +6037,10 @@ var ActionsPanel = ({ actions, editingIndex, onSave, onCancel, isTemplateMode =
|
|
|
5740
6037
|
}
|
|
5741
6038
|
},
|
|
5742
6039
|
currentActionConfig?.label || selectedActionType
|
|
5743
|
-
), /* @__PURE__ */
|
|
5744
|
-
), /* @__PURE__ */
|
|
6040
|
+
), /* @__PURE__ */ React73.createElement(Text34, { size: "sm", style: { color: "#adb5bd" } }, "(Editing)")))
|
|
6041
|
+
), /* @__PURE__ */ React73.createElement(Divider4, { color: "#333" }), /* @__PURE__ */ React73.createElement(ScrollArea3, { style: { flex: 1 } }, renderActionForm()), /* @__PURE__ */ React73.createElement(Divider4, { color: "#333" }), /* @__PURE__ */ React73.createElement(Stack57, { gap: "xs" }, /* @__PURE__ */ React73.createElement(Text34, { size: "sm", fw: 500, style: { color: "#adb5bd" } }, "Current Actions (", actions.length, ")"), /* @__PURE__ */ React73.createElement(ScrollArea3, { h: 100 }, /* @__PURE__ */ React73.createElement(Stack57, { gap: "xs" }, actions.map((action, index) => {
|
|
5745
6042
|
const config = getActionConfig(action.type);
|
|
5746
|
-
return /* @__PURE__ */
|
|
6043
|
+
return /* @__PURE__ */ React73.createElement(
|
|
5747
6044
|
Card12,
|
|
5748
6045
|
{
|
|
5749
6046
|
key: index,
|
|
@@ -5756,7 +6053,7 @@ var ActionsPanel = ({ actions, editingIndex, onSave, onCancel, isTemplateMode =
|
|
|
5756
6053
|
opacity: index === editingIndex ? 0.7 : 1
|
|
5757
6054
|
}
|
|
5758
6055
|
},
|
|
5759
|
-
/* @__PURE__ */
|
|
6056
|
+
/* @__PURE__ */ React73.createElement(Group19, { gap: "xs" }, /* @__PURE__ */ React73.createElement(
|
|
5760
6057
|
Badge8,
|
|
5761
6058
|
{
|
|
5762
6059
|
size: "sm",
|
|
@@ -5766,9 +6063,9 @@ var ActionsPanel = ({ actions, editingIndex, onSave, onCancel, isTemplateMode =
|
|
|
5766
6063
|
}
|
|
5767
6064
|
},
|
|
5768
6065
|
config?.label || action.type
|
|
5769
|
-
), /* @__PURE__ */
|
|
6066
|
+
), /* @__PURE__ */ React73.createElement(Text34, { size: "sm", style: { color: "#adb5bd" } }, config?.getSummary(action.data) || "Action"), index === editingIndex && /* @__PURE__ */ React73.createElement(Badge8, { size: "xs", style: { backgroundColor: "#4dabf7", color: "#fff" } }, "Editing"))
|
|
5770
6067
|
);
|
|
5771
|
-
})))), /* @__PURE__ */
|
|
6068
|
+
})))), /* @__PURE__ */ React73.createElement(Group19, { justify: "flex-end", mt: "md" }, /* @__PURE__ */ React73.createElement(
|
|
5772
6069
|
Button11,
|
|
5773
6070
|
{
|
|
5774
6071
|
variant: "default",
|
|
@@ -5783,7 +6080,7 @@ var ActionsPanel = ({ actions, editingIndex, onSave, onCancel, isTemplateMode =
|
|
|
5783
6080
|
}
|
|
5784
6081
|
},
|
|
5785
6082
|
"Cancel"
|
|
5786
|
-
), /* @__PURE__ */
|
|
6083
|
+
), /* @__PURE__ */ React73.createElement(
|
|
5787
6084
|
Button11,
|
|
5788
6085
|
{
|
|
5789
6086
|
onClick: handleSave,
|
|
@@ -5805,8 +6102,8 @@ var ActionsPanel = ({ actions, editingIndex, onSave, onCancel, isTemplateMode =
|
|
|
5805
6102
|
|
|
5806
6103
|
// src/mantine/blocks/proposal/template/ActionsTab.tsx
|
|
5807
6104
|
var ActionsTab = ({ actions, onActionsChange, editor, block }) => {
|
|
5808
|
-
const [isEditorVisible, setIsEditorVisible] =
|
|
5809
|
-
const [editingIndex, setEditingIndex] =
|
|
6105
|
+
const [isEditorVisible, setIsEditorVisible] = useState16(false);
|
|
6106
|
+
const [editingIndex, setEditingIndex] = useState16(null);
|
|
5810
6107
|
const parseActions = (actionsJson) => {
|
|
5811
6108
|
if (!actionsJson) return [];
|
|
5812
6109
|
try {
|
|
@@ -5817,7 +6114,7 @@ var ActionsTab = ({ actions, onActionsChange, editor, block }) => {
|
|
|
5817
6114
|
}
|
|
5818
6115
|
};
|
|
5819
6116
|
const currentActions = parseActions(actions);
|
|
5820
|
-
|
|
6117
|
+
useEffect11(() => {
|
|
5821
6118
|
if (currentActions.length === 0 && !isEditorVisible) {
|
|
5822
6119
|
setEditingIndex(null);
|
|
5823
6120
|
setIsEditorVisible(true);
|
|
@@ -5856,7 +6153,7 @@ var ActionsTab = ({ actions, onActionsChange, editor, block }) => {
|
|
|
5856
6153
|
setIsEditorVisible(false);
|
|
5857
6154
|
setEditingIndex(null);
|
|
5858
6155
|
}, []);
|
|
5859
|
-
return /* @__PURE__ */
|
|
6156
|
+
return /* @__PURE__ */ React74.createElement(Stack58, { gap: "md" }, /* @__PURE__ */ React74.createElement(
|
|
5860
6157
|
Button12,
|
|
5861
6158
|
{
|
|
5862
6159
|
onClick: handleAddAction,
|
|
@@ -5868,8 +6165,8 @@ var ActionsTab = ({ actions, onActionsChange, editor, block }) => {
|
|
|
5868
6165
|
}
|
|
5869
6166
|
},
|
|
5870
6167
|
"Add Action"
|
|
5871
|
-
), /* @__PURE__ */
|
|
5872
|
-
}, onEditAction: handleEditAction, onRemoveAction: handleRemoveAction }), isEditorVisible && /* @__PURE__ */
|
|
6168
|
+
), /* @__PURE__ */ React74.createElement(ActionsCard, { actions: currentActions, isSelected: false, onClick: () => {
|
|
6169
|
+
}, onEditAction: handleEditAction, onRemoveAction: handleRemoveAction }), isEditorVisible && /* @__PURE__ */ React74.createElement(
|
|
5873
6170
|
Card13,
|
|
5874
6171
|
{
|
|
5875
6172
|
withBorder: true,
|
|
@@ -5880,15 +6177,15 @@ var ActionsTab = ({ actions, onActionsChange, editor, block }) => {
|
|
|
5880
6177
|
borderColor: "#333"
|
|
5881
6178
|
}
|
|
5882
6179
|
},
|
|
5883
|
-
/* @__PURE__ */
|
|
6180
|
+
/* @__PURE__ */ React74.createElement(ActionsPanel, { actions: currentActions, editingIndex, onSave: handleSaveAction, onCancel: handleCancelEditor, isTemplateMode: true })
|
|
5884
6181
|
));
|
|
5885
6182
|
};
|
|
5886
6183
|
|
|
5887
6184
|
// src/mantine/blocks/proposal/template/VoteTab.tsx
|
|
5888
|
-
import
|
|
5889
|
-
import { Stack as
|
|
6185
|
+
import React75 from "react";
|
|
6186
|
+
import { Stack as Stack59, TextInput as TextInput32 } from "@mantine/core";
|
|
5890
6187
|
var VoteTab = ({ voteTitle, voteSubtitle, voteIcon, onVoteTitleChange, onVoteSubtitleChange, onVoteIconChange }) => {
|
|
5891
|
-
return /* @__PURE__ */
|
|
6188
|
+
return /* @__PURE__ */ React75.createElement(Stack59, { gap: "md" }, /* @__PURE__ */ React75.createElement(TextInput32, { label: "Vote Button Title", placeholder: "Vote on this proposal", value: voteTitle, onChange: (event) => onVoteTitleChange(event.currentTarget.value) }), /* @__PURE__ */ React75.createElement(TextInput32, { label: "Vote Button Subtitle", placeholder: "Cast your vote", value: voteSubtitle, onChange: (event) => onVoteSubtitleChange(event.currentTarget.value) }), /* @__PURE__ */ React75.createElement(TextInput32, { label: "Vote Icon", placeholder: "checklist", value: voteIcon, onChange: (event) => onVoteIconChange(event.currentTarget.value) }));
|
|
5892
6189
|
};
|
|
5893
6190
|
|
|
5894
6191
|
// src/mantine/blocks/proposal/template/TemplateConfig.tsx
|
|
@@ -5905,8 +6202,8 @@ var TemplateConfig3 = ({ editor, block }) => {
|
|
|
5905
6202
|
},
|
|
5906
6203
|
[editor, block]
|
|
5907
6204
|
);
|
|
5908
|
-
return /* @__PURE__ */
|
|
5909
|
-
|
|
6205
|
+
return /* @__PURE__ */ React76.createElement(
|
|
6206
|
+
Paper6,
|
|
5910
6207
|
{
|
|
5911
6208
|
p: "md",
|
|
5912
6209
|
shadow: "sm",
|
|
@@ -5916,7 +6213,7 @@ var TemplateConfig3 = ({ editor, block }) => {
|
|
|
5916
6213
|
flexDirection: "column"
|
|
5917
6214
|
}
|
|
5918
6215
|
},
|
|
5919
|
-
/* @__PURE__ */
|
|
6216
|
+
/* @__PURE__ */ React76.createElement(
|
|
5920
6217
|
"div",
|
|
5921
6218
|
{
|
|
5922
6219
|
style: {
|
|
@@ -5926,17 +6223,17 @@ var TemplateConfig3 = ({ editor, block }) => {
|
|
|
5926
6223
|
marginBottom: "1rem"
|
|
5927
6224
|
}
|
|
5928
6225
|
},
|
|
5929
|
-
/* @__PURE__ */
|
|
5930
|
-
/* @__PURE__ */
|
|
6226
|
+
/* @__PURE__ */ React76.createElement(Title4, { order: 3 }, "Proposal Settings"),
|
|
6227
|
+
/* @__PURE__ */ React76.createElement(CloseButton4, { onClick: closePanel })
|
|
5931
6228
|
),
|
|
5932
|
-
/* @__PURE__ */
|
|
6229
|
+
/* @__PURE__ */ React76.createElement(
|
|
5933
6230
|
ReusablePanel,
|
|
5934
6231
|
{
|
|
5935
6232
|
extraTabs: [
|
|
5936
6233
|
{
|
|
5937
6234
|
label: "General",
|
|
5938
6235
|
value: "general",
|
|
5939
|
-
content: /* @__PURE__ */
|
|
6236
|
+
content: /* @__PURE__ */ React76.createElement(
|
|
5940
6237
|
GeneralTab3,
|
|
5941
6238
|
{
|
|
5942
6239
|
title: block.props.title || "",
|
|
@@ -5949,12 +6246,12 @@ var TemplateConfig3 = ({ editor, block }) => {
|
|
|
5949
6246
|
{
|
|
5950
6247
|
label: "Actions",
|
|
5951
6248
|
value: "actions",
|
|
5952
|
-
content: /* @__PURE__ */
|
|
6249
|
+
content: /* @__PURE__ */ React76.createElement(ActionsTab, { actions: block.props.actions || "[]", onActionsChange: (actions) => updateProp("actions", JSON.stringify(actions)), editor, block })
|
|
5953
6250
|
},
|
|
5954
6251
|
{
|
|
5955
6252
|
label: "Vote",
|
|
5956
6253
|
value: "vote",
|
|
5957
|
-
content: /* @__PURE__ */
|
|
6254
|
+
content: /* @__PURE__ */ React76.createElement(
|
|
5958
6255
|
VoteTab,
|
|
5959
6256
|
{
|
|
5960
6257
|
voteTitle: block.props.voteTitle || "",
|
|
@@ -5974,21 +6271,21 @@ var TemplateConfig3 = ({ editor, block }) => {
|
|
|
5974
6271
|
};
|
|
5975
6272
|
|
|
5976
6273
|
// src/mantine/blocks/proposal/template/TemplateView.tsx
|
|
5977
|
-
import { Card as Card14, Group as
|
|
6274
|
+
import { Card as Card14, Group as Group20, Stack as Stack60, Text as Text35, ActionIcon as ActionIcon7 } from "@mantine/core";
|
|
5978
6275
|
var PROPOSAL_TEMPLATE_PANEL_ID = "proposal-template-panel";
|
|
5979
6276
|
var ProposalTemplateView = ({ editor, block }) => {
|
|
5980
6277
|
const panelId = `${PROPOSAL_TEMPLATE_PANEL_ID}-${block.id}`;
|
|
5981
|
-
const panelContent =
|
|
6278
|
+
const panelContent = useMemo10(() => /* @__PURE__ */ React77.createElement(TemplateConfig3, { editor, block }), [editor, block]);
|
|
5982
6279
|
const { open } = usePanel(panelId, panelContent);
|
|
5983
|
-
return /* @__PURE__ */
|
|
6280
|
+
return /* @__PURE__ */ React77.createElement(Card14, { withBorder: true, padding: "md", radius: "md", style: { width: "100%", cursor: "pointer" }, onClick: open }, /* @__PURE__ */ React77.createElement(Group20, { wrap: "nowrap", justify: "space-between", align: "center" }, /* @__PURE__ */ React77.createElement(Group20, { wrap: "nowrap", align: "center" }, /* @__PURE__ */ React77.createElement(ActionIcon7, { variant: "light", color: "blue", size: "lg", radius: "xl", style: { flexShrink: 0 } }, getIcon(block.props.icon, 18, 1.5, "file-text")), /* @__PURE__ */ React77.createElement(Stack60, { gap: "xs", style: { flex: 1 } }, /* @__PURE__ */ React77.createElement(Text35, { fw: 500, size: "sm", contentEditable: false }, block.props.title || "Proposal Title"), /* @__PURE__ */ React77.createElement(Text35, { size: "xs", c: "dimmed", contentEditable: false }, block.props.description || "Proposal description"))), /* @__PURE__ */ React77.createElement(Text35, { size: "xs", c: "dimmed", contentEditable: false }, block.props.status || "draft")));
|
|
5984
6281
|
};
|
|
5985
6282
|
|
|
5986
6283
|
// src/mantine/blocks/proposal/flow/FlowView.tsx
|
|
5987
|
-
import
|
|
6284
|
+
import React82, { useMemo as useMemo11 } from "react";
|
|
5988
6285
|
|
|
5989
6286
|
// src/mantine/blocks/proposal/components/OnChainProposalCard.tsx
|
|
5990
|
-
import
|
|
5991
|
-
import { Card as Card15, Group as
|
|
6287
|
+
import React78 from "react";
|
|
6288
|
+
import { Card as Card15, Group as Group21, Stack as Stack61, Text as Text36, Skeleton, Badge as Badge9, Button as Button13, ActionIcon as ActionIcon8 } from "@mantine/core";
|
|
5992
6289
|
var statusColor = {
|
|
5993
6290
|
open: "#4dabf7",
|
|
5994
6291
|
passed: "#51cf66",
|
|
@@ -6017,7 +6314,7 @@ var OnChainProposalCard = ({
|
|
|
6017
6314
|
onVote,
|
|
6018
6315
|
voteEnabled = false
|
|
6019
6316
|
}) => {
|
|
6020
|
-
return /* @__PURE__ */
|
|
6317
|
+
return /* @__PURE__ */ React78.createElement(
|
|
6021
6318
|
Card15,
|
|
6022
6319
|
{
|
|
6023
6320
|
shadow: "sm",
|
|
@@ -6030,9 +6327,9 @@ var OnChainProposalCard = ({
|
|
|
6030
6327
|
},
|
|
6031
6328
|
onClick
|
|
6032
6329
|
},
|
|
6033
|
-
isFetching && /* @__PURE__ */
|
|
6034
|
-
error && /* @__PURE__ */
|
|
6035
|
-
!isFetching && /* @__PURE__ */
|
|
6330
|
+
isFetching && /* @__PURE__ */ React78.createElement(Stack61, null, /* @__PURE__ */ React78.createElement(Skeleton, { height: 20, width: "70%" }), /* @__PURE__ */ React78.createElement(Skeleton, { height: 16 }), /* @__PURE__ */ React78.createElement(Skeleton, { height: 16, width: "40%" })),
|
|
6331
|
+
error && /* @__PURE__ */ React78.createElement(Text36, { size: "sm", c: "red" }, typeof error === "string" ? error : error.message || "An error occurred while loading the proposal."),
|
|
6332
|
+
!isFetching && /* @__PURE__ */ React78.createElement(Group21, { justify: "space-between", align: "flex-start" }, /* @__PURE__ */ React78.createElement(Group21, { align: "flex-start", gap: "md", style: { flex: 1 } }, /* @__PURE__ */ React78.createElement(ActionIcon8, { variant: "light", color: "blue", size: "xl", radius: "xl", style: { flexShrink: 0 } }, getIcon(icon, 24, 1.5, "file-text")), /* @__PURE__ */ React78.createElement(Stack61, { gap: "xs", style: { flex: 1 } }, /* @__PURE__ */ React78.createElement(Group21, { gap: "xs" }, /* @__PURE__ */ React78.createElement(Text36, { size: "md", fw: 600 }, title || "Proposal"), /* @__PURE__ */ React78.createElement(Badge9, { color: statusColor[status], variant: "filled", size: "sm", radius: "sm" }, status.replace(/_/g, " ").toUpperCase())), /* @__PURE__ */ React78.createElement(Text36, { size: "sm", c: "dimmed" }, getDisplayDescription(description)))), /* @__PURE__ */ React78.createElement(Group21, { gap: "xs" }, voteEnabled && onVote && status === "open" && /* @__PURE__ */ React78.createElement(
|
|
6036
6333
|
Button13,
|
|
6037
6334
|
{
|
|
6038
6335
|
size: "sm",
|
|
@@ -6045,7 +6342,7 @@ var OnChainProposalCard = ({
|
|
|
6045
6342
|
style: { flexShrink: 0 }
|
|
6046
6343
|
},
|
|
6047
6344
|
"Vote"
|
|
6048
|
-
), status === "passed" && onExecute && /* @__PURE__ */
|
|
6345
|
+
), status === "passed" && onExecute && /* @__PURE__ */ React78.createElement(
|
|
6049
6346
|
Button13,
|
|
6050
6347
|
{
|
|
6051
6348
|
size: "sm",
|
|
@@ -6064,11 +6361,11 @@ var OnChainProposalCard = ({
|
|
|
6064
6361
|
};
|
|
6065
6362
|
|
|
6066
6363
|
// src/mantine/blocks/proposal/flow/FlowConfig.tsx
|
|
6067
|
-
import
|
|
6068
|
-
import { Paper as
|
|
6364
|
+
import React81, { useCallback as useCallback14, useState as useState21 } from "react";
|
|
6365
|
+
import { Paper as Paper7, CloseButton as CloseButton5, Title as Title5, Stack as Stack64, TextInput as TextInput33, Textarea as Textarea18, Button as Button16, Text as Text39, Card as Card18 } from "@mantine/core";
|
|
6069
6366
|
|
|
6070
6367
|
// src/mantine/blocks/proposal/flow/useFlowBusinessLogic.ts
|
|
6071
|
-
import { useEffect as
|
|
6368
|
+
import { useEffect as useEffect12, useState as useState17 } from "react";
|
|
6072
6369
|
var CHAIN_STATUSES = ["open", "passed", "rejected", "executed", "closed", "execution_failed", "veto_timelock"];
|
|
6073
6370
|
var isChainStatus = (value) => {
|
|
6074
6371
|
return CHAIN_STATUSES.includes(value);
|
|
@@ -6080,9 +6377,9 @@ var parseStatus = (value) => {
|
|
|
6080
6377
|
var useFlowBusinessLogic = ({ block, editor }) => {
|
|
6081
6378
|
const { blockRequirements } = useBlocknoteContext();
|
|
6082
6379
|
const coreAddress = blockRequirements?.proposal?.coreAddress;
|
|
6083
|
-
const [proposalContractAddress, setProposalContractAddress] =
|
|
6084
|
-
const [isExecuting, setIsExecuting] =
|
|
6085
|
-
const [executionError, setExecutionError] =
|
|
6380
|
+
const [proposalContractAddress, setProposalContractAddress] = useState17(null);
|
|
6381
|
+
const [isExecuting, setIsExecuting] = useState17(false);
|
|
6382
|
+
const [executionError, setExecutionError] = useState17(null);
|
|
6086
6383
|
let handlers = null;
|
|
6087
6384
|
try {
|
|
6088
6385
|
handlers = useBlocknoteHandlers();
|
|
@@ -6112,7 +6409,7 @@ var useFlowBusinessLogic = ({ block, editor }) => {
|
|
|
6112
6409
|
props: { ...block.props, ...nextProps }
|
|
6113
6410
|
});
|
|
6114
6411
|
};
|
|
6115
|
-
|
|
6412
|
+
useEffect12(() => {
|
|
6116
6413
|
if (!handlers || !coreAddress || !proposalId) {
|
|
6117
6414
|
setProposalContractAddress(null);
|
|
6118
6415
|
return;
|
|
@@ -6135,7 +6432,7 @@ var useFlowBusinessLogic = ({ block, editor }) => {
|
|
|
6135
6432
|
isCancelled = true;
|
|
6136
6433
|
};
|
|
6137
6434
|
}, [handlers, coreAddress, proposalId]);
|
|
6138
|
-
|
|
6435
|
+
useEffect12(() => {
|
|
6139
6436
|
if (!proposal) return;
|
|
6140
6437
|
const chainStatus = proposal.proposal.status;
|
|
6141
6438
|
const parsedStatus = parseStatus(chainStatus);
|
|
@@ -6229,13 +6526,13 @@ var useFlowBusinessLogic = ({ block, editor }) => {
|
|
|
6229
6526
|
};
|
|
6230
6527
|
|
|
6231
6528
|
// src/mantine/blocks/proposal/flow/useVoteBusinessLogic.ts
|
|
6232
|
-
import { useState as
|
|
6529
|
+
import { useState as useState18, useEffect as useEffect13 } from "react";
|
|
6233
6530
|
var useVoteBusinessLogic = ({ block, editor }) => {
|
|
6234
6531
|
const { blockRequirements } = useBlocknoteContext();
|
|
6235
6532
|
const coreAddress = blockRequirements?.proposal?.coreAddress;
|
|
6236
|
-
const [localError, setLocalError] =
|
|
6237
|
-
const [userVote, setUserVote] =
|
|
6238
|
-
const [proposalContractAddress, setProposalContractAddress] =
|
|
6533
|
+
const [localError, setLocalError] = useState18(null);
|
|
6534
|
+
const [userVote, setUserVote] = useState18(null);
|
|
6535
|
+
const [proposalContractAddress, setProposalContractAddress] = useState18(null);
|
|
6239
6536
|
let handlers = null;
|
|
6240
6537
|
try {
|
|
6241
6538
|
handlers = useBlocknoteHandlers();
|
|
@@ -6246,7 +6543,7 @@ var useVoteBusinessLogic = ({ block, editor }) => {
|
|
|
6246
6543
|
const title = block.props.title || "";
|
|
6247
6544
|
const description = block.props.description || "";
|
|
6248
6545
|
const status = block.props.status || "draft";
|
|
6249
|
-
|
|
6546
|
+
useEffect13(() => {
|
|
6250
6547
|
if (!handlers || !coreAddress || !proposalId) {
|
|
6251
6548
|
setProposalContractAddress(null);
|
|
6252
6549
|
return;
|
|
@@ -6269,7 +6566,7 @@ var useVoteBusinessLogic = ({ block, editor }) => {
|
|
|
6269
6566
|
isCancelled = true;
|
|
6270
6567
|
};
|
|
6271
6568
|
}, [handlers, coreAddress, proposalId]);
|
|
6272
|
-
|
|
6569
|
+
useEffect13(() => {
|
|
6273
6570
|
if (!handlers || !proposalContractAddress || !proposalId) {
|
|
6274
6571
|
return;
|
|
6275
6572
|
}
|
|
@@ -6317,8 +6614,8 @@ var useVoteBusinessLogic = ({ block, editor }) => {
|
|
|
6317
6614
|
};
|
|
6318
6615
|
|
|
6319
6616
|
// src/mantine/blocks/proposal/flow/VoteGeneralTab.tsx
|
|
6320
|
-
import
|
|
6321
|
-
import { Stack as
|
|
6617
|
+
import React79, { useState as useState19 } from "react";
|
|
6618
|
+
import { Stack as Stack62, Text as Text37, Group as Group22, Card as Card16, Button as Button14, Progress as Progress2, Box as Box14, Textarea as Textarea17, Tooltip as Tooltip3 } from "@mantine/core";
|
|
6322
6619
|
var getVoteIcon = (voteType) => {
|
|
6323
6620
|
switch (voteType) {
|
|
6324
6621
|
case "yes":
|
|
@@ -6344,8 +6641,8 @@ var FlowGeneralTab = ({
|
|
|
6344
6641
|
isDisabled
|
|
6345
6642
|
}) => {
|
|
6346
6643
|
const disabled = isDisabled?.isDisabled === "disable";
|
|
6347
|
-
const [selectedVote, setSelectedVote] =
|
|
6348
|
-
const [rationale, setRationale] =
|
|
6644
|
+
const [selectedVote, setSelectedVote] = useState19("");
|
|
6645
|
+
const [rationale, setRationale] = useState19("");
|
|
6349
6646
|
const hasSubmittedProposal = Boolean(proposalId);
|
|
6350
6647
|
const hasVoted = Boolean(userVote?.vote);
|
|
6351
6648
|
const handleSlideToSign = () => {
|
|
@@ -6360,7 +6657,7 @@ var FlowGeneralTab = ({
|
|
|
6360
6657
|
setRationale("");
|
|
6361
6658
|
}
|
|
6362
6659
|
};
|
|
6363
|
-
return /* @__PURE__ */
|
|
6660
|
+
return /* @__PURE__ */ React79.createElement(Stack62, { gap: "lg" }, !hasSubmittedProposal && /* @__PURE__ */ React79.createElement(
|
|
6364
6661
|
Card16,
|
|
6365
6662
|
{
|
|
6366
6663
|
padding: "md",
|
|
@@ -6371,7 +6668,7 @@ var FlowGeneralTab = ({
|
|
|
6371
6668
|
color: "#f1f3f5"
|
|
6372
6669
|
}
|
|
6373
6670
|
},
|
|
6374
|
-
/* @__PURE__ */
|
|
6671
|
+
/* @__PURE__ */ React79.createElement(Group22, { gap: "xs", align: "center" }, /* @__PURE__ */ React79.createElement(
|
|
6375
6672
|
Box14,
|
|
6376
6673
|
{
|
|
6377
6674
|
style: {
|
|
@@ -6381,9 +6678,9 @@ var FlowGeneralTab = ({
|
|
|
6381
6678
|
borderRadius: "50%"
|
|
6382
6679
|
}
|
|
6383
6680
|
}
|
|
6384
|
-
), /* @__PURE__ */
|
|
6385
|
-
/* @__PURE__ */
|
|
6386
|
-
), /* @__PURE__ */
|
|
6681
|
+
), /* @__PURE__ */ React79.createElement(Text37, { size: "sm", fw: 500, style: { color: "#ffd43b" } }, "Waiting for Proposal Submission")),
|
|
6682
|
+
/* @__PURE__ */ React79.createElement(Text37, { size: "xs", style: { color: "#adb5bd", marginTop: 4 } }, "The connected proposal needs to be submitted before voting can begin.")
|
|
6683
|
+
), /* @__PURE__ */ React79.createElement(
|
|
6387
6684
|
Card16,
|
|
6388
6685
|
{
|
|
6389
6686
|
padding: "lg",
|
|
@@ -6395,7 +6692,7 @@ var FlowGeneralTab = ({
|
|
|
6395
6692
|
opacity: !hasSubmittedProposal ? 0.6 : 1
|
|
6396
6693
|
}
|
|
6397
6694
|
},
|
|
6398
|
-
/* @__PURE__ */
|
|
6695
|
+
/* @__PURE__ */ React79.createElement(Stack62, { gap: "xs" }, /* @__PURE__ */ React79.createElement(Group22, { justify: "space-between" }, /* @__PURE__ */ React79.createElement(Group22, { gap: "xs" }, /* @__PURE__ */ React79.createElement(
|
|
6399
6696
|
Box14,
|
|
6400
6697
|
{
|
|
6401
6698
|
w: 8,
|
|
@@ -6405,8 +6702,8 @@ var FlowGeneralTab = ({
|
|
|
6405
6702
|
borderRadius: "50%"
|
|
6406
6703
|
}
|
|
6407
6704
|
}
|
|
6408
|
-
), /* @__PURE__ */
|
|
6409
|
-
|
|
6705
|
+
), /* @__PURE__ */ React79.createElement(Text37, { size: "sm", style: { color: "#adb5bd" } }, "Status")), /* @__PURE__ */ React79.createElement(Text37, { size: "sm", fw: 500, style: { color: "#f1f3f5" } }, hasSubmittedProposal ? proposalStatus === "open" ? "Active" : proposalStatus || "Active" : "Waiting")), /* @__PURE__ */ React79.createElement(Group22, { justify: "space-between" }, /* @__PURE__ */ React79.createElement(Group22, { gap: "xs" }, /* @__PURE__ */ React79.createElement(Box14, { w: 8, h: 8, style: { backgroundColor: "#adb5bd", borderRadius: "50%" } }), /* @__PURE__ */ React79.createElement(Text37, { size: "sm", style: { color: "#adb5bd" } }, "Proposal ID")), /* @__PURE__ */ React79.createElement(Text37, { size: "sm", fw: 500, style: { color: "#f1f3f5" } }, hasSubmittedProposal ? `#${proposalId}` : "TBD")), /* @__PURE__ */ React79.createElement(Group22, { justify: "space-between" }, /* @__PURE__ */ React79.createElement(Group22, { gap: "xs" }, /* @__PURE__ */ React79.createElement(Box14, { w: 8, h: 8, style: { backgroundColor: "#adb5bd", borderRadius: "50%" } }), /* @__PURE__ */ React79.createElement(Text37, { size: "sm", style: { color: "#adb5bd" } }, "Title")), /* @__PURE__ */ React79.createElement(
|
|
6706
|
+
Text37,
|
|
6410
6707
|
{
|
|
6411
6708
|
size: "sm",
|
|
6412
6709
|
fw: 500,
|
|
@@ -6415,8 +6712,8 @@ var FlowGeneralTab = ({
|
|
|
6415
6712
|
}
|
|
6416
6713
|
},
|
|
6417
6714
|
hasSubmittedProposal ? proposalTitle || "Untitled" : "N/A"
|
|
6418
|
-
)), /* @__PURE__ */
|
|
6419
|
-
/* @__PURE__ */
|
|
6715
|
+
)), /* @__PURE__ */ React79.createElement(Group22, { justify: "space-between" }, /* @__PURE__ */ React79.createElement(Group22, { gap: "xs" }, /* @__PURE__ */ React79.createElement(Box14, { w: 8, h: 8, style: { backgroundColor: "#adb5bd", borderRadius: "50%" } }), /* @__PURE__ */ React79.createElement(Text37, { size: "sm", style: { color: "#adb5bd" } }, "Description")), /* @__PURE__ */ React79.createElement(Text37, { size: "sm", fw: 500, style: { color: "#f1f3f5" }, title: proposalDescription }, hasSubmittedProposal ? proposalDescription ? proposalDescription.length > 30 ? proposalDescription.substring(0, 30) + "..." : proposalDescription : "No description" : "N/A")), /* @__PURE__ */ React79.createElement(Group22, { justify: "space-between" }, /* @__PURE__ */ React79.createElement(Group22, { gap: "xs" }, /* @__PURE__ */ React79.createElement(Box14, { w: 8, h: 8, style: { backgroundColor: "#adb5bd", borderRadius: "50%" } }), /* @__PURE__ */ React79.createElement(Text37, { size: "sm", style: { color: "#adb5bd" } }, "My Vote")), /* @__PURE__ */ React79.createElement(Text37, { size: "sm", fw: 500, style: { color: "#f1f3f5" } }, hasSubmittedProposal ? userVote?.vote ? userVote.vote.vote : "Pending" : "N/A"))),
|
|
6716
|
+
/* @__PURE__ */ React79.createElement(Stack62, { gap: "xs" }, /* @__PURE__ */ React79.createElement(Text37, { size: "sm", style: { color: "#adb5bd" } }, hasSubmittedProposal ? "Voting is open" : "Voting pending"), /* @__PURE__ */ React79.createElement(
|
|
6420
6717
|
Progress2,
|
|
6421
6718
|
{
|
|
6422
6719
|
value: hasSubmittedProposal ? 75 : 0,
|
|
@@ -6429,7 +6726,7 @@ var FlowGeneralTab = ({
|
|
|
6429
6726
|
}
|
|
6430
6727
|
}
|
|
6431
6728
|
))
|
|
6432
|
-
), hasSubmittedProposal && !hasVoted && (status === "open" || proposalStatus === "open") && /* @__PURE__ */
|
|
6729
|
+
), hasSubmittedProposal && !hasVoted && (status === "open" || proposalStatus === "open") && /* @__PURE__ */ React79.createElement(Stack62, { gap: "lg" }, disabled && isDisabled?.message && /* @__PURE__ */ React79.createElement(
|
|
6433
6730
|
Card16,
|
|
6434
6731
|
{
|
|
6435
6732
|
padding: "md",
|
|
@@ -6440,7 +6737,7 @@ var FlowGeneralTab = ({
|
|
|
6440
6737
|
color: "#f1f3f5"
|
|
6441
6738
|
}
|
|
6442
6739
|
},
|
|
6443
|
-
/* @__PURE__ */
|
|
6740
|
+
/* @__PURE__ */ React79.createElement(Group22, { gap: "xs", align: "center" }, /* @__PURE__ */ React79.createElement(
|
|
6444
6741
|
Box14,
|
|
6445
6742
|
{
|
|
6446
6743
|
style: {
|
|
@@ -6450,8 +6747,8 @@ var FlowGeneralTab = ({
|
|
|
6450
6747
|
borderRadius: "50%"
|
|
6451
6748
|
}
|
|
6452
6749
|
}
|
|
6453
|
-
), /* @__PURE__ */
|
|
6454
|
-
), /* @__PURE__ */
|
|
6750
|
+
), /* @__PURE__ */ React79.createElement(Text37, { size: "sm", fw: 500, style: { color: "#ffd43b" } }, isDisabled.message))
|
|
6751
|
+
), /* @__PURE__ */ React79.createElement(Stack62, { gap: "md" }, ["yes", "no", "no_with_veto", "abstain"].map((voteType) => /* @__PURE__ */ React79.createElement(Tooltip3, { key: voteType, label: disabled ? isDisabled?.message : void 0, disabled: !disabled, position: "top" }, /* @__PURE__ */ React79.createElement(
|
|
6455
6752
|
Button14,
|
|
6456
6753
|
{
|
|
6457
6754
|
variant: "outline",
|
|
@@ -6470,8 +6767,8 @@ var FlowGeneralTab = ({
|
|
|
6470
6767
|
opacity: disabled ? 0.5 : 1
|
|
6471
6768
|
}
|
|
6472
6769
|
},
|
|
6473
|
-
/* @__PURE__ */
|
|
6474
|
-
)))), /* @__PURE__ */
|
|
6770
|
+
/* @__PURE__ */ React79.createElement(Text37, { fw: 500, tt: "capitalize", style: { textAlign: "left" } }, voteType === "no_with_veto" ? "No with Veto" : voteType)
|
|
6771
|
+
)))), /* @__PURE__ */ React79.createElement(Stack62, { gap: "xs" }, /* @__PURE__ */ React79.createElement(Text37, { size: "sm", style: { color: "#adb5bd" } }, "Rationale (optional)"), /* @__PURE__ */ React79.createElement(
|
|
6475
6772
|
Textarea17,
|
|
6476
6773
|
{
|
|
6477
6774
|
value: rationale,
|
|
@@ -6488,7 +6785,7 @@ var FlowGeneralTab = ({
|
|
|
6488
6785
|
}
|
|
6489
6786
|
}
|
|
6490
6787
|
}
|
|
6491
|
-
))), (status === "executed" || proposalStatus === "executed") && /* @__PURE__ */
|
|
6788
|
+
))), (status === "executed" || proposalStatus === "executed") && /* @__PURE__ */ React79.createElement(
|
|
6492
6789
|
Card16,
|
|
6493
6790
|
{
|
|
6494
6791
|
padding: "md",
|
|
@@ -6498,8 +6795,8 @@ var FlowGeneralTab = ({
|
|
|
6498
6795
|
border: "1px solid #333"
|
|
6499
6796
|
}
|
|
6500
6797
|
},
|
|
6501
|
-
/* @__PURE__ */
|
|
6502
|
-
), !hasSubmittedProposal && /* @__PURE__ */
|
|
6798
|
+
/* @__PURE__ */ React79.createElement(Stack62, { gap: "xs" }, /* @__PURE__ */ React79.createElement(Text37, { fw: 500, size: "sm", style: { color: "#f1f3f5" } }, "Proposal Executed"), /* @__PURE__ */ React79.createElement(Text37, { size: "sm", style: { color: "#adb5bd" } }, "This proposal has been successfully executed."))
|
|
6799
|
+
), !hasSubmittedProposal && /* @__PURE__ */ React79.createElement(Stack62, { gap: "lg" }, /* @__PURE__ */ React79.createElement(Stack62, { gap: "md" }, ["yes", "no", "no_with_veto", "abstain"].map((voteType) => /* @__PURE__ */ React79.createElement(Tooltip3, { key: voteType, label: "Proposal must be submitted before voting", position: "top" }, /* @__PURE__ */ React79.createElement(
|
|
6503
6800
|
Button14,
|
|
6504
6801
|
{
|
|
6505
6802
|
variant: "outline",
|
|
@@ -6516,8 +6813,8 @@ var FlowGeneralTab = ({
|
|
|
6516
6813
|
opacity: 0.5
|
|
6517
6814
|
}
|
|
6518
6815
|
},
|
|
6519
|
-
/* @__PURE__ */
|
|
6520
|
-
))))), hasSubmittedProposal && !hasVoted && selectedVote && (status === "open" || proposalStatus === "open") && /* @__PURE__ */
|
|
6816
|
+
/* @__PURE__ */ React79.createElement(Text37, { fw: 500, tt: "capitalize", style: { textAlign: "left" } }, voteType === "no_with_veto" ? "No with Veto" : voteType)
|
|
6817
|
+
))))), hasSubmittedProposal && !hasVoted && selectedVote && (status === "open" || proposalStatus === "open") && /* @__PURE__ */ React79.createElement(Tooltip3, { label: disabled ? isDisabled?.message : "Sign to vote", position: "top" }, /* @__PURE__ */ React79.createElement("div", null, /* @__PURE__ */ React79.createElement(
|
|
6521
6818
|
Button14,
|
|
6522
6819
|
{
|
|
6523
6820
|
size: "sm",
|
|
@@ -6533,7 +6830,7 @@ var FlowGeneralTab = ({
|
|
|
6533
6830
|
}
|
|
6534
6831
|
},
|
|
6535
6832
|
"Sign"
|
|
6536
|
-
))), hasVoted && hasSubmittedProposal && /* @__PURE__ */
|
|
6833
|
+
))), hasVoted && hasSubmittedProposal && /* @__PURE__ */ React79.createElement(
|
|
6537
6834
|
Card16,
|
|
6538
6835
|
{
|
|
6539
6836
|
padding: "md",
|
|
@@ -6544,7 +6841,7 @@ var FlowGeneralTab = ({
|
|
|
6544
6841
|
color: "#f1f3f5"
|
|
6545
6842
|
}
|
|
6546
6843
|
},
|
|
6547
|
-
/* @__PURE__ */
|
|
6844
|
+
/* @__PURE__ */ React79.createElement(Stack62, { gap: "xs" }, /* @__PURE__ */ React79.createElement(Group22, { gap: "xs", align: "center" }, /* @__PURE__ */ React79.createElement(
|
|
6548
6845
|
Box14,
|
|
6549
6846
|
{
|
|
6550
6847
|
style: {
|
|
@@ -6554,16 +6851,16 @@ var FlowGeneralTab = ({
|
|
|
6554
6851
|
borderRadius: "50%"
|
|
6555
6852
|
}
|
|
6556
6853
|
}
|
|
6557
|
-
), /* @__PURE__ */
|
|
6854
|
+
), /* @__PURE__ */ React79.createElement(Text37, { size: "sm", fw: 500, style: { color: "#51cf66" } }, "Vote Submitted")), /* @__PURE__ */ React79.createElement(Text37, { size: "xs", style: { color: "#adb5bd" } }, "You have already voted on this proposal. Your vote:", " ", /* @__PURE__ */ React79.createElement(Text37, { span: true, fw: 500, tt: "capitalize" }, userVote?.vote?.vote)))
|
|
6558
6855
|
));
|
|
6559
6856
|
};
|
|
6560
6857
|
|
|
6561
6858
|
// src/mantine/blocks/proposal/flow/ActionsTab.tsx
|
|
6562
|
-
import
|
|
6563
|
-
import { Alert as
|
|
6859
|
+
import React80, { useCallback as useCallback13, useEffect as useEffect14, useState as useState20 } from "react";
|
|
6860
|
+
import { Alert as Alert8, Button as Button15, Card as Card17, Stack as Stack63, Text as Text38 } from "@mantine/core";
|
|
6564
6861
|
var ActionsTab2 = ({ actions, onActionsChange, editor, block, isProposalCreated }) => {
|
|
6565
|
-
const [isEditorVisible, setIsEditorVisible] =
|
|
6566
|
-
const [editingIndex, setEditingIndex] =
|
|
6862
|
+
const [isEditorVisible, setIsEditorVisible] = useState20(false);
|
|
6863
|
+
const [editingIndex, setEditingIndex] = useState20(null);
|
|
6567
6864
|
const parseActions = (actionsJson) => {
|
|
6568
6865
|
if (!actionsJson) return [];
|
|
6569
6866
|
try {
|
|
@@ -6574,7 +6871,7 @@ var ActionsTab2 = ({ actions, onActionsChange, editor, block, isProposalCreated
|
|
|
6574
6871
|
}
|
|
6575
6872
|
};
|
|
6576
6873
|
const currentActions = parseActions(actions);
|
|
6577
|
-
|
|
6874
|
+
useEffect14(() => {
|
|
6578
6875
|
if (!isProposalCreated && currentActions.length === 0 && !isEditorVisible) {
|
|
6579
6876
|
setEditingIndex(null);
|
|
6580
6877
|
setIsEditorVisible(true);
|
|
@@ -6619,7 +6916,7 @@ var ActionsTab2 = ({ actions, onActionsChange, editor, block, isProposalCreated
|
|
|
6619
6916
|
setIsEditorVisible(false);
|
|
6620
6917
|
setEditingIndex(null);
|
|
6621
6918
|
}, []);
|
|
6622
|
-
return /* @__PURE__ */
|
|
6919
|
+
return /* @__PURE__ */ React80.createElement(Stack63, { gap: "md" }, isProposalCreated && /* @__PURE__ */ React80.createElement(Alert8, { color: "yellow", title: "Actions Locked" }, /* @__PURE__ */ React80.createElement(Text38, { size: "sm" }, "Actions cannot be edited after the proposal has been created. These actions are now part of the on-chain proposal.")), /* @__PURE__ */ React80.createElement(Stack63, { gap: "sm" }, !isProposalCreated && /* @__PURE__ */ React80.createElement(
|
|
6623
6920
|
Button15,
|
|
6624
6921
|
{
|
|
6625
6922
|
onClick: handleAddAction,
|
|
@@ -6631,7 +6928,7 @@ var ActionsTab2 = ({ actions, onActionsChange, editor, block, isProposalCreated
|
|
|
6631
6928
|
}
|
|
6632
6929
|
},
|
|
6633
6930
|
"Add Action"
|
|
6634
|
-
), /* @__PURE__ */
|
|
6931
|
+
), /* @__PURE__ */ React80.createElement(
|
|
6635
6932
|
ActionsCard,
|
|
6636
6933
|
{
|
|
6637
6934
|
actions: currentActions,
|
|
@@ -6642,7 +6939,7 @@ var ActionsTab2 = ({ actions, onActionsChange, editor, block, isProposalCreated
|
|
|
6642
6939
|
onRemoveAction: handleRemoveAction,
|
|
6643
6940
|
disabled: isProposalCreated
|
|
6644
6941
|
}
|
|
6645
|
-
)), !isProposalCreated && isEditorVisible && /* @__PURE__ */
|
|
6942
|
+
)), !isProposalCreated && isEditorVisible && /* @__PURE__ */ React80.createElement(
|
|
6646
6943
|
Card17,
|
|
6647
6944
|
{
|
|
6648
6945
|
withBorder: true,
|
|
@@ -6653,7 +6950,7 @@ var ActionsTab2 = ({ actions, onActionsChange, editor, block, isProposalCreated
|
|
|
6653
6950
|
borderColor: "#333"
|
|
6654
6951
|
}
|
|
6655
6952
|
},
|
|
6656
|
-
/* @__PURE__ */
|
|
6953
|
+
/* @__PURE__ */ React80.createElement(ActionsPanel, { actions: currentActions, editingIndex, onSave: handleSaveAction, onCancel: handleCancelEditor, isTemplateMode: false })
|
|
6657
6954
|
));
|
|
6658
6955
|
};
|
|
6659
6956
|
|
|
@@ -6662,8 +6959,8 @@ var FlowConfig = ({ editor, block }) => {
|
|
|
6662
6959
|
const { closePanel } = usePanelStore();
|
|
6663
6960
|
const { blockRequirements } = useBlocknoteContext();
|
|
6664
6961
|
const coreAddress = blockRequirements?.proposal?.coreAddress;
|
|
6665
|
-
const [errors, setErrors] =
|
|
6666
|
-
const [isCreating, setIsCreating] =
|
|
6962
|
+
const [errors, setErrors] = useState21({});
|
|
6963
|
+
const [isCreating, setIsCreating] = useState21(false);
|
|
6667
6964
|
const { createProposal, title, description, proposalId } = useFlowBusinessLogic({
|
|
6668
6965
|
block,
|
|
6669
6966
|
editor
|
|
@@ -6707,7 +7004,7 @@ var FlowConfig = ({ editor, block }) => {
|
|
|
6707
7004
|
setIsCreating(false);
|
|
6708
7005
|
}
|
|
6709
7006
|
};
|
|
6710
|
-
const createProposalTab = /* @__PURE__ */
|
|
7007
|
+
const createProposalTab = /* @__PURE__ */ React81.createElement(Stack64, { gap: "lg" }, coreAddress && /* @__PURE__ */ React81.createElement(Card18, { padding: "sm", radius: "md", withBorder: true }, /* @__PURE__ */ React81.createElement(Text39, { size: "xs", c: "dimmed" }, "Core Address:", " ", /* @__PURE__ */ React81.createElement(Text39, { span: true, ff: "monospace", c: "bright" }, coreAddress.slice(0, 20), "...", coreAddress.slice(-10)))), /* @__PURE__ */ React81.createElement(
|
|
6711
7008
|
TextInput33,
|
|
6712
7009
|
{
|
|
6713
7010
|
label: "Title",
|
|
@@ -6718,7 +7015,7 @@ var FlowConfig = ({ editor, block }) => {
|
|
|
6718
7015
|
required: true,
|
|
6719
7016
|
disabled: isProposalCreated
|
|
6720
7017
|
}
|
|
6721
|
-
), /* @__PURE__ */
|
|
7018
|
+
), /* @__PURE__ */ React81.createElement(
|
|
6722
7019
|
Textarea18,
|
|
6723
7020
|
{
|
|
6724
7021
|
label: "Description",
|
|
@@ -6730,7 +7027,7 @@ var FlowConfig = ({ editor, block }) => {
|
|
|
6730
7027
|
required: true,
|
|
6731
7028
|
disabled: isProposalCreated
|
|
6732
7029
|
}
|
|
6733
|
-
), errors.general && /* @__PURE__ */
|
|
7030
|
+
), errors.general && /* @__PURE__ */ React81.createElement(Text39, { size: "sm", c: "red" }, errors.general), isProposalCreated && /* @__PURE__ */ React81.createElement(Card18, { padding: "md", radius: "md", withBorder: true, style: { borderColor: "var(--mantine-color-green-6)" } }, /* @__PURE__ */ React81.createElement(Text39, { fw: 500, size: "sm", c: "green" }, "Proposal Created Successfully"), /* @__PURE__ */ React81.createElement(Text39, { size: "sm", c: "dimmed" }, "Your proposal has been created and is now open for voting.")), /* @__PURE__ */ React81.createElement(Button16, { fullWidth: true, onClick: handleCreateProposal, disabled: isProposalCreated, loading: isCreating }, isProposalCreated ? "Proposal Created" : "Create Proposal"));
|
|
6734
7031
|
const handleActionsChange = useCallback14(
|
|
6735
7032
|
(newActions) => {
|
|
6736
7033
|
updateProp("actions", JSON.stringify(newActions));
|
|
@@ -6746,12 +7043,12 @@ var FlowConfig = ({ editor, block }) => {
|
|
|
6746
7043
|
{
|
|
6747
7044
|
label: "Actions",
|
|
6748
7045
|
value: "actions",
|
|
6749
|
-
content: /* @__PURE__ */
|
|
7046
|
+
content: /* @__PURE__ */ React81.createElement(ActionsTab2, { actions: block.props.actions || "[]", onActionsChange: handleActionsChange, editor, block, isProposalCreated })
|
|
6750
7047
|
},
|
|
6751
7048
|
{
|
|
6752
7049
|
label: "Vote",
|
|
6753
7050
|
value: "vote",
|
|
6754
|
-
content: /* @__PURE__ */
|
|
7051
|
+
content: /* @__PURE__ */ React81.createElement(
|
|
6755
7052
|
FlowGeneralTab,
|
|
6756
7053
|
{
|
|
6757
7054
|
proposalId: voteLogic.proposalId,
|
|
@@ -6767,8 +7064,8 @@ var FlowConfig = ({ editor, block }) => {
|
|
|
6767
7064
|
)
|
|
6768
7065
|
}
|
|
6769
7066
|
];
|
|
6770
|
-
return /* @__PURE__ */
|
|
6771
|
-
|
|
7067
|
+
return /* @__PURE__ */ React81.createElement(
|
|
7068
|
+
Paper7,
|
|
6772
7069
|
{
|
|
6773
7070
|
p: "md",
|
|
6774
7071
|
shadow: "sm",
|
|
@@ -6778,7 +7075,7 @@ var FlowConfig = ({ editor, block }) => {
|
|
|
6778
7075
|
flexDirection: "column"
|
|
6779
7076
|
}
|
|
6780
7077
|
},
|
|
6781
|
-
/* @__PURE__ */
|
|
7078
|
+
/* @__PURE__ */ React81.createElement(
|
|
6782
7079
|
"div",
|
|
6783
7080
|
{
|
|
6784
7081
|
style: {
|
|
@@ -6788,10 +7085,10 @@ var FlowConfig = ({ editor, block }) => {
|
|
|
6788
7085
|
marginBottom: "1rem"
|
|
6789
7086
|
}
|
|
6790
7087
|
},
|
|
6791
|
-
/* @__PURE__ */
|
|
6792
|
-
/* @__PURE__ */
|
|
7088
|
+
/* @__PURE__ */ React81.createElement(Title5, { order: 3 }, "Proposal Settings"),
|
|
7089
|
+
/* @__PURE__ */ React81.createElement(CloseButton5, { onClick: closePanel })
|
|
6793
7090
|
),
|
|
6794
|
-
/* @__PURE__ */
|
|
7091
|
+
/* @__PURE__ */ React81.createElement(ReusablePanel, { extraTabs, context: { editor, block } })
|
|
6795
7092
|
);
|
|
6796
7093
|
};
|
|
6797
7094
|
|
|
@@ -6803,13 +7100,13 @@ var ProposalFlowView = ({ block, editor }) => {
|
|
|
6803
7100
|
block,
|
|
6804
7101
|
editor
|
|
6805
7102
|
});
|
|
6806
|
-
const panelContent =
|
|
7103
|
+
const panelContent = useMemo11(() => /* @__PURE__ */ React82.createElement(FlowConfig, { editor, block }), [editor, block]);
|
|
6807
7104
|
const { open } = usePanel(panelId, panelContent);
|
|
6808
7105
|
const handleVote = () => {
|
|
6809
7106
|
open();
|
|
6810
7107
|
};
|
|
6811
7108
|
const showVoteButton = (block.props.voteEnabled || false) && proposalId;
|
|
6812
|
-
return /* @__PURE__ */
|
|
7109
|
+
return /* @__PURE__ */ React82.createElement(
|
|
6813
7110
|
OnChainProposalCard,
|
|
6814
7111
|
{
|
|
6815
7112
|
title,
|
|
@@ -6834,9 +7131,9 @@ var ProposalFlowView = ({ block, editor }) => {
|
|
|
6834
7131
|
function ProposalBlock({ editor, block }) {
|
|
6835
7132
|
const { docType } = useBlocknoteContext();
|
|
6836
7133
|
if (docType === "template") {
|
|
6837
|
-
return /* @__PURE__ */
|
|
7134
|
+
return /* @__PURE__ */ React83.createElement(ProposalTemplateView, { editor, block });
|
|
6838
7135
|
}
|
|
6839
|
-
return /* @__PURE__ */
|
|
7136
|
+
return /* @__PURE__ */ React83.createElement(ProposalFlowView, { block, editor });
|
|
6840
7137
|
}
|
|
6841
7138
|
|
|
6842
7139
|
// src/mantine/blocks/proposal/ProposalBlockSpec.tsx
|
|
@@ -6892,28 +7189,28 @@ var ProposalBlockSpec = createReactBlockSpec4(
|
|
|
6892
7189
|
{
|
|
6893
7190
|
render: (props) => {
|
|
6894
7191
|
const ixoProps = props;
|
|
6895
|
-
return /* @__PURE__ */
|
|
7192
|
+
return /* @__PURE__ */ React84.createElement(ProposalBlock, { ...ixoProps });
|
|
6896
7193
|
}
|
|
6897
7194
|
}
|
|
6898
7195
|
);
|
|
6899
7196
|
|
|
6900
7197
|
// src/mantine/blocks/apiRequest/ApiRequestBlockSpec.tsx
|
|
6901
|
-
import
|
|
7198
|
+
import React90 from "react";
|
|
6902
7199
|
import { createReactBlockSpec as createReactBlockSpec5 } from "@blocknote/react";
|
|
6903
7200
|
|
|
6904
7201
|
// src/mantine/blocks/apiRequest/ApiRequestBlock.tsx
|
|
6905
|
-
import
|
|
7202
|
+
import React89 from "react";
|
|
6906
7203
|
|
|
6907
7204
|
// src/mantine/blocks/apiRequest/template/TemplateView.tsx
|
|
6908
|
-
import
|
|
7205
|
+
import React87, { useMemo as useMemo12 } from "react";
|
|
6909
7206
|
|
|
6910
7207
|
// src/mantine/blocks/apiRequest/template/TemplateConfig.tsx
|
|
6911
|
-
import
|
|
6912
|
-
import { Paper as
|
|
7208
|
+
import React86, { useCallback as useCallback15 } from "react";
|
|
7209
|
+
import { Paper as Paper9, CloseButton as CloseButton6, Title as Title6 } from "@mantine/core";
|
|
6913
7210
|
|
|
6914
7211
|
// src/mantine/blocks/apiRequest/template/GeneralTab.tsx
|
|
6915
|
-
import
|
|
6916
|
-
import { Divider as
|
|
7212
|
+
import React85, { useEffect as useEffect15, useState as useState22 } from "react";
|
|
7213
|
+
import { Divider as Divider5, Select as Select9, Stack as Stack65, Text as Text40, TextInput as TextInput34, Textarea as Textarea19, Button as Button17, Group as Group23, ActionIcon as ActionIcon9, Paper as Paper8 } from "@mantine/core";
|
|
6917
7214
|
import { IconTrash, IconPlus } from "@tabler/icons-react";
|
|
6918
7215
|
var GeneralTab4 = ({
|
|
6919
7216
|
title,
|
|
@@ -6929,18 +7226,18 @@ var GeneralTab4 = ({
|
|
|
6929
7226
|
onHeadersChange,
|
|
6930
7227
|
onBodyChange
|
|
6931
7228
|
}) => {
|
|
6932
|
-
const [localTitle, setLocalTitle] =
|
|
6933
|
-
const [localDescription, setLocalDescription] =
|
|
6934
|
-
const [localEndpoint, setLocalEndpoint] =
|
|
6935
|
-
const [localMethod, setLocalMethod] =
|
|
6936
|
-
const [localHeaders, setLocalHeaders] =
|
|
6937
|
-
const [localBody, setLocalBody] =
|
|
6938
|
-
|
|
6939
|
-
|
|
6940
|
-
|
|
6941
|
-
|
|
6942
|
-
|
|
6943
|
-
|
|
7229
|
+
const [localTitle, setLocalTitle] = useState22(title || "");
|
|
7230
|
+
const [localDescription, setLocalDescription] = useState22(description || "");
|
|
7231
|
+
const [localEndpoint, setLocalEndpoint] = useState22(endpoint || "");
|
|
7232
|
+
const [localMethod, setLocalMethod] = useState22(method || "GET");
|
|
7233
|
+
const [localHeaders, setLocalHeaders] = useState22(headers || []);
|
|
7234
|
+
const [localBody, setLocalBody] = useState22(body || []);
|
|
7235
|
+
useEffect15(() => setLocalTitle(title || ""), [title]);
|
|
7236
|
+
useEffect15(() => setLocalDescription(description || ""), [description]);
|
|
7237
|
+
useEffect15(() => setLocalEndpoint(endpoint || ""), [endpoint]);
|
|
7238
|
+
useEffect15(() => setLocalMethod(method || "GET"), [method]);
|
|
7239
|
+
useEffect15(() => setLocalHeaders(headers || []), [headers]);
|
|
7240
|
+
useEffect15(() => setLocalBody(body || []), [body]);
|
|
6944
7241
|
const handleAddHeader = () => {
|
|
6945
7242
|
const newHeaders = [...localHeaders, { key: "", value: "" }];
|
|
6946
7243
|
setLocalHeaders(newHeaders);
|
|
@@ -6973,7 +7270,7 @@ var GeneralTab4 = ({
|
|
|
6973
7270
|
setLocalBody(newBody);
|
|
6974
7271
|
onBodyChange(newBody);
|
|
6975
7272
|
};
|
|
6976
|
-
return /* @__PURE__ */
|
|
7273
|
+
return /* @__PURE__ */ React85.createElement(Stack65, { gap: "lg" }, /* @__PURE__ */ React85.createElement(Stack65, { gap: "xs" }, /* @__PURE__ */ React85.createElement(Text40, { size: "sm", fw: 600 }, "Title"), /* @__PURE__ */ React85.createElement(
|
|
6977
7274
|
TextInput34,
|
|
6978
7275
|
{
|
|
6979
7276
|
placeholder: "e.g. Submit User Data",
|
|
@@ -6984,7 +7281,7 @@ var GeneralTab4 = ({
|
|
|
6984
7281
|
onTitleChange(newTitle);
|
|
6985
7282
|
}
|
|
6986
7283
|
}
|
|
6987
|
-
)), /* @__PURE__ */
|
|
7284
|
+
)), /* @__PURE__ */ React85.createElement(Stack65, { gap: "xs" }, /* @__PURE__ */ React85.createElement(Text40, { size: "sm", fw: 600 }, "Description"), /* @__PURE__ */ React85.createElement(
|
|
6988
7285
|
Textarea19,
|
|
6989
7286
|
{
|
|
6990
7287
|
placeholder: "Describe what this API request does",
|
|
@@ -6996,7 +7293,7 @@ var GeneralTab4 = ({
|
|
|
6996
7293
|
onDescriptionChange(newDescription);
|
|
6997
7294
|
}
|
|
6998
7295
|
}
|
|
6999
|
-
)), /* @__PURE__ */
|
|
7296
|
+
)), /* @__PURE__ */ React85.createElement(Divider5, { variant: "dashed" }), /* @__PURE__ */ React85.createElement(Stack65, { gap: "xs" }, /* @__PURE__ */ React85.createElement(Text40, { size: "sm", fw: 600 }, "HTTP Method"), /* @__PURE__ */ React85.createElement(
|
|
7000
7297
|
Select9,
|
|
7001
7298
|
{
|
|
7002
7299
|
value: localMethod,
|
|
@@ -7013,7 +7310,7 @@ var GeneralTab4 = ({
|
|
|
7013
7310
|
{ value: "PATCH", label: "PATCH" }
|
|
7014
7311
|
]
|
|
7015
7312
|
}
|
|
7016
|
-
)), /* @__PURE__ */
|
|
7313
|
+
)), /* @__PURE__ */ React85.createElement(Stack65, { gap: "xs" }, /* @__PURE__ */ React85.createElement(Text40, { size: "sm", fw: 600 }, "Endpoint URL"), /* @__PURE__ */ React85.createElement(
|
|
7017
7314
|
TextInput34,
|
|
7018
7315
|
{
|
|
7019
7316
|
placeholder: "https://api.example.com/endpoint",
|
|
@@ -7024,7 +7321,7 @@ var GeneralTab4 = ({
|
|
|
7024
7321
|
onEndpointChange(newEndpoint);
|
|
7025
7322
|
}
|
|
7026
7323
|
}
|
|
7027
|
-
)), /* @__PURE__ */
|
|
7324
|
+
)), /* @__PURE__ */ React85.createElement(Divider5, { variant: "dashed" }), /* @__PURE__ */ React85.createElement(Stack65, { gap: "xs" }, /* @__PURE__ */ React85.createElement(Group23, { justify: "space-between" }, /* @__PURE__ */ React85.createElement(Text40, { size: "sm", fw: 600 }, "Request Headers"), /* @__PURE__ */ React85.createElement(Button17, { size: "xs", variant: "light", leftSection: /* @__PURE__ */ React85.createElement(IconPlus, { size: 14 }), onClick: handleAddHeader }, "Add Header")), /* @__PURE__ */ React85.createElement(Text40, { size: "xs" }, "Add custom headers to your API request (e.g., Authorization, Content-Type)"), localHeaders.length > 0 && /* @__PURE__ */ React85.createElement(Stack65, { gap: "xs" }, localHeaders.map((header, index) => /* @__PURE__ */ React85.createElement(Paper8, { key: index, p: "xs" }, /* @__PURE__ */ React85.createElement(Group23, { gap: "xs", align: "flex-start" }, /* @__PURE__ */ React85.createElement(
|
|
7028
7325
|
TextInput34,
|
|
7029
7326
|
{
|
|
7030
7327
|
placeholder: "Header key (e.g., Authorization)",
|
|
@@ -7032,7 +7329,7 @@ var GeneralTab4 = ({
|
|
|
7032
7329
|
onChange: (event) => handleHeaderChange(index, "key", event.currentTarget.value),
|
|
7033
7330
|
style: { flex: 1 }
|
|
7034
7331
|
}
|
|
7035
|
-
), /* @__PURE__ */
|
|
7332
|
+
), /* @__PURE__ */ React85.createElement(
|
|
7036
7333
|
TextInput34,
|
|
7037
7334
|
{
|
|
7038
7335
|
placeholder: "Header value (e.g., Bearer token123)",
|
|
@@ -7040,7 +7337,7 @@ var GeneralTab4 = ({
|
|
|
7040
7337
|
onChange: (event) => handleHeaderChange(index, "value", event.currentTarget.value),
|
|
7041
7338
|
style: { flex: 1 }
|
|
7042
7339
|
}
|
|
7043
|
-
), /* @__PURE__ */
|
|
7340
|
+
), /* @__PURE__ */ React85.createElement(ActionIcon9, { color: "red", variant: "subtle", onClick: () => handleRemoveHeader(index) }, /* @__PURE__ */ React85.createElement(IconTrash, { size: 16 }))))))), /* @__PURE__ */ React85.createElement(Divider5, { variant: "dashed" }), /* @__PURE__ */ React85.createElement(Stack65, { gap: "xs" }, /* @__PURE__ */ React85.createElement(Group23, { justify: "space-between" }, /* @__PURE__ */ React85.createElement(Text40, { size: "sm", fw: 600 }, "Request Body (JSON)"), /* @__PURE__ */ React85.createElement(Button17, { size: "xs", variant: "light", leftSection: /* @__PURE__ */ React85.createElement(IconPlus, { size: 14 }), onClick: handleAddBodyField }, "Add Field")), /* @__PURE__ */ React85.createElement(Text40, { size: "xs" }, "Build your JSON request body as key-value pairs"), localBody.length > 0 && /* @__PURE__ */ React85.createElement(Stack65, { gap: "xs" }, localBody.map((field, index) => /* @__PURE__ */ React85.createElement(Paper8, { key: index, p: "xs" }, /* @__PURE__ */ React85.createElement(Group23, { gap: "xs", align: "flex-start" }, /* @__PURE__ */ React85.createElement(
|
|
7044
7341
|
TextInput34,
|
|
7045
7342
|
{
|
|
7046
7343
|
placeholder: "Field key (e.g., name)",
|
|
@@ -7048,7 +7345,7 @@ var GeneralTab4 = ({
|
|
|
7048
7345
|
onChange: (event) => handleBodyFieldChange(index, "key", event.currentTarget.value),
|
|
7049
7346
|
style: { flex: 1 }
|
|
7050
7347
|
}
|
|
7051
|
-
), /* @__PURE__ */
|
|
7348
|
+
), /* @__PURE__ */ React85.createElement(
|
|
7052
7349
|
TextInput34,
|
|
7053
7350
|
{
|
|
7054
7351
|
placeholder: "Field value (e.g., John Doe)",
|
|
@@ -7056,7 +7353,7 @@ var GeneralTab4 = ({
|
|
|
7056
7353
|
onChange: (event) => handleBodyFieldChange(index, "value", event.currentTarget.value),
|
|
7057
7354
|
style: { flex: 1 }
|
|
7058
7355
|
}
|
|
7059
|
-
), /* @__PURE__ */
|
|
7356
|
+
), /* @__PURE__ */ React85.createElement(ActionIcon9, { color: "red", variant: "subtle", onClick: () => handleRemoveBodyField(index) }, /* @__PURE__ */ React85.createElement(IconTrash, { size: 16 }))))))));
|
|
7060
7357
|
};
|
|
7061
7358
|
|
|
7062
7359
|
// src/mantine/blocks/apiRequest/template/TemplateConfig.tsx
|
|
@@ -7085,8 +7382,8 @@ var TemplateConfig4 = ({ editor, block }) => {
|
|
|
7085
7382
|
},
|
|
7086
7383
|
[updateProp]
|
|
7087
7384
|
);
|
|
7088
|
-
return /* @__PURE__ */
|
|
7089
|
-
|
|
7385
|
+
return /* @__PURE__ */ React86.createElement(
|
|
7386
|
+
Paper9,
|
|
7090
7387
|
{
|
|
7091
7388
|
p: "md",
|
|
7092
7389
|
shadow: "sm",
|
|
@@ -7096,7 +7393,7 @@ var TemplateConfig4 = ({ editor, block }) => {
|
|
|
7096
7393
|
flexDirection: "column"
|
|
7097
7394
|
}
|
|
7098
7395
|
},
|
|
7099
|
-
/* @__PURE__ */
|
|
7396
|
+
/* @__PURE__ */ React86.createElement(
|
|
7100
7397
|
"div",
|
|
7101
7398
|
{
|
|
7102
7399
|
style: {
|
|
@@ -7106,17 +7403,17 @@ var TemplateConfig4 = ({ editor, block }) => {
|
|
|
7106
7403
|
marginBottom: "1rem"
|
|
7107
7404
|
}
|
|
7108
7405
|
},
|
|
7109
|
-
/* @__PURE__ */
|
|
7110
|
-
/* @__PURE__ */
|
|
7406
|
+
/* @__PURE__ */ React86.createElement(Title6, { order: 3 }, "API Request Settings"),
|
|
7407
|
+
/* @__PURE__ */ React86.createElement(CloseButton6, { onClick: closePanel })
|
|
7111
7408
|
),
|
|
7112
|
-
/* @__PURE__ */
|
|
7409
|
+
/* @__PURE__ */ React86.createElement(
|
|
7113
7410
|
ReusablePanel,
|
|
7114
7411
|
{
|
|
7115
7412
|
extraTabs: [
|
|
7116
7413
|
{
|
|
7117
7414
|
label: "General",
|
|
7118
7415
|
value: "general",
|
|
7119
|
-
content: /* @__PURE__ */
|
|
7416
|
+
content: /* @__PURE__ */ React86.createElement(
|
|
7120
7417
|
GeneralTab4,
|
|
7121
7418
|
{
|
|
7122
7419
|
title: block.props.title || "",
|
|
@@ -7154,11 +7451,11 @@ var TemplateConfig4 = ({ editor, block }) => {
|
|
|
7154
7451
|
};
|
|
7155
7452
|
|
|
7156
7453
|
// src/mantine/blocks/apiRequest/template/TemplateView.tsx
|
|
7157
|
-
import { Card as Card19, Group as
|
|
7454
|
+
import { Card as Card19, Group as Group24, Stack as Stack66, Text as Text41, ActionIcon as ActionIcon10, Badge as Badge10 } from "@mantine/core";
|
|
7158
7455
|
var API_REQUEST_TEMPLATE_PANEL_ID = "api-request-template-panel";
|
|
7159
7456
|
var ApiRequestTemplateView = ({ editor, block }) => {
|
|
7160
7457
|
const panelId = `${API_REQUEST_TEMPLATE_PANEL_ID}-${block.id}`;
|
|
7161
|
-
const panelContent =
|
|
7458
|
+
const panelContent = useMemo12(() => /* @__PURE__ */ React87.createElement(TemplateConfig4, { editor, block }), [editor, block]);
|
|
7162
7459
|
const { open } = usePanel(panelId, panelContent);
|
|
7163
7460
|
const method = block.props.method || "GET";
|
|
7164
7461
|
const endpoint = block.props.endpoint || "https://api.example.com/endpoint";
|
|
@@ -7178,17 +7475,17 @@ var ApiRequestTemplateView = ({ editor, block }) => {
|
|
|
7178
7475
|
return "gray";
|
|
7179
7476
|
}
|
|
7180
7477
|
};
|
|
7181
|
-
return /* @__PURE__ */
|
|
7478
|
+
return /* @__PURE__ */ React87.createElement(Card19, { withBorder: true, padding: "md", radius: "md", style: { width: "100%", cursor: "pointer", position: "relative" }, onClick: open }, /* @__PURE__ */ React87.createElement(Badge10, { size: "xs", variant: "light", color: "gray", style: { position: "absolute", top: 8, right: 8 } }, "Template"), /* @__PURE__ */ React87.createElement(Group24, { wrap: "nowrap", justify: "space-between", align: "center" }, /* @__PURE__ */ React87.createElement(Group24, { wrap: "nowrap", align: "center" }, /* @__PURE__ */ React87.createElement(ActionIcon10, { variant: "light", color: "violet", size: "lg", radius: "xl", style: { flexShrink: 0 } }, getIcon(block.props.icon, 18, 1.5, "square-check")), /* @__PURE__ */ React87.createElement(Stack66, { gap: "xs", style: { flex: 1 } }, /* @__PURE__ */ React87.createElement(Group24, { gap: "xs", wrap: "nowrap" }, /* @__PURE__ */ React87.createElement(Badge10, { size: "sm", variant: "filled", color: getMethodColor(method) }, method), /* @__PURE__ */ React87.createElement(Text41, { fw: 500, size: "sm", contentEditable: false }, block.props.title || "API Request")), /* @__PURE__ */ React87.createElement(Text41, { size: "xs", c: "dimmed", contentEditable: false, lineClamp: 1 }, endpoint), block.props.description && /* @__PURE__ */ React87.createElement(Text41, { size: "xs", c: "dimmed", contentEditable: false }, block.props.description)))));
|
|
7182
7479
|
};
|
|
7183
7480
|
|
|
7184
7481
|
// src/mantine/blocks/apiRequest/flow/FlowView.tsx
|
|
7185
|
-
import
|
|
7186
|
-
import { Card as Card20, Group as
|
|
7482
|
+
import React88, { useState as useState23 } from "react";
|
|
7483
|
+
import { Card as Card20, Group as Group25, Stack as Stack67, Text as Text42, ActionIcon as ActionIcon11, Tooltip as Tooltip4, Button as Button18, Badge as Badge11, Collapse, Code, Loader as Loader3, Alert as Alert9 } from "@mantine/core";
|
|
7187
7484
|
import { IconSend, IconChevronDown, IconChevronUp } from "@tabler/icons-react";
|
|
7188
7485
|
var ApiRequestFlowView = ({ editor, block, isDisabled }) => {
|
|
7189
7486
|
const disabled = isDisabled?.isDisabled === "disable";
|
|
7190
|
-
const [isLoading, setIsLoading] =
|
|
7191
|
-
const [showDetails, setShowDetails] =
|
|
7487
|
+
const [isLoading, setIsLoading] = useState23(false);
|
|
7488
|
+
const [showDetails, setShowDetails] = useState23(false);
|
|
7192
7489
|
const method = block.props.method || "GET";
|
|
7193
7490
|
const endpoint = block.props.endpoint || "";
|
|
7194
7491
|
const headers = (() => {
|
|
@@ -7301,21 +7598,21 @@ var ApiRequestFlowView = ({ editor, block, isDisabled }) => {
|
|
|
7301
7598
|
setIsLoading(false);
|
|
7302
7599
|
}
|
|
7303
7600
|
};
|
|
7304
|
-
const executeButton = /* @__PURE__ */
|
|
7601
|
+
const executeButton = /* @__PURE__ */ React88.createElement(
|
|
7305
7602
|
Button18,
|
|
7306
7603
|
{
|
|
7307
7604
|
size: "sm",
|
|
7308
7605
|
variant: "light",
|
|
7309
7606
|
color: getMethodColor(method),
|
|
7310
|
-
leftSection: isLoading ? /* @__PURE__ */
|
|
7607
|
+
leftSection: isLoading ? /* @__PURE__ */ React88.createElement(Loader3, { size: 14 }) : /* @__PURE__ */ React88.createElement(IconSend, { size: 14 }),
|
|
7311
7608
|
onClick: handleExecuteRequest,
|
|
7312
7609
|
disabled: disabled || isLoading || !endpoint,
|
|
7313
7610
|
style: { flexShrink: 0 }
|
|
7314
7611
|
},
|
|
7315
7612
|
isLoading ? "Sending..." : "Execute"
|
|
7316
7613
|
);
|
|
7317
|
-
return /* @__PURE__ */
|
|
7318
|
-
|
|
7614
|
+
return /* @__PURE__ */ React88.createElement(Card20, { withBorder: true, padding: "md", radius: "md", style: { width: "100%" } }, /* @__PURE__ */ React88.createElement(Stack67, { gap: "md" }, /* @__PURE__ */ React88.createElement(Group25, { wrap: "nowrap", justify: "space-between", align: "flex-start" }, /* @__PURE__ */ React88.createElement(Group25, { wrap: "nowrap", align: "flex-start", style: { flex: 1 } }, /* @__PURE__ */ React88.createElement(ActionIcon11, { variant: "light", color: "violet", size: "lg", radius: "xl", style: { flexShrink: 0 } }, getIcon(block.props.icon, 18, 1.5, "square-check")), /* @__PURE__ */ React88.createElement(Stack67, { gap: "xs", style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ React88.createElement(Group25, { gap: "xs", wrap: "nowrap" }, /* @__PURE__ */ React88.createElement(Badge11, { size: "sm", variant: "filled", color: getMethodColor(method) }, method), /* @__PURE__ */ React88.createElement(Text42, { fw: 500, size: "sm", contentEditable: false }, block.props.title || "API Request"), status !== "idle" && /* @__PURE__ */ React88.createElement(Badge11, { size: "xs", variant: "dot", color: getStatusColor(status) }, status)), /* @__PURE__ */ React88.createElement(
|
|
7615
|
+
Text42,
|
|
7319
7616
|
{
|
|
7320
7617
|
size: "xs",
|
|
7321
7618
|
c: "dimmed",
|
|
@@ -7327,7 +7624,7 @@ var ApiRequestFlowView = ({ editor, block, isDisabled }) => {
|
|
|
7327
7624
|
}
|
|
7328
7625
|
},
|
|
7329
7626
|
endpoint || "No endpoint configured"
|
|
7330
|
-
), block.props.description && /* @__PURE__ */
|
|
7627
|
+
), block.props.description && /* @__PURE__ */ React88.createElement(Text42, { size: "xs", c: "dimmed", contentEditable: false }, block.props.description))), /* @__PURE__ */ React88.createElement(Group25, { gap: "xs", style: { flexShrink: 0 } }, disabled && isDisabled?.message ? /* @__PURE__ */ React88.createElement(Tooltip4, { label: isDisabled.message, position: "left", withArrow: true }, executeButton) : executeButton, /* @__PURE__ */ React88.createElement(ActionIcon11, { variant: "subtle", onClick: () => setShowDetails(!showDetails), disabled: headers.length === 0 && body.length === 0 && !response }, showDetails ? /* @__PURE__ */ React88.createElement(IconChevronUp, { size: 16 }) : /* @__PURE__ */ React88.createElement(IconChevronDown, { size: 16 })))), /* @__PURE__ */ React88.createElement(Collapse, { in: showDetails }, /* @__PURE__ */ React88.createElement(Stack67, { gap: "md" }, headers.length > 0 && /* @__PURE__ */ React88.createElement(Stack67, { gap: "xs" }, /* @__PURE__ */ React88.createElement(Text42, { size: "xs", fw: 600, c: "dimmed" }, "Headers:"), /* @__PURE__ */ React88.createElement(Code, { block: true, style: { fontSize: "11px" } }, JSON.stringify(
|
|
7331
7628
|
headers.reduce(
|
|
7332
7629
|
(acc, h) => {
|
|
7333
7630
|
if (h.key && h.value) acc[h.key] = h.value;
|
|
@@ -7337,7 +7634,7 @@ var ApiRequestFlowView = ({ editor, block, isDisabled }) => {
|
|
|
7337
7634
|
),
|
|
7338
7635
|
null,
|
|
7339
7636
|
2
|
|
7340
|
-
))), method !== "GET" && body.length > 0 && /* @__PURE__ */
|
|
7637
|
+
))), method !== "GET" && body.length > 0 && /* @__PURE__ */ React88.createElement(Stack67, { gap: "xs" }, /* @__PURE__ */ React88.createElement(Text42, { size: "xs", fw: 600, c: "dimmed" }, "Body:"), /* @__PURE__ */ React88.createElement(Code, { block: true, style: { fontSize: "11px" } }, JSON.stringify(
|
|
7341
7638
|
body.reduce(
|
|
7342
7639
|
(acc, b) => {
|
|
7343
7640
|
if (b.key && b.value) acc[b.key] = b.value;
|
|
@@ -7347,7 +7644,7 @@ var ApiRequestFlowView = ({ editor, block, isDisabled }) => {
|
|
|
7347
7644
|
),
|
|
7348
7645
|
null,
|
|
7349
7646
|
2
|
|
7350
|
-
))), response && /* @__PURE__ */
|
|
7647
|
+
))), response && /* @__PURE__ */ React88.createElement(Stack67, { gap: "xs" }, /* @__PURE__ */ React88.createElement(Text42, { size: "xs", fw: 600, c: "dimmed" }, "Response:"), status === "error" ? /* @__PURE__ */ React88.createElement(Alert9, { color: "red", title: "Error", styles: { message: { fontSize: "11px" } } }, /* @__PURE__ */ React88.createElement(Code, { block: true, style: { fontSize: "11px" } }, response)) : /* @__PURE__ */ React88.createElement(Code, { block: true, style: { fontSize: "11px", maxHeight: "300px", overflow: "auto" } }, response))))));
|
|
7351
7648
|
};
|
|
7352
7649
|
|
|
7353
7650
|
// src/mantine/blocks/apiRequest/ApiRequestBlock.tsx
|
|
@@ -7361,7 +7658,7 @@ function ApiRequestBlock({ editor, block }) {
|
|
|
7361
7658
|
});
|
|
7362
7659
|
if (docType === "template") {
|
|
7363
7660
|
console.log("[ApiRequestBlock] Rendering template view for block:", block.id);
|
|
7364
|
-
return /* @__PURE__ */
|
|
7661
|
+
return /* @__PURE__ */ React89.createElement(ApiRequestTemplateView, { editor, block });
|
|
7365
7662
|
}
|
|
7366
7663
|
const conditionConfig = parseConditionConfig(block.props.conditions);
|
|
7367
7664
|
const hasVisibility = hasVisibilityConditions(conditionConfig);
|
|
@@ -7381,7 +7678,7 @@ function ApiRequestBlock({ editor, block }) {
|
|
|
7381
7678
|
shouldDisable,
|
|
7382
7679
|
actions
|
|
7383
7680
|
});
|
|
7384
|
-
return /* @__PURE__ */
|
|
7681
|
+
return /* @__PURE__ */ React89.createElement(
|
|
7385
7682
|
ApiRequestFlowView,
|
|
7386
7683
|
{
|
|
7387
7684
|
block,
|
|
@@ -7435,36 +7732,36 @@ var ApiRequestBlockSpec = createReactBlockSpec5(
|
|
|
7435
7732
|
{
|
|
7436
7733
|
render: (props) => {
|
|
7437
7734
|
const ixoProps = props;
|
|
7438
|
-
return /* @__PURE__ */
|
|
7735
|
+
return /* @__PURE__ */ React90.createElement(ApiRequestBlock, { ...ixoProps });
|
|
7439
7736
|
}
|
|
7440
7737
|
}
|
|
7441
7738
|
);
|
|
7442
7739
|
|
|
7443
7740
|
// src/mantine/blocks/enumChecklist/EnumChecklistBlock.tsx
|
|
7444
|
-
import
|
|
7741
|
+
import React97, { useState as useState25, useEffect as useEffect16, useMemo as useMemo13, useCallback as useCallback16 } from "react";
|
|
7445
7742
|
import { createReactBlockSpec as createReactBlockSpec6 } from "@blocknote/react";
|
|
7446
|
-
import { Stack as
|
|
7743
|
+
import { Stack as Stack73, Text as Text48, Button as Button23, ActionIcon as ActionIcon12, Center as Center3, Flex as Flex17 } from "@mantine/core";
|
|
7447
7744
|
|
|
7448
7745
|
// src/mantine/blocks/enumChecklist/oracle_personalities/index.tsx
|
|
7449
|
-
import
|
|
7450
|
-
import { Box as Box15, Flex as
|
|
7746
|
+
import React91 from "react";
|
|
7747
|
+
import { Box as Box15, Flex as Flex16, Stack as Stack68, Text as Text43, Image as Image11 } from "@mantine/core";
|
|
7451
7748
|
function OraclePersonalitiesEnumList({ selectionMode, isItemChecked, onItemCheck, items }) {
|
|
7452
7749
|
if (!items || items.length === 0) {
|
|
7453
|
-
return /* @__PURE__ */
|
|
7750
|
+
return /* @__PURE__ */ React91.createElement(Text43, { size: "sm", c: "dimmed", ta: "center", py: "md" }, "No assets found");
|
|
7454
7751
|
}
|
|
7455
|
-
const rows = items.map(({ id, name, description, voice, icon }) => /* @__PURE__ */
|
|
7456
|
-
return /* @__PURE__ */
|
|
7752
|
+
const rows = items.map(({ id, name, description, voice, icon }) => /* @__PURE__ */ React91.createElement(ListItemContainer, { key: id }, /* @__PURE__ */ React91.createElement(Flex16, { align: "center", gap: "sm" }, /* @__PURE__ */ React91.createElement(Image11, { radius: 16, w: 62, h: 62, src: icon, alt: name }), /* @__PURE__ */ React91.createElement(Stack68, { gap: 0 }, /* @__PURE__ */ React91.createElement(Text43, { size: "sm", fw: 500 }, name || "-"), description !== void 0 && /* @__PURE__ */ React91.createElement(Text43, { size: "sm", c: "dimmed" }, description))), /* @__PURE__ */ React91.createElement(Flex16, { align: "center", gap: "md" }, /* @__PURE__ */ React91.createElement(Stack68, { ta: "right", gap: 0 }, /* @__PURE__ */ React91.createElement(Text43, { size: "sm", fw: 500 }, "Voice"), /* @__PURE__ */ React91.createElement(Text43, { size: "sm", c: "dimmed" }, voice)), selectionMode && /* @__PURE__ */ React91.createElement(ListItemCheckbox, { ariaLabel: `Select oracle ${name}`, checked: isItemChecked?.(id), onCheck: (checked) => onItemCheck?.(id, checked) }))));
|
|
7753
|
+
return /* @__PURE__ */ React91.createElement(Box15, { flex: 1 }, /* @__PURE__ */ React91.createElement(Stack68, null, rows));
|
|
7457
7754
|
}
|
|
7458
7755
|
|
|
7459
7756
|
// src/mantine/blocks/enumChecklist/EnumChecklistConfigModal.tsx
|
|
7460
|
-
import
|
|
7461
|
-
import { Modal, Group as
|
|
7757
|
+
import React96, { useState as useState24 } from "react";
|
|
7758
|
+
import { Modal, Group as Group29, Box as Box17 } from "@mantine/core";
|
|
7462
7759
|
|
|
7463
7760
|
// src/mantine/blocks/list/modal/ModalNavigation.tsx
|
|
7464
|
-
import
|
|
7465
|
-
import { Stack as
|
|
7761
|
+
import React92 from "react";
|
|
7762
|
+
import { Stack as Stack69, Button as Button19, Text as Text44 } from "@mantine/core";
|
|
7466
7763
|
var ModalNavigation = ({ steps, activeStep, onStepChange, showUpdateButton = false, onUpdateBlock }) => {
|
|
7467
|
-
return /* @__PURE__ */
|
|
7764
|
+
return /* @__PURE__ */ React92.createElement(Stack69, { gap: "xs", style: { height: "100%" } }, /* @__PURE__ */ React92.createElement(Stack69, { gap: "xs", style: { flex: 1 } }, steps.map((step) => /* @__PURE__ */ React92.createElement(
|
|
7468
7765
|
Button19,
|
|
7469
7766
|
{
|
|
7470
7767
|
key: step.id,
|
|
@@ -7482,13 +7779,13 @@ var ModalNavigation = ({ steps, activeStep, onStepChange, showUpdateButton = fal
|
|
|
7482
7779
|
}
|
|
7483
7780
|
}
|
|
7484
7781
|
},
|
|
7485
|
-
/* @__PURE__ */
|
|
7486
|
-
))), showUpdateButton && /* @__PURE__ */
|
|
7782
|
+
/* @__PURE__ */ React92.createElement(Stack69, { gap: 2, align: "flex-start" }, /* @__PURE__ */ React92.createElement(Text44, { size: "sm", fw: 500 }, step.label), /* @__PURE__ */ React92.createElement(Text44, { size: "xs", opacity: 0.7 }, step.description))
|
|
7783
|
+
))), showUpdateButton && /* @__PURE__ */ React92.createElement(Button19, { variant: "filled", color: "blue", onClick: onUpdateBlock, style: { marginTop: "auto" } }, "Update Block"));
|
|
7487
7784
|
};
|
|
7488
7785
|
|
|
7489
7786
|
// src/mantine/blocks/enumChecklist/EnumChecklistTypeSelection.tsx
|
|
7490
|
-
import
|
|
7491
|
-
import { Stack as
|
|
7787
|
+
import React93 from "react";
|
|
7788
|
+
import { Stack as Stack70, Card as Card21, Group as Group26, Text as Text45, Box as Box16, Button as Button20 } from "@mantine/core";
|
|
7492
7789
|
|
|
7493
7790
|
// src/mantine/blocks/enumChecklist/oracle_personalities/config.ts
|
|
7494
7791
|
var oraclePersonalitiesMetadata = {
|
|
@@ -7617,7 +7914,7 @@ function getEnumListItems(type) {
|
|
|
7617
7914
|
// src/mantine/blocks/enumChecklist/EnumChecklistTypeSelection.tsx
|
|
7618
7915
|
var EnumChecklistTypeSelection = ({ selectedType, onTypeSelect, onNext }) => {
|
|
7619
7916
|
const enumListsMeta = getEnumListTypesMetadata();
|
|
7620
|
-
return /* @__PURE__ */
|
|
7917
|
+
return /* @__PURE__ */ React93.createElement(Stack70, { gap: "md" }, /* @__PURE__ */ React93.createElement("div", null, /* @__PURE__ */ React93.createElement(Text45, { size: "lg", fw: 600, mb: "xs" }, "Choose List Type"), /* @__PURE__ */ React93.createElement(Text45, { size: "sm", c: "dimmed" }, "Select the type of list you want to create")), /* @__PURE__ */ React93.createElement(Stack70, { gap: "sm" }, enumListsMeta.map((enumChecklistMeta) => /* @__PURE__ */ React93.createElement(
|
|
7621
7918
|
Card21,
|
|
7622
7919
|
{
|
|
7623
7920
|
key: enumChecklistMeta.id,
|
|
@@ -7630,7 +7927,7 @@ var EnumChecklistTypeSelection = ({ selectedType, onTypeSelect, onNext }) => {
|
|
|
7630
7927
|
},
|
|
7631
7928
|
onClick: () => onTypeSelect(enumChecklistMeta.id)
|
|
7632
7929
|
},
|
|
7633
|
-
/* @__PURE__ */
|
|
7930
|
+
/* @__PURE__ */ React93.createElement(Group26, { gap: "md", align: "flex-start" }, /* @__PURE__ */ React93.createElement(
|
|
7634
7931
|
Box16,
|
|
7635
7932
|
{
|
|
7636
7933
|
style: {
|
|
@@ -7646,35 +7943,35 @@ var EnumChecklistTypeSelection = ({ selectedType, onTypeSelect, onNext }) => {
|
|
|
7646
7943
|
}
|
|
7647
7944
|
},
|
|
7648
7945
|
enumChecklistMeta.icon
|
|
7649
|
-
), /* @__PURE__ */
|
|
7650
|
-
))), /* @__PURE__ */
|
|
7946
|
+
), /* @__PURE__ */ React93.createElement(Stack70, { gap: 2, style: { flex: 1 } }, /* @__PURE__ */ React93.createElement(Text45, { size: "md", fw: 600 }, enumChecklistMeta.name), /* @__PURE__ */ React93.createElement(Text45, { size: "sm", c: "dimmed" }, enumChecklistMeta.description)))
|
|
7947
|
+
))), /* @__PURE__ */ React93.createElement(Group26, { justify: "flex-end", mt: "md" }, /* @__PURE__ */ React93.createElement(Button20, { onClick: onNext, disabled: !selectedType }, "Next")));
|
|
7651
7948
|
};
|
|
7652
7949
|
|
|
7653
7950
|
// src/mantine/blocks/enumChecklist/EnumChecklistPreviewStep.tsx
|
|
7654
|
-
import
|
|
7655
|
-
import { Stack as
|
|
7951
|
+
import React94 from "react";
|
|
7952
|
+
import { Stack as Stack71, Text as Text46, Button as Button21, Group as Group27 } from "@mantine/core";
|
|
7656
7953
|
var EnumChecklistPreviewStep = ({ listType, onAddToBlock, onPrev }) => {
|
|
7657
7954
|
const renderListComponent = () => {
|
|
7658
7955
|
switch (listType) {
|
|
7659
7956
|
case "oracle_personalities":
|
|
7660
|
-
return /* @__PURE__ */
|
|
7957
|
+
return /* @__PURE__ */ React94.createElement(OraclePersonalitiesEnumList, { items: getEnumListItems(listType) });
|
|
7661
7958
|
default:
|
|
7662
7959
|
return null;
|
|
7663
7960
|
}
|
|
7664
7961
|
};
|
|
7665
|
-
return /* @__PURE__ */
|
|
7962
|
+
return /* @__PURE__ */ React94.createElement(Stack71, { gap: "md" }, /* @__PURE__ */ React94.createElement("div", null, /* @__PURE__ */ React94.createElement(Text46, { size: "lg", fw: 600, mb: "xs" }, "Preview ", getEnumListNameByType(listType)), /* @__PURE__ */ React94.createElement(Text46, { size: "sm", c: "dimmed" }, "Preview how your list will look with the current configuration")), /* @__PURE__ */ React94.createElement("div", { style: { maxHeight: "400px", overflow: "auto" } }, renderListComponent()), /* @__PURE__ */ React94.createElement(Group27, { justify: "space-between", mt: "md" }, /* @__PURE__ */ React94.createElement(Button21, { variant: "subtle", onClick: onPrev }, "Previous"), /* @__PURE__ */ React94.createElement(Button21, { onClick: onAddToBlock }, "Add to Block")));
|
|
7666
7963
|
};
|
|
7667
7964
|
|
|
7668
7965
|
// src/mantine/blocks/enumChecklist/EnumChecklistConfigurationStep.tsx
|
|
7669
|
-
import
|
|
7670
|
-
import { Stack as
|
|
7966
|
+
import React95 from "react";
|
|
7967
|
+
import { Stack as Stack72, TextInput as TextInput35, Text as Text47, Button as Button22, Group as Group28, Switch as Switch4, Select as Select10 } from "@mantine/core";
|
|
7671
7968
|
var EnumChecklistConfigurationStep = ({ enumChecklistType: listType, config, onConfigChange, onPrev, onNext, isValid }) => {
|
|
7672
7969
|
const typeConfig = ENUM_LIST_CONFIG[listType];
|
|
7673
7970
|
const configFields = getEnumListTypesConfigFields(listType);
|
|
7674
7971
|
const renderListConfigField = (field) => {
|
|
7675
7972
|
switch (field.type) {
|
|
7676
7973
|
case "text":
|
|
7677
|
-
return /* @__PURE__ */
|
|
7974
|
+
return /* @__PURE__ */ React95.createElement(
|
|
7678
7975
|
TextInput35,
|
|
7679
7976
|
{
|
|
7680
7977
|
label: field.label,
|
|
@@ -7686,7 +7983,7 @@ var EnumChecklistConfigurationStep = ({ enumChecklistType: listType, config, onC
|
|
|
7686
7983
|
}
|
|
7687
7984
|
);
|
|
7688
7985
|
case "switch":
|
|
7689
|
-
return /* @__PURE__ */
|
|
7986
|
+
return /* @__PURE__ */ React95.createElement(
|
|
7690
7987
|
Switch4,
|
|
7691
7988
|
{
|
|
7692
7989
|
label: field.label,
|
|
@@ -7696,7 +7993,7 @@ var EnumChecklistConfigurationStep = ({ enumChecklistType: listType, config, onC
|
|
|
7696
7993
|
}
|
|
7697
7994
|
);
|
|
7698
7995
|
case "select":
|
|
7699
|
-
return /* @__PURE__ */
|
|
7996
|
+
return /* @__PURE__ */ React95.createElement(
|
|
7700
7997
|
Select10,
|
|
7701
7998
|
{
|
|
7702
7999
|
label: field.label,
|
|
@@ -7709,7 +8006,7 @@ var EnumChecklistConfigurationStep = ({ enumChecklistType: listType, config, onC
|
|
|
7709
8006
|
}
|
|
7710
8007
|
);
|
|
7711
8008
|
default:
|
|
7712
|
-
return /* @__PURE__ */
|
|
8009
|
+
return /* @__PURE__ */ React95.createElement(
|
|
7713
8010
|
TextInput35,
|
|
7714
8011
|
{
|
|
7715
8012
|
label: field.label,
|
|
@@ -7722,14 +8019,14 @@ var EnumChecklistConfigurationStep = ({ enumChecklistType: listType, config, onC
|
|
|
7722
8019
|
);
|
|
7723
8020
|
}
|
|
7724
8021
|
};
|
|
7725
|
-
return /* @__PURE__ */
|
|
8022
|
+
return /* @__PURE__ */ React95.createElement(Stack72, { gap: "md" }, /* @__PURE__ */ React95.createElement("div", null, /* @__PURE__ */ React95.createElement(Text47, { size: "lg", fw: 600, mb: "xs" }, "Configure ", typeConfig.metadata.name), /* @__PURE__ */ React95.createElement(Text47, { size: "sm", c: "dimmed" }, typeConfig.metadata.description)), /* @__PURE__ */ React95.createElement(Stack72, { gap: "sm" }, configFields.map((field) => /* @__PURE__ */ React95.createElement("div", { key: field.key }, renderListConfigField(field)))), /* @__PURE__ */ React95.createElement(Group28, { justify: "space-between", mt: "md" }, /* @__PURE__ */ React95.createElement(Button22, { variant: "subtle", onClick: onPrev }, "Previous"), /* @__PURE__ */ React95.createElement(Button22, { onClick: onNext, disabled: !isValid }, "Next")));
|
|
7726
8023
|
};
|
|
7727
8024
|
|
|
7728
8025
|
// src/mantine/blocks/enumChecklist/EnumChecklistConfigModal.tsx
|
|
7729
8026
|
var EnumChecklistConfigModal = ({ opened, onClose, onSave, initialConfig }) => {
|
|
7730
|
-
const [activeStep, setActiveStep] =
|
|
7731
|
-
const [selectedType, setSelectedType] =
|
|
7732
|
-
const [config, setConfig] =
|
|
8027
|
+
const [activeStep, setActiveStep] = useState24("type");
|
|
8028
|
+
const [selectedType, setSelectedType] = useState24(initialConfig?.listType || null);
|
|
8029
|
+
const [config, setConfig] = useState24(initialConfig?.listConfig || {});
|
|
7733
8030
|
const handleTypeSelect = (type) => {
|
|
7734
8031
|
setSelectedType(type);
|
|
7735
8032
|
const configFieldsByType = getEnumListTypesConfigFields(type);
|
|
@@ -7784,9 +8081,9 @@ var EnumChecklistConfigModal = ({ opened, onClose, onSave, initialConfig }) => {
|
|
|
7784
8081
|
const renderStepContent = () => {
|
|
7785
8082
|
switch (activeStep) {
|
|
7786
8083
|
case "type":
|
|
7787
|
-
return /* @__PURE__ */
|
|
8084
|
+
return /* @__PURE__ */ React96.createElement(EnumChecklistTypeSelection, { selectedType, onTypeSelect: handleTypeSelect, onNext: () => setActiveStep("configure") });
|
|
7788
8085
|
case "configure":
|
|
7789
|
-
return selectedType ? /* @__PURE__ */
|
|
8086
|
+
return selectedType ? /* @__PURE__ */ React96.createElement(
|
|
7790
8087
|
EnumChecklistConfigurationStep,
|
|
7791
8088
|
{
|
|
7792
8089
|
enumChecklistType: selectedType,
|
|
@@ -7798,22 +8095,22 @@ var EnumChecklistConfigModal = ({ opened, onClose, onSave, initialConfig }) => {
|
|
|
7798
8095
|
}
|
|
7799
8096
|
) : null;
|
|
7800
8097
|
case "preview":
|
|
7801
|
-
return selectedType ? /* @__PURE__ */
|
|
8098
|
+
return selectedType ? /* @__PURE__ */ React96.createElement(EnumChecklistPreviewStep, { listType: selectedType, onAddToBlock: handleAddToBlock, onPrev: () => setActiveStep("configure") }) : null;
|
|
7802
8099
|
default:
|
|
7803
8100
|
return null;
|
|
7804
8101
|
}
|
|
7805
8102
|
};
|
|
7806
|
-
return /* @__PURE__ */
|
|
8103
|
+
return /* @__PURE__ */ React96.createElement(Modal, { opened, onClose: handleClose, title: "Configure Enum Checklist Block", size: "xl" }, /* @__PURE__ */ React96.createElement(Group29, { align: "flex-start", gap: "lg", style: { minHeight: "400px" } }, /* @__PURE__ */ React96.createElement(Box17, { style: { width: "200px", flexShrink: 0, height: "400px", display: "flex" } }, /* @__PURE__ */ React96.createElement(ModalNavigation, { steps, activeStep, onStepChange: setActiveStep, showUpdateButton: selectedType !== null, onUpdateBlock: handleAddToBlock })), /* @__PURE__ */ React96.createElement(Box17, { style: { flex: 1 } }, renderStepContent())));
|
|
7807
8104
|
};
|
|
7808
8105
|
|
|
7809
8106
|
// src/mantine/blocks/enumChecklist/EnumChecklistBlock.tsx
|
|
7810
|
-
var IconSettings2 = () => /* @__PURE__ */
|
|
8107
|
+
var IconSettings2 = () => /* @__PURE__ */ React97.createElement("span", null, "\u2699\uFE0F");
|
|
7811
8108
|
var EnumChecklistBlockType = "enumChecklist";
|
|
7812
8109
|
var EnumChecklistBlockContent = ({ block, editor }) => {
|
|
7813
|
-
const [modalOpened, setModalOpened] =
|
|
8110
|
+
const [modalOpened, setModalOpened] = useState25(false);
|
|
7814
8111
|
const { editable } = useBlocknoteContext();
|
|
7815
8112
|
const listType = block.props.listType && block.props.listType !== "" ? block.props.listType : null;
|
|
7816
|
-
const listConfig =
|
|
8113
|
+
const listConfig = useMemo13(() => {
|
|
7817
8114
|
if (block.props.listConfig && block.props.listConfig !== "{}") {
|
|
7818
8115
|
try {
|
|
7819
8116
|
return JSON.parse(block.props.listConfig);
|
|
@@ -7824,7 +8121,7 @@ var EnumChecklistBlockContent = ({ block, editor }) => {
|
|
|
7824
8121
|
}
|
|
7825
8122
|
return {};
|
|
7826
8123
|
}, [block.props.listConfig]);
|
|
7827
|
-
const selectedIds =
|
|
8124
|
+
const selectedIds = useMemo13(() => {
|
|
7828
8125
|
if (block.props.selectedIds && block.props.selectedIds !== "[]") {
|
|
7829
8126
|
try {
|
|
7830
8127
|
return new Set(JSON.parse(block.props.selectedIds));
|
|
@@ -7835,7 +8132,7 @@ var EnumChecklistBlockContent = ({ block, editor }) => {
|
|
|
7835
8132
|
}
|
|
7836
8133
|
return /* @__PURE__ */ new Set();
|
|
7837
8134
|
}, [block.props.selectedIds]);
|
|
7838
|
-
|
|
8135
|
+
useEffect16(() => {
|
|
7839
8136
|
if (listConfig?.selection_mode === "single" && selectedIds.size > 1) {
|
|
7840
8137
|
const arr = Array.from(selectedIds);
|
|
7841
8138
|
const lastSelected = arr.length > 0 ? arr[arr.length - 1] : void 0;
|
|
@@ -7893,7 +8190,7 @@ var EnumChecklistBlockContent = ({ block, editor }) => {
|
|
|
7893
8190
|
if (!listType) return null;
|
|
7894
8191
|
switch (listType) {
|
|
7895
8192
|
case "oracle_personalities":
|
|
7896
|
-
return /* @__PURE__ */
|
|
8193
|
+
return /* @__PURE__ */ React97.createElement(
|
|
7897
8194
|
OraclePersonalitiesEnumList,
|
|
7898
8195
|
{
|
|
7899
8196
|
items: getEnumListItems(listType),
|
|
@@ -7906,7 +8203,7 @@ var EnumChecklistBlockContent = ({ block, editor }) => {
|
|
|
7906
8203
|
return null;
|
|
7907
8204
|
}
|
|
7908
8205
|
};
|
|
7909
|
-
return /* @__PURE__ */
|
|
8206
|
+
return /* @__PURE__ */ React97.createElement(Stack73, { w: "100%" }, listType && /* @__PURE__ */ React97.createElement(Flex17, { align: "center", justify: "space-between", gap: "xs" }, /* @__PURE__ */ React97.createElement(Text48, null, getEnumListNameByType(listType)), listConfig.listSelectionMode && /* @__PURE__ */ React97.createElement(Text48, { lh: 0.5, c: "dimmed" }, listConfig?.selection_mode === "single" ? "Single Selection" : "Multi Selection"), editable && /* @__PURE__ */ React97.createElement(Flex17, { justify: listType ? "space-between" : "flex-end" }, /* @__PURE__ */ React97.createElement(Flex17, { gap: "xs" }, /* @__PURE__ */ React97.createElement(ActionIcon12, { variant: "subtle", size: "sm", onClick: () => setModalOpened(true) }, /* @__PURE__ */ React97.createElement(IconSettings2, null))))), /* @__PURE__ */ React97.createElement(Flex17, { flex: 1 }, !listType ? /* @__PURE__ */ React97.createElement(Center3, { py: "xl" }, /* @__PURE__ */ React97.createElement(Stack73, { align: "center", gap: "sm" }, /* @__PURE__ */ React97.createElement(Text48, { size: "sm", c: "dimmed", ta: "center" }, "No list type configured"), /* @__PURE__ */ React97.createElement(Button23, { size: "sm", variant: "light", onClick: () => setModalOpened(true) }, "Configure List"))) : /* @__PURE__ */ React97.createElement(Stack73, { gap: "md", flex: 1 }, renderListComponent())), /* @__PURE__ */ React97.createElement(
|
|
7910
8207
|
EnumChecklistConfigModal,
|
|
7911
8208
|
{
|
|
7912
8209
|
opened: modalOpened,
|
|
@@ -7938,7 +8235,7 @@ var EnumChecklistBlock = createReactBlockSpec6(
|
|
|
7938
8235
|
content: "none"
|
|
7939
8236
|
},
|
|
7940
8237
|
{
|
|
7941
|
-
render: (props) => /* @__PURE__ */
|
|
8238
|
+
render: (props) => /* @__PURE__ */ React97.createElement(EnumChecklistBlockContent, { ...props })
|
|
7942
8239
|
}
|
|
7943
8240
|
);
|
|
7944
8241
|
|
|
@@ -8037,10 +8334,10 @@ blockRegistry.register({
|
|
|
8037
8334
|
});
|
|
8038
8335
|
|
|
8039
8336
|
// src/mantine/blocks/hooks/useBlockDependencies.ts
|
|
8040
|
-
import { useMemo as
|
|
8337
|
+
import { useMemo as useMemo14, useEffect as useEffect17, useState as useState26, useCallback as useCallback17 } from "react";
|
|
8041
8338
|
|
|
8042
8339
|
// src/mantine/blocks/hooks/useDependsOn.ts
|
|
8043
|
-
import { useMemo as
|
|
8340
|
+
import { useMemo as useMemo15 } from "react";
|
|
8044
8341
|
|
|
8045
8342
|
// src/mantine/blocks/index.ts
|
|
8046
8343
|
var blockSpecs = {
|
|
@@ -8291,15 +8588,15 @@ import { useCreateBlockNote as useCreateBlockNote2 } from "@blocknote/react";
|
|
|
8291
8588
|
import { BlockNoteSchema as BlockNoteSchema2, defaultBlockSpecs as defaultBlockSpecs2, defaultInlineContentSpecs as defaultInlineContentSpecs2, defaultStyleSpecs as defaultStyleSpecs2 } from "@blocknote/core";
|
|
8292
8589
|
|
|
8293
8590
|
// src/core/hooks/useMatrixProvider.ts
|
|
8294
|
-
import { useEffect as
|
|
8591
|
+
import { useEffect as useEffect18, useState as useState27, useRef as useRef3, useCallback as useCallback18, useMemo as useMemo16 } from "react";
|
|
8295
8592
|
import { MatrixProvider } from "@ixo/matrix-crdt";
|
|
8296
8593
|
function useMatrixProvider({ matrixClient, roomId, yDoc }) {
|
|
8297
|
-
const [matrixProvider, setProvider] =
|
|
8298
|
-
const [status, setStatus] =
|
|
8594
|
+
const [matrixProvider, setProvider] = useState27(null);
|
|
8595
|
+
const [status, setStatus] = useState27("disconnected");
|
|
8299
8596
|
const isMountedRef = useRef3(true);
|
|
8300
8597
|
const providerRef = useRef3(null);
|
|
8301
8598
|
const retryTimeoutRef = useRef3(null);
|
|
8302
|
-
const providerOptions =
|
|
8599
|
+
const providerOptions = useMemo16(
|
|
8303
8600
|
() => ({
|
|
8304
8601
|
translator: {
|
|
8305
8602
|
updateEventType: "matrix-crdt.doc_update",
|
|
@@ -8361,7 +8658,7 @@ function useMatrixProvider({ matrixClient, roomId, yDoc }) {
|
|
|
8361
8658
|
}
|
|
8362
8659
|
}
|
|
8363
8660
|
}, [matrixClient, providerOptions, handleDocumentAvailable, handleDocumentUnavailable, handleCanWriteChanged]);
|
|
8364
|
-
|
|
8661
|
+
useEffect18(() => {
|
|
8365
8662
|
isMountedRef.current = true;
|
|
8366
8663
|
initProvider();
|
|
8367
8664
|
return () => {
|
|
@@ -8378,7 +8675,7 @@ function useMatrixProvider({ matrixClient, roomId, yDoc }) {
|
|
|
8378
8675
|
setStatus("disconnected");
|
|
8379
8676
|
};
|
|
8380
8677
|
}, [initProvider]);
|
|
8381
|
-
|
|
8678
|
+
useEffect18(() => {
|
|
8382
8679
|
return () => {
|
|
8383
8680
|
isMountedRef.current = false;
|
|
8384
8681
|
};
|
|
@@ -8387,17 +8684,17 @@ function useMatrixProvider({ matrixClient, roomId, yDoc }) {
|
|
|
8387
8684
|
}
|
|
8388
8685
|
|
|
8389
8686
|
// src/mantine/hooks/useCollaborativeYDoc.ts
|
|
8390
|
-
import { useMemo as
|
|
8687
|
+
import { useMemo as useMemo17 } from "react";
|
|
8391
8688
|
import * as Y from "yjs";
|
|
8392
8689
|
function useCollaborativeYDoc(_options) {
|
|
8393
|
-
return
|
|
8690
|
+
return useMemo17(() => {
|
|
8394
8691
|
const doc = new Y.Doc();
|
|
8395
8692
|
return doc;
|
|
8396
8693
|
}, []);
|
|
8397
8694
|
}
|
|
8398
8695
|
|
|
8399
8696
|
// src/mantine/hooks/useCollaborativeIxoEditor.ts
|
|
8400
|
-
import { useMemo as
|
|
8697
|
+
import { useMemo as useMemo18, useEffect as useEffect19 } from "react";
|
|
8401
8698
|
function useCreateCollaborativeIxoEditor(options) {
|
|
8402
8699
|
const yDoc = useCollaborativeYDoc(options);
|
|
8403
8700
|
const {
|
|
@@ -8415,7 +8712,7 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
8415
8712
|
matrixClient,
|
|
8416
8713
|
permissions = { write: false }
|
|
8417
8714
|
} = options || {};
|
|
8418
|
-
const memoizedUser =
|
|
8715
|
+
const memoizedUser = useMemo18(
|
|
8419
8716
|
() => ({
|
|
8420
8717
|
id: user?.id || "",
|
|
8421
8718
|
name: user?.name || "",
|
|
@@ -8430,7 +8727,7 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
8430
8727
|
matrixClient,
|
|
8431
8728
|
roomId: options.roomId
|
|
8432
8729
|
});
|
|
8433
|
-
const defaultUploadFile =
|
|
8730
|
+
const defaultUploadFile = useMemo18(
|
|
8434
8731
|
() => uploadFile || (async (file) => {
|
|
8435
8732
|
return new Promise((resolve, reject) => {
|
|
8436
8733
|
const reader = new FileReader();
|
|
@@ -8444,7 +8741,7 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
8444
8741
|
}),
|
|
8445
8742
|
[uploadFile]
|
|
8446
8743
|
);
|
|
8447
|
-
const schema =
|
|
8744
|
+
const schema = useMemo18(
|
|
8448
8745
|
() => BlockNoteSchema2.create({
|
|
8449
8746
|
blockSpecs: {
|
|
8450
8747
|
...defaultBlockSpecs2,
|
|
@@ -8459,11 +8756,11 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
8459
8756
|
}),
|
|
8460
8757
|
[]
|
|
8461
8758
|
);
|
|
8462
|
-
const root =
|
|
8463
|
-
const documentFragment =
|
|
8464
|
-
const flowArray =
|
|
8465
|
-
const userFragment =
|
|
8466
|
-
const collaborationConfig =
|
|
8759
|
+
const root = useMemo18(() => yDoc.getMap("root"), [yDoc]);
|
|
8760
|
+
const documentFragment = useMemo18(() => yDoc.getXmlFragment("document"), [yDoc]);
|
|
8761
|
+
const flowArray = useMemo18(() => yDoc.getArray("flow"), [yDoc]);
|
|
8762
|
+
const userFragment = useMemo18(() => yDoc.getMap(memoizedUser.id), [yDoc, memoizedUser.id]);
|
|
8763
|
+
const collaborationConfig = useMemo18(
|
|
8467
8764
|
() => ({
|
|
8468
8765
|
provider: matrixProvider,
|
|
8469
8766
|
fragment: documentFragment,
|
|
@@ -8475,7 +8772,7 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
8475
8772
|
}),
|
|
8476
8773
|
[matrixProvider, documentFragment, memoizedUser.name, memoizedUser.color]
|
|
8477
8774
|
);
|
|
8478
|
-
const ixoConfig =
|
|
8775
|
+
const ixoConfig = useMemo18(
|
|
8479
8776
|
() => ({
|
|
8480
8777
|
theme,
|
|
8481
8778
|
editable,
|
|
@@ -8494,7 +8791,7 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
8494
8791
|
uploadFile: defaultUploadFile,
|
|
8495
8792
|
collaboration: collaborationConfig
|
|
8496
8793
|
});
|
|
8497
|
-
const titleText =
|
|
8794
|
+
const titleText = useMemo18(() => yDoc.getText("title"), [yDoc]);
|
|
8498
8795
|
let ixoEditor;
|
|
8499
8796
|
if (editor) {
|
|
8500
8797
|
ixoEditor = editor;
|
|
@@ -8551,12 +8848,12 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
8551
8848
|
root.set("docType", value);
|
|
8552
8849
|
};
|
|
8553
8850
|
}
|
|
8554
|
-
|
|
8851
|
+
useEffect19(() => {
|
|
8555
8852
|
if (ixoEditor) {
|
|
8556
8853
|
ixoEditor.isEditable = editable;
|
|
8557
8854
|
}
|
|
8558
8855
|
}, [ixoEditor, editable]);
|
|
8559
|
-
|
|
8856
|
+
useEffect19(() => {
|
|
8560
8857
|
if (connectionStatus !== "connected") {
|
|
8561
8858
|
return;
|
|
8562
8859
|
}
|
|
@@ -8589,19 +8886,19 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
8589
8886
|
}
|
|
8590
8887
|
|
|
8591
8888
|
// src/mantine/IxoEditor.tsx
|
|
8592
|
-
import
|
|
8889
|
+
import React99 from "react";
|
|
8593
8890
|
import { getDefaultReactSlashMenuItems, SuggestionMenuController } from "@blocknote/react";
|
|
8594
8891
|
import { BlockNoteView } from "@blocknote/mantine";
|
|
8595
8892
|
import { filterSuggestionItems } from "@blocknote/core";
|
|
8596
8893
|
import { MantineProvider } from "@mantine/core";
|
|
8597
8894
|
|
|
8598
8895
|
// src/mantine/components/PanelContent.tsx
|
|
8599
|
-
import
|
|
8896
|
+
import React98 from "react";
|
|
8600
8897
|
function PanelContent() {
|
|
8601
8898
|
const { activePanel, registeredPanels } = usePanelStore();
|
|
8602
8899
|
const isOpen = activePanel !== null;
|
|
8603
8900
|
const content = activePanel ? registeredPanels.get(activePanel) : null;
|
|
8604
|
-
return /* @__PURE__ */
|
|
8901
|
+
return /* @__PURE__ */ React98.createElement(
|
|
8605
8902
|
"div",
|
|
8606
8903
|
{
|
|
8607
8904
|
style: {
|
|
@@ -8625,7 +8922,7 @@ function IxoEditorContent({
|
|
|
8625
8922
|
onSelectionChange,
|
|
8626
8923
|
children
|
|
8627
8924
|
}) {
|
|
8628
|
-
return /* @__PURE__ */
|
|
8925
|
+
return /* @__PURE__ */ React99.createElement("div", { style: { display: "flex", height: "100%" } }, /* @__PURE__ */ React99.createElement("div", { className: `ixo-editor ixo-editor--theme-${config.theme} ${className}`, style: { flex: 1 } }, /* @__PURE__ */ React99.createElement(
|
|
8629
8926
|
BlockNoteView,
|
|
8630
8927
|
{
|
|
8631
8928
|
editor,
|
|
@@ -8640,7 +8937,7 @@ function IxoEditorContent({
|
|
|
8640
8937
|
onChange,
|
|
8641
8938
|
onSelectionChange
|
|
8642
8939
|
},
|
|
8643
|
-
config.slashMenu && /* @__PURE__ */
|
|
8940
|
+
config.slashMenu && /* @__PURE__ */ React99.createElement(
|
|
8644
8941
|
SuggestionMenuController,
|
|
8645
8942
|
{
|
|
8646
8943
|
triggerCharacter: "/",
|
|
@@ -8652,7 +8949,7 @@ function IxoEditorContent({
|
|
|
8652
8949
|
}
|
|
8653
8950
|
),
|
|
8654
8951
|
children
|
|
8655
|
-
)), /* @__PURE__ */
|
|
8952
|
+
)), /* @__PURE__ */ React99.createElement(PanelContent, null));
|
|
8656
8953
|
}
|
|
8657
8954
|
function IxoEditor({
|
|
8658
8955
|
editor,
|
|
@@ -8678,9 +8975,9 @@ function IxoEditor({
|
|
|
8678
8975
|
tableHandles: true
|
|
8679
8976
|
};
|
|
8680
8977
|
const isEditable = editable;
|
|
8681
|
-
const editorContent = /* @__PURE__ */
|
|
8978
|
+
const editorContent = /* @__PURE__ */ React99.createElement(BlocknoteProvider, { editor, handlers, blockRequirements, editable: isEditable }, /* @__PURE__ */ React99.createElement(IxoEditorContent, { editor, config, isEditable, className, onChange, onSelectionChange }, children));
|
|
8682
8979
|
if (mantineTheme) {
|
|
8683
|
-
return /* @__PURE__ */
|
|
8980
|
+
return /* @__PURE__ */ React99.createElement(MantineProvider, { theme: mantineTheme }, editorContent);
|
|
8684
8981
|
}
|
|
8685
8982
|
return editorContent;
|
|
8686
8983
|
}
|
|
@@ -8764,4 +9061,4 @@ export {
|
|
|
8764
9061
|
ixoGraphQLClient,
|
|
8765
9062
|
getEntity
|
|
8766
9063
|
};
|
|
8767
|
-
//# sourceMappingURL=chunk-
|
|
9064
|
+
//# sourceMappingURL=chunk-DYWMPNRW.mjs.map
|