@ixo/editor 5.9.1 → 5.10.1
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-OO42QPEG.mjs → chunk-DQCYLHDD.mjs} +69 -11
- package/dist/chunk-DQCYLHDD.mjs.map +1 -0
- package/dist/{chunk-MOPZZGGR.mjs → chunk-JBVGVTIA.mjs} +674 -435
- package/dist/chunk-JBVGVTIA.mjs.map +1 -0
- package/dist/{chunk-V7HASCLL.mjs → chunk-UKZ5T7V4.mjs} +2 -2
- package/dist/core/index.d.ts +7 -5
- package/dist/core/index.mjs +2 -2
- package/dist/{decompile-C29wGJ7k.d.ts → decompile-BKY8P5Q_.d.ts} +1 -1
- package/dist/graphql-client-BWqRGWY6.d.ts +691 -0
- package/dist/{index-7l_Wftr_.d.ts → index-DKKQa1q-.d.ts} +2428 -2
- package/dist/index.d.ts +3 -3
- package/dist/index.mjs +7 -5
- package/dist/index.mjs.map +1 -1
- package/dist/mantine/index.d.ts +3 -4
- package/dist/mantine/index.mjs +2 -2
- package/package.json +1 -1
- package/dist/chunk-MOPZZGGR.mjs.map +0 -1
- package/dist/chunk-OO42QPEG.mjs.map +0 -1
- package/dist/graphql-client-B0OmwaaY.d.ts +0 -3075
- /package/dist/{chunk-V7HASCLL.mjs.map → chunk-UKZ5T7V4.mjs.map} +0 -0
|
@@ -12,6 +12,8 @@ import {
|
|
|
12
12
|
executeNode,
|
|
13
13
|
extractSurveyAnswerSchema,
|
|
14
14
|
extractSurveyAnswersTemplate,
|
|
15
|
+
formatCoin,
|
|
16
|
+
formatCoinAmount,
|
|
15
17
|
getAction,
|
|
16
18
|
getActiveEditor,
|
|
17
19
|
getAllActions,
|
|
@@ -20,12 +22,15 @@ import {
|
|
|
20
22
|
getOutputSchemaForBlock,
|
|
21
23
|
hasDiffResolver,
|
|
22
24
|
isAuthorized,
|
|
25
|
+
microAmountToAmount,
|
|
26
|
+
numberFormatter,
|
|
23
27
|
parseAttendeesField,
|
|
24
28
|
parseCalendarEventCreateInputs,
|
|
25
29
|
parseLinkedEntities,
|
|
26
30
|
readPendingInvocations,
|
|
27
31
|
reconcilePendingInvocations,
|
|
28
32
|
removePendingInvocation,
|
|
33
|
+
renderNumber,
|
|
29
34
|
resolveActionType,
|
|
30
35
|
resolveEntityTypeFromSchema,
|
|
31
36
|
sendDirectMessage,
|
|
@@ -34,7 +39,7 @@ import {
|
|
|
34
39
|
tempDomainCreatorSurvey,
|
|
35
40
|
transformSurveyToCredentialSubject,
|
|
36
41
|
writeRunRecordAndReconcile
|
|
37
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-DQCYLHDD.mjs";
|
|
38
43
|
|
|
39
44
|
// src/mantine/hooks/useCreateIxoEditor.ts
|
|
40
45
|
import { useCreateBlockNote } from "@blocknote/react";
|
|
@@ -1547,7 +1552,8 @@ var BlocknoteProvider = ({
|
|
|
1547
1552
|
domainCardRenderer,
|
|
1548
1553
|
mapConfig,
|
|
1549
1554
|
connectedUsers,
|
|
1550
|
-
awarenessInstance
|
|
1555
|
+
awarenessInstance,
|
|
1556
|
+
translate
|
|
1551
1557
|
}) => {
|
|
1552
1558
|
const [sharedProposals, setSharedProposals] = useState3({});
|
|
1553
1559
|
const sharedProposalsRef = useRef3({});
|
|
@@ -1694,7 +1700,8 @@ var BlocknoteProvider = ({
|
|
|
1694
1700
|
domainCardRenderer,
|
|
1695
1701
|
mapConfig,
|
|
1696
1702
|
connectedUsers,
|
|
1697
|
-
awarenessInstance
|
|
1703
|
+
awarenessInstance,
|
|
1704
|
+
translate
|
|
1698
1705
|
}
|
|
1699
1706
|
},
|
|
1700
1707
|
children
|
|
@@ -1714,6 +1721,18 @@ var useBlocknoteHandlers = () => {
|
|
|
1714
1721
|
}
|
|
1715
1722
|
return handlers;
|
|
1716
1723
|
};
|
|
1724
|
+
var useTranslate = () => {
|
|
1725
|
+
const { translate } = useBlocknoteContext();
|
|
1726
|
+
const translateRef = useRef3(translate);
|
|
1727
|
+
useEffect4(() => {
|
|
1728
|
+
translateRef.current = translate;
|
|
1729
|
+
}, [translate]);
|
|
1730
|
+
return useCallback4((key, opts) => {
|
|
1731
|
+
const fn = translateRef.current;
|
|
1732
|
+
if (fn) return fn(key, opts);
|
|
1733
|
+
return opts?.defaultValue ?? key;
|
|
1734
|
+
}, []);
|
|
1735
|
+
};
|
|
1717
1736
|
|
|
1718
1737
|
// src/mantine/hooks/useBlockPresence.ts
|
|
1719
1738
|
function useBlockPresence(blockId, options) {
|
|
@@ -4831,44 +4850,6 @@ var CollectionsList = ({ items, isMultiSelect, isItemChecked, onItemCheck }) =>
|
|
|
4831
4850
|
// src/mantine/blocks/list/balances/BalancesList.tsx
|
|
4832
4851
|
import React40 from "react";
|
|
4833
4852
|
import { Text as Text20, Box as Box7, Stack as Stack22, Flex as Flex9, Avatar, Group as Group11 } from "@mantine/core";
|
|
4834
|
-
|
|
4835
|
-
// src/core/utils/numbers.ts
|
|
4836
|
-
var numberFormatter = (num, digits) => {
|
|
4837
|
-
const lookup = [
|
|
4838
|
-
{ value: 1, symbol: "" },
|
|
4839
|
-
{ value: 1e3, symbol: "k" },
|
|
4840
|
-
{ value: 1e6, symbol: "M" },
|
|
4841
|
-
{ value: 1e9, symbol: "G" },
|
|
4842
|
-
{ value: 1e12, symbol: "T" },
|
|
4843
|
-
{ value: 1e15, symbol: "P" },
|
|
4844
|
-
{ value: 1e18, symbol: "E" }
|
|
4845
|
-
];
|
|
4846
|
-
const rx = /\.0+$|(\.[0-9]*[1-9])0+$/;
|
|
4847
|
-
const item = lookup.slice().reverse().find((lookupItem) => num >= lookupItem.value);
|
|
4848
|
-
return item ? (num / item.value).toFixed(digits).replace(rx, "$1") + item.symbol : "0";
|
|
4849
|
-
};
|
|
4850
|
-
var microAmountToAmount = (microAmount, microUnits = 6) => {
|
|
4851
|
-
const amount = (microAmount ?? 0) / Math.pow(10, microUnits);
|
|
4852
|
-
return amount;
|
|
4853
|
-
};
|
|
4854
|
-
function renderNumber(value) {
|
|
4855
|
-
if (value === 0) return "0";
|
|
4856
|
-
if (!value) return "";
|
|
4857
|
-
const formattedValue = value.toLocaleString(void 0, { minimumFractionDigits: 0, maximumFractionDigits: 6 });
|
|
4858
|
-
return formattedValue;
|
|
4859
|
-
}
|
|
4860
|
-
var formatCoinAmount = (coin, assetsList) => {
|
|
4861
|
-
const pair = assetsList.find((item) => item.display === coin.denom || item.base === coin.denom);
|
|
4862
|
-
if (!pair) {
|
|
4863
|
-
return `${coin.amount} ${coin.denom}`;
|
|
4864
|
-
}
|
|
4865
|
-
const exponent = pair.denomUnits.find((u) => u.denom === pair.display)?.exponent ?? 0;
|
|
4866
|
-
const amount = Number(coin.amount) / Math.pow(10, exponent);
|
|
4867
|
-
const displayDenom = pair.display.toUpperCase();
|
|
4868
|
-
return `${amount.toLocaleString(void 0, { maximumFractionDigits: 6 })} ${displayDenom}`;
|
|
4869
|
-
};
|
|
4870
|
-
|
|
4871
|
-
// src/mantine/blocks/list/balances/BalancesList.tsx
|
|
4872
4853
|
var BalancesList = ({ items, isMultiSelect, isItemChecked, onItemCheck }) => {
|
|
4873
4854
|
if (!items || items.length === 0) {
|
|
4874
4855
|
return /* @__PURE__ */ React40.createElement(Text20, { size: "sm", c: "dimmed", ta: "center", py: "md" }, "No balances found");
|
|
@@ -19947,7 +19928,7 @@ function SlideToSign({ onSign, label = "Slide to Sign", disabled }) {
|
|
|
19947
19928
|
onChangeEnd: handleSlideEnd,
|
|
19948
19929
|
disabled,
|
|
19949
19930
|
size: "xl",
|
|
19950
|
-
thumbChildren: /* @__PURE__ */ React205.createElement(Flex31, { align: "center", gap: "sm" }, /* @__PURE__ */ React205.createElement(IconFeather2, { color: disabled ? "var(--mantine-color-neutralColor-9)" : "var(--mantine-color-
|
|
19931
|
+
thumbChildren: /* @__PURE__ */ React205.createElement(Flex31, { align: "center", gap: "sm" }, /* @__PURE__ */ React205.createElement(IconFeather2, { color: disabled ? "var(--mantine-color-neutralColor-9)" : "var(--mantine-color-black)", strokeWidth: "1.2" }), /* @__PURE__ */ React205.createElement(Text116, { c: disabled ? "neutralColor.9" : "var(--mantine-color-black)", fz: 14 }, label)),
|
|
19951
19932
|
thumbSize: 42,
|
|
19952
19933
|
styles: {
|
|
19953
19934
|
root: { width: "100%", opacity: disabled ? 0.4 : 1, transition: "opacity 200ms ease" },
|
|
@@ -23617,6 +23598,7 @@ function GenericInputsEditor({ inputs, onInputsChange, editor, blockId }) {
|
|
|
23617
23598
|
|
|
23618
23599
|
// src/mantine/blocks/action/template/TemplateConfig.tsx
|
|
23619
23600
|
var TemplateConfig16 = ({ editor, block }) => {
|
|
23601
|
+
const t = useTranslate();
|
|
23620
23602
|
const { closePanel } = usePanelStore();
|
|
23621
23603
|
const isValid = useMemo86(() => {
|
|
23622
23604
|
const title = (block.props.title || "").trim();
|
|
@@ -23661,7 +23643,7 @@ var TemplateConfig16 = ({ editor, block }) => {
|
|
|
23661
23643
|
);
|
|
23662
23644
|
const tabs = [
|
|
23663
23645
|
{
|
|
23664
|
-
label: "General",
|
|
23646
|
+
label: t("actionBlock.tabs.general", { defaultValue: "General" }),
|
|
23665
23647
|
value: "general",
|
|
23666
23648
|
icon: icon(IconSettings18),
|
|
23667
23649
|
content: /* @__PURE__ */ React237.createElement(Stack157, { gap: 20 }, /* @__PURE__ */ React237.createElement(
|
|
@@ -23686,34 +23668,34 @@ var TemplateConfig16 = ({ editor, block }) => {
|
|
|
23686
23668
|
editor,
|
|
23687
23669
|
blockId: block.id
|
|
23688
23670
|
}
|
|
23689
|
-
), /* @__PURE__ */ React237.createElement(BasePrimaryButton, { leftSection: /* @__PURE__ */ React237.createElement(IconCheck15, { size: 20 }), onClick: closePanel, disabled: !isValid, mt: 4, style: { alignSelf: "flex-start" } }, "Save"))
|
|
23671
|
+
), /* @__PURE__ */ React237.createElement(BasePrimaryButton, { leftSection: /* @__PURE__ */ React237.createElement(IconCheck15, { size: 20 }), onClick: closePanel, disabled: !isValid, mt: 4, style: { alignSelf: "flex-start" } }, t("actionBlock.save", { defaultValue: "Save" })))
|
|
23690
23672
|
},
|
|
23691
23673
|
{
|
|
23692
|
-
label: "Authorization",
|
|
23674
|
+
label: t("actionBlock.tabs.authorization", { defaultValue: "Authorization" }),
|
|
23693
23675
|
value: "authorization",
|
|
23694
23676
|
icon: icon(IconShieldCheck13),
|
|
23695
23677
|
content: /* @__PURE__ */ React237.createElement(AuthorizationTab, { editor, block })
|
|
23696
23678
|
},
|
|
23697
23679
|
{
|
|
23698
|
-
label: "Assignment",
|
|
23680
|
+
label: t("actionBlock.tabs.assignment", { defaultValue: "Assignment" }),
|
|
23699
23681
|
value: "assignment",
|
|
23700
23682
|
icon: icon(IconUserCheck4),
|
|
23701
23683
|
content: /* @__PURE__ */ React237.createElement(AssignmentTab, { editor, block })
|
|
23702
23684
|
},
|
|
23703
23685
|
{
|
|
23704
|
-
label: "Commitment",
|
|
23686
|
+
label: t("actionBlock.tabs.commitment", { defaultValue: "Commitment" }),
|
|
23705
23687
|
value: "commitment",
|
|
23706
23688
|
icon: icon(IconContract4),
|
|
23707
23689
|
content: /* @__PURE__ */ React237.createElement(CommitmentTab, { editor, block })
|
|
23708
23690
|
},
|
|
23709
23691
|
{
|
|
23710
|
-
label: "TTL",
|
|
23692
|
+
label: t("actionBlock.tabs.ttl", { defaultValue: "TTL" }),
|
|
23711
23693
|
value: "ttl",
|
|
23712
23694
|
icon: icon(IconClock11),
|
|
23713
23695
|
content: /* @__PURE__ */ React237.createElement(TtlTab, { editor, block })
|
|
23714
23696
|
}
|
|
23715
23697
|
];
|
|
23716
|
-
return /* @__PURE__ */ React237.createElement(BaseRightPanelLayout, { title: "Configuration", onClose: closePanel, tabs, context: { editor, block } });
|
|
23698
|
+
return /* @__PURE__ */ React237.createElement(BaseRightPanelLayout, { title: t("actionBlock.panels.configuration", { defaultValue: "Configuration" }), onClose: closePanel, tabs, context: { editor, block } });
|
|
23717
23699
|
};
|
|
23718
23700
|
|
|
23719
23701
|
// src/mantine/blocks/action/template/TemplateView.tsx
|
|
@@ -23723,6 +23705,7 @@ var ACTION_TEMPLATE_PANEL_ID = "action-template-panel";
|
|
|
23723
23705
|
var ACTION_ASSIGNMENT_PANEL_ID = "action-template-assignment-panel";
|
|
23724
23706
|
var ACTION_COMMITMENT_PANEL_ID = "action-template-commitment-panel";
|
|
23725
23707
|
var ActionTemplateView = ({ editor, block }) => {
|
|
23708
|
+
const t = useTranslate();
|
|
23726
23709
|
const panelId = `${ACTION_TEMPLATE_PANEL_ID}-${block.id}`;
|
|
23727
23710
|
const assignmentPanelId = `${ACTION_ASSIGNMENT_PANEL_ID}-${block.id}`;
|
|
23728
23711
|
const { closePanel, activePanel } = usePanelStore();
|
|
@@ -23732,9 +23715,16 @@ var ActionTemplateView = ({ editor, block }) => {
|
|
|
23732
23715
|
() => /* @__PURE__ */ React238.createElement(
|
|
23733
23716
|
BaseRightPanelLayout,
|
|
23734
23717
|
{
|
|
23735
|
-
tabs: [
|
|
23718
|
+
tabs: [
|
|
23719
|
+
{
|
|
23720
|
+
content: /* @__PURE__ */ React238.createElement(AssignmentTab, { editor, block }),
|
|
23721
|
+
label: t("actionBlock.tabs.assignment", { defaultValue: "Assignment" }),
|
|
23722
|
+
value: "assignment",
|
|
23723
|
+
icon: icon(IconUser12)
|
|
23724
|
+
}
|
|
23725
|
+
],
|
|
23736
23726
|
onClose: closePanel,
|
|
23737
|
-
title: "Assignment Tab"
|
|
23727
|
+
title: t("actionBlock.panels.assignmentTab", { defaultValue: "Assignment Tab" })
|
|
23738
23728
|
}
|
|
23739
23729
|
),
|
|
23740
23730
|
[editor, block, closePanel]
|
|
@@ -23743,7 +23733,7 @@ var ActionTemplateView = ({ editor, block }) => {
|
|
|
23743
23733
|
const { open: openAssignment } = usePanel(assignmentPanelId, assignmentPanelContent);
|
|
23744
23734
|
const commitmentPanelId = `${ACTION_COMMITMENT_PANEL_ID}-${block.id}`;
|
|
23745
23735
|
const commitmentPanelContent = useMemo87(
|
|
23746
|
-
() => /* @__PURE__ */ React238.createElement(BaseRightPanelLayout, { onClose: closePanel, title: "Commitment Tab" }, /* @__PURE__ */ React238.createElement(CommitmentTab, { editor, block })),
|
|
23736
|
+
() => /* @__PURE__ */ React238.createElement(BaseRightPanelLayout, { onClose: closePanel, title: t("actionBlock.panels.commitmentTab", { defaultValue: "Commitment Tab" }) }, /* @__PURE__ */ React238.createElement(CommitmentTab, { editor, block })),
|
|
23747
23737
|
[editor, block, closePanel]
|
|
23748
23738
|
);
|
|
23749
23739
|
const { open: openCommitment } = usePanel(commitmentPanelId, commitmentPanelContent);
|
|
@@ -23753,7 +23743,7 @@ var ActionTemplateView = ({ editor, block }) => {
|
|
|
23753
23743
|
const actionType = block.props.actionType || "";
|
|
23754
23744
|
const dueDate = block.props.ttlAbsoluteDueDate;
|
|
23755
23745
|
const dueDateDisplay = dueDate ? formatDate(dueDate) : "";
|
|
23756
|
-
const subtitle = dueDateDisplay || block.props.description || getActionMeta(actionType).label || "Due Date";
|
|
23746
|
+
const subtitle = dueDateDisplay || block.props.description || getActionMeta(actionType).label || t("actionBlock.dueDate", { defaultValue: "Due Date" });
|
|
23757
23747
|
return /* @__PURE__ */ React238.createElement(
|
|
23758
23748
|
BaseContainer,
|
|
23759
23749
|
{
|
|
@@ -23767,7 +23757,7 @@ var ActionTemplateView = ({ editor, block }) => {
|
|
|
23767
23757
|
opacity: isPanelBlocked ? 0.6 : 1
|
|
23768
23758
|
}
|
|
23769
23759
|
},
|
|
23770
|
-
/* @__PURE__ */ React238.createElement(Group88, { wrap: "nowrap", gap: 24, align: "center", style: { width: "100%" } }, /* @__PURE__ */ React238.createElement(Group88, { wrap: "nowrap", gap: 16, align: "center", style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ React238.createElement(Box44, { style: { flexShrink: 0, width: 32, height: 32, display: "flex", alignItems: "center", justifyContent: "center" } }, getActionMeta(actionType).icon), /* @__PURE__ */ React238.createElement(Stack158, { gap: 0, style: { flex: 1, minWidth: 0, overflow: "hidden" } }, /* @__PURE__ */ React238.createElement(Text135, { fw: 500, size: "md", truncate: true, contentEditable: false, style: { letterSpacing: "0.16px", lineHeight: 1.5 } }, block.props.title || "Title of the action"), /* @__PURE__ */ React238.createElement(Text135, { size: "sm", c: "dimmed", truncate: true, contentEditable: false, style: { letterSpacing: "0.14px" } }, subtitle))), /* @__PURE__ */ React238.createElement(Stack158, { gap: 2, align: "flex-end", style: { flexShrink: 0, minWidth: 100 } }, /* @__PURE__ */ React238.createElement(Text135, { fw: 500, size: "md", contentEditable: false, style: { letterSpacing: "0.16px", lineHeight: 1.5, textAlign: "right" } }, "Pending"), /* @__PURE__ */ React238.createElement(Group88, { gap: 4, justify: "flex-end" }, /* @__PURE__ */ React238.createElement(CommitmentDisplay, { block, onClick: !interactive || isPanelBlocked ? () => {
|
|
23760
|
+
/* @__PURE__ */ React238.createElement(Group88, { wrap: "nowrap", gap: 24, align: "center", style: { width: "100%" } }, /* @__PURE__ */ React238.createElement(Group88, { wrap: "nowrap", gap: 16, align: "center", style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ React238.createElement(Box44, { style: { flexShrink: 0, width: 32, height: 32, display: "flex", alignItems: "center", justifyContent: "center" } }, getActionMeta(actionType).icon), /* @__PURE__ */ React238.createElement(Stack158, { gap: 0, style: { flex: 1, minWidth: 0, overflow: "hidden" } }, /* @__PURE__ */ React238.createElement(Text135, { fw: 500, size: "md", truncate: true, contentEditable: false, style: { letterSpacing: "0.16px", lineHeight: 1.5 } }, block.props.title || t("actionBlock.titlePlaceholder", { defaultValue: "Title of the action" })), /* @__PURE__ */ React238.createElement(Text135, { size: "sm", c: "dimmed", truncate: true, contentEditable: false, style: { letterSpacing: "0.14px" } }, subtitle))), /* @__PURE__ */ React238.createElement(Stack158, { gap: 2, align: "flex-end", style: { flexShrink: 0, minWidth: 100 } }, /* @__PURE__ */ React238.createElement(Text135, { fw: 500, size: "md", contentEditable: false, style: { letterSpacing: "0.16px", lineHeight: 1.5, textAlign: "right" } }, t("actionBlock.status.pending", { defaultValue: "Pending" })), /* @__PURE__ */ React238.createElement(Group88, { gap: 4, justify: "flex-end" }, /* @__PURE__ */ React238.createElement(CommitmentDisplay, { block, onClick: !interactive || isPanelBlocked ? () => {
|
|
23771
23761
|
} : openCommitment }), /* @__PURE__ */ React238.createElement(AssignmentDisplay, { onClick: !interactive || isPanelBlocked ? () => {
|
|
23772
23762
|
} : openAssignment, block }))))
|
|
23773
23763
|
);
|
|
@@ -24111,16 +24101,16 @@ function formatTimestamp2(iso) {
|
|
|
24111
24101
|
}
|
|
24112
24102
|
|
|
24113
24103
|
// src/mantine/blocks/action/flow/FlowView.tsx
|
|
24114
|
-
var getStatusLabel4 = (runtimeState) => {
|
|
24104
|
+
var getStatusLabel4 = (runtimeState, t) => {
|
|
24115
24105
|
switch (runtimeState) {
|
|
24116
24106
|
case "running":
|
|
24117
|
-
return "In Progress";
|
|
24107
|
+
return t("actionBlock.status.inProgress", { defaultValue: "In Progress" });
|
|
24118
24108
|
case "completed":
|
|
24119
|
-
return "Completed";
|
|
24109
|
+
return t("actionBlock.status.completed", { defaultValue: "Completed" });
|
|
24120
24110
|
case "failed":
|
|
24121
|
-
return "Failed";
|
|
24111
|
+
return t("actionBlock.status.failed", { defaultValue: "Failed" });
|
|
24122
24112
|
default:
|
|
24123
|
-
return "Pending";
|
|
24113
|
+
return t("actionBlock.status.pending", { defaultValue: "Pending" });
|
|
24124
24114
|
}
|
|
24125
24115
|
};
|
|
24126
24116
|
var getStatusColor4 = (runtimeState) => {
|
|
@@ -24136,6 +24126,7 @@ var getStatusColor4 = (runtimeState) => {
|
|
|
24136
24126
|
}
|
|
24137
24127
|
};
|
|
24138
24128
|
var ActionFlowView = ({ editor, block, isDisabled }) => {
|
|
24129
|
+
const t = useTranslate();
|
|
24139
24130
|
const disabled = isDisabled?.isDisabled === "disable";
|
|
24140
24131
|
const [runtime] = useNodeRuntime(editor, block.id);
|
|
24141
24132
|
useAutoCommitOnExecute(editor, block, runtime.state);
|
|
@@ -24145,14 +24136,14 @@ var ActionFlowView = ({ editor, block, isDisabled }) => {
|
|
|
24145
24136
|
const actionTypeUI = actionType ? getActionTypeUI(actionType) : void 0;
|
|
24146
24137
|
const FlowDetailComponent = actionTypeUI?.flowDetailComponent;
|
|
24147
24138
|
const runtimeState = runtime.state || "";
|
|
24148
|
-
const statusLabel = getStatusLabel4(runtimeState);
|
|
24139
|
+
const statusLabel = getStatusLabel4(runtimeState, t);
|
|
24149
24140
|
const statusColor3 = getStatusColor4(runtimeState);
|
|
24150
24141
|
const dueDate = block.props.ttlAbsoluteDueDate;
|
|
24151
24142
|
const dueDateDisplay = dueDate ? formatDate(dueDate) : "";
|
|
24152
24143
|
const tabs = useMemo90(() => {
|
|
24153
24144
|
const baseTabs = [
|
|
24154
24145
|
{
|
|
24155
|
-
label: "Execute",
|
|
24146
|
+
label: t("actionBlock.tabs.execute", { defaultValue: "Execute" }),
|
|
24156
24147
|
value: "execute",
|
|
24157
24148
|
icon: icon(IconBolt9),
|
|
24158
24149
|
content: /* @__PURE__ */ React242.createElement(
|
|
@@ -24170,13 +24161,13 @@ var ActionFlowView = ({ editor, block, isDisabled }) => {
|
|
|
24170
24161
|
];
|
|
24171
24162
|
baseTabs.push(
|
|
24172
24163
|
{
|
|
24173
|
-
label: "Authorization",
|
|
24164
|
+
label: t("actionBlock.tabs.authorization", { defaultValue: "Authorization" }),
|
|
24174
24165
|
value: "authorization",
|
|
24175
24166
|
icon: icon(IconShieldCheck14),
|
|
24176
24167
|
content: /* @__PURE__ */ React242.createElement(AuthorizationTab, { editor, block })
|
|
24177
24168
|
},
|
|
24178
24169
|
{
|
|
24179
|
-
label: "Assignment",
|
|
24170
|
+
label: t("actionBlock.tabs.assignment", { defaultValue: "Assignment" }),
|
|
24180
24171
|
value: "assignment",
|
|
24181
24172
|
icon: icon(IconUser13),
|
|
24182
24173
|
content: /* @__PURE__ */ React242.createElement(AssignmentTab, { editor, block })
|
|
@@ -24191,7 +24182,7 @@ var ActionFlowView = ({ editor, block, isDisabled }) => {
|
|
|
24191
24182
|
const { open } = usePanel(panelId, panelContent);
|
|
24192
24183
|
const commitmentPanelId = `action-flow-commitment-${block.id}`;
|
|
24193
24184
|
const commitmentPanelContent = useMemo90(
|
|
24194
|
-
() => /* @__PURE__ */ React242.createElement(BaseRightPanelLayout, { onClose: closePanel, title: "Commitment Tab" }, /* @__PURE__ */ React242.createElement(CommitmentTab, { editor, block })),
|
|
24185
|
+
() => /* @__PURE__ */ React242.createElement(BaseRightPanelLayout, { onClose: closePanel, title: t("actionBlock.panels.commitmentTab", { defaultValue: "Commitment Tab" }) }, /* @__PURE__ */ React242.createElement(CommitmentTab, { editor, block })),
|
|
24195
24186
|
[editor, block, closePanel]
|
|
24196
24187
|
);
|
|
24197
24188
|
const { open: openCommitment } = usePanel(commitmentPanelId, commitmentPanelContent);
|
|
@@ -24209,7 +24200,7 @@ var ActionFlowView = ({ editor, block, isDisabled }) => {
|
|
|
24209
24200
|
transition: "border-color 140ms ease"
|
|
24210
24201
|
}
|
|
24211
24202
|
},
|
|
24212
|
-
/* @__PURE__ */ React242.createElement(Group91, { wrap: "nowrap", gap: 24, align: "center", style: { width: "100%" } }, /* @__PURE__ */ React242.createElement(Group91, { wrap: "nowrap", gap: 16, align: "center", style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ React242.createElement(Box47, { style: { flexShrink: 0, width: 32, height: 32, display: "flex", alignItems: "center", justifyContent: "center" } }, getActionMeta(actionType).icon), /* @__PURE__ */ React242.createElement(Stack161, { gap: 0, style: { flex: 1, minWidth: 0, overflow: "hidden" } }, /* @__PURE__ */ React242.createElement(Text139, { fw: 500, size: "md", c: "white", truncate: true, contentEditable: false, style: { letterSpacing: "0.16px", lineHeight: 1.5 } }, block.props.title || "Title of the action"), /* @__PURE__ */ React242.createElement(Text139, { size: "sm", c: "dimmed", truncate: true, contentEditable: false, style: { letterSpacing: "0.14px" } }, dueDateDisplay || block.props.description || "Due Date"))), /* @__PURE__ */ React242.createElement(Stack161, { gap: 2, align: "flex-end", style: { flexShrink: 0, minWidth: 100 } }, /* @__PURE__ */ React242.createElement(Text139, { fw: 500, size: "md", c: statusColor3, contentEditable: false, style: { letterSpacing: "0.16px", lineHeight: 1.5, textAlign: "right" } }, statusLabel), /* @__PURE__ */ React242.createElement(Group91, { gap: 4, justify: "flex-end" }, /* @__PURE__ */ React242.createElement(CommitmentDisplay, { block, onClick: openCommitment }), /* @__PURE__ */ React242.createElement(AssignmentDisplay, { block, onClick: open }))))
|
|
24203
|
+
/* @__PURE__ */ React242.createElement(Group91, { wrap: "nowrap", gap: 24, align: "center", style: { width: "100%" } }, /* @__PURE__ */ React242.createElement(Group91, { wrap: "nowrap", gap: 16, align: "center", style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ React242.createElement(Box47, { style: { flexShrink: 0, width: 32, height: 32, display: "flex", alignItems: "center", justifyContent: "center" } }, getActionMeta(actionType).icon), /* @__PURE__ */ React242.createElement(Stack161, { gap: 0, style: { flex: 1, minWidth: 0, overflow: "hidden" } }, /* @__PURE__ */ React242.createElement(Text139, { fw: 500, size: "md", c: "white", truncate: true, contentEditable: false, style: { letterSpacing: "0.16px", lineHeight: 1.5 } }, block.props.title || t("actionBlock.titlePlaceholder", { defaultValue: "Title of the action" })), /* @__PURE__ */ React242.createElement(Text139, { size: "sm", c: "dimmed", truncate: true, contentEditable: false, style: { letterSpacing: "0.14px" } }, dueDateDisplay || block.props.description || t("actionBlock.dueDate", { defaultValue: "Due Date" })))), /* @__PURE__ */ React242.createElement(Stack161, { gap: 2, align: "flex-end", style: { flexShrink: 0, minWidth: 100 } }, /* @__PURE__ */ React242.createElement(Text139, { fw: 500, size: "md", c: statusColor3, contentEditable: false, style: { letterSpacing: "0.16px", lineHeight: 1.5, textAlign: "right" } }, statusLabel), /* @__PURE__ */ React242.createElement(Group91, { gap: 4, justify: "flex-end" }, /* @__PURE__ */ React242.createElement(CommitmentDisplay, { block, onClick: openCommitment }), /* @__PURE__ */ React242.createElement(AssignmentDisplay, { block, onClick: open }))))
|
|
24213
24204
|
);
|
|
24214
24205
|
};
|
|
24215
24206
|
function ActionPanelContent({
|
|
@@ -24220,12 +24211,14 @@ function ActionPanelContent({
|
|
|
24220
24211
|
isDisabled,
|
|
24221
24212
|
disabledMessage
|
|
24222
24213
|
}) {
|
|
24214
|
+
const t = useTranslate();
|
|
24223
24215
|
const [isLoading, setIsLoading] = useState95(false);
|
|
24224
24216
|
const [runtime, updateRuntime] = useNodeRuntime(editor, block.id);
|
|
24225
24217
|
const executeFnRef = useRef23(null);
|
|
24226
24218
|
const [canSign, setCanSign] = useState95(false);
|
|
24227
24219
|
const [runtimeInputs, setRuntimeInputs] = useState95({});
|
|
24228
24220
|
const [showFlowDetail, setShowFlowDetail] = useState95(false);
|
|
24221
|
+
const [activeInvocation, setActiveInvocation] = useState95(null);
|
|
24229
24222
|
const [invokingId, setInvokingId] = useState95(null);
|
|
24230
24223
|
const provideSigningHandler = useCallback74((fn) => {
|
|
24231
24224
|
executeFnRef.current = fn;
|
|
@@ -24239,17 +24232,37 @@ function ActionPanelContent({
|
|
|
24239
24232
|
const actionTypeUI = actionType ? getActionTypeUI(actionType) : void 0;
|
|
24240
24233
|
const executionMode = actionTypeUI?.executionMode ?? "custom";
|
|
24241
24234
|
const isSlideToSign = executionMode === "slide-to-sign";
|
|
24242
|
-
const
|
|
24243
|
-
|
|
24244
|
-
|
|
24245
|
-
|
|
24235
|
+
const handlePendingInvocationCompleted = useCallback74(
|
|
24236
|
+
(invocationId) => {
|
|
24237
|
+
const yDoc = editor?._yDoc;
|
|
24238
|
+
if (yDoc) removePendingInvocation(yDoc, block.id, invocationId);
|
|
24239
|
+
setInvokingId(null);
|
|
24240
|
+
setActiveInvocation(null);
|
|
24241
|
+
},
|
|
24242
|
+
[editor, block.id]
|
|
24243
|
+
);
|
|
24244
|
+
const handleInvoke = useCallback74(
|
|
24245
|
+
(invocation) => {
|
|
24246
|
+
if (invocation?.id) {
|
|
24247
|
+
setInvokingId(invocation.id);
|
|
24248
|
+
setActiveInvocation(invocation);
|
|
24249
|
+
updateRuntime({
|
|
24250
|
+
state: "idle",
|
|
24251
|
+
error: void 0,
|
|
24252
|
+
pendingPayload: {
|
|
24253
|
+
...invocation.payload || {},
|
|
24254
|
+
...invocation.refSnapshots || {}
|
|
24255
|
+
}
|
|
24256
|
+
});
|
|
24257
|
+
}
|
|
24258
|
+
setShowFlowDetail(true);
|
|
24259
|
+
},
|
|
24260
|
+
[updateRuntime]
|
|
24261
|
+
);
|
|
24246
24262
|
useEffect78(() => {
|
|
24247
24263
|
if (runtime.state !== "completed" || !invokingId) return;
|
|
24248
|
-
|
|
24249
|
-
|
|
24250
|
-
setInvokingId(null);
|
|
24251
|
-
setShowFlowDetail(false);
|
|
24252
|
-
}, [runtime.state, invokingId, editor, block.id]);
|
|
24264
|
+
handlePendingInvocationCompleted(invokingId);
|
|
24265
|
+
}, [runtime.state, invokingId, handlePendingInvocationCompleted]);
|
|
24253
24266
|
const triggerMode = (() => {
|
|
24254
24267
|
const raw = block.props.trigger;
|
|
24255
24268
|
if (raw && typeof raw === "string") {
|
|
@@ -24298,9 +24311,11 @@ function ActionPanelContent({
|
|
|
24298
24311
|
isDisabled,
|
|
24299
24312
|
provideSigningHandler,
|
|
24300
24313
|
unlockSigning,
|
|
24301
|
-
registerRuntimeInputs
|
|
24314
|
+
registerRuntimeInputs,
|
|
24315
|
+
activePendingInvocation: activeInvocation,
|
|
24316
|
+
onPendingInvocationCompleted: handlePendingInvocationCompleted
|
|
24302
24317
|
}
|
|
24303
|
-
), diffView), runtime.error && /* @__PURE__ */ React242.createElement(Alert35, { icon: /* @__PURE__ */ React242.createElement(IconAlertTriangle4, { size: 16 }), title: "Execution Error", color: "red", styles: actionAlertStyles }, /* @__PURE__ */ React242.createElement(Text139, { size: "xs" }, runtime.error.message)));
|
|
24318
|
+
), diffView), runtime.error && /* @__PURE__ */ React242.createElement(Alert35, { icon: /* @__PURE__ */ React242.createElement(IconAlertTriangle4, { size: 16 }), title: t("actionBlock.alerts.executionError", { defaultValue: "Execution Error" }), color: "red", styles: actionAlertStyles }, /* @__PURE__ */ React242.createElement(Text139, { size: "xs" }, runtime.error.message)));
|
|
24304
24319
|
}
|
|
24305
24320
|
if (FlowDetailComponent && isSlideToSign) {
|
|
24306
24321
|
return /* @__PURE__ */ React242.createElement(Stack161, { gap: "md", py: "md" }, /* @__PURE__ */ React242.createElement(
|
|
@@ -24316,7 +24331,7 @@ function ActionPanelContent({
|
|
|
24316
24331
|
unlockSigning,
|
|
24317
24332
|
registerRuntimeInputs
|
|
24318
24333
|
}
|
|
24319
|
-
), diffView, runtime.error && /* @__PURE__ */ React242.createElement(Alert35, { icon: /* @__PURE__ */ React242.createElement(IconAlertTriangle4, { size: 16 }), title: "Execution Error", color: "red", styles: actionAlertStyles }, /* @__PURE__ */ React242.createElement(Text139, { size: "xs" }, runtime.error.message)));
|
|
24334
|
+
), diffView, runtime.error && /* @__PURE__ */ React242.createElement(Alert35, { icon: /* @__PURE__ */ React242.createElement(IconAlertTriangle4, { size: 16 }), title: t("actionBlock.alerts.executionError", { defaultValue: "Execution Error" }), color: "red", styles: actionAlertStyles }, /* @__PURE__ */ React242.createElement(Text139, { size: "xs" }, runtime.error.message)));
|
|
24320
24335
|
}
|
|
24321
24336
|
if (FlowDetailComponent) {
|
|
24322
24337
|
return /* @__PURE__ */ React242.createElement(Stack161, { gap: "md", py: "md" }, /* @__PURE__ */ React242.createElement(FlowDetailComponent, { inputs: block.props.inputs || "{}", editor, block, runtime, updateRuntime, isDisabled }));
|
|
@@ -24363,6 +24378,7 @@ function GenericFlowPanel({
|
|
|
24363
24378
|
setIsLoading,
|
|
24364
24379
|
disabledMessage
|
|
24365
24380
|
}) {
|
|
24381
|
+
const t = useTranslate();
|
|
24366
24382
|
const handlers = useBlocknoteHandlers();
|
|
24367
24383
|
const services = useMemo90(() => buildServicesFromHandlers(handlers), [handlers]);
|
|
24368
24384
|
const flowNode = useMemo90(() => buildFlowNodeFromBlock(block), [block]);
|
|
@@ -24483,8 +24499,8 @@ function GenericFlowPanel({
|
|
|
24483
24499
|
onClick: handleExecute,
|
|
24484
24500
|
disabled: isDisabled || isLoading || !actionType
|
|
24485
24501
|
},
|
|
24486
|
-
isLoading ? "Running..." : "Execute"
|
|
24487
|
-
), isDisabled && disabledMessage && /* @__PURE__ */ React242.createElement(Text139, { size: "xs", c: "dimmed" }, disabledMessage), runtime.error && /* @__PURE__ */ React242.createElement(Alert35, { icon: /* @__PURE__ */ React242.createElement(IconAlertTriangle4, { size: 16 }), title: "Execution Error", color: "red", styles: actionAlertStyles }, /* @__PURE__ */ React242.createElement(Text139, { size: "xs" }, runtime.error.message)), Object.keys(parsedInputs).length > 0 && /* @__PURE__ */ React242.createElement(React242.Fragment, null, /* @__PURE__ */ React242.createElement(Divider20, null), /* @__PURE__ */ React242.createElement(Stack161, { gap: "xs" }, /* @__PURE__ */ React242.createElement(Text139, { size: "xs", fw: 600, c: "dimmed" }, "Inputs"), /* @__PURE__ */ React242.createElement(Code8, { block: true, style: { fontSize: "11px" } }, JSON.stringify(parsedInputs, null, 2)))), outputJson && /* @__PURE__ */ React242.createElement(React242.Fragment, null, /* @__PURE__ */ React242.createElement(Divider20, null), /* @__PURE__ */ React242.createElement(Stack161, { gap: "xs" }, /* @__PURE__ */ React242.createElement(Text139, { size: "xs", fw: 600, c: "dimmed" }, "Output"), /* @__PURE__ */ React242.createElement(Code8, { block: true, style: { fontSize: "11px", maxHeight: "300px", overflow: "auto" } }, outputJson))));
|
|
24502
|
+
isLoading ? t("actionBlock.executing", { defaultValue: "Running..." }) : t("actionBlock.tabs.execute", { defaultValue: "Execute" })
|
|
24503
|
+
), isDisabled && disabledMessage && /* @__PURE__ */ React242.createElement(Text139, { size: "xs", c: "dimmed" }, disabledMessage), runtime.error && /* @__PURE__ */ React242.createElement(Alert35, { icon: /* @__PURE__ */ React242.createElement(IconAlertTriangle4, { size: 16 }), title: "Execution Error", color: "red", styles: actionAlertStyles }, /* @__PURE__ */ React242.createElement(Text139, { size: "xs" }, runtime.error.message)), Object.keys(parsedInputs).length > 0 && /* @__PURE__ */ React242.createElement(React242.Fragment, null, /* @__PURE__ */ React242.createElement(Divider20, null), /* @__PURE__ */ React242.createElement(Stack161, { gap: "xs" }, /* @__PURE__ */ React242.createElement(Text139, { size: "xs", fw: 600, c: "dimmed" }, t("actionBlock.inputs", { defaultValue: "Inputs" })), /* @__PURE__ */ React242.createElement(Code8, { block: true, style: { fontSize: "11px" } }, JSON.stringify(parsedInputs, null, 2)))), outputJson && /* @__PURE__ */ React242.createElement(React242.Fragment, null, /* @__PURE__ */ React242.createElement(Divider20, null), /* @__PURE__ */ React242.createElement(Stack161, { gap: "xs" }, /* @__PURE__ */ React242.createElement(Text139, { size: "xs", fw: 600, c: "dimmed" }, t("actionBlock.output", { defaultValue: "Output" })), /* @__PURE__ */ React242.createElement(Code8, { block: true, style: { fontSize: "11px", maxHeight: "300px", overflow: "auto" } }, outputJson))));
|
|
24488
24504
|
}
|
|
24489
24505
|
|
|
24490
24506
|
// src/mantine/blocks/action/actionTypes/pod/domainIndexerLookup/DomainIndexerLookupConfig.tsx
|
|
@@ -26156,6 +26172,7 @@ function serializeBidActionInputs(inputs) {
|
|
|
26156
26172
|
|
|
26157
26173
|
// src/mantine/blocks/action/actionTypes/bid/BidConfig.tsx
|
|
26158
26174
|
var BidConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
26175
|
+
const t = useTranslate();
|
|
26159
26176
|
const handlers = useBlocknoteHandlers();
|
|
26160
26177
|
const [local, setLocal] = useState111(() => parseBidActionInputs(inputs));
|
|
26161
26178
|
const [collections, setCollections] = useState111([]);
|
|
@@ -26175,7 +26192,7 @@ var BidConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
26175
26192
|
const fetchCollections = useCallback89(async () => {
|
|
26176
26193
|
const deedDid = local.deedDid.trim();
|
|
26177
26194
|
if (!deedDid) {
|
|
26178
|
-
setError("Please enter a
|
|
26195
|
+
setError(t("actionTypes.shared.errors.didRequired", { defaultValue: "Please enter a {{did}} first", did: "DID" }));
|
|
26179
26196
|
return;
|
|
26180
26197
|
}
|
|
26181
26198
|
const persisted = { ...local, deedDid };
|
|
@@ -26188,14 +26205,18 @@ var BidConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
26188
26205
|
const fetched = response?.collections || [];
|
|
26189
26206
|
setCollections(fetched);
|
|
26190
26207
|
if (fetched.length === 0) {
|
|
26191
|
-
setError(
|
|
26208
|
+
setError(
|
|
26209
|
+
t("actionTypes.shared.errors.noCollections", { defaultValue: "No {{claimCollections}} found for this {{did}}", claimCollections: "claim collections", did: "DID" })
|
|
26210
|
+
);
|
|
26192
26211
|
}
|
|
26193
26212
|
if (local.collectionId && !fetched.some((c) => c.id === local.collectionId)) {
|
|
26194
26213
|
update({ collectionId: "" });
|
|
26195
26214
|
}
|
|
26196
26215
|
} catch (err) {
|
|
26197
26216
|
setCollections([]);
|
|
26198
|
-
setError(
|
|
26217
|
+
setError(
|
|
26218
|
+
err instanceof Error ? err.message : t("actionTypes.shared.errors.fetchCollections", { defaultValue: "Failed to fetch {{claimCollections}}", claimCollections: "claim collections" })
|
|
26219
|
+
);
|
|
26199
26220
|
} finally {
|
|
26200
26221
|
setLoadingCollections(false);
|
|
26201
26222
|
}
|
|
@@ -26211,8 +26232,12 @@ var BidConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
26211
26232
|
DataInput,
|
|
26212
26233
|
{
|
|
26213
26234
|
label: "DID",
|
|
26214
|
-
placeholder: "Enter deed DID",
|
|
26215
|
-
description: "
|
|
26235
|
+
placeholder: t("actionTypes.shared.didPlaceholder", { defaultValue: "Enter deed {{did}}", did: "DID" }),
|
|
26236
|
+
description: t("actionTypes.shared.didDescription", {
|
|
26237
|
+
defaultValue: "The {{did}} identifier for fetching {{claimCollections}}.",
|
|
26238
|
+
did: "DID",
|
|
26239
|
+
claimCollections: "claim collections"
|
|
26240
|
+
}),
|
|
26216
26241
|
value: local.deedDid,
|
|
26217
26242
|
onChange: (value) => update({ deedDid: value }),
|
|
26218
26243
|
editorDocument: editor?.document || [],
|
|
@@ -26229,19 +26254,21 @@ var BidConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
26229
26254
|
if (entityDid) update({ deedDid: entityDid });
|
|
26230
26255
|
}
|
|
26231
26256
|
},
|
|
26232
|
-
"Use Current Entity"
|
|
26233
|
-
), /* @__PURE__ */ React258.createElement(BasePrimaryButton, { onClick: fetchCollections, disabled: !local.deedDid.trim() || loadingCollections }, loadingCollections ? /* @__PURE__ */ React258.createElement(Loader42, { size: "xs", color: "dark" }) : "Get Collections"), error && /* @__PURE__ */ React258.createElement(Alert45, { color: "red", styles: actionAlertStyles }, error), collectionOptions.length > 0 && /* @__PURE__ */ React258.createElement(
|
|
26257
|
+
t("actionTypes.shared.useCurrentEntity", { defaultValue: "Use Current {{entity}}", entity: "Entity" })
|
|
26258
|
+
), /* @__PURE__ */ React258.createElement(BasePrimaryButton, { onClick: fetchCollections, disabled: !local.deedDid.trim() || loadingCollections }, loadingCollections ? /* @__PURE__ */ React258.createElement(Loader42, { size: "xs", color: "dark" }) : t("actionTypes.shared.getCollections", { defaultValue: "Get {{collections}}", collections: "Collections" })), error && /* @__PURE__ */ React258.createElement(Alert45, { color: "red", styles: actionAlertStyles }, error), collectionOptions.length > 0 && /* @__PURE__ */ React258.createElement(
|
|
26234
26259
|
BaseSelect,
|
|
26235
26260
|
{
|
|
26236
26261
|
label: "Claim Collection",
|
|
26237
|
-
placeholder: "Select a collection",
|
|
26262
|
+
placeholder: t("actionTypes.shared.collectionPlaceholder", { defaultValue: "Select a collection" }),
|
|
26238
26263
|
value: local.collectionId || null,
|
|
26239
26264
|
onChange: (value) => update({ collectionId: value || "" }),
|
|
26240
26265
|
data: collectionOptions,
|
|
26241
26266
|
required: true,
|
|
26242
26267
|
searchable: true
|
|
26243
26268
|
}
|
|
26244
|
-
), /* @__PURE__ */ React258.createElement(Alert45, { icon: /* @__PURE__ */ React258.createElement(IconInfoCircle7, { size: 16 }), color: "blue", title: "Input format", styles: actionAlertStyles }, /* @__PURE__ */ React258.createElement(Text155, { size: "xs" }, "
|
|
26269
|
+
), /* @__PURE__ */ React258.createElement(Alert45, { icon: /* @__PURE__ */ React258.createElement(IconInfoCircle7, { size: 16 }), color: "blue", title: t("actionTypes.bid.config.inputFormat", { defaultValue: "Input format" }), styles: actionAlertStyles }, /* @__PURE__ */ React258.createElement(Text155, { size: "xs" }, t("actionTypes.bid.config.inputFormatNote", {
|
|
26270
|
+
defaultValue: "Role selection and survey answers are collected from the user at flow runtime and are not stored in template configuration."
|
|
26271
|
+
}))));
|
|
26245
26272
|
};
|
|
26246
26273
|
|
|
26247
26274
|
// src/mantine/blocks/action/actionTypes/bid/BidFlowDetail.tsx
|
|
@@ -26266,6 +26293,7 @@ var BidFlowDetail = ({
|
|
|
26266
26293
|
unlockSigning,
|
|
26267
26294
|
registerRuntimeInputs
|
|
26268
26295
|
}) => {
|
|
26296
|
+
const t = useTranslate();
|
|
26269
26297
|
const handlers = useBlocknoteHandlers();
|
|
26270
26298
|
const handlersRef = useRef26(handlers);
|
|
26271
26299
|
useEffect91(() => {
|
|
@@ -26339,11 +26367,11 @@ var BidFlowDetail = ({
|
|
|
26339
26367
|
}, [surveyModel]);
|
|
26340
26368
|
const loadSurveyTemplate = useCallback90(async () => {
|
|
26341
26369
|
if (!deedDid) {
|
|
26342
|
-
setError("
|
|
26370
|
+
setError(t("actionTypes.bid.flow.errors.didRequired", { defaultValue: "{{did}} is required in template configuration.", did: "DID" }));
|
|
26343
26371
|
return;
|
|
26344
26372
|
}
|
|
26345
26373
|
if (!collectionId) {
|
|
26346
|
-
setError("
|
|
26374
|
+
setError(t("actionTypes.bid.flow.errors.collectionRequired", { defaultValue: "{{collection}} is required in template configuration.", collection: "Collection" }));
|
|
26347
26375
|
return;
|
|
26348
26376
|
}
|
|
26349
26377
|
const handlers2 = handlersRef.current;
|
|
@@ -26353,13 +26381,13 @@ var BidFlowDetail = ({
|
|
|
26353
26381
|
const result = role === "service_agent" ? await handlers2.getBidContributorSurveyTemplate(deedDid, collectionId) : await handlers2.getBidEvaluatorSurveyTemplate(deedDid, collectionId);
|
|
26354
26382
|
if (!result?.surveyTemplate) {
|
|
26355
26383
|
setSurveyJson(null);
|
|
26356
|
-
setError("No survey template found for the selected role.");
|
|
26384
|
+
setError(t("actionTypes.bid.flow.errors.noSurveyForRole", { defaultValue: "No survey template found for the selected role." }));
|
|
26357
26385
|
return;
|
|
26358
26386
|
}
|
|
26359
26387
|
setSurveyJson(result.surveyTemplate);
|
|
26360
26388
|
} catch (err) {
|
|
26361
26389
|
setSurveyJson(null);
|
|
26362
|
-
setError(err instanceof Error ? err.message : "Failed to load survey template");
|
|
26390
|
+
setError(err instanceof Error ? err.message : t("actionTypes.shared.errors.surveyTemplateLoad", { defaultValue: "Failed to load survey template" }));
|
|
26363
26391
|
} finally {
|
|
26364
26392
|
setLoadingSurvey(false);
|
|
26365
26393
|
}
|
|
@@ -26428,7 +26456,7 @@ var BidFlowDetail = ({
|
|
|
26428
26456
|
}
|
|
26429
26457
|
const actionDef = getAction("qi/bid.submit");
|
|
26430
26458
|
if (!actionDef) {
|
|
26431
|
-
setError("Bid action is not registered");
|
|
26459
|
+
setError(t("actionTypes.bid.flow.errors.actionNotRegistered", { defaultValue: "Bid action is not registered" }));
|
|
26432
26460
|
return;
|
|
26433
26461
|
}
|
|
26434
26462
|
const submissionProps = {
|
|
@@ -26495,7 +26523,7 @@ var BidFlowDetail = ({
|
|
|
26495
26523
|
// TODO: collect PIN from user for invocation signing
|
|
26496
26524
|
});
|
|
26497
26525
|
if (!outcome.success) {
|
|
26498
|
-
throw new Error(outcome.error || "Bid execution failed");
|
|
26526
|
+
throw new Error(outcome.error || t("actionTypes.bid.flow.errors.executionFailed", { defaultValue: "Bid execution failed" }));
|
|
26499
26527
|
}
|
|
26500
26528
|
updateRuntime({
|
|
26501
26529
|
state: "completed",
|
|
@@ -26503,7 +26531,7 @@ var BidFlowDetail = ({
|
|
|
26503
26531
|
output: outcome.result?.payload || {}
|
|
26504
26532
|
});
|
|
26505
26533
|
} catch (err) {
|
|
26506
|
-
const message = err instanceof Error ? err.message : "Failed to submit bid";
|
|
26534
|
+
const message = err instanceof Error ? err.message : t("actionTypes.bid.flow.errors.submitFailed", { defaultValue: "Failed to submit bid" });
|
|
26507
26535
|
if (!submittedEmitted) {
|
|
26508
26536
|
handlers.onAnalyticsEvent?.("editor_flow_submission_failed", { ...submissionProps, reason: message });
|
|
26509
26537
|
}
|
|
@@ -26566,15 +26594,19 @@ var BidFlowDetail = ({
|
|
|
26566
26594
|
surveyModel.tryComplete();
|
|
26567
26595
|
});
|
|
26568
26596
|
}, [provideSigningHandler, surveyModel]);
|
|
26569
|
-
return /* @__PURE__ */ React260.createElement(Stack178, { gap: "md" }, !deedDid || !collectionId ? /* @__PURE__ */ React260.createElement(Alert46, { color: "yellow", styles: actionAlertStyles },
|
|
26597
|
+
return /* @__PURE__ */ React260.createElement(Stack178, { gap: "md" }, !deedDid || !collectionId ? /* @__PURE__ */ React260.createElement(Alert46, { color: "yellow", styles: actionAlertStyles }, t("actionTypes.shared.errors.configRequired", {
|
|
26598
|
+
defaultValue: "Configure {{did}} and {{claimCollection}} in template mode before running this action.",
|
|
26599
|
+
did: "DID",
|
|
26600
|
+
claimCollection: "claim collection"
|
|
26601
|
+
})) : /* @__PURE__ */ React260.createElement(React260.Fragment, null, /* @__PURE__ */ React260.createElement(Text156, { size: "xs", c: "dimmed" }, t("actionTypes.shared.collectionPrefix", { id: collectionId, defaultValue: `Collection: ${collectionId}` })), statusLoading && /* @__PURE__ */ React260.createElement(Text156, { size: "xs", c: "dimmed" }, t("actionTypes.shared.checkingApplicationState", { defaultValue: "Checking application state..." })), isPending && /* @__PURE__ */ React260.createElement(Alert46, { color: "yellow", title: t("actionTypes.bid.flow.applicationStatus", { defaultValue: "Application Status" }), styles: actionAlertStyles }, t("actionTypes.bid.flow.applicationPending", { defaultValue: "Your application is pending review. Resubmission is disabled." })), isApproved && /* @__PURE__ */ React260.createElement(Alert46, { color: "green", title: t("actionTypes.bid.flow.applicationStatus", { defaultValue: "Application Status" }), styles: actionAlertStyles }, t("actionTypes.bid.flow.applicationApproved", { defaultValue: "Your application was approved. You already have the required role." })), /* @__PURE__ */ React260.createElement(
|
|
26570
26602
|
BaseSelect,
|
|
26571
26603
|
{
|
|
26572
|
-
label: "Apply As",
|
|
26604
|
+
label: t("actionTypes.bid.flow.applyAs", { defaultValue: "Apply As" }),
|
|
26573
26605
|
value: role,
|
|
26574
26606
|
onChange: (value) => setRole(value || "service_agent"),
|
|
26575
26607
|
data: [
|
|
26576
|
-
{ value: "service_agent", label: "Contributor" },
|
|
26577
|
-
{ value: "evaluation_agent", label: "Evaluator" }
|
|
26608
|
+
{ value: "service_agent", label: t("actionTypes.bid.flow.role.contributor", { defaultValue: "Contributor" }) },
|
|
26609
|
+
{ value: "evaluation_agent", label: t("actionTypes.bid.flow.role.evaluator", { defaultValue: "Evaluator" }) }
|
|
26578
26610
|
],
|
|
26579
26611
|
disabled: isDisabled || submitting || statusLoading || !canSubmit
|
|
26580
26612
|
}
|
|
@@ -26585,8 +26617,8 @@ var BidFlowDetail = ({
|
|
|
26585
26617
|
onClick: loadSurveyTemplate,
|
|
26586
26618
|
disabled: isDisabled || loadingSurvey || submitting || statusLoading || !canSubmit
|
|
26587
26619
|
},
|
|
26588
|
-
loadingSurvey ? "Loading Survey..." : "Start Bid Survey"
|
|
26589
|
-
)), error && /* @__PURE__ */ React260.createElement(Alert46, { color: "red", styles: actionAlertStyles }, error), submitting && /* @__PURE__ */ React260.createElement(Text156, { size: "xs", c: "dimmed" }, "Submitting bid..."), surveyModel && !loadingSurvey && canSubmit && /* @__PURE__ */ React260.createElement(StableSurvey, { model: surveyModel }));
|
|
26620
|
+
loadingSurvey ? t("actionTypes.shared.loadingSurvey", { defaultValue: "Loading Survey..." }) : t("actionTypes.bid.flow.startBidSurvey", { defaultValue: "Start Bid Survey" })
|
|
26621
|
+
)), error && /* @__PURE__ */ React260.createElement(Alert46, { color: "red", styles: actionAlertStyles }, error), submitting && /* @__PURE__ */ React260.createElement(Text156, { size: "xs", c: "dimmed" }, t("actionTypes.bid.flow.submittingBid", { defaultValue: "Submitting bid..." })), surveyModel && !loadingSurvey && canSubmit && /* @__PURE__ */ React260.createElement(StableSurvey, { model: surveyModel }));
|
|
26590
26622
|
};
|
|
26591
26623
|
|
|
26592
26624
|
// src/mantine/blocks/action/actionTypes/bid/index.ts
|
|
@@ -26621,6 +26653,7 @@ function serializeEvaluateBidActionInputs(inputs) {
|
|
|
26621
26653
|
|
|
26622
26654
|
// src/mantine/blocks/action/actionTypes/evaluateBid/EvaluateBidConfig.tsx
|
|
26623
26655
|
var EvaluateBidConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
26656
|
+
const t = useTranslate();
|
|
26624
26657
|
const handlers = useBlocknoteHandlers();
|
|
26625
26658
|
const [local, setLocal] = useState113(() => parseEvaluateBidActionInputs(inputs));
|
|
26626
26659
|
const [collections, setCollections] = useState113([]);
|
|
@@ -26640,7 +26673,7 @@ var EvaluateBidConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
26640
26673
|
const fetchCollections = useCallback91(async () => {
|
|
26641
26674
|
const deedDid = local.deedDid.trim();
|
|
26642
26675
|
if (!deedDid) {
|
|
26643
|
-
setError("Please enter a
|
|
26676
|
+
setError(t("actionTypes.shared.errors.didRequired", { defaultValue: "Please enter a {{did}} first", did: "DID" }));
|
|
26644
26677
|
return;
|
|
26645
26678
|
}
|
|
26646
26679
|
const persisted = { ...local, deedDid };
|
|
@@ -26653,14 +26686,18 @@ var EvaluateBidConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
26653
26686
|
const fetched = response?.collections || [];
|
|
26654
26687
|
setCollections(fetched);
|
|
26655
26688
|
if (fetched.length === 0) {
|
|
26656
|
-
setError(
|
|
26689
|
+
setError(
|
|
26690
|
+
t("actionTypes.shared.errors.noCollections", { defaultValue: "No {{claimCollections}} found for this {{did}}", claimCollections: "claim collections", did: "DID" })
|
|
26691
|
+
);
|
|
26657
26692
|
}
|
|
26658
26693
|
if (local.collectionId && !fetched.some((c) => c.id === local.collectionId)) {
|
|
26659
26694
|
update({ collectionId: "" });
|
|
26660
26695
|
}
|
|
26661
26696
|
} catch (err) {
|
|
26662
26697
|
setCollections([]);
|
|
26663
|
-
setError(
|
|
26698
|
+
setError(
|
|
26699
|
+
err instanceof Error ? err.message : t("actionTypes.shared.errors.fetchCollections", { defaultValue: "Failed to fetch {{claimCollections}}", claimCollections: "claim collections" })
|
|
26700
|
+
);
|
|
26664
26701
|
} finally {
|
|
26665
26702
|
setLoadingCollections(false);
|
|
26666
26703
|
}
|
|
@@ -26676,8 +26713,12 @@ var EvaluateBidConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
26676
26713
|
DataInput,
|
|
26677
26714
|
{
|
|
26678
26715
|
label: "DID",
|
|
26679
|
-
placeholder: "Enter deed DID",
|
|
26680
|
-
description: "
|
|
26716
|
+
placeholder: t("actionTypes.shared.didPlaceholder", { defaultValue: "Enter deed {{did}}", did: "DID" }),
|
|
26717
|
+
description: t("actionTypes.shared.didDescription", {
|
|
26718
|
+
defaultValue: "The {{did}} identifier for fetching {{claimCollections}}.",
|
|
26719
|
+
did: "DID",
|
|
26720
|
+
claimCollections: "claim collections"
|
|
26721
|
+
}),
|
|
26681
26722
|
value: local.deedDid,
|
|
26682
26723
|
onChange: (value) => update({ deedDid: value }),
|
|
26683
26724
|
editorDocument: editor?.document || [],
|
|
@@ -26694,12 +26735,12 @@ var EvaluateBidConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
26694
26735
|
if (entityDid) update({ deedDid: entityDid });
|
|
26695
26736
|
}
|
|
26696
26737
|
},
|
|
26697
|
-
"Use Current Entity"
|
|
26698
|
-
), /* @__PURE__ */ React261.createElement(BasePrimaryButton, { onClick: fetchCollections, disabled: !local.deedDid.trim() || loadingCollections }, loadingCollections ? /* @__PURE__ */ React261.createElement(Loader44, { size: "xs", color: "dark" }) : "Get Collections"), error && /* @__PURE__ */ React261.createElement(Alert47, { color: "red", styles: actionAlertStyles }, error), collectionOptions.length > 0 && /* @__PURE__ */ React261.createElement(
|
|
26738
|
+
t("actionTypes.shared.useCurrentEntity", { defaultValue: "Use Current {{entity}}", entity: "Entity" })
|
|
26739
|
+
), /* @__PURE__ */ React261.createElement(BasePrimaryButton, { onClick: fetchCollections, disabled: !local.deedDid.trim() || loadingCollections }, loadingCollections ? /* @__PURE__ */ React261.createElement(Loader44, { size: "xs", color: "dark" }) : t("actionTypes.shared.getCollections", { defaultValue: "Get {{collections}}", collections: "Collections" })), error && /* @__PURE__ */ React261.createElement(Alert47, { color: "red", styles: actionAlertStyles }, error), collectionOptions.length > 0 && /* @__PURE__ */ React261.createElement(
|
|
26699
26740
|
BaseSelect,
|
|
26700
26741
|
{
|
|
26701
26742
|
label: "Claim Collection",
|
|
26702
|
-
placeholder: "Select a collection",
|
|
26743
|
+
placeholder: t("actionTypes.shared.collectionPlaceholder", { defaultValue: "Select a collection" }),
|
|
26703
26744
|
value: local.collectionId || null,
|
|
26704
26745
|
onChange: (value) => update({ collectionId: value || "" }),
|
|
26705
26746
|
data: collectionOptions,
|
|
@@ -26741,11 +26782,11 @@ function getRoleColor2(role) {
|
|
|
26741
26782
|
if (r === "evaluation_agent" || r === "ea") return "green";
|
|
26742
26783
|
return "gray";
|
|
26743
26784
|
}
|
|
26744
|
-
function getRoleLabel2(role) {
|
|
26785
|
+
function getRoleLabel2(role, translate) {
|
|
26745
26786
|
const r = String(role || "").toLowerCase();
|
|
26746
|
-
if (r === "service_agent" || r === "sa") return "Contributor";
|
|
26747
|
-
if (r === "evaluation_agent" || r === "ea") return "Evaluator";
|
|
26748
|
-
return role || "Unknown";
|
|
26787
|
+
if (r === "service_agent" || r === "sa") return translate("actionTypes.bid.flow.role.contributor", { defaultValue: "Contributor" });
|
|
26788
|
+
if (r === "evaluation_agent" || r === "ea") return translate("actionTypes.bid.flow.role.evaluator", { defaultValue: "Evaluator" });
|
|
26789
|
+
return role || translate("actionTypes.evaluateBid.flow.role.unknown", { defaultValue: "Unknown" });
|
|
26749
26790
|
}
|
|
26750
26791
|
var USDC_DENOM4 = "ibc/6BBE9BD4246F8E04948D5A4EEE7164B2630263B9EBB5E7DC5F0A46C62A2FF97B";
|
|
26751
26792
|
var IXO_DENOM4 = "uixo";
|
|
@@ -26780,14 +26821,14 @@ function truncateAddress2(address) {
|
|
|
26780
26821
|
if (address.length <= 14) return address;
|
|
26781
26822
|
return `${address.slice(0, 8)}...${address.slice(-3)}`;
|
|
26782
26823
|
}
|
|
26783
|
-
function getBidStatus(bid) {
|
|
26824
|
+
function getBidStatus(bid, translate) {
|
|
26784
26825
|
try {
|
|
26785
26826
|
const data = typeof bid.data === "string" ? JSON.parse(bid.data) : bid.data;
|
|
26786
|
-
if (data?.status === "approved") return { label: "Approved", color: "green" };
|
|
26787
|
-
if (data?.status === "rejected") return { label: "Rejected", color: "red" };
|
|
26827
|
+
if (data?.status === "approved") return { label: translate("actionTypes.evaluateBid.flow.status.approved", { defaultValue: "Approved" }), key: "approved", color: "green" };
|
|
26828
|
+
if (data?.status === "rejected") return { label: translate("actionTypes.evaluateBid.flow.status.rejected", { defaultValue: "Rejected" }), key: "rejected", color: "red" };
|
|
26788
26829
|
} catch {
|
|
26789
26830
|
}
|
|
26790
|
-
return { label: "Pending", color: "yellow" };
|
|
26831
|
+
return { label: translate("actionTypes.evaluateBid.flow.status.pending", { defaultValue: "Pending" }), key: "pending", color: "yellow" };
|
|
26791
26832
|
}
|
|
26792
26833
|
var EvaluateBidFlowDetail = ({
|
|
26793
26834
|
inputs,
|
|
@@ -26799,6 +26840,7 @@ var EvaluateBidFlowDetail = ({
|
|
|
26799
26840
|
unlockSigning,
|
|
26800
26841
|
registerRuntimeInputs
|
|
26801
26842
|
}) => {
|
|
26843
|
+
const t = useTranslate();
|
|
26802
26844
|
const handlers = useBlocknoteHandlers();
|
|
26803
26845
|
const handlersRef = useRef27(handlers);
|
|
26804
26846
|
useEffect93(() => {
|
|
@@ -26842,10 +26884,7 @@ var EvaluateBidFlowDetail = ({
|
|
|
26842
26884
|
const selectedBid = useMemo98(() => bids.find((bid) => bid.id === selectedBidId) || null, [bids, selectedBidId]);
|
|
26843
26885
|
const filteredBids = useMemo98(() => {
|
|
26844
26886
|
if (activeFilter === "all") return bids;
|
|
26845
|
-
return bids.filter((bid) =>
|
|
26846
|
-
const status = getBidStatus(bid).label.toLowerCase();
|
|
26847
|
-
return status === activeFilter;
|
|
26848
|
-
});
|
|
26887
|
+
return bids.filter((bid) => getBidStatus(bid, t).key === activeFilter);
|
|
26849
26888
|
}, [bids, activeFilter]);
|
|
26850
26889
|
const refreshBids = useCallback92(async () => {
|
|
26851
26890
|
if (!deedDid || !collectionId) return;
|
|
@@ -26864,7 +26903,7 @@ var EvaluateBidFlowDetail = ({
|
|
|
26864
26903
|
} catch (err) {
|
|
26865
26904
|
setBids([]);
|
|
26866
26905
|
setAdminAddress("");
|
|
26867
|
-
setError(err instanceof Error ? err.message : "Failed to load bids");
|
|
26906
|
+
setError(err instanceof Error ? err.message : t("actionTypes.evaluateBid.flow.errors.loadBids", { defaultValue: "Failed to load bids" }));
|
|
26868
26907
|
} finally {
|
|
26869
26908
|
setLoadingBids(false);
|
|
26870
26909
|
}
|
|
@@ -26978,7 +27017,7 @@ var EvaluateBidFlowDetail = ({
|
|
|
26978
27017
|
const selectedBidIsEvaluator = selectedRole === "evaluation_agent" || selectedRole === "ea";
|
|
26979
27018
|
const actionDef = getAction("qi/bid.evaluate");
|
|
26980
27019
|
if (!actionDef) {
|
|
26981
|
-
setError("evaluateBid action is not registered");
|
|
27020
|
+
setError(t("actionTypes.evaluateBid.flow.errors.actionNotRegistered", { defaultValue: "evaluateBid action is not registered" }));
|
|
26982
27021
|
return;
|
|
26983
27022
|
}
|
|
26984
27023
|
setSubmitting(true);
|
|
@@ -27029,14 +27068,14 @@ var EvaluateBidFlowDetail = ({
|
|
|
27029
27068
|
pin: ""
|
|
27030
27069
|
// TODO: collect PIN from user for invocation signing
|
|
27031
27070
|
});
|
|
27032
|
-
if (!outcome.success) throw new Error(outcome.error || "Bid evaluation failed");
|
|
27071
|
+
if (!outcome.success) throw new Error(outcome.error || t("actionTypes.evaluateBid.flow.errors.evaluationFailed", { defaultValue: "Bid evaluation failed" }));
|
|
27033
27072
|
updateRuntime({ state: "completed", executedAt: Date.now(), output: outcome.result?.payload || {} });
|
|
27034
27073
|
setSelectedBidId("");
|
|
27035
27074
|
setDecision("");
|
|
27036
27075
|
setRejectReason("");
|
|
27037
27076
|
await refreshBids();
|
|
27038
27077
|
} catch (err) {
|
|
27039
|
-
const message = err instanceof Error ? err.message : "Failed to evaluate bid";
|
|
27078
|
+
const message = err instanceof Error ? err.message : t("actionTypes.evaluateBid.flow.errors.evaluateFailed", { defaultValue: "Failed to evaluate bid" });
|
|
27040
27079
|
setError(message);
|
|
27041
27080
|
updateRuntime({ state: "failed", error: { message, at: Date.now() } });
|
|
27042
27081
|
} finally {
|
|
@@ -27068,7 +27107,7 @@ var EvaluateBidFlowDetail = ({
|
|
|
27068
27107
|
refreshBids
|
|
27069
27108
|
]);
|
|
27070
27109
|
if (selectedBid) {
|
|
27071
|
-
const bidStatus = getBidStatus(selectedBid);
|
|
27110
|
+
const bidStatus = getBidStatus(selectedBid, t);
|
|
27072
27111
|
const bidRole = String(selectedBid.role || "").toLowerCase();
|
|
27073
27112
|
const bidIsEvaluator = bidRole === "evaluation_agent" || bidRole === "ea";
|
|
27074
27113
|
const selectedBidProfile = profilesByDid[selectedBid.did];
|
|
@@ -27079,7 +27118,7 @@ var EvaluateBidFlowDetail = ({
|
|
|
27079
27118
|
bidData = typeof selectedBid.data === "string" ? JSON.parse(selectedBid.data) : selectedBid.data;
|
|
27080
27119
|
} catch {
|
|
27081
27120
|
}
|
|
27082
|
-
return /* @__PURE__ */ React263.createElement(Stack180, { gap: "md" }, /* @__PURE__ */ React263.createElement(Group101, { gap: "xs", align: "center" }, /* @__PURE__ */ React263.createElement(ActionIcon39, { variant: "subtle", color: "gray", size: "sm", onClick: () => setSelectedBidId("") }, /* @__PURE__ */ React263.createElement(IconArrowLeft7, { size: 16 })), /* @__PURE__ */ React263.createElement(Text158, { fw: 500, size: "sm", truncate: true, style: { flex: 1, minWidth: 0 } }, "
|
|
27121
|
+
return /* @__PURE__ */ React263.createElement(Stack180, { gap: "md" }, /* @__PURE__ */ React263.createElement(Group101, { gap: "xs", align: "center" }, /* @__PURE__ */ React263.createElement(ActionIcon39, { variant: "subtle", color: "gray", size: "sm", onClick: () => setSelectedBidId("") }, /* @__PURE__ */ React263.createElement(IconArrowLeft7, { size: 16 })), /* @__PURE__ */ React263.createElement(Text158, { fw: 500, size: "sm", truncate: true, style: { flex: 1, minWidth: 0 } }, t("actionTypes.evaluateBid.flow.bidNumber", { id: selectedBid.id, defaultValue: `Bid #${selectedBid.id}` }))), /* @__PURE__ */ React263.createElement(Group101, { gap: 16, align: "center", style: { width: "100%" } }, /* @__PURE__ */ React263.createElement(
|
|
27083
27122
|
Box53,
|
|
27084
27123
|
{
|
|
27085
27124
|
style: {
|
|
@@ -27100,7 +27139,7 @@ var EvaluateBidFlowDetail = ({
|
|
|
27100
27139
|
}
|
|
27101
27140
|
},
|
|
27102
27141
|
selectedBidProfile?.avatarUrl ? null : selectedAvatarLabel
|
|
27103
|
-
), /* @__PURE__ */ React263.createElement(Stack180, { gap: 0, style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ React263.createElement(Text158, { fw: 500, size: "md", truncate: true }, selectedDisplayName), /* @__PURE__ */ React263.createElement(Text158, { size: "xs", c: "dimmed", truncate: true }, truncateAddress2(selectedBid.address))), /* @__PURE__ */ React263.createElement(Stack180, { gap: 0, align: "flex-end", style: { flexShrink: 0 } }, /* @__PURE__ */ React263.createElement(Text158, { fw: 500, size: "md", c: bidStatus.color === "green" ? "green" : bidStatus.color === "red" ? "red" : void 0 }, bidStatus.color === "green" && /* @__PURE__ */ React263.createElement(IconCheck20, { size: 14, style: { verticalAlign: "middle", marginRight: 4 } }), bidStatus.label), /* @__PURE__ */ React263.createElement(Text158, { size: "xs", c: "dimmed" }, getTimeAgo(selectedBid.created || "")))), /* @__PURE__ */ React263.createElement(CollapsibleSection, { title: "Details" }, /* @__PURE__ */ React263.createElement(Stack180, { gap: "xs" }, /* @__PURE__ */ React263.createElement(Group101, { justify: "space-between" }, /* @__PURE__ */ React263.createElement(Text158, { size: "xs", c: "dimmed" }, "Bid ID"), /* @__PURE__ */ React263.createElement(Text158, { size: "xs", truncate: true }, selectedBid.id)), /* @__PURE__ */ React263.createElement(Group101, { justify: "space-between" }, /* @__PURE__ */ React263.createElement(Text158, { size: "xs", c: "dimmed" }, "Collection"), /* @__PURE__ */ React263.createElement(Text158, { size: "xs" }, selectedBid.collection || collectionId)), /* @__PURE__ */ React263.createElement(Group101, { justify: "space-between" }, /* @__PURE__ */ React263.createElement(Text158, { size: "xs", c: "dimmed" }, "Role"), /* @__PURE__ */ React263.createElement(Badge49, { size: "xs", variant: "light", color: getRoleColor2(selectedBid.role) }, getRoleLabel2(selectedBid.role))), /* @__PURE__ */ React263.createElement(Group101, { justify: "space-between" }, /* @__PURE__ */ React263.createElement(Text158, { size: "xs", c: "dimmed" }, "Address"), /* @__PURE__ */ React263.createElement(Text158, { size: "xs" }, selectedBid.address)))), /* @__PURE__ */ React263.createElement(CollapsibleSection, { title: "Inputs" }, bidData && typeof bidData === "object" ? /* @__PURE__ */ React263.createElement(
|
|
27142
|
+
), /* @__PURE__ */ React263.createElement(Stack180, { gap: 0, style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ React263.createElement(Text158, { fw: 500, size: "md", truncate: true }, selectedDisplayName), /* @__PURE__ */ React263.createElement(Text158, { size: "xs", c: "dimmed", truncate: true }, truncateAddress2(selectedBid.address))), /* @__PURE__ */ React263.createElement(Stack180, { gap: 0, align: "flex-end", style: { flexShrink: 0 } }, /* @__PURE__ */ React263.createElement(Text158, { fw: 500, size: "md", c: bidStatus.color === "green" ? "green" : bidStatus.color === "red" ? "red" : void 0 }, bidStatus.color === "green" && /* @__PURE__ */ React263.createElement(IconCheck20, { size: 14, style: { verticalAlign: "middle", marginRight: 4 } }), bidStatus.label), /* @__PURE__ */ React263.createElement(Text158, { size: "xs", c: "dimmed" }, getTimeAgo(selectedBid.created || "")))), /* @__PURE__ */ React263.createElement(CollapsibleSection, { title: t("actionTypes.evaluateBid.flow.section.details", { defaultValue: "Details" }) }, /* @__PURE__ */ React263.createElement(Stack180, { gap: "xs" }, /* @__PURE__ */ React263.createElement(Group101, { justify: "space-between" }, /* @__PURE__ */ React263.createElement(Text158, { size: "xs", c: "dimmed" }, "Bid ID"), /* @__PURE__ */ React263.createElement(Text158, { size: "xs", truncate: true }, selectedBid.id)), /* @__PURE__ */ React263.createElement(Group101, { justify: "space-between" }, /* @__PURE__ */ React263.createElement(Text158, { size: "xs", c: "dimmed" }, "Collection"), /* @__PURE__ */ React263.createElement(Text158, { size: "xs" }, selectedBid.collection || collectionId)), /* @__PURE__ */ React263.createElement(Group101, { justify: "space-between" }, /* @__PURE__ */ React263.createElement(Text158, { size: "xs", c: "dimmed" }, t("actionTypes.evaluateBid.flow.details.role", { defaultValue: "Role" })), /* @__PURE__ */ React263.createElement(Badge49, { size: "xs", variant: "light", color: getRoleColor2(selectedBid.role) }, getRoleLabel2(selectedBid.role, t))), /* @__PURE__ */ React263.createElement(Group101, { justify: "space-between" }, /* @__PURE__ */ React263.createElement(Text158, { size: "xs", c: "dimmed" }, t("actionTypes.evaluateBid.flow.details.address", { defaultValue: "Address" })), /* @__PURE__ */ React263.createElement(Text158, { size: "xs" }, selectedBid.address)))), /* @__PURE__ */ React263.createElement(CollapsibleSection, { title: t("actionTypes.evaluateBid.flow.section.inputs", { defaultValue: "Inputs" }) }, bidData && typeof bidData === "object" ? /* @__PURE__ */ React263.createElement(
|
|
27104
27143
|
JsonInput,
|
|
27105
27144
|
{
|
|
27106
27145
|
value: JSON.stringify(bidData, null, 2),
|
|
@@ -27120,29 +27159,29 @@ var EvaluateBidFlowDetail = ({
|
|
|
27120
27159
|
}
|
|
27121
27160
|
}
|
|
27122
27161
|
}
|
|
27123
|
-
) : /* @__PURE__ */ React263.createElement(Text158, { size: "xs", c: "dimmed" }, "No input data available.")), /* @__PURE__ */ React263.createElement(
|
|
27162
|
+
) : /* @__PURE__ */ React263.createElement(Text158, { size: "xs", c: "dimmed" }, t("actionTypes.evaluateBid.flow.noInputData", { defaultValue: "No input data available." }))), /* @__PURE__ */ React263.createElement(
|
|
27124
27163
|
BaseSelect,
|
|
27125
27164
|
{
|
|
27126
|
-
label: "Decision",
|
|
27127
|
-
placeholder: "Select decision",
|
|
27165
|
+
label: t("actionTypes.evaluateClaim.flow.decision.label", { defaultValue: "Decision" }),
|
|
27166
|
+
placeholder: t("actionTypes.evaluateClaim.flow.decision.placeholder", { defaultValue: "Select decision" }),
|
|
27128
27167
|
value: decision || null,
|
|
27129
27168
|
onChange: (value) => setDecision(value || ""),
|
|
27130
27169
|
data: [
|
|
27131
|
-
{ value: "approve", label: "Approve" },
|
|
27132
|
-
{ value: "reject", label: "Reject" }
|
|
27170
|
+
{ value: "approve", label: t("actionTypes.evaluateClaim.flow.decision.approve", { defaultValue: "Approve" }) },
|
|
27171
|
+
{ value: "reject", label: t("actionTypes.evaluateClaim.flow.decision.reject", { defaultValue: "Reject" }) }
|
|
27133
27172
|
],
|
|
27134
27173
|
disabled: isDisabled || submitting
|
|
27135
27174
|
}
|
|
27136
|
-
), decision && (decision === "reject" || decision === "approve" && bidIsEvaluator) && /* @__PURE__ */ React263.createElement(CollapsibleSection, { title: "Evaluation", defaultOpen: true }, /* @__PURE__ */ React263.createElement(Stack180, { gap: "md" }, decision === "reject" && /* @__PURE__ */ React263.createElement(Stack180, { gap: 4 }, /* @__PURE__ */ React263.createElement(Text158, { size: "xs", c: "dimmed" }, "Reason", " ", bidIsEvaluator && /* @__PURE__ */ React263.createElement(Text158, { span: true, c: "red", size: "xs" }, "*")), /* @__PURE__ */ React263.createElement(
|
|
27175
|
+
), decision && (decision === "reject" || decision === "approve" && bidIsEvaluator) && /* @__PURE__ */ React263.createElement(CollapsibleSection, { title: t("actionTypes.evaluateClaim.flow.section.evaluation", { defaultValue: "Evaluation" }), defaultOpen: true }, /* @__PURE__ */ React263.createElement(Stack180, { gap: "md" }, decision === "reject" && /* @__PURE__ */ React263.createElement(Stack180, { gap: 4 }, /* @__PURE__ */ React263.createElement(Text158, { size: "xs", c: "dimmed" }, t("actionTypes.evaluateBid.flow.reason", { defaultValue: "Reason" }), " ", bidIsEvaluator && /* @__PURE__ */ React263.createElement(Text158, { span: true, c: "red", size: "xs" }, "*")), /* @__PURE__ */ React263.createElement(
|
|
27137
27176
|
BaseTextArea,
|
|
27138
27177
|
{
|
|
27139
|
-
placeholder: "Start Typing",
|
|
27178
|
+
placeholder: t("actionTypes.evaluateBid.flow.startTyping", { defaultValue: "Start Typing" }),
|
|
27140
27179
|
value: rejectReason,
|
|
27141
27180
|
onChange: (event) => setRejectReason(event.currentTarget.value),
|
|
27142
27181
|
minRows: 2,
|
|
27143
27182
|
disabled: isDisabled || submitting
|
|
27144
27183
|
}
|
|
27145
|
-
)), decision === "approve" && bidIsEvaluator && /* @__PURE__ */ React263.createElement(React263.Fragment, null, /* @__PURE__ */ React263.createElement(Divider21, { color: "color-mix(in srgb, var(--mantine-color-text) 6%, transparent)" }), /* @__PURE__ */ React263.createElement(Text158, { size: "xs", c: "dimmed" }, "Payment (used as evaluator max amount)"), paymentRows.map((row, index) => /* @__PURE__ */ React263.createElement(Stack180, { key: row.id, gap: 8 }, /* @__PURE__ */ React263.createElement(Group101, { justify: "space-between", align: "center" }, /* @__PURE__ */ React263.createElement(Text158, { size: "sm" }, "
|
|
27184
|
+
)), decision === "approve" && bidIsEvaluator && /* @__PURE__ */ React263.createElement(React263.Fragment, null, /* @__PURE__ */ React263.createElement(Divider21, { color: "color-mix(in srgb, var(--mantine-color-text) 6%, transparent)" }), /* @__PURE__ */ React263.createElement(Text158, { size: "xs", c: "dimmed" }, t("actionTypes.evaluateBid.flow.paymentLabel", { defaultValue: "Payment (used as evaluator max amount)" })), paymentRows.map((row, index) => /* @__PURE__ */ React263.createElement(Stack180, { key: row.id, gap: 8 }, /* @__PURE__ */ React263.createElement(Group101, { justify: "space-between", align: "center" }, /* @__PURE__ */ React263.createElement(Text158, { size: "sm" }, t("actionTypes.evaluateClaim.flow.payment.token", { index: index + 1, defaultValue: `Token ${index + 1}` })), /* @__PURE__ */ React263.createElement(Group101, { gap: "xs" }, paymentRows.length > 1 && /* @__PURE__ */ React263.createElement(Button52, { variant: "subtle", size: "compact-xs", color: "red", onClick: () => removePaymentRow(row.id), disabled: isDisabled || submitting }, t("actionTypes.evaluateClaim.flow.payment.remove", { defaultValue: "Remove" })))), /* @__PURE__ */ React263.createElement(
|
|
27146
27185
|
BaseSelect,
|
|
27147
27186
|
{
|
|
27148
27187
|
value: row.denom,
|
|
@@ -27150,7 +27189,7 @@ var EvaluateBidFlowDetail = ({
|
|
|
27150
27189
|
data: [
|
|
27151
27190
|
{ value: IXO_DENOM4, label: "IXO" },
|
|
27152
27191
|
{ value: USDC_DENOM4, label: "USDC" },
|
|
27153
|
-
{ value: CUSTOM_DENOM, label: "Custom" }
|
|
27192
|
+
{ value: CUSTOM_DENOM, label: t("actionTypes.evaluateClaim.flow.payment.custom", { defaultValue: "Custom" }) }
|
|
27154
27193
|
],
|
|
27155
27194
|
clearable: false,
|
|
27156
27195
|
disabled: isDisabled || submitting
|
|
@@ -27158,7 +27197,7 @@ var EvaluateBidFlowDetail = ({
|
|
|
27158
27197
|
), row.denom === CUSTOM_DENOM && /* @__PURE__ */ React263.createElement(
|
|
27159
27198
|
BaseTextInput,
|
|
27160
27199
|
{
|
|
27161
|
-
placeholder: "Custom denom (e.g. ibc/... or uixo)",
|
|
27200
|
+
placeholder: t("actionTypes.evaluateClaim.flow.payment.customDenomPlaceholder", { defaultValue: "Custom denom (e.g. ibc/... or uixo)" }),
|
|
27162
27201
|
value: row.customDenom,
|
|
27163
27202
|
onChange: (event) => updatePaymentRow(row.id, { customDenom: event.currentTarget.value }),
|
|
27164
27203
|
disabled: isDisabled || submitting
|
|
@@ -27169,13 +27208,17 @@ var EvaluateBidFlowDetail = ({
|
|
|
27169
27208
|
min: 0,
|
|
27170
27209
|
value: row.amount,
|
|
27171
27210
|
onChange: (value) => updatePaymentRow(row.id, { amount: value }),
|
|
27172
|
-
placeholder: "Amount",
|
|
27211
|
+
placeholder: t("actionTypes.evaluateClaim.flow.payment.amountPlaceholder", { defaultValue: "Amount" }),
|
|
27173
27212
|
disabled: isDisabled || submitting
|
|
27174
27213
|
}
|
|
27175
|
-
))), /* @__PURE__ */ React263.createElement(Button52, { variant: "light", size: "xs", onClick: addPaymentRow, disabled: isDisabled || submitting }, "Add Payment")))), error && /* @__PURE__ */ React263.createElement(Alert48, { color: "red", styles: actionAlertStyles }, error));
|
|
27214
|
+
))), /* @__PURE__ */ React263.createElement(Button52, { variant: "light", size: "xs", onClick: addPaymentRow, disabled: isDisabled || submitting }, t("actionTypes.evaluateClaim.flow.payment.addPayment", { defaultValue: "Add Payment" }))))), error && /* @__PURE__ */ React263.createElement(Alert48, { color: "red", styles: actionAlertStyles }, error));
|
|
27176
27215
|
}
|
|
27177
|
-
const filterTabs = [{ value: "pending", label: "Pending" }];
|
|
27178
|
-
return /* @__PURE__ */ React263.createElement(Stack180, { gap: "md" }, !deedDid || !collectionId ? /* @__PURE__ */ React263.createElement(Alert48, { color: "yellow", styles: actionAlertStyles }, "
|
|
27216
|
+
const filterTabs = [{ value: "pending", label: t("actionTypes.evaluateBid.flow.status.pending", { defaultValue: "Pending" }) }];
|
|
27217
|
+
return /* @__PURE__ */ React263.createElement(Stack180, { gap: "md" }, !deedDid || !collectionId ? /* @__PURE__ */ React263.createElement(Alert48, { color: "yellow", styles: actionAlertStyles }, t("actionTypes.shared.errors.configRequired", {
|
|
27218
|
+
defaultValue: "Configure {{did}} and {{claimCollection}} in template mode before running this action.",
|
|
27219
|
+
did: "DID",
|
|
27220
|
+
claimCollection: "claim collection"
|
|
27221
|
+
})) : /* @__PURE__ */ React263.createElement(React263.Fragment, null, /* @__PURE__ */ React263.createElement(Group101, { justify: "space-between", align: "center" }, /* @__PURE__ */ React263.createElement(Group101, { gap: 0 }, filterTabs.map((tab) => /* @__PURE__ */ React263.createElement(
|
|
27179
27222
|
UnstyledButton4,
|
|
27180
27223
|
{
|
|
27181
27224
|
key: tab.value,
|
|
@@ -27189,8 +27232,8 @@ var EvaluateBidFlowDetail = ({
|
|
|
27189
27232
|
}
|
|
27190
27233
|
},
|
|
27191
27234
|
/* @__PURE__ */ React263.createElement(Text158, { size: "sm", fw: 500, c: activeFilter === tab.value ? "var(--mantine-color-text)" : "dimmed" }, tab.label)
|
|
27192
|
-
))), /* @__PURE__ */ React263.createElement(ActionIcon39, { variant: "subtle", color: "gray", size: "sm" }, /* @__PURE__ */ React263.createElement(IconFilter, { size: 16 }))), loadingBids && /* @__PURE__ */ React263.createElement(Group101, { gap: "xs", justify: "center", py: "md" }, /* @__PURE__ */ React263.createElement(Loader45, { size: "xs" }), /* @__PURE__ */ React263.createElement(Text158, { size: "xs", c: "dimmed" }, "Loading bids...")), !loadingBids && filteredBids.length === 0 && /* @__PURE__ */ React263.createElement(Text158, { size: "sm", c: "dimmed", ta: "center", py: "md" }, bids.length === 0 ? "No bids available for this collection." : `No ${activeFilter} bids found.`), filteredBids.length > 0 && /* @__PURE__ */ React263.createElement(Stack180, { gap: 12 }, filteredBids.map((bid) => {
|
|
27193
|
-
const status = getBidStatus(bid);
|
|
27235
|
+
))), /* @__PURE__ */ React263.createElement(ActionIcon39, { variant: "subtle", color: "gray", size: "sm" }, /* @__PURE__ */ React263.createElement(IconFilter, { size: 16 }))), loadingBids && /* @__PURE__ */ React263.createElement(Group101, { gap: "xs", justify: "center", py: "md" }, /* @__PURE__ */ React263.createElement(Loader45, { size: "xs" }), /* @__PURE__ */ React263.createElement(Text158, { size: "xs", c: "dimmed" }, t("actionTypes.evaluateBid.flow.loadingBids", { defaultValue: "Loading bids..." }))), !loadingBids && filteredBids.length === 0 && /* @__PURE__ */ React263.createElement(Text158, { size: "sm", c: "dimmed", ta: "center", py: "md" }, bids.length === 0 ? t("actionTypes.evaluateBid.flow.empty.allCollections", { defaultValue: "No bids available for this collection." }) : t("actionTypes.evaluateBid.flow.empty.filtered", { filter: activeFilter, defaultValue: `No ${activeFilter} bids found.` })), filteredBids.length > 0 && /* @__PURE__ */ React263.createElement(Stack180, { gap: 12 }, filteredBids.map((bid) => {
|
|
27236
|
+
const status = getBidStatus(bid, t);
|
|
27194
27237
|
const profile = profilesByDid[bid.did];
|
|
27195
27238
|
const displayName = profile?.displayname || bid.did || bid.address;
|
|
27196
27239
|
const avatarLabel = (profile?.displayname || bid.did || bid.address || "?")[0]?.toUpperCase();
|
|
@@ -27253,6 +27296,7 @@ function serializeClaimActionInputs(inputs) {
|
|
|
27253
27296
|
|
|
27254
27297
|
// src/mantine/blocks/action/actionTypes/claim/ClaimConfig.tsx
|
|
27255
27298
|
var ClaimConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
27299
|
+
const t = useTranslate();
|
|
27256
27300
|
const handlers = useBlocknoteHandlers();
|
|
27257
27301
|
const [local, setLocal] = useState116(() => parseClaimActionInputs(inputs));
|
|
27258
27302
|
const [collections, setCollections] = useState116([]);
|
|
@@ -27291,11 +27335,13 @@ var ClaimConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
27291
27335
|
const surveySchema = extractSurveyAnswerSchema(result?.surveyTemplate);
|
|
27292
27336
|
update({ surveyAnswersSchema: surveySchema });
|
|
27293
27337
|
if (surveySchema.length === 0) {
|
|
27294
|
-
setSchemaError(
|
|
27338
|
+
setSchemaError(
|
|
27339
|
+
t("actionTypes.claim.config.surveyHasNoQuestions", { defaultValue: "Survey has no recognised questions \u2014 downstream blocks will only see baseline claim fields." })
|
|
27340
|
+
);
|
|
27295
27341
|
}
|
|
27296
27342
|
} catch (err) {
|
|
27297
27343
|
if (gen !== fetchGenRef.current) return;
|
|
27298
|
-
setSchemaError(err instanceof Error ? err.message : "Failed to load survey template");
|
|
27344
|
+
setSchemaError(err instanceof Error ? err.message : t("actionTypes.shared.errors.surveyTemplateLoad", { defaultValue: "Failed to load survey template" }));
|
|
27299
27345
|
update({ surveyAnswersSchema: [] });
|
|
27300
27346
|
} finally {
|
|
27301
27347
|
if (gen === fetchGenRef.current) setSchemaLoading(false);
|
|
@@ -27311,7 +27357,7 @@ var ClaimConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
27311
27357
|
const fetchCollections = useCallback93(async () => {
|
|
27312
27358
|
const deedDid = local.deedDid.trim();
|
|
27313
27359
|
if (!deedDid) {
|
|
27314
|
-
setError("Please enter a
|
|
27360
|
+
setError(t("actionTypes.shared.errors.didRequired", { defaultValue: "Please enter a {{did}} first", did: "DID" }));
|
|
27315
27361
|
return;
|
|
27316
27362
|
}
|
|
27317
27363
|
const persisted = { ...local, deedDid };
|
|
@@ -27324,14 +27370,18 @@ var ClaimConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
27324
27370
|
const fetched = response?.collections || [];
|
|
27325
27371
|
setCollections(fetched);
|
|
27326
27372
|
if (fetched.length === 0) {
|
|
27327
|
-
setError(
|
|
27373
|
+
setError(
|
|
27374
|
+
t("actionTypes.shared.errors.noCollections", { defaultValue: "No {{claimCollections}} found for this {{did}}", claimCollections: "claim collections", did: "DID" })
|
|
27375
|
+
);
|
|
27328
27376
|
}
|
|
27329
27377
|
if (local.collectionId && !fetched.some((c) => c.id === local.collectionId)) {
|
|
27330
27378
|
update({ collectionId: "" });
|
|
27331
27379
|
}
|
|
27332
27380
|
} catch (err) {
|
|
27333
27381
|
setCollections([]);
|
|
27334
|
-
setError(
|
|
27382
|
+
setError(
|
|
27383
|
+
err instanceof Error ? err.message : t("actionTypes.shared.errors.fetchCollections", { defaultValue: "Failed to fetch {{claimCollections}}", claimCollections: "claim collections" })
|
|
27384
|
+
);
|
|
27335
27385
|
} finally {
|
|
27336
27386
|
setLoadingCollections(false);
|
|
27337
27387
|
}
|
|
@@ -27347,8 +27397,12 @@ var ClaimConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
27347
27397
|
DataInput,
|
|
27348
27398
|
{
|
|
27349
27399
|
label: "DID",
|
|
27350
|
-
placeholder: "Enter deed DID",
|
|
27351
|
-
description: "
|
|
27400
|
+
placeholder: t("actionTypes.shared.didPlaceholder", { defaultValue: "Enter deed {{did}}", did: "DID" }),
|
|
27401
|
+
description: t("actionTypes.shared.didDescription", {
|
|
27402
|
+
defaultValue: "The {{did}} identifier for fetching {{claimCollections}}.",
|
|
27403
|
+
did: "DID",
|
|
27404
|
+
claimCollections: "claim collections"
|
|
27405
|
+
}),
|
|
27352
27406
|
value: local.deedDid,
|
|
27353
27407
|
onChange: (value) => update({ deedDid: value }),
|
|
27354
27408
|
editorDocument: editor?.document || [],
|
|
@@ -27365,12 +27419,12 @@ var ClaimConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
27365
27419
|
if (entityDid) update({ deedDid: entityDid });
|
|
27366
27420
|
}
|
|
27367
27421
|
},
|
|
27368
|
-
"Use Current Entity"
|
|
27369
|
-
), /* @__PURE__ */ React264.createElement(BasePrimaryButton, { onClick: fetchCollections, disabled: !local.deedDid.trim() || loadingCollections }, loadingCollections ? /* @__PURE__ */ React264.createElement(Loader46, { size: "xs", color: "dark" }) : "Get Collections"), error && /* @__PURE__ */ React264.createElement(Alert49, { color: "red", styles: actionAlertStyles }, error), collectionOptions.length > 0 && /* @__PURE__ */ React264.createElement(
|
|
27422
|
+
t("actionTypes.shared.useCurrentEntity", { defaultValue: "Use Current {{entity}}", entity: "Entity" })
|
|
27423
|
+
), /* @__PURE__ */ React264.createElement(BasePrimaryButton, { onClick: fetchCollections, disabled: !local.deedDid.trim() || loadingCollections }, loadingCollections ? /* @__PURE__ */ React264.createElement(Loader46, { size: "xs", color: "dark" }) : t("actionTypes.shared.getCollections", { defaultValue: "Get {{collections}}", collections: "Collections" })), error && /* @__PURE__ */ React264.createElement(Alert49, { color: "red", styles: actionAlertStyles }, error), collectionOptions.length > 0 && /* @__PURE__ */ React264.createElement(
|
|
27370
27424
|
BaseSelect,
|
|
27371
27425
|
{
|
|
27372
27426
|
label: "Claim Collection",
|
|
27373
|
-
placeholder: "Select a collection",
|
|
27427
|
+
placeholder: t("actionTypes.shared.collectionPlaceholder", { defaultValue: "Select a collection" }),
|
|
27374
27428
|
value: local.collectionId || null,
|
|
27375
27429
|
onChange: (value) => {
|
|
27376
27430
|
const next = value || "";
|
|
@@ -27380,7 +27434,10 @@ var ClaimConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
27380
27434
|
required: true,
|
|
27381
27435
|
searchable: true
|
|
27382
27436
|
}
|
|
27383
|
-
), local.collectionId && /* @__PURE__ */ React264.createElement(Stack181, { gap: 4 }, schemaLoading && /* @__PURE__ */ React264.createElement(Text159, { size: "xs", c: "dimmed" }, "Loading survey schema..."), !schemaLoading && local.surveyAnswersSchema.length > 0 && /* @__PURE__ */ React264.createElement(Text159, { size: "xs", c: "dimmed" },
|
|
27437
|
+
), local.collectionId && /* @__PURE__ */ React264.createElement(Stack181, { gap: 4 }, schemaLoading && /* @__PURE__ */ React264.createElement(Text159, { size: "xs", c: "dimmed" }, t("actionTypes.shared.loadingSurveySchema", { defaultValue: "Loading survey schema..." })), !schemaLoading && local.surveyAnswersSchema.length > 0 && /* @__PURE__ */ React264.createElement(Text159, { size: "xs", c: "dimmed" }, t("actionTypes.claim.config.emitsPrefix", { defaultValue: "Emits" }), " ", /* @__PURE__ */ React264.createElement("code", null, "submitted"), " ", t("actionTypes.claim.config.emitsWith", { defaultValue: "with" }), " ", local.surveyAnswersSchema.length, " ", t("actionTypes.claim.config.typedSurveyField", {
|
|
27438
|
+
count: local.surveyAnswersSchema.length,
|
|
27439
|
+
defaultValue: local.surveyAnswersSchema.length === 1 ? "typed survey field" : "typed survey fields"
|
|
27440
|
+
}), ". ", t("actionTypes.claim.config.listenerBlocksCanReference", { defaultValue: "Listener blocks can reference" }), " ", /* @__PURE__ */ React264.createElement("code", null, "$", "{", "sourceBlock.payload.surveyAnswers.<field>", "}"), "."), schemaError && /* @__PURE__ */ React264.createElement(Alert49, { color: "yellow", styles: actionAlertStyles }, schemaError)));
|
|
27384
27441
|
};
|
|
27385
27442
|
|
|
27386
27443
|
// src/mantine/blocks/action/actionTypes/claim/ClaimFlowDetail.tsx
|
|
@@ -27427,6 +27484,7 @@ var ClaimFlowDetail = ({
|
|
|
27427
27484
|
unlockSigning,
|
|
27428
27485
|
registerRuntimeInputs
|
|
27429
27486
|
}) => {
|
|
27487
|
+
const t = useTranslate();
|
|
27430
27488
|
const handlers = useBlocknoteHandlers();
|
|
27431
27489
|
const handlersRef = useRef29(handlers);
|
|
27432
27490
|
useEffect95(() => {
|
|
@@ -27565,7 +27623,7 @@ var ClaimFlowDetail = ({
|
|
|
27565
27623
|
} catch (err) {
|
|
27566
27624
|
setClaims([]);
|
|
27567
27625
|
setAdminAddress("");
|
|
27568
|
-
setError(err instanceof Error ? err.message : "Failed to load claim data");
|
|
27626
|
+
setError(err instanceof Error ? err.message : t("actionTypes.claim.flow.errors.loadClaimData", { defaultValue: "Failed to load claim data" }));
|
|
27569
27627
|
} finally {
|
|
27570
27628
|
setLoadingClaims(false);
|
|
27571
27629
|
}
|
|
@@ -27653,7 +27711,7 @@ var ClaimFlowDetail = ({
|
|
|
27653
27711
|
} catch (err) {
|
|
27654
27712
|
if (mounted) {
|
|
27655
27713
|
setIsServiceAgentAuthorized(false);
|
|
27656
|
-
setAuthError(err instanceof Error ? err.message : "Failed to verify authorization");
|
|
27714
|
+
setAuthError(err instanceof Error ? err.message : t("actionTypes.claim.flow.errors.verifyAuth", { defaultValue: "Failed to verify authorization" }));
|
|
27657
27715
|
}
|
|
27658
27716
|
} finally {
|
|
27659
27717
|
if (mounted) {
|
|
@@ -27688,7 +27746,7 @@ var ClaimFlowDetail = ({
|
|
|
27688
27746
|
setSurveyJson(templateResult.surveyTemplate);
|
|
27689
27747
|
}
|
|
27690
27748
|
} catch (err) {
|
|
27691
|
-
if (!cancelled) setError(err instanceof Error ? err.message : "Failed to load claim details");
|
|
27749
|
+
if (!cancelled) setError(err instanceof Error ? err.message : t("actionTypes.claim.flow.errors.loadClaimDetails", { defaultValue: "Failed to load claim details" }));
|
|
27692
27750
|
} finally {
|
|
27693
27751
|
if (!cancelled) setLoadingClaimDetail(false);
|
|
27694
27752
|
}
|
|
@@ -27726,13 +27784,13 @@ var ClaimFlowDetail = ({
|
|
|
27726
27784
|
const template = await handlers2.getDeedSurveyTemplate(deedDid, collectionId);
|
|
27727
27785
|
if (!template?.surveyTemplate) {
|
|
27728
27786
|
setSurveyJson(null);
|
|
27729
|
-
setError("No survey template found for this DID");
|
|
27787
|
+
setError(t("actionTypes.claim.flow.errors.noSurveyTemplate", { defaultValue: "No survey template found for this {{did}}", did: "DID" }));
|
|
27730
27788
|
return;
|
|
27731
27789
|
}
|
|
27732
27790
|
setSurveyJson(template.surveyTemplate);
|
|
27733
27791
|
} catch (err) {
|
|
27734
27792
|
setSurveyJson(null);
|
|
27735
|
-
setError(err instanceof Error ? err.message : "Failed to load survey template");
|
|
27793
|
+
setError(err instanceof Error ? err.message : t("actionTypes.shared.errors.surveyTemplateLoad", { defaultValue: "Failed to load survey template" }));
|
|
27736
27794
|
} finally {
|
|
27737
27795
|
setLoadingSurvey(false);
|
|
27738
27796
|
}
|
|
@@ -27740,16 +27798,16 @@ var ClaimFlowDetail = ({
|
|
|
27740
27798
|
const handleSurveyComplete = useCallback94(
|
|
27741
27799
|
async (sender) => {
|
|
27742
27800
|
if (authChecking || !isServiceAgentAuthorized) {
|
|
27743
|
-
setError("You need service agent authorization for this collection to submit claims.");
|
|
27801
|
+
setError(t("actionTypes.claim.flow.errors.notAuthorized", { defaultValue: "You need service agent authorization for this collection to submit claims." }));
|
|
27744
27802
|
return;
|
|
27745
27803
|
}
|
|
27746
27804
|
if (!adminAddress) {
|
|
27747
|
-
setError("Admin address could not be resolved for this collection");
|
|
27805
|
+
setError(t("actionTypes.claim.flow.errors.noAdminAddress", { defaultValue: "Admin address could not be resolved for this collection" }));
|
|
27748
27806
|
return;
|
|
27749
27807
|
}
|
|
27750
27808
|
const actionDef = getAction("qi/claim.submit");
|
|
27751
27809
|
if (!actionDef) {
|
|
27752
|
-
setError("claim action is not registered");
|
|
27810
|
+
setError(t("actionTypes.claim.flow.errors.actionNotRegistered", { defaultValue: "claim action is not registered" }));
|
|
27753
27811
|
return;
|
|
27754
27812
|
}
|
|
27755
27813
|
const submissionProps = {
|
|
@@ -27817,7 +27875,7 @@ var ClaimFlowDetail = ({
|
|
|
27817
27875
|
// TODO: collect PIN from user for invocation signing
|
|
27818
27876
|
});
|
|
27819
27877
|
if (!outcome.success) {
|
|
27820
|
-
throw new Error(outcome.error || "Claim execution failed");
|
|
27878
|
+
throw new Error(outcome.error || t("actionTypes.claim.flow.errors.executionFailed", { defaultValue: "Claim execution failed" }));
|
|
27821
27879
|
}
|
|
27822
27880
|
const output = outcome.result?.payload || {};
|
|
27823
27881
|
updateRuntime({
|
|
@@ -27832,7 +27890,7 @@ var ClaimFlowDetail = ({
|
|
|
27832
27890
|
setPrefillData(null);
|
|
27833
27891
|
await fetchClaimsAndAdmin();
|
|
27834
27892
|
} catch (err) {
|
|
27835
|
-
const message = err instanceof Error ? err.message : "Failed to submit claim";
|
|
27893
|
+
const message = err instanceof Error ? err.message : t("actionTypes.claim.flow.errors.submitFailed", { defaultValue: "Failed to submit claim" });
|
|
27836
27894
|
if (!submittedEmitted) {
|
|
27837
27895
|
handlers.onAnalyticsEvent?.("editor_flow_submission_failed", { ...submissionProps, reason: message });
|
|
27838
27896
|
}
|
|
@@ -27892,17 +27950,24 @@ var ClaimFlowDetail = ({
|
|
|
27892
27950
|
});
|
|
27893
27951
|
}, [surveyModel, handlers, editor, deedDid, collectionId, block.id, block?.props?.title]);
|
|
27894
27952
|
if (selectedClaim) {
|
|
27895
|
-
return /* @__PURE__ */ React265.createElement(Stack182, { gap: "md" }, /* @__PURE__ */ React265.createElement(Group102, { gap: "xs", align: "center" }, /* @__PURE__ */ React265.createElement(ActionIcon40, { variant: "subtle", color: "gray", size: "sm", onClick: () => setSelectedClaimId("") }, /* @__PURE__ */ React265.createElement(IconArrowLeft8, { size: 16 })), /* @__PURE__ */ React265.createElement(Text160, { fw: 500, size: "sm", title: selectedClaim.claimId }, "
|
|
27896
|
-
|
|
27897
|
-
|
|
27953
|
+
return /* @__PURE__ */ React265.createElement(Stack182, { gap: "md" }, /* @__PURE__ */ React265.createElement(Group102, { gap: "xs", align: "center" }, /* @__PURE__ */ React265.createElement(ActionIcon40, { variant: "subtle", color: "gray", size: "sm", onClick: () => setSelectedClaimId("") }, /* @__PURE__ */ React265.createElement(IconArrowLeft8, { size: 16 })), /* @__PURE__ */ React265.createElement(Text160, { fw: 500, size: "sm", title: selectedClaim.claimId }, t("actionTypes.claim.flow.claimNumber", { id: truncateId(selectedClaim.claimId), defaultValue: `Claim #${truncateId(selectedClaim.claimId)}` }))), selectedClaimStatus && /* @__PURE__ */ React265.createElement(Group102, { gap: "xs", align: "center" }, /* @__PURE__ */ React265.createElement(Text160, { size: "sm", c: "dimmed" }, t("actionTypes.claim.flow.statusLabel", { defaultValue: "Status:" })), /* @__PURE__ */ React265.createElement(Text160, { fw: 500, size: "sm", c: selectedClaimStatus.color }, selectedClaimStatus.label), /* @__PURE__ */ React265.createElement(Text160, { size: "xs", c: "dimmed" }, "\xB7 ", getTimeAgo2(selectedClaim.submissionDate || ""))), isSelectedDisputed && /* @__PURE__ */ React265.createElement(Alert50, { color: "orange", title: t("actionTypes.claim.flow.disputed.title", { defaultValue: "Claim disputed" }), styles: actionAlertStyles }, loadingDispute ? /* @__PURE__ */ React265.createElement(Group102, { gap: "xs" }, /* @__PURE__ */ React265.createElement(Loader47, { size: "xs" }), /* @__PURE__ */ React265.createElement(Text160, { size: "xs" }, t("actionTypes.claim.flow.disputed.loadingDetails", { defaultValue: "Loading dispute details\u2026" }))) : disputeDetails ? /* @__PURE__ */ React265.createElement(Stack182, { gap: 6 }, disputeDetails.reason ? /* @__PURE__ */ React265.createElement(Text160, { size: "sm" }, disputeDetails.reason) : /* @__PURE__ */ React265.createElement(Text160, { size: "sm", c: "dimmed" }, t("actionTypes.claim.flow.disputed.noMessage", { defaultValue: "The evaluator disputed this claim but did not provide a message." })), (disputeDetails.evaluatorDid || disputeDetails.disputedAt) && /* @__PURE__ */ React265.createElement(Text160, { size: "xs", c: "dimmed" }, disputeDetails.evaluatorDid ? t("actionTypes.claim.flow.disputed.byEvaluator", {
|
|
27954
|
+
address: truncateAddress3(disputeDetails.evaluatorDid),
|
|
27955
|
+
defaultValue: `By ${truncateAddress3(disputeDetails.evaluatorDid)}`
|
|
27956
|
+
}) : "", disputeDetails.evaluatorDid && disputeDetails.disputedAt ? " \xB7 " : "", disputeDetails.disputedAt ? new Date(disputeDetails.disputedAt).toLocaleString() : ""), /* @__PURE__ */ React265.createElement(BasePrimaryButton, { onClick: amendAndResubmit, disabled: isDisabled || submitting || !isServiceAgentAuthorized || !selectedClaimData }, t("actionTypes.claim.flow.disputed.amendAndResubmit", { defaultValue: "Amend & Resubmit" }))) : typeof handlers.getClaimDisputeDetails !== "function" ? /* @__PURE__ */ React265.createElement(Text160, { size: "xs", c: "dimmed" }, t("actionTypes.claim.flow.disputed.unavailable", { defaultValue: "Dispute details unavailable in this environment." })) : /* @__PURE__ */ React265.createElement(Text160, { size: "xs", c: "dimmed" }, t("actionTypes.claim.flow.disputed.noRecord", { defaultValue: "No dispute record found on-chain for this claim." }))), loadingClaimDetail ? /* @__PURE__ */ React265.createElement(Group102, { gap: "xs" }, /* @__PURE__ */ React265.createElement(Loader47, { size: "xs" }), /* @__PURE__ */ React265.createElement(Text160, { size: "xs", c: "dimmed" }, t("actionTypes.claim.flow.loadingSubmission", { defaultValue: "Loading submission\u2026" }))) : detailSurveyModel ? /* @__PURE__ */ React265.createElement(StableSurvey, { model: detailSurveyModel }) : /* @__PURE__ */ React265.createElement(Text160, { size: "xs", c: "dimmed" }, t("actionTypes.claim.flow.noSubmissionData", { defaultValue: "No submission data available." })), error && /* @__PURE__ */ React265.createElement(Alert50, { color: "red", styles: actionAlertStyles }, error));
|
|
27957
|
+
}
|
|
27958
|
+
return /* @__PURE__ */ React265.createElement(Stack182, { gap: "md" }, !deedDid || !collectionId ? /* @__PURE__ */ React265.createElement(Alert50, { color: "yellow", styles: actionAlertStyles }, t("actionTypes.shared.errors.configRequired", {
|
|
27959
|
+
defaultValue: "Configure {{did}} and {{claimCollection}} in template mode before running this action.",
|
|
27960
|
+
did: "DID",
|
|
27961
|
+
claimCollection: "claim collection"
|
|
27962
|
+
})) : /* @__PURE__ */ React265.createElement(React265.Fragment, null, /* @__PURE__ */ React265.createElement(Text160, { size: "xs", c: "dimmed" }, t("actionTypes.shared.collectionPrefix", { id: collectionId, defaultValue: `Collection: ${collectionId}` })), prefillData && /* @__PURE__ */ React265.createElement(Alert50, { color: "orange", styles: actionAlertStyles }, t("actionTypes.claim.flow.amendingNotice", { defaultValue: "Amending a previously disputed claim \u2014 edit the fields below and submit to resubmit." })), /* @__PURE__ */ React265.createElement(
|
|
27898
27963
|
BasePrimaryButton,
|
|
27899
27964
|
{
|
|
27900
27965
|
leftSection: loadingSurvey || authChecking ? /* @__PURE__ */ React265.createElement(Loader47, { size: 14 }) : /* @__PURE__ */ React265.createElement(IconPlayerPlay4, { size: 14 }),
|
|
27901
27966
|
onClick: startSurvey,
|
|
27902
27967
|
disabled: isDisabled || loadingSurvey || submitting || authChecking || !isServiceAgentAuthorized || !adminAddress
|
|
27903
27968
|
},
|
|
27904
|
-
authChecking ? "Checking authorization..." : loadingSurvey ? "Loading Survey..." : "Start New Claim"
|
|
27905
|
-
), !authChecking && authError && /* @__PURE__ */ React265.createElement(Alert50, { color: "orange", styles: actionAlertStyles }, /* @__PURE__ */ React265.createElement(Stack182, { gap: "xs" }, /* @__PURE__ */ React265.createElement(Text160, { size: "sm" }, "Couldn't verify your authorization \u2014 the chain RPC is unreachable."), /* @__PURE__ */ React265.createElement(Text160, { size: "xs", c: "dimmed" }, authError), /* @__PURE__ */ React265.createElement(BasePrimaryButton, { size: "xs", onClick: () => setAuthRetryKey((k) => k + 1) }, "Retry"))), !authChecking && !authError && !isServiceAgentAuthorized && /* @__PURE__ */ React265.createElement(Alert50, { color: "yellow", styles: actionAlertStyles }, "You need service agent authorization for this collection to submit claims."), loadingClaims ? /* @__PURE__ */ React265.createElement(Text160, { size: "xs", c: "dimmed" }, "Loading your claims...") : claims.length === 0 ? /* @__PURE__ */ React265.createElement(Text160, { size: "sm", c: "dimmed" }, "No claims submitted for this collection yet.") : /* @__PURE__ */ React265.createElement(Stack182, { gap: "xs" }, /* @__PURE__ */ React265.createElement(Text160, { size: "sm", fw: 600 }, "Your Claims"), claims.map((claim) => {
|
|
27969
|
+
authChecking ? t("actionTypes.claim.flow.checkingAuthorization", { defaultValue: "Checking authorization..." }) : loadingSurvey ? t("actionTypes.shared.loadingSurvey", { defaultValue: "Loading Survey..." }) : t("actionTypes.claim.flow.startNewClaim", { defaultValue: "Start New Claim" })
|
|
27970
|
+
), !authChecking && authError && /* @__PURE__ */ React265.createElement(Alert50, { color: "orange", styles: actionAlertStyles }, /* @__PURE__ */ React265.createElement(Stack182, { gap: "xs" }, /* @__PURE__ */ React265.createElement(Text160, { size: "sm" }, t("actionTypes.claim.flow.authVerifyFailed", { defaultValue: "Couldn't verify your authorization \u2014 the chain RPC is unreachable." })), /* @__PURE__ */ React265.createElement(Text160, { size: "xs", c: "dimmed" }, authError), /* @__PURE__ */ React265.createElement(BasePrimaryButton, { size: "xs", onClick: () => setAuthRetryKey((k) => k + 1) }, t("actionTypes.claim.flow.retry", { defaultValue: "Retry" })))), !authChecking && !authError && !isServiceAgentAuthorized && /* @__PURE__ */ React265.createElement(Alert50, { color: "yellow", styles: actionAlertStyles }, t("actionTypes.claim.flow.errors.notAuthorized", { defaultValue: "You need service agent authorization for this collection to submit claims." })), loadingClaims ? /* @__PURE__ */ React265.createElement(Text160, { size: "xs", c: "dimmed" }, t("actionTypes.claim.flow.loadingYourClaims", { defaultValue: "Loading your claims..." })) : claims.length === 0 ? /* @__PURE__ */ React265.createElement(Text160, { size: "sm", c: "dimmed" }, t("actionTypes.claim.flow.noClaimsYet", { defaultValue: "No claims submitted for this collection yet." })) : /* @__PURE__ */ React265.createElement(Stack182, { gap: "xs" }, /* @__PURE__ */ React265.createElement(Text160, { size: "sm", fw: 600 }, t("actionTypes.claim.flow.yourClaims", { defaultValue: "Your Claims" })), claims.map((claim) => {
|
|
27906
27971
|
const status = getClaimStatusInfo(claim);
|
|
27907
27972
|
const profile = profilesByDid[claim.agentDid];
|
|
27908
27973
|
const displayName = profile?.displayname || claim.agentDid || claim.agentAddress;
|
|
@@ -27929,7 +27994,7 @@ var ClaimFlowDetail = ({
|
|
|
27929
27994
|
},
|
|
27930
27995
|
profile?.avatarUrl ? null : avatarLabel
|
|
27931
27996
|
), /* @__PURE__ */ React265.createElement(Stack182, { gap: 0, style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ React265.createElement(Text160, { fw: 500, size: "md", truncate: true, style: { lineHeight: 1.5 } }, displayName), /* @__PURE__ */ React265.createElement(Text160, { size: "xs", c: "dimmed", truncate: true }, truncateAddress3(claim.agentAddress)))), /* @__PURE__ */ React265.createElement(Stack182, { gap: 0, align: "flex-end", style: { flexShrink: 0, minWidth: 80 } }, /* @__PURE__ */ React265.createElement(Text160, { fw: 500, size: "md", c: status.color, style: { lineHeight: 1.5 } }, status.key === "approved" && /* @__PURE__ */ React265.createElement(IconCheck21, { size: 14, style: { verticalAlign: "middle", marginRight: 2 } }), status.label), /* @__PURE__ */ React265.createElement(Text160, { size: "xs", c: "dimmed" }, getTimeAgo2(claim.submissionDate || ""))));
|
|
27932
|
-
}))), surveyModel && !loadingSurvey && /* @__PURE__ */ React265.createElement(StableSurvey, { model: surveyModel }), submitting && /* @__PURE__ */ React265.createElement(Group102, { gap: "xs" }, /* @__PURE__ */ React265.createElement(Loader47, { size: "xs" }), /* @__PURE__ */ React265.createElement(Text160, { size: "xs", c: "dimmed" }, "Submitting claim...")), error && /* @__PURE__ */ React265.createElement(Alert50, { color: "red", styles: actionAlertStyles }, error));
|
|
27997
|
+
}))), surveyModel && !loadingSurvey && /* @__PURE__ */ React265.createElement(StableSurvey, { model: surveyModel }), submitting && /* @__PURE__ */ React265.createElement(Group102, { gap: "xs" }, /* @__PURE__ */ React265.createElement(Loader47, { size: "xs" }), /* @__PURE__ */ React265.createElement(Text160, { size: "xs", c: "dimmed" }, t("actionTypes.claim.flow.submittingClaim", { defaultValue: "Submitting claim..." }))), error && /* @__PURE__ */ React265.createElement(Alert50, { color: "red", styles: actionAlertStyles }, error));
|
|
27933
27998
|
};
|
|
27934
27999
|
|
|
27935
28000
|
// src/mantine/blocks/action/actionTypes/claim/index.ts
|
|
@@ -27970,6 +28035,7 @@ function serializeEvaluateClaimActionInputs(inputs) {
|
|
|
27970
28035
|
|
|
27971
28036
|
// src/mantine/blocks/action/actionTypes/evaluateClaim/EvaluateClaimConfig.tsx
|
|
27972
28037
|
var EvaluateClaimConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
28038
|
+
const t = useTranslate();
|
|
27973
28039
|
const handlers = useBlocknoteHandlers();
|
|
27974
28040
|
const [local, setLocal] = useState118(() => parseEvaluateClaimActionInputs(inputs));
|
|
27975
28041
|
const [collections, setCollections] = useState118([]);
|
|
@@ -28008,11 +28074,15 @@ var EvaluateClaimConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
28008
28074
|
const surveySchema = extractSurveyAnswerSchema(result?.surveyTemplate);
|
|
28009
28075
|
update({ surveyAnswersSchema: surveySchema });
|
|
28010
28076
|
if (surveySchema.length === 0) {
|
|
28011
|
-
setSchemaError(
|
|
28077
|
+
setSchemaError(
|
|
28078
|
+
t("actionTypes.evaluateClaim.config.surveyHasNoQuestions", {
|
|
28079
|
+
defaultValue: "Survey has no recognised questions \u2014 downstream blocks will only see baseline evaluation fields."
|
|
28080
|
+
})
|
|
28081
|
+
);
|
|
28012
28082
|
}
|
|
28013
28083
|
} catch (err) {
|
|
28014
28084
|
if (gen !== fetchGenRef.current) return;
|
|
28015
|
-
setSchemaError(err instanceof Error ? err.message : "Failed to load survey template");
|
|
28085
|
+
setSchemaError(err instanceof Error ? err.message : t("actionTypes.shared.errors.surveyTemplateLoad", { defaultValue: "Failed to load survey template" }));
|
|
28016
28086
|
update({ surveyAnswersSchema: [] });
|
|
28017
28087
|
} finally {
|
|
28018
28088
|
if (gen === fetchGenRef.current) setSchemaLoading(false);
|
|
@@ -28028,7 +28098,7 @@ var EvaluateClaimConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
28028
28098
|
const fetchCollections = useCallback95(async () => {
|
|
28029
28099
|
const deedDid = local.deedDid.trim();
|
|
28030
28100
|
if (!deedDid) {
|
|
28031
|
-
setError("Please enter a
|
|
28101
|
+
setError(t("actionTypes.shared.errors.didRequired", { defaultValue: "Please enter a {{did}} first", did: "DID" }));
|
|
28032
28102
|
return;
|
|
28033
28103
|
}
|
|
28034
28104
|
const persisted = { ...local, deedDid };
|
|
@@ -28041,14 +28111,18 @@ var EvaluateClaimConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
28041
28111
|
const fetched = response?.collections || [];
|
|
28042
28112
|
setCollections(fetched);
|
|
28043
28113
|
if (fetched.length === 0) {
|
|
28044
|
-
setError(
|
|
28114
|
+
setError(
|
|
28115
|
+
t("actionTypes.shared.errors.noCollections", { defaultValue: "No {{claimCollections}} found for this {{did}}", claimCollections: "claim collections", did: "DID" })
|
|
28116
|
+
);
|
|
28045
28117
|
}
|
|
28046
28118
|
if (local.collectionId && !fetched.some((c) => c.id === local.collectionId)) {
|
|
28047
28119
|
update({ collectionId: "" });
|
|
28048
28120
|
}
|
|
28049
28121
|
} catch (err) {
|
|
28050
28122
|
setCollections([]);
|
|
28051
|
-
setError(
|
|
28123
|
+
setError(
|
|
28124
|
+
err instanceof Error ? err.message : t("actionTypes.shared.errors.fetchCollections", { defaultValue: "Failed to fetch {{claimCollections}}", claimCollections: "claim collections" })
|
|
28125
|
+
);
|
|
28052
28126
|
} finally {
|
|
28053
28127
|
setLoadingCollections(false);
|
|
28054
28128
|
}
|
|
@@ -28066,8 +28140,12 @@ var EvaluateClaimConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
28066
28140
|
DataInput,
|
|
28067
28141
|
{
|
|
28068
28142
|
label: "DID",
|
|
28069
|
-
placeholder: "Enter deed DID",
|
|
28070
|
-
description: "
|
|
28143
|
+
placeholder: t("actionTypes.shared.didPlaceholder", { defaultValue: "Enter deed {{did}}", did: "DID" }),
|
|
28144
|
+
description: t("actionTypes.shared.didDescription", {
|
|
28145
|
+
defaultValue: "The {{did}} identifier for fetching {{claimCollections}}.",
|
|
28146
|
+
did: "DID",
|
|
28147
|
+
claimCollections: "claim collections"
|
|
28148
|
+
}),
|
|
28071
28149
|
value: local.deedDid,
|
|
28072
28150
|
onChange: (value) => update({ deedDid: value }),
|
|
28073
28151
|
editorDocument: editor?.document || [],
|
|
@@ -28084,12 +28162,12 @@ var EvaluateClaimConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
28084
28162
|
if (entityDid) update({ deedDid: entityDid });
|
|
28085
28163
|
}
|
|
28086
28164
|
},
|
|
28087
|
-
"Use Current Entity"
|
|
28088
|
-
), /* @__PURE__ */ React266.createElement(BasePrimaryButton, { onClick: fetchCollections, disabled: !local.deedDid.trim() || loadingCollections }, loadingCollections ? /* @__PURE__ */ React266.createElement(Loader48, { size: "xs", color: "dark" }) : "Get Collections"), error && /* @__PURE__ */ React266.createElement(Alert51, { color: "red", styles: actionAlertStyles }, error), collectionOptions.length > 0 && /* @__PURE__ */ React266.createElement(
|
|
28165
|
+
t("actionTypes.shared.useCurrentEntity", { defaultValue: "Use Current {{entity}}", entity: "Entity" })
|
|
28166
|
+
), /* @__PURE__ */ React266.createElement(BasePrimaryButton, { onClick: fetchCollections, disabled: !local.deedDid.trim() || loadingCollections }, loadingCollections ? /* @__PURE__ */ React266.createElement(Loader48, { size: "xs", color: "dark" }) : t("actionTypes.shared.getCollections", { defaultValue: "Get {{collections}}", collections: "Collections" })), error && /* @__PURE__ */ React266.createElement(Alert51, { color: "red", styles: actionAlertStyles }, error), collectionOptions.length > 0 && /* @__PURE__ */ React266.createElement(
|
|
28089
28167
|
BaseSelect,
|
|
28090
28168
|
{
|
|
28091
28169
|
label: "Claim Collection",
|
|
28092
|
-
placeholder: "Select a collection",
|
|
28170
|
+
placeholder: t("actionTypes.shared.collectionPlaceholder", { defaultValue: "Select a collection" }),
|
|
28093
28171
|
value: local.collectionId || null,
|
|
28094
28172
|
onChange: (value) => {
|
|
28095
28173
|
const next = value || "";
|
|
@@ -28099,11 +28177,17 @@ var EvaluateClaimConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
28099
28177
|
required: true,
|
|
28100
28178
|
searchable: true
|
|
28101
28179
|
}
|
|
28102
|
-
), local.collectionId && /* @__PURE__ */ React266.createElement(Stack183, { gap: 4 }, schemaLoading && /* @__PURE__ */ React266.createElement(Text161, { size: "xs", c: "dimmed" }, "Loading survey schema..."), !schemaLoading && local.surveyAnswersSchema.length > 0 && /* @__PURE__ */ React266.createElement(Text161, { size: "xs", c: "dimmed" },
|
|
28180
|
+
), local.collectionId && /* @__PURE__ */ React266.createElement(Stack183, { gap: 4 }, schemaLoading && /* @__PURE__ */ React266.createElement(Text161, { size: "xs", c: "dimmed" }, t("actionTypes.shared.loadingSurveySchema", { defaultValue: "Loading survey schema..." })), !schemaLoading && local.surveyAnswersSchema.length > 0 && /* @__PURE__ */ React266.createElement(Text161, { size: "xs", c: "dimmed" }, t("actionTypes.evaluateClaim.config.outputsPrefix", { defaultValue: "Outputs" }), " ", /* @__PURE__ */ React266.createElement("code", null, "surveyAnswers"), " ", t("actionTypes.evaluateClaim.config.outputsWith", { defaultValue: "with" }), " ", local.surveyAnswersSchema.length, " ", t("actionTypes.evaluateClaim.config.typedField", {
|
|
28181
|
+
count: local.surveyAnswersSchema.length,
|
|
28182
|
+
defaultValue: local.surveyAnswersSchema.length === 1 ? "typed field" : "typed fields"
|
|
28183
|
+
}), ". ", t("actionTypes.evaluateClaim.config.listenerBlocksCanReference", { defaultValue: "Listener blocks can reference" }), " ", /* @__PURE__ */ React266.createElement("code", null, "$", "{", "thisBlock.output.surveyAnswers.<field>", "}"), "."), schemaError && /* @__PURE__ */ React266.createElement(Alert51, { color: "yellow", styles: actionAlertStyles }, schemaError)), local.collectionId && /* @__PURE__ */ React266.createElement(Stack183, { gap: "xs" }, /* @__PURE__ */ React266.createElement(Text161, { size: "sm", fw: 600, mt: "md" }, t("actionTypes.evaluateClaim.config.xeroSectionTitle", { defaultValue: "{{xero}} bookkeeping (optional)", xero: "Xero" })), /* @__PURE__ */ React266.createElement(Text161, { size: "xs", c: "dimmed" }, t("actionTypes.evaluateClaim.config.xeroSectionDescription", {
|
|
28184
|
+
defaultValue: "Bind a {{xero}} invoice block here to surface a Capture Bill card in the claim evaluation panel. When set alongside a payment block, settlement runs automatically after approval \u2014 using the on-chain tx hash as the payment reference.",
|
|
28185
|
+
xero: "Xero"
|
|
28186
|
+
})), /* @__PURE__ */ React266.createElement(
|
|
28103
28187
|
BaseSelect,
|
|
28104
28188
|
{
|
|
28105
|
-
label: "
|
|
28106
|
-
placeholder: xeroInvoiceOptions.length === 0 ? "No invoice blocks in this flow" : "Select a block",
|
|
28189
|
+
label: t("actionTypes.evaluateClaim.config.xeroInvoiceBlock", { defaultValue: "{{xero}} invoice block", xero: "Xero" }),
|
|
28190
|
+
placeholder: xeroInvoiceOptions.length === 0 ? t("actionTypes.evaluateClaim.config.noInvoiceBlocks", { defaultValue: "No invoice blocks in this flow" }) : t("actionTypes.evaluateClaim.config.selectBlock", { defaultValue: "Select a block" }),
|
|
28107
28191
|
value: local.xeroInvoiceBlockId || null,
|
|
28108
28192
|
onChange: (value) => update({ xeroInvoiceBlockId: value || "" }),
|
|
28109
28193
|
data: xeroInvoiceOptions,
|
|
@@ -28114,8 +28198,8 @@ var EvaluateClaimConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
28114
28198
|
), /* @__PURE__ */ React266.createElement(
|
|
28115
28199
|
BaseSelect,
|
|
28116
28200
|
{
|
|
28117
|
-
label: "
|
|
28118
|
-
placeholder: xeroPaymentOptions.length === 0 ? "No payment blocks in this flow" : "Select a block",
|
|
28201
|
+
label: t("actionTypes.evaluateClaim.config.xeroPaymentBlock", { defaultValue: "{{xero}} payment block (settlement)", xero: "Xero" }),
|
|
28202
|
+
placeholder: xeroPaymentOptions.length === 0 ? t("actionTypes.evaluateClaim.config.noPaymentBlocks", { defaultValue: "No payment blocks in this flow" }) : t("actionTypes.evaluateClaim.config.selectBlock", { defaultValue: "Select a block" }),
|
|
28119
28203
|
value: local.xeroPaymentBlockId || null,
|
|
28120
28204
|
onChange: (value) => update({ xeroPaymentBlockId: value || "" }),
|
|
28121
28205
|
data: xeroPaymentOptions,
|
|
@@ -28336,6 +28420,7 @@ function isImage(file) {
|
|
|
28336
28420
|
return t.startsWith("image/") || ["png", "jpg", "jpeg", "gif", "webp", "svg", "bmp"].includes(ext);
|
|
28337
28421
|
}
|
|
28338
28422
|
var ClaimAttachments = ({ surveyModel, credentialSubject }) => {
|
|
28423
|
+
const t = useTranslate();
|
|
28339
28424
|
const { fetchClaimMedia } = useBlocknoteHandlers();
|
|
28340
28425
|
const [active, setActive] = useState119(null);
|
|
28341
28426
|
const [resolved, setResolved] = useState119({});
|
|
@@ -28438,7 +28523,7 @@ var ClaimAttachments = ({ surveyModel, credentialSubject }) => {
|
|
|
28438
28523
|
[fetchClaimMedia, resolveBlob]
|
|
28439
28524
|
);
|
|
28440
28525
|
if (items.length === 0) {
|
|
28441
|
-
return /* @__PURE__ */ React268.createElement(Text163, { size: "xs", c: "dimmed" }, "No attachments in this submission.");
|
|
28526
|
+
return /* @__PURE__ */ React268.createElement(Text163, { size: "xs", c: "dimmed" }, t("actionTypes.evaluateClaim.attachments.empty", { defaultValue: "No attachments in this submission." }));
|
|
28442
28527
|
}
|
|
28443
28528
|
return /* @__PURE__ */ React268.createElement(React268.Fragment, null, /* @__PURE__ */ React268.createElement(SimpleGrid4, { cols: { base: 2, sm: 3, md: 4 }, spacing: "xs" }, items.map((item, index) => {
|
|
28444
28529
|
const IconCmp = kindIcon(item);
|
|
@@ -28536,6 +28621,7 @@ var EvaluateClaimFlowDetail = ({
|
|
|
28536
28621
|
unlockSigning,
|
|
28537
28622
|
registerRuntimeInputs
|
|
28538
28623
|
}) => {
|
|
28624
|
+
const t = useTranslate();
|
|
28539
28625
|
const handlers = useBlocknoteHandlers();
|
|
28540
28626
|
const handlersRef = useRef32(handlers);
|
|
28541
28627
|
useEffect98(() => {
|
|
@@ -28592,6 +28678,8 @@ var EvaluateClaimFlowDetail = ({
|
|
|
28592
28678
|
const [profilesByDid, setProfilesByDid] = useState120({});
|
|
28593
28679
|
const [disputeDetails, setDisputeDetails] = useState120(null);
|
|
28594
28680
|
const [loadingDispute, setLoadingDispute] = useState120(false);
|
|
28681
|
+
const [evaluationOutcomePatch, setEvaluationOutcomePatch] = useState120(null);
|
|
28682
|
+
const [evaluationAmount, setEvaluationAmount] = useState120(null);
|
|
28595
28683
|
const xeroBlocks = useMemo103(
|
|
28596
28684
|
() => resolveXeroBindings(editor?.document, parsed.xeroInvoiceBlockId, parsed.xeroPaymentBlockId),
|
|
28597
28685
|
[editor, parsed.xeroInvoiceBlockId, parsed.xeroPaymentBlockId]
|
|
@@ -28781,6 +28869,18 @@ var EvaluateClaimFlowDetail = ({
|
|
|
28781
28869
|
});
|
|
28782
28870
|
return model;
|
|
28783
28871
|
}, [outcomeTemplateJson]);
|
|
28872
|
+
useEffect98(() => {
|
|
28873
|
+
if (!outcomeSurveyModel) return;
|
|
28874
|
+
const evaluated = selectedClaim ? isClaimEvaluated(selectedClaim) : false;
|
|
28875
|
+
if (evaluated) {
|
|
28876
|
+
if (evaluationOutcomePatch) {
|
|
28877
|
+
outcomeSurveyModel.data = evaluationOutcomePatch;
|
|
28878
|
+
}
|
|
28879
|
+
outcomeSurveyModel.mode = "display";
|
|
28880
|
+
} else {
|
|
28881
|
+
outcomeSurveyModel.mode = "edit";
|
|
28882
|
+
}
|
|
28883
|
+
}, [outcomeSurveyModel, evaluationOutcomePatch, selectedClaim]);
|
|
28784
28884
|
const refreshClaims = useCallback97(async () => {
|
|
28785
28885
|
if (!deedDid || !collectionId) return;
|
|
28786
28886
|
const handlers2 = handlersRef.current;
|
|
@@ -28798,7 +28898,7 @@ var EvaluateClaimFlowDetail = ({
|
|
|
28798
28898
|
} catch (err) {
|
|
28799
28899
|
setClaims([]);
|
|
28800
28900
|
setAdminAddress("");
|
|
28801
|
-
setError(err instanceof Error ? err.message : "Failed to load claims");
|
|
28901
|
+
setError(err instanceof Error ? err.message : t("actionTypes.evaluateClaim.flow.errors.loadClaims", { defaultValue: "Failed to load claims" }));
|
|
28802
28902
|
} finally {
|
|
28803
28903
|
setLoadingClaims(false);
|
|
28804
28904
|
}
|
|
@@ -28842,7 +28942,7 @@ var EvaluateClaimFlowDetail = ({
|
|
|
28842
28942
|
} catch (evalErr) {
|
|
28843
28943
|
setEvaluationResult({
|
|
28844
28944
|
success: false,
|
|
28845
|
-
error: evalErr instanceof Error ? evalErr.message : "Failed to evaluate claim with rubric"
|
|
28945
|
+
error: evalErr instanceof Error ? evalErr.message : t("actionTypes.evaluateClaim.flow.errors.rubricEvaluation", { defaultValue: "Failed to evaluate claim with rubric" })
|
|
28846
28946
|
});
|
|
28847
28947
|
} finally {
|
|
28848
28948
|
setEvaluationLoading(false);
|
|
@@ -28852,7 +28952,7 @@ var EvaluateClaimFlowDetail = ({
|
|
|
28852
28952
|
setClaimData(null);
|
|
28853
28953
|
setSurveyJson(null);
|
|
28854
28954
|
setEvaluationResult(null);
|
|
28855
|
-
setError(err instanceof Error ? err.message : "Failed to load claim details");
|
|
28955
|
+
setError(err instanceof Error ? err.message : t("actionTypes.claim.flow.errors.loadClaimDetails", { defaultValue: "Failed to load claim details" }));
|
|
28856
28956
|
} finally {
|
|
28857
28957
|
setSurveyLoading(false);
|
|
28858
28958
|
}
|
|
@@ -28904,7 +29004,7 @@ var EvaluateClaimFlowDetail = ({
|
|
|
28904
29004
|
if (cancelled) return;
|
|
28905
29005
|
setInvoiceRunInputs(null);
|
|
28906
29006
|
setInvoicePreview(null);
|
|
28907
|
-
setInvoicePreviewError(err instanceof Error ? err.message : "Failed to resolve bill preview.");
|
|
29007
|
+
setInvoicePreviewError(err instanceof Error ? err.message : t("actionTypes.evaluateClaim.flow.errors.billPreview", { defaultValue: "Failed to resolve bill preview." }));
|
|
28908
29008
|
}
|
|
28909
29009
|
};
|
|
28910
29010
|
void run();
|
|
@@ -29001,7 +29101,7 @@ var EvaluateClaimFlowDetail = ({
|
|
|
29001
29101
|
} catch (err) {
|
|
29002
29102
|
if (mounted) {
|
|
29003
29103
|
setIsEvaluatorAuthorized(false);
|
|
29004
|
-
setAuthError(err instanceof Error ? err.message : "Failed to verify authorization");
|
|
29104
|
+
setAuthError(err instanceof Error ? err.message : t("actionTypes.claim.flow.errors.verifyAuth", { defaultValue: "Failed to verify authorization" }));
|
|
29005
29105
|
}
|
|
29006
29106
|
} finally {
|
|
29007
29107
|
if (mounted) {
|
|
@@ -29020,6 +29120,8 @@ var EvaluateClaimFlowDetail = ({
|
|
|
29020
29120
|
setSurveyJson(null);
|
|
29021
29121
|
setEvaluationResult(null);
|
|
29022
29122
|
setDisputeDetails(null);
|
|
29123
|
+
setEvaluationOutcomePatch(null);
|
|
29124
|
+
setEvaluationAmount(null);
|
|
29023
29125
|
return void 0;
|
|
29024
29126
|
}
|
|
29025
29127
|
const handlers2 = handlersRef.current;
|
|
@@ -29028,10 +29130,14 @@ var EvaluateClaimFlowDetail = ({
|
|
|
29028
29130
|
setPaymentRows([createPaymentRow2()]);
|
|
29029
29131
|
setOutcomeResponses({});
|
|
29030
29132
|
setOutcomeComplete(false);
|
|
29133
|
+
setEvaluationOutcomePatch(null);
|
|
29134
|
+
setEvaluationAmount(null);
|
|
29031
29135
|
loadClaimDetail(selectedClaim);
|
|
29032
|
-
|
|
29136
|
+
let cancelled = false;
|
|
29137
|
+
const claimStatusKey = getClaimStatusInfo(selectedClaim).key;
|
|
29138
|
+
const isDisputed = claimStatusKey === "disputed";
|
|
29139
|
+
const isEvaluated = isClaimEvaluated(selectedClaim);
|
|
29033
29140
|
if (isDisputed && typeof handlers2.getClaimDisputeDetails === "function") {
|
|
29034
|
-
let cancelled = false;
|
|
29035
29141
|
setLoadingDispute(true);
|
|
29036
29142
|
handlers2.getClaimDisputeDetails(selectedClaim.claimId).then((details) => {
|
|
29037
29143
|
if (!cancelled) setDisputeDetails(details);
|
|
@@ -29040,12 +29146,23 @@ var EvaluateClaimFlowDetail = ({
|
|
|
29040
29146
|
}).finally(() => {
|
|
29041
29147
|
if (!cancelled) setLoadingDispute(false);
|
|
29042
29148
|
});
|
|
29043
|
-
|
|
29044
|
-
|
|
29045
|
-
};
|
|
29149
|
+
} else {
|
|
29150
|
+
setDisputeDetails(null);
|
|
29046
29151
|
}
|
|
29047
|
-
|
|
29048
|
-
|
|
29152
|
+
if (isEvaluated && typeof handlers2.getClaimEvaluationDetails === "function") {
|
|
29153
|
+
handlers2.getClaimEvaluationDetails(selectedClaim.claimId).then((details) => {
|
|
29154
|
+
if (cancelled) return;
|
|
29155
|
+
setEvaluationOutcomePatch(details?.patch ?? null);
|
|
29156
|
+
setEvaluationAmount(Array.isArray(details?.amount) && details.amount.length > 0 ? details.amount : null);
|
|
29157
|
+
}).catch(() => {
|
|
29158
|
+
if (cancelled) return;
|
|
29159
|
+
setEvaluationOutcomePatch(null);
|
|
29160
|
+
setEvaluationAmount(null);
|
|
29161
|
+
});
|
|
29162
|
+
}
|
|
29163
|
+
return () => {
|
|
29164
|
+
cancelled = true;
|
|
29165
|
+
};
|
|
29049
29166
|
}, [selectedClaim, loadClaimDetail]);
|
|
29050
29167
|
const isClaimAlreadyEvaluated = useMemo103(() => {
|
|
29051
29168
|
if (!selectedClaim) return false;
|
|
@@ -29108,7 +29225,9 @@ var EvaluateClaimFlowDetail = ({
|
|
|
29108
29225
|
const invoiceId = String(output.invoiceId || "");
|
|
29109
29226
|
if (!invoiceId) {
|
|
29110
29227
|
xwarn("handleCaptureBill: Xero returned no invoiceId", { output });
|
|
29111
|
-
throw new Error(
|
|
29228
|
+
throw new Error(
|
|
29229
|
+
t("actionTypes.evaluateClaim.flow.errors.noInvoiceId", { defaultValue: "{{xero}} did not return an InvoiceID \u2014 bill may not have been created.", xero: "Xero" })
|
|
29230
|
+
);
|
|
29112
29231
|
}
|
|
29113
29232
|
const invoiceTotal = typeof output.total === "number" ? output.total : Number(output.total);
|
|
29114
29233
|
const invoiceTotalForCache = Number.isFinite(invoiceTotal) && invoiceTotal > 0 ? invoiceTotal : void 0;
|
|
@@ -29120,7 +29239,7 @@ var EvaluateClaimFlowDetail = ({
|
|
|
29120
29239
|
capturedAt: Date.now()
|
|
29121
29240
|
});
|
|
29122
29241
|
} catch (err) {
|
|
29123
|
-
const message = err instanceof Error ? err.message : "Failed to capture bill in Xero";
|
|
29242
|
+
const message = err instanceof Error ? err.message : t("actionTypes.evaluateClaim.flow.errors.captureBill", { defaultValue: "Failed to capture bill in {{xero}}", xero: "Xero" });
|
|
29124
29243
|
xwarn("handleCaptureBill: error", { error: message });
|
|
29125
29244
|
setCaptureError(message);
|
|
29126
29245
|
} finally {
|
|
@@ -29198,7 +29317,7 @@ var EvaluateClaimFlowDetail = ({
|
|
|
29198
29317
|
});
|
|
29199
29318
|
}
|
|
29200
29319
|
} catch (err) {
|
|
29201
|
-
const message = err instanceof Error ? err.message : "Failed to record payment in Xero";
|
|
29320
|
+
const message = err instanceof Error ? err.message : t("actionTypes.evaluateClaim.flow.errors.recordPayment", { defaultValue: "Failed to record payment in {{xero}}", xero: "Xero" });
|
|
29202
29321
|
xwarn("runSettlement: error", { error: message });
|
|
29203
29322
|
setSettlementError(message);
|
|
29204
29323
|
}
|
|
@@ -29260,7 +29379,7 @@ var EvaluateClaimFlowDetail = ({
|
|
|
29260
29379
|
try {
|
|
29261
29380
|
if (isDispute) {
|
|
29262
29381
|
if (!services.claim?.disputeClaim) {
|
|
29263
|
-
throw new Error("disputeClaim handler is not available on the claim service");
|
|
29382
|
+
throw new Error(t("actionTypes.evaluateClaim.flow.errors.disputeHandlerMissing", { defaultValue: "disputeClaim handler is not available on the claim service" }));
|
|
29264
29383
|
}
|
|
29265
29384
|
await services.claim.disputeClaim(actorDid, deedDid, {
|
|
29266
29385
|
subjectId: selectedClaim.claimId,
|
|
@@ -29284,7 +29403,7 @@ var EvaluateClaimFlowDetail = ({
|
|
|
29284
29403
|
return;
|
|
29285
29404
|
}
|
|
29286
29405
|
const actionDef = getAction("qi/claim.evaluate");
|
|
29287
|
-
if (!actionDef) throw new Error("evaluateClaim action is not registered");
|
|
29406
|
+
if (!actionDef) throw new Error(t("actionTypes.evaluateClaim.flow.errors.actionNotRegistered", { defaultValue: "evaluateClaim action is not registered" }));
|
|
29288
29407
|
let actionEvents = [];
|
|
29289
29408
|
const outcome = await executeNode({
|
|
29290
29409
|
node: flowNode,
|
|
@@ -29341,7 +29460,7 @@ var EvaluateClaimFlowDetail = ({
|
|
|
29341
29460
|
},
|
|
29342
29461
|
pin: ""
|
|
29343
29462
|
});
|
|
29344
|
-
if (!outcome.success) throw new Error(outcome.error || "Claim evaluation failed");
|
|
29463
|
+
if (!outcome.success) throw new Error(outcome.error || t("actionTypes.evaluateClaim.flow.errors.evaluationFailed", { defaultValue: "Claim evaluation failed" }));
|
|
29345
29464
|
const output = outcome.result?.payload || {};
|
|
29346
29465
|
updateRuntime({ state: "completed", executedAt: Date.now(), error: void 0, output });
|
|
29347
29466
|
if (actionEvents.length > 0) {
|
|
@@ -29369,7 +29488,7 @@ var EvaluateClaimFlowDetail = ({
|
|
|
29369
29488
|
setDecision("");
|
|
29370
29489
|
await refreshClaims();
|
|
29371
29490
|
} catch (err) {
|
|
29372
|
-
const message = err instanceof Error ? err.message : "Failed to evaluate claim";
|
|
29491
|
+
const message = err instanceof Error ? err.message : t("actionTypes.evaluateClaim.flow.errors.evaluateFailed", { defaultValue: "Failed to evaluate claim" });
|
|
29373
29492
|
setError(message);
|
|
29374
29493
|
updateRuntime({ state: "idle", error: void 0 });
|
|
29375
29494
|
} finally {
|
|
@@ -29411,7 +29530,7 @@ var EvaluateClaimFlowDetail = ({
|
|
|
29411
29530
|
const selectedClaimProfile = profilesByDid[selectedClaim.agentDid];
|
|
29412
29531
|
const selectedDisplayName = selectedClaimProfile?.displayname || selectedClaim.agentDid || selectedClaim.agentAddress;
|
|
29413
29532
|
const selectedAvatarLabel = (selectedClaimProfile?.displayname || selectedClaim.agentDid || selectedClaim.agentAddress || "?")[0]?.toUpperCase();
|
|
29414
|
-
return /* @__PURE__ */ React269.createElement(Stack186, { gap: "md" }, /* @__PURE__ */ React269.createElement(Group105, { gap: "xs", align: "center" }, /* @__PURE__ */ React269.createElement(ActionIcon41, { variant: "subtle", color: "gray", size: "sm", onClick: () => setSelectedClaimId("") }, /* @__PURE__ */ React269.createElement(IconArrowLeft9, { size: 16 })), /* @__PURE__ */ React269.createElement(Text164, { fw: 500, size: "sm", title: selectedClaim.claimId }, "
|
|
29533
|
+
return /* @__PURE__ */ React269.createElement(Stack186, { gap: "md" }, /* @__PURE__ */ React269.createElement(Group105, { gap: "xs", align: "center" }, /* @__PURE__ */ React269.createElement(ActionIcon41, { variant: "subtle", color: "gray", size: "sm", onClick: () => setSelectedClaimId("") }, /* @__PURE__ */ React269.createElement(IconArrowLeft9, { size: 16 })), /* @__PURE__ */ React269.createElement(Text164, { fw: 500, size: "sm", title: selectedClaim.claimId }, t("actionTypes.claim.flow.claimNumber", { id: truncateId2(selectedClaim.claimId), defaultValue: `Claim #${truncateId2(selectedClaim.claimId)}` }))), /* @__PURE__ */ React269.createElement(Group105, { gap: 16, align: "center", style: { width: "100%" } }, /* @__PURE__ */ React269.createElement(
|
|
29415
29534
|
Box57,
|
|
29416
29535
|
{
|
|
29417
29536
|
style: {
|
|
@@ -29432,14 +29551,17 @@ var EvaluateClaimFlowDetail = ({
|
|
|
29432
29551
|
}
|
|
29433
29552
|
},
|
|
29434
29553
|
selectedClaimProfile?.avatarUrl ? null : selectedAvatarLabel
|
|
29435
|
-
), /* @__PURE__ */ React269.createElement(Stack186, { gap: 0, style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ React269.createElement(Text164, { fw: 500, size: "md", truncate: true }, selectedDisplayName), /* @__PURE__ */ React269.createElement(Text164, { size: "xs", c: "dimmed", truncate: true }, truncateAddress4(selectedClaim.agentAddress))), /* @__PURE__ */ React269.createElement(Stack186, { gap: 0, align: "flex-end", style: { flexShrink: 0 } }, /* @__PURE__ */ React269.createElement(Text164, { fw: 500, size: "md", c: claimStatus.color }, claimStatus.key === "approved" && /* @__PURE__ */ React269.createElement(IconCheck22, { size: 14, style: { verticalAlign: "middle", marginRight: 4 } }), claimStatus.label), /* @__PURE__ */ React269.createElement(Text164, { size: "xs", c: "dimmed" }, getTimeAgo3(selectedClaim.submissionDate || "")))), claimStatus.key === "disputed" && /* @__PURE__ */ React269.createElement(Alert52, { color: "orange", title: "Claim disputed", styles: actionAlertStyles }, loadingDispute ? /* @__PURE__ */ React269.createElement(Group105, { gap: "xs" }, /* @__PURE__ */ React269.createElement(Loader50, { size: "xs" }), /* @__PURE__ */ React269.createElement(Text164, { size: "xs" }, "Loading dispute details\u2026")) : disputeDetails ? /* @__PURE__ */ React269.createElement(Stack186, { gap: 6 }, disputeDetails.reason ? /* @__PURE__ */ React269.createElement(Text164, { size: "sm" }, disputeDetails.reason) : /* @__PURE__ */ React269.createElement(Text164, { size: "sm", c: "dimmed" }, "A dispute was recorded but no message was attached."), (disputeDetails.evaluatorDid || disputeDetails.disputedAt) && /* @__PURE__ */ React269.createElement(Text164, { size: "xs", c: "dimmed" }, disputeDetails.evaluatorDid ?
|
|
29554
|
+
), /* @__PURE__ */ React269.createElement(Stack186, { gap: 0, style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ React269.createElement(Text164, { fw: 500, size: "md", truncate: true }, selectedDisplayName), /* @__PURE__ */ React269.createElement(Text164, { size: "xs", c: "dimmed", truncate: true }, truncateAddress4(selectedClaim.agentAddress))), /* @__PURE__ */ React269.createElement(Stack186, { gap: 0, align: "flex-end", style: { flexShrink: 0 } }, /* @__PURE__ */ React269.createElement(Text164, { fw: 500, size: "md", c: claimStatus.color }, claimStatus.key === "approved" && /* @__PURE__ */ React269.createElement(IconCheck22, { size: 14, style: { verticalAlign: "middle", marginRight: 4 } }), claimStatus.label), /* @__PURE__ */ React269.createElement(Text164, { size: "xs", c: "dimmed" }, getTimeAgo3(selectedClaim.submissionDate || "")))), claimStatus.key === "disputed" && /* @__PURE__ */ React269.createElement(Alert52, { color: "orange", title: t("actionTypes.claim.flow.disputed.title", { defaultValue: "Claim disputed" }), styles: actionAlertStyles }, loadingDispute ? /* @__PURE__ */ React269.createElement(Group105, { gap: "xs" }, /* @__PURE__ */ React269.createElement(Loader50, { size: "xs" }), /* @__PURE__ */ React269.createElement(Text164, { size: "xs" }, t("actionTypes.claim.flow.disputed.loadingDetails", { defaultValue: "Loading dispute details\u2026" }))) : disputeDetails ? /* @__PURE__ */ React269.createElement(Stack186, { gap: 6 }, disputeDetails.reason ? /* @__PURE__ */ React269.createElement(Text164, { size: "sm" }, disputeDetails.reason) : /* @__PURE__ */ React269.createElement(Text164, { size: "sm", c: "dimmed" }, t("actionTypes.evaluateClaim.flow.disputed.noMessageAttached", { defaultValue: "A dispute was recorded but no message was attached." })), (disputeDetails.evaluatorDid || disputeDetails.disputedAt) && /* @__PURE__ */ React269.createElement(Text164, { size: "xs", c: "dimmed" }, disputeDetails.evaluatorDid ? t("actionTypes.claim.flow.disputed.byEvaluator", {
|
|
29555
|
+
address: truncateAddress4(disputeDetails.evaluatorDid),
|
|
29556
|
+
defaultValue: `By ${truncateAddress4(disputeDetails.evaluatorDid)}`
|
|
29557
|
+
}) : "", disputeDetails.evaluatorDid && disputeDetails.disputedAt ? " \xB7 " : "", disputeDetails.disputedAt ? new Date(disputeDetails.disputedAt).toLocaleString() : ""), /* @__PURE__ */ React269.createElement(Text164, { size: "xs", c: "dimmed" }, t("actionTypes.evaluateClaim.flow.disputed.amendNeeded", { defaultValue: "The submitter needs to amend and resubmit before this claim can be evaluated." }))) : typeof handlers.getClaimDisputeDetails !== "function" ? /* @__PURE__ */ React269.createElement(Text164, { size: "xs", c: "dimmed" }, t("actionTypes.claim.flow.disputed.unavailable", { defaultValue: "Dispute details unavailable in this environment." })) : /* @__PURE__ */ React269.createElement(Text164, { size: "xs", c: "dimmed" }, t("actionTypes.claim.flow.disputed.noRecord", { defaultValue: "No dispute record found on-chain for this claim." }))), /* @__PURE__ */ React269.createElement(CollapsibleSection, { title: t("actionTypes.evaluateClaim.flow.section.submission", { defaultValue: "Submission" }) }, surveyLoading ? /* @__PURE__ */ React269.createElement(Group105, { gap: "xs" }, /* @__PURE__ */ React269.createElement(Loader50, { size: "xs" }), /* @__PURE__ */ React269.createElement(Text164, { size: "xs", c: "dimmed" }, t("actionTypes.evaluateClaim.flow.loadingSubmissionDetails", { defaultValue: "Loading submission details..." }))) : surveyModel ? /* @__PURE__ */ React269.createElement(ScrollArea8, { h: 280 }, /* @__PURE__ */ React269.createElement(StableSurvey, { model: surveyModel })) : /* @__PURE__ */ React269.createElement(Text164, { size: "xs", c: "dimmed" }, t("actionTypes.evaluateClaim.flow.noSubmissionTemplate", { defaultValue: "No submission template/data available." }))), /* @__PURE__ */ React269.createElement(CollapsibleSection, { title: t("actionTypes.evaluateClaim.flow.section.attachments", { defaultValue: "Attachments" }) }, /* @__PURE__ */ React269.createElement(ClaimAttachments, { surveyModel, credentialSubject: resolvedCredentialSubject })), /* @__PURE__ */ React269.createElement(CollapsibleSection, { title: t("actionTypes.evaluateClaim.flow.section.aiEvaluation", { defaultValue: "AI Evaluation" }) }, evaluationLoading ? /* @__PURE__ */ React269.createElement(Group105, { gap: "xs" }, /* @__PURE__ */ React269.createElement(Loader50, { size: "xs" }), /* @__PURE__ */ React269.createElement(Text164, { size: "xs", c: "dimmed" }, t("actionTypes.evaluateClaim.flow.runningRubric", { defaultValue: "Running rubric evaluation..." }))) : evaluationResult ? /* @__PURE__ */ React269.createElement(ScrollArea8, { h: 280 }, /* @__PURE__ */ React269.createElement(RubricEvaluationResults, { evaluation: evaluationResult })) : /* @__PURE__ */ React269.createElement(Text164, { size: "xs", c: "dimmed" }, t("actionTypes.evaluateClaim.flow.noRubric", { defaultValue: "No rubric evaluation available for this claim." }))), xeroBlocks.invoiceCreateBlock && !isClaimAlreadyEvaluated && /* @__PURE__ */ React269.createElement(
|
|
29436
29558
|
CollapsibleSection,
|
|
29437
29559
|
{
|
|
29438
29560
|
title: "Xero Bill",
|
|
29439
29561
|
defaultOpen: true,
|
|
29440
|
-
badge: capturedInvoiceId ? /* @__PURE__ */ React269.createElement(Badge50, { color: "green", size: "sm", variant: "light" }, "Captured") : null
|
|
29562
|
+
badge: capturedInvoiceId ? /* @__PURE__ */ React269.createElement(Badge50, { color: "green", size: "sm", variant: "light" }, t("actionTypes.evaluateClaim.flow.xero.captured", { defaultValue: "Captured" })) : null
|
|
29441
29563
|
},
|
|
29442
|
-
/* @__PURE__ */ React269.createElement(Card24, { withBorder: true, p: "sm" }, /* @__PURE__ */ React269.createElement(Stack186, { gap: "xs" }, /* @__PURE__ */ React269.createElement(Group105, { gap: "xs", align: "center" }, /* @__PURE__ */ React269.createElement(IconReceipt3, { size: 16 }), /* @__PURE__ */ React269.createElement(Text164, { size: "sm", fw: 600 }, "
|
|
29564
|
+
/* @__PURE__ */ React269.createElement(Card24, { withBorder: true, p: "sm" }, /* @__PURE__ */ React269.createElement(Stack186, { gap: "xs" }, /* @__PURE__ */ React269.createElement(Group105, { gap: "xs", align: "center" }, /* @__PURE__ */ React269.createElement(IconReceipt3, { size: 16 }), /* @__PURE__ */ React269.createElement(Text164, { size: "sm", fw: 600 }, t("actionTypes.evaluateClaim.flow.xero.billOnApproval", { defaultValue: "{{xero}} bill on approval", xero: "Xero" }))), /* @__PURE__ */ React269.createElement(
|
|
29443
29565
|
XeroConnectionBar,
|
|
29444
29566
|
{
|
|
29445
29567
|
effectiveConnection: xeroEffective.effectiveConnection,
|
|
@@ -29452,7 +29574,10 @@ var EvaluateClaimFlowDetail = ({
|
|
|
29452
29574
|
onClearOverride: handleClearOverride,
|
|
29453
29575
|
editorDocument
|
|
29454
29576
|
}
|
|
29455
|
-
), invoicePreviewError && /* @__PURE__ */ React269.createElement(Alert52, { color: "yellow", variant: "light", p: "xs" }, /* @__PURE__ */ React269.createElement(Text164, { size: "xs" }, invoicePreviewError)), !invoicePreviewError && invoicePreview && invoicePreview.length > 0 && /* @__PURE__ */ React269.createElement(Stack186, { gap: 4 }, invoicePreview.map((row) => /* @__PURE__ */ React269.createElement(Group105, { key: row.key, gap: "xs", wrap: "nowrap" }, /* @__PURE__ */ React269.createElement(Text164, { size: "xs", c: "dimmed", style: { minWidth: 110 } }, row.label), /* @__PURE__ */ React269.createElement(Text164, { size: "xs", style: { flex: 1, wordBreak: "break-word" } }, String(row.after ?? ""))))), captureError && /* @__PURE__ */ React269.createElement(Alert52, { color: "red", variant: "light", p: "xs" }, /* @__PURE__ */ React269.createElement(Text164, { size: "xs" }, captureError)), capturedInvoiceId && /* @__PURE__ */ React269.createElement(Text164, { size: "xs", c: "dimmed" }, "Invoice ID: ", /* @__PURE__ */ React269.createElement("code", null, capturedInvoiceId)), settledPaymentId && /* @__PURE__ */ React269.createElement(Text164, { size: "xs", c: "green" }, "Payment recorded: ", /* @__PURE__ */ React269.createElement("code", null, settledPaymentId)), settlementError && /* @__PURE__ */ React269.createElement(Alert52, { color: "orange", variant: "light", p: "xs" }, /* @__PURE__ */ React269.createElement(Text164, { size: "xs" }, "
|
|
29577
|
+
), invoicePreviewError && /* @__PURE__ */ React269.createElement(Alert52, { color: "yellow", variant: "light", p: "xs" }, /* @__PURE__ */ React269.createElement(Text164, { size: "xs" }, invoicePreviewError)), !invoicePreviewError && invoicePreview && invoicePreview.length > 0 && /* @__PURE__ */ React269.createElement(Stack186, { gap: 4 }, invoicePreview.map((row) => /* @__PURE__ */ React269.createElement(Group105, { key: row.key, gap: "xs", wrap: "nowrap" }, /* @__PURE__ */ React269.createElement(Text164, { size: "xs", c: "dimmed", style: { minWidth: 110 } }, row.label), /* @__PURE__ */ React269.createElement(Text164, { size: "xs", style: { flex: 1, wordBreak: "break-word" } }, String(row.after ?? ""))))), captureError && /* @__PURE__ */ React269.createElement(Alert52, { color: "red", variant: "light", p: "xs" }, /* @__PURE__ */ React269.createElement(Text164, { size: "xs" }, captureError)), capturedInvoiceId && /* @__PURE__ */ React269.createElement(Text164, { size: "xs", c: "dimmed" }, "Invoice ID: ", /* @__PURE__ */ React269.createElement("code", null, capturedInvoiceId)), settledPaymentId && /* @__PURE__ */ React269.createElement(Text164, { size: "xs", c: "green" }, t("actionTypes.evaluateClaim.flow.xero.paymentRecordedLabel", { defaultValue: "Payment recorded:" }), " ", /* @__PURE__ */ React269.createElement("code", null, settledPaymentId)), settlementError && /* @__PURE__ */ React269.createElement(Alert52, { color: "orange", variant: "light", p: "xs" }, /* @__PURE__ */ React269.createElement(Text164, { size: "xs" }, t("actionTypes.evaluateClaim.flow.xero.settlementFailed", {
|
|
29578
|
+
error: settlementError,
|
|
29579
|
+
defaultValue: `Bill captured but settlement failed \u2014 manual reconciliation needed: ${settlementError}`
|
|
29580
|
+
}))), !capturedInvoiceId && /* @__PURE__ */ React269.createElement(
|
|
29456
29581
|
BasePrimaryButton,
|
|
29457
29582
|
{
|
|
29458
29583
|
size: "xs",
|
|
@@ -29460,28 +29585,30 @@ var EvaluateClaimFlowDetail = ({
|
|
|
29460
29585
|
loading: capturingBill,
|
|
29461
29586
|
disabled: !invoiceRunInputs || capturingBill || isClaimAlreadyEvaluated || !xeroEffective.effectiveConnection
|
|
29462
29587
|
},
|
|
29463
|
-
capturingBill ? "Capturing\u2026" : "Capture Bill"
|
|
29464
|
-
), xeroBlocks.paymentCreateBlock && capturedInvoiceId && !settledPaymentId && /* @__PURE__ */ React269.createElement(Text164, { size: "xs", c: "dimmed" }, "Payment will be recorded automatically on Approve.")))
|
|
29588
|
+
capturingBill ? t("actionTypes.evaluateClaim.flow.xero.capturing", { defaultValue: "Capturing\u2026" }) : t("actionTypes.evaluateClaim.flow.xero.captureBill", { defaultValue: "Capture {{bill}}", bill: "Bill" })
|
|
29589
|
+
), xeroBlocks.paymentCreateBlock && capturedInvoiceId && !settledPaymentId && /* @__PURE__ */ React269.createElement(Text164, { size: "xs", c: "dimmed" }, t("actionTypes.evaluateClaim.flow.xero.paymentAutoOnApprove", { defaultValue: "Payment will be recorded automatically on Approve." }))))
|
|
29465
29590
|
), (outcomeTemplateLoading || outcomeTemplateJson) && /* @__PURE__ */ React269.createElement(
|
|
29466
29591
|
CollapsibleSection,
|
|
29467
29592
|
{
|
|
29468
|
-
title: "Outcome",
|
|
29593
|
+
title: t("actionTypes.evaluateClaim.flow.section.outcome", { defaultValue: "Outcome" }),
|
|
29469
29594
|
defaultOpen: true,
|
|
29470
|
-
badge: /* @__PURE__ */ React269.createElement(React269.Fragment, null, outcomeTemplateJson && !outcomeComplete && /* @__PURE__ */ React269.createElement(Text164, { size: "xs", c: "yellow" }, "(required)"), outcomeComplete && /* @__PURE__ */ React269.createElement(IconCheck22, { size: 14, color: "var(--mantine-color-green-6)" }))
|
|
29595
|
+
badge: /* @__PURE__ */ React269.createElement(React269.Fragment, null, outcomeTemplateJson && !outcomeComplete && !isClaimAlreadyEvaluated && /* @__PURE__ */ React269.createElement(Text164, { size: "xs", c: "yellow" }, t("actionTypes.evaluateClaim.flow.outcome.requiredBadge", { defaultValue: "(required)" })), (outcomeComplete || isClaimAlreadyEvaluated) && /* @__PURE__ */ React269.createElement(IconCheck22, { size: 14, color: "var(--mantine-color-green-6)" }))
|
|
29471
29596
|
},
|
|
29472
|
-
outcomeTemplateLoading ? /* @__PURE__ */ React269.createElement(Group105, { gap: "xs" }, /* @__PURE__ */ React269.createElement(Loader50, { size: "xs" }), /* @__PURE__ */ React269.createElement(Text164, { size: "xs", c: "dimmed" }, "Loading evaluation template...")) : outcomeSurveyModel ? /* @__PURE__ */ React269.createElement(ScrollArea8, { h: 320 }, /* @__PURE__ */ React269.createElement(StableSurvey, { model: outcomeSurveyModel })) : /* @__PURE__ */ React269.createElement(Text164, { size: "xs", c: "dimmed" }, "No evaluation template available.")
|
|
29473
|
-
), /* @__PURE__ */ React269.createElement(CollapsibleSection, { title: "Evaluation", defaultOpen: true }, /* @__PURE__ */ React269.createElement(Stack186, { gap: "md" }, /* @__PURE__ */ React269.createElement(Divider22, { color: "color-mix(in srgb, var(--mantine-color-text) 6%, transparent)" }), decision === "dispute" ? /* @__PURE__ */ React269.createElement(Stack186, { gap: "md" }, /* @__PURE__ */ React269.createElement(
|
|
29597
|
+
outcomeTemplateLoading ? /* @__PURE__ */ React269.createElement(Group105, { gap: "xs" }, /* @__PURE__ */ React269.createElement(Loader50, { size: "xs" }), /* @__PURE__ */ React269.createElement(Text164, { size: "xs", c: "dimmed" }, t("actionTypes.evaluateClaim.flow.outcome.loading", { defaultValue: "Loading evaluation template..." }))) : outcomeSurveyModel ? /* @__PURE__ */ React269.createElement(ScrollArea8, { h: 320 }, /* @__PURE__ */ React269.createElement(StableSurvey, { model: outcomeSurveyModel })) : /* @__PURE__ */ React269.createElement(Text164, { size: "xs", c: "dimmed" }, t("actionTypes.evaluateClaim.flow.outcome.noTemplate", { defaultValue: "No evaluation template available." }))
|
|
29598
|
+
), !isClaimAlreadyEvaluated && /* @__PURE__ */ React269.createElement(CollapsibleSection, { title: t("actionTypes.evaluateClaim.flow.section.evaluation", { defaultValue: "Evaluation" }), defaultOpen: true }, /* @__PURE__ */ React269.createElement(Stack186, { gap: "md" }, /* @__PURE__ */ React269.createElement(Divider22, { color: "color-mix(in srgb, var(--mantine-color-text) 6%, transparent)" }), decision === "dispute" ? /* @__PURE__ */ React269.createElement(Stack186, { gap: "md" }, /* @__PURE__ */ React269.createElement(
|
|
29474
29599
|
BaseTextArea,
|
|
29475
29600
|
{
|
|
29476
|
-
label: "Message to claimant",
|
|
29477
|
-
placeholder: "
|
|
29601
|
+
label: t("actionTypes.evaluateClaim.flow.dispute.messageLabel", { defaultValue: "Message to claimant" }),
|
|
29602
|
+
placeholder: t("actionTypes.evaluateClaim.flow.dispute.messagePlaceholder", {
|
|
29603
|
+
defaultValue: "Explain why this claim is being disputed so the youth can correct it."
|
|
29604
|
+
}),
|
|
29478
29605
|
value: disputeReason,
|
|
29479
29606
|
onChange: (event) => setDisputeReason(event.currentTarget.value),
|
|
29480
29607
|
minRows: 4,
|
|
29481
29608
|
required: true,
|
|
29482
29609
|
disabled: isDisabled || submitting || isClaimAlreadyEvaluated
|
|
29483
29610
|
}
|
|
29484
|
-
)) : /* @__PURE__ */ React269.createElement(React269.Fragment, null, /* @__PURE__ */ React269.createElement(Text164, { size: "xs", c: "dimmed" }, "Payment (optional custom payouts)"), paymentRows.map((row, index) => /* @__PURE__ */ React269.createElement(Stack186, { key: row.id, gap: 8 }, /* @__PURE__ */ React269.createElement(Group105, { justify: "space-between", align: "center" }, /* @__PURE__ */ React269.createElement(Text164, { size: "sm" }, "
|
|
29611
|
+
)) : /* @__PURE__ */ React269.createElement(React269.Fragment, null, /* @__PURE__ */ React269.createElement(Text164, { size: "xs", c: "dimmed" }, t("actionTypes.evaluateClaim.flow.payment.label", { defaultValue: "Payment (optional custom payouts)" })), paymentRows.map((row, index) => /* @__PURE__ */ React269.createElement(Stack186, { key: row.id, gap: 8 }, /* @__PURE__ */ React269.createElement(Group105, { justify: "space-between", align: "center" }, /* @__PURE__ */ React269.createElement(Text164, { size: "sm" }, t("actionTypes.evaluateClaim.flow.payment.token", { index: index + 1, defaultValue: `Token ${index + 1}` })), paymentRows.length > 1 && /* @__PURE__ */ React269.createElement(Button55, { variant: "subtle", size: "compact-xs", color: "red", onClick: () => removePaymentRow(row.id), disabled: isDisabled || submitting }, t("actionTypes.evaluateClaim.flow.payment.remove", { defaultValue: "Remove" }))), /* @__PURE__ */ React269.createElement(
|
|
29485
29612
|
BaseSelect,
|
|
29486
29613
|
{
|
|
29487
29614
|
value: row.denom,
|
|
@@ -29489,7 +29616,7 @@ var EvaluateClaimFlowDetail = ({
|
|
|
29489
29616
|
data: [
|
|
29490
29617
|
{ value: USDC_DENOM5, label: "USDC" },
|
|
29491
29618
|
{ value: IXO_DENOM5, label: "IXO" },
|
|
29492
|
-
{ value: CUSTOM_DENOM2, label: "Custom" }
|
|
29619
|
+
{ value: CUSTOM_DENOM2, label: t("actionTypes.evaluateClaim.flow.payment.custom", { defaultValue: "Custom" }) }
|
|
29493
29620
|
],
|
|
29494
29621
|
clearable: false,
|
|
29495
29622
|
disabled: isDisabled || submitting
|
|
@@ -29497,7 +29624,7 @@ var EvaluateClaimFlowDetail = ({
|
|
|
29497
29624
|
), row.denom === CUSTOM_DENOM2 && /* @__PURE__ */ React269.createElement(
|
|
29498
29625
|
BaseTextInput,
|
|
29499
29626
|
{
|
|
29500
|
-
placeholder: "Custom denom (e.g. ibc/... or uixo)",
|
|
29627
|
+
placeholder: t("actionTypes.evaluateClaim.flow.payment.customDenomPlaceholder", { defaultValue: "Custom denom (e.g. ibc/... or uixo)" }),
|
|
29501
29628
|
value: row.customDenom,
|
|
29502
29629
|
onChange: (event) => updatePaymentRow(row.id, { customDenom: event.currentTarget.value }),
|
|
29503
29630
|
disabled: isDisabled || submitting
|
|
@@ -29508,33 +29635,47 @@ var EvaluateClaimFlowDetail = ({
|
|
|
29508
29635
|
min: 0,
|
|
29509
29636
|
value: row.amount,
|
|
29510
29637
|
onChange: (value) => updatePaymentRow(row.id, { amount: value }),
|
|
29511
|
-
placeholder: "Amount",
|
|
29638
|
+
placeholder: t("actionTypes.evaluateClaim.flow.payment.amountPlaceholder", { defaultValue: "Amount" }),
|
|
29512
29639
|
disabled: isDisabled || submitting
|
|
29513
29640
|
}
|
|
29514
|
-
))), /* @__PURE__ */ React269.createElement(Button55, { variant: "light", size: "xs", onClick: addPaymentRow, disabled: isDisabled || submitting },
|
|
29641
|
+
))), /* @__PURE__ */ React269.createElement(Button55, { variant: "light", size: "xs", onClick: addPaymentRow, disabled: isDisabled || submitting }, t("actionTypes.evaluateClaim.flow.payment.addPayment", { defaultValue: "Add Payment" }))), /* @__PURE__ */ React269.createElement(
|
|
29642
|
+
Checkbox13,
|
|
29643
|
+
{
|
|
29644
|
+
label: t("actionTypes.evaluateClaim.flow.generateUdid", { defaultValue: "Generate UDID proof before signing" }),
|
|
29645
|
+
checked: createUdid,
|
|
29646
|
+
onChange: (event) => setCreateUdid(event.currentTarget.checked)
|
|
29647
|
+
}
|
|
29648
|
+
))), outcomeNotReady && !isClaimAlreadyEvaluated && /* @__PURE__ */ React269.createElement(Alert52, { color: "yellow", styles: actionAlertStyles }, t("actionTypes.evaluateClaim.flow.outcome.completeBeforeAction", { defaultValue: "Complete the Outcome evaluation template before approving or rejecting." })), isClaimAlreadyEvaluated && claimStatus.key !== "disputed" && /* @__PURE__ */ React269.createElement(Alert52, { color: "yellow", styles: actionAlertStyles }, /* @__PURE__ */ React269.createElement(Stack186, { gap: 4 }, /* @__PURE__ */ React269.createElement(Text164, { size: "sm" }, t("actionTypes.evaluateClaim.flow.alreadyEvaluated", { defaultValue: "This claim is already evaluated." })), evaluationAmount && evaluationAmount.length > 0 && /* @__PURE__ */ React269.createElement(Text164, { size: "xs", c: "dimmed" }, t("actionTypes.evaluateClaim.flow.transferredOnChain", {
|
|
29649
|
+
amount: evaluationAmount.map(formatCoin).join(", "),
|
|
29650
|
+
defaultValue: `Transferred on-chain: ${evaluationAmount.map(formatCoin).join(", ")}`
|
|
29651
|
+
})))), !authChecking && authError && /* @__PURE__ */ React269.createElement(Alert52, { color: "orange", styles: actionAlertStyles }, /* @__PURE__ */ React269.createElement(Stack186, { gap: "xs" }, /* @__PURE__ */ React269.createElement(Text164, { size: "sm" }, t("actionTypes.claim.flow.authVerifyFailed", { defaultValue: "Couldn't verify your authorization \u2014 the chain RPC is unreachable." })), /* @__PURE__ */ React269.createElement(Text164, { size: "xs", c: "dimmed" }, authError), /* @__PURE__ */ React269.createElement(Button55, { size: "xs", variant: "light", onClick: () => setAuthRetryKey((k) => k + 1) }, t("actionTypes.claim.flow.retry", { defaultValue: "Retry" })))), !authChecking && !authError && !isEvaluatorAuthorized && /* @__PURE__ */ React269.createElement(Alert52, { color: "yellow", styles: actionAlertStyles }, t("actionTypes.evaluateClaim.flow.notAuthorized", { defaultValue: "You need evaluator authorization for this collection to approve or reject claims." })), !isClaimAlreadyEvaluated && /* @__PURE__ */ React269.createElement(
|
|
29515
29652
|
BaseSelect,
|
|
29516
29653
|
{
|
|
29517
|
-
label: "Decision",
|
|
29518
|
-
placeholder: "Select decision",
|
|
29654
|
+
label: t("actionTypes.evaluateClaim.flow.decision.label", { defaultValue: "Decision" }),
|
|
29655
|
+
placeholder: t("actionTypes.evaluateClaim.flow.decision.placeholder", { defaultValue: "Select decision" }),
|
|
29519
29656
|
value: decision || null,
|
|
29520
29657
|
onChange: (value) => setDecision(value || ""),
|
|
29521
29658
|
data: [
|
|
29522
|
-
{ value: "approve", label: "Approve" },
|
|
29523
|
-
{ value: "reject", label: "Reject" },
|
|
29524
|
-
{ value: "dispute", label: "Dispute" }
|
|
29659
|
+
{ value: "approve", label: t("actionTypes.evaluateClaim.flow.decision.approve", { defaultValue: "Approve" }) },
|
|
29660
|
+
{ value: "reject", label: t("actionTypes.evaluateClaim.flow.decision.reject", { defaultValue: "Reject" }) },
|
|
29661
|
+
{ value: "dispute", label: t("actionTypes.evaluateClaim.flow.decision.dispute", { defaultValue: "Dispute" }) }
|
|
29525
29662
|
],
|
|
29526
|
-
disabled: isDisabled || submitting
|
|
29663
|
+
disabled: isDisabled || submitting
|
|
29527
29664
|
}
|
|
29528
29665
|
), error && /* @__PURE__ */ React269.createElement(Alert52, { color: "red", styles: actionAlertStyles }, error), /* @__PURE__ */ React269.createElement(MediaPreviewModal, { file: surveyActiveFile, onClose: () => setSurveyActiveFile(null) }));
|
|
29529
29666
|
}
|
|
29530
29667
|
const filterTabs = [
|
|
29531
|
-
{ value: "all", label: "All" },
|
|
29532
|
-
{ value: "pending", label: "Pending" },
|
|
29533
|
-
{ value: "approved", label: "Approved" },
|
|
29534
|
-
{ value: "rejected", label: "Rejected" },
|
|
29535
|
-
{ value: "disputed", label: "Disputed" }
|
|
29668
|
+
{ value: "all", label: t("actionTypes.evaluateClaim.flow.filter.all", { defaultValue: "All" }) },
|
|
29669
|
+
{ value: "pending", label: t("actionTypes.evaluateClaim.flow.filter.pending", { defaultValue: "Pending" }) },
|
|
29670
|
+
{ value: "approved", label: t("actionTypes.evaluateClaim.flow.filter.approved", { defaultValue: "Approved" }) },
|
|
29671
|
+
{ value: "rejected", label: t("actionTypes.evaluateClaim.flow.filter.rejected", { defaultValue: "Rejected" }) },
|
|
29672
|
+
{ value: "disputed", label: t("actionTypes.evaluateClaim.flow.filter.disputed", { defaultValue: "Disputed" }) }
|
|
29536
29673
|
];
|
|
29537
|
-
return /* @__PURE__ */ React269.createElement(Stack186, { gap: "md" }, !deedDid || !collectionId ? /* @__PURE__ */ React269.createElement(Alert52, { color: "yellow", styles: actionAlertStyles }, "
|
|
29674
|
+
return /* @__PURE__ */ React269.createElement(Stack186, { gap: "md" }, !deedDid || !collectionId ? /* @__PURE__ */ React269.createElement(Alert52, { color: "yellow", styles: actionAlertStyles }, t("actionTypes.shared.errors.configRequired", {
|
|
29675
|
+
defaultValue: "Configure {{did}} and {{claimCollection}} in template mode before running this action.",
|
|
29676
|
+
did: "DID",
|
|
29677
|
+
claimCollection: "claim collection"
|
|
29678
|
+
})) : /* @__PURE__ */ React269.createElement(React269.Fragment, null, /* @__PURE__ */ React269.createElement(Group105, { justify: "space-between", align: "center" }, /* @__PURE__ */ React269.createElement(Group105, { gap: 0 }, filterTabs.map((tab) => /* @__PURE__ */ React269.createElement(
|
|
29538
29679
|
UnstyledButton6,
|
|
29539
29680
|
{
|
|
29540
29681
|
key: tab.value,
|
|
@@ -29548,7 +29689,7 @@ var EvaluateClaimFlowDetail = ({
|
|
|
29548
29689
|
}
|
|
29549
29690
|
},
|
|
29550
29691
|
/* @__PURE__ */ React269.createElement(Text164, { size: "sm", fw: 500, c: activeFilter === tab.value ? "var(--mantine-color-text)" : "dimmed" }, tab.label)
|
|
29551
|
-
))), /* @__PURE__ */ React269.createElement(ActionIcon41, { variant: "subtle", color: "gray", size: "sm" }, /* @__PURE__ */ React269.createElement(IconFilter2, { size: 16 }))), loadingClaims && /* @__PURE__ */ React269.createElement(Group105, { gap: "xs", justify: "center", py: "md" }, /* @__PURE__ */ React269.createElement(Loader50, { size: "xs" }), /* @__PURE__ */ React269.createElement(Text164, { size: "xs", c: "dimmed" }, "Loading claims...")), !loadingClaims && filteredClaims.length === 0 && /* @__PURE__ */ React269.createElement(Text164, { size: "sm", c: "dimmed", ta: "center", py: "md" }, claims.length === 0 ? "No claims available for this collection." : `No ${activeFilter} claims found.`), filteredClaims.length > 0 && /* @__PURE__ */ React269.createElement(Stack186, { gap: 12 }, filteredClaims.map((claim) => {
|
|
29692
|
+
))), /* @__PURE__ */ React269.createElement(ActionIcon41, { variant: "subtle", color: "gray", size: "sm" }, /* @__PURE__ */ React269.createElement(IconFilter2, { size: 16 }))), loadingClaims && /* @__PURE__ */ React269.createElement(Group105, { gap: "xs", justify: "center", py: "md" }, /* @__PURE__ */ React269.createElement(Loader50, { size: "xs" }), /* @__PURE__ */ React269.createElement(Text164, { size: "xs", c: "dimmed" }, t("actionTypes.evaluateClaim.flow.loadingClaims", { defaultValue: "Loading claims..." }))), !loadingClaims && filteredClaims.length === 0 && /* @__PURE__ */ React269.createElement(Text164, { size: "sm", c: "dimmed", ta: "center", py: "md" }, claims.length === 0 ? t("actionTypes.evaluateClaim.flow.empty.allCollections", { defaultValue: "No claims available for this collection." }) : t("actionTypes.evaluateClaim.flow.empty.filtered", { filter: activeFilter, defaultValue: `No ${activeFilter} claims found.` })), filteredClaims.length > 0 && /* @__PURE__ */ React269.createElement(Stack186, { gap: 12 }, filteredClaims.map((claim) => {
|
|
29552
29693
|
const status = getClaimStatusInfo(claim);
|
|
29553
29694
|
const profile = profilesByDid[claim.agentDid];
|
|
29554
29695
|
const displayName = profile?.displayname || claim.agentDid || claim.agentAddress;
|
|
@@ -30688,7 +30829,7 @@ var DomainSignConfig = ({ inputs, onInputsChange }) => {
|
|
|
30688
30829
|
};
|
|
30689
30830
|
|
|
30690
30831
|
// src/mantine/blocks/action/actionTypes/domainSign/DomainSignFlowDetail.tsx
|
|
30691
|
-
import React277, { useCallback as useCallback104, useMemo as useMemo108, useState as useState128 } from "react";
|
|
30832
|
+
import React277, { useCallback as useCallback104, useEffect as useEffect105, useMemo as useMemo108, useState as useState128 } from "react";
|
|
30692
30833
|
import { Alert as Alert55, Button as Button58, Group as Group109, Loader as Loader55, Stack as Stack194, Text as Text172 } from "@mantine/core";
|
|
30693
30834
|
import { IconCheck as IconCheck23, IconAlertCircle as IconAlertCircle21, IconExternalLink as IconExternalLink2 } from "@tabler/icons-react";
|
|
30694
30835
|
var STEP_LABELS = {
|
|
@@ -30696,7 +30837,16 @@ var STEP_LABELS = {
|
|
|
30696
30837
|
uploading: "Uploading to storage...",
|
|
30697
30838
|
creating: "Creating domain entity..."
|
|
30698
30839
|
};
|
|
30699
|
-
var DomainSignFlowDetail = ({
|
|
30840
|
+
var DomainSignFlowDetail = ({
|
|
30841
|
+
inputs,
|
|
30842
|
+
editor,
|
|
30843
|
+
block,
|
|
30844
|
+
runtime,
|
|
30845
|
+
updateRuntime,
|
|
30846
|
+
isDisabled,
|
|
30847
|
+
activePendingInvocation,
|
|
30848
|
+
onPendingInvocationCompleted
|
|
30849
|
+
}) => {
|
|
30700
30850
|
const handlers = useBlocknoteHandlers();
|
|
30701
30851
|
const services = useMemo108(() => buildServicesFromHandlers(handlers), [handlers]);
|
|
30702
30852
|
const flowNode = useMemo108(() => buildFlowNodeFromBlock(block), [block]);
|
|
@@ -30721,7 +30871,13 @@ var DomainSignFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isD
|
|
|
30721
30871
|
const editorDocument = editor?.document || [];
|
|
30722
30872
|
const resolveOpts = useMemo108(() => ({ yRuntime: editor?._yRuntime }), [editor?._yRuntime]);
|
|
30723
30873
|
const entityType = resolveReferences(parsed.entityType, editorDocument, resolveOpts).trim();
|
|
30724
|
-
const pendingPayload =
|
|
30874
|
+
const pendingPayload = useMemo108(() => {
|
|
30875
|
+
if (!activePendingInvocation) return runtime.pendingPayload;
|
|
30876
|
+
return {
|
|
30877
|
+
...activePendingInvocation.payload || {},
|
|
30878
|
+
...activePendingInvocation.refSnapshots || {}
|
|
30879
|
+
};
|
|
30880
|
+
}, [activePendingInvocation, runtime.pendingPayload]);
|
|
30725
30881
|
const domainCardData = useMemo108(() => {
|
|
30726
30882
|
try {
|
|
30727
30883
|
const raw = pendingPayload?.domainCardData;
|
|
@@ -30741,8 +30897,17 @@ var DomainSignFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isD
|
|
|
30741
30897
|
});
|
|
30742
30898
|
const [activeStep, setActiveStep] = useState128("");
|
|
30743
30899
|
const [error, setError] = useState128(runtime.error?.message || null);
|
|
30900
|
+
useEffect105(() => {
|
|
30901
|
+
if (!activePendingInvocation?.id) return;
|
|
30902
|
+
setFlowStep("idle");
|
|
30903
|
+
setActiveStep("");
|
|
30904
|
+
setError(null);
|
|
30905
|
+
}, [activePendingInvocation?.id]);
|
|
30744
30906
|
const entityDid = runtime.output?.entityDid || "";
|
|
30745
|
-
const
|
|
30907
|
+
const governanceGroupCoreAddress = runtime.output?.governanceGroupCoreAddress || "";
|
|
30908
|
+
const transactionHash = runtime.output?.transactionHash || "";
|
|
30909
|
+
const isInvokingPending = !!activePendingInvocation?.id;
|
|
30910
|
+
const isCompleted = flowStep === "success" || runtime.state === "completed" && !isInvokingPending;
|
|
30746
30911
|
const handleSign = useCallback104(async () => {
|
|
30747
30912
|
if (isDisabled || flowStep === "running" || isCompleted) return;
|
|
30748
30913
|
if (!domainCardData) {
|
|
@@ -30759,6 +30924,7 @@ var DomainSignFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isD
|
|
|
30759
30924
|
setError(null);
|
|
30760
30925
|
updateRuntime({ state: "running", error: void 0 });
|
|
30761
30926
|
try {
|
|
30927
|
+
let actionEvents = [];
|
|
30762
30928
|
const outcome = await executeNode({
|
|
30763
30929
|
node: flowNode,
|
|
30764
30930
|
actorDid,
|
|
@@ -30808,6 +30974,7 @@ var DomainSignFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isD
|
|
|
30808
30974
|
editor
|
|
30809
30975
|
}
|
|
30810
30976
|
);
|
|
30977
|
+
actionEvents = result.events || [];
|
|
30811
30978
|
return {
|
|
30812
30979
|
payload: result.output,
|
|
30813
30980
|
submittedByDid: actorDid || void 0
|
|
@@ -30818,11 +30985,32 @@ var DomainSignFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isD
|
|
|
30818
30985
|
if (!outcome.success) {
|
|
30819
30986
|
throw new Error(outcome.error || "Domain sign failed");
|
|
30820
30987
|
}
|
|
30988
|
+
const output = outcome.result?.payload || {};
|
|
30821
30989
|
updateRuntime({
|
|
30822
30990
|
state: "completed",
|
|
30823
30991
|
executedAt: Date.now(),
|
|
30824
|
-
output
|
|
30992
|
+
output
|
|
30825
30993
|
});
|
|
30994
|
+
if (actionEvents.length > 0) {
|
|
30995
|
+
writeRunRecordAndReconcile(
|
|
30996
|
+
editor,
|
|
30997
|
+
block.id,
|
|
30998
|
+
output,
|
|
30999
|
+
actionEvents,
|
|
31000
|
+
actorDid,
|
|
31001
|
+
activePendingInvocation ? {
|
|
31002
|
+
fromPendingInvocationId: activePendingInvocation.id,
|
|
31003
|
+
triggeredBy: {
|
|
31004
|
+
sourceBlockId: activePendingInvocation.triggeringBlockId,
|
|
31005
|
+
eventName: activePendingInvocation.eventName
|
|
31006
|
+
},
|
|
31007
|
+
sourceRunId: activePendingInvocation.sourceRunId
|
|
31008
|
+
} : void 0
|
|
31009
|
+
);
|
|
31010
|
+
}
|
|
31011
|
+
if (activePendingInvocation?.id) {
|
|
31012
|
+
onPendingInvocationCompleted?.(activePendingInvocation.id);
|
|
31013
|
+
}
|
|
30826
31014
|
setFlowStep("success");
|
|
30827
31015
|
setActiveStep("");
|
|
30828
31016
|
} catch (err) {
|
|
@@ -30837,6 +31025,7 @@ var DomainSignFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isD
|
|
|
30837
31025
|
}
|
|
30838
31026
|
}, [
|
|
30839
31027
|
actorDid,
|
|
31028
|
+
activePendingInvocation,
|
|
30840
31029
|
block.id,
|
|
30841
31030
|
domainCardData,
|
|
30842
31031
|
editor,
|
|
@@ -30851,6 +31040,7 @@ var DomainSignFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isD
|
|
|
30851
31040
|
isCompleted,
|
|
30852
31041
|
isDisabled,
|
|
30853
31042
|
pendingPayload,
|
|
31043
|
+
onPendingInvocationCompleted,
|
|
30854
31044
|
runtimeManager,
|
|
30855
31045
|
services,
|
|
30856
31046
|
ucanService,
|
|
@@ -30870,7 +31060,7 @@ var DomainSignFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isD
|
|
|
30870
31060
|
const isActive = activeStep === step;
|
|
30871
31061
|
const isDone = ["signing", "uploading", "creating"].indexOf(step) < ["signing", "uploading", "creating"].indexOf(activeStep);
|
|
30872
31062
|
return /* @__PURE__ */ React277.createElement(Group109, { key: step, gap: "xs" }, isDone ? /* @__PURE__ */ React277.createElement(IconCheck23, { size: 14, color: "var(--mantine-color-green-5)" }) : isActive ? /* @__PURE__ */ React277.createElement(Loader55, { size: 14 }) : /* @__PURE__ */ React277.createElement(Text172, { size: "xs", c: "dimmed", style: { width: 14 } }, "\u2013"), /* @__PURE__ */ React277.createElement(Text172, { size: "xs", c: isActive ? void 0 : "dimmed" }, STEP_LABELS[step]));
|
|
30873
|
-
})), isCompleted && /* @__PURE__ */ React277.createElement(Alert55, { icon: /* @__PURE__ */ React277.createElement(IconCheck23, { size: 16 }), title: "Domain Created Successfully", color: "green" }, /* @__PURE__ */ React277.createElement(Stack194, { gap: "xs" }, /* @__PURE__ */ React277.createElement(Text172, { size: "sm" }, "The domain card has been signed and the entity has been created on-chain."), entityDid && /* @__PURE__ */ React277.createElement(Text172, { size: "xs", c: "dimmed", style: { wordBreak: "break-all" } }, "
|
|
31063
|
+
})), isCompleted && /* @__PURE__ */ React277.createElement(Alert55, { icon: /* @__PURE__ */ React277.createElement(IconCheck23, { size: 16 }), title: "Domain Created Successfully", color: "green" }, /* @__PURE__ */ React277.createElement(Stack194, { gap: "xs" }, /* @__PURE__ */ React277.createElement(Text172, { size: "sm" }, "The domain card has been signed and the entity has been created on-chain."), entityDid && /* @__PURE__ */ React277.createElement(Text172, { size: "xs", c: "dimmed", style: { wordBreak: "break-all" } }, "POD DID: ", entityDid), governanceGroupCoreAddress && /* @__PURE__ */ React277.createElement(Text172, { size: "xs", c: "dimmed", style: { wordBreak: "break-all" } }, "Group core address: ", governanceGroupCoreAddress), transactionHash && /* @__PURE__ */ React277.createElement(Text172, { size: "xs", c: "dimmed", style: { wordBreak: "break-all" } }, "Transaction hash: ", transactionHash))), isCompleted && entityDid && handlers?.redirectToEntityOverview && /* @__PURE__ */ React277.createElement(Button58, { variant: "outline", leftSection: /* @__PURE__ */ React277.createElement(IconExternalLink2, { size: 14 }), onClick: handleVisitEntity }, "Visit Entity"), !isCompleted && /* @__PURE__ */ React277.createElement(Button58, { fullWidth: true, onClick: handleSign, disabled: isDisabled || flowStep === "running", loading: flowStep === "running" }, flowStep === "running" ? "Processing..." : "Sign & Create Domain"), flowStep === "error" && /* @__PURE__ */ React277.createElement(Group109, null, /* @__PURE__ */ React277.createElement(Button58, { variant: "outline", onClick: handleRetry }, "Try Again"))), error && /* @__PURE__ */ React277.createElement(Alert55, { icon: /* @__PURE__ */ React277.createElement(IconAlertCircle21, { size: 16 }), color: "red", styles: actionAlertStyles }, error), runtime.error?.message && flowStep !== "error" && /* @__PURE__ */ React277.createElement(Alert55, { color: "red", styles: actionAlertStyles }, runtime.error.message));
|
|
30874
31064
|
};
|
|
30875
31065
|
|
|
30876
31066
|
// src/mantine/blocks/action/actionTypes/domainSign/index.ts
|
|
@@ -30880,7 +31070,7 @@ registerActionTypeUI("qi/domain.sign", {
|
|
|
30880
31070
|
});
|
|
30881
31071
|
|
|
30882
31072
|
// src/mantine/blocks/action/actionTypes/domainCardPreview/DomainCardPreviewConfig.tsx
|
|
30883
|
-
import React278, { useCallback as useCallback105, useEffect as
|
|
31073
|
+
import React278, { useCallback as useCallback105, useEffect as useEffect106, useState as useState129 } from "react";
|
|
30884
31074
|
import { Stack as Stack195, Text as Text173, Textarea as Textarea3 } from "@mantine/core";
|
|
30885
31075
|
|
|
30886
31076
|
// src/mantine/blocks/action/actionTypes/domainCardPreview/types.ts
|
|
@@ -30934,7 +31124,7 @@ function buildCardDataFromInputs(inputs) {
|
|
|
30934
31124
|
// src/mantine/blocks/action/actionTypes/domainCardPreview/DomainCardPreviewConfig.tsx
|
|
30935
31125
|
var DomainCardPreviewConfig = ({ inputs, onInputsChange }) => {
|
|
30936
31126
|
const [local, setLocal] = useState129(() => parseDomainCardPreviewInputs(inputs));
|
|
30937
|
-
|
|
31127
|
+
useEffect106(() => {
|
|
30938
31128
|
setLocal(parseDomainCardPreviewInputs(inputs));
|
|
30939
31129
|
}, [inputs]);
|
|
30940
31130
|
const update = useCallback105(
|
|
@@ -31030,7 +31220,7 @@ registerActionTypeUI("qi/domain.card-preview", {
|
|
|
31030
31220
|
});
|
|
31031
31221
|
|
|
31032
31222
|
// src/mantine/blocks/action/actionTypes/oracle/OracleConfig.tsx
|
|
31033
|
-
import React280, { useCallback as useCallback107, useEffect as
|
|
31223
|
+
import React280, { useCallback as useCallback107, useEffect as useEffect107, useState as useState130 } from "react";
|
|
31034
31224
|
import { Stack as Stack197 } from "@mantine/core";
|
|
31035
31225
|
|
|
31036
31226
|
// src/mantine/blocks/action/actionTypes/oracle/types.ts
|
|
@@ -31053,7 +31243,7 @@ function serializeOracleInputs(inputs) {
|
|
|
31053
31243
|
// src/mantine/blocks/action/actionTypes/oracle/OracleConfig.tsx
|
|
31054
31244
|
var OracleConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
31055
31245
|
const [local, setLocal] = useState130(() => parseOracleInputs(inputs));
|
|
31056
|
-
|
|
31246
|
+
useEffect107(() => {
|
|
31057
31247
|
setLocal(parseOracleInputs(inputs));
|
|
31058
31248
|
}, [inputs]);
|
|
31059
31249
|
const update = useCallback107(
|
|
@@ -31133,7 +31323,7 @@ registerActionTypeUI("oracle", {
|
|
|
31133
31323
|
});
|
|
31134
31324
|
|
|
31135
31325
|
// src/mantine/blocks/action/actionTypes/oraclePrompt/OraclePromptConfig.tsx
|
|
31136
|
-
import React282, { useCallback as useCallback109, useEffect as
|
|
31326
|
+
import React282, { useCallback as useCallback109, useEffect as useEffect108, useState as useState132 } from "react";
|
|
31137
31327
|
import { Stack as Stack199 } from "@mantine/core";
|
|
31138
31328
|
|
|
31139
31329
|
// src/mantine/blocks/action/actionTypes/oraclePrompt/types.ts
|
|
@@ -31154,7 +31344,7 @@ function serializeOraclePromptInputs(inputs) {
|
|
|
31154
31344
|
// src/mantine/blocks/action/actionTypes/oraclePrompt/OraclePromptConfig.tsx
|
|
31155
31345
|
var OraclePromptConfig = ({ inputs, onInputsChange }) => {
|
|
31156
31346
|
const [localPrompt, setLocalPrompt] = useState132(() => parseOraclePromptInputs(inputs).prompt);
|
|
31157
|
-
|
|
31347
|
+
useEffect108(() => {
|
|
31158
31348
|
setLocalPrompt(parseOraclePromptInputs(inputs).prompt);
|
|
31159
31349
|
}, [inputs]);
|
|
31160
31350
|
const handleChange = useCallback109(
|
|
@@ -31264,7 +31454,7 @@ registerActionTypeUI("oracle.prompt", {
|
|
|
31264
31454
|
});
|
|
31265
31455
|
|
|
31266
31456
|
// src/mantine/blocks/action/actionTypes/formSubmit/FormSubmitConfig.tsx
|
|
31267
|
-
import React284, { useCallback as useCallback111, useEffect as
|
|
31457
|
+
import React284, { useCallback as useCallback111, useEffect as useEffect109, useState as useState134 } from "react";
|
|
31268
31458
|
import { Stack as Stack201, Text as Text176 } from "@mantine/core";
|
|
31269
31459
|
|
|
31270
31460
|
// src/mantine/blocks/action/actionTypes/formSubmit/types.ts
|
|
@@ -31301,7 +31491,7 @@ function isValidSchemaJson(value) {
|
|
|
31301
31491
|
var FormSubmitConfig = ({ inputs, onInputsChange }) => {
|
|
31302
31492
|
const [localSchema, setLocalSchema] = useState134(() => parseFormSubmitActionInputs(inputs).surveySchema);
|
|
31303
31493
|
const [error, setError] = useState134(null);
|
|
31304
|
-
|
|
31494
|
+
useEffect109(() => {
|
|
31305
31495
|
setLocalSchema(parseFormSubmitActionInputs(inputs).surveySchema);
|
|
31306
31496
|
setError(null);
|
|
31307
31497
|
}, [inputs]);
|
|
@@ -31336,7 +31526,7 @@ var FormSubmitConfig = ({ inputs, onInputsChange }) => {
|
|
|
31336
31526
|
};
|
|
31337
31527
|
|
|
31338
31528
|
// src/mantine/blocks/action/actionTypes/formSubmit/FormSubmitFlowDetail.tsx
|
|
31339
|
-
import React285, { useCallback as useCallback112, useEffect as
|
|
31529
|
+
import React285, { useCallback as useCallback112, useEffect as useEffect110, useMemo as useMemo112, useState as useState135 } from "react";
|
|
31340
31530
|
import { Alert as Alert59, Loader as Loader58, Stack as Stack202, Text as Text177 } from "@mantine/core";
|
|
31341
31531
|
import { SurveyModel as SurveyModel12 } from "@ixo/surveys";
|
|
31342
31532
|
function parsePrimarySkill2(rawSkill) {
|
|
@@ -31523,7 +31713,7 @@ var FormSubmitFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isD
|
|
|
31523
31713
|
},
|
|
31524
31714
|
[actorDid, block, editor, flowId, flowNode, flowOwnerDid, flowUri, handlers, invocationStore, isDisabled, runtimeManager, services, submitting, ucanService, updateRuntime]
|
|
31525
31715
|
);
|
|
31526
|
-
|
|
31716
|
+
useEffect110(() => {
|
|
31527
31717
|
if (!surveyModel) return void 0;
|
|
31528
31718
|
surveyModel.onComplete.add(handleSurveyComplete);
|
|
31529
31719
|
return () => {
|
|
@@ -31545,7 +31735,7 @@ registerActionTypeUI("qi/human.form.submit", {
|
|
|
31545
31735
|
});
|
|
31546
31736
|
|
|
31547
31737
|
// src/mantine/blocks/action/actionTypes/credentialStore/CredentialStoreConfig.tsx
|
|
31548
|
-
import React286, { useCallback as useCallback113, useEffect as
|
|
31738
|
+
import React286, { useCallback as useCallback113, useEffect as useEffect111, useState as useState136 } from "react";
|
|
31549
31739
|
import { Stack as Stack203, Text as Text178 } from "@mantine/core";
|
|
31550
31740
|
|
|
31551
31741
|
// src/mantine/blocks/action/actionTypes/credentialStore/types.ts
|
|
@@ -31578,7 +31768,7 @@ function serializeCredentialStoreInputs(inputs) {
|
|
|
31578
31768
|
// src/mantine/blocks/action/actionTypes/credentialStore/CredentialStoreConfig.tsx
|
|
31579
31769
|
var CredentialStoreConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
31580
31770
|
const [local, setLocal] = useState136(() => parseCredentialStoreInputs(inputs));
|
|
31581
|
-
|
|
31771
|
+
useEffect111(() => {
|
|
31582
31772
|
setLocal(parseCredentialStoreInputs(inputs));
|
|
31583
31773
|
}, [inputs]);
|
|
31584
31774
|
const update = useCallback113(
|
|
@@ -31782,7 +31972,7 @@ registerActionTypeUI("qi/credential.store", {
|
|
|
31782
31972
|
});
|
|
31783
31973
|
|
|
31784
31974
|
// src/mantine/blocks/action/actionTypes/payment/PaymentConfig.tsx
|
|
31785
|
-
import React288, { useCallback as useCallback115, useEffect as
|
|
31975
|
+
import React288, { useCallback as useCallback115, useEffect as useEffect112, useState as useState138 } from "react";
|
|
31786
31976
|
import { Stack as Stack205, Text as Text180 } from "@mantine/core";
|
|
31787
31977
|
|
|
31788
31978
|
// src/mantine/blocks/action/actionTypes/payment/types.ts
|
|
@@ -31818,7 +32008,7 @@ function isValidPaymentConfig(value) {
|
|
|
31818
32008
|
var PaymentConfig = ({ inputs, onInputsChange }) => {
|
|
31819
32009
|
const [localConfig, setLocalConfig] = useState138(() => parsePaymentInputs(inputs).paymentConfig);
|
|
31820
32010
|
const [error, setError] = useState138(null);
|
|
31821
|
-
|
|
32011
|
+
useEffect112(() => {
|
|
31822
32012
|
setLocalConfig(parsePaymentInputs(inputs).paymentConfig);
|
|
31823
32013
|
setError(null);
|
|
31824
32014
|
}, [inputs]);
|
|
@@ -32173,7 +32363,7 @@ registerActionTypeUI("qi/payment.execute", {
|
|
|
32173
32363
|
});
|
|
32174
32364
|
|
|
32175
32365
|
// src/mantine/blocks/action/actionTypes/matrixDm/MatrixDmConfig.tsx
|
|
32176
|
-
import React290, { useCallback as useCallback117, useEffect as
|
|
32366
|
+
import React290, { useCallback as useCallback117, useEffect as useEffect113, useMemo as useMemo115, useState as useState140 } from "react";
|
|
32177
32367
|
import { Flex as Flex35, Stack as Stack207, Text as Text182 } from "@mantine/core";
|
|
32178
32368
|
|
|
32179
32369
|
// src/mantine/blocks/action/actionTypes/matrixDm/types.ts
|
|
@@ -32203,10 +32393,10 @@ var MatrixDmConfig = ({ inputs, onInputsChange, editor }) => {
|
|
|
32203
32393
|
const [searchValue, setSearchValue] = useState140("");
|
|
32204
32394
|
const roomId = editor?.getRoomId?.() || null;
|
|
32205
32395
|
const mx = editor?.getMatrixClient?.() || null;
|
|
32206
|
-
|
|
32396
|
+
useEffect113(() => {
|
|
32207
32397
|
setLocal(parseMatrixDmInputs(inputs));
|
|
32208
32398
|
}, [inputs]);
|
|
32209
|
-
|
|
32399
|
+
useEffect113(() => {
|
|
32210
32400
|
(async () => {
|
|
32211
32401
|
if (!roomId || !mx) return;
|
|
32212
32402
|
try {
|
|
@@ -32280,11 +32470,11 @@ registerActionTypeUI("qi/matrix.dm", {
|
|
|
32280
32470
|
});
|
|
32281
32471
|
|
|
32282
32472
|
// src/mantine/blocks/action/actionTypes/calendar/eventCreate/CalendarEventCreateConfig.tsx
|
|
32283
|
-
import React291, { useCallback as useCallback118, useEffect as
|
|
32473
|
+
import React291, { useCallback as useCallback118, useEffect as useEffect114, useState as useState141 } from "react";
|
|
32284
32474
|
import { Divider as Divider26, Stack as Stack208, Text as Text183 } from "@mantine/core";
|
|
32285
32475
|
var CalendarEventCreateConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
32286
32476
|
const [local, setLocal] = useState141(() => parseCalendarEventCreateInputs(inputs));
|
|
32287
|
-
|
|
32477
|
+
useEffect114(() => {
|
|
32288
32478
|
setLocal(parseCalendarEventCreateInputs(inputs));
|
|
32289
32479
|
}, [inputs]);
|
|
32290
32480
|
const update = useCallback118(
|
|
@@ -32401,7 +32591,7 @@ var CalendarEventCreateConfig = ({ inputs, onInputsChange, editor, blockId }) =>
|
|
|
32401
32591
|
};
|
|
32402
32592
|
|
|
32403
32593
|
// src/mantine/blocks/action/actionTypes/calendar/eventCreate/CalendarEventCreateFlowDetail.tsx
|
|
32404
|
-
import React292, { useCallback as useCallback119, useEffect as
|
|
32594
|
+
import React292, { useCallback as useCallback119, useEffect as useEffect115, useMemo as useMemo116, useState as useState142 } from "react";
|
|
32405
32595
|
import { Alert as Alert62, Anchor as Anchor2, Stack as Stack209, Text as Text184 } from "@mantine/core";
|
|
32406
32596
|
var CalendarEventCreateFlowDetail = ({
|
|
32407
32597
|
inputs,
|
|
@@ -32453,7 +32643,7 @@ var CalendarEventCreateFlowDetail = ({
|
|
|
32453
32643
|
description: resolve("description"),
|
|
32454
32644
|
calendar_id: resolve("calendar_id") || "primary"
|
|
32455
32645
|
}));
|
|
32456
|
-
|
|
32646
|
+
useEffect115(() => {
|
|
32457
32647
|
setLocal((prev) => ({
|
|
32458
32648
|
summary: prev.summary || resolve("summary"),
|
|
32459
32649
|
start_datetime: prev.start_datetime || resolve("start_datetime"),
|
|
@@ -32473,10 +32663,10 @@ var CalendarEventCreateFlowDetail = ({
|
|
|
32473
32663
|
const entityMismatch = hasConnection && entityDid && connection.entityDid && connection.entityDid !== entityDid;
|
|
32474
32664
|
const isCompleted = runtime.state === "completed";
|
|
32475
32665
|
const readyToSign = hasConnection && !entityMismatch && !!local.start_datetime.trim() && !isCompleted;
|
|
32476
|
-
|
|
32666
|
+
useEffect115(() => {
|
|
32477
32667
|
unlockSigning?.(readyToSign);
|
|
32478
32668
|
}, [unlockSigning, readyToSign]);
|
|
32479
|
-
|
|
32669
|
+
useEffect115(() => {
|
|
32480
32670
|
registerRuntimeInputs?.(local);
|
|
32481
32671
|
}, [registerRuntimeInputs, local]);
|
|
32482
32672
|
const [error, setError] = useState142(null);
|
|
@@ -32582,7 +32772,7 @@ var CalendarEventCreateFlowDetail = ({
|
|
|
32582
32772
|
ucanService,
|
|
32583
32773
|
updateRuntime
|
|
32584
32774
|
]);
|
|
32585
|
-
|
|
32775
|
+
useEffect115(() => {
|
|
32586
32776
|
if (!provideSigningHandler) return;
|
|
32587
32777
|
provideSigningHandler(execute);
|
|
32588
32778
|
}, [provideSigningHandler, execute]);
|
|
@@ -32640,7 +32830,7 @@ registerActionTypeUI("qi/calendar.event.create", {
|
|
|
32640
32830
|
});
|
|
32641
32831
|
|
|
32642
32832
|
// src/mantine/blocks/action/actionTypes/calendar/eventUpdate/CalendarEventUpdateConfig.tsx
|
|
32643
|
-
import React293, { useCallback as useCallback120, useEffect as
|
|
32833
|
+
import React293, { useCallback as useCallback120, useEffect as useEffect116, useState as useState143 } from "react";
|
|
32644
32834
|
import { Divider as Divider27, Stack as Stack210, Text as Text185 } from "@mantine/core";
|
|
32645
32835
|
|
|
32646
32836
|
// src/core/lib/actionRegistry/actions/calendar/eventUpdate.types.ts
|
|
@@ -32686,7 +32876,7 @@ function serializeCalendarEventUpdateInputs(inputs) {
|
|
|
32686
32876
|
// src/mantine/blocks/action/actionTypes/calendar/eventUpdate/CalendarEventUpdateConfig.tsx
|
|
32687
32877
|
var CalendarEventUpdateConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
32688
32878
|
const [local, setLocal] = useState143(() => parseCalendarEventUpdateInputs(inputs));
|
|
32689
|
-
|
|
32879
|
+
useEffect116(() => {
|
|
32690
32880
|
setLocal(parseCalendarEventUpdateInputs(inputs));
|
|
32691
32881
|
}, [inputs]);
|
|
32692
32882
|
const update = useCallback120(
|
|
@@ -32780,7 +32970,7 @@ var CalendarEventUpdateConfig = ({ inputs, onInputsChange, editor, blockId }) =>
|
|
|
32780
32970
|
};
|
|
32781
32971
|
|
|
32782
32972
|
// src/mantine/blocks/action/actionTypes/calendar/eventUpdate/CalendarEventUpdateFlowDetail.tsx
|
|
32783
|
-
import React294, { useCallback as useCallback121, useEffect as
|
|
32973
|
+
import React294, { useCallback as useCallback121, useEffect as useEffect117, useMemo as useMemo117, useState as useState144 } from "react";
|
|
32784
32974
|
import { Alert as Alert63, Anchor as Anchor3, Stack as Stack211, Text as Text186 } from "@mantine/core";
|
|
32785
32975
|
var CalendarEventUpdateFlowDetail = ({
|
|
32786
32976
|
inputs,
|
|
@@ -32833,7 +33023,7 @@ var CalendarEventUpdateFlowDetail = ({
|
|
|
32833
33023
|
description: resolve("description"),
|
|
32834
33024
|
calendar_id: resolve("calendar_id") || "primary"
|
|
32835
33025
|
}));
|
|
32836
|
-
|
|
33026
|
+
useEffect117(() => {
|
|
32837
33027
|
setLocal((prev) => ({
|
|
32838
33028
|
event_id: prev.event_id || resolve("event_id"),
|
|
32839
33029
|
summary: prev.summary || resolve("summary"),
|
|
@@ -32854,10 +33044,10 @@ var CalendarEventUpdateFlowDetail = ({
|
|
|
32854
33044
|
const entityMismatch = hasConnection && entityDid && connection.entityDid && connection.entityDid !== entityDid;
|
|
32855
33045
|
const isCompleted = runtime.state === "completed";
|
|
32856
33046
|
const readyToSign = hasConnection && !entityMismatch && !!local.event_id.trim() && !!local.start_datetime.trim() && !isCompleted;
|
|
32857
|
-
|
|
33047
|
+
useEffect117(() => {
|
|
32858
33048
|
unlockSigning?.(readyToSign);
|
|
32859
33049
|
}, [unlockSigning, readyToSign]);
|
|
32860
|
-
|
|
33050
|
+
useEffect117(() => {
|
|
32861
33051
|
registerRuntimeInputs?.(local);
|
|
32862
33052
|
}, [registerRuntimeInputs, local]);
|
|
32863
33053
|
const [error, setError] = useState144(null);
|
|
@@ -32964,7 +33154,7 @@ var CalendarEventUpdateFlowDetail = ({
|
|
|
32964
33154
|
ucanService,
|
|
32965
33155
|
updateRuntime
|
|
32966
33156
|
]);
|
|
32967
|
-
|
|
33157
|
+
useEffect117(() => {
|
|
32968
33158
|
if (!provideSigningHandler) return;
|
|
32969
33159
|
provideSigningHandler(execute);
|
|
32970
33160
|
}, [provideSigningHandler, execute]);
|
|
@@ -33001,7 +33191,7 @@ registerActionTypeUI("qi/calendar.event.update", {
|
|
|
33001
33191
|
});
|
|
33002
33192
|
|
|
33003
33193
|
// src/mantine/blocks/action/actionTypes/calendar/eventList/CalendarEventListConfig.tsx
|
|
33004
|
-
import React295, { useCallback as useCallback122, useEffect as
|
|
33194
|
+
import React295, { useCallback as useCallback122, useEffect as useEffect118, useState as useState145 } from "react";
|
|
33005
33195
|
import { Divider as Divider28, Group as Group112, Stack as Stack212, Switch as Switch7, Text as Text187 } from "@mantine/core";
|
|
33006
33196
|
|
|
33007
33197
|
// src/core/lib/actionRegistry/actions/calendar/eventList.types.ts
|
|
@@ -33043,7 +33233,7 @@ function serializeCalendarEventListInputs(inputs) {
|
|
|
33043
33233
|
// src/mantine/blocks/action/actionTypes/calendar/eventList/CalendarEventListConfig.tsx
|
|
33044
33234
|
var CalendarEventListConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
33045
33235
|
const [local, setLocal] = useState145(() => parseCalendarEventListInputs(inputs));
|
|
33046
|
-
|
|
33236
|
+
useEffect118(() => {
|
|
33047
33237
|
setLocal(parseCalendarEventListInputs(inputs));
|
|
33048
33238
|
}, [inputs]);
|
|
33049
33239
|
const update = useCallback122(
|
|
@@ -33264,7 +33454,7 @@ registerActionTypeUI("qi/calendar.event.list", {
|
|
|
33264
33454
|
});
|
|
33265
33455
|
|
|
33266
33456
|
// src/mantine/blocks/action/actionTypes/xero/contactCreate/XeroContactCreateConfig.tsx
|
|
33267
|
-
import React297, { useCallback as useCallback124, useEffect as
|
|
33457
|
+
import React297, { useCallback as useCallback124, useEffect as useEffect119, useState as useState147 } from "react";
|
|
33268
33458
|
import { Divider as Divider29, Group as Group113, Stack as Stack214, Switch as Switch8, Text as Text188 } from "@mantine/core";
|
|
33269
33459
|
|
|
33270
33460
|
// src/core/lib/actionRegistry/actions/xero/contactCreate.types.ts
|
|
@@ -33318,7 +33508,7 @@ function serializeXeroContactCreateInputs(inputs) {
|
|
|
33318
33508
|
// src/mantine/blocks/action/actionTypes/xero/contactCreate/XeroContactCreateConfig.tsx
|
|
33319
33509
|
var XeroContactCreateConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
33320
33510
|
const [local, setLocal] = useState147(() => parseXeroContactCreateInputs(inputs));
|
|
33321
|
-
|
|
33511
|
+
useEffect119(() => {
|
|
33322
33512
|
setLocal(parseXeroContactCreateInputs(inputs));
|
|
33323
33513
|
}, [inputs]);
|
|
33324
33514
|
const update = useCallback124(
|
|
@@ -33383,7 +33573,7 @@ var XeroContactCreateConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
33383
33573
|
};
|
|
33384
33574
|
|
|
33385
33575
|
// src/mantine/blocks/action/actionTypes/xero/contactCreate/XeroContactCreateFlowDetail.tsx
|
|
33386
|
-
import React298, { useCallback as useCallback125, useEffect as
|
|
33576
|
+
import React298, { useCallback as useCallback125, useEffect as useEffect120, useMemo as useMemo119, useState as useState148 } from "react";
|
|
33387
33577
|
import { Alert as Alert65, Stack as Stack215, Text as Text189 } from "@mantine/core";
|
|
33388
33578
|
var XeroContactCreateFlowDetail = ({
|
|
33389
33579
|
inputs,
|
|
@@ -33433,7 +33623,7 @@ var XeroContactCreateFlowDetail = ({
|
|
|
33433
33623
|
phone_number: resolve("phone_number"),
|
|
33434
33624
|
mobile_number: resolve("mobile_number")
|
|
33435
33625
|
}));
|
|
33436
|
-
|
|
33626
|
+
useEffect120(() => {
|
|
33437
33627
|
setLocal((prev) => ({
|
|
33438
33628
|
Name: prev.Name || resolve("Name"),
|
|
33439
33629
|
EmailAddress: prev.EmailAddress || resolve("EmailAddress"),
|
|
@@ -33451,10 +33641,10 @@ var XeroContactCreateFlowDetail = ({
|
|
|
33451
33641
|
const entityMismatch = hasConnection && entityDid && connection.entityDid && connection.entityDid !== entityDid;
|
|
33452
33642
|
const isCompleted = runtime.state === "completed";
|
|
33453
33643
|
const readyToSign = hasConnection && !entityMismatch && !!local.Name.trim() && !isCompleted;
|
|
33454
|
-
|
|
33644
|
+
useEffect120(() => {
|
|
33455
33645
|
unlockSigning?.(readyToSign);
|
|
33456
33646
|
}, [unlockSigning, readyToSign]);
|
|
33457
|
-
|
|
33647
|
+
useEffect120(() => {
|
|
33458
33648
|
registerRuntimeInputs?.(local);
|
|
33459
33649
|
}, [registerRuntimeInputs, local]);
|
|
33460
33650
|
const [error, setError] = useState148(null);
|
|
@@ -33565,7 +33755,7 @@ var XeroContactCreateFlowDetail = ({
|
|
|
33565
33755
|
ucanService,
|
|
33566
33756
|
updateRuntime
|
|
33567
33757
|
]);
|
|
33568
|
-
|
|
33758
|
+
useEffect120(() => {
|
|
33569
33759
|
if (!provideSigningHandler) return;
|
|
33570
33760
|
provideSigningHandler(execute);
|
|
33571
33761
|
}, [provideSigningHandler, execute]);
|
|
@@ -33580,7 +33770,7 @@ registerActionTypeUI("qi/xero.contact.create", {
|
|
|
33580
33770
|
});
|
|
33581
33771
|
|
|
33582
33772
|
// src/mantine/blocks/action/actionTypes/xero/invoiceCreate/XeroInvoiceCreateConfig.tsx
|
|
33583
|
-
import React300, { useCallback as useCallback127, useEffect as
|
|
33773
|
+
import React300, { useCallback as useCallback127, useEffect as useEffect121, useState as useState149 } from "react";
|
|
33584
33774
|
import { Divider as Divider31, Group as Group115, Stack as Stack217, Text as Text191 } from "@mantine/core";
|
|
33585
33775
|
|
|
33586
33776
|
// src/mantine/blocks/action/actionTypes/xero/invoiceCreate/XeroLineItemsEditor.tsx
|
|
@@ -33833,7 +34023,7 @@ function IterativeMapEditor({
|
|
|
33833
34023
|
// src/mantine/blocks/action/actionTypes/xero/invoiceCreate/XeroInvoiceCreateConfig.tsx
|
|
33834
34024
|
var XeroInvoiceCreateConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
33835
34025
|
const [local, setLocal] = useState149(() => parseXeroInvoiceCreateInputs(inputs));
|
|
33836
|
-
|
|
34026
|
+
useEffect121(() => {
|
|
33837
34027
|
setLocal(parseXeroInvoiceCreateInputs(inputs));
|
|
33838
34028
|
}, [inputs]);
|
|
33839
34029
|
const update = useCallback127(
|
|
@@ -33940,7 +34130,7 @@ var XeroInvoiceCreateConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
33940
34130
|
};
|
|
33941
34131
|
|
|
33942
34132
|
// src/mantine/blocks/action/actionTypes/xero/invoiceCreate/XeroInvoiceCreateFlowDetail.tsx
|
|
33943
|
-
import React301, { useCallback as useCallback128, useEffect as
|
|
34133
|
+
import React301, { useCallback as useCallback128, useEffect as useEffect122, useMemo as useMemo121, useState as useState150 } from "react";
|
|
33944
34134
|
import { Alert as Alert67, Badge as Badge54, Stack as Stack218, Text as Text192 } from "@mantine/core";
|
|
33945
34135
|
function resolveIterativeSource(source, editorDocument, opts) {
|
|
33946
34136
|
const refs = parseReferences(source || "");
|
|
@@ -34021,7 +34211,7 @@ var XeroInvoiceCreateFlowDetail = ({
|
|
|
34021
34211
|
InvoiceNumber: seedFromTemplate("InvoiceNumber"),
|
|
34022
34212
|
Reference: seedFromTemplate("Reference")
|
|
34023
34213
|
}));
|
|
34024
|
-
|
|
34214
|
+
useEffect122(() => {
|
|
34025
34215
|
setLocal((prev) => {
|
|
34026
34216
|
const next = {
|
|
34027
34217
|
ContactID: prev.ContactID || seedFromTemplate("ContactID"),
|
|
@@ -34055,10 +34245,10 @@ var XeroInvoiceCreateFlowDetail = ({
|
|
|
34055
34245
|
}, [parsed.LineItems, editor, resolveOpts]);
|
|
34056
34246
|
const hasContact = !!(local.ContactID.trim() || local.ContactName.trim());
|
|
34057
34247
|
const readyToSign = hasConnection && !entityMismatch && lineItemsValidation.ok && hasContact && !isCompleted;
|
|
34058
|
-
|
|
34248
|
+
useEffect122(() => {
|
|
34059
34249
|
unlockSigning?.(readyToSign);
|
|
34060
34250
|
}, [unlockSigning, readyToSign]);
|
|
34061
|
-
|
|
34251
|
+
useEffect122(() => {
|
|
34062
34252
|
registerRuntimeInputs?.(local);
|
|
34063
34253
|
}, [registerRuntimeInputs, local]);
|
|
34064
34254
|
const [error, setError] = useState150(null);
|
|
@@ -34175,7 +34365,7 @@ var XeroInvoiceCreateFlowDetail = ({
|
|
|
34175
34365
|
ucanService,
|
|
34176
34366
|
updateRuntime
|
|
34177
34367
|
]);
|
|
34178
|
-
|
|
34368
|
+
useEffect122(() => {
|
|
34179
34369
|
if (!provideSigningHandler) return;
|
|
34180
34370
|
provideSigningHandler(execute);
|
|
34181
34371
|
}, [provideSigningHandler, execute]);
|
|
@@ -34199,7 +34389,7 @@ registerActionTypeUI("qi/xero.invoice.create", {
|
|
|
34199
34389
|
});
|
|
34200
34390
|
|
|
34201
34391
|
// src/mantine/blocks/action/actionTypes/xero/invoiceList/XeroInvoiceListConfig.tsx
|
|
34202
|
-
import React302, { useCallback as useCallback129, useEffect as
|
|
34392
|
+
import React302, { useCallback as useCallback129, useEffect as useEffect123, useState as useState151 } from "react";
|
|
34203
34393
|
import { Divider as Divider32, Group as Group116, Stack as Stack219, Switch as Switch9, Text as Text193 } from "@mantine/core";
|
|
34204
34394
|
|
|
34205
34395
|
// src/core/lib/actionRegistry/actions/xero/invoiceList.types.ts
|
|
@@ -34243,7 +34433,7 @@ function serializeXeroInvoiceListInputs(inputs) {
|
|
|
34243
34433
|
// src/mantine/blocks/action/actionTypes/xero/invoiceList/XeroInvoiceListConfig.tsx
|
|
34244
34434
|
var XeroInvoiceListConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
34245
34435
|
const [local, setLocal] = useState151(() => parseXeroInvoiceListInputs(inputs));
|
|
34246
|
-
|
|
34436
|
+
useEffect123(() => {
|
|
34247
34437
|
setLocal(parseXeroInvoiceListInputs(inputs));
|
|
34248
34438
|
}, [inputs]);
|
|
34249
34439
|
const update = useCallback129(
|
|
@@ -34465,11 +34655,11 @@ registerActionTypeUI("qi/xero.invoice.list", {
|
|
|
34465
34655
|
});
|
|
34466
34656
|
|
|
34467
34657
|
// src/mantine/blocks/action/actionTypes/xero/paymentCreate/XeroPaymentCreateConfig.tsx
|
|
34468
|
-
import React304, { useCallback as useCallback131, useEffect as
|
|
34658
|
+
import React304, { useCallback as useCallback131, useEffect as useEffect124, useState as useState153 } from "react";
|
|
34469
34659
|
import { Divider as Divider33, Group as Group117, Stack as Stack221, Text as Text194 } from "@mantine/core";
|
|
34470
34660
|
var XeroPaymentCreateConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
34471
34661
|
const [local, setLocal] = useState153(() => parseXeroPaymentCreateInputs(inputs));
|
|
34472
|
-
|
|
34662
|
+
useEffect124(() => {
|
|
34473
34663
|
setLocal(parseXeroPaymentCreateInputs(inputs));
|
|
34474
34664
|
}, [inputs]);
|
|
34475
34665
|
const update = useCallback131(
|
|
@@ -34560,7 +34750,7 @@ var XeroPaymentCreateConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
34560
34750
|
};
|
|
34561
34751
|
|
|
34562
34752
|
// src/mantine/blocks/action/actionTypes/xero/paymentCreate/XeroPaymentCreateFlowDetail.tsx
|
|
34563
|
-
import React305, { useCallback as useCallback132, useEffect as
|
|
34753
|
+
import React305, { useCallback as useCallback132, useEffect as useEffect125, useMemo as useMemo123, useState as useState154 } from "react";
|
|
34564
34754
|
import { Alert as Alert69, Stack as Stack222, Text as Text195 } from "@mantine/core";
|
|
34565
34755
|
var XeroPaymentCreateFlowDetail = ({
|
|
34566
34756
|
inputs,
|
|
@@ -34610,7 +34800,7 @@ var XeroPaymentCreateFlowDetail = ({
|
|
|
34610
34800
|
Date: seedFromTemplate("Date"),
|
|
34611
34801
|
Reference: seedFromTemplate("Reference")
|
|
34612
34802
|
}));
|
|
34613
|
-
|
|
34803
|
+
useEffect125(() => {
|
|
34614
34804
|
setLocal((prev) => {
|
|
34615
34805
|
const next = {
|
|
34616
34806
|
InvoiceID: prev.InvoiceID || seedFromTemplate("InvoiceID"),
|
|
@@ -34639,10 +34829,10 @@ var XeroPaymentCreateFlowDetail = ({
|
|
|
34639
34829
|
}, [local.Amount]);
|
|
34640
34830
|
const amountValid = Number.isFinite(amountNumber) && amountNumber > 0;
|
|
34641
34831
|
const readyToSign = hasConnection && !entityMismatch && !!local.InvoiceID.trim() && !!local.AccountID.trim() && amountValid && !isCompleted;
|
|
34642
|
-
|
|
34832
|
+
useEffect125(() => {
|
|
34643
34833
|
unlockSigning?.(readyToSign);
|
|
34644
34834
|
}, [unlockSigning, readyToSign]);
|
|
34645
|
-
|
|
34835
|
+
useEffect125(() => {
|
|
34646
34836
|
registerRuntimeInputs?.(local);
|
|
34647
34837
|
}, [registerRuntimeInputs, local]);
|
|
34648
34838
|
const [error, setError] = useState154(null);
|
|
@@ -34756,7 +34946,7 @@ var XeroPaymentCreateFlowDetail = ({
|
|
|
34756
34946
|
ucanService,
|
|
34757
34947
|
updateRuntime
|
|
34758
34948
|
]);
|
|
34759
|
-
|
|
34949
|
+
useEffect125(() => {
|
|
34760
34950
|
if (!provideSigningHandler) return;
|
|
34761
34951
|
provideSigningHandler(execute);
|
|
34762
34952
|
}, [provideSigningHandler, execute]);
|
|
@@ -34899,7 +35089,7 @@ registerActionTypeUI("qi/wallet.generate", {
|
|
|
34899
35089
|
});
|
|
34900
35090
|
|
|
34901
35091
|
// src/mantine/blocks/action/actionTypes/walletFund/WalletFundConfig.tsx
|
|
34902
|
-
import React308, { useCallback as useCallback134, useEffect as
|
|
35092
|
+
import React308, { useCallback as useCallback134, useEffect as useEffect126, useState as useState155 } from "react";
|
|
34903
35093
|
import { Stack as Stack225, Text as Text198, NumberInput as NumberInput5 } from "@mantine/core";
|
|
34904
35094
|
|
|
34905
35095
|
// src/mantine/blocks/action/actionTypes/walletFund/types.ts
|
|
@@ -34925,7 +35115,7 @@ function serializeWalletFundInputs(inputs) {
|
|
|
34925
35115
|
// src/mantine/blocks/action/actionTypes/walletFund/WalletFundConfig.tsx
|
|
34926
35116
|
var WalletFundConfig = ({ inputs, onInputsChange }) => {
|
|
34927
35117
|
const [local, setLocal] = useState155(() => parseWalletFundInputs(inputs));
|
|
34928
|
-
|
|
35118
|
+
useEffect126(() => {
|
|
34929
35119
|
setLocal(parseWalletFundInputs(inputs));
|
|
34930
35120
|
}, [inputs]);
|
|
34931
35121
|
const update = useCallback134(
|
|
@@ -34940,7 +35130,7 @@ var WalletFundConfig = ({ inputs, onInputsChange }) => {
|
|
|
34940
35130
|
};
|
|
34941
35131
|
|
|
34942
35132
|
// src/mantine/blocks/action/actionTypes/walletFund/WalletFundFlowDetail.tsx
|
|
34943
|
-
import React309, { useCallback as useCallback135, useEffect as
|
|
35133
|
+
import React309, { useCallback as useCallback135, useEffect as useEffect127, useMemo as useMemo125 } from "react";
|
|
34944
35134
|
import { Alert as Alert71, Group as Group119, Loader as Loader64, Stack as Stack226, Text as Text199 } from "@mantine/core";
|
|
34945
35135
|
import { IconCheck as IconCheck27, IconAlertCircle as IconAlertCircle25 } from "@tabler/icons-react";
|
|
34946
35136
|
var WalletFundFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isDisabled, provideSigningHandler, unlockSigning }) => {
|
|
@@ -35047,10 +35237,10 @@ var WalletFundFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isD
|
|
|
35047
35237
|
updateRuntime,
|
|
35048
35238
|
schemaVersion
|
|
35049
35239
|
]);
|
|
35050
|
-
|
|
35240
|
+
useEffect127(() => {
|
|
35051
35241
|
provideSigningHandler?.(handleExecute);
|
|
35052
35242
|
}, [provideSigningHandler, handleExecute]);
|
|
35053
|
-
|
|
35243
|
+
useEffect127(() => {
|
|
35054
35244
|
unlockSigning?.(!!resolvedAddress && !isCompleted && !isRunning);
|
|
35055
35245
|
}, [unlockSigning, resolvedAddress, isCompleted, isRunning]);
|
|
35056
35246
|
const handleRetry = useCallback135(() => {
|
|
@@ -35187,7 +35377,7 @@ registerActionTypeUI("qi/wallet.generateAndFund", {
|
|
|
35187
35377
|
});
|
|
35188
35378
|
|
|
35189
35379
|
// src/mantine/blocks/action/actionTypes/iidCreate/IidCreateConfig.tsx
|
|
35190
|
-
import React312, { useCallback as useCallback137, useEffect as
|
|
35380
|
+
import React312, { useCallback as useCallback137, useEffect as useEffect128, useState as useState156 } from "react";
|
|
35191
35381
|
import { Stack as Stack229, Text as Text202 } from "@mantine/core";
|
|
35192
35382
|
|
|
35193
35383
|
// src/mantine/blocks/action/actionTypes/iidCreate/types.ts
|
|
@@ -35216,7 +35406,7 @@ function serializeIidCreateInputs(inputs) {
|
|
|
35216
35406
|
// src/mantine/blocks/action/actionTypes/iidCreate/IidCreateConfig.tsx
|
|
35217
35407
|
var IidCreateConfig = ({ inputs, onInputsChange }) => {
|
|
35218
35408
|
const [local, setLocal] = useState156(() => parseIidCreateInputs(inputs));
|
|
35219
|
-
|
|
35409
|
+
useEffect128(() => {
|
|
35220
35410
|
setLocal(parseIidCreateInputs(inputs));
|
|
35221
35411
|
}, [inputs]);
|
|
35222
35412
|
const update = useCallback137(
|
|
@@ -35434,7 +35624,7 @@ registerActionTypeUI("qi/iid.create", {
|
|
|
35434
35624
|
});
|
|
35435
35625
|
|
|
35436
35626
|
// src/mantine/blocks/action/actionTypes/matrixRegister/MatrixRegisterConfig.tsx
|
|
35437
|
-
import React314, { useCallback as useCallback139, useEffect as
|
|
35627
|
+
import React314, { useCallback as useCallback139, useEffect as useEffect129, useState as useState157 } from "react";
|
|
35438
35628
|
import { Stack as Stack231, Text as Text204 } from "@mantine/core";
|
|
35439
35629
|
|
|
35440
35630
|
// src/mantine/blocks/action/actionTypes/matrixRegister/types.ts
|
|
@@ -35467,7 +35657,7 @@ function serializeMatrixRegisterInputs(inputs) {
|
|
|
35467
35657
|
// src/mantine/blocks/action/actionTypes/matrixRegister/MatrixRegisterConfig.tsx
|
|
35468
35658
|
var MatrixRegisterConfig = ({ inputs, onInputsChange }) => {
|
|
35469
35659
|
const [local, setLocal] = useState157(() => parseMatrixRegisterInputs(inputs));
|
|
35470
|
-
|
|
35660
|
+
useEffect129(() => {
|
|
35471
35661
|
setLocal(parseMatrixRegisterInputs(inputs));
|
|
35472
35662
|
}, [inputs]);
|
|
35473
35663
|
const update = useCallback139(
|
|
@@ -35645,7 +35835,7 @@ registerActionTypeUI("qi/matrix.register", {
|
|
|
35645
35835
|
});
|
|
35646
35836
|
|
|
35647
35837
|
// src/mantine/blocks/action/actionTypes/identityCreate/IdentityCreateConfig.tsx
|
|
35648
|
-
import React316, { useCallback as useCallback141, useEffect as
|
|
35838
|
+
import React316, { useCallback as useCallback141, useEffect as useEffect130, useState as useState158 } from "react";
|
|
35649
35839
|
import { Stack as Stack233, Text as Text206 } from "@mantine/core";
|
|
35650
35840
|
|
|
35651
35841
|
// src/mantine/blocks/action/actionTypes/identityCreate/types.ts
|
|
@@ -35677,7 +35867,7 @@ function serializeIdentityCreateInputs(inputs) {
|
|
|
35677
35867
|
// src/mantine/blocks/action/actionTypes/identityCreate/IdentityCreateConfig.tsx
|
|
35678
35868
|
var IdentityCreateConfig = ({ inputs, onInputsChange }) => {
|
|
35679
35869
|
const [local, setLocal] = useState158(() => parseIdentityCreateInputs(inputs));
|
|
35680
|
-
|
|
35870
|
+
useEffect130(() => {
|
|
35681
35871
|
setLocal(parseIdentityCreateInputs(inputs));
|
|
35682
35872
|
}, [inputs]);
|
|
35683
35873
|
const update = useCallback141(
|
|
@@ -35931,7 +36121,7 @@ registerActionTypeUI("qi/identity.create", {
|
|
|
35931
36121
|
});
|
|
35932
36122
|
|
|
35933
36123
|
// src/mantine/blocks/action/actionTypes/entityCreateOracle/EntityCreateOracleConfig.tsx
|
|
35934
|
-
import React318, { useCallback as useCallback143, useEffect as
|
|
36124
|
+
import React318, { useCallback as useCallback143, useEffect as useEffect131, useState as useState159 } from "react";
|
|
35935
36125
|
import { Divider as Divider34, Stack as Stack235, Text as Text208 } from "@mantine/core";
|
|
35936
36126
|
|
|
35937
36127
|
// src/mantine/blocks/action/actionTypes/entityCreateOracle/types.ts
|
|
@@ -35996,7 +36186,7 @@ function serializeEntityCreateOracleInputs(inputs) {
|
|
|
35996
36186
|
// src/mantine/blocks/action/actionTypes/entityCreateOracle/EntityCreateOracleConfig.tsx
|
|
35997
36187
|
var EntityCreateOracleConfig = ({ inputs, onInputsChange }) => {
|
|
35998
36188
|
const [local, setLocal] = useState159(() => parseEntityCreateOracleInputs(inputs));
|
|
35999
|
-
|
|
36189
|
+
useEffect131(() => {
|
|
36000
36190
|
setLocal(parseEntityCreateOracleInputs(inputs));
|
|
36001
36191
|
}, [inputs]);
|
|
36002
36192
|
const update = useCallback143(
|
|
@@ -36296,7 +36486,7 @@ registerActionTypeUI("qi/entity.createOracle", {
|
|
|
36296
36486
|
});
|
|
36297
36487
|
|
|
36298
36488
|
// src/mantine/blocks/action/actionTypes/sandboxProvision/SandboxProvisionConfig.tsx
|
|
36299
|
-
import React320, { useCallback as useCallback145, useEffect as
|
|
36489
|
+
import React320, { useCallback as useCallback145, useEffect as useEffect132, useState as useState160 } from "react";
|
|
36300
36490
|
import { Stack as Stack237, Text as Text210 } from "@mantine/core";
|
|
36301
36491
|
|
|
36302
36492
|
// src/mantine/blocks/action/actionTypes/sandboxProvision/types.ts
|
|
@@ -36321,7 +36511,7 @@ function serializeSandboxProvisionInputs(inputs) {
|
|
|
36321
36511
|
// src/mantine/blocks/action/actionTypes/sandboxProvision/SandboxProvisionConfig.tsx
|
|
36322
36512
|
var SandboxProvisionConfig = ({ inputs, onInputsChange }) => {
|
|
36323
36513
|
const [local, setLocal] = useState160(() => parseSandboxProvisionInputs(inputs));
|
|
36324
|
-
|
|
36514
|
+
useEffect132(() => {
|
|
36325
36515
|
setLocal(parseSandboxProvisionInputs(inputs));
|
|
36326
36516
|
}, [inputs]);
|
|
36327
36517
|
const update = useCallback145(
|
|
@@ -36468,7 +36658,7 @@ registerActionTypeUI("qi/sandbox.provision", {
|
|
|
36468
36658
|
});
|
|
36469
36659
|
|
|
36470
36660
|
// src/mantine/blocks/action/actionTypes/oracleContract/OracleContractConfig.tsx
|
|
36471
|
-
import React322, { useCallback as useCallback147, useEffect as
|
|
36661
|
+
import React322, { useCallback as useCallback147, useEffect as useEffect133, useState as useState161 } from "react";
|
|
36472
36662
|
import { Stack as Stack239, Text as Text212 } from "@mantine/core";
|
|
36473
36663
|
|
|
36474
36664
|
// src/mantine/blocks/action/actionTypes/oracleContract/types.ts
|
|
@@ -36491,7 +36681,7 @@ function serializeOracleContractInputs(inputs) {
|
|
|
36491
36681
|
// src/mantine/blocks/action/actionTypes/oracleContract/OracleContractConfig.tsx
|
|
36492
36682
|
var OracleContractConfig = ({ inputs, onInputsChange }) => {
|
|
36493
36683
|
const [local, setLocal] = useState161(() => parseOracleContractInputs(inputs));
|
|
36494
|
-
|
|
36684
|
+
useEffect133(() => {
|
|
36495
36685
|
setLocal(parseOracleContractInputs(inputs));
|
|
36496
36686
|
}, [inputs]);
|
|
36497
36687
|
const update = useCallback147(
|
|
@@ -36628,7 +36818,7 @@ registerActionTypeUI("qi/oracle.contract", {
|
|
|
36628
36818
|
});
|
|
36629
36819
|
|
|
36630
36820
|
// src/mantine/blocks/action/actionTypes/oracleStoreSecrets/OracleStoreSecretsConfig.tsx
|
|
36631
|
-
import React324, { useCallback as useCallback149, useEffect as
|
|
36821
|
+
import React324, { useCallback as useCallback149, useEffect as useEffect134, useState as useState162 } from "react";
|
|
36632
36822
|
import { Divider as Divider35, Stack as Stack241, Text as Text214 } from "@mantine/core";
|
|
36633
36823
|
|
|
36634
36824
|
// src/mantine/blocks/action/actionTypes/oracleStoreSecrets/types.ts
|
|
@@ -36677,7 +36867,7 @@ function serializeOracleStoreSecretsInputs(inputs) {
|
|
|
36677
36867
|
// src/mantine/blocks/action/actionTypes/oracleStoreSecrets/OracleStoreSecretsConfig.tsx
|
|
36678
36868
|
var OracleStoreSecretsConfig = ({ inputs, onInputsChange }) => {
|
|
36679
36869
|
const [local, setLocal] = useState162(() => parseOracleStoreSecretsInputs(inputs));
|
|
36680
|
-
|
|
36870
|
+
useEffect134(() => {
|
|
36681
36871
|
setLocal(parseOracleStoreSecretsInputs(inputs));
|
|
36682
36872
|
}, [inputs]);
|
|
36683
36873
|
const update = useCallback149(
|
|
@@ -36812,7 +37002,7 @@ var OracleStoreSecretsConfig = ({ inputs, onInputsChange }) => {
|
|
|
36812
37002
|
};
|
|
36813
37003
|
|
|
36814
37004
|
// src/mantine/blocks/action/actionTypes/oracleStoreSecrets/OracleStoreSecretsFlowDetail.tsx
|
|
36815
|
-
import React325, { useCallback as useCallback150, useEffect as
|
|
37005
|
+
import React325, { useCallback as useCallback150, useEffect as useEffect135, useMemo as useMemo133, useRef as useRef33, useState as useState163 } from "react";
|
|
36816
37006
|
import { Alert as Alert79, Button as Button74, Collapse as Collapse11, Divider as Divider36, Group as Group127, Loader as Loader72, Stack as Stack242, Text as Text215 } from "@mantine/core";
|
|
36817
37007
|
import { IconAlertCircle as IconAlertCircle33, IconCheck as IconCheck35, IconChevronDown as IconChevronDown11, IconChevronUp as IconChevronUp5, IconLock as IconLock2 } from "@tabler/icons-react";
|
|
36818
37008
|
var EXPECTED_SECRETS = ["SECP_MNEMONIC", "MATRIX_ORACLE_ADMIN_PASSWORD", "MATRIX_ORACLE_ADMIN_ACCESS_TOKEN", "MATRIX_RECOVERY_PHRASE", "MATRIX_VALUE_PIN", "OPEN_ROUTER_API_KEY"];
|
|
@@ -37008,7 +37198,7 @@ var OracleStoreSecretsFlowDetail = ({ inputs, editor, block, runtime, updateRunt
|
|
|
37008
37198
|
missingFields
|
|
37009
37199
|
]);
|
|
37010
37200
|
const idempotencyCheckRef = useRef33(false);
|
|
37011
|
-
|
|
37201
|
+
useEffect135(() => {
|
|
37012
37202
|
if (idempotencyCheckRef.current) return;
|
|
37013
37203
|
if (!inputsReady) return;
|
|
37014
37204
|
if (runtime.state === "completed") return;
|
|
@@ -37041,7 +37231,7 @@ var OracleStoreSecretsFlowDetail = ({ inputs, editor, block, runtime, updateRunt
|
|
|
37041
37231
|
}
|
|
37042
37232
|
})();
|
|
37043
37233
|
}, [inputsReady, runtime.state, isDisabled, services, resolvedInputs.matrixRoomId, updateRuntime]);
|
|
37044
|
-
|
|
37234
|
+
useEffect135(() => {
|
|
37045
37235
|
if (constantsFetchRef.current) return;
|
|
37046
37236
|
if (!inputsReady) return;
|
|
37047
37237
|
if (!resolvedInputs.oracleName) return;
|
|
@@ -37093,7 +37283,7 @@ registerActionTypeUI("qi/oracle.storeSecrets", {
|
|
|
37093
37283
|
});
|
|
37094
37284
|
|
|
37095
37285
|
// src/mantine/blocks/action/actionTypes/oracleStoreConfig/OracleStoreConfigConfig.tsx
|
|
37096
|
-
import React326, { useCallback as useCallback151, useEffect as
|
|
37286
|
+
import React326, { useCallback as useCallback151, useEffect as useEffect136, useState as useState164 } from "react";
|
|
37097
37287
|
import { Divider as Divider37, Stack as Stack243, Text as Text216 } from "@mantine/core";
|
|
37098
37288
|
|
|
37099
37289
|
// src/mantine/blocks/action/actionTypes/oracleStoreConfig/types.ts
|
|
@@ -37164,7 +37354,7 @@ function serializeOracleStoreConfigInputs(inputs) {
|
|
|
37164
37354
|
// src/mantine/blocks/action/actionTypes/oracleStoreConfig/OracleStoreConfigConfig.tsx
|
|
37165
37355
|
var OracleStoreConfigConfig = ({ inputs, onInputsChange }) => {
|
|
37166
37356
|
const [local, setLocal] = useState164(() => parseOracleStoreConfigInputs(inputs));
|
|
37167
|
-
|
|
37357
|
+
useEffect136(() => {
|
|
37168
37358
|
setLocal(parseOracleStoreConfigInputs(inputs));
|
|
37169
37359
|
}, [inputs]);
|
|
37170
37360
|
const update = useCallback151(
|
|
@@ -37427,7 +37617,7 @@ registerActionTypeUI("qi/oracle.storeConfig", {
|
|
|
37427
37617
|
});
|
|
37428
37618
|
|
|
37429
37619
|
// src/mantine/blocks/action/actionTypes/oracleStoreSecretsAndConfig/OracleStoreSecretsAndConfigConfig.tsx
|
|
37430
|
-
import React328, { useCallback as useCallback153, useEffect as
|
|
37620
|
+
import React328, { useCallback as useCallback153, useEffect as useEffect137, useState as useState165 } from "react";
|
|
37431
37621
|
import { Divider as Divider38, Stack as Stack245, Text as Text218 } from "@mantine/core";
|
|
37432
37622
|
|
|
37433
37623
|
// src/mantine/blocks/action/actionTypes/oracleStoreSecretsAndConfig/types.ts
|
|
@@ -37503,7 +37693,7 @@ function serializeOracleStoreSecretsAndConfigInputs(inputs) {
|
|
|
37503
37693
|
// src/mantine/blocks/action/actionTypes/oracleStoreSecretsAndConfig/OracleStoreSecretsAndConfigConfig.tsx
|
|
37504
37694
|
var OracleStoreSecretsAndConfigConfig = ({ inputs, onInputsChange }) => {
|
|
37505
37695
|
const [local, setLocal] = useState165(() => parseOracleStoreSecretsAndConfigInputs(inputs));
|
|
37506
|
-
|
|
37696
|
+
useEffect137(() => {
|
|
37507
37697
|
setLocal(parseOracleStoreSecretsAndConfigInputs(inputs));
|
|
37508
37698
|
}, [inputs]);
|
|
37509
37699
|
const update = useCallback153(
|
|
@@ -37686,7 +37876,7 @@ var OracleStoreSecretsAndConfigConfig = ({ inputs, onInputsChange }) => {
|
|
|
37686
37876
|
};
|
|
37687
37877
|
|
|
37688
37878
|
// src/mantine/blocks/action/actionTypes/oracleStoreSecretsAndConfig/OracleStoreSecretsAndConfigFlowDetail.tsx
|
|
37689
|
-
import React329, { useCallback as useCallback154, useEffect as
|
|
37879
|
+
import React329, { useCallback as useCallback154, useEffect as useEffect138, useMemo as useMemo135, useRef as useRef34, useState as useState166 } from "react";
|
|
37690
37880
|
import { Alert as Alert81, Button as Button76, Collapse as Collapse12, Divider as Divider39, Group as Group129, Loader as Loader74, Stack as Stack246, Text as Text219 } from "@mantine/core";
|
|
37691
37881
|
import { IconAlertCircle as IconAlertCircle35, IconCheck as IconCheck37, IconChevronDown as IconChevronDown12, IconChevronUp as IconChevronUp6, IconLock as IconLock3 } from "@tabler/icons-react";
|
|
37692
37882
|
var EXPECTED_SECRETS2 = ["SECP_MNEMONIC", "MATRIX_ORACLE_ADMIN_PASSWORD", "MATRIX_ORACLE_ADMIN_ACCESS_TOKEN", "MATRIX_RECOVERY_PHRASE", "MATRIX_VALUE_PIN", "OPEN_ROUTER_API_KEY"];
|
|
@@ -37894,7 +38084,7 @@ var OracleStoreSecretsAndConfigFlowDetail = ({ inputs, editor, block, runtime, u
|
|
|
37894
38084
|
missingFields
|
|
37895
38085
|
]);
|
|
37896
38086
|
const idempotencyCheckRef = useRef34(false);
|
|
37897
|
-
|
|
38087
|
+
useEffect138(() => {
|
|
37898
38088
|
if (idempotencyCheckRef.current) return;
|
|
37899
38089
|
if (!inputsReady) return;
|
|
37900
38090
|
if (runtime.state === "completed") return;
|
|
@@ -37925,7 +38115,7 @@ var OracleStoreSecretsAndConfigFlowDetail = ({ inputs, editor, block, runtime, u
|
|
|
37925
38115
|
}
|
|
37926
38116
|
})();
|
|
37927
38117
|
}, [inputsReady, runtime.state, isDisabled, services, resolvedInputs.matrixRoomId, updateRuntime]);
|
|
37928
|
-
|
|
38118
|
+
useEffect138(() => {
|
|
37929
38119
|
if (constantsFetchRef.current) return;
|
|
37930
38120
|
if (!inputsReady) return;
|
|
37931
38121
|
if (!resolvedInputs.oracleName) return;
|
|
@@ -37973,7 +38163,7 @@ registerActionTypeUI("qi/oracle.storeSecretsAndConfig", {
|
|
|
37973
38163
|
});
|
|
37974
38164
|
|
|
37975
38165
|
// src/mantine/blocks/action/actionTypes/oracleConfigureOracle/OracleConfigureOracleConfig.tsx
|
|
37976
|
-
import React330, { useCallback as useCallback155, useEffect as
|
|
38166
|
+
import React330, { useCallback as useCallback155, useEffect as useEffect139, useState as useState167 } from "react";
|
|
37977
38167
|
import { Divider as Divider40, Stack as Stack247, Text as Text220 } from "@mantine/core";
|
|
37978
38168
|
|
|
37979
38169
|
// src/mantine/blocks/action/actionTypes/oracleConfigureOracle/types.ts
|
|
@@ -38050,7 +38240,7 @@ function serializeOracleConfigureOracleInputs(inputs) {
|
|
|
38050
38240
|
// src/mantine/blocks/action/actionTypes/oracleConfigureOracle/OracleConfigureOracleConfig.tsx
|
|
38051
38241
|
var OracleConfigureOracleConfig = ({ inputs, onInputsChange }) => {
|
|
38052
38242
|
const [local, setLocal] = useState167(() => parseOracleConfigureOracleInputs(inputs));
|
|
38053
|
-
|
|
38243
|
+
useEffect139(() => {
|
|
38054
38244
|
setLocal(parseOracleConfigureOracleInputs(inputs));
|
|
38055
38245
|
}, [inputs]);
|
|
38056
38246
|
const update = useCallback155(
|
|
@@ -38233,7 +38423,7 @@ var OracleConfigureOracleConfig = ({ inputs, onInputsChange }) => {
|
|
|
38233
38423
|
};
|
|
38234
38424
|
|
|
38235
38425
|
// src/mantine/blocks/action/actionTypes/oracleConfigureOracle/OracleConfigureOracleFlowDetail.tsx
|
|
38236
|
-
import React331, { useCallback as useCallback156, useEffect as
|
|
38426
|
+
import React331, { useCallback as useCallback156, useEffect as useEffect140, useMemo as useMemo136, useRef as useRef35, useState as useState168 } from "react";
|
|
38237
38427
|
import { Alert as Alert82, Button as Button77, Collapse as Collapse13, Divider as Divider41, Group as Group130, Loader as Loader75, Stack as Stack248, Text as Text221 } from "@mantine/core";
|
|
38238
38428
|
import { IconAlertCircle as IconAlertCircle36, IconCheck as IconCheck38, IconChevronDown as IconChevronDown13, IconChevronUp as IconChevronUp7, IconLock as IconLock4 } from "@tabler/icons-react";
|
|
38239
38429
|
var EXPECTED_SECRETS3 = ["SECP_MNEMONIC", "MATRIX_ORACLE_ADMIN_PASSWORD", "MATRIX_ORACLE_ADMIN_ACCESS_TOKEN", "MATRIX_RECOVERY_PHRASE", "MATRIX_VALUE_PIN", "OPEN_ROUTER_API_KEY"];
|
|
@@ -38462,7 +38652,7 @@ var OracleConfigureOracleFlowDetail = ({ inputs, editor, block, runtime, updateR
|
|
|
38462
38652
|
missingFields
|
|
38463
38653
|
]);
|
|
38464
38654
|
const idempotencyCheckRef = useRef35(false);
|
|
38465
|
-
|
|
38655
|
+
useEffect140(() => {
|
|
38466
38656
|
if (idempotencyCheckRef.current) return;
|
|
38467
38657
|
if (!inputsReady) return;
|
|
38468
38658
|
if (runtime.state === "completed") return;
|
|
@@ -38494,7 +38684,7 @@ var OracleConfigureOracleFlowDetail = ({ inputs, editor, block, runtime, updateR
|
|
|
38494
38684
|
}
|
|
38495
38685
|
})();
|
|
38496
38686
|
}, [inputsReady, runtime.state, runtime.output?.userOracleRoomId, isDisabled, services, updateRuntime]);
|
|
38497
|
-
|
|
38687
|
+
useEffect140(() => {
|
|
38498
38688
|
if (constantsFetchRef.current) return;
|
|
38499
38689
|
if (!inputsReady) return;
|
|
38500
38690
|
if (!resolvedInputs.oracleName) return;
|
|
@@ -39166,6 +39356,7 @@ registerActionTypeUI("qi/oracle.deploy", {
|
|
|
39166
39356
|
// src/mantine/blocks/action/ActionBlock.tsx
|
|
39167
39357
|
function ActionBlock({ editor, block }) {
|
|
39168
39358
|
const { docType } = useBlocknoteContext();
|
|
39359
|
+
const t = useTranslate();
|
|
39169
39360
|
const { actions } = useBlockConditions(block, editor);
|
|
39170
39361
|
if (docType === "template") {
|
|
39171
39362
|
return /* @__PURE__ */ React338.createElement(ActionTemplateView, { editor, block });
|
|
@@ -39186,7 +39377,7 @@ function ActionBlock({ editor, block }) {
|
|
|
39186
39377
|
editor,
|
|
39187
39378
|
isDisabled: shouldDisable ? {
|
|
39188
39379
|
isDisabled: "disable",
|
|
39189
|
-
message: "This action is currently disabled by conditions"
|
|
39380
|
+
message: t("actionBlock.disabledByConditions", { defaultValue: "This action is currently disabled by conditions" })
|
|
39190
39381
|
} : void 0
|
|
39191
39382
|
}
|
|
39192
39383
|
);
|
|
@@ -39280,14 +39471,14 @@ import React342, { useCallback as useCallback161 } from "react";
|
|
|
39280
39471
|
import { IconSettings as IconSettings19 } from "@tabler/icons-react";
|
|
39281
39472
|
|
|
39282
39473
|
// src/mantine/blocks/location/template/GeneralTab.tsx
|
|
39283
|
-
import React341, { useEffect as
|
|
39474
|
+
import React341, { useEffect as useEffect142, useRef as useRef36, useState as useState171 } from "react";
|
|
39284
39475
|
import { Box as Box63, Divider as Divider42, Stack as Stack255, Text as Text228 } from "@mantine/core";
|
|
39285
39476
|
|
|
39286
39477
|
// src/core/hooks/useUnlMap.ts
|
|
39287
|
-
import { useEffect as
|
|
39478
|
+
import { useEffect as useEffect141, useState as useState169 } from "react";
|
|
39288
39479
|
function useUnlMap() {
|
|
39289
39480
|
const [status, setStatus] = useState169("loading");
|
|
39290
|
-
|
|
39481
|
+
useEffect141(() => {
|
|
39291
39482
|
if (typeof window === "undefined") {
|
|
39292
39483
|
return;
|
|
39293
39484
|
}
|
|
@@ -39461,13 +39652,13 @@ var GeneralTab17 = ({ title, description, latitude, longitude, onTitleChange, on
|
|
|
39461
39652
|
const mapRef = useRef36(null);
|
|
39462
39653
|
const wrapperRef = useRef36(null);
|
|
39463
39654
|
const containerRef = useRef36(null);
|
|
39464
|
-
|
|
39655
|
+
useEffect142(() => {
|
|
39465
39656
|
setLocalTitle(title);
|
|
39466
39657
|
}, [title]);
|
|
39467
|
-
|
|
39658
|
+
useEffect142(() => {
|
|
39468
39659
|
setLocalDescription(description);
|
|
39469
39660
|
}, [description]);
|
|
39470
|
-
|
|
39661
|
+
useEffect142(() => {
|
|
39471
39662
|
if (status !== "ready" || !UnlSdk || mapRef.current || !mapConfig || !containerRef.current || !wrapperRef.current) return;
|
|
39472
39663
|
try {
|
|
39473
39664
|
const hasCoords = latitude && longitude;
|
|
@@ -39593,7 +39784,7 @@ var TemplateConfig17 = ({ editor, block }) => {
|
|
|
39593
39784
|
};
|
|
39594
39785
|
|
|
39595
39786
|
// src/mantine/blocks/location/components/LocationMap.tsx
|
|
39596
|
-
import React343, { useEffect as
|
|
39787
|
+
import React343, { useEffect as useEffect143, useRef as useRef37, useState as useState172 } from "react";
|
|
39597
39788
|
import { Box as Box64, Flex as Flex36, Loader as Loader79, Text as Text229 } from "@mantine/core";
|
|
39598
39789
|
var UnlMap = ({ w = "100%", h = 200, latitude, longitude, zoom = 5, showMarker = true, showTilesControl = false }) => {
|
|
39599
39790
|
const [mapError, setMapError] = useState172(null);
|
|
@@ -39603,7 +39794,7 @@ var UnlMap = ({ w = "100%", h = 200, latitude, longitude, zoom = 5, showMarker =
|
|
|
39603
39794
|
const mapRef = useRef37(null);
|
|
39604
39795
|
const markerRef = useRef37(null);
|
|
39605
39796
|
const { status, UnlSdk } = useUnlMap();
|
|
39606
|
-
|
|
39797
|
+
useEffect143(() => {
|
|
39607
39798
|
if (status !== "ready" || !UnlSdk || mapRef.current || !containerRef.current || !wrapperRef.current) return;
|
|
39608
39799
|
let ro;
|
|
39609
39800
|
let resizeTimer;
|
|
@@ -39634,7 +39825,7 @@ var UnlMap = ({ w = "100%", h = 200, latitude, longitude, zoom = 5, showMarker =
|
|
|
39634
39825
|
ro?.disconnect();
|
|
39635
39826
|
};
|
|
39636
39827
|
}, [status, UnlSdk, mapConfig]);
|
|
39637
|
-
|
|
39828
|
+
useEffect143(() => {
|
|
39638
39829
|
if (!mapRef.current || !latitude || !longitude) return;
|
|
39639
39830
|
const coords = [Number(longitude), Number(latitude)];
|
|
39640
39831
|
mapRef.current.setCenter(coords);
|
|
@@ -39774,7 +39965,7 @@ import React350, { useCallback as useCallback162 } from "react";
|
|
|
39774
39965
|
import { IconSettings as IconSettings20 } from "@tabler/icons-react";
|
|
39775
39966
|
|
|
39776
39967
|
// src/mantine/blocks/embed/template/GeneralTab.tsx
|
|
39777
|
-
import React349, { useEffect as
|
|
39968
|
+
import React349, { useEffect as useEffect144, useState as useState173 } from "react";
|
|
39778
39969
|
import { Stack as Stack258, Switch as Switch10, Text as Text232 } from "@mantine/core";
|
|
39779
39970
|
var GeneralTab18 = ({
|
|
39780
39971
|
url,
|
|
@@ -39796,10 +39987,10 @@ var GeneralTab18 = ({
|
|
|
39796
39987
|
value: key,
|
|
39797
39988
|
label: key.split("-").map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join(" ")
|
|
39798
39989
|
}));
|
|
39799
|
-
|
|
39990
|
+
useEffect144(() => {
|
|
39800
39991
|
setLocalUrl(url);
|
|
39801
39992
|
}, [url]);
|
|
39802
|
-
|
|
39993
|
+
useEffect144(() => {
|
|
39803
39994
|
setLocalHeight(height);
|
|
39804
39995
|
}, [height]);
|
|
39805
39996
|
return /* @__PURE__ */ React349.createElement(Stack258, { gap: "md" }, /* @__PURE__ */ React349.createElement(Stack258, { gap: "xs" }, /* @__PURE__ */ React349.createElement(Text232, { size: "sm", fw: 600 }, "URL"), /* @__PURE__ */ React349.createElement(
|
|
@@ -40214,7 +40405,7 @@ var SkillsTemplateView = ({ editor: _editor, block }) => {
|
|
|
40214
40405
|
// src/mantine/blocks/skills/flow/SkillsFlowView.tsx
|
|
40215
40406
|
import { ActionIcon as ActionIcon46, Badge as Badge57, Button as Button82, Collapse as Collapse15, Group as Group141, Loader as Loader80, Paper as Paper21, Stack as Stack263, Text as Text237, Tooltip as Tooltip30 } from "@mantine/core";
|
|
40216
40407
|
import { IconBrain as IconBrain3, IconCheck as IconCheck43, IconPencil, IconPlus as IconPlus11, IconTrash as IconTrash11, IconX as IconX15 } from "@tabler/icons-react";
|
|
40217
|
-
import React361, { useCallback as useCallback165, useEffect as
|
|
40408
|
+
import React361, { useCallback as useCallback165, useEffect as useEffect145, useMemo as useMemo146, useRef as useRef38, useState as useState175 } from "react";
|
|
40218
40409
|
function parseSkills2(raw) {
|
|
40219
40410
|
try {
|
|
40220
40411
|
const parsed = JSON.parse(raw || "[]");
|
|
@@ -40247,7 +40438,7 @@ var SkillsFlowView = ({ editor, block }) => {
|
|
|
40247
40438
|
const [capsules, setCapsules] = useState175([]);
|
|
40248
40439
|
const [loadingCapsules, setLoadingCapsules] = useState175(false);
|
|
40249
40440
|
const capsulesFetchedRef = useRef38(false);
|
|
40250
|
-
|
|
40441
|
+
useEffect145(() => {
|
|
40251
40442
|
if (capsulesFetchedRef.current || !handlers.getSkills) return;
|
|
40252
40443
|
capsulesFetchedRef.current = true;
|
|
40253
40444
|
setLoadingCapsules(true);
|
|
@@ -40255,7 +40446,7 @@ var SkillsFlowView = ({ editor, block }) => {
|
|
|
40255
40446
|
}, [handlers.getSkills]);
|
|
40256
40447
|
const [network, setNetwork] = useState175("");
|
|
40257
40448
|
const networkFetchedRef = useRef38(false);
|
|
40258
|
-
|
|
40449
|
+
useEffect145(() => {
|
|
40259
40450
|
if (networkFetchedRef.current || !handlers.getNetwork) return;
|
|
40260
40451
|
networkFetchedRef.current = true;
|
|
40261
40452
|
handlers.getNetwork().then(setNetwork).catch(() => setNetwork("mainnet"));
|
|
@@ -40791,7 +40982,7 @@ blockRegistry.register({
|
|
|
40791
40982
|
});
|
|
40792
40983
|
|
|
40793
40984
|
// src/mantine/blocks/hooks/useBlockDependencies.ts
|
|
40794
|
-
import { useMemo as useMemo147, useEffect as
|
|
40985
|
+
import { useMemo as useMemo147, useEffect as useEffect146, useState as useState176, useCallback as useCallback166 } from "react";
|
|
40795
40986
|
|
|
40796
40987
|
// src/mantine/blocks/hooks/useDependsOn.ts
|
|
40797
40988
|
import { useMemo as useMemo148 } from "react";
|
|
@@ -40823,10 +41014,11 @@ var blockSpecs = {
|
|
|
40823
41014
|
secrets: SecretsBlockSpec,
|
|
40824
41015
|
skills: SkillsBlockSpec
|
|
40825
41016
|
};
|
|
40826
|
-
var getExtraSlashMenuItems = (editor) => {
|
|
41017
|
+
var getExtraSlashMenuItems = (editor, translate) => {
|
|
41018
|
+
const t = translate ?? ((key, opts) => opts?.defaultValue ?? key);
|
|
40827
41019
|
const slashMenuList = [
|
|
40828
41020
|
{
|
|
40829
|
-
title: "Checkbox",
|
|
41021
|
+
title: t("palette.items.checkbox.title", { defaultValue: "Checkbox" }),
|
|
40830
41022
|
icon: icon(IconCheckbox4),
|
|
40831
41023
|
onItemClick: () => {
|
|
40832
41024
|
editor.insertBlocks(
|
|
@@ -40851,10 +41043,10 @@ var getExtraSlashMenuItems = (editor) => {
|
|
|
40851
41043
|
},
|
|
40852
41044
|
aliases: ["checkbox", "task", "todo"],
|
|
40853
41045
|
group: "Basics",
|
|
40854
|
-
subtext: "Add an interactive checkbox with flow permissions"
|
|
41046
|
+
subtext: t("palette.items.checkbox.subtext", { defaultValue: "Add an interactive checkbox with flow permissions" })
|
|
40855
41047
|
},
|
|
40856
41048
|
{
|
|
40857
|
-
title: "
|
|
41049
|
+
title: t("palette.items.domainCreator.title", { defaultValue: "{{domain}} Creator", domain: "Domain" }),
|
|
40858
41050
|
icon: icon(IconFileDescription4),
|
|
40859
41051
|
onItemClick: () => {
|
|
40860
41052
|
editor.insertBlocks(
|
|
@@ -40875,7 +41067,7 @@ var getExtraSlashMenuItems = (editor) => {
|
|
|
40875
41067
|
},
|
|
40876
41068
|
aliases: ["domain", "creator", "domain-creator"],
|
|
40877
41069
|
group: "Domains",
|
|
40878
|
-
subtext: "Launch a survey-driven domain creation flow"
|
|
41070
|
+
subtext: t("palette.items.domainCreator.subtext", { defaultValue: "Launch a survey-driven {{domain}} creation {{flow}}", domain: "domain", flow: "flow" })
|
|
40879
41071
|
},
|
|
40880
41072
|
{
|
|
40881
41073
|
title: "Governance Group",
|
|
@@ -40904,10 +41096,13 @@ var getExtraSlashMenuItems = (editor) => {
|
|
|
40904
41096
|
},
|
|
40905
41097
|
aliases: ["governance", "group", "dao-group", "multisig", "staking"],
|
|
40906
41098
|
group: "DAO",
|
|
40907
|
-
subtext: "
|
|
41099
|
+
subtext: t("palette.items.governanceGroup.subtext", {
|
|
41100
|
+
defaultValue: "Create a {{governanceGroup}} (categorical, multisig, or staking)",
|
|
41101
|
+
governanceGroup: "governance group"
|
|
41102
|
+
})
|
|
40908
41103
|
},
|
|
40909
41104
|
{
|
|
40910
|
-
title: "List",
|
|
41105
|
+
title: t("palette.items.list.title", { defaultValue: "List" }),
|
|
40911
41106
|
icon: icon(IconList),
|
|
40912
41107
|
onItemClick: () => {
|
|
40913
41108
|
editor.insertBlocks(
|
|
@@ -40927,10 +41122,10 @@ var getExtraSlashMenuItems = (editor) => {
|
|
|
40927
41122
|
},
|
|
40928
41123
|
aliases: ["list", "data", "dynamic"],
|
|
40929
41124
|
group: "Domains",
|
|
40930
|
-
subtext: "Create a dynamic list from
|
|
41125
|
+
subtext: t("palette.items.list.subtext", { defaultValue: "Create a dynamic list from {{did}} data", did: "DID" })
|
|
40931
41126
|
},
|
|
40932
41127
|
{
|
|
40933
|
-
title: "Enum Checklist",
|
|
41128
|
+
title: t("palette.items.enumChecklist.title", { defaultValue: "Enum Checklist" }),
|
|
40934
41129
|
icon: icon(IconChecklist7),
|
|
40935
41130
|
onItemClick: () => {
|
|
40936
41131
|
editor.insertBlocks(
|
|
@@ -40949,10 +41144,10 @@ var getExtraSlashMenuItems = (editor) => {
|
|
|
40949
41144
|
},
|
|
40950
41145
|
aliases: ["enum", "enum-checklist", "enum-list", "enum-checklist-block"],
|
|
40951
41146
|
group: "Domains",
|
|
40952
|
-
subtext: "Create a predefined enum checklist"
|
|
41147
|
+
subtext: t("palette.items.enumChecklist.subtext", { defaultValue: "Create a predefined enum checklist" })
|
|
40953
41148
|
},
|
|
40954
41149
|
{
|
|
40955
|
-
title: "Overview",
|
|
41150
|
+
title: t("palette.items.overview.title", { defaultValue: "Overview" }),
|
|
40956
41151
|
icon: icon(IconLayoutDashboard),
|
|
40957
41152
|
onItemClick: () => {
|
|
40958
41153
|
editor.insertBlocks(
|
|
@@ -40968,10 +41163,10 @@ var getExtraSlashMenuItems = (editor) => {
|
|
|
40968
41163
|
},
|
|
40969
41164
|
aliases: ["overview", "overview-block", "data-overview"],
|
|
40970
41165
|
group: "Domains",
|
|
40971
|
-
subtext: "Create an overview from domain card
|
|
41166
|
+
subtext: t("palette.items.overview.subtext", { defaultValue: "Create an overview from {{domainCard}} data", domainCard: "domain card" })
|
|
40972
41167
|
},
|
|
40973
41168
|
{
|
|
40974
|
-
title: "Proposal",
|
|
41169
|
+
title: t("palette.items.proposal.title", { defaultValue: "Proposal" }),
|
|
40975
41170
|
icon: icon(IconGavel),
|
|
40976
41171
|
onItemClick: () => {
|
|
40977
41172
|
editor.insertBlocks(
|
|
@@ -40993,10 +41188,10 @@ var getExtraSlashMenuItems = (editor) => {
|
|
|
40993
41188
|
},
|
|
40994
41189
|
aliases: ["proposal", "create-proposal", "dao-proposal", "governance"],
|
|
40995
41190
|
group: "DAO",
|
|
40996
|
-
subtext: "Create a new
|
|
41191
|
+
subtext: t("palette.items.proposal.subtext", { defaultValue: "Create a new {{dao}} proposal", dao: "DAO" })
|
|
40997
41192
|
},
|
|
40998
41193
|
{
|
|
40999
|
-
title: "Visualization",
|
|
41194
|
+
title: t("palette.items.visualization.title", { defaultValue: "Visualization" }),
|
|
41000
41195
|
icon: icon(IconChartBar),
|
|
41001
41196
|
onItemClick: () => {
|
|
41002
41197
|
editor.insertBlocks(
|
|
@@ -41016,10 +41211,10 @@ var getExtraSlashMenuItems = (editor) => {
|
|
|
41016
41211
|
},
|
|
41017
41212
|
aliases: ["visualization", "chart", "graph", "table", "ag-ui"],
|
|
41018
41213
|
group: "Basics",
|
|
41019
|
-
subtext: "Add an
|
|
41214
|
+
subtext: t("palette.items.visualization.subtext", { defaultValue: "Add an {{agUi}} visualization (chart, table, etc.)", agUi: "AG-UI" })
|
|
41020
41215
|
},
|
|
41021
41216
|
{
|
|
41022
|
-
title: "Dynamic List",
|
|
41217
|
+
title: t("palette.items.dynamicList.title", { defaultValue: "Dynamic List" }),
|
|
41023
41218
|
icon: icon(IconTable),
|
|
41024
41219
|
onItemClick: () => {
|
|
41025
41220
|
editor.insertBlocks(
|
|
@@ -41042,10 +41237,10 @@ var getExtraSlashMenuItems = (editor) => {
|
|
|
41042
41237
|
},
|
|
41043
41238
|
aliases: ["dynamic-list", "action-list", "ag-ui-list", "oracle-list"],
|
|
41044
41239
|
group: "Basics",
|
|
41045
|
-
subtext: "Add a dynamic list from
|
|
41240
|
+
subtext: t("palette.items.dynamicList.subtext", { defaultValue: "Add a dynamic list from {{agUi}} with snapshot support", agUi: "AG-UI" })
|
|
41046
41241
|
},
|
|
41047
41242
|
{
|
|
41048
|
-
title: "Protocol Selector",
|
|
41243
|
+
title: t("palette.items.protocolSelector.title", { defaultValue: "Protocol Selector" }),
|
|
41049
41244
|
icon: icon(IconGitBranch),
|
|
41050
41245
|
onItemClick: () => {
|
|
41051
41246
|
editor.insertBlocks(
|
|
@@ -41070,10 +41265,10 @@ var getExtraSlashMenuItems = (editor) => {
|
|
|
41070
41265
|
},
|
|
41071
41266
|
aliases: ["protocol", "protocol-selector", "select-protocol", "domain-type"],
|
|
41072
41267
|
group: "Domains",
|
|
41073
|
-
subtext: "Select a protocol from a predefined list"
|
|
41268
|
+
subtext: t("palette.items.protocolSelector.subtext", { defaultValue: "Select a protocol from a predefined list" })
|
|
41074
41269
|
},
|
|
41075
41270
|
{
|
|
41076
|
-
title: "Sign to Create",
|
|
41271
|
+
title: t("palette.items.signToCreate.title", { defaultValue: "Sign to Create" }),
|
|
41077
41272
|
icon: icon(IconPencil2),
|
|
41078
41273
|
onItemClick: () => {
|
|
41079
41274
|
editor.insertBlocks(
|
|
@@ -41099,7 +41294,7 @@ var getExtraSlashMenuItems = (editor) => {
|
|
|
41099
41294
|
},
|
|
41100
41295
|
aliases: ["domain-sign"],
|
|
41101
41296
|
group: "Domains",
|
|
41102
|
-
subtext: "Sign
|
|
41297
|
+
subtext: t("palette.items.signToCreate.subtext", { defaultValue: "Sign {{domainCard}} and create {{entity}} on-chain", domainCard: "domain card", entity: "entity" })
|
|
41103
41298
|
},
|
|
41104
41299
|
{
|
|
41105
41300
|
title: "Domain Card",
|
|
@@ -41127,10 +41322,10 @@ var getExtraSlashMenuItems = (editor) => {
|
|
|
41127
41322
|
},
|
|
41128
41323
|
aliases: ["domain-card", "domain-viewer", "card-preview"],
|
|
41129
41324
|
group: "Domains",
|
|
41130
|
-
subtext: "Preview
|
|
41325
|
+
subtext: t("palette.items.domainCard.subtext", { defaultValue: "Preview {{domainCard}} before signing", domainCard: "domain card" })
|
|
41131
41326
|
},
|
|
41132
41327
|
{
|
|
41133
|
-
title: "Action",
|
|
41328
|
+
title: t("palette.items.action.title", { defaultValue: "Action" }),
|
|
41134
41329
|
icon: icon(IconBolt10),
|
|
41135
41330
|
onItemClick: () => {
|
|
41136
41331
|
editor.insertBlocks(
|
|
@@ -41154,10 +41349,10 @@ var getExtraSlashMenuItems = (editor) => {
|
|
|
41154
41349
|
},
|
|
41155
41350
|
aliases: ["action", "generic-action", "workflow", "execute"],
|
|
41156
41351
|
group: "Basics",
|
|
41157
|
-
subtext: "Run any registered action from the action registry"
|
|
41352
|
+
subtext: t("palette.items.action.subtext", { defaultValue: "Run any registered action from the action registry" })
|
|
41158
41353
|
},
|
|
41159
41354
|
{
|
|
41160
|
-
title: "
|
|
41355
|
+
title: t("palette.items.flowLink.title", { defaultValue: "{{flow}} Link", flow: "Flow" }),
|
|
41161
41356
|
icon: icon(IconExternalLink3),
|
|
41162
41357
|
onItemClick: () => {
|
|
41163
41358
|
editor.insertBlocks(
|
|
@@ -41179,10 +41374,10 @@ var getExtraSlashMenuItems = (editor) => {
|
|
|
41179
41374
|
},
|
|
41180
41375
|
aliases: ["flow-link", "link", "navigate", "redirect"],
|
|
41181
41376
|
group: "Flows",
|
|
41182
|
-
subtext: "Link to other flow documents"
|
|
41377
|
+
subtext: t("palette.items.flowLink.subtext", { defaultValue: "Link to other {{flow}} documents", flow: "flow" })
|
|
41183
41378
|
},
|
|
41184
41379
|
{
|
|
41185
|
-
title: "Location",
|
|
41380
|
+
title: t("palette.items.location.title", { defaultValue: "Location" }),
|
|
41186
41381
|
icon: icon(IconMapPin3),
|
|
41187
41382
|
onItemClick: () => {
|
|
41188
41383
|
editor.insertBlocks(
|
|
@@ -41202,10 +41397,10 @@ var getExtraSlashMenuItems = (editor) => {
|
|
|
41202
41397
|
},
|
|
41203
41398
|
aliases: ["location", "map", "gps", "coordinates"],
|
|
41204
41399
|
group: "Basics",
|
|
41205
|
-
subtext: "Set a location on a map"
|
|
41400
|
+
subtext: t("palette.items.location.subtext", { defaultValue: "Set a location on a map" })
|
|
41206
41401
|
},
|
|
41207
41402
|
{
|
|
41208
|
-
title: "Embed",
|
|
41403
|
+
title: t("palette.items.embed.title", { defaultValue: "Embed" }),
|
|
41209
41404
|
icon: icon(IconCode3),
|
|
41210
41405
|
onItemClick: () => {
|
|
41211
41406
|
editor.insertBlocks(
|
|
@@ -41227,10 +41422,10 @@ var getExtraSlashMenuItems = (editor) => {
|
|
|
41227
41422
|
},
|
|
41228
41423
|
aliases: ["embed", "iframe", "website", "external"],
|
|
41229
41424
|
group: "Basics",
|
|
41230
|
-
subtext: "Embed an external website or content via iframe"
|
|
41425
|
+
subtext: t("palette.items.embed.subtext", { defaultValue: "Embed an external website or content via iframe" })
|
|
41231
41426
|
},
|
|
41232
41427
|
{
|
|
41233
|
-
title: "Secrets",
|
|
41428
|
+
title: t("palette.items.secrets.title", { defaultValue: "Secrets" }),
|
|
41234
41429
|
icon: icon(IconKey3),
|
|
41235
41430
|
onItemClick: () => {
|
|
41236
41431
|
editor.insertBlocks(
|
|
@@ -41258,10 +41453,10 @@ var getExtraSlashMenuItems = (editor) => {
|
|
|
41258
41453
|
},
|
|
41259
41454
|
aliases: ["secrets", "credentials", "keys", "oracle-credentials"],
|
|
41260
41455
|
group: "Basics",
|
|
41261
|
-
subtext: "Display generated credentials with copy-to-clipboard"
|
|
41456
|
+
subtext: t("palette.items.secrets.subtext", { defaultValue: "Display generated credentials with copy-to-clipboard" })
|
|
41262
41457
|
},
|
|
41263
41458
|
{
|
|
41264
|
-
title: "Skills",
|
|
41459
|
+
title: t("palette.items.skills.title", { defaultValue: "Skills" }),
|
|
41265
41460
|
icon: icon(IconTools2),
|
|
41266
41461
|
onItemClick: () => {
|
|
41267
41462
|
editor.insertBlocks(
|
|
@@ -41284,7 +41479,7 @@ var getExtraSlashMenuItems = (editor) => {
|
|
|
41284
41479
|
},
|
|
41285
41480
|
aliases: ["skills", "mcp", "tools", "capabilities"],
|
|
41286
41481
|
group: "Basics",
|
|
41287
|
-
subtext: "Manage skills and
|
|
41482
|
+
subtext: t("palette.items.skills.subtext", { defaultValue: "Manage skills and {{mcp}} server configurations", mcp: "MCP" })
|
|
41288
41483
|
}
|
|
41289
41484
|
];
|
|
41290
41485
|
return slashMenuList;
|
|
@@ -41358,7 +41553,7 @@ import { useCreateBlockNote as useCreateBlockNote2 } from "@blocknote/react";
|
|
|
41358
41553
|
import { BlockNoteSchema as BlockNoteSchema2, defaultBlockSpecs as defaultBlockSpecs2, defaultInlineContentSpecs as defaultInlineContentSpecs2 } from "@blocknote/core";
|
|
41359
41554
|
|
|
41360
41555
|
// src/core/hooks/useMatrixProvider.ts
|
|
41361
|
-
import { useEffect as
|
|
41556
|
+
import { useEffect as useEffect147, useState as useState177, useRef as useRef39, useCallback as useCallback167, useMemo as useMemo149 } from "react";
|
|
41362
41557
|
import { MatrixProvider } from "@ixo/matrix-crdt";
|
|
41363
41558
|
function useMatrixProvider({ matrixClient, roomId, yDoc }) {
|
|
41364
41559
|
const [matrixProvider, setProvider] = useState177(null);
|
|
@@ -41427,7 +41622,7 @@ function useMatrixProvider({ matrixClient, roomId, yDoc }) {
|
|
|
41427
41622
|
}
|
|
41428
41623
|
}
|
|
41429
41624
|
}, [matrixClient, providerOptions, handleDocumentAvailable, handleDocumentUnavailable, handleCanWriteChanged]);
|
|
41430
|
-
|
|
41625
|
+
useEffect147(() => {
|
|
41431
41626
|
isMountedRef.current = true;
|
|
41432
41627
|
initProvider();
|
|
41433
41628
|
return () => {
|
|
@@ -41444,7 +41639,7 @@ function useMatrixProvider({ matrixClient, roomId, yDoc }) {
|
|
|
41444
41639
|
setStatus("disconnected");
|
|
41445
41640
|
};
|
|
41446
41641
|
}, [initProvider]);
|
|
41447
|
-
|
|
41642
|
+
useEffect147(() => {
|
|
41448
41643
|
return () => {
|
|
41449
41644
|
isMountedRef.current = false;
|
|
41450
41645
|
};
|
|
@@ -41463,7 +41658,7 @@ function useCollaborativeYDoc(_options) {
|
|
|
41463
41658
|
}
|
|
41464
41659
|
|
|
41465
41660
|
// src/mantine/hooks/useCollaborativeIxoEditor.ts
|
|
41466
|
-
import { useMemo as useMemo151, useEffect as
|
|
41661
|
+
import { useMemo as useMemo151, useEffect as useEffect149, useState as useState178, useRef as useRef41 } from "react";
|
|
41467
41662
|
|
|
41468
41663
|
// src/core/lib/matrixMetadata.ts
|
|
41469
41664
|
var COVER_IMAGE_EVENT_TYPE = "ixo.page.cover_image";
|
|
@@ -41732,7 +41927,7 @@ function logInvocation(matrixClient, roomId, invocation) {
|
|
|
41732
41927
|
}
|
|
41733
41928
|
|
|
41734
41929
|
// src/mantine/hooks/useFlowLifecycle.ts
|
|
41735
|
-
import { useEffect as
|
|
41930
|
+
import { useEffect as useEffect148, useCallback as useCallback168, useRef as useRef40 } from "react";
|
|
41736
41931
|
|
|
41737
41932
|
// src/mantine/hooks/useFlowTTLCleanup.ts
|
|
41738
41933
|
function performTTLCleanup(editor) {
|
|
@@ -41983,19 +42178,19 @@ function useFlowLifecycle({ editor, connectionStatus, enabled = true }) {
|
|
|
41983
42178
|
runningRef.current = false;
|
|
41984
42179
|
}
|
|
41985
42180
|
}, [editor]);
|
|
41986
|
-
|
|
42181
|
+
useEffect148(() => {
|
|
41987
42182
|
if (!enabled || !editor || connectionStatus !== "connected" || hasRunInitialRef.current) return;
|
|
41988
42183
|
if (editor.docType !== "flow") return;
|
|
41989
42184
|
hasRunInitialRef.current = true;
|
|
41990
42185
|
runPipeline();
|
|
41991
42186
|
}, [editor, connectionStatus, enabled, runPipeline]);
|
|
41992
|
-
|
|
42187
|
+
useEffect148(() => {
|
|
41993
42188
|
if (!enabled || !editor || connectionStatus !== "connected") return;
|
|
41994
42189
|
if (editor.docType !== "flow") return;
|
|
41995
42190
|
const id = setInterval(runPipeline, DEFAULT_INTERVAL_MS);
|
|
41996
42191
|
return () => clearInterval(id);
|
|
41997
42192
|
}, [editor, connectionStatus, enabled, runPipeline]);
|
|
41998
|
-
|
|
42193
|
+
useEffect148(() => {
|
|
41999
42194
|
if (!enabled || !editor || connectionStatus !== "connected") return;
|
|
42000
42195
|
if (editor.docType !== "flow") return;
|
|
42001
42196
|
const runtimeMap = editor._yRuntime;
|
|
@@ -42105,7 +42300,7 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
42105
42300
|
roomId: options.roomId
|
|
42106
42301
|
});
|
|
42107
42302
|
const metadataManager = useMemo151(() => new MatrixMetadataManager(matrixClient, options.roomId), [matrixClient, options.roomId]);
|
|
42108
|
-
|
|
42303
|
+
useEffect149(() => {
|
|
42109
42304
|
return () => {
|
|
42110
42305
|
metadataManager.dispose();
|
|
42111
42306
|
};
|
|
@@ -42188,7 +42383,7 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
42188
42383
|
[theme, editable, sideMenu, slashMenu, formattingToolbar, linkToolbar, filePanel, tableHandles]
|
|
42189
42384
|
);
|
|
42190
42385
|
const [providerReady, setProviderReady] = useState178(false);
|
|
42191
|
-
|
|
42386
|
+
useEffect149(() => {
|
|
42192
42387
|
if (matrixProvider && !providerReady) setProviderReady(true);
|
|
42193
42388
|
}, [matrixProvider, providerReady]);
|
|
42194
42389
|
const editor = useCreateBlockNote2(
|
|
@@ -42398,12 +42593,12 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
42398
42593
|
return void 0;
|
|
42399
42594
|
};
|
|
42400
42595
|
}
|
|
42401
|
-
|
|
42596
|
+
useEffect149(() => {
|
|
42402
42597
|
if (ixoEditor) {
|
|
42403
42598
|
ixoEditor.isEditable = editable;
|
|
42404
42599
|
}
|
|
42405
42600
|
}, [ixoEditor, editable]);
|
|
42406
|
-
|
|
42601
|
+
useEffect149(() => {
|
|
42407
42602
|
if (connectionStatus !== "connected") {
|
|
42408
42603
|
return;
|
|
42409
42604
|
}
|
|
@@ -42428,7 +42623,7 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
42428
42623
|
const [connectedUsers, setConnectedUsers] = useState178([]);
|
|
42429
42624
|
const activeBlockIdRef = useRef41(null);
|
|
42430
42625
|
const awarenessInstance = matrixProvider?.awarenessInstance ?? null;
|
|
42431
|
-
|
|
42626
|
+
useEffect149(() => {
|
|
42432
42627
|
if (!awarenessInstance || connectionStatus !== "connected") {
|
|
42433
42628
|
return;
|
|
42434
42629
|
}
|
|
@@ -42446,7 +42641,7 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
42446
42641
|
awarenessInstance.off("change", updateUsers);
|
|
42447
42642
|
};
|
|
42448
42643
|
}, [awarenessInstance, connectionStatus]);
|
|
42449
|
-
|
|
42644
|
+
useEffect149(() => {
|
|
42450
42645
|
if (!awarenessInstance || connectionStatus !== "connected") {
|
|
42451
42646
|
return;
|
|
42452
42647
|
}
|
|
@@ -42475,7 +42670,7 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
42475
42670
|
};
|
|
42476
42671
|
}, [awarenessInstance, connectionStatus, memoizedUser.id, memoizedUser.name, memoizedUser.color, memoizedUser.avatar]);
|
|
42477
42672
|
useFlowLifecycle({ editor: ixoEditor, connectionStatus, enabled: permissions.write });
|
|
42478
|
-
|
|
42673
|
+
useEffect149(() => {
|
|
42479
42674
|
if (!ixoEditor) return;
|
|
42480
42675
|
setActiveEditor(ixoEditor);
|
|
42481
42676
|
return () => {
|
|
@@ -42542,7 +42737,7 @@ function sanitizeThemeForMantine7(theme) {
|
|
|
42542
42737
|
}
|
|
42543
42738
|
|
|
42544
42739
|
// src/mantine/components/CommandPalette.tsx
|
|
42545
|
-
import React364, { useEffect as
|
|
42740
|
+
import React364, { useEffect as useEffect150, useRef as useRef42, useState as useState179, useMemo as useMemo152, useCallback as useCallback169 } from "react";
|
|
42546
42741
|
import { Box as Box67, Text as Text238, Stack as Stack264 } from "@mantine/core";
|
|
42547
42742
|
var GROUP_ORDER = {
|
|
42548
42743
|
Headings: 0,
|
|
@@ -42555,10 +42750,26 @@ var GROUP_ORDER = {
|
|
|
42555
42750
|
DAO: 7,
|
|
42556
42751
|
Flows: 8
|
|
42557
42752
|
};
|
|
42753
|
+
function translateGroupLabel(groupKey, t) {
|
|
42754
|
+
if (!groupKey) return groupKey;
|
|
42755
|
+
const map = {
|
|
42756
|
+
Headings: { key: "palette.groups.headings", defaultValue: "Headings" },
|
|
42757
|
+
"Basic blocks": { key: "palette.groups.basicBlocks", defaultValue: "Basic blocks" },
|
|
42758
|
+
Media: { key: "palette.groups.media", defaultValue: "Media" },
|
|
42759
|
+
Advanced: { key: "palette.groups.advanced", defaultValue: "Advanced" },
|
|
42760
|
+
Others: { key: "palette.groups.others", defaultValue: "Others" },
|
|
42761
|
+
Basics: { key: "palette.groups.basics", defaultValue: "Basics" },
|
|
42762
|
+
Domains: { key: "palette.groups.domains", defaultValue: "Domains" },
|
|
42763
|
+
DAO: { key: "palette.groups.dao", defaultValue: "DAO" },
|
|
42764
|
+
Flows: { key: "palette.groups.flows", defaultValue: "Flows" }
|
|
42765
|
+
};
|
|
42766
|
+
const entry = map[groupKey];
|
|
42767
|
+
return entry ? t(entry.key, { defaultValue: entry.defaultValue }) : groupKey;
|
|
42768
|
+
}
|
|
42558
42769
|
function PaletteItem({ item, isSelected, onClick, id }) {
|
|
42559
42770
|
const ref = useRef42(null);
|
|
42560
42771
|
const [hovered, setHovered] = useState179(false);
|
|
42561
|
-
|
|
42772
|
+
useEffect150(() => {
|
|
42562
42773
|
if (isSelected && ref.current) {
|
|
42563
42774
|
ref.current.scrollIntoView({ block: "nearest" });
|
|
42564
42775
|
}
|
|
@@ -42628,6 +42839,7 @@ function PaletteItem({ item, isSelected, onClick, id }) {
|
|
|
42628
42839
|
);
|
|
42629
42840
|
}
|
|
42630
42841
|
function CommandPalette({ items, onItemClick, loadingState, selectedIndex }) {
|
|
42842
|
+
const t = useTranslate();
|
|
42631
42843
|
const groupedItems = useMemo152(() => {
|
|
42632
42844
|
const groups = [];
|
|
42633
42845
|
let currentGroup;
|
|
@@ -42660,7 +42872,7 @@ function CommandPalette({ items, onItemClick, loadingState, selectedIndex }) {
|
|
|
42660
42872
|
boxShadow: "0 4px 16px rgba(0, 0, 0, 0.2)"
|
|
42661
42873
|
}
|
|
42662
42874
|
},
|
|
42663
|
-
/* @__PURE__ */ React364.createElement(Text238, { size: "sm", style: { color: "var(--mantine-color-neutralColor-7) !important", textAlign: "center" } }, "Loading...")
|
|
42875
|
+
/* @__PURE__ */ React364.createElement(Text238, { size: "sm", style: { color: "var(--mantine-color-neutralColor-7) !important", textAlign: "center" } }, t("palette.loading", { defaultValue: "Loading..." }))
|
|
42664
42876
|
);
|
|
42665
42877
|
}
|
|
42666
42878
|
return /* @__PURE__ */ React364.createElement(
|
|
@@ -42703,7 +42915,7 @@ function CommandPalette({ items, onItemClick, loadingState, selectedIndex }) {
|
|
|
42703
42915
|
fontSize: 11
|
|
42704
42916
|
}
|
|
42705
42917
|
},
|
|
42706
|
-
group.label
|
|
42918
|
+
translateGroupLabel(group.label, t)
|
|
42707
42919
|
), group.items.map(({ item, globalIndex }) => /* @__PURE__ */ React364.createElement(
|
|
42708
42920
|
PaletteItem,
|
|
42709
42921
|
{
|
|
@@ -42724,7 +42936,7 @@ function CommandPalette({ items, onItemClick, loadingState, selectedIndex }) {
|
|
|
42724
42936
|
padding: "12px"
|
|
42725
42937
|
}
|
|
42726
42938
|
},
|
|
42727
|
-
"No results"
|
|
42939
|
+
t("palette.noResults", { defaultValue: "No results" })
|
|
42728
42940
|
)
|
|
42729
42941
|
)
|
|
42730
42942
|
);
|
|
@@ -42784,7 +42996,7 @@ function PanelContent({ theme: _theme }) {
|
|
|
42784
42996
|
}
|
|
42785
42997
|
|
|
42786
42998
|
// src/mantine/components/CoverImage.tsx
|
|
42787
|
-
import React370, { useState as useState183, useRef as useRef43, useEffect as
|
|
42999
|
+
import React370, { useState as useState183, useRef as useRef43, useEffect as useEffect153, useMemo as useMemo155 } from "react";
|
|
42788
43000
|
import { Box as Box72, Group as Group145 } from "@mantine/core";
|
|
42789
43001
|
import { IconMoodSmile, IconPhoto as IconPhoto6, IconSettings as IconSettings22, IconArrowsMove, IconTrash as IconTrash13, IconRefresh as IconRefresh10 } from "@tabler/icons-react";
|
|
42790
43002
|
|
|
@@ -42964,7 +43176,7 @@ var CoverImageButton = forwardRef(function CoverImageButton2({ isActive = false,
|
|
|
42964
43176
|
});
|
|
42965
43177
|
|
|
42966
43178
|
// src/mantine/components/Base/BaseIconPicker.tsx
|
|
42967
|
-
import React367, { useState as useState181, useMemo as useMemo153, useEffect as
|
|
43179
|
+
import React367, { useState as useState181, useMemo as useMemo153, useEffect as useEffect151 } from "react";
|
|
42968
43180
|
import { TextInput as TextInput9, Tabs as Tabs4, Box as Box69, Stack as Stack265, UnstyledButton as UnstyledButton8, Text as Text240, Center as Center15, ScrollArea as ScrollArea10, Group as Group143, Popover as Popover6 } from "@mantine/core";
|
|
42969
43181
|
import * as TablerIcons2 from "@tabler/icons-react";
|
|
42970
43182
|
import { IconSearch as IconSearch9, IconX as IconX16, IconChevronLeft, IconChevronRight as IconChevronRight13 } from "@tabler/icons-react";
|
|
@@ -43009,7 +43221,7 @@ function BaseIconPicker({ opened, onClose, onSelectIcon, onUploadClick, onRemove
|
|
|
43009
43221
|
const query = searchQuery.toLowerCase();
|
|
43010
43222
|
return allIcons.filter(([name]) => name.toLowerCase().includes(query));
|
|
43011
43223
|
}, [allIcons, searchQuery]);
|
|
43012
|
-
|
|
43224
|
+
useEffect151(() => {
|
|
43013
43225
|
setCurrentPage(1);
|
|
43014
43226
|
}, [searchQuery]);
|
|
43015
43227
|
const paginatedIcons = useMemo153(() => {
|
|
@@ -43195,7 +43407,7 @@ function PageIcon({ src, iconSize = 64, useCenter = false, style }) {
|
|
|
43195
43407
|
import { useDisclosure as useDisclosure8 } from "@mantine/hooks";
|
|
43196
43408
|
|
|
43197
43409
|
// src/mantine/components/FlowSettingsPanel.tsx
|
|
43198
|
-
import React369, { useState as useState182, useEffect as
|
|
43410
|
+
import React369, { useState as useState182, useEffect as useEffect152, useCallback as useCallback170 } from "react";
|
|
43199
43411
|
import { Stack as Stack266, Group as Group144, Button as Button83, ActionIcon as ActionIcon47, Text as Text241, Box as Box71 } from "@mantine/core";
|
|
43200
43412
|
import { IconPlus as IconPlus12, IconTrash as IconTrash12 } from "@tabler/icons-react";
|
|
43201
43413
|
var SYSTEM_KEYS = /* @__PURE__ */ new Set(["@context", "_type", "schema_version", "doc_id", "title", "createdAt", "createdBy", "flowOwnerDid"]);
|
|
@@ -43213,7 +43425,7 @@ var FlowSettingsPanel = ({ editor }) => {
|
|
|
43213
43425
|
}
|
|
43214
43426
|
setRows(customRows);
|
|
43215
43427
|
}, [editor]);
|
|
43216
|
-
|
|
43428
|
+
useEffect152(() => {
|
|
43217
43429
|
loadSettings();
|
|
43218
43430
|
}, [loadSettings]);
|
|
43219
43431
|
const handleKeyChange = useCallback170(
|
|
@@ -43278,7 +43490,7 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
43278
43490
|
const [metadata, setMetadata] = useState183(() => editor?.getPageMetadata?.() || null);
|
|
43279
43491
|
const settingsPanelContent = useMemo155(() => editor ? /* @__PURE__ */ React370.createElement(FlowSettingsPanel, { editor }) : null, [editor]);
|
|
43280
43492
|
const { open: openSettings } = usePanel("flow-settings-panel", settingsPanelContent);
|
|
43281
|
-
|
|
43493
|
+
useEffect153(() => {
|
|
43282
43494
|
if (!editor?._metadataManager) {
|
|
43283
43495
|
return;
|
|
43284
43496
|
}
|
|
@@ -43568,7 +43780,7 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
43568
43780
|
}
|
|
43569
43781
|
|
|
43570
43782
|
// src/mantine/components/PageTitle.tsx
|
|
43571
|
-
import React371, { useState as useState184, useEffect as
|
|
43783
|
+
import React371, { useState as useState184, useEffect as useEffect154, useRef as useRef44, useCallback as useCallback171 } from "react";
|
|
43572
43784
|
import { Box as Box73 } from "@mantine/core";
|
|
43573
43785
|
var DEFAULT_TITLE = "New page";
|
|
43574
43786
|
function isUserTitle(name) {
|
|
@@ -43612,11 +43824,12 @@ function insertPlainTextAtSelection(root, text) {
|
|
|
43612
43824
|
placeCaretAfter(textNode);
|
|
43613
43825
|
}
|
|
43614
43826
|
function PageTitle({ editor, editable }) {
|
|
43827
|
+
const t = useTranslate();
|
|
43615
43828
|
const [title, setTitle] = useState184("");
|
|
43616
43829
|
const [hasIcon, setHasIcon] = useState184(false);
|
|
43617
43830
|
const titleRef = useRef44(null);
|
|
43618
43831
|
const isComposing = useRef44(false);
|
|
43619
|
-
|
|
43832
|
+
useEffect154(() => {
|
|
43620
43833
|
if (!editor?._metadataManager) return;
|
|
43621
43834
|
const metadata = editor._metadataManager.getMetadata();
|
|
43622
43835
|
const initial = isUserTitle(metadata?.title);
|
|
@@ -43636,7 +43849,7 @@ function PageTitle({ editor, editable }) {
|
|
|
43636
43849
|
});
|
|
43637
43850
|
return unsubscribe;
|
|
43638
43851
|
}, [editor]);
|
|
43639
|
-
|
|
43852
|
+
useEffect154(() => {
|
|
43640
43853
|
if (titleRef.current && title && !titleRef.current.textContent) {
|
|
43641
43854
|
titleRef.current.textContent = title;
|
|
43642
43855
|
}
|
|
@@ -43680,7 +43893,7 @@ function PageTitle({ editor, editable }) {
|
|
|
43680
43893
|
},
|
|
43681
43894
|
[editor, saveTitle]
|
|
43682
43895
|
);
|
|
43683
|
-
|
|
43896
|
+
useEffect154(() => {
|
|
43684
43897
|
const handleEditorKeyDown = (e) => {
|
|
43685
43898
|
if (e.key !== "ArrowUp" || !titleRef.current) return;
|
|
43686
43899
|
if (document.getElementById("bn-suggestion-menu")) return;
|
|
@@ -43721,8 +43934,8 @@ function PageTitle({ editor, editable }) {
|
|
|
43721
43934
|
contentEditable: editable !== false,
|
|
43722
43935
|
suppressContentEditableWarning: true,
|
|
43723
43936
|
role: "textbox",
|
|
43724
|
-
"aria-label": "Page title",
|
|
43725
|
-
"data-placeholder": "New page",
|
|
43937
|
+
"aria-label": t("pageTitle.ariaLabel", { defaultValue: "Page title" }),
|
|
43938
|
+
"data-placeholder": t("pageTitle.placeholder", { defaultValue: "New page" }),
|
|
43726
43939
|
fz: 40,
|
|
43727
43940
|
fw: 700,
|
|
43728
43941
|
lh: 1.2,
|
|
@@ -43770,7 +43983,7 @@ if (typeof document !== "undefined") {
|
|
|
43770
43983
|
}
|
|
43771
43984
|
|
|
43772
43985
|
// src/mantine/components/ExternalDropZone.tsx
|
|
43773
|
-
import React372, { useCallback as useCallback172, useEffect as
|
|
43986
|
+
import React372, { useCallback as useCallback172, useEffect as useEffect155, useRef as useRef45, useState as useState185 } from "react";
|
|
43774
43987
|
import { Box as Box74 } from "@mantine/core";
|
|
43775
43988
|
var SCROLL_ZONE_SIZE = 80;
|
|
43776
43989
|
var SCROLL_SPEED = 12;
|
|
@@ -43946,7 +44159,7 @@ var ExternalDropZone = ({
|
|
|
43946
44159
|
},
|
|
43947
44160
|
[onDrop, stopAutoScroll]
|
|
43948
44161
|
);
|
|
43949
|
-
|
|
44162
|
+
useEffect155(() => {
|
|
43950
44163
|
const handleGlobalDragEnd = () => {
|
|
43951
44164
|
setIsValidDrag(false);
|
|
43952
44165
|
dropPositionRef.current = null;
|
|
@@ -44004,7 +44217,7 @@ var ExternalDropZone = ({
|
|
|
44004
44217
|
},
|
|
44005
44218
|
[getScrollContainer]
|
|
44006
44219
|
);
|
|
44007
|
-
|
|
44220
|
+
useEffect155(() => {
|
|
44008
44221
|
if (!isPlacementMode) return;
|
|
44009
44222
|
const handleKeyDown = (e) => {
|
|
44010
44223
|
if (e.key === "Escape") {
|
|
@@ -44027,13 +44240,13 @@ var ExternalDropZone = ({
|
|
|
44027
44240
|
document.removeEventListener("click", handleGlobalClick, true);
|
|
44028
44241
|
};
|
|
44029
44242
|
}, [isPlacementMode, onPlacementCancel]);
|
|
44030
|
-
|
|
44243
|
+
useEffect155(() => {
|
|
44031
44244
|
if (!isPlacementMode) {
|
|
44032
44245
|
setIsHoveringInPlacementMode(false);
|
|
44033
44246
|
dropPositionRef.current = null;
|
|
44034
44247
|
}
|
|
44035
44248
|
}, [isPlacementMode]);
|
|
44036
|
-
|
|
44249
|
+
useEffect155(() => {
|
|
44037
44250
|
const isActive = isValidDrag || isPlacementMode && isHoveringInPlacementMode;
|
|
44038
44251
|
if (isActive) {
|
|
44039
44252
|
document.body.classList.add("external-artifact-drag-active");
|
|
@@ -44044,7 +44257,7 @@ var ExternalDropZone = ({
|
|
|
44044
44257
|
document.body.classList.remove("external-artifact-drag-active");
|
|
44045
44258
|
};
|
|
44046
44259
|
}, [isValidDrag, isPlacementMode, isHoveringInPlacementMode]);
|
|
44047
|
-
|
|
44260
|
+
useEffect155(() => {
|
|
44048
44261
|
return () => {
|
|
44049
44262
|
if (scrollAnimationRef.current) {
|
|
44050
44263
|
cancelAnimationFrame(scrollAnimationRef.current);
|
|
@@ -44114,6 +44327,24 @@ var DEFAULT_ICON_MAP = {
|
|
|
44114
44327
|
Emoji: icon(IconMoodSmile2),
|
|
44115
44328
|
"Page Break": icon(IconPageBreak)
|
|
44116
44329
|
};
|
|
44330
|
+
var BUILTIN_TITLE_KEYS = {
|
|
44331
|
+
"Heading 1": "palette.builtin.heading1",
|
|
44332
|
+
"Heading 2": "palette.builtin.heading2",
|
|
44333
|
+
"Heading 3": "palette.builtin.heading3",
|
|
44334
|
+
Quote: "palette.builtin.quote",
|
|
44335
|
+
"Numbered List": "palette.builtin.numberedList",
|
|
44336
|
+
"Bullet List": "palette.builtin.bulletList",
|
|
44337
|
+
"Check List": "palette.builtin.checkList",
|
|
44338
|
+
Paragraph: "palette.builtin.paragraph",
|
|
44339
|
+
"Code Block": "palette.builtin.codeBlock",
|
|
44340
|
+
Table: "palette.builtin.table",
|
|
44341
|
+
Image: "palette.builtin.image",
|
|
44342
|
+
Video: "palette.builtin.video",
|
|
44343
|
+
Audio: "palette.builtin.audio",
|
|
44344
|
+
File: "palette.builtin.file",
|
|
44345
|
+
Emoji: "palette.builtin.emoji",
|
|
44346
|
+
"Page Break": "palette.builtin.pageBreak"
|
|
44347
|
+
};
|
|
44117
44348
|
function SanitizedThemeBoundary({ children }) {
|
|
44118
44349
|
const parentTheme = useMantineTheme();
|
|
44119
44350
|
const sanitizedTheme = useMemo156(() => sanitizeThemeForMantine7(parentTheme), [parentTheme]);
|
|
@@ -44139,6 +44370,7 @@ function IxoEditorContent({
|
|
|
44139
44370
|
}) {
|
|
44140
44371
|
const { activePanel } = usePanelStore();
|
|
44141
44372
|
const isPanelOpen = activePanel !== null;
|
|
44373
|
+
const t = useTranslate();
|
|
44142
44374
|
const editorContent = /* @__PURE__ */ React373.createElement(
|
|
44143
44375
|
BlockNoteView,
|
|
44144
44376
|
{
|
|
@@ -44160,11 +44392,15 @@ function IxoEditorContent({
|
|
|
44160
44392
|
triggerCharacter: "/",
|
|
44161
44393
|
suggestionMenuComponent: CommandPalette,
|
|
44162
44394
|
getItems: async (query) => {
|
|
44163
|
-
const customItems = getExtraSlashMenuItems(editor);
|
|
44164
|
-
const defaultItems = getDefaultReactSlashMenuItems(editor).map((item) =>
|
|
44165
|
-
|
|
44166
|
-
|
|
44167
|
-
|
|
44395
|
+
const customItems = getExtraSlashMenuItems(editor, t);
|
|
44396
|
+
const defaultItems = getDefaultReactSlashMenuItems(editor).map((item) => {
|
|
44397
|
+
const titleKey = BUILTIN_TITLE_KEYS[item.title];
|
|
44398
|
+
return {
|
|
44399
|
+
...item,
|
|
44400
|
+
icon: DEFAULT_ICON_MAP[item.title] ?? item.icon,
|
|
44401
|
+
title: titleKey ? t(titleKey, { defaultValue: item.title }) : item.title
|
|
44402
|
+
};
|
|
44403
|
+
});
|
|
44168
44404
|
const allItems = [...defaultItems, ...customItems];
|
|
44169
44405
|
allItems.sort((a, b) => {
|
|
44170
44406
|
const groupA = a.group || "";
|
|
@@ -44232,7 +44468,8 @@ function IxoEditor({
|
|
|
44232
44468
|
mapConfig,
|
|
44233
44469
|
connectedUsers,
|
|
44234
44470
|
awarenessInstance,
|
|
44235
|
-
belowTitleSlot
|
|
44471
|
+
belowTitleSlot,
|
|
44472
|
+
translate
|
|
44236
44473
|
}) {
|
|
44237
44474
|
if (!editor) {
|
|
44238
44475
|
return null;
|
|
@@ -44260,7 +44497,8 @@ function IxoEditor({
|
|
|
44260
44497
|
domainCardRenderer,
|
|
44261
44498
|
mapConfig,
|
|
44262
44499
|
connectedUsers,
|
|
44263
|
-
awarenessInstance
|
|
44500
|
+
awarenessInstance,
|
|
44501
|
+
translate
|
|
44264
44502
|
},
|
|
44265
44503
|
/* @__PURE__ */ React373.createElement(
|
|
44266
44504
|
IxoEditorContent,
|
|
@@ -44370,7 +44608,7 @@ function DebugButton({ editor }) {
|
|
|
44370
44608
|
}
|
|
44371
44609
|
|
|
44372
44610
|
// src/mantine/components/PageHeader.tsx
|
|
44373
|
-
import React375, { useState as useState186, useRef as useRef46, useEffect as
|
|
44611
|
+
import React375, { useState as useState186, useRef as useRef46, useEffect as useEffect156 } from "react";
|
|
44374
44612
|
function PageHeader({
|
|
44375
44613
|
title = "New page",
|
|
44376
44614
|
icon: icon2,
|
|
@@ -44386,7 +44624,7 @@ function PageHeader({
|
|
|
44386
44624
|
const [isPrivacyOpen, setIsPrivacyOpen] = useState186(false);
|
|
44387
44625
|
const menuRef = useRef46(null);
|
|
44388
44626
|
const privacyRef = useRef46(null);
|
|
44389
|
-
|
|
44627
|
+
useEffect156(() => {
|
|
44390
44628
|
function handleClickOutside(event) {
|
|
44391
44629
|
if (menuRef.current && !menuRef.current.contains(event.target)) {
|
|
44392
44630
|
setIsMenuOpen(false);
|
|
@@ -44656,7 +44894,7 @@ var EntitySigningSetup = ({ opened, onClose, entityDid, entityName, onSetup }) =
|
|
|
44656
44894
|
};
|
|
44657
44895
|
|
|
44658
44896
|
// src/mantine/components/FlowPermissionsPanel.tsx
|
|
44659
|
-
import React377, { useState as useState188, useEffect as
|
|
44897
|
+
import React377, { useState as useState188, useEffect as useEffect157, useMemo as useMemo157 } from "react";
|
|
44660
44898
|
import { Stack as Stack268, Text as Text243, Paper as Paper22, Group as Group147, Badge as Badge58, Button as Button85, ActionIcon as ActionIcon48, Loader as Loader81, Alert as Alert87, Divider as Divider43 } from "@mantine/core";
|
|
44661
44899
|
import { IconPlus as IconPlus13, IconTrash as IconTrash14, IconShieldCheck as IconShieldCheck16, IconUser as IconUser14, IconRobot as IconRobot4, IconBuilding as IconBuilding2 } from "@tabler/icons-react";
|
|
44662
44900
|
var FlowPermissionsPanel = ({ editor, entityDid, entityName, onGrantPermission, onRevokePermission, getUserDisplayName }) => {
|
|
@@ -44669,7 +44907,7 @@ var FlowPermissionsPanel = ({ editor, entityDid, entityName, onGrantPermission,
|
|
|
44669
44907
|
}
|
|
44670
44908
|
return null;
|
|
44671
44909
|
}, [editor]);
|
|
44672
|
-
|
|
44910
|
+
useEffect157(() => {
|
|
44673
44911
|
const loadDelegations = async () => {
|
|
44674
44912
|
setLoading(true);
|
|
44675
44913
|
let allDelegations = [];
|
|
@@ -44981,6 +45219,7 @@ export {
|
|
|
44981
45219
|
BlocknoteProvider,
|
|
44982
45220
|
useBlocknoteContext,
|
|
44983
45221
|
useBlocknoteHandlers,
|
|
45222
|
+
useTranslate,
|
|
44984
45223
|
useBlockPresence,
|
|
44985
45224
|
useTrackBlockFocus,
|
|
44986
45225
|
StakeType,
|
|
@@ -45017,4 +45256,4 @@ export {
|
|
|
45017
45256
|
getExtraSlashMenuItems,
|
|
45018
45257
|
useCreateIxoEditor
|
|
45019
45258
|
};
|
|
45020
|
-
//# sourceMappingURL=chunk-
|
|
45259
|
+
//# sourceMappingURL=chunk-JBVGVTIA.mjs.map
|