@ixo/editor 1.8.0 → 1.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-HCXEWG4Z.mjs → chunk-NJ34FIYQ.mjs} +927 -1157
- package/dist/chunk-NJ34FIYQ.mjs.map +1 -0
- package/dist/index.d.ts +73 -93
- package/dist/index.mjs +3 -3
- package/dist/mantine/index.d.ts +1 -1
- package/dist/mantine/index.mjs +3 -3
- package/package.json +1 -1
- package/dist/chunk-HCXEWG4Z.mjs.map +0 -1
|
@@ -247,14 +247,10 @@ function getBlockDisplayName(block) {
|
|
|
247
247
|
return `${block.type} (${block.id.slice(0, 8)}...)`;
|
|
248
248
|
}
|
|
249
249
|
function hasVisibilityConditions(conditionConfig) {
|
|
250
|
-
return conditionConfig.conditions.some(
|
|
251
|
-
(c) => c.effect.action === "show" || c.effect.action === "hide"
|
|
252
|
-
);
|
|
250
|
+
return conditionConfig.conditions.some((c) => c.effect.action === "show" || c.effect.action === "hide");
|
|
253
251
|
}
|
|
254
252
|
function hasEnableConditions(conditionConfig) {
|
|
255
|
-
return conditionConfig.conditions.some(
|
|
256
|
-
(c) => c.effect.action === "enable" || c.effect.action === "disable"
|
|
257
|
-
);
|
|
253
|
+
return conditionConfig.conditions.some((c) => c.effect.action === "enable" || c.effect.action === "disable");
|
|
258
254
|
}
|
|
259
255
|
|
|
260
256
|
// src/mantine/blocks/components/ConditionBuilder/ConditionBuilderTab.tsx
|
|
@@ -416,12 +412,7 @@ function getPropertyByName(blockType, propertyName) {
|
|
|
416
412
|
// src/mantine/blocks/components/ConditionBuilder/PropertyValueInput.tsx
|
|
417
413
|
import React2, { useCallback as useCallback2 } from "react";
|
|
418
414
|
import { TextInput, NumberInput, Switch, Select, Stack } from "@mantine/core";
|
|
419
|
-
function PropertyValueInput({
|
|
420
|
-
property,
|
|
421
|
-
value,
|
|
422
|
-
onChange,
|
|
423
|
-
disabled = false
|
|
424
|
-
}) {
|
|
415
|
+
function PropertyValueInput({ property, value, onChange, disabled = false }) {
|
|
425
416
|
const handleStringChange = useCallback2(
|
|
426
417
|
(event) => {
|
|
427
418
|
onChange(event.currentTarget.value);
|
|
@@ -455,26 +446,9 @@ function PropertyValueInput({
|
|
|
455
446
|
}
|
|
456
447
|
switch (property.type) {
|
|
457
448
|
case "boolean":
|
|
458
|
-
return /* @__PURE__ */ React2.createElement(Stack, { gap: 4 }, /* @__PURE__ */ React2.createElement(
|
|
459
|
-
Switch,
|
|
460
|
-
{
|
|
461
|
-
label: "Value",
|
|
462
|
-
checked: Boolean(value),
|
|
463
|
-
onChange: handleBooleanChange,
|
|
464
|
-
disabled
|
|
465
|
-
}
|
|
466
|
-
));
|
|
449
|
+
return /* @__PURE__ */ React2.createElement(Stack, { gap: 4 }, /* @__PURE__ */ React2.createElement(Switch, { label: "Value", checked: Boolean(value), onChange: handleBooleanChange, disabled }));
|
|
467
450
|
case "number":
|
|
468
|
-
return /* @__PURE__ */ React2.createElement(
|
|
469
|
-
NumberInput,
|
|
470
|
-
{
|
|
471
|
-
label: "Value",
|
|
472
|
-
placeholder: "Enter number...",
|
|
473
|
-
value: typeof value === "number" ? value : 0,
|
|
474
|
-
onChange: handleNumberChange,
|
|
475
|
-
disabled
|
|
476
|
-
}
|
|
477
|
-
);
|
|
451
|
+
return /* @__PURE__ */ React2.createElement(NumberInput, { label: "Value", placeholder: "Enter number...", value: typeof value === "number" ? value : 0, onChange: handleNumberChange, disabled });
|
|
478
452
|
case "select":
|
|
479
453
|
if (!property.selectOptions) {
|
|
480
454
|
return /* @__PURE__ */ React2.createElement(TextInput, { label: "Value", placeholder: "No options available", disabled: true });
|
|
@@ -483,39 +457,15 @@ function PropertyValueInput({
|
|
|
483
457
|
value: String(option.value),
|
|
484
458
|
label: option.label
|
|
485
459
|
}));
|
|
486
|
-
return /* @__PURE__ */ React2.createElement(
|
|
487
|
-
Select,
|
|
488
|
-
{
|
|
489
|
-
label: "Value",
|
|
490
|
-
placeholder: "Select value...",
|
|
491
|
-
data: selectData,
|
|
492
|
-
value: String(value),
|
|
493
|
-
onChange: handleSelectChange,
|
|
494
|
-
disabled
|
|
495
|
-
}
|
|
496
|
-
);
|
|
460
|
+
return /* @__PURE__ */ React2.createElement(Select, { label: "Value", placeholder: "Select value...", data: selectData, value: String(value), onChange: handleSelectChange, disabled });
|
|
497
461
|
case "string":
|
|
498
462
|
default:
|
|
499
|
-
return /* @__PURE__ */ React2.createElement(
|
|
500
|
-
TextInput,
|
|
501
|
-
{
|
|
502
|
-
label: "Value",
|
|
503
|
-
placeholder: "Enter text...",
|
|
504
|
-
value: String(value),
|
|
505
|
-
onChange: handleStringChange,
|
|
506
|
-
disabled
|
|
507
|
-
}
|
|
508
|
-
);
|
|
463
|
+
return /* @__PURE__ */ React2.createElement(TextInput, { label: "Value", placeholder: "Enter text...", value: String(value), onChange: handleStringChange, disabled });
|
|
509
464
|
}
|
|
510
465
|
}
|
|
511
466
|
|
|
512
467
|
// src/mantine/blocks/components/ConditionBuilder/ConditionRow.tsx
|
|
513
|
-
function ConditionRow({
|
|
514
|
-
condition,
|
|
515
|
-
availableBlocks,
|
|
516
|
-
onUpdate,
|
|
517
|
-
onDelete
|
|
518
|
-
}) {
|
|
468
|
+
function ConditionRow({ condition, availableBlocks, onUpdate, onDelete }) {
|
|
519
469
|
console.log("[ConditionRow] Props:", {
|
|
520
470
|
conditionId: condition.id,
|
|
521
471
|
sourceBlockId: condition.sourceBlockId,
|
|
@@ -545,10 +495,7 @@ function ConditionRow({
|
|
|
545
495
|
);
|
|
546
496
|
}
|
|
547
497
|
if (selectedProperty.type === "number") {
|
|
548
|
-
baseOperators.push(
|
|
549
|
-
{ value: "greater_than", label: "greater than" },
|
|
550
|
-
{ value: "less_than", label: "less than" }
|
|
551
|
-
);
|
|
498
|
+
baseOperators.push({ value: "greater_than", label: "greater than" }, { value: "less_than", label: "less than" });
|
|
552
499
|
}
|
|
553
500
|
return baseOperators;
|
|
554
501
|
}, [selectedProperty]);
|
|
@@ -668,35 +615,7 @@ function ConditionRow({
|
|
|
668
615
|
{ value: "show", label: "Show block" }
|
|
669
616
|
];
|
|
670
617
|
const currentBlockValue = condition.sourceBlockId && condition.sourceBlockType ? `${condition.sourceBlockType}:${condition.sourceBlockId}` : "";
|
|
671
|
-
return /* @__PURE__ */ React3.createElement(Card, { withBorder: true, p: "md" }, /* @__PURE__ */ React3.createElement(Stack2, { gap: "sm" }, /* @__PURE__ */ React3.createElement(
|
|
672
|
-
TextInput2,
|
|
673
|
-
{
|
|
674
|
-
label: "Condition name",
|
|
675
|
-
placeholder: "e.g., User must acknowledge terms",
|
|
676
|
-
value: condition.name,
|
|
677
|
-
onChange: (e) => handleNameChange(e.currentTarget.value)
|
|
678
|
-
}
|
|
679
|
-
), /* @__PURE__ */ React3.createElement(
|
|
680
|
-
Select2,
|
|
681
|
-
{
|
|
682
|
-
label: "Check this block",
|
|
683
|
-
placeholder: "Select a block...",
|
|
684
|
-
data: blockSelectData,
|
|
685
|
-
value: currentBlockValue,
|
|
686
|
-
onChange: handleSourceBlockChange,
|
|
687
|
-
searchable: true,
|
|
688
|
-
clearable: true
|
|
689
|
-
}
|
|
690
|
-
), condition.sourceBlockType && /* @__PURE__ */ React3.createElement(React3.Fragment, null, /* @__PURE__ */ React3.createElement(Group, { grow: true }, /* @__PURE__ */ React3.createElement(
|
|
691
|
-
Select2,
|
|
692
|
-
{
|
|
693
|
-
label: "Property",
|
|
694
|
-
placeholder: "Select property...",
|
|
695
|
-
data: propertySelectData,
|
|
696
|
-
value: condition.rule.property,
|
|
697
|
-
onChange: handlePropertyChange
|
|
698
|
-
}
|
|
699
|
-
), /* @__PURE__ */ React3.createElement(
|
|
618
|
+
return /* @__PURE__ */ React3.createElement(Card, { withBorder: true, p: "md" }, /* @__PURE__ */ React3.createElement(Stack2, { gap: "sm" }, /* @__PURE__ */ React3.createElement(TextInput2, { label: "Condition name", placeholder: "e.g., User must acknowledge terms", value: condition.name, onChange: (e) => handleNameChange(e.currentTarget.value) }), /* @__PURE__ */ React3.createElement(Select2, { label: "Check this block", placeholder: "Select a block...", data: blockSelectData, value: currentBlockValue, onChange: handleSourceBlockChange, searchable: true, clearable: true }), condition.sourceBlockType && /* @__PURE__ */ React3.createElement(React3.Fragment, null, /* @__PURE__ */ React3.createElement(Group, { grow: true }, /* @__PURE__ */ React3.createElement(Select2, { label: "Property", placeholder: "Select property...", data: propertySelectData, value: condition.rule.property, onChange: handlePropertyChange }), /* @__PURE__ */ React3.createElement(
|
|
700
619
|
Select2,
|
|
701
620
|
{
|
|
702
621
|
label: "Operator",
|
|
@@ -714,16 +633,7 @@ function ConditionRow({
|
|
|
714
633
|
onChange: handleValueChange,
|
|
715
634
|
disabled: !condition.rule.property || !condition.rule.operator
|
|
716
635
|
}
|
|
717
|
-
))), /* @__PURE__ */ React3.createElement(Group, { grow: true }, /* @__PURE__ */ React3.createElement(
|
|
718
|
-
Select2,
|
|
719
|
-
{
|
|
720
|
-
label: "Action",
|
|
721
|
-
placeholder: "Select action...",
|
|
722
|
-
data: actionSelectData,
|
|
723
|
-
value: condition.effect.action,
|
|
724
|
-
onChange: handleActionChange
|
|
725
|
-
}
|
|
726
|
-
)), /* @__PURE__ */ React3.createElement(
|
|
636
|
+
))), /* @__PURE__ */ React3.createElement(Group, { grow: true }, /* @__PURE__ */ React3.createElement(Select2, { label: "Action", placeholder: "Select action...", data: actionSelectData, value: condition.effect.action, onChange: handleActionChange })), /* @__PURE__ */ React3.createElement(
|
|
727
637
|
TextInput2,
|
|
728
638
|
{
|
|
729
639
|
label: "Message (optional)",
|
|
@@ -848,16 +758,7 @@ function ConditionsTab({ block, editor }) {
|
|
|
848
758
|
onDelete: () => handleDeleteCondition(index)
|
|
849
759
|
}
|
|
850
760
|
);
|
|
851
|
-
})), /* @__PURE__ */ React5.createElement(
|
|
852
|
-
Button3,
|
|
853
|
-
{
|
|
854
|
-
variant: "outline",
|
|
855
|
-
onClick: handleAddCondition,
|
|
856
|
-
disabled: availableBlocks.length === 0,
|
|
857
|
-
fullWidth: true
|
|
858
|
-
},
|
|
859
|
-
"Add Condition"
|
|
860
|
-
), availableBlocks.length === 0 && /* @__PURE__ */ React5.createElement(Alert2, { color: "blue", title: "No blocks available for conditions" }, 'Add other blocks to the editor (checkbox, proposal, etc.) to create conditions that depend on them. The "Add Condition" button will become enabled once other blocks are available.'));
|
|
761
|
+
})), /* @__PURE__ */ React5.createElement(Button3, { variant: "outline", onClick: handleAddCondition, disabled: availableBlocks.length === 0, fullWidth: true }, "Add Condition"), availableBlocks.length === 0 && /* @__PURE__ */ React5.createElement(Alert2, { color: "blue", title: "No blocks available for conditions" }, 'Add other blocks to the editor (checkbox, proposal, etc.) to create conditions that depend on them. The "Add Condition" button will become enabled once other blocks are available.'));
|
|
861
762
|
}
|
|
862
763
|
|
|
863
764
|
// src/mantine/components/ReusablePanel.tsx
|
|
@@ -1135,14 +1036,7 @@ import { Card as Card2, Checkbox, Group as Group2, Stack as Stack6, Text as Text
|
|
|
1135
1036
|
|
|
1136
1037
|
// src/mantine/utils/iconMap.tsx
|
|
1137
1038
|
import React9 from "react";
|
|
1138
|
-
import {
|
|
1139
|
-
IconSquareCheck,
|
|
1140
|
-
IconFileText,
|
|
1141
|
-
IconCheckbox,
|
|
1142
|
-
IconNote,
|
|
1143
|
-
IconChecklist,
|
|
1144
|
-
IconThumbUp
|
|
1145
|
-
} from "@tabler/icons-react";
|
|
1039
|
+
import { IconSquareCheck, IconFileText, IconCheckbox, IconNote, IconChecklist, IconThumbUp } from "@tabler/icons-react";
|
|
1146
1040
|
var ICON_MAP = {
|
|
1147
1041
|
"square-check": IconSquareCheck,
|
|
1148
1042
|
"file-text": IconFileText,
|
|
@@ -1191,17 +1085,7 @@ var CheckboxFlowView = ({ editor, block, isDisabled }) => {
|
|
|
1191
1085
|
onClick: (e) => e.stopPropagation()
|
|
1192
1086
|
}
|
|
1193
1087
|
);
|
|
1194
|
-
return /* @__PURE__ */ React11.createElement(React11.Fragment, null, /* @__PURE__ */ React11.createElement(Card3, { withBorder: true, padding: "md", radius: "md", style: { width: "100%", cursor: "pointer" } }, /* @__PURE__ */ React11.createElement(Group3, { wrap: "nowrap", justify: "space-between", align: "center" }, /* @__PURE__ */ React11.createElement(Group3, { wrap: "nowrap", align: "center" }, /* @__PURE__ */ React11.createElement(
|
|
1195
|
-
ActionIcon2,
|
|
1196
|
-
{
|
|
1197
|
-
variant: "light",
|
|
1198
|
-
color: "blue",
|
|
1199
|
-
size: "lg",
|
|
1200
|
-
radius: "xl",
|
|
1201
|
-
style: { flexShrink: 0 }
|
|
1202
|
-
},
|
|
1203
|
-
getIcon(block.props.icon, 18, 1.5, "square-check")
|
|
1204
|
-
), /* @__PURE__ */ React11.createElement(Stack7, { gap: "xs", style: { flex: 1 } }, /* @__PURE__ */ React11.createElement(Text5, { fw: 500, size: "sm", contentEditable: false }, block.props.title || "Checkbox Title"), /* @__PURE__ */ React11.createElement(Text5, { size: "xs", c: "dimmed", contentEditable: false }, block.props.description || "Checkbox description"))), disabled && isDisabled?.message ? /* @__PURE__ */ React11.createElement(Tooltip, { label: isDisabled.message, position: "left", withArrow: true }, checkboxElement) : checkboxElement)));
|
|
1088
|
+
return /* @__PURE__ */ React11.createElement(React11.Fragment, null, /* @__PURE__ */ React11.createElement(Card3, { withBorder: true, padding: "md", radius: "md", style: { width: "100%", cursor: "pointer" } }, /* @__PURE__ */ React11.createElement(Group3, { wrap: "nowrap", justify: "space-between", align: "center" }, /* @__PURE__ */ React11.createElement(Group3, { wrap: "nowrap", align: "center" }, /* @__PURE__ */ React11.createElement(ActionIcon2, { variant: "light", color: "blue", size: "lg", radius: "xl", style: { flexShrink: 0 } }, getIcon(block.props.icon, 18, 1.5, "square-check")), /* @__PURE__ */ React11.createElement(Stack7, { gap: "xs", style: { flex: 1 } }, /* @__PURE__ */ React11.createElement(Text5, { fw: 500, size: "sm", contentEditable: false }, block.props.title || "Checkbox Title"), /* @__PURE__ */ React11.createElement(Text5, { size: "xs", c: "dimmed", contentEditable: false }, block.props.description || "Checkbox description"))), disabled && isDisabled?.message ? /* @__PURE__ */ React11.createElement(Tooltip, { label: isDisabled.message, position: "left", withArrow: true }, checkboxElement) : checkboxElement)));
|
|
1205
1089
|
};
|
|
1206
1090
|
|
|
1207
1091
|
// src/mantine/blocks/hooks/useBlockConditions.ts
|
|
@@ -1307,9 +1191,7 @@ function evaluateBlockConditions(conditionConfig, editorDocument, currentUser) {
|
|
|
1307
1191
|
}
|
|
1308
1192
|
const normalizedConditions = normalizeConditions(conditionConfig.conditions);
|
|
1309
1193
|
const evaluationResults = normalizedConditions.map((condition) => {
|
|
1310
|
-
const sourceBlock = editorDocument.find(
|
|
1311
|
-
(block) => block.id === condition.sourceBlockId && block.type === condition.sourceBlockType
|
|
1312
|
-
);
|
|
1194
|
+
const sourceBlock = editorDocument.find((block) => block.id === condition.sourceBlockId && block.type === condition.sourceBlockType);
|
|
1313
1195
|
const result = evaluateCondition(condition, sourceBlock, currentUser);
|
|
1314
1196
|
return {
|
|
1315
1197
|
condition,
|
|
@@ -1447,18 +1329,23 @@ var CheckboxBlockSpec = createReactBlockSpec(
|
|
|
1447
1329
|
}
|
|
1448
1330
|
);
|
|
1449
1331
|
|
|
1450
|
-
// src/mantine/blocks/list/
|
|
1451
|
-
import React37
|
|
1332
|
+
// src/mantine/blocks/list/ListBlockSpec.tsx
|
|
1333
|
+
import React37 from "react";
|
|
1452
1334
|
import { createReactBlockSpec as createReactBlockSpec2 } from "@blocknote/react";
|
|
1453
|
-
import { Group as Group8, Stack as Stack24, Text as Text24, Button as Button8, ActionIcon as ActionIcon3, Alert as Alert4, Loader as Loader2, Center as Center2, Flex as Flex14 } from "@mantine/core";
|
|
1454
1335
|
|
|
1455
|
-
// src/mantine/blocks/list/
|
|
1456
|
-
import
|
|
1457
|
-
|
|
1336
|
+
// src/mantine/blocks/list/ListBlock.tsx
|
|
1337
|
+
import React36 from "react";
|
|
1338
|
+
|
|
1339
|
+
// src/mantine/blocks/list/template/TemplateView.tsx
|
|
1340
|
+
import React16, { useMemo as useMemo6 } from "react";
|
|
1341
|
+
|
|
1342
|
+
// src/mantine/blocks/list/template/TemplateConfig.tsx
|
|
1343
|
+
import React15, { useCallback as useCallback8 } from "react";
|
|
1344
|
+
import { Paper as Paper2, CloseButton as CloseButton2, Title as Title2 } from "@mantine/core";
|
|
1458
1345
|
|
|
1459
|
-
// src/mantine/blocks/list/
|
|
1460
|
-
import React14 from "react";
|
|
1461
|
-
import { Stack as Stack8, Card as Card4, Group as Group4, Text as Text6, Box, Button as Button4 } from "@mantine/core";
|
|
1346
|
+
// src/mantine/blocks/list/template/GeneralTab.tsx
|
|
1347
|
+
import React14, { useState as useState4 } from "react";
|
|
1348
|
+
import { Stack as Stack8, Card as Card4, Group as Group4, Text as Text6, Box, TextInput as TextInput4, Button as Button4, Switch as Switch3, Accordion } from "@mantine/core";
|
|
1462
1349
|
|
|
1463
1350
|
// src/mantine/blocks/list/linked_resources/config.ts
|
|
1464
1351
|
var linkedResourcesMetadata = {
|
|
@@ -1925,151 +1812,311 @@ var getListNameByType = (type) => {
|
|
|
1925
1812
|
return listTypeRegistry[type].metadata.name;
|
|
1926
1813
|
};
|
|
1927
1814
|
|
|
1928
|
-
// src/mantine/blocks/list/
|
|
1929
|
-
var
|
|
1930
|
-
const
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
padding: "md",
|
|
1936
|
-
radius: "md",
|
|
1937
|
-
withBorder: true,
|
|
1938
|
-
bg: selectedType === listType.id ? "var(--mantine-color-gray-8)" : "transparent",
|
|
1939
|
-
style: {
|
|
1940
|
-
cursor: "pointer"
|
|
1941
|
-
},
|
|
1942
|
-
onClick: () => onTypeSelect(listType.id)
|
|
1943
|
-
},
|
|
1944
|
-
/* @__PURE__ */ React14.createElement(Group4, { gap: "md", align: "flex-start" }, /* @__PURE__ */ React14.createElement(
|
|
1945
|
-
Box,
|
|
1946
|
-
{
|
|
1947
|
-
style: {
|
|
1948
|
-
width: 48,
|
|
1949
|
-
height: 48,
|
|
1950
|
-
borderRadius: "8px",
|
|
1951
|
-
display: "flex",
|
|
1952
|
-
alignItems: "center",
|
|
1953
|
-
justifyContent: "center",
|
|
1954
|
-
fontSize: "20px",
|
|
1955
|
-
backgroundColor: "var(--mantine-color-gray-1)",
|
|
1956
|
-
border: "1px solid var(--mantine-color-gray-3)"
|
|
1957
|
-
}
|
|
1958
|
-
},
|
|
1959
|
-
listType.icon
|
|
1960
|
-
), /* @__PURE__ */ React14.createElement(Stack8, { gap: 2, style: { flex: 1 } }, /* @__PURE__ */ React14.createElement(Text6, { size: "md", fw: 600 }, listType.name), /* @__PURE__ */ React14.createElement(Text6, { size: "sm", c: "dimmed" }, listType.description)))
|
|
1961
|
-
))), /* @__PURE__ */ React14.createElement(Group4, { justify: "flex-end", mt: "md" }, /* @__PURE__ */ React14.createElement(Button4, { onClick: onNext, disabled: !selectedType }, "Next")));
|
|
1962
|
-
};
|
|
1963
|
-
|
|
1964
|
-
// src/mantine/blocks/list/modal/ListConfigurationStep.tsx
|
|
1965
|
-
import React15 from "react";
|
|
1966
|
-
import { Stack as Stack9, TextInput as TextInput4, Text as Text7, Button as Button5, Group as Group5, Switch as Switch3 } from "@mantine/core";
|
|
1967
|
-
var ListConfigurationStep = ({ listType, config, onConfigChange, onPrev, onNext, isValid }) => {
|
|
1968
|
-
const typeConfig = getListTypeConfig(listType);
|
|
1815
|
+
// src/mantine/blocks/list/template/GeneralTab.tsx
|
|
1816
|
+
var GeneralTab2 = ({ initialConfig, onSave }) => {
|
|
1817
|
+
const [selectedType, setSelectedType] = useState4(initialConfig?.type || null);
|
|
1818
|
+
const [config, setConfig] = useState4(initialConfig?.config || {});
|
|
1819
|
+
const [sortConfig, setSortConfig] = useState4(initialConfig?.sortOptions || {});
|
|
1820
|
+
const [filterConfig, setFilterConfig] = useState4(initialConfig?.filterOptions || {});
|
|
1821
|
+
const [accordionValue, setAccordionValue] = useState4(initialConfig ? "configure" : "type");
|
|
1969
1822
|
const handlers = useBlocknoteHandlers();
|
|
1823
|
+
const listTypes = getAllListTypes();
|
|
1824
|
+
const handleTypeSelect = (type) => {
|
|
1825
|
+
setSelectedType(type);
|
|
1826
|
+
const typeConfig2 = getListTypeConfig(type);
|
|
1827
|
+
const defaultConfig = {};
|
|
1828
|
+
typeConfig2.configFields.forEach((field) => {
|
|
1829
|
+
if (field.defaultValue !== void 0) {
|
|
1830
|
+
defaultConfig[field.key] = field.defaultValue;
|
|
1831
|
+
}
|
|
1832
|
+
});
|
|
1833
|
+
setSortConfig(typeConfig2.sortFields);
|
|
1834
|
+
setFilterConfig(typeConfig2.filterFields);
|
|
1835
|
+
setConfig(defaultConfig);
|
|
1836
|
+
setAccordionValue("configure");
|
|
1837
|
+
};
|
|
1838
|
+
const handleConfigChange = (key, value) => {
|
|
1839
|
+
setConfig((prev) => ({ ...prev, [key]: value }));
|
|
1840
|
+
};
|
|
1970
1841
|
const handleAutoFill = async () => {
|
|
1971
|
-
if (
|
|
1842
|
+
if (selectedType === "transactions" && handlers?.getCurrentUser) {
|
|
1972
1843
|
try {
|
|
1973
1844
|
const user = handlers.getCurrentUser();
|
|
1974
|
-
|
|
1845
|
+
handleConfigChange("address", user.address);
|
|
1975
1846
|
} catch (error) {
|
|
1976
1847
|
console.error("Failed to get current user:", error);
|
|
1977
1848
|
}
|
|
1978
1849
|
}
|
|
1979
1850
|
};
|
|
1980
|
-
const
|
|
1851
|
+
const isConfigValid = () => {
|
|
1852
|
+
if (!selectedType) return false;
|
|
1853
|
+
const typeConfig2 = getListTypeConfig(selectedType);
|
|
1854
|
+
return typeConfig2.configFields.every((field) => !field.required || config[field.key] && config[field.key].trim() !== "");
|
|
1855
|
+
};
|
|
1856
|
+
const handleSaveConfig = () => {
|
|
1857
|
+
if (selectedType && isConfigValid()) {
|
|
1858
|
+
onSave({
|
|
1859
|
+
type: selectedType,
|
|
1860
|
+
config,
|
|
1861
|
+
sortOptions: sortConfig,
|
|
1862
|
+
filterOptions: filterConfig,
|
|
1863
|
+
filter: null,
|
|
1864
|
+
sort: null
|
|
1865
|
+
});
|
|
1866
|
+
}
|
|
1867
|
+
};
|
|
1868
|
+
const renderConfigField = (field) => {
|
|
1981
1869
|
switch (field.type) {
|
|
1982
1870
|
case "text":
|
|
1983
|
-
return /* @__PURE__ */
|
|
1871
|
+
return /* @__PURE__ */ React14.createElement(Stack8, { gap: "xs", key: field.key }, /* @__PURE__ */ React14.createElement(
|
|
1984
1872
|
TextInput4,
|
|
1985
1873
|
{
|
|
1986
1874
|
label: field.label,
|
|
1987
1875
|
description: field.description,
|
|
1988
1876
|
placeholder: field.placeholder,
|
|
1989
1877
|
value: config[field.key] || "",
|
|
1990
|
-
onChange: (e) =>
|
|
1991
|
-
required: field.required
|
|
1878
|
+
onChange: (e) => handleConfigChange(field.key, e.target.value),
|
|
1879
|
+
required: field.required,
|
|
1880
|
+
styles: {
|
|
1881
|
+
input: {
|
|
1882
|
+
backgroundColor: "#1a1a1a",
|
|
1883
|
+
borderColor: "#333",
|
|
1884
|
+
color: "#f1f3f5"
|
|
1885
|
+
}
|
|
1886
|
+
}
|
|
1992
1887
|
}
|
|
1993
|
-
);
|
|
1888
|
+
), field.key === "address" && selectedType === "transactions" && /* @__PURE__ */ React14.createElement(Button4, { size: "xs", variant: "subtle", onClick: handleAutoFill }, "Use Current User Address"));
|
|
1994
1889
|
case "switch":
|
|
1995
|
-
return /* @__PURE__ */
|
|
1890
|
+
return /* @__PURE__ */ React14.createElement(
|
|
1996
1891
|
Switch3,
|
|
1997
1892
|
{
|
|
1893
|
+
key: field.key,
|
|
1998
1894
|
label: field.label,
|
|
1999
1895
|
description: field.description,
|
|
2000
1896
|
checked: config[field.key] !== void 0 ? config[field.key] : field.defaultValue || false,
|
|
2001
|
-
onChange: (event) =>
|
|
1897
|
+
onChange: (event) => handleConfigChange(field.key, event.currentTarget.checked),
|
|
1898
|
+
styles: {
|
|
1899
|
+
track: {
|
|
1900
|
+
backgroundColor: config[field.key] ? "#4dabf7" : "#333"
|
|
1901
|
+
},
|
|
1902
|
+
label: {
|
|
1903
|
+
color: "#adb5bd"
|
|
1904
|
+
}
|
|
1905
|
+
}
|
|
2002
1906
|
}
|
|
2003
1907
|
);
|
|
2004
1908
|
default:
|
|
2005
|
-
return /* @__PURE__ */
|
|
1909
|
+
return /* @__PURE__ */ React14.createElement(
|
|
2006
1910
|
TextInput4,
|
|
2007
1911
|
{
|
|
1912
|
+
key: field.key,
|
|
2008
1913
|
label: field.label,
|
|
2009
1914
|
description: field.description,
|
|
2010
1915
|
placeholder: field.placeholder,
|
|
2011
1916
|
value: config[field.key] || "",
|
|
2012
|
-
onChange: (e) =>
|
|
2013
|
-
required: field.required
|
|
1917
|
+
onChange: (e) => handleConfigChange(field.key, e.target.value),
|
|
1918
|
+
required: field.required,
|
|
1919
|
+
styles: {
|
|
1920
|
+
input: {
|
|
1921
|
+
backgroundColor: "#1a1a1a",
|
|
1922
|
+
borderColor: "#333",
|
|
1923
|
+
color: "#f1f3f5"
|
|
1924
|
+
}
|
|
1925
|
+
}
|
|
2014
1926
|
}
|
|
2015
1927
|
);
|
|
2016
1928
|
}
|
|
2017
1929
|
};
|
|
2018
|
-
|
|
1930
|
+
const typeConfig = selectedType ? getListTypeConfig(selectedType) : null;
|
|
1931
|
+
return /* @__PURE__ */ React14.createElement(Stack8, { gap: "lg" }, /* @__PURE__ */ React14.createElement(Accordion, { value: accordionValue, onChange: setAccordionValue }, /* @__PURE__ */ React14.createElement(Accordion.Item, { value: "type" }, /* @__PURE__ */ React14.createElement(Accordion.Control, null, /* @__PURE__ */ React14.createElement(Text6, { fw: 600 }, "Choose List Type")), /* @__PURE__ */ React14.createElement(Accordion.Panel, null, /* @__PURE__ */ React14.createElement(Stack8, { gap: "sm", mt: "md" }, listTypes.map((listType) => /* @__PURE__ */ React14.createElement(
|
|
1932
|
+
Card4,
|
|
1933
|
+
{
|
|
1934
|
+
key: listType.id,
|
|
1935
|
+
padding: "md",
|
|
1936
|
+
radius: "md",
|
|
1937
|
+
withBorder: true,
|
|
1938
|
+
bg: selectedType === listType.id ? "var(--mantine-color-gray-8)" : "transparent",
|
|
1939
|
+
style: {
|
|
1940
|
+
cursor: "pointer"
|
|
1941
|
+
},
|
|
1942
|
+
onClick: () => handleTypeSelect(listType.id)
|
|
1943
|
+
},
|
|
1944
|
+
/* @__PURE__ */ React14.createElement(Group4, { gap: "md", align: "flex-start" }, /* @__PURE__ */ React14.createElement(
|
|
1945
|
+
Box,
|
|
1946
|
+
{
|
|
1947
|
+
style: {
|
|
1948
|
+
width: 48,
|
|
1949
|
+
height: 48,
|
|
1950
|
+
borderRadius: "8px",
|
|
1951
|
+
display: "flex",
|
|
1952
|
+
alignItems: "center",
|
|
1953
|
+
justifyContent: "center",
|
|
1954
|
+
fontSize: "20px",
|
|
1955
|
+
backgroundColor: "var(--mantine-color-gray-1)",
|
|
1956
|
+
border: "1px solid var(--mantine-color-gray-3)"
|
|
1957
|
+
}
|
|
1958
|
+
},
|
|
1959
|
+
listType.icon
|
|
1960
|
+
), /* @__PURE__ */ React14.createElement(Stack8, { gap: 2, style: { flex: 1 } }, /* @__PURE__ */ React14.createElement(Text6, { size: "md", fw: 600 }, listType.name), /* @__PURE__ */ React14.createElement(Text6, { size: "sm", c: "dimmed" }, listType.description)))
|
|
1961
|
+
))))), selectedType && typeConfig && /* @__PURE__ */ React14.createElement(Accordion.Item, { value: "configure" }, /* @__PURE__ */ React14.createElement(Accordion.Control, null, /* @__PURE__ */ React14.createElement(Text6, { fw: 600 }, "Configure ", typeConfig.metadata.name)), /* @__PURE__ */ React14.createElement(Accordion.Panel, null, /* @__PURE__ */ React14.createElement(Stack8, { gap: "md", mt: "md" }, /* @__PURE__ */ React14.createElement(Text6, { size: "sm", c: "dimmed" }, typeConfig.metadata.description), /* @__PURE__ */ React14.createElement(Stack8, { gap: "sm" }, typeConfig.configFields.map((field) => renderConfigField(field))))))), selectedType && /* @__PURE__ */ React14.createElement(Button4, { onClick: handleSaveConfig, disabled: !isConfigValid(), fullWidth: true }, "Save Configuration"));
|
|
2019
1962
|
};
|
|
2020
1963
|
|
|
2021
|
-
// src/mantine/blocks/list/
|
|
2022
|
-
|
|
2023
|
-
|
|
1964
|
+
// src/mantine/blocks/list/template/TemplateConfig.tsx
|
|
1965
|
+
var TemplateConfig2 = ({ editor, block }) => {
|
|
1966
|
+
const { closePanel } = usePanelStore();
|
|
1967
|
+
const handleConfigSave = useCallback8(
|
|
1968
|
+
(config) => {
|
|
1969
|
+
editor.updateBlock(block, {
|
|
1970
|
+
props: {
|
|
1971
|
+
...block.props,
|
|
1972
|
+
listType: config.type,
|
|
1973
|
+
listConfig: JSON.stringify(config.config),
|
|
1974
|
+
sortOptions: JSON.stringify(config.sortOptions),
|
|
1975
|
+
sort: JSON.stringify(config.sort),
|
|
1976
|
+
filterOptions: JSON.stringify(config.filterOptions),
|
|
1977
|
+
filter: JSON.stringify(config.filter)
|
|
1978
|
+
}
|
|
1979
|
+
});
|
|
1980
|
+
},
|
|
1981
|
+
[editor, block]
|
|
1982
|
+
);
|
|
1983
|
+
const listType = block.props.listType && block.props.listType !== "" ? block.props.listType : null;
|
|
1984
|
+
let listConfig = {};
|
|
1985
|
+
try {
|
|
1986
|
+
if (block.props.listConfig && block.props.listConfig !== "{}") {
|
|
1987
|
+
listConfig = JSON.parse(block.props.listConfig);
|
|
1988
|
+
}
|
|
1989
|
+
} catch (error) {
|
|
1990
|
+
console.error("Failed to parse listConfig:", error);
|
|
1991
|
+
}
|
|
1992
|
+
let sortOptions = {};
|
|
1993
|
+
try {
|
|
1994
|
+
if (block.props.sortOptions && block.props.sortOptions !== "{}") {
|
|
1995
|
+
sortOptions = JSON.parse(block.props.sortOptions);
|
|
1996
|
+
}
|
|
1997
|
+
} catch (error) {
|
|
1998
|
+
console.error("Failed to parse sortOptions:", error);
|
|
1999
|
+
}
|
|
2000
|
+
let filterOptions = {};
|
|
2001
|
+
try {
|
|
2002
|
+
if (block.props.filterOptions && block.props.filterOptions !== "{}") {
|
|
2003
|
+
filterOptions = JSON.parse(block.props.filterOptions);
|
|
2004
|
+
}
|
|
2005
|
+
} catch (error) {
|
|
2006
|
+
console.error("Failed to parse filterOptions:", error);
|
|
2007
|
+
}
|
|
2008
|
+
const initialConfig = listType && listConfig ? {
|
|
2009
|
+
type: listType,
|
|
2010
|
+
config: listConfig,
|
|
2011
|
+
sort: null,
|
|
2012
|
+
filter: null,
|
|
2013
|
+
filterOptions,
|
|
2014
|
+
sortOptions
|
|
2015
|
+
} : null;
|
|
2016
|
+
return /* @__PURE__ */ React15.createElement(
|
|
2017
|
+
Paper2,
|
|
2018
|
+
{
|
|
2019
|
+
p: "md",
|
|
2020
|
+
shadow: "sm",
|
|
2021
|
+
style: {
|
|
2022
|
+
height: "100%",
|
|
2023
|
+
display: "flex",
|
|
2024
|
+
flexDirection: "column"
|
|
2025
|
+
}
|
|
2026
|
+
},
|
|
2027
|
+
/* @__PURE__ */ React15.createElement(
|
|
2028
|
+
"div",
|
|
2029
|
+
{
|
|
2030
|
+
style: {
|
|
2031
|
+
display: "flex",
|
|
2032
|
+
justifyContent: "space-between",
|
|
2033
|
+
alignItems: "center",
|
|
2034
|
+
marginBottom: "1rem"
|
|
2035
|
+
}
|
|
2036
|
+
},
|
|
2037
|
+
/* @__PURE__ */ React15.createElement(Title2, { order: 3 }, "List Settings"),
|
|
2038
|
+
/* @__PURE__ */ React15.createElement(CloseButton2, { onClick: closePanel })
|
|
2039
|
+
),
|
|
2040
|
+
/* @__PURE__ */ React15.createElement(
|
|
2041
|
+
ReusablePanel,
|
|
2042
|
+
{
|
|
2043
|
+
extraTabs: [
|
|
2044
|
+
{
|
|
2045
|
+
label: "General",
|
|
2046
|
+
value: "general",
|
|
2047
|
+
content: /* @__PURE__ */ React15.createElement(GeneralTab2, { initialConfig, onSave: handleConfigSave })
|
|
2048
|
+
}
|
|
2049
|
+
],
|
|
2050
|
+
context: { editor, block }
|
|
2051
|
+
}
|
|
2052
|
+
)
|
|
2053
|
+
);
|
|
2054
|
+
};
|
|
2055
|
+
|
|
2056
|
+
// src/mantine/blocks/list/template/TemplateView.tsx
|
|
2057
|
+
import { Card as Card5, Group as Group5, Stack as Stack9, Text as Text7, ActionIcon as ActionIcon3, Badge as Badge2 } from "@mantine/core";
|
|
2058
|
+
var LIST_TEMPLATE_PANEL_ID = "list-template-panel";
|
|
2059
|
+
var ListTemplateView = ({ editor, block }) => {
|
|
2060
|
+
const panelId = `${LIST_TEMPLATE_PANEL_ID}-${block.id}`;
|
|
2061
|
+
const panelContent = useMemo6(() => /* @__PURE__ */ React16.createElement(TemplateConfig2, { editor, block }), [editor, block]);
|
|
2062
|
+
const { open } = usePanel(panelId, panelContent);
|
|
2063
|
+
const listType = block.props.listType && block.props.listType !== "" ? block.props.listType : null;
|
|
2064
|
+
const listName = listType ? getListNameByType(listType) : "Unconfigured List";
|
|
2065
|
+
return /* @__PURE__ */ React16.createElement(Card5, { withBorder: true, padding: "md", radius: "md", style: { width: "100%", cursor: "pointer", position: "relative" }, onClick: open }, /* @__PURE__ */ React16.createElement(Badge2, { size: "xs", variant: "light", color: "gray", style: { position: "absolute", top: 8, right: 8 } }, "Template"), /* @__PURE__ */ React16.createElement(Group5, { wrap: "nowrap", justify: "space-between", align: "center" }, /* @__PURE__ */ React16.createElement(Group5, { wrap: "nowrap", align: "center" }, /* @__PURE__ */ React16.createElement(ActionIcon3, { variant: "light", color: "blue", size: "lg", radius: "xl", style: { flexShrink: 0 } }, getIcon(block.props.icon, 18, 1.5, "checklist")), /* @__PURE__ */ React16.createElement(Stack9, { gap: "xs", style: { flex: 1 } }, /* @__PURE__ */ React16.createElement(Text7, { fw: 500, size: "sm", contentEditable: false }, listName), /* @__PURE__ */ React16.createElement(Text7, { size: "xs", c: "dimmed", contentEditable: false }, listType ? `List of ${listName.toLowerCase()}` : "Click to configure list type and settings")))));
|
|
2066
|
+
};
|
|
2067
|
+
|
|
2068
|
+
// src/mantine/blocks/list/flow/FlowView.tsx
|
|
2069
|
+
import React35, { useState as useState5, useEffect as useEffect5, useMemo as useMemo7, useCallback as useCallback9 } from "react";
|
|
2070
|
+
import { Group as Group6, Stack as Stack22, Text as Text22, ActionIcon as ActionIcon4, Alert as Alert3, Loader, Center, Flex as Flex14, Button as Button5 } from "@mantine/core";
|
|
2024
2071
|
|
|
2025
2072
|
// src/mantine/blocks/list/linked_resources/LinkedResourcesList.tsx
|
|
2026
|
-
import
|
|
2073
|
+
import React20 from "react";
|
|
2027
2074
|
import { Stack as Stack10, Text as Text8, Box as Box2, Flex as Flex2 } from "@mantine/core";
|
|
2028
2075
|
|
|
2029
2076
|
// src/core/lib/getMediaTypeIcon.tsx
|
|
2030
2077
|
import { IconArchive, IconDeviceAudioTape, IconFileTypeXml, IconImageInPicture, IconPdf, IconFile, IconJson, IconVideo } from "@tabler/icons-react";
|
|
2031
|
-
import
|
|
2078
|
+
import React17 from "react";
|
|
2032
2079
|
function getMediaTypeIcon(mediaType, props = {}) {
|
|
2033
2080
|
const normalizedType = mediaType?.toLowerCase() || "";
|
|
2034
2081
|
if (normalizedType.startsWith("image/")) {
|
|
2035
|
-
return /* @__PURE__ */
|
|
2082
|
+
return /* @__PURE__ */ React17.createElement(IconImageInPicture, { ...props });
|
|
2036
2083
|
}
|
|
2037
2084
|
if (normalizedType.startsWith("video/")) {
|
|
2038
|
-
return /* @__PURE__ */
|
|
2085
|
+
return /* @__PURE__ */ React17.createElement(IconVideo, { ...props });
|
|
2039
2086
|
}
|
|
2040
2087
|
if (normalizedType.startsWith("audio/")) {
|
|
2041
|
-
return /* @__PURE__ */
|
|
2088
|
+
return /* @__PURE__ */ React17.createElement(IconDeviceAudioTape, { ...props });
|
|
2042
2089
|
}
|
|
2043
2090
|
if (normalizedType.includes("pdf") || normalizedType === "application/pdf") {
|
|
2044
|
-
return /* @__PURE__ */
|
|
2091
|
+
return /* @__PURE__ */ React17.createElement(IconPdf, { ...props });
|
|
2045
2092
|
}
|
|
2046
2093
|
if (normalizedType.includes("json") || normalizedType === "application/json" || normalizedType === "text/json") {
|
|
2047
|
-
return /* @__PURE__ */
|
|
2094
|
+
return /* @__PURE__ */ React17.createElement(IconJson, { ...props });
|
|
2048
2095
|
}
|
|
2049
2096
|
if (normalizedType.includes("xml") || normalizedType === "application/xml" || normalizedType === "text/xml" || normalizedType === "application/rss+xml" || normalizedType === "application/atom+xml") {
|
|
2050
|
-
return /* @__PURE__ */
|
|
2097
|
+
return /* @__PURE__ */ React17.createElement(IconFileTypeXml, { ...props });
|
|
2051
2098
|
}
|
|
2052
2099
|
if (normalizedType.includes("zip") || normalizedType.includes("rar") || normalizedType.includes("tar") || normalizedType.includes("gzip") || normalizedType.includes("7z") || normalizedType === "application/x-compressed" || normalizedType === "application/x-zip-compressed" || normalizedType === "multipart/x-zip") {
|
|
2053
|
-
return /* @__PURE__ */
|
|
2100
|
+
return /* @__PURE__ */ React17.createElement(IconArchive, { ...props });
|
|
2054
2101
|
}
|
|
2055
2102
|
if (normalizedType.startsWith("text/") || normalizedType.includes("document") || normalizedType.includes("word") || normalizedType.includes("excel") || normalizedType.includes("powerpoint") || normalizedType.includes("spreadsheet") || normalizedType.includes("presentation")) {
|
|
2056
|
-
return /* @__PURE__ */
|
|
2103
|
+
return /* @__PURE__ */ React17.createElement(IconFile, { ...props });
|
|
2057
2104
|
}
|
|
2058
|
-
return /* @__PURE__ */
|
|
2105
|
+
return /* @__PURE__ */ React17.createElement(IconVideo, { ...props });
|
|
2059
2106
|
}
|
|
2060
2107
|
|
|
2061
2108
|
// src/mantine/blocks/list/ListItemContainer.tsx
|
|
2062
2109
|
import { Flex } from "@mantine/core";
|
|
2063
|
-
import
|
|
2110
|
+
import React18 from "react";
|
|
2064
2111
|
function ListItemContainer({ children }) {
|
|
2065
|
-
return /* @__PURE__ */
|
|
2112
|
+
return /* @__PURE__ */ React18.createElement(Flex, { styles: { root: { borderRadius: 16, border: `1px solid rgba(255, 255, 255, 0.06)` } }, p: 20, bg: "rgba(255, 255, 255, 0.02)", justify: "space-between" }, children);
|
|
2066
2113
|
}
|
|
2067
2114
|
|
|
2068
2115
|
// src/mantine/blocks/list/ListItemCheckbox.tsx
|
|
2069
|
-
import
|
|
2116
|
+
import React19 from "react";
|
|
2070
2117
|
import { Checkbox as Checkbox3 } from "@mantine/core";
|
|
2071
2118
|
function ListItemCheckbox({ checked, onCheck, ariaLabel }) {
|
|
2072
|
-
return /* @__PURE__ */
|
|
2119
|
+
return /* @__PURE__ */ React19.createElement(
|
|
2073
2120
|
Checkbox3,
|
|
2074
2121
|
{
|
|
2075
2122
|
"aria-label": ariaLabel || "Select row",
|
|
@@ -2090,11 +2137,11 @@ function ListItemCheckbox({ checked, onCheck, ariaLabel }) {
|
|
|
2090
2137
|
// src/mantine/blocks/list/linked_resources/LinkedResourcesList.tsx
|
|
2091
2138
|
var LinkedResourcesList = ({ items, mods, isItemChecked, onItemCheck, config: _config }) => {
|
|
2092
2139
|
if (!items || items.length === 0) {
|
|
2093
|
-
return /* @__PURE__ */
|
|
2140
|
+
return /* @__PURE__ */ React20.createElement(Text8, { size: "sm", c: "dimmed", ta: "center", py: "md" }, "No linked resources found");
|
|
2094
2141
|
}
|
|
2095
2142
|
const rows = items.map((item, index) => {
|
|
2096
2143
|
const title = item.description || item.id || `Resource ${index + 1}`;
|
|
2097
|
-
return /* @__PURE__ */
|
|
2144
|
+
return /* @__PURE__ */ React20.createElement(ListItemContainer, { key: item.id || index }, /* @__PURE__ */ React20.createElement(Flex2, { align: "center", gap: "sm" }, /* @__PURE__ */ React20.createElement(
|
|
2098
2145
|
Box2,
|
|
2099
2146
|
{
|
|
2100
2147
|
style: {
|
|
@@ -2109,7 +2156,7 @@ var LinkedResourcesList = ({ items, mods, isItemChecked, onItemCheck, config: _c
|
|
|
2109
2156
|
}
|
|
2110
2157
|
},
|
|
2111
2158
|
getMediaTypeIcon(item.mediaType, { size: 16 })
|
|
2112
|
-
), /* @__PURE__ */
|
|
2159
|
+
), /* @__PURE__ */ React20.createElement(Stack10, { gap: 0 }, /* @__PURE__ */ React20.createElement(Text8, { size: "sm" }, title), item.type && /* @__PURE__ */ React20.createElement(Text8, { size: "xs", c: "dimmed" }, item.type))), /* @__PURE__ */ React20.createElement(Flex2, { align: "center", gap: "md" }, /* @__PURE__ */ React20.createElement(Stack10, { ta: "right", gap: 0 }, /* @__PURE__ */ React20.createElement(Text8, { size: "sm" }, item.encrypted === "true" ? "Private" : "Public"), /* @__PURE__ */ React20.createElement(Text8, { size: "xs", c: "dimmed" }, item.encrypted === "true" ? "Ask for access" : "Accessible")), mods && /* @__PURE__ */ React20.createElement(
|
|
2113
2160
|
ListItemCheckbox,
|
|
2114
2161
|
{
|
|
2115
2162
|
ariaLabel: `Select resource ${item.id}`,
|
|
@@ -2118,11 +2165,11 @@ var LinkedResourcesList = ({ items, mods, isItemChecked, onItemCheck, config: _c
|
|
|
2118
2165
|
}
|
|
2119
2166
|
)));
|
|
2120
2167
|
});
|
|
2121
|
-
return /* @__PURE__ */
|
|
2168
|
+
return /* @__PURE__ */ React20.createElement(Box2, { flex: 1 }, /* @__PURE__ */ React20.createElement(Stack10, null, rows));
|
|
2122
2169
|
};
|
|
2123
2170
|
|
|
2124
2171
|
// src/mantine/blocks/list/assets/AssetsList.tsx
|
|
2125
|
-
import
|
|
2172
|
+
import React21 from "react";
|
|
2126
2173
|
import { Text as Text9, Box as Box3, Stack as Stack11, Flex as Flex3, Image } from "@mantine/core";
|
|
2127
2174
|
|
|
2128
2175
|
// src/core/lib/formatters.ts
|
|
@@ -2131,15 +2178,15 @@ var formatNumber = (value) => typeof value === "number" ? value.toLocaleString()
|
|
|
2131
2178
|
// src/mantine/blocks/list/assets/AssetsList.tsx
|
|
2132
2179
|
var AssetsList = ({ items, mods, isItemChecked, onItemCheck }) => {
|
|
2133
2180
|
if (!items || items.length === 0) {
|
|
2134
|
-
return /* @__PURE__ */
|
|
2181
|
+
return /* @__PURE__ */ React21.createElement(Text9, { size: "sm", c: "dimmed", ta: "center", py: "md" }, "No assets found");
|
|
2135
2182
|
}
|
|
2136
|
-
const rows = items.map((asset) => /* @__PURE__ */
|
|
2137
|
-
return /* @__PURE__ */
|
|
2183
|
+
const rows = items.map((asset) => /* @__PURE__ */ React21.createElement(ListItemContainer, { key: asset.did }, /* @__PURE__ */ React21.createElement(Flex3, { align: "center", gap: "sm" }, /* @__PURE__ */ React21.createElement(Image, { radius: 16, w: 32, h: 32, src: asset.icon }), /* @__PURE__ */ React21.createElement(Stack11, { gap: 0 }, /* @__PURE__ */ React21.createElement(Text9, { size: "sm" }, asset.name || "-", " ", asset.alsoKnownAs || "-"), asset.totalCarbon !== void 0 && /* @__PURE__ */ React21.createElement(Text9, { size: "sm", c: "dimmed" }, formatNumber(asset.totalCarbon), " CARBON"))), /* @__PURE__ */ React21.createElement(Flex3, { align: "center", gap: "md" }, /* @__PURE__ */ React21.createElement(Stack11, { ta: "right", gap: 0 }, /* @__PURE__ */ React21.createElement(Text9, { size: "sm" }, asset.currency || "", formatNumber(asset.price)), /* @__PURE__ */ React21.createElement(Text9, { size: "sm", c: "dimmed" }, asset.available ? "Available" : "Unavailable")), mods && /* @__PURE__ */ React21.createElement(ListItemCheckbox, { ariaLabel: `Select asset ${asset.did}`, checked: isItemChecked?.(asset.did), onCheck: (checked) => onItemCheck?.(asset.did, checked) }))));
|
|
2184
|
+
return /* @__PURE__ */ React21.createElement(Box3, { flex: 1 }, /* @__PURE__ */ React21.createElement(Stack11, null, rows));
|
|
2138
2185
|
};
|
|
2139
2186
|
|
|
2140
2187
|
// src/mantine/blocks/list/transactions/TransactionsList.tsx
|
|
2141
|
-
import
|
|
2142
|
-
import { Text as Text10, Badge as
|
|
2188
|
+
import React22 from "react";
|
|
2189
|
+
import { Text as Text10, Badge as Badge3, Tooltip as Tooltip2, Box as Box4, Flex as Flex4, Stack as Stack12 } from "@mantine/core";
|
|
2143
2190
|
var formatTime = (timeStr) => {
|
|
2144
2191
|
try {
|
|
2145
2192
|
const date = new Date(timeStr);
|
|
@@ -2154,9 +2201,9 @@ var truncateHash = (hash, length = 8) => {
|
|
|
2154
2201
|
};
|
|
2155
2202
|
var TransactionsList = ({ items, mods, isItemChecked, onItemCheck, config: _config }) => {
|
|
2156
2203
|
if (!items || items.length === 0) {
|
|
2157
|
-
return /* @__PURE__ */
|
|
2204
|
+
return /* @__PURE__ */ React22.createElement(Text10, { size: "sm", c: "dimmed", ta: "center", py: "md" }, "No transactions found");
|
|
2158
2205
|
}
|
|
2159
|
-
const rows = items.map((transaction, index) => /* @__PURE__ */
|
|
2206
|
+
const rows = items.map((transaction, index) => /* @__PURE__ */ React22.createElement(ListItemContainer, { key: transaction.transactionHash || index }, /* @__PURE__ */ React22.createElement(Flex4, { align: "center", gap: "sm" }, /* @__PURE__ */ React22.createElement(Stack12, { gap: 2 }, /* @__PURE__ */ React22.createElement(Tooltip2, { label: transaction.transactionHash, position: "top" }, /* @__PURE__ */ React22.createElement(Text10, { size: "sm", style: { fontFamily: "monospace" } }, truncateHash(transaction.transactionHash))), /* @__PURE__ */ React22.createElement(Text10, { size: "sm", c: "dimmed" }, transaction.memo || "-"))), /* @__PURE__ */ React22.createElement(Flex4, { align: "center", gap: "md" }, /* @__PURE__ */ React22.createElement(Stack12, { ta: "right", gap: 2 }, /* @__PURE__ */ React22.createElement(Badge3, { size: "sm", variant: "light", color: "blue", style: { fontFamily: "monospace", fontSize: "10px" } }, transaction.typeUrl), /* @__PURE__ */ React22.createElement(Text10, { size: "xs", c: "dimmed" }, formatTime(transaction.time))), mods && /* @__PURE__ */ React22.createElement(
|
|
2160
2207
|
ListItemCheckbox,
|
|
2161
2208
|
{
|
|
2162
2209
|
ariaLabel: `Select transaction ${transaction.transactionHash}`,
|
|
@@ -2164,17 +2211,17 @@ var TransactionsList = ({ items, mods, isItemChecked, onItemCheck, config: _conf
|
|
|
2164
2211
|
onCheck: (checked) => onItemCheck?.(transaction.transactionHash, checked)
|
|
2165
2212
|
}
|
|
2166
2213
|
))));
|
|
2167
|
-
return /* @__PURE__ */
|
|
2214
|
+
return /* @__PURE__ */ React22.createElement(Box4, { flex: 1 }, /* @__PURE__ */ React22.createElement(Stack12, null, rows));
|
|
2168
2215
|
};
|
|
2169
2216
|
|
|
2170
2217
|
// src/mantine/blocks/list/collections/CollectionsList.tsx
|
|
2171
|
-
import
|
|
2218
|
+
import React23 from "react";
|
|
2172
2219
|
import { Text as Text11, Box as Box5, Image as Image2, Stack as Stack13, Flex as Flex5 } from "@mantine/core";
|
|
2173
2220
|
var CollectionsList = ({ items, mods, isItemChecked, onItemCheck }) => {
|
|
2174
2221
|
if (!items || items.length === 0) {
|
|
2175
|
-
return /* @__PURE__ */
|
|
2222
|
+
return /* @__PURE__ */ React23.createElement(Text11, { size: "sm", c: "dimmed", ta: "center", py: "md" }, "No collections found");
|
|
2176
2223
|
}
|
|
2177
|
-
const rows = items.map((collection) => /* @__PURE__ */
|
|
2224
|
+
const rows = items.map((collection) => /* @__PURE__ */ React23.createElement(ListItemContainer, { key: collection.did }, /* @__PURE__ */ React23.createElement(Flex5, { align: "center", gap: "sm" }, /* @__PURE__ */ React23.createElement(Image2, { radius: 16, w: 32, h: 32, src: collection.icon }), /* @__PURE__ */ React23.createElement(Stack13, { gap: 0 }, /* @__PURE__ */ React23.createElement(Text11, { size: "sm" }, collection.name || "-"), /* @__PURE__ */ React23.createElement(Text11, { size: "sm", c: "dimmed" }, collection.brand || "-"))), /* @__PURE__ */ React23.createElement(Flex5, { align: "center", gap: "md" }, /* @__PURE__ */ React23.createElement(Stack13, { ta: "right", gap: 0 }, /* @__PURE__ */ React23.createElement(Text11, { size: "sm" }, collection.totalAssets || "-", " Assets"), /* @__PURE__ */ React23.createElement(Text11, { size: "sm", c: "dimmed" }, collection.currency || "-", collection.price || "-")), mods && /* @__PURE__ */ React23.createElement(
|
|
2178
2225
|
ListItemCheckbox,
|
|
2179
2226
|
{
|
|
2180
2227
|
ariaLabel: `Select collection ${collection.did}`,
|
|
@@ -2182,17 +2229,17 @@ var CollectionsList = ({ items, mods, isItemChecked, onItemCheck }) => {
|
|
|
2182
2229
|
onCheck: (checked) => onItemCheck?.(collection.did, checked)
|
|
2183
2230
|
}
|
|
2184
2231
|
))));
|
|
2185
|
-
return /* @__PURE__ */
|
|
2232
|
+
return /* @__PURE__ */ React23.createElement(Box5, { flex: 1 }, /* @__PURE__ */ React23.createElement(Stack13, null, rows));
|
|
2186
2233
|
};
|
|
2187
2234
|
|
|
2188
2235
|
// src/mantine/blocks/list/investments/InvestmentsList.tsx
|
|
2189
|
-
import
|
|
2236
|
+
import React24 from "react";
|
|
2190
2237
|
import { Text as Text12, Box as Box6, Image as Image3, Stack as Stack14, Flex as Flex6, Progress } from "@mantine/core";
|
|
2191
2238
|
var InvestmentsList = ({ items, mods, isItemChecked, onItemCheck }) => {
|
|
2192
2239
|
if (!items || items.length === 0) {
|
|
2193
|
-
return /* @__PURE__ */
|
|
2240
|
+
return /* @__PURE__ */ React24.createElement(Text12, { size: "sm", c: "dimmed", ta: "center", py: "md" }, "No investments found");
|
|
2194
2241
|
}
|
|
2195
|
-
const rows = items.map((investment) => /* @__PURE__ */
|
|
2242
|
+
const rows = items.map((investment) => /* @__PURE__ */ React24.createElement(ListItemContainer, { key: investment.did }, /* @__PURE__ */ React24.createElement(Flex6, { align: "center", gap: "sm" }, /* @__PURE__ */ React24.createElement(Image3, { radius: 16, w: 32, h: 32, src: investment.icon }), /* @__PURE__ */ React24.createElement(Stack14, { gap: 0 }, /* @__PURE__ */ React24.createElement(Text12, { size: "sm" }, investment.name || "-"), /* @__PURE__ */ React24.createElement(Text12, { size: "sm", c: "dimmed" }, investment.brand || "-"))), /* @__PURE__ */ React24.createElement(Flex6, { align: "center", gap: "md" }, /* @__PURE__ */ React24.createElement(Stack14, { ta: "right", gap: 0 }, /* @__PURE__ */ React24.createElement(Flex6, { gap: "5px" }, /* @__PURE__ */ React24.createElement(Text12, { size: "sm" }, investment.currency + formatNumber(investment.currentAmount)), /* @__PURE__ */ React24.createElement(Text12, { size: "sm", c: "dimmed" }, "/ ", investment.currency + formatNumber(investment.maxAmount))), /* @__PURE__ */ React24.createElement(Text12, { size: "xs", c: "dimmed" }, /* @__PURE__ */ React24.createElement(Progress, { color: "rgb(0, 255, 157)", radius: "xl", size: "lg", value: investment.currentAmount * 100 / investment.maxAmount }))), mods && /* @__PURE__ */ React24.createElement(
|
|
2196
2243
|
ListItemCheckbox,
|
|
2197
2244
|
{
|
|
2198
2245
|
ariaLabel: `Select investment ${investment.did}`,
|
|
@@ -2200,408 +2247,88 @@ var InvestmentsList = ({ items, mods, isItemChecked, onItemCheck }) => {
|
|
|
2200
2247
|
onCheck: (checked) => onItemCheck?.(investment.did, checked)
|
|
2201
2248
|
}
|
|
2202
2249
|
))));
|
|
2203
|
-
return /* @__PURE__ */
|
|
2204
|
-
};
|
|
2205
|
-
|
|
2206
|
-
// src/mantine/blocks/list/oracles/OraclesList.tsx
|
|
2207
|
-
import React24 from "react";
|
|
2208
|
-
import { Text as Text13, Box as Box7, Image as Image4, Stack as Stack15, Flex as Flex7 } from "@mantine/core";
|
|
2209
|
-
var OraclesList = ({ items, mods, isItemChecked, onItemCheck }) => {
|
|
2210
|
-
if (!items || items.length === 0) {
|
|
2211
|
-
return /* @__PURE__ */ React24.createElement(Text13, { size: "sm", c: "dimmed", ta: "center", py: "md" }, "No oracles found");
|
|
2212
|
-
}
|
|
2213
|
-
const rows = items.map((oracle) => /* @__PURE__ */ React24.createElement(ListItemContainer, { key: oracle.did }, /* @__PURE__ */ React24.createElement(Flex7, { align: "center", gap: "sm" }, /* @__PURE__ */ React24.createElement(Image4, { radius: 16, w: 32, h: 32, src: oracle.icon }), /* @__PURE__ */ React24.createElement(Stack15, { gap: 0 }, /* @__PURE__ */ React24.createElement(Text13, { size: "sm" }, oracle.name || "-"), /* @__PURE__ */ React24.createElement(Text13, { size: "sm", c: "dimmed" }, oracle.brand || "-"))), /* @__PURE__ */ React24.createElement(Flex7, { align: "center", gap: "md" }, /* @__PURE__ */ React24.createElement(Stack15, { ta: "right", gap: 0 }, /* @__PURE__ */ React24.createElement(Text13, { size: "sm" }, oracle.currency || "-"), /* @__PURE__ */ React24.createElement(Text13, { size: "xs", c: "dimmed" }, oracle.minPoints, " - ", oracle.maxPoints, " pts"), /* @__PURE__ */ React24.createElement(Text13, { size: "xs", c: "dimmed" }, oracle.flowsAmount, " Flows")), mods && /* @__PURE__ */ React24.createElement(ListItemCheckbox, { ariaLabel: `Select oracle ${oracle.did}`, checked: isItemChecked?.(oracle.did), onCheck: (checked) => onItemCheck?.(oracle.did, checked) }))));
|
|
2214
|
-
return /* @__PURE__ */ React24.createElement(Box7, { flex: 1 }, /* @__PURE__ */ React24.createElement(Stack15, null, rows));
|
|
2215
|
-
};
|
|
2216
|
-
|
|
2217
|
-
// src/mantine/blocks/list/pods/PODsList.tsx
|
|
2218
|
-
import React25 from "react";
|
|
2219
|
-
import { Text as Text14, Box as Box8, Image as Image5, Stack as Stack16, Flex as Flex8 } from "@mantine/core";
|
|
2220
|
-
var PodsList = ({ items, mods, isItemChecked, onItemCheck }) => {
|
|
2221
|
-
if (!items || items.length === 0) {
|
|
2222
|
-
return /* @__PURE__ */ React25.createElement(Text14, { size: "sm", c: "dimmed", ta: "center", py: "md" }, "No PODs found");
|
|
2223
|
-
}
|
|
2224
|
-
const rows = items.map((pod) => /* @__PURE__ */ React25.createElement(ListItemContainer, { key: pod.did }, /* @__PURE__ */ React25.createElement(Flex8, { align: "center", gap: "sm" }, /* @__PURE__ */ React25.createElement(Image5, { radius: 16, w: 32, h: 32, src: pod.icon }), /* @__PURE__ */ React25.createElement(Stack16, { gap: 0 }, /* @__PURE__ */ React25.createElement(Text14, { size: "sm" }, pod.name || "-"), /* @__PURE__ */ React25.createElement(Text14, { size: "sm", c: "dimmed" }, pod.startDate, " \u2192 ", pod.endDate))), /* @__PURE__ */ React25.createElement(Flex8, { align: "center", gap: "md" }, /* @__PURE__ */ React25.createElement(Stack16, { ta: "right", gap: 0 }, /* @__PURE__ */ React25.createElement(Text14, { size: "sm" }, pod.members, " Members"), /* @__PURE__ */ React25.createElement(Text14, { size: "sm", c: "dimmed" }, pod.totalProposals, " Proposals")), mods && /* @__PURE__ */ React25.createElement(ListItemCheckbox, { ariaLabel: `Select pod ${pod.did}`, checked: isItemChecked?.(pod.did), onCheck: (checked) => onItemCheck?.(pod.did, checked) }))));
|
|
2225
|
-
return /* @__PURE__ */ React25.createElement(Box8, { flex: 1 }, /* @__PURE__ */ React25.createElement(Stack16, null, rows));
|
|
2226
|
-
};
|
|
2227
|
-
|
|
2228
|
-
// src/mantine/blocks/list/proposals/CollectionsList.tsx
|
|
2229
|
-
import React26 from "react";
|
|
2230
|
-
import { Text as Text15, Box as Box9, Image as Image6, Stack as Stack17, Flex as Flex9, Badge as Badge3 } from "@mantine/core";
|
|
2231
|
-
var ProposalsList = ({ items, mods, isItemChecked, onItemCheck }) => {
|
|
2232
|
-
if (!items || items.length === 0) {
|
|
2233
|
-
return /* @__PURE__ */ React26.createElement(Text15, { size: "sm", c: "dimmed", ta: "center", py: "md" }, "No proposals found");
|
|
2234
|
-
}
|
|
2235
|
-
const rows = items.map((proposal) => /* @__PURE__ */ React26.createElement(ListItemContainer, { key: proposal.did }, /* @__PURE__ */ React26.createElement(Flex9, { align: "center", gap: "sm" }, /* @__PURE__ */ React26.createElement(Image6, { radius: 16, w: 32, h: 32, src: proposal.icon }), /* @__PURE__ */ React26.createElement(Stack17, { gap: 0 }, /* @__PURE__ */ React26.createElement(Text15, { size: "sm" }, proposal.name || "-"), /* @__PURE__ */ React26.createElement(Text15, { size: "xs", c: "dimmed" }, proposal.description || "-"))), /* @__PURE__ */ React26.createElement(Flex9, { align: "center", gap: "md" }, /* @__PURE__ */ React26.createElement(Stack17, { ta: "right", gap: 0 }, /* @__PURE__ */ React26.createElement(Badge3, { size: "sm", variant: "light", color: "blue", style: { fontFamily: "monospace", fontSize: "10px" } }, proposal.status), /* @__PURE__ */ React26.createElement(Text15, { size: "sm", c: "dimmed" }, proposal.isVotedOn ? "Voted" : "Not voted")), mods && /* @__PURE__ */ React26.createElement(ListItemCheckbox, { ariaLabel: `Select proposal ${proposal.did}`, checked: isItemChecked?.(proposal.did), onCheck: (checked) => onItemCheck?.(proposal.did, checked) }))));
|
|
2236
|
-
return /* @__PURE__ */ React26.createElement(Box9, { flex: 1 }, /* @__PURE__ */ React26.createElement(Stack17, null, rows));
|
|
2237
|
-
};
|
|
2238
|
-
|
|
2239
|
-
// src/mantine/blocks/list/requests/RequestsList.tsx
|
|
2240
|
-
import React27 from "react";
|
|
2241
|
-
import { Text as Text16, Box as Box10, Image as Image7, Stack as Stack18, Flex as Flex10 } from "@mantine/core";
|
|
2242
|
-
var RequestsList = ({ items, mods, isItemChecked, onItemCheck }) => {
|
|
2243
|
-
if (!items || items.length === 0) {
|
|
2244
|
-
return /* @__PURE__ */ React27.createElement(Text16, { size: "sm", c: "dimmed", ta: "center", py: "md" }, "No requests found");
|
|
2245
|
-
}
|
|
2246
|
-
const rows = items.map((request) => /* @__PURE__ */ React27.createElement(ListItemContainer, { key: request.did }, /* @__PURE__ */ React27.createElement(Flex10, { align: "center", gap: "sm" }, /* @__PURE__ */ React27.createElement(Image7, { radius: 16, w: 32, h: 32, src: request.icon }), /* @__PURE__ */ React27.createElement(Stack18, { gap: 0 }, /* @__PURE__ */ React27.createElement(Text16, { size: "sm" }, request.name || "-"), /* @__PURE__ */ React27.createElement(Text16, { size: "sm", c: "dimmed" }, request.brand || "-"))), /* @__PURE__ */ React27.createElement(Flex10, { align: "center", gap: "md" }, /* @__PURE__ */ React27.createElement(Stack18, { ta: "right", gap: 0 }, /* @__PURE__ */ React27.createElement(Text16, { size: "sm", c: "dimmed" }, request.currency || "", request.budget ?? "-"), /* @__PURE__ */ React27.createElement(Text16, { size: "xs", c: "dimmed" }, request.totalApplications ?? 0, " Applications")), mods && /* @__PURE__ */ React27.createElement(ListItemCheckbox, { ariaLabel: `Select request ${request.did}`, checked: isItemChecked?.(request.did), onCheck: (checked) => onItemCheck?.(request.did, checked) }))));
|
|
2247
|
-
return /* @__PURE__ */ React27.createElement(Box10, { flex: 1 }, /* @__PURE__ */ React27.createElement(Stack18, null, rows));
|
|
2248
|
-
};
|
|
2249
|
-
|
|
2250
|
-
// src/mantine/blocks/list/members/MembersList.tsx
|
|
2251
|
-
import React28 from "react";
|
|
2252
|
-
import { Text as Text17, Box as Box11, Image as Image8, Stack as Stack19, Flex as Flex11 } from "@mantine/core";
|
|
2253
|
-
var MembersList = ({ items, mods, isItemChecked, onItemCheck }) => {
|
|
2254
|
-
if (!items || items.length === 0) {
|
|
2255
|
-
return /* @__PURE__ */ React28.createElement(Text17, { size: "sm", c: "dimmed", ta: "center", py: "md" }, "No members found");
|
|
2256
|
-
}
|
|
2257
|
-
const rows = items.map((member) => /* @__PURE__ */ React28.createElement(ListItemContainer, { key: member.did }, /* @__PURE__ */ React28.createElement(Flex11, { align: "center", gap: "sm" }, /* @__PURE__ */ React28.createElement(Image8, { radius: 16, w: 32, h: 32, src: member.icon }), /* @__PURE__ */ React28.createElement(Stack19, { gap: 0 }, /* @__PURE__ */ React28.createElement(Text17, { size: "sm" }, member.username || "-"), /* @__PURE__ */ React28.createElement(Text17, { size: "xs", c: "dimmed" }, member.address || "-"))), /* @__PURE__ */ React28.createElement(Flex11, { align: "center", gap: "md" }, /* @__PURE__ */ React28.createElement(Stack19, { ta: "right", gap: 0 }, /* @__PURE__ */ React28.createElement(Text17, { size: "sm" }, member.percentage), /* @__PURE__ */ React28.createElement(Text17, { size: "sm", c: "dimmed" }, member.role)), mods && /* @__PURE__ */ React28.createElement(ListItemCheckbox, { ariaLabel: `Select member ${member.did}`, checked: isItemChecked?.(member.did), onCheck: (checked) => onItemCheck?.(member.did, checked) }))));
|
|
2258
|
-
return /* @__PURE__ */ React28.createElement(Box11, { flex: 1 }, /* @__PURE__ */ React28.createElement(Stack19, null, rows));
|
|
2259
|
-
};
|
|
2260
|
-
|
|
2261
|
-
// src/mantine/blocks/list/validators/ValidatorsList.tsx
|
|
2262
|
-
import React29 from "react";
|
|
2263
|
-
import { Text as Text18, Box as Box12, Image as Image9, Stack as Stack20, Flex as Flex12 } from "@mantine/core";
|
|
2264
|
-
var ValidatorsList = ({ items, mods, isItemChecked, onItemCheck }) => {
|
|
2265
|
-
if (!items || items.length === 0) {
|
|
2266
|
-
return /* @__PURE__ */ React29.createElement(Text18, { size: "sm", c: "dimmed", ta: "center", py: "md" }, "No validators found");
|
|
2267
|
-
}
|
|
2268
|
-
const rows = items.map((v) => /* @__PURE__ */ React29.createElement(ListItemContainer, { key: v.did }, /* @__PURE__ */ React29.createElement(Flex12, { align: "center", gap: "sm" }, /* @__PURE__ */ React29.createElement(Image9, { radius: 16, w: 32, h: 32, src: v.icon }), /* @__PURE__ */ React29.createElement(Stack20, { gap: 0 }, /* @__PURE__ */ React29.createElement(Text18, { size: "sm" }, v.name || "-"), /* @__PURE__ */ React29.createElement(Text18, { size: "xs", c: "dimmed" }, v.description || "-"))), /* @__PURE__ */ React29.createElement(Flex12, { align: "center", gap: "md" }, /* @__PURE__ */ React29.createElement(Stack20, { ta: "right", gap: 0 }, /* @__PURE__ */ React29.createElement(Text18, { size: "sm" }, formatNumber(v.amount), " ", v.currency), /* @__PURE__ */ React29.createElement(Text18, { size: "sm", c: "dimmed" }, v.commission, "% fee"), /* @__PURE__ */ React29.createElement(Text18, { size: "xs", c: "dimmed" }, v.isActive ? "Active" : "Inactive", " \u2022 ", v.isStaked ? "Staked" : "Not staked", " \u2022 ", v.isBonding ? "Bonding" : "Not bonding")), mods && /* @__PURE__ */ React29.createElement(ListItemCheckbox, { ariaLabel: `Select validator ${v.did}`, checked: isItemChecked?.(v.did), onCheck: (checked) => onItemCheck?.(v.did, checked) }))));
|
|
2269
|
-
return /* @__PURE__ */ React29.createElement(Box12, { flex: 1 }, /* @__PURE__ */ React29.createElement(Stack20, null, rows));
|
|
2270
|
-
};
|
|
2271
|
-
|
|
2272
|
-
// src/mantine/blocks/list/ListPagination.tsx
|
|
2273
|
-
import React30 from "react";
|
|
2274
|
-
import { Pagination } from "@mantine/core";
|
|
2275
|
-
function ListPagination({ page, setPage, totalPages }) {
|
|
2276
|
-
return /* @__PURE__ */ React30.createElement(
|
|
2277
|
-
Pagination,
|
|
2278
|
-
{
|
|
2279
|
-
value: page,
|
|
2280
|
-
onChange: setPage,
|
|
2281
|
-
total: totalPages,
|
|
2282
|
-
siblings: 1,
|
|
2283
|
-
radius: 8,
|
|
2284
|
-
color: "rgba(255, 255, 255, 0.08)",
|
|
2285
|
-
boundaries: 0,
|
|
2286
|
-
mx: "auto",
|
|
2287
|
-
styles: {
|
|
2288
|
-
dots: { display: "none" },
|
|
2289
|
-
control: {
|
|
2290
|
-
padding: 0,
|
|
2291
|
-
border: 0,
|
|
2292
|
-
color: "#868e96"
|
|
2293
|
-
}
|
|
2294
|
-
}
|
|
2295
|
-
}
|
|
2296
|
-
);
|
|
2297
|
-
}
|
|
2298
|
-
|
|
2299
|
-
// src/core/constants.ts
|
|
2300
|
-
var DEFAULT_PAGE_SIZE = 5;
|
|
2301
|
-
|
|
2302
|
-
// src/mantine/blocks/list/dao_members/MembersList.tsx
|
|
2303
|
-
import React31 from "react";
|
|
2304
|
-
import { Text as Text19, Box as Box13, Image as Image10, Stack as Stack21, Flex as Flex13 } from "@mantine/core";
|
|
2305
|
-
var DaoMembersList = ({ items, mods, isItemChecked, onItemCheck }) => {
|
|
2306
|
-
if (!items || items.length === 0) {
|
|
2307
|
-
return /* @__PURE__ */ React31.createElement(Text19, { size: "sm", c: "dimmed", ta: "center", py: "md" }, "No members found");
|
|
2308
|
-
}
|
|
2309
|
-
const rows = items.map((member) => /* @__PURE__ */ React31.createElement(ListItemContainer, { key: member.did }, /* @__PURE__ */ React31.createElement(Flex13, { align: "center", gap: "sm" }, /* @__PURE__ */ React31.createElement(Image10, { radius: 16, w: 32, h: 32, src: member.icon }), /* @__PURE__ */ React31.createElement(Stack21, { gap: 0 }, /* @__PURE__ */ React31.createElement(Text19, { size: "sm", fw: 500 }, member.username || "Unknown User"), /* @__PURE__ */ React31.createElement(Text19, { size: "xs", c: "dimmed", lineClamp: 1 }, member.address || "No address"))), /* @__PURE__ */ React31.createElement(Flex13, { align: "center", gap: "md" }, /* @__PURE__ */ React31.createElement(Stack21, { ta: "right", gap: 0 }, /* @__PURE__ */ React31.createElement(Text19, { size: "sm", fw: 500, c: "blue" }, member.percentage || "0%"), /* @__PURE__ */ React31.createElement(Text19, { size: "xs", c: "dimmed", tt: "capitalize" }, member.role || "member")), mods && /* @__PURE__ */ React31.createElement(
|
|
2310
|
-
ListItemCheckbox,
|
|
2311
|
-
{
|
|
2312
|
-
ariaLabel: `Select member ${member.username || member.did}`,
|
|
2313
|
-
checked: isItemChecked?.(member.did) || false,
|
|
2314
|
-
onCheck: (checked) => onItemCheck?.(member.did, checked)
|
|
2315
|
-
}
|
|
2316
|
-
))));
|
|
2317
|
-
return /* @__PURE__ */ React31.createElement(Box13, { flex: 1 }, /* @__PURE__ */ React31.createElement(Stack21, { gap: "xs" }, rows));
|
|
2250
|
+
return /* @__PURE__ */ React24.createElement(Box6, { flex: 1 }, /* @__PURE__ */ React24.createElement(Stack14, null, rows));
|
|
2318
2251
|
};
|
|
2319
2252
|
|
|
2320
|
-
// src/mantine/blocks/list/
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
const
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
result = await handlers.getProposals(did || config.relayedNodeDid, page);
|
|
2385
|
-
setData({ items: result.data });
|
|
2386
|
-
break;
|
|
2387
|
-
case "requests":
|
|
2388
|
-
did = handlers.getEntityDid();
|
|
2389
|
-
if (!did && !config.relayedNodeDid) throw new Error("Relayer is required");
|
|
2390
|
-
result = await handlers.getRequests(did || config.relayedNodeDid, page);
|
|
2391
|
-
setData({ items: result.data });
|
|
2392
|
-
break;
|
|
2393
|
-
case "group_members":
|
|
2394
|
-
if (!config.address) throw new Error("Address is required");
|
|
2395
|
-
if (!config.groupCoreAddress) throw new Error("Group Core Address is required");
|
|
2396
|
-
result = await handlers.getMembers(config.address, config.groupCoreAddress, config.withBalance, page);
|
|
2397
|
-
setData({ items: result.data });
|
|
2398
|
-
break;
|
|
2399
|
-
case "validators":
|
|
2400
|
-
did = handlers.getEntityDid();
|
|
2401
|
-
if (!did && !config.relayedNodeDid) throw new Error("Relayer is required");
|
|
2402
|
-
result = await handlers.getValidators(did || config.relayedNodeDid, page);
|
|
2403
|
-
setData({ items: result.data });
|
|
2404
|
-
break;
|
|
2405
|
-
case "dao_members":
|
|
2406
|
-
userAddress = handlers.getCurrentUser();
|
|
2407
|
-
groupIds = handlers.getDaoGroupsIds();
|
|
2408
|
-
if (!userAddress.address && !config.address) throw new Error("Address is required");
|
|
2409
|
-
if (!groupIds && !config.groupIds) throw new Error("Group Ids are required");
|
|
2410
|
-
result = await handlers.getDaoMembers(userAddress.address || config.address, groupIds || config.groupIds, config.withBalance, page);
|
|
2411
|
-
setData({ items: result.data });
|
|
2412
|
-
break;
|
|
2413
|
-
default:
|
|
2414
|
-
throw new Error(`Unknown list type: ${listType}`);
|
|
2415
|
-
}
|
|
2416
|
-
} catch (err) {
|
|
2417
|
-
setError(err instanceof Error ? err.message : "Failed to fetch data");
|
|
2418
|
-
} finally {
|
|
2419
|
-
setLoading(false);
|
|
2420
|
-
}
|
|
2421
|
-
};
|
|
2422
|
-
useEffect5(() => {
|
|
2423
|
-
fetchData();
|
|
2424
|
-
}, [listType, page, config]);
|
|
2425
|
-
const renderListComponent = () => {
|
|
2426
|
-
if (!data) return null;
|
|
2427
|
-
switch (listType) {
|
|
2428
|
-
case "linked_resources":
|
|
2429
|
-
return /* @__PURE__ */ React32.createElement(LinkedResourcesList, { items: data.items, config });
|
|
2430
|
-
case "assets":
|
|
2431
|
-
return /* @__PURE__ */ React32.createElement(AssetsList, { items: data.items, config });
|
|
2432
|
-
case "transactions":
|
|
2433
|
-
return /* @__PURE__ */ React32.createElement(TransactionsList, { items: data.items, config });
|
|
2434
|
-
case "collections":
|
|
2435
|
-
return /* @__PURE__ */ React32.createElement(CollectionsList, { items: data.items });
|
|
2436
|
-
case "investments":
|
|
2437
|
-
return /* @__PURE__ */ React32.createElement(InvestmentsList, { items: data.items });
|
|
2438
|
-
case "oracles":
|
|
2439
|
-
return /* @__PURE__ */ React32.createElement(OraclesList, { items: data.items });
|
|
2440
|
-
case "pods":
|
|
2441
|
-
return /* @__PURE__ */ React32.createElement(PodsList, { items: data.items });
|
|
2442
|
-
case "proposals":
|
|
2443
|
-
return /* @__PURE__ */ React32.createElement(ProposalsList, { items: data.items });
|
|
2444
|
-
case "requests":
|
|
2445
|
-
return /* @__PURE__ */ React32.createElement(RequestsList, { items: data.items });
|
|
2446
|
-
case "group_members":
|
|
2447
|
-
return /* @__PURE__ */ React32.createElement(MembersList, { items: data.items });
|
|
2448
|
-
case "dao_members":
|
|
2449
|
-
return /* @__PURE__ */ React32.createElement(DaoMembersList, { items: data.items });
|
|
2450
|
-
case "validators":
|
|
2451
|
-
return /* @__PURE__ */ React32.createElement(ValidatorsList, { items: data.items });
|
|
2452
|
-
default:
|
|
2453
|
-
return null;
|
|
2454
|
-
}
|
|
2455
|
-
};
|
|
2456
|
-
return /* @__PURE__ */ React32.createElement(Stack22, { gap: "md" }, /* @__PURE__ */ React32.createElement("div", null, /* @__PURE__ */ React32.createElement(Text20, { size: "lg", fw: 600, mb: "xs" }, "Preview ", typeConfig.metadata.name), /* @__PURE__ */ React32.createElement(Text20, { size: "sm", c: "dimmed" }, "Preview how your list will look with the current configuration")), loading && /* @__PURE__ */ React32.createElement(Center, { py: "xl" }, /* @__PURE__ */ React32.createElement(Stack22, { align: "center", gap: "sm" }, /* @__PURE__ */ React32.createElement(Loader, { size: "md" }), /* @__PURE__ */ React32.createElement(Text20, { size: "sm", c: "dimmed" }, "Loading preview..."))), error && /* @__PURE__ */ React32.createElement(Alert3, { color: "red", title: "Failed to load preview" }, /* @__PURE__ */ React32.createElement(Stack22, { gap: "xs" }, /* @__PURE__ */ React32.createElement(Text20, { size: "sm" }, error), /* @__PURE__ */ React32.createElement(Button6, { size: "xs", variant: "subtle", onClick: fetchData }, "Retry"))), !loading && !error && data && /* @__PURE__ */ React32.createElement(React32.Fragment, null, /* @__PURE__ */ React32.createElement("div", { style: { maxHeight: "400px", overflow: "auto" } }, renderListComponent()), /* @__PURE__ */ React32.createElement(ListPagination, { page, setPage, totalPages })), /* @__PURE__ */ React32.createElement(Group6, { justify: "space-between", mt: "md" }, /* @__PURE__ */ React32.createElement(Button6, { variant: "subtle", onClick: onPrev }, "Previous"), /* @__PURE__ */ React32.createElement(Button6, { onClick: onAddToBlock }, "Add to Block")));
|
|
2457
|
-
};
|
|
2458
|
-
|
|
2459
|
-
// src/mantine/blocks/list/modal/ModalNavigation.tsx
|
|
2460
|
-
import React33 from "react";
|
|
2461
|
-
import { Stack as Stack23, Button as Button7, Text as Text21 } from "@mantine/core";
|
|
2462
|
-
var ModalNavigation = ({
|
|
2463
|
-
steps,
|
|
2464
|
-
activeStep,
|
|
2465
|
-
onStepChange,
|
|
2466
|
-
showUpdateButton = false,
|
|
2467
|
-
onUpdateBlock
|
|
2468
|
-
}) => {
|
|
2469
|
-
return /* @__PURE__ */ React33.createElement(Stack23, { gap: "xs", style: { height: "100%" } }, /* @__PURE__ */ React33.createElement(Stack23, { gap: "xs", style: { flex: 1 } }, steps.map((step) => /* @__PURE__ */ React33.createElement(
|
|
2470
|
-
Button7,
|
|
2471
|
-
{
|
|
2472
|
-
key: step.id,
|
|
2473
|
-
variant: activeStep === step.id ? "filled" : "subtle",
|
|
2474
|
-
justify: "flex-start",
|
|
2475
|
-
disabled: step.disabled,
|
|
2476
|
-
onClick: () => onStepChange(step.id),
|
|
2477
|
-
styles: {
|
|
2478
|
-
root: {
|
|
2479
|
-
height: "auto",
|
|
2480
|
-
padding: "12px"
|
|
2481
|
-
},
|
|
2482
|
-
inner: {
|
|
2483
|
-
justifyContent: "flex-start"
|
|
2484
|
-
}
|
|
2485
|
-
}
|
|
2486
|
-
},
|
|
2487
|
-
/* @__PURE__ */ React33.createElement(Stack23, { gap: 2, align: "flex-start" }, /* @__PURE__ */ React33.createElement(Text21, { size: "sm", fw: 500 }, step.label), /* @__PURE__ */ React33.createElement(Text21, { size: "xs", opacity: 0.7 }, step.description))
|
|
2488
|
-
))), showUpdateButton && /* @__PURE__ */ React33.createElement(Button7, { variant: "filled", color: "blue", onClick: onUpdateBlock, style: { marginTop: "auto" } }, "Update Block"));
|
|
2489
|
-
};
|
|
2490
|
-
|
|
2491
|
-
// src/mantine/blocks/list/modal/ListConfigModal.tsx
|
|
2492
|
-
var ListConfigModal = ({ opened, onClose, onSave, initialConfig }) => {
|
|
2493
|
-
const [activeStep, setActiveStep] = useState5("type");
|
|
2494
|
-
const [selectedType, setSelectedType] = useState5(initialConfig?.type || null);
|
|
2495
|
-
const [config, setConfig] = useState5(initialConfig?.config || {});
|
|
2496
|
-
const [sortConfig, setSortConfig] = useState5(initialConfig?.sortOptions || {});
|
|
2497
|
-
const [filterConfig, setFilterConfig] = useState5(initialConfig?.filterOptions || {});
|
|
2498
|
-
const handleTypeSelect = (type) => {
|
|
2499
|
-
setSelectedType(type);
|
|
2500
|
-
const typeConfig = getListTypeConfig(type);
|
|
2501
|
-
const defaultConfig = {};
|
|
2502
|
-
typeConfig.configFields.forEach((field) => {
|
|
2503
|
-
if (field.defaultValue !== void 0) {
|
|
2504
|
-
defaultConfig[field.key] = field.defaultValue;
|
|
2505
|
-
}
|
|
2506
|
-
});
|
|
2507
|
-
setSortConfig(typeConfig.sortFields);
|
|
2508
|
-
setFilterConfig(typeConfig.filterFields);
|
|
2509
|
-
setConfig(defaultConfig);
|
|
2510
|
-
};
|
|
2511
|
-
const handleConfigChange = (key, value) => {
|
|
2512
|
-
setConfig((prev) => ({ ...prev, [key]: value }));
|
|
2513
|
-
};
|
|
2514
|
-
const handleAddToBlock = () => {
|
|
2515
|
-
if (selectedType && config) {
|
|
2516
|
-
onSave({
|
|
2517
|
-
type: selectedType,
|
|
2518
|
-
config,
|
|
2519
|
-
sortOptions: sortConfig,
|
|
2520
|
-
filterOptions: filterConfig,
|
|
2521
|
-
filter: null,
|
|
2522
|
-
sort: null
|
|
2523
|
-
});
|
|
2524
|
-
onClose();
|
|
2525
|
-
}
|
|
2526
|
-
};
|
|
2527
|
-
const isConfigValid = () => {
|
|
2528
|
-
if (!selectedType) return false;
|
|
2529
|
-
const typeConfig = getListTypeConfig(selectedType);
|
|
2530
|
-
return typeConfig.configFields.every((field) => !field.required || config[field.key] && config[field.key].trim() !== "");
|
|
2531
|
-
};
|
|
2532
|
-
const handleClose = () => {
|
|
2533
|
-
setActiveStep("type");
|
|
2534
|
-
setSelectedType(null);
|
|
2535
|
-
setConfig({});
|
|
2536
|
-
onClose();
|
|
2537
|
-
};
|
|
2538
|
-
const steps = [
|
|
2539
|
-
{
|
|
2540
|
-
id: "type",
|
|
2541
|
-
label: "Type",
|
|
2542
|
-
description: "Choose list type",
|
|
2543
|
-
disabled: false
|
|
2544
|
-
},
|
|
2545
|
-
{
|
|
2546
|
-
id: "configure",
|
|
2547
|
-
label: "Configure",
|
|
2548
|
-
description: "Set configuration",
|
|
2549
|
-
disabled: !selectedType
|
|
2550
|
-
},
|
|
2551
|
-
{
|
|
2552
|
-
id: "preview",
|
|
2553
|
-
label: "Preview",
|
|
2554
|
-
description: "Preview and add",
|
|
2555
|
-
disabled: !selectedType || !isConfigValid()
|
|
2556
|
-
}
|
|
2557
|
-
];
|
|
2558
|
-
const renderStepContent = () => {
|
|
2559
|
-
switch (activeStep) {
|
|
2560
|
-
case "type":
|
|
2561
|
-
return /* @__PURE__ */ React34.createElement(ListTypeSelectionStep, { selectedType, onTypeSelect: handleTypeSelect, onNext: () => setActiveStep("configure") });
|
|
2562
|
-
case "configure":
|
|
2563
|
-
return selectedType ? /* @__PURE__ */ React34.createElement(
|
|
2564
|
-
ListConfigurationStep,
|
|
2565
|
-
{
|
|
2566
|
-
listType: selectedType,
|
|
2567
|
-
config,
|
|
2568
|
-
onConfigChange: handleConfigChange,
|
|
2569
|
-
onPrev: () => setActiveStep("type"),
|
|
2570
|
-
onNext: () => setActiveStep("preview"),
|
|
2571
|
-
isValid: isConfigValid()
|
|
2572
|
-
}
|
|
2573
|
-
) : null;
|
|
2574
|
-
case "preview":
|
|
2575
|
-
return selectedType ? /* @__PURE__ */ React34.createElement(ListPreviewStep, { listSortConfig: null, listType: selectedType, config, onAddToBlock: handleAddToBlock, onPrev: () => setActiveStep("configure") }) : null;
|
|
2576
|
-
default:
|
|
2577
|
-
return null;
|
|
2578
|
-
}
|
|
2579
|
-
};
|
|
2580
|
-
return /* @__PURE__ */ React34.createElement(Modal, { opened, onClose: handleClose, title: "Configure List Block", size: "xl" }, /* @__PURE__ */ React34.createElement(Group7, { align: "flex-start", gap: "lg", style: { minHeight: "400px" } }, /* @__PURE__ */ React34.createElement(Box14, { style: { width: "200px", flexShrink: 0, height: "400px", display: "flex" } }, /* @__PURE__ */ React34.createElement(
|
|
2581
|
-
ModalNavigation,
|
|
2582
|
-
{
|
|
2583
|
-
steps,
|
|
2584
|
-
activeStep,
|
|
2585
|
-
onStepChange: setActiveStep,
|
|
2586
|
-
showUpdateButton: selectedType !== null && isConfigValid(),
|
|
2587
|
-
onUpdateBlock: handleAddToBlock
|
|
2588
|
-
}
|
|
2589
|
-
)), /* @__PURE__ */ React34.createElement(Box14, { style: { flex: 1 } }, renderStepContent())));
|
|
2253
|
+
// src/mantine/blocks/list/oracles/OraclesList.tsx
|
|
2254
|
+
import React25 from "react";
|
|
2255
|
+
import { Text as Text13, Box as Box7, Image as Image4, Stack as Stack15, Flex as Flex7 } from "@mantine/core";
|
|
2256
|
+
var OraclesList = ({ items, mods, isItemChecked, onItemCheck }) => {
|
|
2257
|
+
if (!items || items.length === 0) {
|
|
2258
|
+
return /* @__PURE__ */ React25.createElement(Text13, { size: "sm", c: "dimmed", ta: "center", py: "md" }, "No oracles found");
|
|
2259
|
+
}
|
|
2260
|
+
const rows = items.map((oracle) => /* @__PURE__ */ React25.createElement(ListItemContainer, { key: oracle.did }, /* @__PURE__ */ React25.createElement(Flex7, { align: "center", gap: "sm" }, /* @__PURE__ */ React25.createElement(Image4, { radius: 16, w: 32, h: 32, src: oracle.icon }), /* @__PURE__ */ React25.createElement(Stack15, { gap: 0 }, /* @__PURE__ */ React25.createElement(Text13, { size: "sm" }, oracle.name || "-"), /* @__PURE__ */ React25.createElement(Text13, { size: "sm", c: "dimmed" }, oracle.brand || "-"))), /* @__PURE__ */ React25.createElement(Flex7, { align: "center", gap: "md" }, /* @__PURE__ */ React25.createElement(Stack15, { ta: "right", gap: 0 }, /* @__PURE__ */ React25.createElement(Text13, { size: "sm" }, oracle.currency || "-"), /* @__PURE__ */ React25.createElement(Text13, { size: "xs", c: "dimmed" }, oracle.minPoints, " - ", oracle.maxPoints, " pts"), /* @__PURE__ */ React25.createElement(Text13, { size: "xs", c: "dimmed" }, oracle.flowsAmount, " Flows")), mods && /* @__PURE__ */ React25.createElement(ListItemCheckbox, { ariaLabel: `Select oracle ${oracle.did}`, checked: isItemChecked?.(oracle.did), onCheck: (checked) => onItemCheck?.(oracle.did, checked) }))));
|
|
2261
|
+
return /* @__PURE__ */ React25.createElement(Box7, { flex: 1 }, /* @__PURE__ */ React25.createElement(Stack15, null, rows));
|
|
2262
|
+
};
|
|
2263
|
+
|
|
2264
|
+
// src/mantine/blocks/list/pods/PODsList.tsx
|
|
2265
|
+
import React26 from "react";
|
|
2266
|
+
import { Text as Text14, Box as Box8, Image as Image5, Stack as Stack16, Flex as Flex8 } from "@mantine/core";
|
|
2267
|
+
var PodsList = ({ items, mods, isItemChecked, onItemCheck }) => {
|
|
2268
|
+
if (!items || items.length === 0) {
|
|
2269
|
+
return /* @__PURE__ */ React26.createElement(Text14, { size: "sm", c: "dimmed", ta: "center", py: "md" }, "No PODs found");
|
|
2270
|
+
}
|
|
2271
|
+
const rows = items.map((pod) => /* @__PURE__ */ React26.createElement(ListItemContainer, { key: pod.did }, /* @__PURE__ */ React26.createElement(Flex8, { align: "center", gap: "sm" }, /* @__PURE__ */ React26.createElement(Image5, { radius: 16, w: 32, h: 32, src: pod.icon }), /* @__PURE__ */ React26.createElement(Stack16, { gap: 0 }, /* @__PURE__ */ React26.createElement(Text14, { size: "sm" }, pod.name || "-"), /* @__PURE__ */ React26.createElement(Text14, { size: "sm", c: "dimmed" }, pod.startDate, " \u2192 ", pod.endDate))), /* @__PURE__ */ React26.createElement(Flex8, { align: "center", gap: "md" }, /* @__PURE__ */ React26.createElement(Stack16, { ta: "right", gap: 0 }, /* @__PURE__ */ React26.createElement(Text14, { size: "sm" }, pod.members, " Members"), /* @__PURE__ */ React26.createElement(Text14, { size: "sm", c: "dimmed" }, pod.totalProposals, " Proposals")), mods && /* @__PURE__ */ React26.createElement(ListItemCheckbox, { ariaLabel: `Select pod ${pod.did}`, checked: isItemChecked?.(pod.did), onCheck: (checked) => onItemCheck?.(pod.did, checked) }))));
|
|
2272
|
+
return /* @__PURE__ */ React26.createElement(Box8, { flex: 1 }, /* @__PURE__ */ React26.createElement(Stack16, null, rows));
|
|
2273
|
+
};
|
|
2274
|
+
|
|
2275
|
+
// src/mantine/blocks/list/proposals/CollectionsList.tsx
|
|
2276
|
+
import React27 from "react";
|
|
2277
|
+
import { Text as Text15, Box as Box9, Image as Image6, Stack as Stack17, Flex as Flex9, Badge as Badge4 } from "@mantine/core";
|
|
2278
|
+
var ProposalsList = ({ items, mods, isItemChecked, onItemCheck }) => {
|
|
2279
|
+
if (!items || items.length === 0) {
|
|
2280
|
+
return /* @__PURE__ */ React27.createElement(Text15, { size: "sm", c: "dimmed", ta: "center", py: "md" }, "No proposals found");
|
|
2281
|
+
}
|
|
2282
|
+
const rows = items.map((proposal) => /* @__PURE__ */ React27.createElement(ListItemContainer, { key: proposal.did }, /* @__PURE__ */ React27.createElement(Flex9, { align: "center", gap: "sm" }, /* @__PURE__ */ React27.createElement(Image6, { radius: 16, w: 32, h: 32, src: proposal.icon }), /* @__PURE__ */ React27.createElement(Stack17, { gap: 0 }, /* @__PURE__ */ React27.createElement(Text15, { size: "sm" }, proposal.name || "-"), /* @__PURE__ */ React27.createElement(Text15, { size: "xs", c: "dimmed" }, proposal.description || "-"))), /* @__PURE__ */ React27.createElement(Flex9, { align: "center", gap: "md" }, /* @__PURE__ */ React27.createElement(Stack17, { ta: "right", gap: 0 }, /* @__PURE__ */ React27.createElement(Badge4, { size: "sm", variant: "light", color: "blue", style: { fontFamily: "monospace", fontSize: "10px" } }, proposal.status), /* @__PURE__ */ React27.createElement(Text15, { size: "sm", c: "dimmed" }, proposal.isVotedOn ? "Voted" : "Not voted")), mods && /* @__PURE__ */ React27.createElement(ListItemCheckbox, { ariaLabel: `Select proposal ${proposal.did}`, checked: isItemChecked?.(proposal.did), onCheck: (checked) => onItemCheck?.(proposal.did, checked) }))));
|
|
2283
|
+
return /* @__PURE__ */ React27.createElement(Box9, { flex: 1 }, /* @__PURE__ */ React27.createElement(Stack17, null, rows));
|
|
2284
|
+
};
|
|
2285
|
+
|
|
2286
|
+
// src/mantine/blocks/list/requests/RequestsList.tsx
|
|
2287
|
+
import React28 from "react";
|
|
2288
|
+
import { Text as Text16, Box as Box10, Image as Image7, Stack as Stack18, Flex as Flex10 } from "@mantine/core";
|
|
2289
|
+
var RequestsList = ({ items, mods, isItemChecked, onItemCheck }) => {
|
|
2290
|
+
if (!items || items.length === 0) {
|
|
2291
|
+
return /* @__PURE__ */ React28.createElement(Text16, { size: "sm", c: "dimmed", ta: "center", py: "md" }, "No requests found");
|
|
2292
|
+
}
|
|
2293
|
+
const rows = items.map((request) => /* @__PURE__ */ React28.createElement(ListItemContainer, { key: request.did }, /* @__PURE__ */ React28.createElement(Flex10, { align: "center", gap: "sm" }, /* @__PURE__ */ React28.createElement(Image7, { radius: 16, w: 32, h: 32, src: request.icon }), /* @__PURE__ */ React28.createElement(Stack18, { gap: 0 }, /* @__PURE__ */ React28.createElement(Text16, { size: "sm" }, request.name || "-"), /* @__PURE__ */ React28.createElement(Text16, { size: "sm", c: "dimmed" }, request.brand || "-"))), /* @__PURE__ */ React28.createElement(Flex10, { align: "center", gap: "md" }, /* @__PURE__ */ React28.createElement(Stack18, { ta: "right", gap: 0 }, /* @__PURE__ */ React28.createElement(Text16, { size: "sm", c: "dimmed" }, request.currency || "", request.budget ?? "-"), /* @__PURE__ */ React28.createElement(Text16, { size: "xs", c: "dimmed" }, request.totalApplications ?? 0, " Applications")), mods && /* @__PURE__ */ React28.createElement(ListItemCheckbox, { ariaLabel: `Select request ${request.did}`, checked: isItemChecked?.(request.did), onCheck: (checked) => onItemCheck?.(request.did, checked) }))));
|
|
2294
|
+
return /* @__PURE__ */ React28.createElement(Box10, { flex: 1 }, /* @__PURE__ */ React28.createElement(Stack18, null, rows));
|
|
2295
|
+
};
|
|
2296
|
+
|
|
2297
|
+
// src/mantine/blocks/list/members/MembersList.tsx
|
|
2298
|
+
import React29 from "react";
|
|
2299
|
+
import { Text as Text17, Box as Box11, Image as Image8, Stack as Stack19, Flex as Flex11 } from "@mantine/core";
|
|
2300
|
+
var MembersList = ({ items, mods, isItemChecked, onItemCheck }) => {
|
|
2301
|
+
if (!items || items.length === 0) {
|
|
2302
|
+
return /* @__PURE__ */ React29.createElement(Text17, { size: "sm", c: "dimmed", ta: "center", py: "md" }, "No members found");
|
|
2303
|
+
}
|
|
2304
|
+
const rows = items.map((member) => /* @__PURE__ */ React29.createElement(ListItemContainer, { key: member.did }, /* @__PURE__ */ React29.createElement(Flex11, { align: "center", gap: "sm" }, /* @__PURE__ */ React29.createElement(Image8, { radius: 16, w: 32, h: 32, src: member.icon }), /* @__PURE__ */ React29.createElement(Stack19, { gap: 0 }, /* @__PURE__ */ React29.createElement(Text17, { size: "sm" }, member.username || "-"), /* @__PURE__ */ React29.createElement(Text17, { size: "xs", c: "dimmed" }, member.address || "-"))), /* @__PURE__ */ React29.createElement(Flex11, { align: "center", gap: "md" }, /* @__PURE__ */ React29.createElement(Stack19, { ta: "right", gap: 0 }, /* @__PURE__ */ React29.createElement(Text17, { size: "sm" }, member.percentage), /* @__PURE__ */ React29.createElement(Text17, { size: "sm", c: "dimmed" }, member.role)), mods && /* @__PURE__ */ React29.createElement(ListItemCheckbox, { ariaLabel: `Select member ${member.did}`, checked: isItemChecked?.(member.did), onCheck: (checked) => onItemCheck?.(member.did, checked) }))));
|
|
2305
|
+
return /* @__PURE__ */ React29.createElement(Box11, { flex: 1 }, /* @__PURE__ */ React29.createElement(Stack19, null, rows));
|
|
2306
|
+
};
|
|
2307
|
+
|
|
2308
|
+
// src/mantine/blocks/list/validators/ValidatorsList.tsx
|
|
2309
|
+
import React30 from "react";
|
|
2310
|
+
import { Text as Text18, Box as Box12, Image as Image9, Stack as Stack20, Flex as Flex12 } from "@mantine/core";
|
|
2311
|
+
var ValidatorsList = ({ items, mods, isItemChecked, onItemCheck }) => {
|
|
2312
|
+
if (!items || items.length === 0) {
|
|
2313
|
+
return /* @__PURE__ */ React30.createElement(Text18, { size: "sm", c: "dimmed", ta: "center", py: "md" }, "No validators found");
|
|
2314
|
+
}
|
|
2315
|
+
const rows = items.map((v) => /* @__PURE__ */ React30.createElement(ListItemContainer, { key: v.did }, /* @__PURE__ */ React30.createElement(Flex12, { align: "center", gap: "sm" }, /* @__PURE__ */ React30.createElement(Image9, { radius: 16, w: 32, h: 32, src: v.icon }), /* @__PURE__ */ React30.createElement(Stack20, { gap: 0 }, /* @__PURE__ */ React30.createElement(Text18, { size: "sm" }, v.name || "-"), /* @__PURE__ */ React30.createElement(Text18, { size: "xs", c: "dimmed" }, v.description || "-"))), /* @__PURE__ */ React30.createElement(Flex12, { align: "center", gap: "md" }, /* @__PURE__ */ React30.createElement(Stack20, { ta: "right", gap: 0 }, /* @__PURE__ */ React30.createElement(Text18, { size: "sm" }, formatNumber(v.amount), " ", v.currency), /* @__PURE__ */ React30.createElement(Text18, { size: "sm", c: "dimmed" }, v.commission, "% fee"), /* @__PURE__ */ React30.createElement(Text18, { size: "xs", c: "dimmed" }, v.isActive ? "Active" : "Inactive", " \u2022 ", v.isStaked ? "Staked" : "Not staked", " \u2022 ", v.isBonding ? "Bonding" : "Not bonding")), mods && /* @__PURE__ */ React30.createElement(ListItemCheckbox, { ariaLabel: `Select validator ${v.did}`, checked: isItemChecked?.(v.did), onCheck: (checked) => onItemCheck?.(v.did, checked) }))));
|
|
2316
|
+
return /* @__PURE__ */ React30.createElement(Box12, { flex: 1 }, /* @__PURE__ */ React30.createElement(Stack20, null, rows));
|
|
2590
2317
|
};
|
|
2591
2318
|
|
|
2592
2319
|
// src/mantine/blocks/list/ListActionsMenu.tsx
|
|
2593
|
-
import
|
|
2594
|
-
import { Menu, Text as
|
|
2320
|
+
import React31 from "react";
|
|
2321
|
+
import { Menu, Text as Text19 } from "@mantine/core";
|
|
2595
2322
|
import { IconArrowDown, IconArrowUp, IconAdjustments, IconCheckbox as IconCheckbox2, IconAdjustmentsHorizontal } from "@tabler/icons-react";
|
|
2596
2323
|
var ListActionsMenu = ({ options, selectionMode, onSelectActionClick, value, onChange }) => {
|
|
2597
2324
|
const renderItem = (opt, direction) => {
|
|
2598
2325
|
const isActive = value?.key === opt.key && value?.direction === direction;
|
|
2599
2326
|
const Icon = direction === "asc" ? IconArrowUp : IconArrowDown;
|
|
2600
|
-
return /* @__PURE__ */
|
|
2327
|
+
return /* @__PURE__ */ React31.createElement(
|
|
2601
2328
|
Menu.Item,
|
|
2602
2329
|
{
|
|
2603
2330
|
key: `${opt.key}-${direction}`,
|
|
2604
|
-
leftSection: /* @__PURE__ */
|
|
2331
|
+
leftSection: /* @__PURE__ */ React31.createElement(Icon, { size: 16 }),
|
|
2605
2332
|
onClick: () => {
|
|
2606
2333
|
console.log("Changing sort: ", direction);
|
|
2607
2334
|
onChange({ key: opt.key, direction });
|
|
@@ -2611,7 +2338,7 @@ var ListActionsMenu = ({ options, selectionMode, onSelectActionClick, value, onC
|
|
|
2611
2338
|
opt.label
|
|
2612
2339
|
);
|
|
2613
2340
|
};
|
|
2614
|
-
return /* @__PURE__ */
|
|
2341
|
+
return /* @__PURE__ */ React31.createElement(Menu, { shadow: "md", width: 220 }, /* @__PURE__ */ React31.createElement(Menu.Target, null, /* @__PURE__ */ React31.createElement(Text19, { style: { cursor: "pointer" } }, /* @__PURE__ */ React31.createElement(IconAdjustmentsHorizontal, { size: 20 }))), /* @__PURE__ */ React31.createElement(Menu.Dropdown, null, /* @__PURE__ */ React31.createElement(Menu.Label, null, /* @__PURE__ */ React31.createElement(Text19, { c: "dimmed" }, "Order By")), options.map((opt) => /* @__PURE__ */ React31.createElement(React31.Fragment, { key: opt.key }, renderItem(opt, "desc"), renderItem(opt, "asc"))), /* @__PURE__ */ React31.createElement(Menu.Divider, null), /* @__PURE__ */ React31.createElement(Menu.Item, { leftSection: /* @__PURE__ */ React31.createElement(IconAdjustments, { size: 16 }) }, "Smart Filter"), /* @__PURE__ */ React31.createElement(Menu.Divider, null), /* @__PURE__ */ React31.createElement(Menu.Item, { onClick: () => onSelectActionClick(selectionMode === "single" ? null : "single"), leftSection: /* @__PURE__ */ React31.createElement(IconCheckbox2, { size: 16 }) }, "Single Select"), /* @__PURE__ */ React31.createElement(Menu.Item, { onClick: () => onSelectActionClick(selectionMode === "multi" ? null : "multi"), leftSection: /* @__PURE__ */ React31.createElement(IconCheckbox2, { size: 16 }) }, "Multi Select")));
|
|
2615
2342
|
};
|
|
2616
2343
|
|
|
2617
2344
|
// src/core/lib/sortListItems.ts
|
|
@@ -2634,10 +2361,10 @@ function sortListItems(data, sortOption) {
|
|
|
2634
2361
|
}
|
|
2635
2362
|
|
|
2636
2363
|
// src/mantine/blocks/list/FilterTab.tsx
|
|
2637
|
-
import
|
|
2638
|
-
import { UnstyledButton, Text as
|
|
2364
|
+
import React32 from "react";
|
|
2365
|
+
import { UnstyledButton, Text as Text20 } from "@mantine/core";
|
|
2639
2366
|
function FilterTab({ onClick, label, isActive }) {
|
|
2640
|
-
return /* @__PURE__ */
|
|
2367
|
+
return /* @__PURE__ */ React32.createElement(
|
|
2641
2368
|
UnstyledButton,
|
|
2642
2369
|
{
|
|
2643
2370
|
onClick,
|
|
@@ -2668,7 +2395,7 @@ function FilterTab({ onClick, label, isActive }) {
|
|
|
2668
2395
|
if (!isActive) e.currentTarget.style.background = "transparent";
|
|
2669
2396
|
}
|
|
2670
2397
|
},
|
|
2671
|
-
/* @__PURE__ */
|
|
2398
|
+
/* @__PURE__ */ React32.createElement(Text20, { size: "sm", fw: 500 }, label)
|
|
2672
2399
|
);
|
|
2673
2400
|
}
|
|
2674
2401
|
|
|
@@ -2684,36 +2411,89 @@ function filterListItems(items, filterOption) {
|
|
|
2684
2411
|
});
|
|
2685
2412
|
}
|
|
2686
2413
|
|
|
2687
|
-
// src/mantine/blocks/list/
|
|
2414
|
+
// src/mantine/blocks/list/flow/FlowView.tsx
|
|
2688
2415
|
import { IconArrowDown as IconArrowDown2, IconArrowUp as IconArrowUp2 } from "@tabler/icons-react";
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
|
|
2416
|
+
|
|
2417
|
+
// src/mantine/blocks/list/ListPagination.tsx
|
|
2418
|
+
import React33 from "react";
|
|
2419
|
+
import { Pagination } from "@mantine/core";
|
|
2420
|
+
function ListPagination({ page, setPage, totalPages }) {
|
|
2421
|
+
return /* @__PURE__ */ React33.createElement(
|
|
2422
|
+
Pagination,
|
|
2423
|
+
{
|
|
2424
|
+
value: page,
|
|
2425
|
+
onChange: setPage,
|
|
2426
|
+
total: totalPages,
|
|
2427
|
+
siblings: 1,
|
|
2428
|
+
radius: 8,
|
|
2429
|
+
color: "rgba(255, 255, 255, 0.08)",
|
|
2430
|
+
boundaries: 0,
|
|
2431
|
+
mx: "auto",
|
|
2432
|
+
styles: {
|
|
2433
|
+
dots: { display: "none" },
|
|
2434
|
+
control: {
|
|
2435
|
+
padding: 0,
|
|
2436
|
+
border: 0,
|
|
2437
|
+
color: "#868e96"
|
|
2438
|
+
}
|
|
2439
|
+
}
|
|
2440
|
+
}
|
|
2441
|
+
);
|
|
2442
|
+
}
|
|
2443
|
+
|
|
2444
|
+
// src/core/constants.ts
|
|
2445
|
+
var DEFAULT_PAGE_SIZE = 5;
|
|
2446
|
+
|
|
2447
|
+
// src/mantine/blocks/list/dao_members/MembersList.tsx
|
|
2448
|
+
import React34 from "react";
|
|
2449
|
+
import { Text as Text21, Box as Box13, Image as Image10, Stack as Stack21, Flex as Flex13 } from "@mantine/core";
|
|
2450
|
+
var DaoMembersList = ({ items, mods, isItemChecked, onItemCheck }) => {
|
|
2451
|
+
if (!items || items.length === 0) {
|
|
2452
|
+
return /* @__PURE__ */ React34.createElement(Text21, { size: "sm", c: "dimmed", ta: "center", py: "md" }, "No members found");
|
|
2453
|
+
}
|
|
2454
|
+
const rows = items.map((member) => /* @__PURE__ */ React34.createElement(ListItemContainer, { key: member.did }, /* @__PURE__ */ React34.createElement(Flex13, { align: "center", gap: "sm" }, /* @__PURE__ */ React34.createElement(Image10, { radius: 16, w: 32, h: 32, src: member.icon }), /* @__PURE__ */ React34.createElement(Stack21, { gap: 0 }, /* @__PURE__ */ React34.createElement(Text21, { size: "sm", fw: 500 }, member.username || "Unknown User"), /* @__PURE__ */ React34.createElement(Text21, { size: "xs", c: "dimmed", lineClamp: 1 }, member.address || "No address"))), /* @__PURE__ */ React34.createElement(Flex13, { align: "center", gap: "md" }, /* @__PURE__ */ React34.createElement(Stack21, { ta: "right", gap: 0 }, /* @__PURE__ */ React34.createElement(Text21, { size: "sm", fw: 500, c: "blue" }, member.percentage || "0%"), /* @__PURE__ */ React34.createElement(Text21, { size: "xs", c: "dimmed", tt: "capitalize" }, member.role || "member")), mods && /* @__PURE__ */ React34.createElement(
|
|
2455
|
+
ListItemCheckbox,
|
|
2456
|
+
{
|
|
2457
|
+
ariaLabel: `Select member ${member.username || member.did}`,
|
|
2458
|
+
checked: isItemChecked?.(member.did) || false,
|
|
2459
|
+
onCheck: (checked) => onItemCheck?.(member.did, checked)
|
|
2460
|
+
}
|
|
2461
|
+
))));
|
|
2462
|
+
return /* @__PURE__ */ React34.createElement(Box13, { flex: 1 }, /* @__PURE__ */ React34.createElement(Stack21, { gap: "xs" }, rows));
|
|
2463
|
+
};
|
|
2464
|
+
|
|
2465
|
+
// src/mantine/blocks/list/flow/FlowView.tsx
|
|
2466
|
+
var IconRefresh = () => /* @__PURE__ */ React35.createElement("span", null, "\u{1F504}");
|
|
2467
|
+
var IconSettings = () => /* @__PURE__ */ React35.createElement("span", null, "\u2699\uFE0F");
|
|
2468
|
+
var IconAlertCircle = () => /* @__PURE__ */ React35.createElement("span", null, "\u26A0\uFE0F");
|
|
2469
|
+
var LIST_FLOW_PANEL_ID = "list-flow-panel";
|
|
2470
|
+
var ListFlowView = ({ block, editor }) => {
|
|
2702
2471
|
const { editable } = useBlocknoteContext();
|
|
2703
|
-
|
|
2472
|
+
const [data, setData] = useState5(null);
|
|
2473
|
+
const [loading, setLoading] = useState5(false);
|
|
2474
|
+
const [error, setError] = useState5(null);
|
|
2475
|
+
const [showErrorDetails, setShowErrorDetails] = useState5(false);
|
|
2476
|
+
const [page, setPage] = useState5(1);
|
|
2477
|
+
const [selectionMode, setSelectionMode] = useState5(null);
|
|
2478
|
+
const [totalPages, setTotalPages] = useState5(0);
|
|
2479
|
+
const [selectedIds, setSelectedIds] = useState5(/* @__PURE__ */ new Set());
|
|
2480
|
+
const panelId = `${LIST_FLOW_PANEL_ID}-${block.id}`;
|
|
2481
|
+
const panelContent = useMemo7(() => /* @__PURE__ */ React35.createElement(TemplateConfig2, { editor, block }), [editor, block]);
|
|
2482
|
+
const { open: openPanel } = usePanel(panelId, panelContent);
|
|
2483
|
+
useEffect5(() => {
|
|
2704
2484
|
if (selectionMode === "single" && selectedIds.size > 1) {
|
|
2705
2485
|
const arr = Array.from(selectedIds);
|
|
2706
2486
|
const lastSelected = arr.length > 0 ? arr[arr.length - 1] : void 0;
|
|
2707
2487
|
setSelectedIds(new Set(lastSelected ? [lastSelected] : []));
|
|
2708
2488
|
}
|
|
2709
2489
|
}, [selectionMode, selectedIds]);
|
|
2710
|
-
const isItemChecked =
|
|
2490
|
+
const isItemChecked = useCallback9(
|
|
2711
2491
|
(id) => {
|
|
2712
2492
|
return selectedIds.has(id);
|
|
2713
2493
|
},
|
|
2714
2494
|
[selectedIds]
|
|
2715
2495
|
);
|
|
2716
|
-
const onItemCheck =
|
|
2496
|
+
const onItemCheck = useCallback9(
|
|
2717
2497
|
(id, checked) => {
|
|
2718
2498
|
setSelectedIds((prev) => {
|
|
2719
2499
|
const nextSelectedIds = new Set(prev);
|
|
@@ -2736,7 +2516,7 @@ var ListBlockContent = ({ block, editor }) => {
|
|
|
2736
2516
|
);
|
|
2737
2517
|
const handlers = useBlocknoteHandlers();
|
|
2738
2518
|
const listType = block.props.listType && block.props.listType !== "" ? block.props.listType : null;
|
|
2739
|
-
const listConfig =
|
|
2519
|
+
const listConfig = useMemo7(() => {
|
|
2740
2520
|
if (block.props.listConfig && block.props.listConfig !== "{}") {
|
|
2741
2521
|
try {
|
|
2742
2522
|
return JSON.parse(block.props.listConfig);
|
|
@@ -2747,7 +2527,7 @@ var ListBlockContent = ({ block, editor }) => {
|
|
|
2747
2527
|
}
|
|
2748
2528
|
return {};
|
|
2749
2529
|
}, [block.props.listConfig]);
|
|
2750
|
-
const listSortConfigOptions =
|
|
2530
|
+
const listSortConfigOptions = useMemo7(() => {
|
|
2751
2531
|
if (block.props.sortOptions && block.props.sortOptions !== "{}") {
|
|
2752
2532
|
try {
|
|
2753
2533
|
return JSON.parse(block.props.sortOptions);
|
|
@@ -2758,7 +2538,7 @@ var ListBlockContent = ({ block, editor }) => {
|
|
|
2758
2538
|
}
|
|
2759
2539
|
return {};
|
|
2760
2540
|
}, [block.props.sortOptions]);
|
|
2761
|
-
const listFilterConfigOptions =
|
|
2541
|
+
const listFilterConfigOptions = useMemo7(() => {
|
|
2762
2542
|
if (block.props.filterOptions && block.props.filterOptions !== "{}") {
|
|
2763
2543
|
try {
|
|
2764
2544
|
return JSON.parse(block.props.filterOptions);
|
|
@@ -2769,7 +2549,7 @@ var ListBlockContent = ({ block, editor }) => {
|
|
|
2769
2549
|
}
|
|
2770
2550
|
return {};
|
|
2771
2551
|
}, [block.props.filterOptions]);
|
|
2772
|
-
const listFilterConfig =
|
|
2552
|
+
const listFilterConfig = useMemo7(() => {
|
|
2773
2553
|
if (block.props.filter && block.props.filter !== "{}") {
|
|
2774
2554
|
try {
|
|
2775
2555
|
return JSON.parse(block.props.filter);
|
|
@@ -2780,7 +2560,7 @@ var ListBlockContent = ({ block, editor }) => {
|
|
|
2780
2560
|
}
|
|
2781
2561
|
return {};
|
|
2782
2562
|
}, [block.props.filter]);
|
|
2783
|
-
const listSortConfig =
|
|
2563
|
+
const listSortConfig = useMemo7(() => {
|
|
2784
2564
|
if (block.props.sort && block.props.sort !== "{}") {
|
|
2785
2565
|
try {
|
|
2786
2566
|
return JSON.parse(block.props.sort);
|
|
@@ -2799,7 +2579,7 @@ var ListBlockContent = ({ block, editor }) => {
|
|
|
2799
2579
|
}
|
|
2800
2580
|
});
|
|
2801
2581
|
};
|
|
2802
|
-
const fetchData =
|
|
2582
|
+
const fetchData = useCallback9(async () => {
|
|
2803
2583
|
if (!handlers || !listType || !listConfig) return;
|
|
2804
2584
|
setLoading(true);
|
|
2805
2585
|
setError(null);
|
|
@@ -2892,24 +2672,12 @@ var ListBlockContent = ({ block, editor }) => {
|
|
|
2892
2672
|
setLoading(false);
|
|
2893
2673
|
}
|
|
2894
2674
|
}, [handlers, page, listType, listConfig]);
|
|
2895
|
-
|
|
2675
|
+
useEffect5(() => {
|
|
2896
2676
|
if (listType && listConfig) {
|
|
2897
|
-
console.log("[
|
|
2677
|
+
console.log("[ListFlowView] useEffect", listType, listConfig);
|
|
2898
2678
|
fetchData();
|
|
2899
2679
|
}
|
|
2900
2680
|
}, [listType, page, listConfig]);
|
|
2901
|
-
const handleConfigSave = (config) => {
|
|
2902
|
-
console.log("[ListBlockContent] handleConfigSave", config);
|
|
2903
|
-
updateProps({
|
|
2904
|
-
listType: config.type,
|
|
2905
|
-
listConfig: JSON.stringify(config.config),
|
|
2906
|
-
sortOptions: JSON.stringify(config.sortOptions),
|
|
2907
|
-
sort: JSON.stringify(config.sort),
|
|
2908
|
-
filterOptions: JSON.stringify(config.filterOptions),
|
|
2909
|
-
filter: JSON.stringify(config.filter)
|
|
2910
|
-
});
|
|
2911
|
-
setModalOpened(false);
|
|
2912
|
-
};
|
|
2913
2681
|
const handleFilterChange = (filterOption) => {
|
|
2914
2682
|
if (filterOption?.key === listFilterConfig?.key && filterOption?.value === listFilterConfig?.value) {
|
|
2915
2683
|
return updateProps({ filter: null });
|
|
@@ -2922,51 +2690,54 @@ var ListBlockContent = ({ block, editor }) => {
|
|
|
2922
2690
|
}
|
|
2923
2691
|
updateProps({ sort: JSON.stringify(sortOption) });
|
|
2924
2692
|
};
|
|
2925
|
-
const sortedData =
|
|
2693
|
+
const sortedData = useMemo7(() => {
|
|
2926
2694
|
if (!data) return null;
|
|
2927
2695
|
return sortListItems(data, listSortConfig);
|
|
2928
2696
|
}, [data?.items, listSortConfig]);
|
|
2929
|
-
const filteredData =
|
|
2697
|
+
const filteredData = useMemo7(() => {
|
|
2930
2698
|
if (!listFilterConfig?.key) return sortedData;
|
|
2931
2699
|
if (!sortedData) return null;
|
|
2932
2700
|
return filterListItems(sortedData, listFilterConfig);
|
|
2933
2701
|
}, [data?.items, sortedData, listFilterConfig]);
|
|
2934
2702
|
const renderListComponent = () => {
|
|
2935
2703
|
if (!filteredData || !listType) return null;
|
|
2936
|
-
console.log("[
|
|
2704
|
+
console.log("[ListFlowView] renderListComponent", data, listType);
|
|
2937
2705
|
switch (listType) {
|
|
2938
2706
|
case "linked_resources":
|
|
2939
|
-
return /* @__PURE__ */
|
|
2707
|
+
return /* @__PURE__ */ React35.createElement(LinkedResourcesList, { items: filteredData, config: listConfig, mods: selectionMode, isItemChecked, onItemCheck });
|
|
2940
2708
|
case "assets":
|
|
2941
|
-
return /* @__PURE__ */
|
|
2709
|
+
return /* @__PURE__ */ React35.createElement(AssetsList, { items: filteredData, config: listConfig, mods: selectionMode, isItemChecked, onItemCheck });
|
|
2942
2710
|
case "transactions":
|
|
2943
|
-
return /* @__PURE__ */
|
|
2711
|
+
return /* @__PURE__ */ React35.createElement(TransactionsList, { items: filteredData, config: listConfig, mods: selectionMode, isItemChecked, onItemCheck });
|
|
2944
2712
|
case "collections":
|
|
2945
|
-
return /* @__PURE__ */
|
|
2713
|
+
return /* @__PURE__ */ React35.createElement(CollectionsList, { items: filteredData, mods: selectionMode, isItemChecked, onItemCheck });
|
|
2946
2714
|
case "investments":
|
|
2947
|
-
return /* @__PURE__ */
|
|
2715
|
+
return /* @__PURE__ */ React35.createElement(InvestmentsList, { items: filteredData, mods: selectionMode, isItemChecked, onItemCheck });
|
|
2948
2716
|
case "oracles":
|
|
2949
|
-
return /* @__PURE__ */
|
|
2717
|
+
return /* @__PURE__ */ React35.createElement(OraclesList, { items: filteredData, mods: selectionMode, isItemChecked, onItemCheck });
|
|
2950
2718
|
case "pods":
|
|
2951
|
-
return /* @__PURE__ */
|
|
2719
|
+
return /* @__PURE__ */ React35.createElement(PodsList, { items: filteredData, mods: selectionMode, isItemChecked, onItemCheck });
|
|
2952
2720
|
case "proposals":
|
|
2953
|
-
return /* @__PURE__ */
|
|
2721
|
+
return /* @__PURE__ */ React35.createElement(ProposalsList, { items: filteredData, mods: selectionMode, isItemChecked, onItemCheck });
|
|
2954
2722
|
case "requests":
|
|
2955
|
-
return /* @__PURE__ */
|
|
2723
|
+
return /* @__PURE__ */ React35.createElement(RequestsList, { items: filteredData, mods: selectionMode, isItemChecked, onItemCheck });
|
|
2956
2724
|
case "group_members":
|
|
2957
|
-
return /* @__PURE__ */
|
|
2725
|
+
return /* @__PURE__ */ React35.createElement(MembersList, { items: filteredData, mods: selectionMode, isItemChecked, onItemCheck });
|
|
2958
2726
|
case "dao_members":
|
|
2959
|
-
return /* @__PURE__ */
|
|
2727
|
+
return /* @__PURE__ */ React35.createElement(DaoMembersList, { items: filteredData, mods: selectionMode, isItemChecked, onItemCheck });
|
|
2960
2728
|
case "validators":
|
|
2961
|
-
return /* @__PURE__ */
|
|
2729
|
+
return /* @__PURE__ */ React35.createElement(ValidatorsList, { items: filteredData, mods: selectionMode, isItemChecked, onItemCheck });
|
|
2962
2730
|
default:
|
|
2963
2731
|
return null;
|
|
2964
2732
|
}
|
|
2965
2733
|
};
|
|
2966
|
-
|
|
2734
|
+
if (!listType) {
|
|
2735
|
+
return /* @__PURE__ */ React35.createElement(Center, { py: "xl" }, /* @__PURE__ */ React35.createElement(Text22, { size: "sm", c: "dimmed" }, "List not configured"));
|
|
2736
|
+
}
|
|
2737
|
+
return /* @__PURE__ */ React35.createElement(Stack22, { mih: totalPages !== 0 ? 700 : void 0, w: "100%" }, /* @__PURE__ */ React35.createElement(Flex14, { align: "center", gap: "xs" }, /* @__PURE__ */ React35.createElement(Text22, null, getListNameByType(listType)), listSortConfig?.key && /* @__PURE__ */ React35.createElement(Flex14, { align: "center" }, /* @__PURE__ */ React35.createElement(Text22, { size: "xs", c: "dimmed" }, listSortConfig.key?.replace(/([A-Z])/g, " $1").replace(
|
|
2967
2738
|
/^./,
|
|
2968
2739
|
(str) => str.toUpperCase()
|
|
2969
|
-
), " "), /* @__PURE__ */
|
|
2740
|
+
), " "), /* @__PURE__ */ React35.createElement(Text22, { lh: 0.5, c: "dimmed" }, listSortConfig.direction === "asc" && /* @__PURE__ */ React35.createElement(IconArrowUp2, { size: 18 }), listSortConfig.direction === "desc" && /* @__PURE__ */ React35.createElement(IconArrowDown2, { size: 18 }))), selectionMode && /* @__PURE__ */ React35.createElement(Text22, { lh: 0.5, c: "dimmed" }, selectionMode === "single" ? "Single Selection" : "Multi Selection")), /* @__PURE__ */ React35.createElement(Flex14, { justify: "space-between" }, /* @__PURE__ */ React35.createElement(Flex14, { gap: "xs", align: "center" }, /* @__PURE__ */ React35.createElement(FilterTab, { key: "All", label: "All", isActive: !listFilterConfig?.key, onClick: () => handleFilterChange(null) }), Array.isArray(listFilterConfigOptions) && listFilterConfigOptions.length > 0 && listFilterConfigOptions.map(({ key, label, type }) => /* @__PURE__ */ React35.createElement(
|
|
2970
2741
|
FilterTab,
|
|
2971
2742
|
{
|
|
2972
2743
|
key: label,
|
|
@@ -2974,7 +2745,7 @@ var ListBlockContent = ({ block, editor }) => {
|
|
|
2974
2745
|
isActive: listFilterConfig?.key === key && listFilterConfig?.value === type,
|
|
2975
2746
|
onClick: () => handleFilterChange({ key, value: type })
|
|
2976
2747
|
}
|
|
2977
|
-
))), /* @__PURE__ */
|
|
2748
|
+
))), /* @__PURE__ */ React35.createElement(Flex14, { gap: "xs" }, /* @__PURE__ */ React35.createElement(ActionIcon4, { variant: "subtle", size: "sm", onClick: fetchData, loading }, /* @__PURE__ */ React35.createElement(IconRefresh, null)), editable && /* @__PURE__ */ React35.createElement(ActionIcon4, { variant: "subtle", size: "sm", onClick: openPanel }, /* @__PURE__ */ React35.createElement(IconSettings, null)), listConfig && listSortConfigOptions && listSortConfigOptions?.length > 0 && /* @__PURE__ */ React35.createElement(
|
|
2978
2749
|
ListActionsMenu,
|
|
2979
2750
|
{
|
|
2980
2751
|
onSelectActionClick: (mode) => setSelectionMode(mode),
|
|
@@ -2983,7 +2754,7 @@ var ListBlockContent = ({ block, editor }) => {
|
|
|
2983
2754
|
value: listSortConfig,
|
|
2984
2755
|
onChange: (sortOption) => handleSortChange(sortOption)
|
|
2985
2756
|
}
|
|
2986
|
-
))), /* @__PURE__ */
|
|
2757
|
+
))), /* @__PURE__ */ React35.createElement(Flex14, { flex: 1 }, loading ? /* @__PURE__ */ React35.createElement(Center, { py: "xl", w: "100%" }, /* @__PURE__ */ React35.createElement(Loader, { size: "md", mx: "auto" })) : error ? /* @__PURE__ */ React35.createElement(Alert3, { color: "red", title: "Failed to load data", icon: /* @__PURE__ */ React35.createElement(IconAlertCircle, null) }, /* @__PURE__ */ React35.createElement(Stack22, { gap: "xs" }, /* @__PURE__ */ React35.createElement(Text22, { size: "sm" }, showErrorDetails ? error : "Unable to fetch list data"), /* @__PURE__ */ React35.createElement(Group6, { gap: "xs" }, /* @__PURE__ */ React35.createElement(Button5, { size: "xs", variant: "subtle", onClick: fetchData }, "Retry"), /* @__PURE__ */ React35.createElement(Button5, { size: "xs", variant: "subtle", onClick: () => setShowErrorDetails(!showErrorDetails) }, showErrorDetails ? "Hide" : "Show", " Details")))) : /* @__PURE__ */ React35.createElement(Stack22, { gap: "md", flex: 1 }, renderListComponent(), /* @__PURE__ */ React35.createElement(
|
|
2987
2758
|
ListPagination,
|
|
2988
2759
|
{
|
|
2989
2760
|
page,
|
|
@@ -2992,17 +2763,22 @@ var ListBlockContent = ({ block, editor }) => {
|
|
|
2992
2763
|
},
|
|
2993
2764
|
totalPages
|
|
2994
2765
|
}
|
|
2995
|
-
)))
|
|
2996
|
-
ListConfigModal,
|
|
2997
|
-
{
|
|
2998
|
-
opened: modalOpened,
|
|
2999
|
-
onClose: () => setModalOpened(false),
|
|
3000
|
-
onSave: handleConfigSave,
|
|
3001
|
-
initialConfig: listType && listConfig ? { type: listType, config: listConfig, sort: null, filter: null, filterOptions: listFilterConfigOptions, sortOptions: listSortConfigOptions } : null
|
|
3002
|
-
}
|
|
3003
|
-
));
|
|
2766
|
+
))));
|
|
3004
2767
|
};
|
|
3005
|
-
|
|
2768
|
+
|
|
2769
|
+
// src/mantine/blocks/list/ListBlock.tsx
|
|
2770
|
+
function ListBlock({ editor, block }) {
|
|
2771
|
+
const { editable } = useBlocknoteContext();
|
|
2772
|
+
const listType = block.props.listType && block.props.listType !== "";
|
|
2773
|
+
const isConfigured = listType;
|
|
2774
|
+
if (editable && !isConfigured) {
|
|
2775
|
+
return /* @__PURE__ */ React36.createElement(ListTemplateView, { editor, block });
|
|
2776
|
+
}
|
|
2777
|
+
return /* @__PURE__ */ React36.createElement(ListFlowView, { block, editor });
|
|
2778
|
+
}
|
|
2779
|
+
|
|
2780
|
+
// src/mantine/blocks/list/ListBlockSpec.tsx
|
|
2781
|
+
var ListBlockSpec = createReactBlockSpec2(
|
|
3006
2782
|
{
|
|
3007
2783
|
type: "list",
|
|
3008
2784
|
propSchema: {
|
|
@@ -3023,12 +2799,18 @@ var ListBlock = createReactBlockSpec2(
|
|
|
3023
2799
|
},
|
|
3024
2800
|
listConfig: {
|
|
3025
2801
|
default: "{}"
|
|
2802
|
+
},
|
|
2803
|
+
icon: {
|
|
2804
|
+
default: "\u{1F4CB}"
|
|
3026
2805
|
}
|
|
3027
2806
|
},
|
|
3028
2807
|
content: "none"
|
|
3029
2808
|
},
|
|
3030
2809
|
{
|
|
3031
|
-
render: (props) =>
|
|
2810
|
+
render: (props) => {
|
|
2811
|
+
const ixoProps = props;
|
|
2812
|
+
return /* @__PURE__ */ React37.createElement(ListBlock, { ...ixoProps });
|
|
2813
|
+
}
|
|
3032
2814
|
}
|
|
3033
2815
|
);
|
|
3034
2816
|
|
|
@@ -3115,25 +2897,25 @@ var ValidatorActionType = /* @__PURE__ */ ((ValidatorActionType2) => {
|
|
|
3115
2897
|
})(ValidatorActionType || {});
|
|
3116
2898
|
|
|
3117
2899
|
// src/mantine/context/hooks/useSharedProposal.ts
|
|
3118
|
-
import { useState as
|
|
2900
|
+
import { useState as useState6, useEffect as useEffect6, useCallback as useCallback10 } from "react";
|
|
3119
2901
|
var useSharedProposal = ({ proposalId, contractAddress, autoFetch = true }) => {
|
|
3120
2902
|
const { sharedProposals, fetchSharedProposal, invalidateProposal, subscribeToProposal } = useBlocknoteContext();
|
|
3121
|
-
const [localProposal, setLocalProposal] =
|
|
2903
|
+
const [localProposal, setLocalProposal] = useState6(null);
|
|
3122
2904
|
const cacheKey = `${contractAddress}:${proposalId}`;
|
|
3123
|
-
|
|
2905
|
+
useEffect6(() => {
|
|
3124
2906
|
if (!proposalId || !contractAddress || !autoFetch) return;
|
|
3125
2907
|
fetchSharedProposal(proposalId, contractAddress).then(setLocalProposal).catch((error) => {
|
|
3126
2908
|
console.error("Failed to fetch proposal:", error);
|
|
3127
2909
|
});
|
|
3128
2910
|
}, [proposalId, contractAddress, fetchSharedProposal, autoFetch]);
|
|
3129
|
-
|
|
2911
|
+
useEffect6(() => {
|
|
3130
2912
|
const proposal = subscribeToProposal(cacheKey);
|
|
3131
2913
|
if (proposal) {
|
|
3132
2914
|
setLocalProposal(proposal);
|
|
3133
2915
|
}
|
|
3134
2916
|
}, [subscribeToProposal, cacheKey]);
|
|
3135
|
-
const refetch =
|
|
3136
|
-
const invalidate =
|
|
2917
|
+
const refetch = useCallback10(() => fetchSharedProposal(proposalId, contractAddress, true), [fetchSharedProposal, proposalId, contractAddress]);
|
|
2918
|
+
const invalidate = useCallback10(() => invalidateProposal(proposalId), [invalidateProposal, proposalId]);
|
|
3137
2919
|
return {
|
|
3138
2920
|
proposal: localProposal,
|
|
3139
2921
|
loading: sharedProposals[cacheKey]?.loading ?? false,
|
|
@@ -3151,25 +2933,25 @@ import { createReactBlockSpec as createReactBlockSpec4 } from "@blocknote/react"
|
|
|
3151
2933
|
import React81 from "react";
|
|
3152
2934
|
|
|
3153
2935
|
// src/mantine/blocks/proposal/template/TemplateView.tsx
|
|
3154
|
-
import React75, { useMemo as
|
|
2936
|
+
import React75, { useMemo as useMemo9 } from "react";
|
|
3155
2937
|
|
|
3156
2938
|
// src/mantine/blocks/proposal/template/TemplateConfig.tsx
|
|
3157
|
-
import React74, { useCallback as
|
|
3158
|
-
import { Paper as
|
|
2939
|
+
import React74, { useCallback as useCallback12 } from "react";
|
|
2940
|
+
import { Paper as Paper4, CloseButton as CloseButton3, Title as Title3 } from "@mantine/core";
|
|
3159
2941
|
|
|
3160
2942
|
// src/mantine/blocks/proposal/template/GeneralTab.tsx
|
|
3161
|
-
import React39, { useEffect as
|
|
3162
|
-
import { Stack as
|
|
3163
|
-
var
|
|
3164
|
-
const [localTitle, setLocalTitle] =
|
|
3165
|
-
const [localDescription, setLocalDescription] =
|
|
3166
|
-
|
|
2943
|
+
import React39, { useEffect as useEffect7, useState as useState7 } from "react";
|
|
2944
|
+
import { Stack as Stack23, Text as Text23, TextInput as TextInput5, Textarea as Textarea2 } from "@mantine/core";
|
|
2945
|
+
var GeneralTab3 = ({ title, description, onTitleChange, onDescriptionChange }) => {
|
|
2946
|
+
const [localTitle, setLocalTitle] = useState7(title || "");
|
|
2947
|
+
const [localDescription, setLocalDescription] = useState7(description || "");
|
|
2948
|
+
useEffect7(() => {
|
|
3167
2949
|
setLocalTitle(title || "");
|
|
3168
2950
|
}, [title]);
|
|
3169
|
-
|
|
2951
|
+
useEffect7(() => {
|
|
3170
2952
|
setLocalDescription(description || "");
|
|
3171
2953
|
}, [description]);
|
|
3172
|
-
return /* @__PURE__ */ React39.createElement(
|
|
2954
|
+
return /* @__PURE__ */ React39.createElement(Stack23, { gap: "lg" }, /* @__PURE__ */ React39.createElement(Stack23, { gap: "xs" }, /* @__PURE__ */ React39.createElement(Text23, { size: "sm", fw: 600 }, "Title"), /* @__PURE__ */ React39.createElement(
|
|
3173
2955
|
TextInput5,
|
|
3174
2956
|
{
|
|
3175
2957
|
placeholder: "e.g. Proposal Title",
|
|
@@ -3180,7 +2962,7 @@ var GeneralTab2 = ({ title, description, onTitleChange, onDescriptionChange }) =
|
|
|
3180
2962
|
onTitleChange(newTitle);
|
|
3181
2963
|
}
|
|
3182
2964
|
}
|
|
3183
|
-
)), /* @__PURE__ */ React39.createElement(
|
|
2965
|
+
)), /* @__PURE__ */ React39.createElement(Stack23, { gap: "xs" }, /* @__PURE__ */ React39.createElement(Text23, { size: "sm", fw: 600 }, "Description"), /* @__PURE__ */ React39.createElement(
|
|
3184
2966
|
Textarea2,
|
|
3185
2967
|
{
|
|
3186
2968
|
placeholder: "Describe what this proposal is about",
|
|
@@ -3196,12 +2978,12 @@ var GeneralTab2 = ({ title, description, onTitleChange, onDescriptionChange }) =
|
|
|
3196
2978
|
};
|
|
3197
2979
|
|
|
3198
2980
|
// src/mantine/blocks/proposal/template/ActionsTab.tsx
|
|
3199
|
-
import React72, { useCallback as
|
|
3200
|
-
import { Button as
|
|
2981
|
+
import React72, { useCallback as useCallback11, useEffect as useEffect10, useState as useState15 } from "react";
|
|
2982
|
+
import { Button as Button12, Card as Card13, Stack as Stack56 } from "@mantine/core";
|
|
3201
2983
|
|
|
3202
2984
|
// src/mantine/blocks/proposal/actions-components/ActionsCard.tsx
|
|
3203
2985
|
import React40 from "react";
|
|
3204
|
-
import { Card as
|
|
2986
|
+
import { Card as Card6, Group as Group7, Text as Text24, Badge as Badge5, Stack as Stack24, ActionIcon as ActionIcon5, ScrollArea } from "@mantine/core";
|
|
3205
2987
|
var getActionSummary = (action) => {
|
|
3206
2988
|
switch (action.type) {
|
|
3207
2989
|
case "Spend":
|
|
@@ -3234,7 +3016,7 @@ var ActionsCard = ({ actions, isSelected, onClick, onEditAction, onRemoveAction,
|
|
|
3234
3016
|
onClick();
|
|
3235
3017
|
};
|
|
3236
3018
|
return /* @__PURE__ */ React40.createElement(
|
|
3237
|
-
|
|
3019
|
+
Card6,
|
|
3238
3020
|
{
|
|
3239
3021
|
shadow: "sm",
|
|
3240
3022
|
padding: "lg",
|
|
@@ -3250,8 +3032,8 @@ var ActionsCard = ({ actions, isSelected, onClick, onEditAction, onRemoveAction,
|
|
|
3250
3032
|
},
|
|
3251
3033
|
onClick: handleCardClick
|
|
3252
3034
|
},
|
|
3253
|
-
/* @__PURE__ */ React40.createElement(
|
|
3254
|
-
|
|
3035
|
+
/* @__PURE__ */ React40.createElement(Group7, { justify: "space-between", align: "flex-start" }, /* @__PURE__ */ React40.createElement(Stack24, { gap: "xs", style: { flex: 1 } }, /* @__PURE__ */ React40.createElement(Text24, { size: "md", fw: 600, style: { color: "#f1f3f5" } }, "Proposal Actions (", actions.length, ")"), actions.length === 0 ? /* @__PURE__ */ React40.createElement(Text24, { size: "sm", style: { color: "#868e96" } }, "No actions added yet.") : /* @__PURE__ */ React40.createElement(ScrollArea, { h: actions.length > 3 ? 150 : void 0, style: { marginTop: 8 } }, /* @__PURE__ */ React40.createElement(Stack24, { gap: "xs" }, actions.map((action, index) => /* @__PURE__ */ React40.createElement(
|
|
3036
|
+
Card6,
|
|
3255
3037
|
{
|
|
3256
3038
|
key: index,
|
|
3257
3039
|
withBorder: true,
|
|
@@ -3261,8 +3043,8 @@ var ActionsCard = ({ actions, isSelected, onClick, onEditAction, onRemoveAction,
|
|
|
3261
3043
|
borderColor: "#333"
|
|
3262
3044
|
}
|
|
3263
3045
|
},
|
|
3264
|
-
/* @__PURE__ */ React40.createElement(
|
|
3265
|
-
|
|
3046
|
+
/* @__PURE__ */ React40.createElement(Group7, { justify: "space-between", align: "center" }, /* @__PURE__ */ React40.createElement(Group7, { gap: "xs", style: { flex: 1 } }, /* @__PURE__ */ React40.createElement(
|
|
3047
|
+
Badge5,
|
|
3266
3048
|
{
|
|
3267
3049
|
size: "sm",
|
|
3268
3050
|
variant: "light",
|
|
@@ -3272,8 +3054,8 @@ var ActionsCard = ({ actions, isSelected, onClick, onEditAction, onRemoveAction,
|
|
|
3272
3054
|
}
|
|
3273
3055
|
},
|
|
3274
3056
|
action.type
|
|
3275
|
-
), /* @__PURE__ */ React40.createElement(
|
|
3276
|
-
|
|
3057
|
+
), /* @__PURE__ */ React40.createElement(Text24, { size: "sm", style: { color: "#adb5bd" } }, getActionSummary(action))), !disabled && /* @__PURE__ */ React40.createElement(Group7, { gap: 4 }, /* @__PURE__ */ React40.createElement(
|
|
3058
|
+
ActionIcon5,
|
|
3277
3059
|
{
|
|
3278
3060
|
size: "sm",
|
|
3279
3061
|
variant: "subtle",
|
|
@@ -3286,7 +3068,7 @@ var ActionsCard = ({ actions, isSelected, onClick, onEditAction, onRemoveAction,
|
|
|
3286
3068
|
},
|
|
3287
3069
|
"\u270F\uFE0F"
|
|
3288
3070
|
), /* @__PURE__ */ React40.createElement(
|
|
3289
|
-
|
|
3071
|
+
ActionIcon5,
|
|
3290
3072
|
{
|
|
3291
3073
|
size: "sm",
|
|
3292
3074
|
variant: "subtle",
|
|
@@ -3304,14 +3086,14 @@ var ActionsCard = ({ actions, isSelected, onClick, onEditAction, onRemoveAction,
|
|
|
3304
3086
|
};
|
|
3305
3087
|
|
|
3306
3088
|
// src/mantine/blocks/proposal/ActionsPanel.tsx
|
|
3307
|
-
import React71, { useState as
|
|
3308
|
-
import { Stack as
|
|
3089
|
+
import React71, { useState as useState14, useEffect as useEffect9, useMemo as useMemo8 } from "react";
|
|
3090
|
+
import { Stack as Stack55, Button as Button11, Group as Group18, Text as Text32, Card as Card12, Badge as Badge8, Divider as Divider3, ScrollArea as ScrollArea3, Alert as Alert6, Tabs as Tabs2, SimpleGrid, Paper as Paper3 } from "@mantine/core";
|
|
3309
3091
|
|
|
3310
3092
|
// src/mantine/blocks/proposal/actions-components/SpendActionForm.tsx
|
|
3311
3093
|
import React41 from "react";
|
|
3312
|
-
import { TextInput as TextInput6, Stack as
|
|
3094
|
+
import { TextInput as TextInput6, Stack as Stack25 } from "@mantine/core";
|
|
3313
3095
|
var SpendActionForm = ({ data, onChange }) => {
|
|
3314
|
-
return /* @__PURE__ */ React41.createElement(
|
|
3096
|
+
return /* @__PURE__ */ React41.createElement(Stack25, null, /* @__PURE__ */ React41.createElement(
|
|
3315
3097
|
TextInput6,
|
|
3316
3098
|
{
|
|
3317
3099
|
label: "Recipient Address",
|
|
@@ -3375,11 +3157,11 @@ var SpendActionForm = ({ data, onChange }) => {
|
|
|
3375
3157
|
};
|
|
3376
3158
|
|
|
3377
3159
|
// src/mantine/blocks/proposal/actions-components/UpdateMembersActionForm.tsx
|
|
3378
|
-
import React42, { useState as
|
|
3379
|
-
import { Stack as
|
|
3160
|
+
import React42, { useState as useState8 } from "react";
|
|
3161
|
+
import { Stack as Stack26, TextInput as TextInput7, NumberInput as NumberInput2, Button as Button6, Group as Group8, Text as Text25, Card as Card7, Badge as Badge6, ActionIcon as ActionIcon6, Divider as Divider2, ScrollArea as ScrollArea2 } from "@mantine/core";
|
|
3380
3162
|
var UpdateMembersActionForm = ({ data, onChange }) => {
|
|
3381
|
-
const [newMember, setNewMember] =
|
|
3382
|
-
const [newRemoveAddress, setNewRemoveAddress] =
|
|
3163
|
+
const [newMember, setNewMember] = useState8({ addr: "", weight: 1 });
|
|
3164
|
+
const [newRemoveAddress, setNewRemoveAddress] = useState8("");
|
|
3383
3165
|
const handleAddMember = () => {
|
|
3384
3166
|
if (!newMember.addr) return;
|
|
3385
3167
|
onChange({
|
|
@@ -3419,8 +3201,8 @@ var UpdateMembersActionForm = ({ data, onChange }) => {
|
|
|
3419
3201
|
}
|
|
3420
3202
|
}
|
|
3421
3203
|
};
|
|
3422
|
-
return /* @__PURE__ */ React42.createElement(
|
|
3423
|
-
|
|
3204
|
+
return /* @__PURE__ */ React42.createElement(Stack26, null, /* @__PURE__ */ React42.createElement(Stack26, { gap: "xs" }, /* @__PURE__ */ React42.createElement(Text25, { size: "sm", fw: 500, style: { color: "#adb5bd" } }, "Members to Add"), /* @__PURE__ */ React42.createElement(ScrollArea2, { h: 150 }, /* @__PURE__ */ React42.createElement(Stack26, { gap: "xs" }, (data.add || []).map((member, index) => /* @__PURE__ */ React42.createElement(
|
|
3205
|
+
Card7,
|
|
3424
3206
|
{
|
|
3425
3207
|
key: index,
|
|
3426
3208
|
withBorder: true,
|
|
@@ -3430,8 +3212,8 @@ var UpdateMembersActionForm = ({ data, onChange }) => {
|
|
|
3430
3212
|
borderColor: "#333"
|
|
3431
3213
|
}
|
|
3432
3214
|
},
|
|
3433
|
-
/* @__PURE__ */ React42.createElement(
|
|
3434
|
-
|
|
3215
|
+
/* @__PURE__ */ React42.createElement(Group8, { justify: "space-between" }, /* @__PURE__ */ React42.createElement("div", null, /* @__PURE__ */ React42.createElement(Text25, { size: "sm", fw: 500, style: { color: "#f1f3f5" } }, member.addr.slice(0, 20), "..."), /* @__PURE__ */ React42.createElement(
|
|
3216
|
+
Badge6,
|
|
3435
3217
|
{
|
|
3436
3218
|
size: "sm",
|
|
3437
3219
|
style: {
|
|
@@ -3441,8 +3223,8 @@ var UpdateMembersActionForm = ({ data, onChange }) => {
|
|
|
3441
3223
|
},
|
|
3442
3224
|
"Weight: ",
|
|
3443
3225
|
member.weight
|
|
3444
|
-
)), /* @__PURE__ */ React42.createElement(
|
|
3445
|
-
)))), /* @__PURE__ */ React42.createElement(
|
|
3226
|
+
)), /* @__PURE__ */ React42.createElement(ActionIcon6, { size: "sm", variant: "subtle", onClick: () => handleRemoveMember(index), style: { color: "#ff6b6b" } }, "\u{1F5D1}\uFE0F"))
|
|
3227
|
+
)))), /* @__PURE__ */ React42.createElement(Group8, { grow: true }, /* @__PURE__ */ React42.createElement(TextInput7, { placeholder: "Member address", value: newMember.addr, onChange: (e) => setNewMember({ ...newMember, addr: e.currentTarget.value }), styles: inputStyles29 }), /* @__PURE__ */ React42.createElement(
|
|
3446
3228
|
NumberInput2,
|
|
3447
3229
|
{
|
|
3448
3230
|
placeholder: "Weight",
|
|
@@ -3452,7 +3234,7 @@ var UpdateMembersActionForm = ({ data, onChange }) => {
|
|
|
3452
3234
|
styles: inputStyles29
|
|
3453
3235
|
}
|
|
3454
3236
|
), /* @__PURE__ */ React42.createElement(
|
|
3455
|
-
|
|
3237
|
+
Button6,
|
|
3456
3238
|
{
|
|
3457
3239
|
size: "sm",
|
|
3458
3240
|
onClick: handleAddMember,
|
|
@@ -3464,8 +3246,8 @@ var UpdateMembersActionForm = ({ data, onChange }) => {
|
|
|
3464
3246
|
}
|
|
3465
3247
|
},
|
|
3466
3248
|
"\u2795 Add"
|
|
3467
|
-
))), /* @__PURE__ */ React42.createElement(Divider2, { color: "#333" }), /* @__PURE__ */ React42.createElement(
|
|
3468
|
-
|
|
3249
|
+
))), /* @__PURE__ */ React42.createElement(Divider2, { color: "#333" }), /* @__PURE__ */ React42.createElement(Stack26, { gap: "xs" }, /* @__PURE__ */ React42.createElement(Text25, { size: "sm", fw: 500, style: { color: "#adb5bd" } }, "Members to Remove"), /* @__PURE__ */ React42.createElement(ScrollArea2, { h: 100 }, /* @__PURE__ */ React42.createElement(Stack26, { gap: "xs" }, (data.remove || []).map((item, index) => /* @__PURE__ */ React42.createElement(
|
|
3250
|
+
Card7,
|
|
3469
3251
|
{
|
|
3470
3252
|
key: index,
|
|
3471
3253
|
withBorder: true,
|
|
@@ -3475,9 +3257,9 @@ var UpdateMembersActionForm = ({ data, onChange }) => {
|
|
|
3475
3257
|
borderColor: "#333"
|
|
3476
3258
|
}
|
|
3477
3259
|
},
|
|
3478
|
-
/* @__PURE__ */ React42.createElement(
|
|
3479
|
-
)))), /* @__PURE__ */ React42.createElement(
|
|
3480
|
-
|
|
3260
|
+
/* @__PURE__ */ React42.createElement(Group8, { justify: "space-between" }, /* @__PURE__ */ React42.createElement(Text25, { size: "sm", style: { color: "#adb5bd" } }, item.addr.slice(0, 30), "..."), /* @__PURE__ */ React42.createElement(ActionIcon6, { size: "sm", variant: "subtle", onClick: () => handleRemoveRemoveAddress(index), style: { color: "#ff6b6b" } }, "\u{1F5D1}\uFE0F"))
|
|
3261
|
+
)))), /* @__PURE__ */ React42.createElement(Group8, { grow: true }, /* @__PURE__ */ React42.createElement(TextInput7, { placeholder: "Address to remove", value: newRemoveAddress, onChange: (e) => setNewRemoveAddress(e.currentTarget.value), styles: inputStyles29 }), /* @__PURE__ */ React42.createElement(
|
|
3262
|
+
Button6,
|
|
3481
3263
|
{
|
|
3482
3264
|
size: "sm",
|
|
3483
3265
|
onClick: handleAddRemoveAddress,
|
|
@@ -3494,7 +3276,7 @@ var UpdateMembersActionForm = ({ data, onChange }) => {
|
|
|
3494
3276
|
|
|
3495
3277
|
// src/mantine/blocks/proposal/actions-components/StakeActionForm.tsx
|
|
3496
3278
|
import React43 from "react";
|
|
3497
|
-
import { Stack as
|
|
3279
|
+
import { Stack as Stack27, TextInput as TextInput8, Select as Select3, NumberInput as NumberInput3 } from "@mantine/core";
|
|
3498
3280
|
var stakeTypeOptions = [
|
|
3499
3281
|
{ value: StakeType.Delegate, label: "Delegate" },
|
|
3500
3282
|
{ value: StakeType.Undelegate, label: "Undelegate" },
|
|
@@ -3539,7 +3321,7 @@ var selectStyles = {
|
|
|
3539
3321
|
var StakeActionForm = ({ data, onChange }) => {
|
|
3540
3322
|
const isRedelegate = data.stakeType === StakeType.Redelegate;
|
|
3541
3323
|
const needsAmount = data.stakeType !== StakeType.WithdrawDelegatorReward;
|
|
3542
|
-
return /* @__PURE__ */ React43.createElement(
|
|
3324
|
+
return /* @__PURE__ */ React43.createElement(Stack27, { gap: "md" }, /* @__PURE__ */ React43.createElement(
|
|
3543
3325
|
Select3,
|
|
3544
3326
|
{
|
|
3545
3327
|
label: "Stake Type",
|
|
@@ -3599,7 +3381,7 @@ var StakeActionForm = ({ data, onChange }) => {
|
|
|
3599
3381
|
|
|
3600
3382
|
// src/mantine/blocks/proposal/actions-components/JoinActionForm.tsx
|
|
3601
3383
|
import React44 from "react";
|
|
3602
|
-
import { Stack as
|
|
3384
|
+
import { Stack as Stack28, TextInput as TextInput9 } from "@mantine/core";
|
|
3603
3385
|
var inputStyles2 = {
|
|
3604
3386
|
label: { color: "#adb5bd" },
|
|
3605
3387
|
input: {
|
|
@@ -3612,7 +3394,7 @@ var inputStyles2 = {
|
|
|
3612
3394
|
}
|
|
3613
3395
|
};
|
|
3614
3396
|
var JoinActionForm = ({ data, onChange }) => {
|
|
3615
|
-
return /* @__PURE__ */ React44.createElement(
|
|
3397
|
+
return /* @__PURE__ */ React44.createElement(Stack28, { gap: "md" }, /* @__PURE__ */ React44.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__ */ React44.createElement(
|
|
3616
3398
|
TextInput9,
|
|
3617
3399
|
{
|
|
3618
3400
|
label: "Core Address",
|
|
@@ -3627,7 +3409,7 @@ var JoinActionForm = ({ data, onChange }) => {
|
|
|
3627
3409
|
|
|
3628
3410
|
// src/mantine/blocks/proposal/actions-components/forms/MintActionForm.tsx
|
|
3629
3411
|
import React45 from "react";
|
|
3630
|
-
import { Stack as
|
|
3412
|
+
import { Stack as Stack29, TextInput as TextInput10, NumberInput as NumberInput4 } from "@mantine/core";
|
|
3631
3413
|
var inputStyles3 = {
|
|
3632
3414
|
label: { color: "#adb5bd" },
|
|
3633
3415
|
input: {
|
|
@@ -3640,7 +3422,7 @@ var inputStyles3 = {
|
|
|
3640
3422
|
}
|
|
3641
3423
|
};
|
|
3642
3424
|
var MintActionForm = ({ data, onChange }) => {
|
|
3643
|
-
return /* @__PURE__ */ React45.createElement(
|
|
3425
|
+
return /* @__PURE__ */ React45.createElement(Stack29, { gap: "md" }, /* @__PURE__ */ React45.createElement(TextInput10, { label: "Recipient Address", placeholder: "ixo1...", value: data.to, onChange: (e) => onChange({ ...data, to: e.currentTarget.value }), required: true, styles: inputStyles3 }), /* @__PURE__ */ React45.createElement(
|
|
3644
3426
|
NumberInput4,
|
|
3645
3427
|
{
|
|
3646
3428
|
label: "Amount",
|
|
@@ -3656,8 +3438,8 @@ var MintActionForm = ({ data, onChange }) => {
|
|
|
3656
3438
|
};
|
|
3657
3439
|
|
|
3658
3440
|
// src/mantine/blocks/proposal/actions-components/forms/ExecuteActionForm.tsx
|
|
3659
|
-
import React46, { useState as
|
|
3660
|
-
import { Stack as
|
|
3441
|
+
import React46, { useState as useState9 } from "react";
|
|
3442
|
+
import { Stack as Stack30, TextInput as TextInput11, Textarea as Textarea3, Button as Button7, Group as Group9, Text as Text26, Card as Card8 } from "@mantine/core";
|
|
3661
3443
|
var inputStyles4 = {
|
|
3662
3444
|
label: { color: "#adb5bd" },
|
|
3663
3445
|
input: {
|
|
@@ -3670,7 +3452,7 @@ var inputStyles4 = {
|
|
|
3670
3452
|
}
|
|
3671
3453
|
};
|
|
3672
3454
|
var ExecuteActionForm = ({ data, onChange }) => {
|
|
3673
|
-
const [newFund, setNewFund] =
|
|
3455
|
+
const [newFund, setNewFund] = useState9({ denom: "uixo", amount: "" });
|
|
3674
3456
|
const handleAddFund = () => {
|
|
3675
3457
|
if (newFund.amount && newFund.denom) {
|
|
3676
3458
|
onChange({
|
|
@@ -3694,7 +3476,7 @@ var ExecuteActionForm = ({ data, onChange }) => {
|
|
|
3694
3476
|
return data.message;
|
|
3695
3477
|
}
|
|
3696
3478
|
};
|
|
3697
|
-
return /* @__PURE__ */ React46.createElement(
|
|
3479
|
+
return /* @__PURE__ */ React46.createElement(Stack30, { gap: "md" }, /* @__PURE__ */ React46.createElement(
|
|
3698
3480
|
TextInput11,
|
|
3699
3481
|
{
|
|
3700
3482
|
label: "Contract Address",
|
|
@@ -3715,8 +3497,8 @@ var ExecuteActionForm = ({ data, onChange }) => {
|
|
|
3715
3497
|
required: true,
|
|
3716
3498
|
styles: inputStyles4
|
|
3717
3499
|
}
|
|
3718
|
-
), /* @__PURE__ */ React46.createElement(
|
|
3719
|
-
|
|
3500
|
+
), /* @__PURE__ */ React46.createElement(Stack30, { gap: "xs" }, /* @__PURE__ */ React46.createElement(Text26, { size: "sm", fw: 500, style: { color: "#adb5bd" } }, "Funds (Optional)"), (data.funds || []).map((fund, index) => /* @__PURE__ */ React46.createElement(Card8, { key: index, withBorder: true, padding: "xs", style: { backgroundColor: "#2a2a2a", borderColor: "#333" } }, /* @__PURE__ */ React46.createElement(Group9, { justify: "space-between" }, /* @__PURE__ */ React46.createElement(Text26, { size: "sm", style: { color: "#f1f3f5" } }, fund.amount, " ", fund.denom), /* @__PURE__ */ React46.createElement(Button7, { size: "xs", variant: "subtle", onClick: () => handleRemoveFund(index), style: { color: "#ff6b6b" } }, "Remove")))), /* @__PURE__ */ React46.createElement(Group9, { grow: true }, /* @__PURE__ */ React46.createElement(TextInput11, { placeholder: "Amount", value: newFund.amount, onChange: (e) => setNewFund({ ...newFund, amount: e.currentTarget.value }), styles: inputStyles4 }), /* @__PURE__ */ React46.createElement(TextInput11, { placeholder: "Denom (e.g., uixo)", value: newFund.denom, onChange: (e) => setNewFund({ ...newFund, denom: e.currentTarget.value }), styles: inputStyles4 }), /* @__PURE__ */ React46.createElement(
|
|
3501
|
+
Button7,
|
|
3720
3502
|
{
|
|
3721
3503
|
size: "sm",
|
|
3722
3504
|
onClick: handleAddFund,
|
|
@@ -3730,9 +3512,9 @@ var ExecuteActionForm = ({ data, onChange }) => {
|
|
|
3730
3512
|
};
|
|
3731
3513
|
|
|
3732
3514
|
// src/mantine/blocks/proposal/actions-components/forms/CustomActionForm.tsx
|
|
3733
|
-
import React47, { useState as
|
|
3734
|
-
import { Stack as
|
|
3735
|
-
import { Group as
|
|
3515
|
+
import React47, { useState as useState10, useEffect as useEffect8 } from "react";
|
|
3516
|
+
import { Stack as Stack31, Textarea as Textarea4, Alert as Alert4, Text as Text27, Badge as Badge7 } from "@mantine/core";
|
|
3517
|
+
import { Group as Group10 } from "@mantine/core";
|
|
3736
3518
|
var inputStyles5 = {
|
|
3737
3519
|
label: { color: "#adb5bd" },
|
|
3738
3520
|
input: {
|
|
@@ -3746,9 +3528,9 @@ var inputStyles5 = {
|
|
|
3746
3528
|
}
|
|
3747
3529
|
};
|
|
3748
3530
|
var CustomActionForm = ({ data, onChange }) => {
|
|
3749
|
-
const [isValid, setIsValid] =
|
|
3750
|
-
const [error, setError] =
|
|
3751
|
-
|
|
3531
|
+
const [isValid, setIsValid] = useState10(true);
|
|
3532
|
+
const [error, setError] = useState10("");
|
|
3533
|
+
useEffect8(() => {
|
|
3752
3534
|
try {
|
|
3753
3535
|
if (data.message) {
|
|
3754
3536
|
JSON.parse(data.message);
|
|
@@ -3768,8 +3550,8 @@ var CustomActionForm = ({ data, onChange }) => {
|
|
|
3768
3550
|
return data.message;
|
|
3769
3551
|
}
|
|
3770
3552
|
};
|
|
3771
|
-
return /* @__PURE__ */ React47.createElement(
|
|
3772
|
-
|
|
3553
|
+
return /* @__PURE__ */ React47.createElement(Stack31, { gap: "md" }, /* @__PURE__ */ React47.createElement(Alert4, { color: "yellow", style: { backgroundColor: "#2a2a2a", borderColor: "#ffd43b" } }, /* @__PURE__ */ React47.createElement(Text27, { size: "sm", style: { color: "#ffd43b" } }, "\u26A0\uFE0F Custom actions require valid JSON messages. Supports both Wasm and Stargate message formats.")), /* @__PURE__ */ React47.createElement("div", null, /* @__PURE__ */ React47.createElement(Group10, { gap: "xs", mb: "xs" }, /* @__PURE__ */ React47.createElement(Text27, { size: "sm", fw: 500, style: { color: "#adb5bd" } }, "Custom Message (JSON)"), /* @__PURE__ */ React47.createElement(
|
|
3554
|
+
Badge7,
|
|
3773
3555
|
{
|
|
3774
3556
|
size: "sm",
|
|
3775
3557
|
style: {
|
|
@@ -3812,7 +3594,7 @@ Example Stargate message:
|
|
|
3812
3594
|
|
|
3813
3595
|
// src/mantine/blocks/proposal/actions-components/forms/AuthzExecActionForm.tsx
|
|
3814
3596
|
import React48 from "react";
|
|
3815
|
-
import { Stack as
|
|
3597
|
+
import { Stack as Stack32, Select as Select4, TextInput as TextInput12, Textarea as Textarea5 } from "@mantine/core";
|
|
3816
3598
|
var inputStyles6 = {
|
|
3817
3599
|
label: { color: "#adb5bd" },
|
|
3818
3600
|
input: {
|
|
@@ -3847,7 +3629,7 @@ var AuthzExecActionForm = ({ data, onChange }) => {
|
|
|
3847
3629
|
onChange({ ...data, [field]: value });
|
|
3848
3630
|
}
|
|
3849
3631
|
};
|
|
3850
|
-
return /* @__PURE__ */ React48.createElement(
|
|
3632
|
+
return /* @__PURE__ */ React48.createElement(Stack32, { gap: "md" }, /* @__PURE__ */ React48.createElement(
|
|
3851
3633
|
Select4,
|
|
3852
3634
|
{
|
|
3853
3635
|
label: "Action Type",
|
|
@@ -3912,7 +3694,7 @@ var AuthzExecActionForm = ({ data, onChange }) => {
|
|
|
3912
3694
|
|
|
3913
3695
|
// src/mantine/blocks/proposal/actions-components/forms/AuthzGrantActionForm.tsx
|
|
3914
3696
|
import React49 from "react";
|
|
3915
|
-
import { Stack as
|
|
3697
|
+
import { Stack as Stack33, TextInput as TextInput13 } from "@mantine/core";
|
|
3916
3698
|
var inputStyles7 = {
|
|
3917
3699
|
label: { color: "#adb5bd" },
|
|
3918
3700
|
input: {
|
|
@@ -3925,7 +3707,7 @@ var inputStyles7 = {
|
|
|
3925
3707
|
}
|
|
3926
3708
|
};
|
|
3927
3709
|
var AuthzGrantActionForm = ({ data, onChange }) => {
|
|
3928
|
-
return /* @__PURE__ */ React49.createElement(
|
|
3710
|
+
return /* @__PURE__ */ React49.createElement(Stack33, { gap: "md" }, /* @__PURE__ */ React49.createElement(
|
|
3929
3711
|
TextInput13,
|
|
3930
3712
|
{
|
|
3931
3713
|
label: "Type URL",
|
|
@@ -3966,7 +3748,7 @@ var AuthzGrantActionForm = ({ data, onChange }) => {
|
|
|
3966
3748
|
|
|
3967
3749
|
// src/mantine/blocks/proposal/actions-components/forms/BurnNftActionForm.tsx
|
|
3968
3750
|
import React50 from "react";
|
|
3969
|
-
import { Stack as
|
|
3751
|
+
import { Stack as Stack34, TextInput as TextInput14 } from "@mantine/core";
|
|
3970
3752
|
var inputStyles8 = {
|
|
3971
3753
|
label: { color: "#adb5bd" },
|
|
3972
3754
|
input: {
|
|
@@ -3979,7 +3761,7 @@ var inputStyles8 = {
|
|
|
3979
3761
|
}
|
|
3980
3762
|
};
|
|
3981
3763
|
var BurnNftActionForm = ({ data, onChange }) => {
|
|
3982
|
-
return /* @__PURE__ */ React50.createElement(
|
|
3764
|
+
return /* @__PURE__ */ React50.createElement(Stack34, { gap: "md" }, /* @__PURE__ */ React50.createElement(
|
|
3983
3765
|
TextInput14,
|
|
3984
3766
|
{
|
|
3985
3767
|
label: "Collection Address",
|
|
@@ -3994,7 +3776,7 @@ var BurnNftActionForm = ({ data, onChange }) => {
|
|
|
3994
3776
|
|
|
3995
3777
|
// src/mantine/blocks/proposal/actions-components/forms/TransferNftActionForm.tsx
|
|
3996
3778
|
import React51 from "react";
|
|
3997
|
-
import { Stack as
|
|
3779
|
+
import { Stack as Stack35, TextInput as TextInput15, Checkbox as Checkbox4, Textarea as Textarea6 } from "@mantine/core";
|
|
3998
3780
|
var inputStyles9 = {
|
|
3999
3781
|
label: { color: "#adb5bd" },
|
|
4000
3782
|
input: {
|
|
@@ -4007,7 +3789,7 @@ var inputStyles9 = {
|
|
|
4007
3789
|
}
|
|
4008
3790
|
};
|
|
4009
3791
|
var TransferNftActionForm = ({ data, onChange }) => {
|
|
4010
|
-
return /* @__PURE__ */ React51.createElement(
|
|
3792
|
+
return /* @__PURE__ */ React51.createElement(Stack35, { gap: "md" }, /* @__PURE__ */ React51.createElement(
|
|
4011
3793
|
TextInput15,
|
|
4012
3794
|
{
|
|
4013
3795
|
label: "Collection Address",
|
|
@@ -4053,7 +3835,7 @@ var TransferNftActionForm = ({ data, onChange }) => {
|
|
|
4053
3835
|
|
|
4054
3836
|
// src/mantine/blocks/proposal/actions-components/forms/ManageCw721ActionForm.tsx
|
|
4055
3837
|
import React52 from "react";
|
|
4056
|
-
import { Stack as
|
|
3838
|
+
import { Stack as Stack36, TextInput as TextInput16, Radio, Group as Group11 } from "@mantine/core";
|
|
4057
3839
|
var inputStyles10 = {
|
|
4058
3840
|
label: { color: "#adb5bd" },
|
|
4059
3841
|
input: {
|
|
@@ -4066,7 +3848,7 @@ var inputStyles10 = {
|
|
|
4066
3848
|
}
|
|
4067
3849
|
};
|
|
4068
3850
|
var ManageCw721ActionForm = ({ data, onChange }) => {
|
|
4069
|
-
return /* @__PURE__ */ React52.createElement(
|
|
3851
|
+
return /* @__PURE__ */ React52.createElement(Stack36, { gap: "md" }, /* @__PURE__ */ React52.createElement(Radio.Group, { label: "Action", value: data.adding ? "add" : "remove", onChange: (value) => onChange({ ...data, adding: value === "add" }) }, /* @__PURE__ */ React52.createElement(Group11, { mt: "xs" }, /* @__PURE__ */ React52.createElement(
|
|
4070
3852
|
Radio,
|
|
4071
3853
|
{
|
|
4072
3854
|
value: "add",
|
|
@@ -4100,8 +3882,8 @@ var ManageCw721ActionForm = ({ data, onChange }) => {
|
|
|
4100
3882
|
};
|
|
4101
3883
|
|
|
4102
3884
|
// src/mantine/blocks/proposal/actions-components/forms/InstantiateActionForm.tsx
|
|
4103
|
-
import React53, { useState as
|
|
4104
|
-
import { Stack as
|
|
3885
|
+
import React53, { useState as useState11 } from "react";
|
|
3886
|
+
import { Stack as Stack37, TextInput as TextInput17, Textarea as Textarea7, NumberInput as NumberInput5, Button as Button8, Group as Group12, Text as Text28, Card as Card9 } from "@mantine/core";
|
|
4105
3887
|
var inputStyles11 = {
|
|
4106
3888
|
label: { color: "#adb5bd" },
|
|
4107
3889
|
input: {
|
|
@@ -4114,7 +3896,7 @@ var inputStyles11 = {
|
|
|
4114
3896
|
}
|
|
4115
3897
|
};
|
|
4116
3898
|
var InstantiateActionForm = ({ data, onChange }) => {
|
|
4117
|
-
const [newFund, setNewFund] =
|
|
3899
|
+
const [newFund, setNewFund] = useState11({ denom: "uixo", amount: "" });
|
|
4118
3900
|
const handleAddFund = () => {
|
|
4119
3901
|
if (newFund.amount && newFund.denom) {
|
|
4120
3902
|
onChange({
|
|
@@ -4138,7 +3920,7 @@ var InstantiateActionForm = ({ data, onChange }) => {
|
|
|
4138
3920
|
return data.message;
|
|
4139
3921
|
}
|
|
4140
3922
|
};
|
|
4141
|
-
return /* @__PURE__ */ React53.createElement(
|
|
3923
|
+
return /* @__PURE__ */ React53.createElement(Stack37, { gap: "md" }, /* @__PURE__ */ React53.createElement(
|
|
4142
3924
|
TextInput17,
|
|
4143
3925
|
{
|
|
4144
3926
|
label: "Admin Address",
|
|
@@ -4170,8 +3952,8 @@ var InstantiateActionForm = ({ data, onChange }) => {
|
|
|
4170
3952
|
required: true,
|
|
4171
3953
|
styles: inputStyles11
|
|
4172
3954
|
}
|
|
4173
|
-
), /* @__PURE__ */ React53.createElement(
|
|
4174
|
-
|
|
3955
|
+
), /* @__PURE__ */ React53.createElement(Stack37, { gap: "xs" }, /* @__PURE__ */ React53.createElement(Text28, { size: "sm", fw: 500, style: { color: "#adb5bd" } }, "Funds (Optional)"), (data.funds || []).map((fund, index) => /* @__PURE__ */ React53.createElement(Card9, { key: index, withBorder: true, padding: "xs", style: { backgroundColor: "#2a2a2a", borderColor: "#333" } }, /* @__PURE__ */ React53.createElement(Group12, { justify: "space-between" }, /* @__PURE__ */ React53.createElement(Text28, { size: "sm", style: { color: "#f1f3f5" } }, fund.amount, " ", fund.denom), /* @__PURE__ */ React53.createElement(Button8, { size: "xs", variant: "subtle", onClick: () => handleRemoveFund(index), style: { color: "#ff6b6b" } }, "Remove")))), /* @__PURE__ */ React53.createElement(Group12, { grow: true }, /* @__PURE__ */ React53.createElement(TextInput17, { placeholder: "Amount", value: newFund.amount, onChange: (e) => setNewFund({ ...newFund, amount: e.currentTarget.value }), styles: inputStyles11 }), /* @__PURE__ */ React53.createElement(TextInput17, { placeholder: "Denom (e.g., uixo)", value: newFund.denom, onChange: (e) => setNewFund({ ...newFund, denom: e.currentTarget.value }), styles: inputStyles11 }), /* @__PURE__ */ React53.createElement(
|
|
3956
|
+
Button8,
|
|
4175
3957
|
{
|
|
4176
3958
|
size: "sm",
|
|
4177
3959
|
onClick: handleAddFund,
|
|
@@ -4186,7 +3968,7 @@ var InstantiateActionForm = ({ data, onChange }) => {
|
|
|
4186
3968
|
|
|
4187
3969
|
// src/mantine/blocks/proposal/actions-components/forms/MigrateActionForm.tsx
|
|
4188
3970
|
import React54 from "react";
|
|
4189
|
-
import { Stack as
|
|
3971
|
+
import { Stack as Stack38, TextInput as TextInput18, Textarea as Textarea8, NumberInput as NumberInput6 } from "@mantine/core";
|
|
4190
3972
|
var inputStyles12 = {
|
|
4191
3973
|
label: { color: "#adb5bd" },
|
|
4192
3974
|
input: {
|
|
@@ -4207,7 +3989,7 @@ var MigrateActionForm = ({ data, onChange }) => {
|
|
|
4207
3989
|
return data.msg;
|
|
4208
3990
|
}
|
|
4209
3991
|
};
|
|
4210
|
-
return /* @__PURE__ */ React54.createElement(
|
|
3992
|
+
return /* @__PURE__ */ React54.createElement(Stack38, { gap: "md" }, /* @__PURE__ */ React54.createElement(
|
|
4211
3993
|
TextInput18,
|
|
4212
3994
|
{
|
|
4213
3995
|
label: "Contract Address",
|
|
@@ -4244,7 +4026,7 @@ var MigrateActionForm = ({ data, onChange }) => {
|
|
|
4244
4026
|
|
|
4245
4027
|
// src/mantine/blocks/proposal/actions-components/forms/UpdateAdminActionForm.tsx
|
|
4246
4028
|
import React55 from "react";
|
|
4247
|
-
import { Stack as
|
|
4029
|
+
import { Stack as Stack39, TextInput as TextInput19 } from "@mantine/core";
|
|
4248
4030
|
var inputStyles13 = {
|
|
4249
4031
|
label: { color: "#adb5bd" },
|
|
4250
4032
|
input: {
|
|
@@ -4257,7 +4039,7 @@ var inputStyles13 = {
|
|
|
4257
4039
|
}
|
|
4258
4040
|
};
|
|
4259
4041
|
var UpdateAdminActionForm = ({ data, onChange }) => {
|
|
4260
|
-
return /* @__PURE__ */ React55.createElement(
|
|
4042
|
+
return /* @__PURE__ */ React55.createElement(Stack39, { gap: "md" }, /* @__PURE__ */ React55.createElement(
|
|
4261
4043
|
TextInput19,
|
|
4262
4044
|
{
|
|
4263
4045
|
label: "Contract Address",
|
|
@@ -4282,7 +4064,7 @@ var UpdateAdminActionForm = ({ data, onChange }) => {
|
|
|
4282
4064
|
|
|
4283
4065
|
// src/mantine/blocks/proposal/actions-components/forms/ManageCw20ActionForm.tsx
|
|
4284
4066
|
import React56 from "react";
|
|
4285
|
-
import { Stack as
|
|
4067
|
+
import { Stack as Stack40, TextInput as TextInput20, Radio as Radio2, Group as Group13 } from "@mantine/core";
|
|
4286
4068
|
var inputStyles14 = {
|
|
4287
4069
|
label: { color: "#adb5bd" },
|
|
4288
4070
|
input: {
|
|
@@ -4295,7 +4077,7 @@ var inputStyles14 = {
|
|
|
4295
4077
|
}
|
|
4296
4078
|
};
|
|
4297
4079
|
var ManageCw20ActionForm = ({ data, onChange }) => {
|
|
4298
|
-
return /* @__PURE__ */ React56.createElement(
|
|
4080
|
+
return /* @__PURE__ */ React56.createElement(Stack40, { gap: "md" }, /* @__PURE__ */ React56.createElement(Radio2.Group, { label: "Action", value: data.adding ? "add" : "remove", onChange: (value) => onChange({ ...data, adding: value === "add" }) }, /* @__PURE__ */ React56.createElement(Group13, { mt: "xs" }, /* @__PURE__ */ React56.createElement(
|
|
4299
4081
|
Radio2,
|
|
4300
4082
|
{
|
|
4301
4083
|
value: "add",
|
|
@@ -4329,8 +4111,8 @@ var ManageCw20ActionForm = ({ data, onChange }) => {
|
|
|
4329
4111
|
};
|
|
4330
4112
|
|
|
4331
4113
|
// src/mantine/blocks/proposal/actions-components/forms/ManageSubDaosActionForm.tsx
|
|
4332
|
-
import React57, { useState as
|
|
4333
|
-
import { Stack as
|
|
4114
|
+
import React57, { useState as useState12 } from "react";
|
|
4115
|
+
import { Stack as Stack41, TextInput as TextInput21, Button as Button9, Group as Group14, Text as Text29, Card as Card10, Textarea as Textarea9 } from "@mantine/core";
|
|
4334
4116
|
var inputStyles15 = {
|
|
4335
4117
|
label: { color: "#adb5bd" },
|
|
4336
4118
|
input: {
|
|
@@ -4343,8 +4125,8 @@ var inputStyles15 = {
|
|
|
4343
4125
|
}
|
|
4344
4126
|
};
|
|
4345
4127
|
var ManageSubDaosActionForm = ({ data, onChange }) => {
|
|
4346
|
-
const [newSubDao, setNewSubDao] =
|
|
4347
|
-
const [newRemoveAddress, setNewRemoveAddress] =
|
|
4128
|
+
const [newSubDao, setNewSubDao] = useState12({ addr: "", charter: "" });
|
|
4129
|
+
const [newRemoveAddress, setNewRemoveAddress] = useState12("");
|
|
4348
4130
|
const handleAddSubDao = () => {
|
|
4349
4131
|
if (newSubDao.addr) {
|
|
4350
4132
|
onChange({
|
|
@@ -4375,7 +4157,7 @@ var ManageSubDaosActionForm = ({ data, onChange }) => {
|
|
|
4375
4157
|
toRemove: (data.toRemove || []).filter((_, i) => i !== index)
|
|
4376
4158
|
});
|
|
4377
4159
|
};
|
|
4378
|
-
return /* @__PURE__ */ React57.createElement(
|
|
4160
|
+
return /* @__PURE__ */ React57.createElement(Stack41, { gap: "md" }, /* @__PURE__ */ React57.createElement(Stack41, { gap: "xs" }, /* @__PURE__ */ React57.createElement(Text29, { size: "sm", fw: 500, style: { color: "#adb5bd" } }, "SubDAOs to Add"), (data.toAdd || []).map((subDao, index) => /* @__PURE__ */ React57.createElement(Card10, { key: index, withBorder: true, padding: "xs", style: { backgroundColor: "#2a2a2a", borderColor: "#333" } }, /* @__PURE__ */ React57.createElement(Stack41, { gap: "xs" }, /* @__PURE__ */ React57.createElement(Group14, { justify: "space-between" }, /* @__PURE__ */ React57.createElement(Text29, { size: "sm", style: { color: "#f1f3f5" } }, subDao.addr), /* @__PURE__ */ React57.createElement(Button9, { size: "xs", variant: "subtle", onClick: () => handleRemoveFromAddList(index), style: { color: "#ff6b6b" } }, "Remove")), subDao.charter && /* @__PURE__ */ React57.createElement(Text29, { size: "xs", style: { color: "#adb5bd" } }, "Charter: ", subDao.charter)))), /* @__PURE__ */ React57.createElement(Stack41, { gap: "xs" }, /* @__PURE__ */ React57.createElement(TextInput21, { placeholder: "SubDAO Address", value: newSubDao.addr, onChange: (e) => setNewSubDao({ ...newSubDao, addr: e.currentTarget.value }), styles: inputStyles15 }), /* @__PURE__ */ React57.createElement(
|
|
4379
4161
|
Textarea9,
|
|
4380
4162
|
{
|
|
4381
4163
|
placeholder: "Charter (optional)",
|
|
@@ -4385,7 +4167,7 @@ var ManageSubDaosActionForm = ({ data, onChange }) => {
|
|
|
4385
4167
|
styles: inputStyles15
|
|
4386
4168
|
}
|
|
4387
4169
|
), /* @__PURE__ */ React57.createElement(
|
|
4388
|
-
|
|
4170
|
+
Button9,
|
|
4389
4171
|
{
|
|
4390
4172
|
size: "sm",
|
|
4391
4173
|
onClick: handleAddSubDao,
|
|
@@ -4395,8 +4177,8 @@ var ManageSubDaosActionForm = ({ data, onChange }) => {
|
|
|
4395
4177
|
}
|
|
4396
4178
|
},
|
|
4397
4179
|
"Add SubDAO"
|
|
4398
|
-
))), /* @__PURE__ */ React57.createElement(
|
|
4399
|
-
|
|
4180
|
+
))), /* @__PURE__ */ React57.createElement(Stack41, { gap: "xs" }, /* @__PURE__ */ React57.createElement(Text29, { size: "sm", fw: 500, style: { color: "#adb5bd" } }, "SubDAOs to Remove"), (data.toRemove || []).map((subDao, index) => /* @__PURE__ */ React57.createElement(Card10, { key: index, withBorder: true, padding: "xs", style: { backgroundColor: "#2a2a2a", borderColor: "#333" } }, /* @__PURE__ */ React57.createElement(Group14, { justify: "space-between" }, /* @__PURE__ */ React57.createElement(Text29, { size: "sm", style: { color: "#f1f3f5" } }, subDao.address), /* @__PURE__ */ React57.createElement(Button9, { size: "xs", variant: "subtle", onClick: () => handleRemoveFromRemoveList(index), style: { color: "#ff6b6b" } }, "Remove")))), /* @__PURE__ */ React57.createElement(Group14, { grow: true }, /* @__PURE__ */ React57.createElement(TextInput21, { placeholder: "SubDAO Address to Remove", value: newRemoveAddress, onChange: (e) => setNewRemoveAddress(e.currentTarget.value), styles: inputStyles15 }), /* @__PURE__ */ React57.createElement(
|
|
4181
|
+
Button9,
|
|
4400
4182
|
{
|
|
4401
4183
|
size: "sm",
|
|
4402
4184
|
onClick: handleAddToRemoveList,
|
|
@@ -4411,7 +4193,7 @@ var ManageSubDaosActionForm = ({ data, onChange }) => {
|
|
|
4411
4193
|
|
|
4412
4194
|
// src/mantine/blocks/proposal/actions-components/forms/UpdateInfoActionForm.tsx
|
|
4413
4195
|
import React58 from "react";
|
|
4414
|
-
import { Stack as
|
|
4196
|
+
import { Stack as Stack42, TextInput as TextInput22, Textarea as Textarea10, Checkbox as Checkbox5 } from "@mantine/core";
|
|
4415
4197
|
var inputStyles16 = {
|
|
4416
4198
|
label: { color: "#adb5bd" },
|
|
4417
4199
|
input: {
|
|
@@ -4424,7 +4206,7 @@ var inputStyles16 = {
|
|
|
4424
4206
|
}
|
|
4425
4207
|
};
|
|
4426
4208
|
var UpdateInfoActionForm = ({ data, onChange }) => {
|
|
4427
|
-
return /* @__PURE__ */ React58.createElement(
|
|
4209
|
+
return /* @__PURE__ */ React58.createElement(Stack42, { gap: "md" }, /* @__PURE__ */ React58.createElement(TextInput22, { label: "DAO Name", placeholder: "My DAO", value: data.name, onChange: (e) => onChange({ ...data, name: e.currentTarget.value }), required: true, styles: inputStyles16 }), /* @__PURE__ */ React58.createElement(
|
|
4428
4210
|
Textarea10,
|
|
4429
4211
|
{
|
|
4430
4212
|
label: "Description",
|
|
@@ -4479,7 +4261,7 @@ var UpdateInfoActionForm = ({ data, onChange }) => {
|
|
|
4479
4261
|
|
|
4480
4262
|
// src/mantine/blocks/proposal/actions-components/forms/ManageStorageItemsActionForm.tsx
|
|
4481
4263
|
import React59 from "react";
|
|
4482
|
-
import { Stack as
|
|
4264
|
+
import { Stack as Stack43, TextInput as TextInput23, Radio as Radio3, Group as Group15, Textarea as Textarea11 } from "@mantine/core";
|
|
4483
4265
|
var inputStyles17 = {
|
|
4484
4266
|
label: { color: "#adb5bd" },
|
|
4485
4267
|
input: {
|
|
@@ -4492,7 +4274,7 @@ var inputStyles17 = {
|
|
|
4492
4274
|
}
|
|
4493
4275
|
};
|
|
4494
4276
|
var ManageStorageItemsActionForm = ({ data, onChange }) => {
|
|
4495
|
-
return /* @__PURE__ */ React59.createElement(
|
|
4277
|
+
return /* @__PURE__ */ React59.createElement(Stack43, { gap: "md" }, /* @__PURE__ */ React59.createElement(Radio3.Group, { label: "Action", value: data.setting ? "set" : "remove", onChange: (value) => onChange({ ...data, setting: value === "set" }) }, /* @__PURE__ */ React59.createElement(Group15, { mt: "xs" }, /* @__PURE__ */ React59.createElement(
|
|
4496
4278
|
Radio3,
|
|
4497
4279
|
{
|
|
4498
4280
|
value: "set",
|
|
@@ -4527,8 +4309,8 @@ var ManageStorageItemsActionForm = ({ data, onChange }) => {
|
|
|
4527
4309
|
};
|
|
4528
4310
|
|
|
4529
4311
|
// src/mantine/blocks/proposal/actions-components/forms/DaoAdminExecActionForm.tsx
|
|
4530
|
-
import React60, { useState as
|
|
4531
|
-
import { Stack as
|
|
4312
|
+
import React60, { useState as useState13 } from "react";
|
|
4313
|
+
import { Stack as Stack44, TextInput as TextInput24, Button as Button10, Group as Group16, Text as Text30, Card as Card11, Textarea as Textarea12 } from "@mantine/core";
|
|
4532
4314
|
var inputStyles18 = {
|
|
4533
4315
|
label: { color: "#adb5bd" },
|
|
4534
4316
|
input: {
|
|
@@ -4541,7 +4323,7 @@ var inputStyles18 = {
|
|
|
4541
4323
|
}
|
|
4542
4324
|
};
|
|
4543
4325
|
var DaoAdminExecActionForm = ({ data, onChange }) => {
|
|
4544
|
-
const [newMsg, setNewMsg] =
|
|
4326
|
+
const [newMsg, setNewMsg] = useState13("");
|
|
4545
4327
|
const handleAddMessage = () => {
|
|
4546
4328
|
if (newMsg) {
|
|
4547
4329
|
try {
|
|
@@ -4561,7 +4343,7 @@ var DaoAdminExecActionForm = ({ data, onChange }) => {
|
|
|
4561
4343
|
msgs: (data.msgs || []).filter((_, i) => i !== index)
|
|
4562
4344
|
});
|
|
4563
4345
|
};
|
|
4564
|
-
return /* @__PURE__ */ React60.createElement(
|
|
4346
|
+
return /* @__PURE__ */ React60.createElement(Stack44, { gap: "md" }, /* @__PURE__ */ React60.createElement(
|
|
4565
4347
|
TextInput24,
|
|
4566
4348
|
{
|
|
4567
4349
|
label: "Core Address",
|
|
@@ -4571,7 +4353,7 @@ var DaoAdminExecActionForm = ({ data, onChange }) => {
|
|
|
4571
4353
|
required: true,
|
|
4572
4354
|
styles: inputStyles18
|
|
4573
4355
|
}
|
|
4574
|
-
), /* @__PURE__ */ React60.createElement(
|
|
4356
|
+
), /* @__PURE__ */ React60.createElement(Stack44, { gap: "xs" }, /* @__PURE__ */ React60.createElement(Text30, { size: "sm", fw: 500, style: { color: "#adb5bd" } }, "Messages to Execute"), (data.msgs || []).map((msg, index) => /* @__PURE__ */ React60.createElement(Card11, { key: index, withBorder: true, padding: "xs", style: { backgroundColor: "#2a2a2a", borderColor: "#333" } }, /* @__PURE__ */ React60.createElement(Group16, { justify: "space-between" }, /* @__PURE__ */ React60.createElement(Text30, { size: "sm", style: { color: "#f1f3f5" } }, "Message ", index + 1), /* @__PURE__ */ React60.createElement(Button10, { size: "xs", variant: "subtle", onClick: () => handleRemoveMessage(index), style: { color: "#ff6b6b" } }, "Remove")), /* @__PURE__ */ React60.createElement(Text30, { size: "xs", style: { color: "#adb5bd", fontFamily: "monospace" } }, JSON.stringify(msg, null, 2).substring(0, 100), "..."))), /* @__PURE__ */ React60.createElement(
|
|
4575
4357
|
Textarea12,
|
|
4576
4358
|
{
|
|
4577
4359
|
placeholder: 'Add cosmos message as JSON:\\n{"bank": {"send": {"to_address": "ixo1...", "amount": [{"denom": "uixo", "amount": "1000"}]}}}',
|
|
@@ -4581,7 +4363,7 @@ var DaoAdminExecActionForm = ({ data, onChange }) => {
|
|
|
4581
4363
|
styles: inputStyles18
|
|
4582
4364
|
}
|
|
4583
4365
|
), /* @__PURE__ */ React60.createElement(
|
|
4584
|
-
|
|
4366
|
+
Button10,
|
|
4585
4367
|
{
|
|
4586
4368
|
size: "sm",
|
|
4587
4369
|
onClick: handleAddMessage,
|
|
@@ -4596,7 +4378,7 @@ var DaoAdminExecActionForm = ({ data, onChange }) => {
|
|
|
4596
4378
|
|
|
4597
4379
|
// src/mantine/blocks/proposal/actions-components/forms/AcceptToMarketplaceActionForm.tsx
|
|
4598
4380
|
import React61 from "react";
|
|
4599
|
-
import { Stack as
|
|
4381
|
+
import { Stack as Stack45, TextInput as TextInput25 } from "@mantine/core";
|
|
4600
4382
|
var inputStyles19 = {
|
|
4601
4383
|
label: { color: "#adb5bd" },
|
|
4602
4384
|
input: {
|
|
@@ -4609,7 +4391,7 @@ var inputStyles19 = {
|
|
|
4609
4391
|
}
|
|
4610
4392
|
};
|
|
4611
4393
|
var AcceptToMarketplaceActionForm = ({ data, onChange }) => {
|
|
4612
|
-
return /* @__PURE__ */ React61.createElement(
|
|
4394
|
+
return /* @__PURE__ */ React61.createElement(Stack45, { gap: "md" }, /* @__PURE__ */ React61.createElement(TextInput25, { label: "DID", placeholder: "did:ixo:...", value: data.did, onChange: (e) => onChange({ ...data, did: e.currentTarget.value }), required: true, styles: inputStyles19 }), /* @__PURE__ */ React61.createElement(
|
|
4613
4395
|
TextInput25,
|
|
4614
4396
|
{
|
|
4615
4397
|
label: "Relayer Node DID",
|
|
@@ -4634,7 +4416,7 @@ var AcceptToMarketplaceActionForm = ({ data, onChange }) => {
|
|
|
4634
4416
|
|
|
4635
4417
|
// src/mantine/blocks/proposal/actions-components/forms/CreateEntityActionForm.tsx
|
|
4636
4418
|
import React62 from "react";
|
|
4637
|
-
import { Stack as
|
|
4419
|
+
import { Stack as Stack46, Textarea as Textarea13, Alert as Alert5, Text as Text31 } from "@mantine/core";
|
|
4638
4420
|
var inputStyles20 = {
|
|
4639
4421
|
label: { color: "#adb5bd" },
|
|
4640
4422
|
input: {
|
|
@@ -4654,7 +4436,7 @@ var CreateEntityActionForm = ({ data, onChange }) => {
|
|
|
4654
4436
|
} catch {
|
|
4655
4437
|
}
|
|
4656
4438
|
};
|
|
4657
|
-
return /* @__PURE__ */ React62.createElement(
|
|
4439
|
+
return /* @__PURE__ */ React62.createElement(Stack46, { gap: "md" }, /* @__PURE__ */ React62.createElement(Alert5, { color: "blue", style: { backgroundColor: "#2a2a2a", borderColor: "#4dabf7" } }, /* @__PURE__ */ React62.createElement(Text31, { size: "sm", style: { color: "#4dabf7" } }, "This is a complex entity creation action. Please provide the complete entity data as JSON.")), /* @__PURE__ */ React62.createElement(
|
|
4658
4440
|
Textarea13,
|
|
4659
4441
|
{
|
|
4660
4442
|
label: "Entity Data (JSON)",
|
|
@@ -4670,7 +4452,7 @@ var CreateEntityActionForm = ({ data, onChange }) => {
|
|
|
4670
4452
|
|
|
4671
4453
|
// src/mantine/blocks/proposal/actions-components/forms/UpdateVotingConfigActionForm.tsx
|
|
4672
4454
|
import React63 from "react";
|
|
4673
|
-
import { Stack as
|
|
4455
|
+
import { Stack as Stack47, Checkbox as Checkbox6, Select as Select5, NumberInput as NumberInput7, Group as Group17 } from "@mantine/core";
|
|
4674
4456
|
var inputStyles21 = {
|
|
4675
4457
|
label: { color: "#adb5bd" },
|
|
4676
4458
|
input: {
|
|
@@ -4683,7 +4465,7 @@ var inputStyles21 = {
|
|
|
4683
4465
|
}
|
|
4684
4466
|
};
|
|
4685
4467
|
var UpdateVotingConfigActionForm = ({ data, onChange }) => {
|
|
4686
|
-
return /* @__PURE__ */ React63.createElement(
|
|
4468
|
+
return /* @__PURE__ */ React63.createElement(Stack47, { gap: "md" }, /* @__PURE__ */ React63.createElement(
|
|
4687
4469
|
Checkbox6,
|
|
4688
4470
|
{
|
|
4689
4471
|
label: "Only members can execute",
|
|
@@ -4753,7 +4535,7 @@ var UpdateVotingConfigActionForm = ({ data, onChange }) => {
|
|
|
4753
4535
|
suffix: "%",
|
|
4754
4536
|
styles: inputStyles21
|
|
4755
4537
|
}
|
|
4756
|
-
)), /* @__PURE__ */ React63.createElement(
|
|
4538
|
+
)), /* @__PURE__ */ React63.createElement(Group17, { grow: true }, /* @__PURE__ */ React63.createElement(
|
|
4757
4539
|
NumberInput7,
|
|
4758
4540
|
{
|
|
4759
4541
|
label: "Proposal Duration",
|
|
@@ -4793,7 +4575,7 @@ var UpdateVotingConfigActionForm = ({ data, onChange }) => {
|
|
|
4793
4575
|
|
|
4794
4576
|
// src/mantine/blocks/proposal/actions-components/forms/UpdatePreProposeConfigActionForm.tsx
|
|
4795
4577
|
import React64 from "react";
|
|
4796
|
-
import { Stack as
|
|
4578
|
+
import { Stack as Stack48, Checkbox as Checkbox7, TextInput as TextInput26, Select as Select6, Textarea as Textarea14 } from "@mantine/core";
|
|
4797
4579
|
var inputStyles22 = {
|
|
4798
4580
|
label: { color: "#adb5bd" },
|
|
4799
4581
|
input: {
|
|
@@ -4806,7 +4588,7 @@ var inputStyles22 = {
|
|
|
4806
4588
|
}
|
|
4807
4589
|
};
|
|
4808
4590
|
var UpdatePreProposeConfigActionForm = ({ data, onChange }) => {
|
|
4809
|
-
return /* @__PURE__ */ React64.createElement(
|
|
4591
|
+
return /* @__PURE__ */ React64.createElement(Stack48, { gap: "md" }, /* @__PURE__ */ React64.createElement(
|
|
4810
4592
|
Checkbox7,
|
|
4811
4593
|
{
|
|
4812
4594
|
label: "Anyone can propose",
|
|
@@ -4907,7 +4689,7 @@ var UpdatePreProposeConfigActionForm = ({ data, onChange }) => {
|
|
|
4907
4689
|
|
|
4908
4690
|
// src/mantine/blocks/proposal/actions-components/forms/GovernanceVoteActionForm.tsx
|
|
4909
4691
|
import React65 from "react";
|
|
4910
|
-
import { Stack as
|
|
4692
|
+
import { Stack as Stack49, TextInput as TextInput27, Select as Select7 } from "@mantine/core";
|
|
4911
4693
|
var inputStyles23 = {
|
|
4912
4694
|
label: { color: "#adb5bd" },
|
|
4913
4695
|
input: {
|
|
@@ -4926,7 +4708,7 @@ var GovernanceVoteActionForm = ({ data, onChange }) => {
|
|
|
4926
4708
|
{ value: "3", label: "No" },
|
|
4927
4709
|
{ value: "4", label: "No with Veto" }
|
|
4928
4710
|
];
|
|
4929
|
-
return /* @__PURE__ */ React65.createElement(
|
|
4711
|
+
return /* @__PURE__ */ React65.createElement(Stack49, { gap: "md" }, /* @__PURE__ */ React65.createElement(
|
|
4930
4712
|
TextInput27,
|
|
4931
4713
|
{
|
|
4932
4714
|
label: "Proposal ID",
|
|
@@ -4951,7 +4733,7 @@ var GovernanceVoteActionForm = ({ data, onChange }) => {
|
|
|
4951
4733
|
|
|
4952
4734
|
// src/mantine/blocks/proposal/actions-components/forms/WithdrawTokenSwapActionForm.tsx
|
|
4953
4735
|
import React66 from "react";
|
|
4954
|
-
import { Stack as
|
|
4736
|
+
import { Stack as Stack50, TextInput as TextInput28, Checkbox as Checkbox8 } from "@mantine/core";
|
|
4955
4737
|
var inputStyles24 = {
|
|
4956
4738
|
label: { color: "#adb5bd" },
|
|
4957
4739
|
input: {
|
|
@@ -4964,7 +4746,7 @@ var inputStyles24 = {
|
|
|
4964
4746
|
}
|
|
4965
4747
|
};
|
|
4966
4748
|
var WithdrawTokenSwapActionForm = ({ data, onChange }) => {
|
|
4967
|
-
return /* @__PURE__ */ React66.createElement(
|
|
4749
|
+
return /* @__PURE__ */ React66.createElement(Stack50, { gap: "md" }, /* @__PURE__ */ React66.createElement(
|
|
4968
4750
|
Checkbox8,
|
|
4969
4751
|
{
|
|
4970
4752
|
label: "Contract chosen",
|
|
@@ -4990,7 +4772,7 @@ var WithdrawTokenSwapActionForm = ({ data, onChange }) => {
|
|
|
4990
4772
|
|
|
4991
4773
|
// src/mantine/blocks/proposal/actions-components/forms/PerformTokenSwapActionForm.tsx
|
|
4992
4774
|
import React67 from "react";
|
|
4993
|
-
import { Stack as
|
|
4775
|
+
import { Stack as Stack51, TextInput as TextInput29, Checkbox as Checkbox9, Textarea as Textarea15 } from "@mantine/core";
|
|
4994
4776
|
var inputStyles25 = {
|
|
4995
4777
|
label: { color: "#adb5bd" },
|
|
4996
4778
|
input: {
|
|
@@ -5003,7 +4785,7 @@ var inputStyles25 = {
|
|
|
5003
4785
|
}
|
|
5004
4786
|
};
|
|
5005
4787
|
var PerformTokenSwapActionForm = ({ data, onChange }) => {
|
|
5006
|
-
return /* @__PURE__ */ React67.createElement(
|
|
4788
|
+
return /* @__PURE__ */ React67.createElement(Stack51, { gap: "md" }, /* @__PURE__ */ React67.createElement(
|
|
5007
4789
|
Checkbox9,
|
|
5008
4790
|
{
|
|
5009
4791
|
label: "Contract chosen",
|
|
@@ -5061,7 +4843,7 @@ var PerformTokenSwapActionForm = ({ data, onChange }) => {
|
|
|
5061
4843
|
|
|
5062
4844
|
// src/mantine/blocks/proposal/actions-components/forms/StakeToGroupActionForm.tsx
|
|
5063
4845
|
import React68 from "react";
|
|
5064
|
-
import { Stack as
|
|
4846
|
+
import { Stack as Stack52, TextInput as TextInput30 } from "@mantine/core";
|
|
5065
4847
|
var inputStyles26 = {
|
|
5066
4848
|
label: { color: "#adb5bd" },
|
|
5067
4849
|
input: {
|
|
@@ -5074,7 +4856,7 @@ var inputStyles26 = {
|
|
|
5074
4856
|
}
|
|
5075
4857
|
};
|
|
5076
4858
|
var StakeToGroupActionForm = ({ data, onChange }) => {
|
|
5077
|
-
return /* @__PURE__ */ React68.createElement(
|
|
4859
|
+
return /* @__PURE__ */ React68.createElement(Stack52, { gap: "md" }, /* @__PURE__ */ React68.createElement(
|
|
5078
4860
|
TextInput30,
|
|
5079
4861
|
{
|
|
5080
4862
|
label: "Token Contract Address",
|
|
@@ -5099,7 +4881,7 @@ var StakeToGroupActionForm = ({ data, onChange }) => {
|
|
|
5099
4881
|
|
|
5100
4882
|
// src/mantine/blocks/proposal/actions-components/forms/SendGroupTokenActionForm.tsx
|
|
5101
4883
|
import React69 from "react";
|
|
5102
|
-
import { Stack as
|
|
4884
|
+
import { Stack as Stack53, TextInput as TextInput31 } from "@mantine/core";
|
|
5103
4885
|
var inputStyles27 = {
|
|
5104
4886
|
label: { color: "#adb5bd" },
|
|
5105
4887
|
input: {
|
|
@@ -5112,7 +4894,7 @@ var inputStyles27 = {
|
|
|
5112
4894
|
}
|
|
5113
4895
|
};
|
|
5114
4896
|
var SendGroupTokenActionForm = ({ data, onChange }) => {
|
|
5115
|
-
return /* @__PURE__ */ React69.createElement(
|
|
4897
|
+
return /* @__PURE__ */ React69.createElement(Stack53, { gap: "md" }, /* @__PURE__ */ React69.createElement(
|
|
5116
4898
|
TextInput31,
|
|
5117
4899
|
{
|
|
5118
4900
|
label: "Contract Address",
|
|
@@ -5137,7 +4919,7 @@ var SendGroupTokenActionForm = ({ data, onChange }) => {
|
|
|
5137
4919
|
|
|
5138
4920
|
// src/mantine/blocks/proposal/actions-components/forms/ValidatorActionsActionForm.tsx
|
|
5139
4921
|
import React70 from "react";
|
|
5140
|
-
import { Stack as
|
|
4922
|
+
import { Stack as Stack54, Select as Select8, Textarea as Textarea16 } from "@mantine/core";
|
|
5141
4923
|
var inputStyles28 = {
|
|
5142
4924
|
label: { color: "#adb5bd" },
|
|
5143
4925
|
input: {
|
|
@@ -5156,7 +4938,7 @@ var ValidatorActionsActionForm = ({ data, onChange }) => {
|
|
|
5156
4938
|
{ value: "/cosmos.slashing.v1beta1.MsgUnjail" /* UnjailValidator */, label: "Unjail Validator" },
|
|
5157
4939
|
{ value: "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission" /* WithdrawValidatorCommission */, label: "Withdraw Commission" }
|
|
5158
4940
|
];
|
|
5159
|
-
return /* @__PURE__ */ React70.createElement(
|
|
4941
|
+
return /* @__PURE__ */ React70.createElement(Stack54, { gap: "md" }, /* @__PURE__ */ React70.createElement(
|
|
5160
4942
|
Select8,
|
|
5161
4943
|
{
|
|
5162
4944
|
label: "Validator Action Type",
|
|
@@ -5849,8 +5631,8 @@ var ActionsPanel = ({ actions, editingIndex, onSave, onCancel, isTemplateMode =
|
|
|
5849
5631
|
const isEditing = editingIndex !== null;
|
|
5850
5632
|
const editingAction = isEditing ? actions[editingIndex] : null;
|
|
5851
5633
|
const initialActionType = editingAction?.type || "Spend";
|
|
5852
|
-
const [selectedActionType, setSelectedActionType] =
|
|
5853
|
-
const [actionData, setActionData] =
|
|
5634
|
+
const [selectedActionType, setSelectedActionType] = useState14(initialActionType);
|
|
5635
|
+
const [actionData, setActionData] = useState14(() => {
|
|
5854
5636
|
if (editingAction) {
|
|
5855
5637
|
return editingAction.data;
|
|
5856
5638
|
}
|
|
@@ -5858,8 +5640,8 @@ var ActionsPanel = ({ actions, editingIndex, onSave, onCancel, isTemplateMode =
|
|
|
5858
5640
|
return config?.getDefaultData() || {};
|
|
5859
5641
|
});
|
|
5860
5642
|
const currentActionConfig = getActionConfig(selectedActionType);
|
|
5861
|
-
const categorizedActions =
|
|
5862
|
-
|
|
5643
|
+
const categorizedActions = useMemo8(() => getCategorizedActions(), []);
|
|
5644
|
+
useEffect9(() => {
|
|
5863
5645
|
if (!isEditing) {
|
|
5864
5646
|
const config = getActionConfig(selectedActionType);
|
|
5865
5647
|
if (config) {
|
|
@@ -5882,7 +5664,7 @@ var ActionsPanel = ({ actions, editingIndex, onSave, onCancel, isTemplateMode =
|
|
|
5882
5664
|
};
|
|
5883
5665
|
const renderActionForm = () => {
|
|
5884
5666
|
if (!currentActionConfig) {
|
|
5885
|
-
return /* @__PURE__ */ React71.createElement(
|
|
5667
|
+
return /* @__PURE__ */ React71.createElement(Alert6, { color: "red", style: { backgroundColor: "#2a2a2a", borderColor: "#ff6b6b" } }, /* @__PURE__ */ React71.createElement(Text32, { size: "sm", style: { color: "#ff6b6b" } }, "Unknown action type selected"));
|
|
5886
5668
|
}
|
|
5887
5669
|
const FormComponent = currentActionConfig.FormComponent;
|
|
5888
5670
|
return /* @__PURE__ */ React71.createElement(FormComponent, { data: actionData, onChange: setActionData, isTemplateMode });
|
|
@@ -5900,7 +5682,7 @@ var ActionsPanel = ({ actions, editingIndex, onSave, onCancel, isTemplateMode =
|
|
|
5900
5682
|
};
|
|
5901
5683
|
return colors[category] || "#6b7280";
|
|
5902
5684
|
};
|
|
5903
|
-
return /* @__PURE__ */ React71.createElement(
|
|
5685
|
+
return /* @__PURE__ */ React71.createElement(Stack55, { style: { backgroundColor: "#1a1a1a", color: "#f1f3f5", height: "100%" } }, /* @__PURE__ */ React71.createElement(Text32, { size: "lg", fw: 600, style: { color: "#f1f3f5" } }, isEditing ? "Edit Action" : "Add New Action"), !isEditing ? /* @__PURE__ */ React71.createElement(Stack55, { gap: "md" }, /* @__PURE__ */ React71.createElement(Text32, { size: "sm", fw: 500, style: { color: "#adb5bd" } }, "Select Action Type"), /* @__PURE__ */ React71.createElement(
|
|
5904
5686
|
Tabs2,
|
|
5905
5687
|
{
|
|
5906
5688
|
defaultValue: ACTION_CATEGORIES[0].id,
|
|
@@ -5921,9 +5703,9 @@ var ActionsPanel = ({ actions, editingIndex, onSave, onCancel, isTemplateMode =
|
|
|
5921
5703
|
panel: { paddingTop: "md" }
|
|
5922
5704
|
}
|
|
5923
5705
|
},
|
|
5924
|
-
/* @__PURE__ */ React71.createElement(Tabs2.List, null, ACTION_CATEGORIES.map((category) => /* @__PURE__ */ React71.createElement(Tabs2.Tab, { key: category.id, value: category.id }, /* @__PURE__ */ React71.createElement(
|
|
5706
|
+
/* @__PURE__ */ React71.createElement(Tabs2.List, null, ACTION_CATEGORIES.map((category) => /* @__PURE__ */ React71.createElement(Tabs2.Tab, { key: category.id, value: category.id }, /* @__PURE__ */ React71.createElement(Group18, { gap: "xs" }, /* @__PURE__ */ React71.createElement("span", null, category.icon), /* @__PURE__ */ React71.createElement("span", null, category.label))))),
|
|
5925
5707
|
ACTION_CATEGORIES.map((category) => /* @__PURE__ */ React71.createElement(Tabs2.Panel, { key: category.id, value: category.id }, /* @__PURE__ */ React71.createElement(SimpleGrid, { cols: 2, spacing: "xs" }, (categorizedActions.get(category.id) || []).map((config) => /* @__PURE__ */ React71.createElement(
|
|
5926
|
-
|
|
5708
|
+
Paper3,
|
|
5927
5709
|
{
|
|
5928
5710
|
key: config.value,
|
|
5929
5711
|
withBorder: true,
|
|
@@ -5936,10 +5718,10 @@ var ActionsPanel = ({ actions, editingIndex, onSave, onCancel, isTemplateMode =
|
|
|
5936
5718
|
},
|
|
5937
5719
|
onClick: () => setSelectedActionType(config.value)
|
|
5938
5720
|
},
|
|
5939
|
-
/* @__PURE__ */ React71.createElement(
|
|
5721
|
+
/* @__PURE__ */ React71.createElement(Stack55, { gap: "xs" }, /* @__PURE__ */ React71.createElement(Group18, { justify: "space-between" }, /* @__PURE__ */ React71.createElement(Text32, { size: "sm", fw: 500, style: { color: "#f1f3f5" } }, config.label), selectedActionType === config.value && /* @__PURE__ */ React71.createElement(Badge8, { size: "xs", style: { backgroundColor: "#4dabf7" } }, "Selected")), config.description && /* @__PURE__ */ React71.createElement(Text32, { size: "xs", style: { color: "#adb5bd" } }, config.description))
|
|
5940
5722
|
)))))
|
|
5941
5723
|
)) : /* @__PURE__ */ React71.createElement(
|
|
5942
|
-
|
|
5724
|
+
Card12,
|
|
5943
5725
|
{
|
|
5944
5726
|
withBorder: true,
|
|
5945
5727
|
p: "sm",
|
|
@@ -5948,8 +5730,8 @@ var ActionsPanel = ({ actions, editingIndex, onSave, onCancel, isTemplateMode =
|
|
|
5948
5730
|
borderColor: "#333"
|
|
5949
5731
|
}
|
|
5950
5732
|
},
|
|
5951
|
-
/* @__PURE__ */ React71.createElement(
|
|
5952
|
-
|
|
5733
|
+
/* @__PURE__ */ React71.createElement(Group18, { justify: "space-between" }, /* @__PURE__ */ React71.createElement(Group18, { gap: "xs" }, /* @__PURE__ */ React71.createElement(
|
|
5734
|
+
Badge8,
|
|
5953
5735
|
{
|
|
5954
5736
|
size: "sm",
|
|
5955
5737
|
style: {
|
|
@@ -5958,11 +5740,11 @@ var ActionsPanel = ({ actions, editingIndex, onSave, onCancel, isTemplateMode =
|
|
|
5958
5740
|
}
|
|
5959
5741
|
},
|
|
5960
5742
|
currentActionConfig?.label || selectedActionType
|
|
5961
|
-
), /* @__PURE__ */ React71.createElement(
|
|
5962
|
-
), /* @__PURE__ */ React71.createElement(Divider3, { color: "#333" }), /* @__PURE__ */ React71.createElement(ScrollArea3, { style: { flex: 1 } }, renderActionForm()), /* @__PURE__ */ React71.createElement(Divider3, { color: "#333" }), /* @__PURE__ */ React71.createElement(
|
|
5743
|
+
), /* @__PURE__ */ React71.createElement(Text32, { size: "sm", style: { color: "#adb5bd" } }, "(Editing)")))
|
|
5744
|
+
), /* @__PURE__ */ React71.createElement(Divider3, { color: "#333" }), /* @__PURE__ */ React71.createElement(ScrollArea3, { style: { flex: 1 } }, renderActionForm()), /* @__PURE__ */ React71.createElement(Divider3, { color: "#333" }), /* @__PURE__ */ React71.createElement(Stack55, { gap: "xs" }, /* @__PURE__ */ React71.createElement(Text32, { size: "sm", fw: 500, style: { color: "#adb5bd" } }, "Current Actions (", actions.length, ")"), /* @__PURE__ */ React71.createElement(ScrollArea3, { h: 100 }, /* @__PURE__ */ React71.createElement(Stack55, { gap: "xs" }, actions.map((action, index) => {
|
|
5963
5745
|
const config = getActionConfig(action.type);
|
|
5964
5746
|
return /* @__PURE__ */ React71.createElement(
|
|
5965
|
-
|
|
5747
|
+
Card12,
|
|
5966
5748
|
{
|
|
5967
5749
|
key: index,
|
|
5968
5750
|
withBorder: true,
|
|
@@ -5974,8 +5756,8 @@ var ActionsPanel = ({ actions, editingIndex, onSave, onCancel, isTemplateMode =
|
|
|
5974
5756
|
opacity: index === editingIndex ? 0.7 : 1
|
|
5975
5757
|
}
|
|
5976
5758
|
},
|
|
5977
|
-
/* @__PURE__ */ React71.createElement(
|
|
5978
|
-
|
|
5759
|
+
/* @__PURE__ */ React71.createElement(Group18, { gap: "xs" }, /* @__PURE__ */ React71.createElement(
|
|
5760
|
+
Badge8,
|
|
5979
5761
|
{
|
|
5980
5762
|
size: "sm",
|
|
5981
5763
|
style: {
|
|
@@ -5984,10 +5766,10 @@ var ActionsPanel = ({ actions, editingIndex, onSave, onCancel, isTemplateMode =
|
|
|
5984
5766
|
}
|
|
5985
5767
|
},
|
|
5986
5768
|
config?.label || action.type
|
|
5987
|
-
), /* @__PURE__ */ React71.createElement(
|
|
5769
|
+
), /* @__PURE__ */ React71.createElement(Text32, { size: "sm", style: { color: "#adb5bd" } }, config?.getSummary(action.data) || "Action"), index === editingIndex && /* @__PURE__ */ React71.createElement(Badge8, { size: "xs", style: { backgroundColor: "#4dabf7", color: "#fff" } }, "Editing"))
|
|
5988
5770
|
);
|
|
5989
|
-
})))), /* @__PURE__ */ React71.createElement(
|
|
5990
|
-
|
|
5771
|
+
})))), /* @__PURE__ */ React71.createElement(Group18, { justify: "flex-end", mt: "md" }, /* @__PURE__ */ React71.createElement(
|
|
5772
|
+
Button11,
|
|
5991
5773
|
{
|
|
5992
5774
|
variant: "default",
|
|
5993
5775
|
onClick: onCancel,
|
|
@@ -6002,7 +5784,7 @@ var ActionsPanel = ({ actions, editingIndex, onSave, onCancel, isTemplateMode =
|
|
|
6002
5784
|
},
|
|
6003
5785
|
"Cancel"
|
|
6004
5786
|
), /* @__PURE__ */ React71.createElement(
|
|
6005
|
-
|
|
5787
|
+
Button11,
|
|
6006
5788
|
{
|
|
6007
5789
|
onClick: handleSave,
|
|
6008
5790
|
disabled: !currentActionConfig,
|
|
@@ -6023,8 +5805,8 @@ var ActionsPanel = ({ actions, editingIndex, onSave, onCancel, isTemplateMode =
|
|
|
6023
5805
|
|
|
6024
5806
|
// src/mantine/blocks/proposal/template/ActionsTab.tsx
|
|
6025
5807
|
var ActionsTab = ({ actions, onActionsChange, editor, block }) => {
|
|
6026
|
-
const [isEditorVisible, setIsEditorVisible] =
|
|
6027
|
-
const [editingIndex, setEditingIndex] =
|
|
5808
|
+
const [isEditorVisible, setIsEditorVisible] = useState15(false);
|
|
5809
|
+
const [editingIndex, setEditingIndex] = useState15(null);
|
|
6028
5810
|
const parseActions = (actionsJson) => {
|
|
6029
5811
|
if (!actionsJson) return [];
|
|
6030
5812
|
try {
|
|
@@ -6035,28 +5817,28 @@ var ActionsTab = ({ actions, onActionsChange, editor, block }) => {
|
|
|
6035
5817
|
}
|
|
6036
5818
|
};
|
|
6037
5819
|
const currentActions = parseActions(actions);
|
|
6038
|
-
|
|
5820
|
+
useEffect10(() => {
|
|
6039
5821
|
if (currentActions.length === 0 && !isEditorVisible) {
|
|
6040
5822
|
setEditingIndex(null);
|
|
6041
5823
|
setIsEditorVisible(true);
|
|
6042
5824
|
}
|
|
6043
5825
|
}, [currentActions.length, isEditorVisible]);
|
|
6044
|
-
const handleAddAction =
|
|
5826
|
+
const handleAddAction = useCallback11(() => {
|
|
6045
5827
|
setEditingIndex(null);
|
|
6046
5828
|
setIsEditorVisible(true);
|
|
6047
5829
|
}, []);
|
|
6048
|
-
const handleEditAction =
|
|
5830
|
+
const handleEditAction = useCallback11((index) => {
|
|
6049
5831
|
setEditingIndex(index);
|
|
6050
5832
|
setIsEditorVisible(true);
|
|
6051
5833
|
}, []);
|
|
6052
|
-
const handleRemoveAction =
|
|
5834
|
+
const handleRemoveAction = useCallback11(
|
|
6053
5835
|
(index) => {
|
|
6054
5836
|
const newActions = currentActions.filter((_, i) => i !== index);
|
|
6055
5837
|
onActionsChange(newActions);
|
|
6056
5838
|
},
|
|
6057
5839
|
[currentActions, onActionsChange]
|
|
6058
5840
|
);
|
|
6059
|
-
const handleSaveAction =
|
|
5841
|
+
const handleSaveAction = useCallback11(
|
|
6060
5842
|
(action) => {
|
|
6061
5843
|
let newActions;
|
|
6062
5844
|
if (editingIndex !== null) {
|
|
@@ -6070,12 +5852,12 @@ var ActionsTab = ({ actions, onActionsChange, editor, block }) => {
|
|
|
6070
5852
|
},
|
|
6071
5853
|
[editingIndex, currentActions, onActionsChange]
|
|
6072
5854
|
);
|
|
6073
|
-
const handleCancelEditor =
|
|
5855
|
+
const handleCancelEditor = useCallback11(() => {
|
|
6074
5856
|
setIsEditorVisible(false);
|
|
6075
5857
|
setEditingIndex(null);
|
|
6076
5858
|
}, []);
|
|
6077
|
-
return /* @__PURE__ */ React72.createElement(
|
|
6078
|
-
|
|
5859
|
+
return /* @__PURE__ */ React72.createElement(Stack56, { gap: "md" }, /* @__PURE__ */ React72.createElement(
|
|
5860
|
+
Button12,
|
|
6079
5861
|
{
|
|
6080
5862
|
onClick: handleAddAction,
|
|
6081
5863
|
style: {
|
|
@@ -6088,7 +5870,7 @@ var ActionsTab = ({ actions, onActionsChange, editor, block }) => {
|
|
|
6088
5870
|
"Add Action"
|
|
6089
5871
|
), /* @__PURE__ */ React72.createElement(ActionsCard, { actions: currentActions, isSelected: false, onClick: () => {
|
|
6090
5872
|
}, onEditAction: handleEditAction, onRemoveAction: handleRemoveAction }), isEditorVisible && /* @__PURE__ */ React72.createElement(
|
|
6091
|
-
|
|
5873
|
+
Card13,
|
|
6092
5874
|
{
|
|
6093
5875
|
withBorder: true,
|
|
6094
5876
|
padding: "lg",
|
|
@@ -6104,15 +5886,15 @@ var ActionsTab = ({ actions, onActionsChange, editor, block }) => {
|
|
|
6104
5886
|
|
|
6105
5887
|
// src/mantine/blocks/proposal/template/VoteTab.tsx
|
|
6106
5888
|
import React73 from "react";
|
|
6107
|
-
import { Stack as
|
|
5889
|
+
import { Stack as Stack57, TextInput as TextInput32 } from "@mantine/core";
|
|
6108
5890
|
var VoteTab = ({ voteTitle, voteSubtitle, voteIcon, onVoteTitleChange, onVoteSubtitleChange, onVoteIconChange }) => {
|
|
6109
|
-
return /* @__PURE__ */ React73.createElement(
|
|
5891
|
+
return /* @__PURE__ */ React73.createElement(Stack57, { gap: "md" }, /* @__PURE__ */ React73.createElement(TextInput32, { label: "Vote Button Title", placeholder: "Vote on this proposal", value: voteTitle, onChange: (event) => onVoteTitleChange(event.currentTarget.value) }), /* @__PURE__ */ React73.createElement(TextInput32, { label: "Vote Button Subtitle", placeholder: "Cast your vote", value: voteSubtitle, onChange: (event) => onVoteSubtitleChange(event.currentTarget.value) }), /* @__PURE__ */ React73.createElement(TextInput32, { label: "Vote Icon", placeholder: "checklist", value: voteIcon, onChange: (event) => onVoteIconChange(event.currentTarget.value) }));
|
|
6110
5892
|
};
|
|
6111
5893
|
|
|
6112
5894
|
// src/mantine/blocks/proposal/template/TemplateConfig.tsx
|
|
6113
|
-
var
|
|
5895
|
+
var TemplateConfig3 = ({ editor, block }) => {
|
|
6114
5896
|
const { closePanel } = usePanelStore();
|
|
6115
|
-
const updateProp =
|
|
5897
|
+
const updateProp = useCallback12(
|
|
6116
5898
|
(key, value) => {
|
|
6117
5899
|
editor.updateBlock(block, {
|
|
6118
5900
|
props: {
|
|
@@ -6124,7 +5906,7 @@ var TemplateConfig2 = ({ editor, block }) => {
|
|
|
6124
5906
|
[editor, block]
|
|
6125
5907
|
);
|
|
6126
5908
|
return /* @__PURE__ */ React74.createElement(
|
|
6127
|
-
|
|
5909
|
+
Paper4,
|
|
6128
5910
|
{
|
|
6129
5911
|
p: "md",
|
|
6130
5912
|
shadow: "sm",
|
|
@@ -6144,8 +5926,8 @@ var TemplateConfig2 = ({ editor, block }) => {
|
|
|
6144
5926
|
marginBottom: "1rem"
|
|
6145
5927
|
}
|
|
6146
5928
|
},
|
|
6147
|
-
/* @__PURE__ */ React74.createElement(
|
|
6148
|
-
/* @__PURE__ */ React74.createElement(
|
|
5929
|
+
/* @__PURE__ */ React74.createElement(Title3, { order: 3 }, "Proposal Settings"),
|
|
5930
|
+
/* @__PURE__ */ React74.createElement(CloseButton3, { onClick: closePanel })
|
|
6149
5931
|
),
|
|
6150
5932
|
/* @__PURE__ */ React74.createElement(
|
|
6151
5933
|
ReusablePanel,
|
|
@@ -6155,7 +5937,7 @@ var TemplateConfig2 = ({ editor, block }) => {
|
|
|
6155
5937
|
label: "General",
|
|
6156
5938
|
value: "general",
|
|
6157
5939
|
content: /* @__PURE__ */ React74.createElement(
|
|
6158
|
-
|
|
5940
|
+
GeneralTab3,
|
|
6159
5941
|
{
|
|
6160
5942
|
title: block.props.title || "",
|
|
6161
5943
|
description: block.props.description || "",
|
|
@@ -6192,21 +5974,21 @@ var TemplateConfig2 = ({ editor, block }) => {
|
|
|
6192
5974
|
};
|
|
6193
5975
|
|
|
6194
5976
|
// src/mantine/blocks/proposal/template/TemplateView.tsx
|
|
6195
|
-
import { Card as
|
|
5977
|
+
import { Card as Card14, Group as Group19, Stack as Stack58, Text as Text33, ActionIcon as ActionIcon7 } from "@mantine/core";
|
|
6196
5978
|
var PROPOSAL_TEMPLATE_PANEL_ID = "proposal-template-panel";
|
|
6197
5979
|
var ProposalTemplateView = ({ editor, block }) => {
|
|
6198
5980
|
const panelId = `${PROPOSAL_TEMPLATE_PANEL_ID}-${block.id}`;
|
|
6199
|
-
const panelContent =
|
|
5981
|
+
const panelContent = useMemo9(() => /* @__PURE__ */ React75.createElement(TemplateConfig3, { editor, block }), [editor, block]);
|
|
6200
5982
|
const { open } = usePanel(panelId, panelContent);
|
|
6201
|
-
return /* @__PURE__ */ React75.createElement(
|
|
5983
|
+
return /* @__PURE__ */ React75.createElement(Card14, { withBorder: true, padding: "md", radius: "md", style: { width: "100%", cursor: "pointer" }, onClick: open }, /* @__PURE__ */ React75.createElement(Group19, { wrap: "nowrap", justify: "space-between", align: "center" }, /* @__PURE__ */ React75.createElement(Group19, { wrap: "nowrap", align: "center" }, /* @__PURE__ */ React75.createElement(ActionIcon7, { variant: "light", color: "blue", size: "lg", radius: "xl", style: { flexShrink: 0 } }, getIcon(block.props.icon, 18, 1.5, "file-text")), /* @__PURE__ */ React75.createElement(Stack58, { gap: "xs", style: { flex: 1 } }, /* @__PURE__ */ React75.createElement(Text33, { fw: 500, size: "sm", contentEditable: false }, block.props.title || "Proposal Title"), /* @__PURE__ */ React75.createElement(Text33, { size: "xs", c: "dimmed", contentEditable: false }, block.props.description || "Proposal description"))), /* @__PURE__ */ React75.createElement(Text33, { size: "xs", c: "dimmed", contentEditable: false }, block.props.status || "draft")));
|
|
6202
5984
|
};
|
|
6203
5985
|
|
|
6204
5986
|
// src/mantine/blocks/proposal/flow/FlowView.tsx
|
|
6205
|
-
import React80, { useMemo as
|
|
5987
|
+
import React80, { useMemo as useMemo10 } from "react";
|
|
6206
5988
|
|
|
6207
5989
|
// src/mantine/blocks/proposal/components/OnChainProposalCard.tsx
|
|
6208
5990
|
import React76 from "react";
|
|
6209
|
-
import { Card as
|
|
5991
|
+
import { Card as Card15, Group as Group20, Stack as Stack59, Text as Text34, Skeleton, Badge as Badge9, Button as Button13, ActionIcon as ActionIcon8 } from "@mantine/core";
|
|
6210
5992
|
var statusColor = {
|
|
6211
5993
|
open: "#4dabf7",
|
|
6212
5994
|
passed: "#51cf66",
|
|
@@ -6236,7 +6018,7 @@ var OnChainProposalCard = ({
|
|
|
6236
6018
|
voteEnabled = false
|
|
6237
6019
|
}) => {
|
|
6238
6020
|
return /* @__PURE__ */ React76.createElement(
|
|
6239
|
-
|
|
6021
|
+
Card15,
|
|
6240
6022
|
{
|
|
6241
6023
|
shadow: "sm",
|
|
6242
6024
|
padding: "lg",
|
|
@@ -6248,10 +6030,10 @@ var OnChainProposalCard = ({
|
|
|
6248
6030
|
},
|
|
6249
6031
|
onClick
|
|
6250
6032
|
},
|
|
6251
|
-
isFetching && /* @__PURE__ */ React76.createElement(
|
|
6252
|
-
error && /* @__PURE__ */ React76.createElement(
|
|
6253
|
-
!isFetching && /* @__PURE__ */ React76.createElement(
|
|
6254
|
-
|
|
6033
|
+
isFetching && /* @__PURE__ */ React76.createElement(Stack59, null, /* @__PURE__ */ React76.createElement(Skeleton, { height: 20, width: "70%" }), /* @__PURE__ */ React76.createElement(Skeleton, { height: 16 }), /* @__PURE__ */ React76.createElement(Skeleton, { height: 16, width: "40%" })),
|
|
6034
|
+
error && /* @__PURE__ */ React76.createElement(Text34, { size: "sm", c: "red" }, typeof error === "string" ? error : error.message || "An error occurred while loading the proposal."),
|
|
6035
|
+
!isFetching && /* @__PURE__ */ React76.createElement(Group20, { justify: "space-between", align: "flex-start" }, /* @__PURE__ */ React76.createElement(Group20, { align: "flex-start", gap: "md", style: { flex: 1 } }, /* @__PURE__ */ React76.createElement(ActionIcon8, { variant: "light", color: "blue", size: "xl", radius: "xl", style: { flexShrink: 0 } }, getIcon(icon, 24, 1.5, "file-text")), /* @__PURE__ */ React76.createElement(Stack59, { gap: "xs", style: { flex: 1 } }, /* @__PURE__ */ React76.createElement(Group20, { gap: "xs" }, /* @__PURE__ */ React76.createElement(Text34, { size: "md", fw: 600 }, title || "Proposal"), /* @__PURE__ */ React76.createElement(Badge9, { color: statusColor[status], variant: "filled", size: "sm", radius: "sm" }, status.replace(/_/g, " ").toUpperCase())), /* @__PURE__ */ React76.createElement(Text34, { size: "sm", c: "dimmed" }, getDisplayDescription(description)))), /* @__PURE__ */ React76.createElement(Group20, { gap: "xs" }, voteEnabled && onVote && status === "open" && /* @__PURE__ */ React76.createElement(
|
|
6036
|
+
Button13,
|
|
6255
6037
|
{
|
|
6256
6038
|
size: "sm",
|
|
6257
6039
|
variant: "filled",
|
|
@@ -6264,7 +6046,7 @@ var OnChainProposalCard = ({
|
|
|
6264
6046
|
},
|
|
6265
6047
|
"Vote"
|
|
6266
6048
|
), status === "passed" && onExecute && /* @__PURE__ */ React76.createElement(
|
|
6267
|
-
|
|
6049
|
+
Button13,
|
|
6268
6050
|
{
|
|
6269
6051
|
size: "sm",
|
|
6270
6052
|
variant: "filled",
|
|
@@ -6282,11 +6064,11 @@ var OnChainProposalCard = ({
|
|
|
6282
6064
|
};
|
|
6283
6065
|
|
|
6284
6066
|
// src/mantine/blocks/proposal/flow/FlowConfig.tsx
|
|
6285
|
-
import React79, { useCallback as
|
|
6286
|
-
import { Paper as
|
|
6067
|
+
import React79, { useCallback as useCallback14, useState as useState20 } from "react";
|
|
6068
|
+
import { Paper as Paper5, CloseButton as CloseButton4, Title as Title4, Stack as Stack62, TextInput as TextInput33, Textarea as Textarea18, Button as Button16, Text as Text37, Card as Card18 } from "@mantine/core";
|
|
6287
6069
|
|
|
6288
6070
|
// src/mantine/blocks/proposal/flow/useFlowBusinessLogic.ts
|
|
6289
|
-
import { useEffect as
|
|
6071
|
+
import { useEffect as useEffect11, useState as useState16 } from "react";
|
|
6290
6072
|
var CHAIN_STATUSES = ["open", "passed", "rejected", "executed", "closed", "execution_failed", "veto_timelock"];
|
|
6291
6073
|
var isChainStatus = (value) => {
|
|
6292
6074
|
return CHAIN_STATUSES.includes(value);
|
|
@@ -6298,9 +6080,9 @@ var parseStatus = (value) => {
|
|
|
6298
6080
|
var useFlowBusinessLogic = ({ block, editor }) => {
|
|
6299
6081
|
const { blockRequirements } = useBlocknoteContext();
|
|
6300
6082
|
const coreAddress = blockRequirements?.proposal?.coreAddress;
|
|
6301
|
-
const [proposalContractAddress, setProposalContractAddress] =
|
|
6302
|
-
const [isExecuting, setIsExecuting] =
|
|
6303
|
-
const [executionError, setExecutionError] =
|
|
6083
|
+
const [proposalContractAddress, setProposalContractAddress] = useState16(null);
|
|
6084
|
+
const [isExecuting, setIsExecuting] = useState16(false);
|
|
6085
|
+
const [executionError, setExecutionError] = useState16(null);
|
|
6304
6086
|
let handlers = null;
|
|
6305
6087
|
try {
|
|
6306
6088
|
handlers = useBlocknoteHandlers();
|
|
@@ -6330,7 +6112,7 @@ var useFlowBusinessLogic = ({ block, editor }) => {
|
|
|
6330
6112
|
props: { ...block.props, ...nextProps }
|
|
6331
6113
|
});
|
|
6332
6114
|
};
|
|
6333
|
-
|
|
6115
|
+
useEffect11(() => {
|
|
6334
6116
|
if (!handlers || !coreAddress || !proposalId) {
|
|
6335
6117
|
setProposalContractAddress(null);
|
|
6336
6118
|
return;
|
|
@@ -6353,7 +6135,7 @@ var useFlowBusinessLogic = ({ block, editor }) => {
|
|
|
6353
6135
|
isCancelled = true;
|
|
6354
6136
|
};
|
|
6355
6137
|
}, [handlers, coreAddress, proposalId]);
|
|
6356
|
-
|
|
6138
|
+
useEffect11(() => {
|
|
6357
6139
|
if (!proposal) return;
|
|
6358
6140
|
const chainStatus = proposal.proposal.status;
|
|
6359
6141
|
const parsedStatus = parseStatus(chainStatus);
|
|
@@ -6447,13 +6229,13 @@ var useFlowBusinessLogic = ({ block, editor }) => {
|
|
|
6447
6229
|
};
|
|
6448
6230
|
|
|
6449
6231
|
// src/mantine/blocks/proposal/flow/useVoteBusinessLogic.ts
|
|
6450
|
-
import { useState as
|
|
6232
|
+
import { useState as useState17, useEffect as useEffect12 } from "react";
|
|
6451
6233
|
var useVoteBusinessLogic = ({ block, editor }) => {
|
|
6452
6234
|
const { blockRequirements } = useBlocknoteContext();
|
|
6453
6235
|
const coreAddress = blockRequirements?.proposal?.coreAddress;
|
|
6454
|
-
const [localError, setLocalError] =
|
|
6455
|
-
const [userVote, setUserVote] =
|
|
6456
|
-
const [proposalContractAddress, setProposalContractAddress] =
|
|
6236
|
+
const [localError, setLocalError] = useState17(null);
|
|
6237
|
+
const [userVote, setUserVote] = useState17(null);
|
|
6238
|
+
const [proposalContractAddress, setProposalContractAddress] = useState17(null);
|
|
6457
6239
|
let handlers = null;
|
|
6458
6240
|
try {
|
|
6459
6241
|
handlers = useBlocknoteHandlers();
|
|
@@ -6464,7 +6246,7 @@ var useVoteBusinessLogic = ({ block, editor }) => {
|
|
|
6464
6246
|
const title = block.props.title || "";
|
|
6465
6247
|
const description = block.props.description || "";
|
|
6466
6248
|
const status = block.props.status || "draft";
|
|
6467
|
-
|
|
6249
|
+
useEffect12(() => {
|
|
6468
6250
|
if (!handlers || !coreAddress || !proposalId) {
|
|
6469
6251
|
setProposalContractAddress(null);
|
|
6470
6252
|
return;
|
|
@@ -6487,7 +6269,7 @@ var useVoteBusinessLogic = ({ block, editor }) => {
|
|
|
6487
6269
|
isCancelled = true;
|
|
6488
6270
|
};
|
|
6489
6271
|
}, [handlers, coreAddress, proposalId]);
|
|
6490
|
-
|
|
6272
|
+
useEffect12(() => {
|
|
6491
6273
|
if (!handlers || !proposalContractAddress || !proposalId) {
|
|
6492
6274
|
return;
|
|
6493
6275
|
}
|
|
@@ -6535,8 +6317,8 @@ var useVoteBusinessLogic = ({ block, editor }) => {
|
|
|
6535
6317
|
};
|
|
6536
6318
|
|
|
6537
6319
|
// src/mantine/blocks/proposal/flow/VoteGeneralTab.tsx
|
|
6538
|
-
import React77, { useState as
|
|
6539
|
-
import { Stack as
|
|
6320
|
+
import React77, { useState as useState18 } from "react";
|
|
6321
|
+
import { Stack as Stack60, Text as Text35, Group as Group21, Card as Card16, Button as Button14, Progress as Progress2, Box as Box14, Textarea as Textarea17, Tooltip as Tooltip3 } from "@mantine/core";
|
|
6540
6322
|
var getVoteIcon = (voteType) => {
|
|
6541
6323
|
switch (voteType) {
|
|
6542
6324
|
case "yes":
|
|
@@ -6562,8 +6344,8 @@ var FlowGeneralTab = ({
|
|
|
6562
6344
|
isDisabled
|
|
6563
6345
|
}) => {
|
|
6564
6346
|
const disabled = isDisabled?.isDisabled === "disable";
|
|
6565
|
-
const [selectedVote, setSelectedVote] =
|
|
6566
|
-
const [rationale, setRationale] =
|
|
6347
|
+
const [selectedVote, setSelectedVote] = useState18("");
|
|
6348
|
+
const [rationale, setRationale] = useState18("");
|
|
6567
6349
|
const hasSubmittedProposal = Boolean(proposalId);
|
|
6568
6350
|
const hasVoted = Boolean(userVote?.vote);
|
|
6569
6351
|
const handleSlideToSign = () => {
|
|
@@ -6578,8 +6360,8 @@ var FlowGeneralTab = ({
|
|
|
6578
6360
|
setRationale("");
|
|
6579
6361
|
}
|
|
6580
6362
|
};
|
|
6581
|
-
return /* @__PURE__ */ React77.createElement(
|
|
6582
|
-
|
|
6363
|
+
return /* @__PURE__ */ React77.createElement(Stack60, { gap: "lg" }, !hasSubmittedProposal && /* @__PURE__ */ React77.createElement(
|
|
6364
|
+
Card16,
|
|
6583
6365
|
{
|
|
6584
6366
|
padding: "md",
|
|
6585
6367
|
radius: "md",
|
|
@@ -6589,8 +6371,8 @@ var FlowGeneralTab = ({
|
|
|
6589
6371
|
color: "#f1f3f5"
|
|
6590
6372
|
}
|
|
6591
6373
|
},
|
|
6592
|
-
/* @__PURE__ */ React77.createElement(
|
|
6593
|
-
|
|
6374
|
+
/* @__PURE__ */ React77.createElement(Group21, { gap: "xs", align: "center" }, /* @__PURE__ */ React77.createElement(
|
|
6375
|
+
Box14,
|
|
6594
6376
|
{
|
|
6595
6377
|
style: {
|
|
6596
6378
|
width: 8,
|
|
@@ -6599,10 +6381,10 @@ var FlowGeneralTab = ({
|
|
|
6599
6381
|
borderRadius: "50%"
|
|
6600
6382
|
}
|
|
6601
6383
|
}
|
|
6602
|
-
), /* @__PURE__ */ React77.createElement(
|
|
6603
|
-
/* @__PURE__ */ React77.createElement(
|
|
6384
|
+
), /* @__PURE__ */ React77.createElement(Text35, { size: "sm", fw: 500, style: { color: "#ffd43b" } }, "Waiting for Proposal Submission")),
|
|
6385
|
+
/* @__PURE__ */ React77.createElement(Text35, { size: "xs", style: { color: "#adb5bd", marginTop: 4 } }, "The connected proposal needs to be submitted before voting can begin.")
|
|
6604
6386
|
), /* @__PURE__ */ React77.createElement(
|
|
6605
|
-
|
|
6387
|
+
Card16,
|
|
6606
6388
|
{
|
|
6607
6389
|
padding: "lg",
|
|
6608
6390
|
radius: "md",
|
|
@@ -6613,8 +6395,8 @@ var FlowGeneralTab = ({
|
|
|
6613
6395
|
opacity: !hasSubmittedProposal ? 0.6 : 1
|
|
6614
6396
|
}
|
|
6615
6397
|
},
|
|
6616
|
-
/* @__PURE__ */ React77.createElement(
|
|
6617
|
-
|
|
6398
|
+
/* @__PURE__ */ React77.createElement(Stack60, { gap: "xs" }, /* @__PURE__ */ React77.createElement(Group21, { justify: "space-between" }, /* @__PURE__ */ React77.createElement(Group21, { gap: "xs" }, /* @__PURE__ */ React77.createElement(
|
|
6399
|
+
Box14,
|
|
6618
6400
|
{
|
|
6619
6401
|
w: 8,
|
|
6620
6402
|
h: 8,
|
|
@@ -6623,8 +6405,8 @@ var FlowGeneralTab = ({
|
|
|
6623
6405
|
borderRadius: "50%"
|
|
6624
6406
|
}
|
|
6625
6407
|
}
|
|
6626
|
-
), /* @__PURE__ */ React77.createElement(
|
|
6627
|
-
|
|
6408
|
+
), /* @__PURE__ */ React77.createElement(Text35, { size: "sm", style: { color: "#adb5bd" } }, "Status")), /* @__PURE__ */ React77.createElement(Text35, { size: "sm", fw: 500, style: { color: "#f1f3f5" } }, hasSubmittedProposal ? proposalStatus === "open" ? "Active" : proposalStatus || "Active" : "Waiting")), /* @__PURE__ */ React77.createElement(Group21, { justify: "space-between" }, /* @__PURE__ */ React77.createElement(Group21, { gap: "xs" }, /* @__PURE__ */ React77.createElement(Box14, { w: 8, h: 8, style: { backgroundColor: "#adb5bd", borderRadius: "50%" } }), /* @__PURE__ */ React77.createElement(Text35, { size: "sm", style: { color: "#adb5bd" } }, "Proposal ID")), /* @__PURE__ */ React77.createElement(Text35, { size: "sm", fw: 500, style: { color: "#f1f3f5" } }, hasSubmittedProposal ? `#${proposalId}` : "TBD")), /* @__PURE__ */ React77.createElement(Group21, { justify: "space-between" }, /* @__PURE__ */ React77.createElement(Group21, { gap: "xs" }, /* @__PURE__ */ React77.createElement(Box14, { w: 8, h: 8, style: { backgroundColor: "#adb5bd", borderRadius: "50%" } }), /* @__PURE__ */ React77.createElement(Text35, { size: "sm", style: { color: "#adb5bd" } }, "Title")), /* @__PURE__ */ React77.createElement(
|
|
6409
|
+
Text35,
|
|
6628
6410
|
{
|
|
6629
6411
|
size: "sm",
|
|
6630
6412
|
fw: 500,
|
|
@@ -6633,8 +6415,8 @@ var FlowGeneralTab = ({
|
|
|
6633
6415
|
}
|
|
6634
6416
|
},
|
|
6635
6417
|
hasSubmittedProposal ? proposalTitle || "Untitled" : "N/A"
|
|
6636
|
-
)), /* @__PURE__ */ React77.createElement(
|
|
6637
|
-
/* @__PURE__ */ React77.createElement(
|
|
6418
|
+
)), /* @__PURE__ */ React77.createElement(Group21, { justify: "space-between" }, /* @__PURE__ */ React77.createElement(Group21, { gap: "xs" }, /* @__PURE__ */ React77.createElement(Box14, { w: 8, h: 8, style: { backgroundColor: "#adb5bd", borderRadius: "50%" } }), /* @__PURE__ */ React77.createElement(Text35, { size: "sm", style: { color: "#adb5bd" } }, "Description")), /* @__PURE__ */ React77.createElement(Text35, { size: "sm", fw: 500, style: { color: "#f1f3f5" }, title: proposalDescription }, hasSubmittedProposal ? proposalDescription ? proposalDescription.length > 30 ? proposalDescription.substring(0, 30) + "..." : proposalDescription : "No description" : "N/A")), /* @__PURE__ */ React77.createElement(Group21, { justify: "space-between" }, /* @__PURE__ */ React77.createElement(Group21, { gap: "xs" }, /* @__PURE__ */ React77.createElement(Box14, { w: 8, h: 8, style: { backgroundColor: "#adb5bd", borderRadius: "50%" } }), /* @__PURE__ */ React77.createElement(Text35, { size: "sm", style: { color: "#adb5bd" } }, "My Vote")), /* @__PURE__ */ React77.createElement(Text35, { size: "sm", fw: 500, style: { color: "#f1f3f5" } }, hasSubmittedProposal ? userVote?.vote ? userVote.vote.vote : "Pending" : "N/A"))),
|
|
6419
|
+
/* @__PURE__ */ React77.createElement(Stack60, { gap: "xs" }, /* @__PURE__ */ React77.createElement(Text35, { size: "sm", style: { color: "#adb5bd" } }, hasSubmittedProposal ? "Voting is open" : "Voting pending"), /* @__PURE__ */ React77.createElement(
|
|
6638
6420
|
Progress2,
|
|
6639
6421
|
{
|
|
6640
6422
|
value: hasSubmittedProposal ? 75 : 0,
|
|
@@ -6647,8 +6429,8 @@ var FlowGeneralTab = ({
|
|
|
6647
6429
|
}
|
|
6648
6430
|
}
|
|
6649
6431
|
))
|
|
6650
|
-
), hasSubmittedProposal && !hasVoted && (status === "open" || proposalStatus === "open") && /* @__PURE__ */ React77.createElement(
|
|
6651
|
-
|
|
6432
|
+
), hasSubmittedProposal && !hasVoted && (status === "open" || proposalStatus === "open") && /* @__PURE__ */ React77.createElement(Stack60, { gap: "lg" }, disabled && isDisabled?.message && /* @__PURE__ */ React77.createElement(
|
|
6433
|
+
Card16,
|
|
6652
6434
|
{
|
|
6653
6435
|
padding: "md",
|
|
6654
6436
|
radius: "md",
|
|
@@ -6658,8 +6440,8 @@ var FlowGeneralTab = ({
|
|
|
6658
6440
|
color: "#f1f3f5"
|
|
6659
6441
|
}
|
|
6660
6442
|
},
|
|
6661
|
-
/* @__PURE__ */ React77.createElement(
|
|
6662
|
-
|
|
6443
|
+
/* @__PURE__ */ React77.createElement(Group21, { gap: "xs", align: "center" }, /* @__PURE__ */ React77.createElement(
|
|
6444
|
+
Box14,
|
|
6663
6445
|
{
|
|
6664
6446
|
style: {
|
|
6665
6447
|
width: 8,
|
|
@@ -6668,9 +6450,9 @@ var FlowGeneralTab = ({
|
|
|
6668
6450
|
borderRadius: "50%"
|
|
6669
6451
|
}
|
|
6670
6452
|
}
|
|
6671
|
-
), /* @__PURE__ */ React77.createElement(
|
|
6672
|
-
), /* @__PURE__ */ React77.createElement(
|
|
6673
|
-
|
|
6453
|
+
), /* @__PURE__ */ React77.createElement(Text35, { size: "sm", fw: 500, style: { color: "#ffd43b" } }, isDisabled.message))
|
|
6454
|
+
), /* @__PURE__ */ React77.createElement(Stack60, { gap: "md" }, ["yes", "no", "no_with_veto", "abstain"].map((voteType) => /* @__PURE__ */ React77.createElement(Tooltip3, { key: voteType, label: disabled ? isDisabled?.message : void 0, disabled: !disabled, position: "top" }, /* @__PURE__ */ React77.createElement(
|
|
6455
|
+
Button14,
|
|
6674
6456
|
{
|
|
6675
6457
|
variant: "outline",
|
|
6676
6458
|
leftSection: getVoteIcon(voteType),
|
|
@@ -6688,8 +6470,8 @@ var FlowGeneralTab = ({
|
|
|
6688
6470
|
opacity: disabled ? 0.5 : 1
|
|
6689
6471
|
}
|
|
6690
6472
|
},
|
|
6691
|
-
/* @__PURE__ */ React77.createElement(
|
|
6692
|
-
)))), /* @__PURE__ */ React77.createElement(
|
|
6473
|
+
/* @__PURE__ */ React77.createElement(Text35, { fw: 500, tt: "capitalize", style: { textAlign: "left" } }, voteType === "no_with_veto" ? "No with Veto" : voteType)
|
|
6474
|
+
)))), /* @__PURE__ */ React77.createElement(Stack60, { gap: "xs" }, /* @__PURE__ */ React77.createElement(Text35, { size: "sm", style: { color: "#adb5bd" } }, "Rationale (optional)"), /* @__PURE__ */ React77.createElement(
|
|
6693
6475
|
Textarea17,
|
|
6694
6476
|
{
|
|
6695
6477
|
value: rationale,
|
|
@@ -6707,7 +6489,7 @@ var FlowGeneralTab = ({
|
|
|
6707
6489
|
}
|
|
6708
6490
|
}
|
|
6709
6491
|
))), (status === "executed" || proposalStatus === "executed") && /* @__PURE__ */ React77.createElement(
|
|
6710
|
-
|
|
6492
|
+
Card16,
|
|
6711
6493
|
{
|
|
6712
6494
|
padding: "md",
|
|
6713
6495
|
radius: "md",
|
|
@@ -6716,9 +6498,9 @@ var FlowGeneralTab = ({
|
|
|
6716
6498
|
border: "1px solid #333"
|
|
6717
6499
|
}
|
|
6718
6500
|
},
|
|
6719
|
-
/* @__PURE__ */ React77.createElement(
|
|
6720
|
-
), !hasSubmittedProposal && /* @__PURE__ */ React77.createElement(
|
|
6721
|
-
|
|
6501
|
+
/* @__PURE__ */ React77.createElement(Stack60, { gap: "xs" }, /* @__PURE__ */ React77.createElement(Text35, { fw: 500, size: "sm", style: { color: "#f1f3f5" } }, "Proposal Executed"), /* @__PURE__ */ React77.createElement(Text35, { size: "sm", style: { color: "#adb5bd" } }, "This proposal has been successfully executed."))
|
|
6502
|
+
), !hasSubmittedProposal && /* @__PURE__ */ React77.createElement(Stack60, { gap: "lg" }, /* @__PURE__ */ React77.createElement(Stack60, { gap: "md" }, ["yes", "no", "no_with_veto", "abstain"].map((voteType) => /* @__PURE__ */ React77.createElement(Tooltip3, { key: voteType, label: "Proposal must be submitted before voting", position: "top" }, /* @__PURE__ */ React77.createElement(
|
|
6503
|
+
Button14,
|
|
6722
6504
|
{
|
|
6723
6505
|
variant: "outline",
|
|
6724
6506
|
leftSection: getVoteIcon(voteType),
|
|
@@ -6734,9 +6516,9 @@ var FlowGeneralTab = ({
|
|
|
6734
6516
|
opacity: 0.5
|
|
6735
6517
|
}
|
|
6736
6518
|
},
|
|
6737
|
-
/* @__PURE__ */ React77.createElement(
|
|
6519
|
+
/* @__PURE__ */ React77.createElement(Text35, { fw: 500, tt: "capitalize", style: { textAlign: "left" } }, voteType === "no_with_veto" ? "No with Veto" : voteType)
|
|
6738
6520
|
))))), hasSubmittedProposal && !hasVoted && selectedVote && (status === "open" || proposalStatus === "open") && /* @__PURE__ */ React77.createElement(Tooltip3, { label: disabled ? isDisabled?.message : "Sign to vote", position: "top" }, /* @__PURE__ */ React77.createElement("div", null, /* @__PURE__ */ React77.createElement(
|
|
6739
|
-
|
|
6521
|
+
Button14,
|
|
6740
6522
|
{
|
|
6741
6523
|
size: "sm",
|
|
6742
6524
|
onClick: handleSlideToSign,
|
|
@@ -6752,7 +6534,7 @@ var FlowGeneralTab = ({
|
|
|
6752
6534
|
},
|
|
6753
6535
|
"Sign"
|
|
6754
6536
|
))), hasVoted && hasSubmittedProposal && /* @__PURE__ */ React77.createElement(
|
|
6755
|
-
|
|
6537
|
+
Card16,
|
|
6756
6538
|
{
|
|
6757
6539
|
padding: "md",
|
|
6758
6540
|
radius: "md",
|
|
@@ -6762,8 +6544,8 @@ var FlowGeneralTab = ({
|
|
|
6762
6544
|
color: "#f1f3f5"
|
|
6763
6545
|
}
|
|
6764
6546
|
},
|
|
6765
|
-
/* @__PURE__ */ React77.createElement(
|
|
6766
|
-
|
|
6547
|
+
/* @__PURE__ */ React77.createElement(Stack60, { gap: "xs" }, /* @__PURE__ */ React77.createElement(Group21, { gap: "xs", align: "center" }, /* @__PURE__ */ React77.createElement(
|
|
6548
|
+
Box14,
|
|
6767
6549
|
{
|
|
6768
6550
|
style: {
|
|
6769
6551
|
width: 8,
|
|
@@ -6772,16 +6554,16 @@ var FlowGeneralTab = ({
|
|
|
6772
6554
|
borderRadius: "50%"
|
|
6773
6555
|
}
|
|
6774
6556
|
}
|
|
6775
|
-
), /* @__PURE__ */ React77.createElement(
|
|
6557
|
+
), /* @__PURE__ */ React77.createElement(Text35, { size: "sm", fw: 500, style: { color: "#51cf66" } }, "Vote Submitted")), /* @__PURE__ */ React77.createElement(Text35, { size: "xs", style: { color: "#adb5bd" } }, "You have already voted on this proposal. Your vote:", " ", /* @__PURE__ */ React77.createElement(Text35, { span: true, fw: 500, tt: "capitalize" }, userVote?.vote?.vote)))
|
|
6776
6558
|
));
|
|
6777
6559
|
};
|
|
6778
6560
|
|
|
6779
6561
|
// src/mantine/blocks/proposal/flow/ActionsTab.tsx
|
|
6780
|
-
import React78, { useCallback as
|
|
6781
|
-
import { Alert as
|
|
6562
|
+
import React78, { useCallback as useCallback13, useEffect as useEffect13, useState as useState19 } from "react";
|
|
6563
|
+
import { Alert as Alert7, Button as Button15, Card as Card17, Stack as Stack61, Text as Text36 } from "@mantine/core";
|
|
6782
6564
|
var ActionsTab2 = ({ actions, onActionsChange, editor, block, isProposalCreated }) => {
|
|
6783
|
-
const [isEditorVisible, setIsEditorVisible] =
|
|
6784
|
-
const [editingIndex, setEditingIndex] =
|
|
6565
|
+
const [isEditorVisible, setIsEditorVisible] = useState19(false);
|
|
6566
|
+
const [editingIndex, setEditingIndex] = useState19(null);
|
|
6785
6567
|
const parseActions = (actionsJson) => {
|
|
6786
6568
|
if (!actionsJson) return [];
|
|
6787
6569
|
try {
|
|
@@ -6792,18 +6574,18 @@ var ActionsTab2 = ({ actions, onActionsChange, editor, block, isProposalCreated
|
|
|
6792
6574
|
}
|
|
6793
6575
|
};
|
|
6794
6576
|
const currentActions = parseActions(actions);
|
|
6795
|
-
|
|
6577
|
+
useEffect13(() => {
|
|
6796
6578
|
if (!isProposalCreated && currentActions.length === 0 && !isEditorVisible) {
|
|
6797
6579
|
setEditingIndex(null);
|
|
6798
6580
|
setIsEditorVisible(true);
|
|
6799
6581
|
}
|
|
6800
6582
|
}, [currentActions.length, isEditorVisible, isProposalCreated]);
|
|
6801
|
-
const handleAddAction =
|
|
6583
|
+
const handleAddAction = useCallback13(() => {
|
|
6802
6584
|
if (isProposalCreated) return;
|
|
6803
6585
|
setEditingIndex(null);
|
|
6804
6586
|
setIsEditorVisible(true);
|
|
6805
6587
|
}, [isProposalCreated]);
|
|
6806
|
-
const handleEditAction =
|
|
6588
|
+
const handleEditAction = useCallback13(
|
|
6807
6589
|
(index) => {
|
|
6808
6590
|
if (isProposalCreated) return;
|
|
6809
6591
|
setEditingIndex(index);
|
|
@@ -6811,7 +6593,7 @@ var ActionsTab2 = ({ actions, onActionsChange, editor, block, isProposalCreated
|
|
|
6811
6593
|
},
|
|
6812
6594
|
[isProposalCreated]
|
|
6813
6595
|
);
|
|
6814
|
-
const handleRemoveAction =
|
|
6596
|
+
const handleRemoveAction = useCallback13(
|
|
6815
6597
|
(index) => {
|
|
6816
6598
|
if (isProposalCreated) return;
|
|
6817
6599
|
const newActions = currentActions.filter((_, i) => i !== index);
|
|
@@ -6819,7 +6601,7 @@ var ActionsTab2 = ({ actions, onActionsChange, editor, block, isProposalCreated
|
|
|
6819
6601
|
},
|
|
6820
6602
|
[currentActions, onActionsChange, isProposalCreated]
|
|
6821
6603
|
);
|
|
6822
|
-
const handleSaveAction =
|
|
6604
|
+
const handleSaveAction = useCallback13(
|
|
6823
6605
|
(action) => {
|
|
6824
6606
|
let newActions;
|
|
6825
6607
|
if (editingIndex !== null) {
|
|
@@ -6833,12 +6615,12 @@ var ActionsTab2 = ({ actions, onActionsChange, editor, block, isProposalCreated
|
|
|
6833
6615
|
},
|
|
6834
6616
|
[editingIndex, currentActions, onActionsChange]
|
|
6835
6617
|
);
|
|
6836
|
-
const handleCancelEditor =
|
|
6618
|
+
const handleCancelEditor = useCallback13(() => {
|
|
6837
6619
|
setIsEditorVisible(false);
|
|
6838
6620
|
setEditingIndex(null);
|
|
6839
6621
|
}, []);
|
|
6840
|
-
return /* @__PURE__ */ React78.createElement(
|
|
6841
|
-
|
|
6622
|
+
return /* @__PURE__ */ React78.createElement(Stack61, { gap: "md" }, isProposalCreated && /* @__PURE__ */ React78.createElement(Alert7, { color: "yellow", title: "Actions Locked" }, /* @__PURE__ */ React78.createElement(Text36, { size: "sm" }, "Actions cannot be edited after the proposal has been created. These actions are now part of the on-chain proposal.")), /* @__PURE__ */ React78.createElement(Stack61, { gap: "sm" }, !isProposalCreated && /* @__PURE__ */ React78.createElement(
|
|
6623
|
+
Button15,
|
|
6842
6624
|
{
|
|
6843
6625
|
onClick: handleAddAction,
|
|
6844
6626
|
style: {
|
|
@@ -6861,7 +6643,7 @@ var ActionsTab2 = ({ actions, onActionsChange, editor, block, isProposalCreated
|
|
|
6861
6643
|
disabled: isProposalCreated
|
|
6862
6644
|
}
|
|
6863
6645
|
)), !isProposalCreated && isEditorVisible && /* @__PURE__ */ React78.createElement(
|
|
6864
|
-
|
|
6646
|
+
Card17,
|
|
6865
6647
|
{
|
|
6866
6648
|
withBorder: true,
|
|
6867
6649
|
padding: "lg",
|
|
@@ -6880,15 +6662,15 @@ var FlowConfig = ({ editor, block }) => {
|
|
|
6880
6662
|
const { closePanel } = usePanelStore();
|
|
6881
6663
|
const { blockRequirements } = useBlocknoteContext();
|
|
6882
6664
|
const coreAddress = blockRequirements?.proposal?.coreAddress;
|
|
6883
|
-
const [errors, setErrors] =
|
|
6884
|
-
const [isCreating, setIsCreating] =
|
|
6665
|
+
const [errors, setErrors] = useState20({});
|
|
6666
|
+
const [isCreating, setIsCreating] = useState20(false);
|
|
6885
6667
|
const { createProposal, title, description, proposalId } = useFlowBusinessLogic({
|
|
6886
6668
|
block,
|
|
6887
6669
|
editor
|
|
6888
6670
|
});
|
|
6889
6671
|
const isProposalCreated = !!proposalId;
|
|
6890
6672
|
const voteLogic = useVoteBusinessLogic({ block, editor });
|
|
6891
|
-
const updateProp =
|
|
6673
|
+
const updateProp = useCallback14(
|
|
6892
6674
|
(key, value) => {
|
|
6893
6675
|
editor.updateBlock(block, {
|
|
6894
6676
|
props: {
|
|
@@ -6925,7 +6707,7 @@ var FlowConfig = ({ editor, block }) => {
|
|
|
6925
6707
|
setIsCreating(false);
|
|
6926
6708
|
}
|
|
6927
6709
|
};
|
|
6928
|
-
const createProposalTab = /* @__PURE__ */ React79.createElement(
|
|
6710
|
+
const createProposalTab = /* @__PURE__ */ React79.createElement(Stack62, { gap: "lg" }, coreAddress && /* @__PURE__ */ React79.createElement(Card18, { padding: "sm", radius: "md", withBorder: true }, /* @__PURE__ */ React79.createElement(Text37, { size: "xs", c: "dimmed" }, "Core Address:", " ", /* @__PURE__ */ React79.createElement(Text37, { span: true, ff: "monospace", c: "bright" }, coreAddress.slice(0, 20), "...", coreAddress.slice(-10)))), /* @__PURE__ */ React79.createElement(
|
|
6929
6711
|
TextInput33,
|
|
6930
6712
|
{
|
|
6931
6713
|
label: "Title",
|
|
@@ -6948,8 +6730,8 @@ var FlowConfig = ({ editor, block }) => {
|
|
|
6948
6730
|
required: true,
|
|
6949
6731
|
disabled: isProposalCreated
|
|
6950
6732
|
}
|
|
6951
|
-
), errors.general && /* @__PURE__ */ React79.createElement(
|
|
6952
|
-
const handleActionsChange =
|
|
6733
|
+
), errors.general && /* @__PURE__ */ React79.createElement(Text37, { size: "sm", c: "red" }, errors.general), isProposalCreated && /* @__PURE__ */ React79.createElement(Card18, { padding: "md", radius: "md", withBorder: true, style: { borderColor: "var(--mantine-color-green-6)" } }, /* @__PURE__ */ React79.createElement(Text37, { fw: 500, size: "sm", c: "green" }, "Proposal Created Successfully"), /* @__PURE__ */ React79.createElement(Text37, { size: "sm", c: "dimmed" }, "Your proposal has been created and is now open for voting.")), /* @__PURE__ */ React79.createElement(Button16, { fullWidth: true, onClick: handleCreateProposal, disabled: isProposalCreated, loading: isCreating }, isProposalCreated ? "Proposal Created" : "Create Proposal"));
|
|
6734
|
+
const handleActionsChange = useCallback14(
|
|
6953
6735
|
(newActions) => {
|
|
6954
6736
|
updateProp("actions", JSON.stringify(newActions));
|
|
6955
6737
|
},
|
|
@@ -6986,7 +6768,7 @@ var FlowConfig = ({ editor, block }) => {
|
|
|
6986
6768
|
}
|
|
6987
6769
|
];
|
|
6988
6770
|
return /* @__PURE__ */ React79.createElement(
|
|
6989
|
-
|
|
6771
|
+
Paper5,
|
|
6990
6772
|
{
|
|
6991
6773
|
p: "md",
|
|
6992
6774
|
shadow: "sm",
|
|
@@ -7006,8 +6788,8 @@ var FlowConfig = ({ editor, block }) => {
|
|
|
7006
6788
|
marginBottom: "1rem"
|
|
7007
6789
|
}
|
|
7008
6790
|
},
|
|
7009
|
-
/* @__PURE__ */ React79.createElement(
|
|
7010
|
-
/* @__PURE__ */ React79.createElement(
|
|
6791
|
+
/* @__PURE__ */ React79.createElement(Title4, { order: 3 }, "Proposal Settings"),
|
|
6792
|
+
/* @__PURE__ */ React79.createElement(CloseButton4, { onClick: closePanel })
|
|
7011
6793
|
),
|
|
7012
6794
|
/* @__PURE__ */ React79.createElement(ReusablePanel, { extraTabs, context: { editor, block } })
|
|
7013
6795
|
);
|
|
@@ -7021,7 +6803,7 @@ var ProposalFlowView = ({ block, editor }) => {
|
|
|
7021
6803
|
block,
|
|
7022
6804
|
editor
|
|
7023
6805
|
});
|
|
7024
|
-
const panelContent =
|
|
6806
|
+
const panelContent = useMemo10(() => /* @__PURE__ */ React80.createElement(FlowConfig, { editor, block }), [editor, block]);
|
|
7025
6807
|
const { open } = usePanel(panelId, panelContent);
|
|
7026
6808
|
const handleVote = () => {
|
|
7027
6809
|
open();
|
|
@@ -7050,7 +6832,8 @@ var ProposalFlowView = ({ block, editor }) => {
|
|
|
7050
6832
|
|
|
7051
6833
|
// src/mantine/blocks/proposal/ProposalBlock.tsx
|
|
7052
6834
|
function ProposalBlock({ editor, block }) {
|
|
7053
|
-
|
|
6835
|
+
const { docType } = useBlocknoteContext();
|
|
6836
|
+
if (docType === "template") {
|
|
7054
6837
|
return /* @__PURE__ */ React81.createElement(ProposalTemplateView, { editor, block });
|
|
7055
6838
|
}
|
|
7056
6839
|
return /* @__PURE__ */ React81.createElement(ProposalFlowView, { block, editor });
|
|
@@ -7122,17 +6905,17 @@ import { createReactBlockSpec as createReactBlockSpec5 } from "@blocknote/react"
|
|
|
7122
6905
|
import React87 from "react";
|
|
7123
6906
|
|
|
7124
6907
|
// src/mantine/blocks/apiRequest/template/TemplateView.tsx
|
|
7125
|
-
import React85, { useMemo as
|
|
6908
|
+
import React85, { useMemo as useMemo11 } from "react";
|
|
7126
6909
|
|
|
7127
6910
|
// src/mantine/blocks/apiRequest/template/TemplateConfig.tsx
|
|
7128
|
-
import React84, { useCallback as
|
|
7129
|
-
import { Paper as
|
|
6911
|
+
import React84, { useCallback as useCallback15 } from "react";
|
|
6912
|
+
import { Paper as Paper7, CloseButton as CloseButton5, Title as Title5 } from "@mantine/core";
|
|
7130
6913
|
|
|
7131
6914
|
// src/mantine/blocks/apiRequest/template/GeneralTab.tsx
|
|
7132
|
-
import React83, { useEffect as
|
|
7133
|
-
import { Divider as Divider4, Select as Select9, Stack as
|
|
6915
|
+
import React83, { useEffect as useEffect14, useState as useState21 } from "react";
|
|
6916
|
+
import { Divider as Divider4, Select as Select9, Stack as Stack63, Text as Text38, TextInput as TextInput34, Textarea as Textarea19, Button as Button17, Group as Group22, ActionIcon as ActionIcon9, Paper as Paper6 } from "@mantine/core";
|
|
7134
6917
|
import { IconTrash, IconPlus } from "@tabler/icons-react";
|
|
7135
|
-
var
|
|
6918
|
+
var GeneralTab4 = ({
|
|
7136
6919
|
title,
|
|
7137
6920
|
description,
|
|
7138
6921
|
endpoint,
|
|
@@ -7146,18 +6929,18 @@ var GeneralTab3 = ({
|
|
|
7146
6929
|
onHeadersChange,
|
|
7147
6930
|
onBodyChange
|
|
7148
6931
|
}) => {
|
|
7149
|
-
const [localTitle, setLocalTitle] =
|
|
7150
|
-
const [localDescription, setLocalDescription] =
|
|
7151
|
-
const [localEndpoint, setLocalEndpoint] =
|
|
7152
|
-
const [localMethod, setLocalMethod] =
|
|
7153
|
-
const [localHeaders, setLocalHeaders] =
|
|
7154
|
-
const [localBody, setLocalBody] =
|
|
7155
|
-
|
|
7156
|
-
|
|
7157
|
-
|
|
7158
|
-
|
|
7159
|
-
|
|
7160
|
-
|
|
6932
|
+
const [localTitle, setLocalTitle] = useState21(title || "");
|
|
6933
|
+
const [localDescription, setLocalDescription] = useState21(description || "");
|
|
6934
|
+
const [localEndpoint, setLocalEndpoint] = useState21(endpoint || "");
|
|
6935
|
+
const [localMethod, setLocalMethod] = useState21(method || "GET");
|
|
6936
|
+
const [localHeaders, setLocalHeaders] = useState21(headers || []);
|
|
6937
|
+
const [localBody, setLocalBody] = useState21(body || []);
|
|
6938
|
+
useEffect14(() => setLocalTitle(title || ""), [title]);
|
|
6939
|
+
useEffect14(() => setLocalDescription(description || ""), [description]);
|
|
6940
|
+
useEffect14(() => setLocalEndpoint(endpoint || ""), [endpoint]);
|
|
6941
|
+
useEffect14(() => setLocalMethod(method || "GET"), [method]);
|
|
6942
|
+
useEffect14(() => setLocalHeaders(headers || []), [headers]);
|
|
6943
|
+
useEffect14(() => setLocalBody(body || []), [body]);
|
|
7161
6944
|
const handleAddHeader = () => {
|
|
7162
6945
|
const newHeaders = [...localHeaders, { key: "", value: "" }];
|
|
7163
6946
|
setLocalHeaders(newHeaders);
|
|
@@ -7190,7 +6973,7 @@ var GeneralTab3 = ({
|
|
|
7190
6973
|
setLocalBody(newBody);
|
|
7191
6974
|
onBodyChange(newBody);
|
|
7192
6975
|
};
|
|
7193
|
-
return /* @__PURE__ */ React83.createElement(
|
|
6976
|
+
return /* @__PURE__ */ React83.createElement(Stack63, { gap: "lg" }, /* @__PURE__ */ React83.createElement(Stack63, { gap: "xs" }, /* @__PURE__ */ React83.createElement(Text38, { size: "sm", fw: 600 }, "Title"), /* @__PURE__ */ React83.createElement(
|
|
7194
6977
|
TextInput34,
|
|
7195
6978
|
{
|
|
7196
6979
|
placeholder: "e.g. Submit User Data",
|
|
@@ -7201,7 +6984,7 @@ var GeneralTab3 = ({
|
|
|
7201
6984
|
onTitleChange(newTitle);
|
|
7202
6985
|
}
|
|
7203
6986
|
}
|
|
7204
|
-
)), /* @__PURE__ */ React83.createElement(
|
|
6987
|
+
)), /* @__PURE__ */ React83.createElement(Stack63, { gap: "xs" }, /* @__PURE__ */ React83.createElement(Text38, { size: "sm", fw: 600 }, "Description"), /* @__PURE__ */ React83.createElement(
|
|
7205
6988
|
Textarea19,
|
|
7206
6989
|
{
|
|
7207
6990
|
placeholder: "Describe what this API request does",
|
|
@@ -7213,7 +6996,7 @@ var GeneralTab3 = ({
|
|
|
7213
6996
|
onDescriptionChange(newDescription);
|
|
7214
6997
|
}
|
|
7215
6998
|
}
|
|
7216
|
-
)), /* @__PURE__ */ React83.createElement(Divider4, { variant: "dashed" }), /* @__PURE__ */ React83.createElement(
|
|
6999
|
+
)), /* @__PURE__ */ React83.createElement(Divider4, { variant: "dashed" }), /* @__PURE__ */ React83.createElement(Stack63, { gap: "xs" }, /* @__PURE__ */ React83.createElement(Text38, { size: "sm", fw: 600 }, "HTTP Method"), /* @__PURE__ */ React83.createElement(
|
|
7217
7000
|
Select9,
|
|
7218
7001
|
{
|
|
7219
7002
|
value: localMethod,
|
|
@@ -7230,7 +7013,7 @@ var GeneralTab3 = ({
|
|
|
7230
7013
|
{ value: "PATCH", label: "PATCH" }
|
|
7231
7014
|
]
|
|
7232
7015
|
}
|
|
7233
|
-
)), /* @__PURE__ */ React83.createElement(
|
|
7016
|
+
)), /* @__PURE__ */ React83.createElement(Stack63, { gap: "xs" }, /* @__PURE__ */ React83.createElement(Text38, { size: "sm", fw: 600 }, "Endpoint URL"), /* @__PURE__ */ React83.createElement(
|
|
7234
7017
|
TextInput34,
|
|
7235
7018
|
{
|
|
7236
7019
|
placeholder: "https://api.example.com/endpoint",
|
|
@@ -7241,7 +7024,7 @@ var GeneralTab3 = ({
|
|
|
7241
7024
|
onEndpointChange(newEndpoint);
|
|
7242
7025
|
}
|
|
7243
7026
|
}
|
|
7244
|
-
)), /* @__PURE__ */ React83.createElement(Divider4, { variant: "dashed" }), /* @__PURE__ */ React83.createElement(
|
|
7027
|
+
)), /* @__PURE__ */ React83.createElement(Divider4, { variant: "dashed" }), /* @__PURE__ */ React83.createElement(Stack63, { gap: "xs" }, /* @__PURE__ */ React83.createElement(Group22, { justify: "space-between" }, /* @__PURE__ */ React83.createElement(Text38, { size: "sm", fw: 600 }, "Request Headers"), /* @__PURE__ */ React83.createElement(Button17, { size: "xs", variant: "light", leftSection: /* @__PURE__ */ React83.createElement(IconPlus, { size: 14 }), onClick: handleAddHeader }, "Add Header")), /* @__PURE__ */ React83.createElement(Text38, { size: "xs" }, "Add custom headers to your API request (e.g., Authorization, Content-Type)"), localHeaders.length > 0 && /* @__PURE__ */ React83.createElement(Stack63, { gap: "xs" }, localHeaders.map((header, index) => /* @__PURE__ */ React83.createElement(Paper6, { key: index, p: "xs" }, /* @__PURE__ */ React83.createElement(Group22, { gap: "xs", align: "flex-start" }, /* @__PURE__ */ React83.createElement(
|
|
7245
7028
|
TextInput34,
|
|
7246
7029
|
{
|
|
7247
7030
|
placeholder: "Header key (e.g., Authorization)",
|
|
@@ -7257,7 +7040,7 @@ var GeneralTab3 = ({
|
|
|
7257
7040
|
onChange: (event) => handleHeaderChange(index, "value", event.currentTarget.value),
|
|
7258
7041
|
style: { flex: 1 }
|
|
7259
7042
|
}
|
|
7260
|
-
), /* @__PURE__ */ React83.createElement(
|
|
7043
|
+
), /* @__PURE__ */ React83.createElement(ActionIcon9, { color: "red", variant: "subtle", onClick: () => handleRemoveHeader(index) }, /* @__PURE__ */ React83.createElement(IconTrash, { size: 16 }))))))), /* @__PURE__ */ React83.createElement(Divider4, { variant: "dashed" }), /* @__PURE__ */ React83.createElement(Stack63, { gap: "xs" }, /* @__PURE__ */ React83.createElement(Group22, { justify: "space-between" }, /* @__PURE__ */ React83.createElement(Text38, { size: "sm", fw: 600 }, "Request Body (JSON)"), /* @__PURE__ */ React83.createElement(Button17, { size: "xs", variant: "light", leftSection: /* @__PURE__ */ React83.createElement(IconPlus, { size: 14 }), onClick: handleAddBodyField }, "Add Field")), /* @__PURE__ */ React83.createElement(Text38, { size: "xs" }, "Build your JSON request body as key-value pairs"), localBody.length > 0 && /* @__PURE__ */ React83.createElement(Stack63, { gap: "xs" }, localBody.map((field, index) => /* @__PURE__ */ React83.createElement(Paper6, { key: index, p: "xs" }, /* @__PURE__ */ React83.createElement(Group22, { gap: "xs", align: "flex-start" }, /* @__PURE__ */ React83.createElement(
|
|
7261
7044
|
TextInput34,
|
|
7262
7045
|
{
|
|
7263
7046
|
placeholder: "Field key (e.g., name)",
|
|
@@ -7273,13 +7056,13 @@ var GeneralTab3 = ({
|
|
|
7273
7056
|
onChange: (event) => handleBodyFieldChange(index, "value", event.currentTarget.value),
|
|
7274
7057
|
style: { flex: 1 }
|
|
7275
7058
|
}
|
|
7276
|
-
), /* @__PURE__ */ React83.createElement(
|
|
7059
|
+
), /* @__PURE__ */ React83.createElement(ActionIcon9, { color: "red", variant: "subtle", onClick: () => handleRemoveBodyField(index) }, /* @__PURE__ */ React83.createElement(IconTrash, { size: 16 }))))))));
|
|
7277
7060
|
};
|
|
7278
7061
|
|
|
7279
7062
|
// src/mantine/blocks/apiRequest/template/TemplateConfig.tsx
|
|
7280
|
-
var
|
|
7063
|
+
var TemplateConfig4 = ({ editor, block }) => {
|
|
7281
7064
|
const { closePanel } = usePanelStore();
|
|
7282
|
-
const updateProp =
|
|
7065
|
+
const updateProp = useCallback15(
|
|
7283
7066
|
(key, value) => {
|
|
7284
7067
|
editor.updateBlock(block, {
|
|
7285
7068
|
props: {
|
|
@@ -7290,20 +7073,20 @@ var TemplateConfig3 = ({ editor, block }) => {
|
|
|
7290
7073
|
},
|
|
7291
7074
|
[editor, block]
|
|
7292
7075
|
);
|
|
7293
|
-
const handleHeadersChange =
|
|
7076
|
+
const handleHeadersChange = useCallback15(
|
|
7294
7077
|
(headers) => {
|
|
7295
7078
|
updateProp("headers", JSON.stringify(headers));
|
|
7296
7079
|
},
|
|
7297
7080
|
[updateProp]
|
|
7298
7081
|
);
|
|
7299
|
-
const handleBodyChange =
|
|
7082
|
+
const handleBodyChange = useCallback15(
|
|
7300
7083
|
(body) => {
|
|
7301
7084
|
updateProp("body", JSON.stringify(body));
|
|
7302
7085
|
},
|
|
7303
7086
|
[updateProp]
|
|
7304
7087
|
);
|
|
7305
7088
|
return /* @__PURE__ */ React84.createElement(
|
|
7306
|
-
|
|
7089
|
+
Paper7,
|
|
7307
7090
|
{
|
|
7308
7091
|
p: "md",
|
|
7309
7092
|
shadow: "sm",
|
|
@@ -7323,8 +7106,8 @@ var TemplateConfig3 = ({ editor, block }) => {
|
|
|
7323
7106
|
marginBottom: "1rem"
|
|
7324
7107
|
}
|
|
7325
7108
|
},
|
|
7326
|
-
/* @__PURE__ */ React84.createElement(
|
|
7327
|
-
/* @__PURE__ */ React84.createElement(
|
|
7109
|
+
/* @__PURE__ */ React84.createElement(Title5, { order: 3 }, "API Request Settings"),
|
|
7110
|
+
/* @__PURE__ */ React84.createElement(CloseButton5, { onClick: closePanel })
|
|
7328
7111
|
),
|
|
7329
7112
|
/* @__PURE__ */ React84.createElement(
|
|
7330
7113
|
ReusablePanel,
|
|
@@ -7334,7 +7117,7 @@ var TemplateConfig3 = ({ editor, block }) => {
|
|
|
7334
7117
|
label: "General",
|
|
7335
7118
|
value: "general",
|
|
7336
7119
|
content: /* @__PURE__ */ React84.createElement(
|
|
7337
|
-
|
|
7120
|
+
GeneralTab4,
|
|
7338
7121
|
{
|
|
7339
7122
|
title: block.props.title || "",
|
|
7340
7123
|
description: block.props.description || "",
|
|
@@ -7371,11 +7154,11 @@ var TemplateConfig3 = ({ editor, block }) => {
|
|
|
7371
7154
|
};
|
|
7372
7155
|
|
|
7373
7156
|
// src/mantine/blocks/apiRequest/template/TemplateView.tsx
|
|
7374
|
-
import { Card as
|
|
7157
|
+
import { Card as Card19, Group as Group23, Stack as Stack64, Text as Text39, ActionIcon as ActionIcon10, Badge as Badge10 } from "@mantine/core";
|
|
7375
7158
|
var API_REQUEST_TEMPLATE_PANEL_ID = "api-request-template-panel";
|
|
7376
7159
|
var ApiRequestTemplateView = ({ editor, block }) => {
|
|
7377
7160
|
const panelId = `${API_REQUEST_TEMPLATE_PANEL_ID}-${block.id}`;
|
|
7378
|
-
const panelContent =
|
|
7161
|
+
const panelContent = useMemo11(() => /* @__PURE__ */ React85.createElement(TemplateConfig4, { editor, block }), [editor, block]);
|
|
7379
7162
|
const { open } = usePanel(panelId, panelContent);
|
|
7380
7163
|
const method = block.props.method || "GET";
|
|
7381
7164
|
const endpoint = block.props.endpoint || "https://api.example.com/endpoint";
|
|
@@ -7395,17 +7178,17 @@ var ApiRequestTemplateView = ({ editor, block }) => {
|
|
|
7395
7178
|
return "gray";
|
|
7396
7179
|
}
|
|
7397
7180
|
};
|
|
7398
|
-
return /* @__PURE__ */ React85.createElement(
|
|
7181
|
+
return /* @__PURE__ */ React85.createElement(Card19, { withBorder: true, padding: "md", radius: "md", style: { width: "100%", cursor: "pointer", position: "relative" }, onClick: open }, /* @__PURE__ */ React85.createElement(Badge10, { size: "xs", variant: "light", color: "gray", style: { position: "absolute", top: 8, right: 8 } }, "Template"), /* @__PURE__ */ React85.createElement(Group23, { wrap: "nowrap", justify: "space-between", align: "center" }, /* @__PURE__ */ React85.createElement(Group23, { wrap: "nowrap", align: "center" }, /* @__PURE__ */ React85.createElement(ActionIcon10, { variant: "light", color: "violet", size: "lg", radius: "xl", style: { flexShrink: 0 } }, getIcon(block.props.icon, 18, 1.5, "square-check")), /* @__PURE__ */ React85.createElement(Stack64, { gap: "xs", style: { flex: 1 } }, /* @__PURE__ */ React85.createElement(Group23, { gap: "xs", wrap: "nowrap" }, /* @__PURE__ */ React85.createElement(Badge10, { size: "sm", variant: "filled", color: getMethodColor(method) }, method), /* @__PURE__ */ React85.createElement(Text39, { fw: 500, size: "sm", contentEditable: false }, block.props.title || "API Request")), /* @__PURE__ */ React85.createElement(Text39, { size: "xs", c: "dimmed", contentEditable: false, lineClamp: 1 }, endpoint), block.props.description && /* @__PURE__ */ React85.createElement(Text39, { size: "xs", c: "dimmed", contentEditable: false }, block.props.description)))));
|
|
7399
7182
|
};
|
|
7400
7183
|
|
|
7401
7184
|
// src/mantine/blocks/apiRequest/flow/FlowView.tsx
|
|
7402
|
-
import React86, { useState as
|
|
7403
|
-
import { Card as
|
|
7185
|
+
import React86, { useState as useState22 } from "react";
|
|
7186
|
+
import { Card as Card20, Group as Group24, Stack as Stack65, Text as Text40, ActionIcon as ActionIcon11, Tooltip as Tooltip4, Button as Button18, Badge as Badge11, Collapse, Code, Loader as Loader2, Alert as Alert8 } from "@mantine/core";
|
|
7404
7187
|
import { IconSend, IconChevronDown, IconChevronUp } from "@tabler/icons-react";
|
|
7405
7188
|
var ApiRequestFlowView = ({ editor, block, isDisabled }) => {
|
|
7406
7189
|
const disabled = isDisabled?.isDisabled === "disable";
|
|
7407
|
-
const [isLoading, setIsLoading] =
|
|
7408
|
-
const [showDetails, setShowDetails] =
|
|
7190
|
+
const [isLoading, setIsLoading] = useState22(false);
|
|
7191
|
+
const [showDetails, setShowDetails] = useState22(false);
|
|
7409
7192
|
const method = block.props.method || "GET";
|
|
7410
7193
|
const endpoint = block.props.endpoint || "";
|
|
7411
7194
|
const headers = (() => {
|
|
@@ -7519,20 +7302,20 @@ var ApiRequestFlowView = ({ editor, block, isDisabled }) => {
|
|
|
7519
7302
|
}
|
|
7520
7303
|
};
|
|
7521
7304
|
const executeButton = /* @__PURE__ */ React86.createElement(
|
|
7522
|
-
|
|
7305
|
+
Button18,
|
|
7523
7306
|
{
|
|
7524
7307
|
size: "sm",
|
|
7525
7308
|
variant: "light",
|
|
7526
7309
|
color: getMethodColor(method),
|
|
7527
|
-
leftSection: isLoading ? /* @__PURE__ */ React86.createElement(
|
|
7310
|
+
leftSection: isLoading ? /* @__PURE__ */ React86.createElement(Loader2, { size: 14 }) : /* @__PURE__ */ React86.createElement(IconSend, { size: 14 }),
|
|
7528
7311
|
onClick: handleExecuteRequest,
|
|
7529
7312
|
disabled: disabled || isLoading || !endpoint,
|
|
7530
7313
|
style: { flexShrink: 0 }
|
|
7531
7314
|
},
|
|
7532
7315
|
isLoading ? "Sending..." : "Execute"
|
|
7533
7316
|
);
|
|
7534
|
-
return /* @__PURE__ */ React86.createElement(
|
|
7535
|
-
|
|
7317
|
+
return /* @__PURE__ */ React86.createElement(Card20, { withBorder: true, padding: "md", radius: "md", style: { width: "100%" } }, /* @__PURE__ */ React86.createElement(Stack65, { gap: "md" }, /* @__PURE__ */ React86.createElement(Group24, { wrap: "nowrap", justify: "space-between", align: "flex-start" }, /* @__PURE__ */ React86.createElement(Group24, { wrap: "nowrap", align: "flex-start", style: { flex: 1 } }, /* @__PURE__ */ React86.createElement(ActionIcon11, { variant: "light", color: "violet", size: "lg", radius: "xl", style: { flexShrink: 0 } }, getIcon(block.props.icon, 18, 1.5, "square-check")), /* @__PURE__ */ React86.createElement(Stack65, { gap: "xs", style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ React86.createElement(Group24, { gap: "xs", wrap: "nowrap" }, /* @__PURE__ */ React86.createElement(Badge11, { size: "sm", variant: "filled", color: getMethodColor(method) }, method), /* @__PURE__ */ React86.createElement(Text40, { fw: 500, size: "sm", contentEditable: false }, block.props.title || "API Request"), status !== "idle" && /* @__PURE__ */ React86.createElement(Badge11, { size: "xs", variant: "dot", color: getStatusColor(status) }, status)), /* @__PURE__ */ React86.createElement(
|
|
7318
|
+
Text40,
|
|
7536
7319
|
{
|
|
7537
7320
|
size: "xs",
|
|
7538
7321
|
c: "dimmed",
|
|
@@ -7544,7 +7327,7 @@ var ApiRequestFlowView = ({ editor, block, isDisabled }) => {
|
|
|
7544
7327
|
}
|
|
7545
7328
|
},
|
|
7546
7329
|
endpoint || "No endpoint configured"
|
|
7547
|
-
), block.props.description && /* @__PURE__ */ React86.createElement(
|
|
7330
|
+
), block.props.description && /* @__PURE__ */ React86.createElement(Text40, { size: "xs", c: "dimmed", contentEditable: false }, block.props.description))), /* @__PURE__ */ React86.createElement(Group24, { gap: "xs", style: { flexShrink: 0 } }, disabled && isDisabled?.message ? /* @__PURE__ */ React86.createElement(Tooltip4, { label: isDisabled.message, position: "left", withArrow: true }, executeButton) : executeButton, /* @__PURE__ */ React86.createElement(ActionIcon11, { variant: "subtle", onClick: () => setShowDetails(!showDetails), disabled: headers.length === 0 && body.length === 0 && !response }, showDetails ? /* @__PURE__ */ React86.createElement(IconChevronUp, { size: 16 }) : /* @__PURE__ */ React86.createElement(IconChevronDown, { size: 16 })))), /* @__PURE__ */ React86.createElement(Collapse, { in: showDetails }, /* @__PURE__ */ React86.createElement(Stack65, { gap: "md" }, headers.length > 0 && /* @__PURE__ */ React86.createElement(Stack65, { gap: "xs" }, /* @__PURE__ */ React86.createElement(Text40, { size: "xs", fw: 600, c: "dimmed" }, "Headers:"), /* @__PURE__ */ React86.createElement(Code, { block: true, style: { fontSize: "11px" } }, JSON.stringify(
|
|
7548
7331
|
headers.reduce(
|
|
7549
7332
|
(acc, h) => {
|
|
7550
7333
|
if (h.key && h.value) acc[h.key] = h.value;
|
|
@@ -7554,7 +7337,7 @@ var ApiRequestFlowView = ({ editor, block, isDisabled }) => {
|
|
|
7554
7337
|
),
|
|
7555
7338
|
null,
|
|
7556
7339
|
2
|
|
7557
|
-
))), method !== "GET" && body.length > 0 && /* @__PURE__ */ React86.createElement(
|
|
7340
|
+
))), method !== "GET" && body.length > 0 && /* @__PURE__ */ React86.createElement(Stack65, { gap: "xs" }, /* @__PURE__ */ React86.createElement(Text40, { size: "xs", fw: 600, c: "dimmed" }, "Body:"), /* @__PURE__ */ React86.createElement(Code, { block: true, style: { fontSize: "11px" } }, JSON.stringify(
|
|
7558
7341
|
body.reduce(
|
|
7559
7342
|
(acc, b) => {
|
|
7560
7343
|
if (b.key && b.value) acc[b.key] = b.value;
|
|
@@ -7564,7 +7347,7 @@ var ApiRequestFlowView = ({ editor, block, isDisabled }) => {
|
|
|
7564
7347
|
),
|
|
7565
7348
|
null,
|
|
7566
7349
|
2
|
|
7567
|
-
))), response && /* @__PURE__ */ React86.createElement(
|
|
7350
|
+
))), response && /* @__PURE__ */ React86.createElement(Stack65, { gap: "xs" }, /* @__PURE__ */ React86.createElement(Text40, { size: "xs", fw: 600, c: "dimmed" }, "Response:"), status === "error" ? /* @__PURE__ */ React86.createElement(Alert8, { color: "red", title: "Error", styles: { message: { fontSize: "11px" } } }, /* @__PURE__ */ React86.createElement(Code, { block: true, style: { fontSize: "11px" } }, response)) : /* @__PURE__ */ React86.createElement(Code, { block: true, style: { fontSize: "11px", maxHeight: "300px", overflow: "auto" } }, response))))));
|
|
7568
7351
|
};
|
|
7569
7352
|
|
|
7570
7353
|
// src/mantine/blocks/apiRequest/ApiRequestBlock.tsx
|
|
@@ -7658,28 +7441,54 @@ var ApiRequestBlockSpec = createReactBlockSpec5(
|
|
|
7658
7441
|
);
|
|
7659
7442
|
|
|
7660
7443
|
// src/mantine/blocks/enumChecklist/EnumChecklistBlock.tsx
|
|
7661
|
-
import
|
|
7444
|
+
import React95, { useState as useState24, useEffect as useEffect15, useMemo as useMemo12, useCallback as useCallback16 } from "react";
|
|
7662
7445
|
import { createReactBlockSpec as createReactBlockSpec6 } from "@blocknote/react";
|
|
7663
|
-
import { Stack as
|
|
7446
|
+
import { Stack as Stack71, Text as Text46, Button as Button23, ActionIcon as ActionIcon12, Center as Center2, Flex as Flex16 } from "@mantine/core";
|
|
7664
7447
|
|
|
7665
7448
|
// src/mantine/blocks/enumChecklist/oracle_personalities/index.tsx
|
|
7666
7449
|
import React89 from "react";
|
|
7667
|
-
import { Box as
|
|
7450
|
+
import { Box as Box15, Flex as Flex15, Stack as Stack66, Text as Text41, Image as Image11 } from "@mantine/core";
|
|
7668
7451
|
function OraclePersonalitiesEnumList({ selectionMode, isItemChecked, onItemCheck, items }) {
|
|
7669
7452
|
if (!items || items.length === 0) {
|
|
7670
|
-
return /* @__PURE__ */ React89.createElement(
|
|
7453
|
+
return /* @__PURE__ */ React89.createElement(Text41, { size: "sm", c: "dimmed", ta: "center", py: "md" }, "No assets found");
|
|
7671
7454
|
}
|
|
7672
|
-
const rows = items.map(({ id, name, description, voice, icon }) => /* @__PURE__ */ React89.createElement(ListItemContainer, { key: id }, /* @__PURE__ */ React89.createElement(Flex15, { align: "center", gap: "sm" }, /* @__PURE__ */ React89.createElement(Image11, { radius: 16, w: 62, h: 62, src: icon, alt: name }), /* @__PURE__ */ React89.createElement(
|
|
7673
|
-
return /* @__PURE__ */ React89.createElement(
|
|
7455
|
+
const rows = items.map(({ id, name, description, voice, icon }) => /* @__PURE__ */ React89.createElement(ListItemContainer, { key: id }, /* @__PURE__ */ React89.createElement(Flex15, { align: "center", gap: "sm" }, /* @__PURE__ */ React89.createElement(Image11, { radius: 16, w: 62, h: 62, src: icon, alt: name }), /* @__PURE__ */ React89.createElement(Stack66, { gap: 0 }, /* @__PURE__ */ React89.createElement(Text41, { size: "sm", fw: 500 }, name || "-"), description !== void 0 && /* @__PURE__ */ React89.createElement(Text41, { size: "sm", c: "dimmed" }, description))), /* @__PURE__ */ React89.createElement(Flex15, { align: "center", gap: "md" }, /* @__PURE__ */ React89.createElement(Stack66, { ta: "right", gap: 0 }, /* @__PURE__ */ React89.createElement(Text41, { size: "sm", fw: 500 }, "Voice"), /* @__PURE__ */ React89.createElement(Text41, { size: "sm", c: "dimmed" }, voice)), selectionMode && /* @__PURE__ */ React89.createElement(ListItemCheckbox, { ariaLabel: `Select oracle ${name}`, checked: isItemChecked?.(id), onCheck: (checked) => onItemCheck?.(id, checked) }))));
|
|
7456
|
+
return /* @__PURE__ */ React89.createElement(Box15, { flex: 1 }, /* @__PURE__ */ React89.createElement(Stack66, null, rows));
|
|
7674
7457
|
}
|
|
7675
7458
|
|
|
7676
7459
|
// src/mantine/blocks/enumChecklist/EnumChecklistConfigModal.tsx
|
|
7677
|
-
import
|
|
7678
|
-
import { Modal
|
|
7460
|
+
import React94, { useState as useState23 } from "react";
|
|
7461
|
+
import { Modal, Group as Group28, Box as Box17 } from "@mantine/core";
|
|
7679
7462
|
|
|
7680
|
-
// src/mantine/blocks/
|
|
7463
|
+
// src/mantine/blocks/list/modal/ModalNavigation.tsx
|
|
7681
7464
|
import React90 from "react";
|
|
7682
|
-
import { Stack as
|
|
7465
|
+
import { Stack as Stack67, Button as Button19, Text as Text42 } from "@mantine/core";
|
|
7466
|
+
var ModalNavigation = ({ steps, activeStep, onStepChange, showUpdateButton = false, onUpdateBlock }) => {
|
|
7467
|
+
return /* @__PURE__ */ React90.createElement(Stack67, { gap: "xs", style: { height: "100%" } }, /* @__PURE__ */ React90.createElement(Stack67, { gap: "xs", style: { flex: 1 } }, steps.map((step) => /* @__PURE__ */ React90.createElement(
|
|
7468
|
+
Button19,
|
|
7469
|
+
{
|
|
7470
|
+
key: step.id,
|
|
7471
|
+
variant: activeStep === step.id ? "filled" : "subtle",
|
|
7472
|
+
justify: "flex-start",
|
|
7473
|
+
disabled: step.disabled,
|
|
7474
|
+
onClick: () => onStepChange(step.id),
|
|
7475
|
+
styles: {
|
|
7476
|
+
root: {
|
|
7477
|
+
height: "auto",
|
|
7478
|
+
padding: "12px"
|
|
7479
|
+
},
|
|
7480
|
+
inner: {
|
|
7481
|
+
justifyContent: "flex-start"
|
|
7482
|
+
}
|
|
7483
|
+
}
|
|
7484
|
+
},
|
|
7485
|
+
/* @__PURE__ */ React90.createElement(Stack67, { gap: 2, align: "flex-start" }, /* @__PURE__ */ React90.createElement(Text42, { size: "sm", fw: 500 }, step.label), /* @__PURE__ */ React90.createElement(Text42, { size: "xs", opacity: 0.7 }, step.description))
|
|
7486
|
+
))), showUpdateButton && /* @__PURE__ */ React90.createElement(Button19, { variant: "filled", color: "blue", onClick: onUpdateBlock, style: { marginTop: "auto" } }, "Update Block"));
|
|
7487
|
+
};
|
|
7488
|
+
|
|
7489
|
+
// src/mantine/blocks/enumChecklist/EnumChecklistTypeSelection.tsx
|
|
7490
|
+
import React91 from "react";
|
|
7491
|
+
import { Stack as Stack68, Card as Card21, Group as Group25, Text as Text43, Box as Box16, Button as Button20 } from "@mantine/core";
|
|
7683
7492
|
|
|
7684
7493
|
// src/mantine/blocks/enumChecklist/oracle_personalities/config.ts
|
|
7685
7494
|
var oraclePersonalitiesMetadata = {
|
|
@@ -7808,8 +7617,8 @@ function getEnumListItems(type) {
|
|
|
7808
7617
|
// src/mantine/blocks/enumChecklist/EnumChecklistTypeSelection.tsx
|
|
7809
7618
|
var EnumChecklistTypeSelection = ({ selectedType, onTypeSelect, onNext }) => {
|
|
7810
7619
|
const enumListsMeta = getEnumListTypesMetadata();
|
|
7811
|
-
return /* @__PURE__ */
|
|
7812
|
-
|
|
7620
|
+
return /* @__PURE__ */ React91.createElement(Stack68, { gap: "md" }, /* @__PURE__ */ React91.createElement("div", null, /* @__PURE__ */ React91.createElement(Text43, { size: "lg", fw: 600, mb: "xs" }, "Choose List Type"), /* @__PURE__ */ React91.createElement(Text43, { size: "sm", c: "dimmed" }, "Select the type of list you want to create")), /* @__PURE__ */ React91.createElement(Stack68, { gap: "sm" }, enumListsMeta.map((enumChecklistMeta) => /* @__PURE__ */ React91.createElement(
|
|
7621
|
+
Card21,
|
|
7813
7622
|
{
|
|
7814
7623
|
key: enumChecklistMeta.id,
|
|
7815
7624
|
padding: "md",
|
|
@@ -7821,8 +7630,8 @@ var EnumChecklistTypeSelection = ({ selectedType, onTypeSelect, onNext }) => {
|
|
|
7821
7630
|
},
|
|
7822
7631
|
onClick: () => onTypeSelect(enumChecklistMeta.id)
|
|
7823
7632
|
},
|
|
7824
|
-
/* @__PURE__ */
|
|
7825
|
-
|
|
7633
|
+
/* @__PURE__ */ React91.createElement(Group25, { gap: "md", align: "flex-start" }, /* @__PURE__ */ React91.createElement(
|
|
7634
|
+
Box16,
|
|
7826
7635
|
{
|
|
7827
7636
|
style: {
|
|
7828
7637
|
width: 48,
|
|
@@ -7837,35 +7646,35 @@ var EnumChecklistTypeSelection = ({ selectedType, onTypeSelect, onNext }) => {
|
|
|
7837
7646
|
}
|
|
7838
7647
|
},
|
|
7839
7648
|
enumChecklistMeta.icon
|
|
7840
|
-
), /* @__PURE__ */
|
|
7841
|
-
))), /* @__PURE__ */
|
|
7649
|
+
), /* @__PURE__ */ React91.createElement(Stack68, { gap: 2, style: { flex: 1 } }, /* @__PURE__ */ React91.createElement(Text43, { size: "md", fw: 600 }, enumChecklistMeta.name), /* @__PURE__ */ React91.createElement(Text43, { size: "sm", c: "dimmed" }, enumChecklistMeta.description)))
|
|
7650
|
+
))), /* @__PURE__ */ React91.createElement(Group25, { justify: "flex-end", mt: "md" }, /* @__PURE__ */ React91.createElement(Button20, { onClick: onNext, disabled: !selectedType }, "Next")));
|
|
7842
7651
|
};
|
|
7843
7652
|
|
|
7844
7653
|
// src/mantine/blocks/enumChecklist/EnumChecklistPreviewStep.tsx
|
|
7845
|
-
import
|
|
7846
|
-
import { Stack as
|
|
7654
|
+
import React92 from "react";
|
|
7655
|
+
import { Stack as Stack69, Text as Text44, Button as Button21, Group as Group26 } from "@mantine/core";
|
|
7847
7656
|
var EnumChecklistPreviewStep = ({ listType, onAddToBlock, onPrev }) => {
|
|
7848
7657
|
const renderListComponent = () => {
|
|
7849
7658
|
switch (listType) {
|
|
7850
7659
|
case "oracle_personalities":
|
|
7851
|
-
return /* @__PURE__ */
|
|
7660
|
+
return /* @__PURE__ */ React92.createElement(OraclePersonalitiesEnumList, { items: getEnumListItems(listType) });
|
|
7852
7661
|
default:
|
|
7853
7662
|
return null;
|
|
7854
7663
|
}
|
|
7855
7664
|
};
|
|
7856
|
-
return /* @__PURE__ */
|
|
7665
|
+
return /* @__PURE__ */ React92.createElement(Stack69, { gap: "md" }, /* @__PURE__ */ React92.createElement("div", null, /* @__PURE__ */ React92.createElement(Text44, { size: "lg", fw: 600, mb: "xs" }, "Preview ", getEnumListNameByType(listType)), /* @__PURE__ */ React92.createElement(Text44, { size: "sm", c: "dimmed" }, "Preview how your list will look with the current configuration")), /* @__PURE__ */ React92.createElement("div", { style: { maxHeight: "400px", overflow: "auto" } }, renderListComponent()), /* @__PURE__ */ React92.createElement(Group26, { justify: "space-between", mt: "md" }, /* @__PURE__ */ React92.createElement(Button21, { variant: "subtle", onClick: onPrev }, "Previous"), /* @__PURE__ */ React92.createElement(Button21, { onClick: onAddToBlock }, "Add to Block")));
|
|
7857
7666
|
};
|
|
7858
7667
|
|
|
7859
7668
|
// src/mantine/blocks/enumChecklist/EnumChecklistConfigurationStep.tsx
|
|
7860
|
-
import
|
|
7861
|
-
import { Stack as
|
|
7669
|
+
import React93 from "react";
|
|
7670
|
+
import { Stack as Stack70, TextInput as TextInput35, Text as Text45, Button as Button22, Group as Group27, Switch as Switch4, Select as Select10 } from "@mantine/core";
|
|
7862
7671
|
var EnumChecklistConfigurationStep = ({ enumChecklistType: listType, config, onConfigChange, onPrev, onNext, isValid }) => {
|
|
7863
7672
|
const typeConfig = ENUM_LIST_CONFIG[listType];
|
|
7864
7673
|
const configFields = getEnumListTypesConfigFields(listType);
|
|
7865
7674
|
const renderListConfigField = (field) => {
|
|
7866
7675
|
switch (field.type) {
|
|
7867
7676
|
case "text":
|
|
7868
|
-
return /* @__PURE__ */
|
|
7677
|
+
return /* @__PURE__ */ React93.createElement(
|
|
7869
7678
|
TextInput35,
|
|
7870
7679
|
{
|
|
7871
7680
|
label: field.label,
|
|
@@ -7877,7 +7686,7 @@ var EnumChecklistConfigurationStep = ({ enumChecklistType: listType, config, onC
|
|
|
7877
7686
|
}
|
|
7878
7687
|
);
|
|
7879
7688
|
case "switch":
|
|
7880
|
-
return /* @__PURE__ */
|
|
7689
|
+
return /* @__PURE__ */ React93.createElement(
|
|
7881
7690
|
Switch4,
|
|
7882
7691
|
{
|
|
7883
7692
|
label: field.label,
|
|
@@ -7887,7 +7696,7 @@ var EnumChecklistConfigurationStep = ({ enumChecklistType: listType, config, onC
|
|
|
7887
7696
|
}
|
|
7888
7697
|
);
|
|
7889
7698
|
case "select":
|
|
7890
|
-
return /* @__PURE__ */
|
|
7699
|
+
return /* @__PURE__ */ React93.createElement(
|
|
7891
7700
|
Select10,
|
|
7892
7701
|
{
|
|
7893
7702
|
label: field.label,
|
|
@@ -7900,7 +7709,7 @@ var EnumChecklistConfigurationStep = ({ enumChecklistType: listType, config, onC
|
|
|
7900
7709
|
}
|
|
7901
7710
|
);
|
|
7902
7711
|
default:
|
|
7903
|
-
return /* @__PURE__ */
|
|
7712
|
+
return /* @__PURE__ */ React93.createElement(
|
|
7904
7713
|
TextInput35,
|
|
7905
7714
|
{
|
|
7906
7715
|
label: field.label,
|
|
@@ -7913,14 +7722,14 @@ var EnumChecklistConfigurationStep = ({ enumChecklistType: listType, config, onC
|
|
|
7913
7722
|
);
|
|
7914
7723
|
}
|
|
7915
7724
|
};
|
|
7916
|
-
return /* @__PURE__ */
|
|
7725
|
+
return /* @__PURE__ */ React93.createElement(Stack70, { gap: "md" }, /* @__PURE__ */ React93.createElement("div", null, /* @__PURE__ */ React93.createElement(Text45, { size: "lg", fw: 600, mb: "xs" }, "Configure ", typeConfig.metadata.name), /* @__PURE__ */ React93.createElement(Text45, { size: "sm", c: "dimmed" }, typeConfig.metadata.description)), /* @__PURE__ */ React93.createElement(Stack70, { gap: "sm" }, configFields.map((field) => /* @__PURE__ */ React93.createElement("div", { key: field.key }, renderListConfigField(field)))), /* @__PURE__ */ React93.createElement(Group27, { justify: "space-between", mt: "md" }, /* @__PURE__ */ React93.createElement(Button22, { variant: "subtle", onClick: onPrev }, "Previous"), /* @__PURE__ */ React93.createElement(Button22, { onClick: onNext, disabled: !isValid }, "Next")));
|
|
7917
7726
|
};
|
|
7918
7727
|
|
|
7919
7728
|
// src/mantine/blocks/enumChecklist/EnumChecklistConfigModal.tsx
|
|
7920
7729
|
var EnumChecklistConfigModal = ({ opened, onClose, onSave, initialConfig }) => {
|
|
7921
|
-
const [activeStep, setActiveStep] =
|
|
7922
|
-
const [selectedType, setSelectedType] =
|
|
7923
|
-
const [config, setConfig] =
|
|
7730
|
+
const [activeStep, setActiveStep] = useState23("type");
|
|
7731
|
+
const [selectedType, setSelectedType] = useState23(initialConfig?.listType || null);
|
|
7732
|
+
const [config, setConfig] = useState23(initialConfig?.listConfig || {});
|
|
7924
7733
|
const handleTypeSelect = (type) => {
|
|
7925
7734
|
setSelectedType(type);
|
|
7926
7735
|
const configFieldsByType = getEnumListTypesConfigFields(type);
|
|
@@ -7975,9 +7784,9 @@ var EnumChecklistConfigModal = ({ opened, onClose, onSave, initialConfig }) => {
|
|
|
7975
7784
|
const renderStepContent = () => {
|
|
7976
7785
|
switch (activeStep) {
|
|
7977
7786
|
case "type":
|
|
7978
|
-
return /* @__PURE__ */
|
|
7787
|
+
return /* @__PURE__ */ React94.createElement(EnumChecklistTypeSelection, { selectedType, onTypeSelect: handleTypeSelect, onNext: () => setActiveStep("configure") });
|
|
7979
7788
|
case "configure":
|
|
7980
|
-
return selectedType ? /* @__PURE__ */
|
|
7789
|
+
return selectedType ? /* @__PURE__ */ React94.createElement(
|
|
7981
7790
|
EnumChecklistConfigurationStep,
|
|
7982
7791
|
{
|
|
7983
7792
|
enumChecklistType: selectedType,
|
|
@@ -7989,22 +7798,22 @@ var EnumChecklistConfigModal = ({ opened, onClose, onSave, initialConfig }) => {
|
|
|
7989
7798
|
}
|
|
7990
7799
|
) : null;
|
|
7991
7800
|
case "preview":
|
|
7992
|
-
return selectedType ? /* @__PURE__ */
|
|
7801
|
+
return selectedType ? /* @__PURE__ */ React94.createElement(EnumChecklistPreviewStep, { listType: selectedType, onAddToBlock: handleAddToBlock, onPrev: () => setActiveStep("configure") }) : null;
|
|
7993
7802
|
default:
|
|
7994
7803
|
return null;
|
|
7995
7804
|
}
|
|
7996
7805
|
};
|
|
7997
|
-
return /* @__PURE__ */
|
|
7806
|
+
return /* @__PURE__ */ React94.createElement(Modal, { opened, onClose: handleClose, title: "Configure Enum Checklist Block", size: "xl" }, /* @__PURE__ */ React94.createElement(Group28, { align: "flex-start", gap: "lg", style: { minHeight: "400px" } }, /* @__PURE__ */ React94.createElement(Box17, { style: { width: "200px", flexShrink: 0, height: "400px", display: "flex" } }, /* @__PURE__ */ React94.createElement(ModalNavigation, { steps, activeStep, onStepChange: setActiveStep, showUpdateButton: selectedType !== null, onUpdateBlock: handleAddToBlock })), /* @__PURE__ */ React94.createElement(Box17, { style: { flex: 1 } }, renderStepContent())));
|
|
7998
7807
|
};
|
|
7999
7808
|
|
|
8000
7809
|
// src/mantine/blocks/enumChecklist/EnumChecklistBlock.tsx
|
|
8001
|
-
var IconSettings2 = () => /* @__PURE__ */
|
|
7810
|
+
var IconSettings2 = () => /* @__PURE__ */ React95.createElement("span", null, "\u2699\uFE0F");
|
|
8002
7811
|
var EnumChecklistBlockType = "enumChecklist";
|
|
8003
7812
|
var EnumChecklistBlockContent = ({ block, editor }) => {
|
|
8004
|
-
const [modalOpened, setModalOpened] =
|
|
7813
|
+
const [modalOpened, setModalOpened] = useState24(false);
|
|
8005
7814
|
const { editable } = useBlocknoteContext();
|
|
8006
7815
|
const listType = block.props.listType && block.props.listType !== "" ? block.props.listType : null;
|
|
8007
|
-
const listConfig =
|
|
7816
|
+
const listConfig = useMemo12(() => {
|
|
8008
7817
|
if (block.props.listConfig && block.props.listConfig !== "{}") {
|
|
8009
7818
|
try {
|
|
8010
7819
|
return JSON.parse(block.props.listConfig);
|
|
@@ -8015,7 +7824,7 @@ var EnumChecklistBlockContent = ({ block, editor }) => {
|
|
|
8015
7824
|
}
|
|
8016
7825
|
return {};
|
|
8017
7826
|
}, [block.props.listConfig]);
|
|
8018
|
-
const selectedIds =
|
|
7827
|
+
const selectedIds = useMemo12(() => {
|
|
8019
7828
|
if (block.props.selectedIds && block.props.selectedIds !== "[]") {
|
|
8020
7829
|
try {
|
|
8021
7830
|
return new Set(JSON.parse(block.props.selectedIds));
|
|
@@ -8026,7 +7835,7 @@ var EnumChecklistBlockContent = ({ block, editor }) => {
|
|
|
8026
7835
|
}
|
|
8027
7836
|
return /* @__PURE__ */ new Set();
|
|
8028
7837
|
}, [block.props.selectedIds]);
|
|
8029
|
-
|
|
7838
|
+
useEffect15(() => {
|
|
8030
7839
|
if (listConfig?.selection_mode === "single" && selectedIds.size > 1) {
|
|
8031
7840
|
const arr = Array.from(selectedIds);
|
|
8032
7841
|
const lastSelected = arr.length > 0 ? arr[arr.length - 1] : void 0;
|
|
@@ -8035,13 +7844,13 @@ var EnumChecklistBlockContent = ({ block, editor }) => {
|
|
|
8035
7844
|
});
|
|
8036
7845
|
}
|
|
8037
7846
|
}, [listConfig?.selection_mode, selectedIds]);
|
|
8038
|
-
const isItemChecked =
|
|
7847
|
+
const isItemChecked = useCallback16(
|
|
8039
7848
|
(id) => {
|
|
8040
7849
|
return selectedIds.has(id);
|
|
8041
7850
|
},
|
|
8042
7851
|
[selectedIds]
|
|
8043
7852
|
);
|
|
8044
|
-
const onItemCheck =
|
|
7853
|
+
const onItemCheck = useCallback16(
|
|
8045
7854
|
(id, checked) => {
|
|
8046
7855
|
const currentSelectedIds = Array.from(selectedIds);
|
|
8047
7856
|
let newSelectedIds;
|
|
@@ -8084,7 +7893,7 @@ var EnumChecklistBlockContent = ({ block, editor }) => {
|
|
|
8084
7893
|
if (!listType) return null;
|
|
8085
7894
|
switch (listType) {
|
|
8086
7895
|
case "oracle_personalities":
|
|
8087
|
-
return /* @__PURE__ */
|
|
7896
|
+
return /* @__PURE__ */ React95.createElement(
|
|
8088
7897
|
OraclePersonalitiesEnumList,
|
|
8089
7898
|
{
|
|
8090
7899
|
items: getEnumListItems(listType),
|
|
@@ -8097,7 +7906,7 @@ var EnumChecklistBlockContent = ({ block, editor }) => {
|
|
|
8097
7906
|
return null;
|
|
8098
7907
|
}
|
|
8099
7908
|
};
|
|
8100
|
-
return /* @__PURE__ */
|
|
7909
|
+
return /* @__PURE__ */ React95.createElement(Stack71, { w: "100%" }, listType && /* @__PURE__ */ React95.createElement(Flex16, { align: "center", justify: "space-between", gap: "xs" }, /* @__PURE__ */ React95.createElement(Text46, null, getEnumListNameByType(listType)), listConfig.listSelectionMode && /* @__PURE__ */ React95.createElement(Text46, { lh: 0.5, c: "dimmed" }, listConfig?.selection_mode === "single" ? "Single Selection" : "Multi Selection"), editable && /* @__PURE__ */ React95.createElement(Flex16, { justify: listType ? "space-between" : "flex-end" }, /* @__PURE__ */ React95.createElement(Flex16, { gap: "xs" }, /* @__PURE__ */ React95.createElement(ActionIcon12, { variant: "subtle", size: "sm", onClick: () => setModalOpened(true) }, /* @__PURE__ */ React95.createElement(IconSettings2, null))))), /* @__PURE__ */ React95.createElement(Flex16, { flex: 1 }, !listType ? /* @__PURE__ */ React95.createElement(Center2, { py: "xl" }, /* @__PURE__ */ React95.createElement(Stack71, { align: "center", gap: "sm" }, /* @__PURE__ */ React95.createElement(Text46, { size: "sm", c: "dimmed", ta: "center" }, "No list type configured"), /* @__PURE__ */ React95.createElement(Button23, { size: "sm", variant: "light", onClick: () => setModalOpened(true) }, "Configure List"))) : /* @__PURE__ */ React95.createElement(Stack71, { gap: "md", flex: 1 }, renderListComponent())), /* @__PURE__ */ React95.createElement(
|
|
8101
7910
|
EnumChecklistConfigModal,
|
|
8102
7911
|
{
|
|
8103
7912
|
opened: modalOpened,
|
|
@@ -8129,7 +7938,7 @@ var EnumChecklistBlock = createReactBlockSpec6(
|
|
|
8129
7938
|
content: "none"
|
|
8130
7939
|
},
|
|
8131
7940
|
{
|
|
8132
|
-
render: (props) => /* @__PURE__ */
|
|
7941
|
+
render: (props) => /* @__PURE__ */ React95.createElement(EnumChecklistBlockContent, { ...props })
|
|
8133
7942
|
}
|
|
8134
7943
|
);
|
|
8135
7944
|
|
|
@@ -8228,15 +8037,15 @@ blockRegistry.register({
|
|
|
8228
8037
|
});
|
|
8229
8038
|
|
|
8230
8039
|
// src/mantine/blocks/hooks/useBlockDependencies.ts
|
|
8231
|
-
import { useMemo as
|
|
8040
|
+
import { useMemo as useMemo13, useEffect as useEffect16, useState as useState25, useCallback as useCallback17 } from "react";
|
|
8232
8041
|
|
|
8233
8042
|
// src/mantine/blocks/hooks/useDependsOn.ts
|
|
8234
|
-
import { useMemo as
|
|
8043
|
+
import { useMemo as useMemo14 } from "react";
|
|
8235
8044
|
|
|
8236
8045
|
// src/mantine/blocks/index.ts
|
|
8237
8046
|
var blockSpecs = {
|
|
8238
8047
|
checkbox: CheckboxBlockSpec,
|
|
8239
|
-
list:
|
|
8048
|
+
list: ListBlockSpec,
|
|
8240
8049
|
enumChecklist: EnumChecklistBlock,
|
|
8241
8050
|
overview: OverviewBlock,
|
|
8242
8051
|
proposal: ProposalBlockSpec,
|
|
@@ -8416,12 +8225,7 @@ var getExtraSlashMenuItems = (editor) => {
|
|
|
8416
8225
|
|
|
8417
8226
|
// src/mantine/hooks/useCreateIxoEditor.ts
|
|
8418
8227
|
import { useCreateBlockNote } from "@blocknote/react";
|
|
8419
|
-
import {
|
|
8420
|
-
BlockNoteSchema,
|
|
8421
|
-
defaultBlockSpecs,
|
|
8422
|
-
defaultInlineContentSpecs,
|
|
8423
|
-
defaultStyleSpecs
|
|
8424
|
-
} from "@blocknote/core";
|
|
8228
|
+
import { BlockNoteSchema, defaultBlockSpecs, defaultInlineContentSpecs, defaultStyleSpecs } from "@blocknote/core";
|
|
8425
8229
|
function useCreateIxoEditor(options) {
|
|
8426
8230
|
const {
|
|
8427
8231
|
theme = "light",
|
|
@@ -8487,21 +8291,15 @@ import { useCreateBlockNote as useCreateBlockNote2 } from "@blocknote/react";
|
|
|
8487
8291
|
import { BlockNoteSchema as BlockNoteSchema2, defaultBlockSpecs as defaultBlockSpecs2, defaultInlineContentSpecs as defaultInlineContentSpecs2, defaultStyleSpecs as defaultStyleSpecs2 } from "@blocknote/core";
|
|
8488
8292
|
|
|
8489
8293
|
// src/core/hooks/useMatrixProvider.ts
|
|
8490
|
-
import { useEffect as
|
|
8294
|
+
import { useEffect as useEffect17, useState as useState26, useRef as useRef3, useCallback as useCallback18, useMemo as useMemo15 } from "react";
|
|
8491
8295
|
import { MatrixProvider } from "@ixo/matrix-crdt";
|
|
8492
|
-
function useMatrixProvider({
|
|
8493
|
-
|
|
8494
|
-
|
|
8495
|
-
yDoc
|
|
8496
|
-
}) {
|
|
8497
|
-
const [matrixProvider, setProvider] = useState27(null);
|
|
8498
|
-
const [status, setStatus] = useState27(
|
|
8499
|
-
"disconnected"
|
|
8500
|
-
);
|
|
8296
|
+
function useMatrixProvider({ matrixClient, roomId, yDoc }) {
|
|
8297
|
+
const [matrixProvider, setProvider] = useState26(null);
|
|
8298
|
+
const [status, setStatus] = useState26("disconnected");
|
|
8501
8299
|
const isMountedRef = useRef3(true);
|
|
8502
8300
|
const providerRef = useRef3(null);
|
|
8503
8301
|
const retryTimeoutRef = useRef3(null);
|
|
8504
|
-
const providerOptions =
|
|
8302
|
+
const providerOptions = useMemo15(
|
|
8505
8303
|
() => ({
|
|
8506
8304
|
translator: {
|
|
8507
8305
|
updateEventType: "matrix-crdt.doc_update",
|
|
@@ -8514,22 +8312,22 @@ function useMatrixProvider({
|
|
|
8514
8312
|
}),
|
|
8515
8313
|
[]
|
|
8516
8314
|
);
|
|
8517
|
-
const handleDocumentAvailable =
|
|
8315
|
+
const handleDocumentAvailable = useCallback18(() => {
|
|
8518
8316
|
if (isMountedRef.current) {
|
|
8519
8317
|
setStatus("connected");
|
|
8520
8318
|
}
|
|
8521
8319
|
}, []);
|
|
8522
|
-
const handleDocumentUnavailable =
|
|
8320
|
+
const handleDocumentUnavailable = useCallback18(() => {
|
|
8523
8321
|
if (isMountedRef.current) {
|
|
8524
8322
|
setStatus("failed");
|
|
8525
8323
|
}
|
|
8526
8324
|
}, []);
|
|
8527
|
-
const handleCanWriteChanged =
|
|
8325
|
+
const handleCanWriteChanged = useCallback18(() => {
|
|
8528
8326
|
if (isMountedRef.current && providerRef.current) {
|
|
8529
8327
|
setStatus(providerRef.current.canWrite ? "connected" : "failed");
|
|
8530
8328
|
}
|
|
8531
8329
|
}, []);
|
|
8532
|
-
const initProvider =
|
|
8330
|
+
const initProvider = useCallback18(async () => {
|
|
8533
8331
|
if (!isMountedRef.current) return;
|
|
8534
8332
|
if (retryTimeoutRef.current) {
|
|
8535
8333
|
clearTimeout(retryTimeoutRef.current);
|
|
@@ -8540,12 +8338,7 @@ function useMatrixProvider({
|
|
|
8540
8338
|
const client = matrixClient;
|
|
8541
8339
|
client.canSupportVoip = false;
|
|
8542
8340
|
client.clientOpts = { lazyLoadMembers: true };
|
|
8543
|
-
const provider = new MatrixProvider(
|
|
8544
|
-
yDoc,
|
|
8545
|
-
client,
|
|
8546
|
-
{ type: "id", id: roomId },
|
|
8547
|
-
providerOptions
|
|
8548
|
-
);
|
|
8341
|
+
const provider = new MatrixProvider(yDoc, client, { type: "id", id: roomId }, providerOptions);
|
|
8549
8342
|
providerRef.current = provider;
|
|
8550
8343
|
provider.onDocumentAvailable(handleDocumentAvailable);
|
|
8551
8344
|
provider.onDocumentUnavailable(handleDocumentUnavailable);
|
|
@@ -8567,14 +8360,8 @@ function useMatrixProvider({
|
|
|
8567
8360
|
}, 5e3);
|
|
8568
8361
|
}
|
|
8569
8362
|
}
|
|
8570
|
-
}, [
|
|
8571
|
-
|
|
8572
|
-
providerOptions,
|
|
8573
|
-
handleDocumentAvailable,
|
|
8574
|
-
handleDocumentUnavailable,
|
|
8575
|
-
handleCanWriteChanged
|
|
8576
|
-
]);
|
|
8577
|
-
useEffect18(() => {
|
|
8363
|
+
}, [matrixClient, providerOptions, handleDocumentAvailable, handleDocumentUnavailable, handleCanWriteChanged]);
|
|
8364
|
+
useEffect17(() => {
|
|
8578
8365
|
isMountedRef.current = true;
|
|
8579
8366
|
initProvider();
|
|
8580
8367
|
return () => {
|
|
@@ -8591,7 +8378,7 @@ function useMatrixProvider({
|
|
|
8591
8378
|
setStatus("disconnected");
|
|
8592
8379
|
};
|
|
8593
8380
|
}, [initProvider]);
|
|
8594
|
-
|
|
8381
|
+
useEffect17(() => {
|
|
8595
8382
|
return () => {
|
|
8596
8383
|
isMountedRef.current = false;
|
|
8597
8384
|
};
|
|
@@ -8600,17 +8387,17 @@ function useMatrixProvider({
|
|
|
8600
8387
|
}
|
|
8601
8388
|
|
|
8602
8389
|
// src/mantine/hooks/useCollaborativeYDoc.ts
|
|
8603
|
-
import { useMemo as
|
|
8390
|
+
import { useMemo as useMemo16 } from "react";
|
|
8604
8391
|
import * as Y from "yjs";
|
|
8605
8392
|
function useCollaborativeYDoc(_options) {
|
|
8606
|
-
return
|
|
8393
|
+
return useMemo16(() => {
|
|
8607
8394
|
const doc = new Y.Doc();
|
|
8608
8395
|
return doc;
|
|
8609
8396
|
}, []);
|
|
8610
8397
|
}
|
|
8611
8398
|
|
|
8612
8399
|
// src/mantine/hooks/useCollaborativeIxoEditor.ts
|
|
8613
|
-
import { useMemo as
|
|
8400
|
+
import { useMemo as useMemo17, useEffect as useEffect18 } from "react";
|
|
8614
8401
|
function useCreateCollaborativeIxoEditor(options) {
|
|
8615
8402
|
const yDoc = useCollaborativeYDoc(options);
|
|
8616
8403
|
const {
|
|
@@ -8626,9 +8413,9 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
8626
8413
|
tableHandles = true,
|
|
8627
8414
|
user,
|
|
8628
8415
|
matrixClient,
|
|
8629
|
-
permissions = {
|
|
8416
|
+
permissions = { write: false }
|
|
8630
8417
|
} = options || {};
|
|
8631
|
-
const memoizedUser =
|
|
8418
|
+
const memoizedUser = useMemo17(
|
|
8632
8419
|
() => ({
|
|
8633
8420
|
id: user?.id || "",
|
|
8634
8421
|
name: user?.name || "",
|
|
@@ -8643,7 +8430,7 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
8643
8430
|
matrixClient,
|
|
8644
8431
|
roomId: options.roomId
|
|
8645
8432
|
});
|
|
8646
|
-
const defaultUploadFile =
|
|
8433
|
+
const defaultUploadFile = useMemo17(
|
|
8647
8434
|
() => uploadFile || (async (file) => {
|
|
8648
8435
|
return new Promise((resolve, reject) => {
|
|
8649
8436
|
const reader = new FileReader();
|
|
@@ -8657,7 +8444,7 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
8657
8444
|
}),
|
|
8658
8445
|
[uploadFile]
|
|
8659
8446
|
);
|
|
8660
|
-
const schema =
|
|
8447
|
+
const schema = useMemo17(
|
|
8661
8448
|
() => BlockNoteSchema2.create({
|
|
8662
8449
|
blockSpecs: {
|
|
8663
8450
|
...defaultBlockSpecs2,
|
|
@@ -8672,11 +8459,11 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
8672
8459
|
}),
|
|
8673
8460
|
[]
|
|
8674
8461
|
);
|
|
8675
|
-
const root =
|
|
8676
|
-
const documentFragment =
|
|
8677
|
-
const flowArray =
|
|
8678
|
-
const userFragment =
|
|
8679
|
-
const collaborationConfig =
|
|
8462
|
+
const root = useMemo17(() => yDoc.getMap("root"), [yDoc]);
|
|
8463
|
+
const documentFragment = useMemo17(() => yDoc.getXmlFragment("document"), [yDoc]);
|
|
8464
|
+
const flowArray = useMemo17(() => yDoc.getArray("flow"), [yDoc]);
|
|
8465
|
+
const userFragment = useMemo17(() => yDoc.getMap(memoizedUser.id), [yDoc, memoizedUser.id]);
|
|
8466
|
+
const collaborationConfig = useMemo17(
|
|
8680
8467
|
() => ({
|
|
8681
8468
|
provider: matrixProvider,
|
|
8682
8469
|
fragment: documentFragment,
|
|
@@ -8688,7 +8475,7 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
8688
8475
|
}),
|
|
8689
8476
|
[matrixProvider, documentFragment, memoizedUser.name, memoizedUser.color]
|
|
8690
8477
|
);
|
|
8691
|
-
const ixoConfig =
|
|
8478
|
+
const ixoConfig = useMemo17(
|
|
8692
8479
|
() => ({
|
|
8693
8480
|
theme,
|
|
8694
8481
|
editable,
|
|
@@ -8707,7 +8494,7 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
8707
8494
|
uploadFile: defaultUploadFile,
|
|
8708
8495
|
collaboration: collaborationConfig
|
|
8709
8496
|
});
|
|
8710
|
-
const titleText =
|
|
8497
|
+
const titleText = useMemo17(() => yDoc.getText("title"), [yDoc]);
|
|
8711
8498
|
let ixoEditor;
|
|
8712
8499
|
if (editor) {
|
|
8713
8500
|
ixoEditor = editor;
|
|
@@ -8720,6 +8507,10 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
8720
8507
|
return userFragment.get(block.id) || {};
|
|
8721
8508
|
};
|
|
8722
8509
|
ixoEditor.updateUserProps = (block, updates) => {
|
|
8510
|
+
if (!permissions.write) {
|
|
8511
|
+
console.warn("Cannot update user props: write permission denied");
|
|
8512
|
+
return;
|
|
8513
|
+
}
|
|
8723
8514
|
const prev = userFragment.get(block.id) || {};
|
|
8724
8515
|
userFragment.set(block.id, { ...prev, ...updates });
|
|
8725
8516
|
};
|
|
@@ -8735,6 +8526,10 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
8735
8526
|
};
|
|
8736
8527
|
};
|
|
8737
8528
|
ixoEditor.updateFlowMetadata = (updates) => {
|
|
8529
|
+
if (!permissions.write) {
|
|
8530
|
+
console.warn("Cannot update flow metadata: write permission denied");
|
|
8531
|
+
return;
|
|
8532
|
+
}
|
|
8738
8533
|
Object.entries(updates).forEach(([key, value]) => {
|
|
8739
8534
|
if (key === "title") {
|
|
8740
8535
|
titleText.delete(0, titleText.length);
|
|
@@ -8749,15 +8544,19 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
8749
8544
|
};
|
|
8750
8545
|
ixoEditor.getDocType = () => root.get("docType") || "";
|
|
8751
8546
|
ixoEditor.setDocType = (value) => {
|
|
8547
|
+
if (!permissions.write) {
|
|
8548
|
+
console.warn("Cannot set doc type: write permission denied");
|
|
8549
|
+
return;
|
|
8550
|
+
}
|
|
8752
8551
|
root.set("docType", value);
|
|
8753
8552
|
};
|
|
8754
8553
|
}
|
|
8755
|
-
|
|
8554
|
+
useEffect18(() => {
|
|
8756
8555
|
if (ixoEditor) {
|
|
8757
8556
|
ixoEditor.isEditable = editable;
|
|
8758
8557
|
}
|
|
8759
8558
|
}, [ixoEditor, editable]);
|
|
8760
|
-
|
|
8559
|
+
useEffect18(() => {
|
|
8761
8560
|
if (connectionStatus !== "connected") {
|
|
8762
8561
|
return;
|
|
8763
8562
|
}
|
|
@@ -8790,19 +8589,19 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
8790
8589
|
}
|
|
8791
8590
|
|
|
8792
8591
|
// src/mantine/IxoEditor.tsx
|
|
8793
|
-
import
|
|
8592
|
+
import React97 from "react";
|
|
8794
8593
|
import { getDefaultReactSlashMenuItems, SuggestionMenuController } from "@blocknote/react";
|
|
8795
8594
|
import { BlockNoteView } from "@blocknote/mantine";
|
|
8796
8595
|
import { filterSuggestionItems } from "@blocknote/core";
|
|
8797
8596
|
import { MantineProvider } from "@mantine/core";
|
|
8798
8597
|
|
|
8799
8598
|
// src/mantine/components/PanelContent.tsx
|
|
8800
|
-
import
|
|
8599
|
+
import React96 from "react";
|
|
8801
8600
|
function PanelContent() {
|
|
8802
8601
|
const { activePanel, registeredPanels } = usePanelStore();
|
|
8803
8602
|
const isOpen = activePanel !== null;
|
|
8804
8603
|
const content = activePanel ? registeredPanels.get(activePanel) : null;
|
|
8805
|
-
return /* @__PURE__ */
|
|
8604
|
+
return /* @__PURE__ */ React96.createElement(
|
|
8806
8605
|
"div",
|
|
8807
8606
|
{
|
|
8808
8607
|
style: {
|
|
@@ -8826,41 +8625,34 @@ function IxoEditorContent({
|
|
|
8826
8625
|
onSelectionChange,
|
|
8827
8626
|
children
|
|
8828
8627
|
}) {
|
|
8829
|
-
return /* @__PURE__ */
|
|
8830
|
-
|
|
8628
|
+
return /* @__PURE__ */ React97.createElement("div", { style: { display: "flex", height: "100%" } }, /* @__PURE__ */ React97.createElement("div", { className: `ixo-editor ixo-editor--theme-${config.theme} ${className}`, style: { flex: 1 } }, /* @__PURE__ */ React97.createElement(
|
|
8629
|
+
BlockNoteView,
|
|
8831
8630
|
{
|
|
8832
|
-
|
|
8833
|
-
|
|
8631
|
+
editor,
|
|
8632
|
+
editable: isEditable,
|
|
8633
|
+
sideMenu: config.sideMenu,
|
|
8634
|
+
slashMenu: false,
|
|
8635
|
+
formattingToolbar: config.formattingToolbar,
|
|
8636
|
+
linkToolbar: config.linkToolbar,
|
|
8637
|
+
filePanel: config.filePanel,
|
|
8638
|
+
tableHandles: config.tableHandles,
|
|
8639
|
+
theme: config.theme,
|
|
8640
|
+
onChange,
|
|
8641
|
+
onSelectionChange
|
|
8834
8642
|
},
|
|
8835
|
-
/* @__PURE__ */
|
|
8836
|
-
|
|
8643
|
+
config.slashMenu && /* @__PURE__ */ React97.createElement(
|
|
8644
|
+
SuggestionMenuController,
|
|
8837
8645
|
{
|
|
8838
|
-
|
|
8839
|
-
|
|
8840
|
-
|
|
8841
|
-
|
|
8842
|
-
|
|
8843
|
-
linkToolbar: config.linkToolbar,
|
|
8844
|
-
filePanel: config.filePanel,
|
|
8845
|
-
tableHandles: config.tableHandles,
|
|
8846
|
-
theme: config.theme,
|
|
8847
|
-
onChange,
|
|
8848
|
-
onSelectionChange
|
|
8849
|
-
},
|
|
8850
|
-
config.slashMenu && /* @__PURE__ */ React96.createElement(
|
|
8851
|
-
SuggestionMenuController,
|
|
8852
|
-
{
|
|
8853
|
-
triggerCharacter: "/",
|
|
8854
|
-
getItems: async (query) => {
|
|
8855
|
-
const defaultItems = getDefaultReactSlashMenuItems(editor);
|
|
8856
|
-
const customItems = getExtraSlashMenuItems(editor);
|
|
8857
|
-
return filterSuggestionItems([...defaultItems, ...customItems], query);
|
|
8858
|
-
}
|
|
8646
|
+
triggerCharacter: "/",
|
|
8647
|
+
getItems: async (query) => {
|
|
8648
|
+
const defaultItems = getDefaultReactSlashMenuItems(editor);
|
|
8649
|
+
const customItems = getExtraSlashMenuItems(editor);
|
|
8650
|
+
return filterSuggestionItems([...defaultItems, ...customItems], query);
|
|
8859
8651
|
}
|
|
8860
|
-
|
|
8861
|
-
|
|
8862
|
-
|
|
8863
|
-
), /* @__PURE__ */
|
|
8652
|
+
}
|
|
8653
|
+
),
|
|
8654
|
+
children
|
|
8655
|
+
)), /* @__PURE__ */ React97.createElement(PanelContent, null));
|
|
8864
8656
|
}
|
|
8865
8657
|
function IxoEditor({
|
|
8866
8658
|
editor,
|
|
@@ -8886,29 +8678,9 @@ function IxoEditor({
|
|
|
8886
8678
|
tableHandles: true
|
|
8887
8679
|
};
|
|
8888
8680
|
const isEditable = editable;
|
|
8889
|
-
const editorContent = /* @__PURE__ */
|
|
8890
|
-
BlocknoteProvider,
|
|
8891
|
-
{
|
|
8892
|
-
editor,
|
|
8893
|
-
handlers,
|
|
8894
|
-
blockRequirements,
|
|
8895
|
-
editable: isEditable
|
|
8896
|
-
},
|
|
8897
|
-
/* @__PURE__ */ React96.createElement(
|
|
8898
|
-
IxoEditorContent,
|
|
8899
|
-
{
|
|
8900
|
-
editor,
|
|
8901
|
-
config,
|
|
8902
|
-
isEditable,
|
|
8903
|
-
className,
|
|
8904
|
-
onChange,
|
|
8905
|
-
onSelectionChange
|
|
8906
|
-
},
|
|
8907
|
-
children
|
|
8908
|
-
)
|
|
8909
|
-
);
|
|
8681
|
+
const editorContent = /* @__PURE__ */ React97.createElement(BlocknoteProvider, { editor, handlers, blockRequirements, editable: isEditable }, /* @__PURE__ */ React97.createElement(IxoEditorContent, { editor, config, isEditable, className, onChange, onSelectionChange }, children));
|
|
8910
8682
|
if (mantineTheme) {
|
|
8911
|
-
return /* @__PURE__ */
|
|
8683
|
+
return /* @__PURE__ */ React97.createElement(MantineProvider, { theme: mantineTheme }, editorContent);
|
|
8912
8684
|
}
|
|
8913
8685
|
return editorContent;
|
|
8914
8686
|
}
|
|
@@ -8941,9 +8713,7 @@ var GraphQLClient = class {
|
|
|
8941
8713
|
return result.data;
|
|
8942
8714
|
}
|
|
8943
8715
|
};
|
|
8944
|
-
var ixoGraphQLClient = new GraphQLClient(
|
|
8945
|
-
"https://devnet-blocksync-graphql.ixo.earth/graphql"
|
|
8946
|
-
);
|
|
8716
|
+
var ixoGraphQLClient = new GraphQLClient("https://devnet-blocksync-graphql.ixo.earth/graphql");
|
|
8947
8717
|
|
|
8948
8718
|
// src/core/lib/graphql-queries.ts
|
|
8949
8719
|
var ENTITY_QUERY = `
|
|
@@ -8978,7 +8748,7 @@ export {
|
|
|
8978
8748
|
useBlocknoteContext,
|
|
8979
8749
|
useBlocknoteHandlers,
|
|
8980
8750
|
CheckboxBlockSpec,
|
|
8981
|
-
|
|
8751
|
+
ListBlockSpec,
|
|
8982
8752
|
OverviewBlock,
|
|
8983
8753
|
StakeType,
|
|
8984
8754
|
AuthzExecActionTypes,
|
|
@@ -8994,4 +8764,4 @@ export {
|
|
|
8994
8764
|
ixoGraphQLClient,
|
|
8995
8765
|
getEntity
|
|
8996
8766
|
};
|
|
8997
|
-
//# sourceMappingURL=chunk-
|
|
8767
|
+
//# sourceMappingURL=chunk-NJ34FIYQ.mjs.map
|