@ixo/editor 5.9.1 → 5.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-OO42QPEG.mjs → chunk-MD3CXTGZ.mjs} +47 -6
- package/dist/chunk-MD3CXTGZ.mjs.map +1 -0
- package/dist/{chunk-MOPZZGGR.mjs → chunk-OSIGG4JK.mjs} +443 -276
- package/dist/chunk-OSIGG4JK.mjs.map +1 -0
- package/dist/{chunk-V7HASCLL.mjs → chunk-UREJIK4X.mjs} +2 -2
- package/dist/core/index.d.ts +4 -4
- 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-UREJIK4X.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-MD3CXTGZ.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,6 +24211,7 @@ 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);
|
|
@@ -24300,7 +24292,7 @@ function ActionPanelContent({
|
|
|
24300
24292
|
unlockSigning,
|
|
24301
24293
|
registerRuntimeInputs
|
|
24302
24294
|
}
|
|
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)));
|
|
24295
|
+
), 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
24296
|
}
|
|
24305
24297
|
if (FlowDetailComponent && isSlideToSign) {
|
|
24306
24298
|
return /* @__PURE__ */ React242.createElement(Stack161, { gap: "md", py: "md" }, /* @__PURE__ */ React242.createElement(
|
|
@@ -24316,7 +24308,7 @@ function ActionPanelContent({
|
|
|
24316
24308
|
unlockSigning,
|
|
24317
24309
|
registerRuntimeInputs
|
|
24318
24310
|
}
|
|
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)));
|
|
24311
|
+
), 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
24312
|
}
|
|
24321
24313
|
if (FlowDetailComponent) {
|
|
24322
24314
|
return /* @__PURE__ */ React242.createElement(Stack161, { gap: "md", py: "md" }, /* @__PURE__ */ React242.createElement(FlowDetailComponent, { inputs: block.props.inputs || "{}", editor, block, runtime, updateRuntime, isDisabled }));
|
|
@@ -24363,6 +24355,7 @@ function GenericFlowPanel({
|
|
|
24363
24355
|
setIsLoading,
|
|
24364
24356
|
disabledMessage
|
|
24365
24357
|
}) {
|
|
24358
|
+
const t = useTranslate();
|
|
24366
24359
|
const handlers = useBlocknoteHandlers();
|
|
24367
24360
|
const services = useMemo90(() => buildServicesFromHandlers(handlers), [handlers]);
|
|
24368
24361
|
const flowNode = useMemo90(() => buildFlowNodeFromBlock(block), [block]);
|
|
@@ -24483,8 +24476,8 @@ function GenericFlowPanel({
|
|
|
24483
24476
|
onClick: handleExecute,
|
|
24484
24477
|
disabled: isDisabled || isLoading || !actionType
|
|
24485
24478
|
},
|
|
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))));
|
|
24479
|
+
isLoading ? t("actionBlock.executing", { defaultValue: "Running..." }) : t("actionBlock.tabs.execute", { defaultValue: "Execute" })
|
|
24480
|
+
), 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
24481
|
}
|
|
24489
24482
|
|
|
24490
24483
|
// src/mantine/blocks/action/actionTypes/pod/domainIndexerLookup/DomainIndexerLookupConfig.tsx
|
|
@@ -26156,6 +26149,7 @@ function serializeBidActionInputs(inputs) {
|
|
|
26156
26149
|
|
|
26157
26150
|
// src/mantine/blocks/action/actionTypes/bid/BidConfig.tsx
|
|
26158
26151
|
var BidConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
26152
|
+
const t = useTranslate();
|
|
26159
26153
|
const handlers = useBlocknoteHandlers();
|
|
26160
26154
|
const [local, setLocal] = useState111(() => parseBidActionInputs(inputs));
|
|
26161
26155
|
const [collections, setCollections] = useState111([]);
|
|
@@ -26175,7 +26169,7 @@ var BidConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
26175
26169
|
const fetchCollections = useCallback89(async () => {
|
|
26176
26170
|
const deedDid = local.deedDid.trim();
|
|
26177
26171
|
if (!deedDid) {
|
|
26178
|
-
setError("Please enter a
|
|
26172
|
+
setError(t("actionTypes.shared.errors.didRequired", { defaultValue: "Please enter a {{did}} first", did: "DID" }));
|
|
26179
26173
|
return;
|
|
26180
26174
|
}
|
|
26181
26175
|
const persisted = { ...local, deedDid };
|
|
@@ -26188,14 +26182,18 @@ var BidConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
26188
26182
|
const fetched = response?.collections || [];
|
|
26189
26183
|
setCollections(fetched);
|
|
26190
26184
|
if (fetched.length === 0) {
|
|
26191
|
-
setError(
|
|
26185
|
+
setError(
|
|
26186
|
+
t("actionTypes.shared.errors.noCollections", { defaultValue: "No {{claimCollections}} found for this {{did}}", claimCollections: "claim collections", did: "DID" })
|
|
26187
|
+
);
|
|
26192
26188
|
}
|
|
26193
26189
|
if (local.collectionId && !fetched.some((c) => c.id === local.collectionId)) {
|
|
26194
26190
|
update({ collectionId: "" });
|
|
26195
26191
|
}
|
|
26196
26192
|
} catch (err) {
|
|
26197
26193
|
setCollections([]);
|
|
26198
|
-
setError(
|
|
26194
|
+
setError(
|
|
26195
|
+
err instanceof Error ? err.message : t("actionTypes.shared.errors.fetchCollections", { defaultValue: "Failed to fetch {{claimCollections}}", claimCollections: "claim collections" })
|
|
26196
|
+
);
|
|
26199
26197
|
} finally {
|
|
26200
26198
|
setLoadingCollections(false);
|
|
26201
26199
|
}
|
|
@@ -26211,8 +26209,12 @@ var BidConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
26211
26209
|
DataInput,
|
|
26212
26210
|
{
|
|
26213
26211
|
label: "DID",
|
|
26214
|
-
placeholder: "Enter deed DID",
|
|
26215
|
-
description: "
|
|
26212
|
+
placeholder: t("actionTypes.shared.didPlaceholder", { defaultValue: "Enter deed {{did}}", did: "DID" }),
|
|
26213
|
+
description: t("actionTypes.shared.didDescription", {
|
|
26214
|
+
defaultValue: "The {{did}} identifier for fetching {{claimCollections}}.",
|
|
26215
|
+
did: "DID",
|
|
26216
|
+
claimCollections: "claim collections"
|
|
26217
|
+
}),
|
|
26216
26218
|
value: local.deedDid,
|
|
26217
26219
|
onChange: (value) => update({ deedDid: value }),
|
|
26218
26220
|
editorDocument: editor?.document || [],
|
|
@@ -26229,19 +26231,21 @@ var BidConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
26229
26231
|
if (entityDid) update({ deedDid: entityDid });
|
|
26230
26232
|
}
|
|
26231
26233
|
},
|
|
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(
|
|
26234
|
+
t("actionTypes.shared.useCurrentEntity", { defaultValue: "Use Current {{entity}}", entity: "Entity" })
|
|
26235
|
+
), /* @__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
26236
|
BaseSelect,
|
|
26235
26237
|
{
|
|
26236
26238
|
label: "Claim Collection",
|
|
26237
|
-
placeholder: "Select a collection",
|
|
26239
|
+
placeholder: t("actionTypes.shared.collectionPlaceholder", { defaultValue: "Select a collection" }),
|
|
26238
26240
|
value: local.collectionId || null,
|
|
26239
26241
|
onChange: (value) => update({ collectionId: value || "" }),
|
|
26240
26242
|
data: collectionOptions,
|
|
26241
26243
|
required: true,
|
|
26242
26244
|
searchable: true
|
|
26243
26245
|
}
|
|
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" }, "
|
|
26246
|
+
), /* @__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", {
|
|
26247
|
+
defaultValue: "Role selection and survey answers are collected from the user at flow runtime and are not stored in template configuration."
|
|
26248
|
+
}))));
|
|
26245
26249
|
};
|
|
26246
26250
|
|
|
26247
26251
|
// src/mantine/blocks/action/actionTypes/bid/BidFlowDetail.tsx
|
|
@@ -26266,6 +26270,7 @@ var BidFlowDetail = ({
|
|
|
26266
26270
|
unlockSigning,
|
|
26267
26271
|
registerRuntimeInputs
|
|
26268
26272
|
}) => {
|
|
26273
|
+
const t = useTranslate();
|
|
26269
26274
|
const handlers = useBlocknoteHandlers();
|
|
26270
26275
|
const handlersRef = useRef26(handlers);
|
|
26271
26276
|
useEffect91(() => {
|
|
@@ -26339,11 +26344,11 @@ var BidFlowDetail = ({
|
|
|
26339
26344
|
}, [surveyModel]);
|
|
26340
26345
|
const loadSurveyTemplate = useCallback90(async () => {
|
|
26341
26346
|
if (!deedDid) {
|
|
26342
|
-
setError("
|
|
26347
|
+
setError(t("actionTypes.bid.flow.errors.didRequired", { defaultValue: "{{did}} is required in template configuration.", did: "DID" }));
|
|
26343
26348
|
return;
|
|
26344
26349
|
}
|
|
26345
26350
|
if (!collectionId) {
|
|
26346
|
-
setError("
|
|
26351
|
+
setError(t("actionTypes.bid.flow.errors.collectionRequired", { defaultValue: "{{collection}} is required in template configuration.", collection: "Collection" }));
|
|
26347
26352
|
return;
|
|
26348
26353
|
}
|
|
26349
26354
|
const handlers2 = handlersRef.current;
|
|
@@ -26353,13 +26358,13 @@ var BidFlowDetail = ({
|
|
|
26353
26358
|
const result = role === "service_agent" ? await handlers2.getBidContributorSurveyTemplate(deedDid, collectionId) : await handlers2.getBidEvaluatorSurveyTemplate(deedDid, collectionId);
|
|
26354
26359
|
if (!result?.surveyTemplate) {
|
|
26355
26360
|
setSurveyJson(null);
|
|
26356
|
-
setError("No survey template found for the selected role.");
|
|
26361
|
+
setError(t("actionTypes.bid.flow.errors.noSurveyForRole", { defaultValue: "No survey template found for the selected role." }));
|
|
26357
26362
|
return;
|
|
26358
26363
|
}
|
|
26359
26364
|
setSurveyJson(result.surveyTemplate);
|
|
26360
26365
|
} catch (err) {
|
|
26361
26366
|
setSurveyJson(null);
|
|
26362
|
-
setError(err instanceof Error ? err.message : "Failed to load survey template");
|
|
26367
|
+
setError(err instanceof Error ? err.message : t("actionTypes.shared.errors.surveyTemplateLoad", { defaultValue: "Failed to load survey template" }));
|
|
26363
26368
|
} finally {
|
|
26364
26369
|
setLoadingSurvey(false);
|
|
26365
26370
|
}
|
|
@@ -26428,7 +26433,7 @@ var BidFlowDetail = ({
|
|
|
26428
26433
|
}
|
|
26429
26434
|
const actionDef = getAction("qi/bid.submit");
|
|
26430
26435
|
if (!actionDef) {
|
|
26431
|
-
setError("Bid action is not registered");
|
|
26436
|
+
setError(t("actionTypes.bid.flow.errors.actionNotRegistered", { defaultValue: "Bid action is not registered" }));
|
|
26432
26437
|
return;
|
|
26433
26438
|
}
|
|
26434
26439
|
const submissionProps = {
|
|
@@ -26495,7 +26500,7 @@ var BidFlowDetail = ({
|
|
|
26495
26500
|
// TODO: collect PIN from user for invocation signing
|
|
26496
26501
|
});
|
|
26497
26502
|
if (!outcome.success) {
|
|
26498
|
-
throw new Error(outcome.error || "Bid execution failed");
|
|
26503
|
+
throw new Error(outcome.error || t("actionTypes.bid.flow.errors.executionFailed", { defaultValue: "Bid execution failed" }));
|
|
26499
26504
|
}
|
|
26500
26505
|
updateRuntime({
|
|
26501
26506
|
state: "completed",
|
|
@@ -26503,7 +26508,7 @@ var BidFlowDetail = ({
|
|
|
26503
26508
|
output: outcome.result?.payload || {}
|
|
26504
26509
|
});
|
|
26505
26510
|
} catch (err) {
|
|
26506
|
-
const message = err instanceof Error ? err.message : "Failed to submit bid";
|
|
26511
|
+
const message = err instanceof Error ? err.message : t("actionTypes.bid.flow.errors.submitFailed", { defaultValue: "Failed to submit bid" });
|
|
26507
26512
|
if (!submittedEmitted) {
|
|
26508
26513
|
handlers.onAnalyticsEvent?.("editor_flow_submission_failed", { ...submissionProps, reason: message });
|
|
26509
26514
|
}
|
|
@@ -26566,15 +26571,19 @@ var BidFlowDetail = ({
|
|
|
26566
26571
|
surveyModel.tryComplete();
|
|
26567
26572
|
});
|
|
26568
26573
|
}, [provideSigningHandler, surveyModel]);
|
|
26569
|
-
return /* @__PURE__ */ React260.createElement(Stack178, { gap: "md" }, !deedDid || !collectionId ? /* @__PURE__ */ React260.createElement(Alert46, { color: "yellow", styles: actionAlertStyles },
|
|
26574
|
+
return /* @__PURE__ */ React260.createElement(Stack178, { gap: "md" }, !deedDid || !collectionId ? /* @__PURE__ */ React260.createElement(Alert46, { color: "yellow", styles: actionAlertStyles }, t("actionTypes.shared.errors.configRequired", {
|
|
26575
|
+
defaultValue: "Configure {{did}} and {{claimCollection}} in template mode before running this action.",
|
|
26576
|
+
did: "DID",
|
|
26577
|
+
claimCollection: "claim collection"
|
|
26578
|
+
})) : /* @__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
26579
|
BaseSelect,
|
|
26571
26580
|
{
|
|
26572
|
-
label: "Apply As",
|
|
26581
|
+
label: t("actionTypes.bid.flow.applyAs", { defaultValue: "Apply As" }),
|
|
26573
26582
|
value: role,
|
|
26574
26583
|
onChange: (value) => setRole(value || "service_agent"),
|
|
26575
26584
|
data: [
|
|
26576
|
-
{ value: "service_agent", label: "Contributor" },
|
|
26577
|
-
{ value: "evaluation_agent", label: "Evaluator" }
|
|
26585
|
+
{ value: "service_agent", label: t("actionTypes.bid.flow.role.contributor", { defaultValue: "Contributor" }) },
|
|
26586
|
+
{ value: "evaluation_agent", label: t("actionTypes.bid.flow.role.evaluator", { defaultValue: "Evaluator" }) }
|
|
26578
26587
|
],
|
|
26579
26588
|
disabled: isDisabled || submitting || statusLoading || !canSubmit
|
|
26580
26589
|
}
|
|
@@ -26585,8 +26594,8 @@ var BidFlowDetail = ({
|
|
|
26585
26594
|
onClick: loadSurveyTemplate,
|
|
26586
26595
|
disabled: isDisabled || loadingSurvey || submitting || statusLoading || !canSubmit
|
|
26587
26596
|
},
|
|
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 }));
|
|
26597
|
+
loadingSurvey ? t("actionTypes.shared.loadingSurvey", { defaultValue: "Loading Survey..." }) : t("actionTypes.bid.flow.startBidSurvey", { defaultValue: "Start Bid Survey" })
|
|
26598
|
+
)), 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
26599
|
};
|
|
26591
26600
|
|
|
26592
26601
|
// src/mantine/blocks/action/actionTypes/bid/index.ts
|
|
@@ -26621,6 +26630,7 @@ function serializeEvaluateBidActionInputs(inputs) {
|
|
|
26621
26630
|
|
|
26622
26631
|
// src/mantine/blocks/action/actionTypes/evaluateBid/EvaluateBidConfig.tsx
|
|
26623
26632
|
var EvaluateBidConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
26633
|
+
const t = useTranslate();
|
|
26624
26634
|
const handlers = useBlocknoteHandlers();
|
|
26625
26635
|
const [local, setLocal] = useState113(() => parseEvaluateBidActionInputs(inputs));
|
|
26626
26636
|
const [collections, setCollections] = useState113([]);
|
|
@@ -26640,7 +26650,7 @@ var EvaluateBidConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
26640
26650
|
const fetchCollections = useCallback91(async () => {
|
|
26641
26651
|
const deedDid = local.deedDid.trim();
|
|
26642
26652
|
if (!deedDid) {
|
|
26643
|
-
setError("Please enter a
|
|
26653
|
+
setError(t("actionTypes.shared.errors.didRequired", { defaultValue: "Please enter a {{did}} first", did: "DID" }));
|
|
26644
26654
|
return;
|
|
26645
26655
|
}
|
|
26646
26656
|
const persisted = { ...local, deedDid };
|
|
@@ -26653,14 +26663,18 @@ var EvaluateBidConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
26653
26663
|
const fetched = response?.collections || [];
|
|
26654
26664
|
setCollections(fetched);
|
|
26655
26665
|
if (fetched.length === 0) {
|
|
26656
|
-
setError(
|
|
26666
|
+
setError(
|
|
26667
|
+
t("actionTypes.shared.errors.noCollections", { defaultValue: "No {{claimCollections}} found for this {{did}}", claimCollections: "claim collections", did: "DID" })
|
|
26668
|
+
);
|
|
26657
26669
|
}
|
|
26658
26670
|
if (local.collectionId && !fetched.some((c) => c.id === local.collectionId)) {
|
|
26659
26671
|
update({ collectionId: "" });
|
|
26660
26672
|
}
|
|
26661
26673
|
} catch (err) {
|
|
26662
26674
|
setCollections([]);
|
|
26663
|
-
setError(
|
|
26675
|
+
setError(
|
|
26676
|
+
err instanceof Error ? err.message : t("actionTypes.shared.errors.fetchCollections", { defaultValue: "Failed to fetch {{claimCollections}}", claimCollections: "claim collections" })
|
|
26677
|
+
);
|
|
26664
26678
|
} finally {
|
|
26665
26679
|
setLoadingCollections(false);
|
|
26666
26680
|
}
|
|
@@ -26676,8 +26690,12 @@ var EvaluateBidConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
26676
26690
|
DataInput,
|
|
26677
26691
|
{
|
|
26678
26692
|
label: "DID",
|
|
26679
|
-
placeholder: "Enter deed DID",
|
|
26680
|
-
description: "
|
|
26693
|
+
placeholder: t("actionTypes.shared.didPlaceholder", { defaultValue: "Enter deed {{did}}", did: "DID" }),
|
|
26694
|
+
description: t("actionTypes.shared.didDescription", {
|
|
26695
|
+
defaultValue: "The {{did}} identifier for fetching {{claimCollections}}.",
|
|
26696
|
+
did: "DID",
|
|
26697
|
+
claimCollections: "claim collections"
|
|
26698
|
+
}),
|
|
26681
26699
|
value: local.deedDid,
|
|
26682
26700
|
onChange: (value) => update({ deedDid: value }),
|
|
26683
26701
|
editorDocument: editor?.document || [],
|
|
@@ -26694,12 +26712,12 @@ var EvaluateBidConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
26694
26712
|
if (entityDid) update({ deedDid: entityDid });
|
|
26695
26713
|
}
|
|
26696
26714
|
},
|
|
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(
|
|
26715
|
+
t("actionTypes.shared.useCurrentEntity", { defaultValue: "Use Current {{entity}}", entity: "Entity" })
|
|
26716
|
+
), /* @__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
26717
|
BaseSelect,
|
|
26700
26718
|
{
|
|
26701
26719
|
label: "Claim Collection",
|
|
26702
|
-
placeholder: "Select a collection",
|
|
26720
|
+
placeholder: t("actionTypes.shared.collectionPlaceholder", { defaultValue: "Select a collection" }),
|
|
26703
26721
|
value: local.collectionId || null,
|
|
26704
26722
|
onChange: (value) => update({ collectionId: value || "" }),
|
|
26705
26723
|
data: collectionOptions,
|
|
@@ -26741,11 +26759,11 @@ function getRoleColor2(role) {
|
|
|
26741
26759
|
if (r === "evaluation_agent" || r === "ea") return "green";
|
|
26742
26760
|
return "gray";
|
|
26743
26761
|
}
|
|
26744
|
-
function getRoleLabel2(role) {
|
|
26762
|
+
function getRoleLabel2(role, translate) {
|
|
26745
26763
|
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";
|
|
26764
|
+
if (r === "service_agent" || r === "sa") return translate("actionTypes.bid.flow.role.contributor", { defaultValue: "Contributor" });
|
|
26765
|
+
if (r === "evaluation_agent" || r === "ea") return translate("actionTypes.bid.flow.role.evaluator", { defaultValue: "Evaluator" });
|
|
26766
|
+
return role || translate("actionTypes.evaluateBid.flow.role.unknown", { defaultValue: "Unknown" });
|
|
26749
26767
|
}
|
|
26750
26768
|
var USDC_DENOM4 = "ibc/6BBE9BD4246F8E04948D5A4EEE7164B2630263B9EBB5E7DC5F0A46C62A2FF97B";
|
|
26751
26769
|
var IXO_DENOM4 = "uixo";
|
|
@@ -26780,14 +26798,14 @@ function truncateAddress2(address) {
|
|
|
26780
26798
|
if (address.length <= 14) return address;
|
|
26781
26799
|
return `${address.slice(0, 8)}...${address.slice(-3)}`;
|
|
26782
26800
|
}
|
|
26783
|
-
function getBidStatus(bid) {
|
|
26801
|
+
function getBidStatus(bid, translate) {
|
|
26784
26802
|
try {
|
|
26785
26803
|
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" };
|
|
26804
|
+
if (data?.status === "approved") return { label: translate("actionTypes.evaluateBid.flow.status.approved", { defaultValue: "Approved" }), key: "approved", color: "green" };
|
|
26805
|
+
if (data?.status === "rejected") return { label: translate("actionTypes.evaluateBid.flow.status.rejected", { defaultValue: "Rejected" }), key: "rejected", color: "red" };
|
|
26788
26806
|
} catch {
|
|
26789
26807
|
}
|
|
26790
|
-
return { label: "Pending", color: "yellow" };
|
|
26808
|
+
return { label: translate("actionTypes.evaluateBid.flow.status.pending", { defaultValue: "Pending" }), key: "pending", color: "yellow" };
|
|
26791
26809
|
}
|
|
26792
26810
|
var EvaluateBidFlowDetail = ({
|
|
26793
26811
|
inputs,
|
|
@@ -26799,6 +26817,7 @@ var EvaluateBidFlowDetail = ({
|
|
|
26799
26817
|
unlockSigning,
|
|
26800
26818
|
registerRuntimeInputs
|
|
26801
26819
|
}) => {
|
|
26820
|
+
const t = useTranslate();
|
|
26802
26821
|
const handlers = useBlocknoteHandlers();
|
|
26803
26822
|
const handlersRef = useRef27(handlers);
|
|
26804
26823
|
useEffect93(() => {
|
|
@@ -26842,10 +26861,7 @@ var EvaluateBidFlowDetail = ({
|
|
|
26842
26861
|
const selectedBid = useMemo98(() => bids.find((bid) => bid.id === selectedBidId) || null, [bids, selectedBidId]);
|
|
26843
26862
|
const filteredBids = useMemo98(() => {
|
|
26844
26863
|
if (activeFilter === "all") return bids;
|
|
26845
|
-
return bids.filter((bid) =>
|
|
26846
|
-
const status = getBidStatus(bid).label.toLowerCase();
|
|
26847
|
-
return status === activeFilter;
|
|
26848
|
-
});
|
|
26864
|
+
return bids.filter((bid) => getBidStatus(bid, t).key === activeFilter);
|
|
26849
26865
|
}, [bids, activeFilter]);
|
|
26850
26866
|
const refreshBids = useCallback92(async () => {
|
|
26851
26867
|
if (!deedDid || !collectionId) return;
|
|
@@ -26864,7 +26880,7 @@ var EvaluateBidFlowDetail = ({
|
|
|
26864
26880
|
} catch (err) {
|
|
26865
26881
|
setBids([]);
|
|
26866
26882
|
setAdminAddress("");
|
|
26867
|
-
setError(err instanceof Error ? err.message : "Failed to load bids");
|
|
26883
|
+
setError(err instanceof Error ? err.message : t("actionTypes.evaluateBid.flow.errors.loadBids", { defaultValue: "Failed to load bids" }));
|
|
26868
26884
|
} finally {
|
|
26869
26885
|
setLoadingBids(false);
|
|
26870
26886
|
}
|
|
@@ -26978,7 +26994,7 @@ var EvaluateBidFlowDetail = ({
|
|
|
26978
26994
|
const selectedBidIsEvaluator = selectedRole === "evaluation_agent" || selectedRole === "ea";
|
|
26979
26995
|
const actionDef = getAction("qi/bid.evaluate");
|
|
26980
26996
|
if (!actionDef) {
|
|
26981
|
-
setError("evaluateBid action is not registered");
|
|
26997
|
+
setError(t("actionTypes.evaluateBid.flow.errors.actionNotRegistered", { defaultValue: "evaluateBid action is not registered" }));
|
|
26982
26998
|
return;
|
|
26983
26999
|
}
|
|
26984
27000
|
setSubmitting(true);
|
|
@@ -27029,14 +27045,14 @@ var EvaluateBidFlowDetail = ({
|
|
|
27029
27045
|
pin: ""
|
|
27030
27046
|
// TODO: collect PIN from user for invocation signing
|
|
27031
27047
|
});
|
|
27032
|
-
if (!outcome.success) throw new Error(outcome.error || "Bid evaluation failed");
|
|
27048
|
+
if (!outcome.success) throw new Error(outcome.error || t("actionTypes.evaluateBid.flow.errors.evaluationFailed", { defaultValue: "Bid evaluation failed" }));
|
|
27033
27049
|
updateRuntime({ state: "completed", executedAt: Date.now(), output: outcome.result?.payload || {} });
|
|
27034
27050
|
setSelectedBidId("");
|
|
27035
27051
|
setDecision("");
|
|
27036
27052
|
setRejectReason("");
|
|
27037
27053
|
await refreshBids();
|
|
27038
27054
|
} catch (err) {
|
|
27039
|
-
const message = err instanceof Error ? err.message : "Failed to evaluate bid";
|
|
27055
|
+
const message = err instanceof Error ? err.message : t("actionTypes.evaluateBid.flow.errors.evaluateFailed", { defaultValue: "Failed to evaluate bid" });
|
|
27040
27056
|
setError(message);
|
|
27041
27057
|
updateRuntime({ state: "failed", error: { message, at: Date.now() } });
|
|
27042
27058
|
} finally {
|
|
@@ -27068,7 +27084,7 @@ var EvaluateBidFlowDetail = ({
|
|
|
27068
27084
|
refreshBids
|
|
27069
27085
|
]);
|
|
27070
27086
|
if (selectedBid) {
|
|
27071
|
-
const bidStatus = getBidStatus(selectedBid);
|
|
27087
|
+
const bidStatus = getBidStatus(selectedBid, t);
|
|
27072
27088
|
const bidRole = String(selectedBid.role || "").toLowerCase();
|
|
27073
27089
|
const bidIsEvaluator = bidRole === "evaluation_agent" || bidRole === "ea";
|
|
27074
27090
|
const selectedBidProfile = profilesByDid[selectedBid.did];
|
|
@@ -27079,7 +27095,7 @@ var EvaluateBidFlowDetail = ({
|
|
|
27079
27095
|
bidData = typeof selectedBid.data === "string" ? JSON.parse(selectedBid.data) : selectedBid.data;
|
|
27080
27096
|
} catch {
|
|
27081
27097
|
}
|
|
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 } }, "
|
|
27098
|
+
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
27099
|
Box53,
|
|
27084
27100
|
{
|
|
27085
27101
|
style: {
|
|
@@ -27100,7 +27116,7 @@ var EvaluateBidFlowDetail = ({
|
|
|
27100
27116
|
}
|
|
27101
27117
|
},
|
|
27102
27118
|
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(
|
|
27119
|
+
), /* @__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
27120
|
JsonInput,
|
|
27105
27121
|
{
|
|
27106
27122
|
value: JSON.stringify(bidData, null, 2),
|
|
@@ -27120,29 +27136,29 @@ var EvaluateBidFlowDetail = ({
|
|
|
27120
27136
|
}
|
|
27121
27137
|
}
|
|
27122
27138
|
}
|
|
27123
|
-
) : /* @__PURE__ */ React263.createElement(Text158, { size: "xs", c: "dimmed" }, "No input data available.")), /* @__PURE__ */ React263.createElement(
|
|
27139
|
+
) : /* @__PURE__ */ React263.createElement(Text158, { size: "xs", c: "dimmed" }, t("actionTypes.evaluateBid.flow.noInputData", { defaultValue: "No input data available." }))), /* @__PURE__ */ React263.createElement(
|
|
27124
27140
|
BaseSelect,
|
|
27125
27141
|
{
|
|
27126
|
-
label: "Decision",
|
|
27127
|
-
placeholder: "Select decision",
|
|
27142
|
+
label: t("actionTypes.evaluateClaim.flow.decision.label", { defaultValue: "Decision" }),
|
|
27143
|
+
placeholder: t("actionTypes.evaluateClaim.flow.decision.placeholder", { defaultValue: "Select decision" }),
|
|
27128
27144
|
value: decision || null,
|
|
27129
27145
|
onChange: (value) => setDecision(value || ""),
|
|
27130
27146
|
data: [
|
|
27131
|
-
{ value: "approve", label: "Approve" },
|
|
27132
|
-
{ value: "reject", label: "Reject" }
|
|
27147
|
+
{ value: "approve", label: t("actionTypes.evaluateClaim.flow.decision.approve", { defaultValue: "Approve" }) },
|
|
27148
|
+
{ value: "reject", label: t("actionTypes.evaluateClaim.flow.decision.reject", { defaultValue: "Reject" }) }
|
|
27133
27149
|
],
|
|
27134
27150
|
disabled: isDisabled || submitting
|
|
27135
27151
|
}
|
|
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(
|
|
27152
|
+
), 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
27153
|
BaseTextArea,
|
|
27138
27154
|
{
|
|
27139
|
-
placeholder: "Start Typing",
|
|
27155
|
+
placeholder: t("actionTypes.evaluateBid.flow.startTyping", { defaultValue: "Start Typing" }),
|
|
27140
27156
|
value: rejectReason,
|
|
27141
27157
|
onChange: (event) => setRejectReason(event.currentTarget.value),
|
|
27142
27158
|
minRows: 2,
|
|
27143
27159
|
disabled: isDisabled || submitting
|
|
27144
27160
|
}
|
|
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" }, "
|
|
27161
|
+
)), 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
27162
|
BaseSelect,
|
|
27147
27163
|
{
|
|
27148
27164
|
value: row.denom,
|
|
@@ -27150,7 +27166,7 @@ var EvaluateBidFlowDetail = ({
|
|
|
27150
27166
|
data: [
|
|
27151
27167
|
{ value: IXO_DENOM4, label: "IXO" },
|
|
27152
27168
|
{ value: USDC_DENOM4, label: "USDC" },
|
|
27153
|
-
{ value: CUSTOM_DENOM, label: "Custom" }
|
|
27169
|
+
{ value: CUSTOM_DENOM, label: t("actionTypes.evaluateClaim.flow.payment.custom", { defaultValue: "Custom" }) }
|
|
27154
27170
|
],
|
|
27155
27171
|
clearable: false,
|
|
27156
27172
|
disabled: isDisabled || submitting
|
|
@@ -27158,7 +27174,7 @@ var EvaluateBidFlowDetail = ({
|
|
|
27158
27174
|
), row.denom === CUSTOM_DENOM && /* @__PURE__ */ React263.createElement(
|
|
27159
27175
|
BaseTextInput,
|
|
27160
27176
|
{
|
|
27161
|
-
placeholder: "Custom denom (e.g. ibc/... or uixo)",
|
|
27177
|
+
placeholder: t("actionTypes.evaluateClaim.flow.payment.customDenomPlaceholder", { defaultValue: "Custom denom (e.g. ibc/... or uixo)" }),
|
|
27162
27178
|
value: row.customDenom,
|
|
27163
27179
|
onChange: (event) => updatePaymentRow(row.id, { customDenom: event.currentTarget.value }),
|
|
27164
27180
|
disabled: isDisabled || submitting
|
|
@@ -27169,13 +27185,17 @@ var EvaluateBidFlowDetail = ({
|
|
|
27169
27185
|
min: 0,
|
|
27170
27186
|
value: row.amount,
|
|
27171
27187
|
onChange: (value) => updatePaymentRow(row.id, { amount: value }),
|
|
27172
|
-
placeholder: "Amount",
|
|
27188
|
+
placeholder: t("actionTypes.evaluateClaim.flow.payment.amountPlaceholder", { defaultValue: "Amount" }),
|
|
27173
27189
|
disabled: isDisabled || submitting
|
|
27174
27190
|
}
|
|
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));
|
|
27191
|
+
))), /* @__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
27192
|
}
|
|
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 }, "
|
|
27193
|
+
const filterTabs = [{ value: "pending", label: t("actionTypes.evaluateBid.flow.status.pending", { defaultValue: "Pending" }) }];
|
|
27194
|
+
return /* @__PURE__ */ React263.createElement(Stack180, { gap: "md" }, !deedDid || !collectionId ? /* @__PURE__ */ React263.createElement(Alert48, { color: "yellow", styles: actionAlertStyles }, t("actionTypes.shared.errors.configRequired", {
|
|
27195
|
+
defaultValue: "Configure {{did}} and {{claimCollection}} in template mode before running this action.",
|
|
27196
|
+
did: "DID",
|
|
27197
|
+
claimCollection: "claim collection"
|
|
27198
|
+
})) : /* @__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
27199
|
UnstyledButton4,
|
|
27180
27200
|
{
|
|
27181
27201
|
key: tab.value,
|
|
@@ -27189,8 +27209,8 @@ var EvaluateBidFlowDetail = ({
|
|
|
27189
27209
|
}
|
|
27190
27210
|
},
|
|
27191
27211
|
/* @__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);
|
|
27212
|
+
))), /* @__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) => {
|
|
27213
|
+
const status = getBidStatus(bid, t);
|
|
27194
27214
|
const profile = profilesByDid[bid.did];
|
|
27195
27215
|
const displayName = profile?.displayname || bid.did || bid.address;
|
|
27196
27216
|
const avatarLabel = (profile?.displayname || bid.did || bid.address || "?")[0]?.toUpperCase();
|
|
@@ -27253,6 +27273,7 @@ function serializeClaimActionInputs(inputs) {
|
|
|
27253
27273
|
|
|
27254
27274
|
// src/mantine/blocks/action/actionTypes/claim/ClaimConfig.tsx
|
|
27255
27275
|
var ClaimConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
27276
|
+
const t = useTranslate();
|
|
27256
27277
|
const handlers = useBlocknoteHandlers();
|
|
27257
27278
|
const [local, setLocal] = useState116(() => parseClaimActionInputs(inputs));
|
|
27258
27279
|
const [collections, setCollections] = useState116([]);
|
|
@@ -27291,11 +27312,13 @@ var ClaimConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
27291
27312
|
const surveySchema = extractSurveyAnswerSchema(result?.surveyTemplate);
|
|
27292
27313
|
update({ surveyAnswersSchema: surveySchema });
|
|
27293
27314
|
if (surveySchema.length === 0) {
|
|
27294
|
-
setSchemaError(
|
|
27315
|
+
setSchemaError(
|
|
27316
|
+
t("actionTypes.claim.config.surveyHasNoQuestions", { defaultValue: "Survey has no recognised questions \u2014 downstream blocks will only see baseline claim fields." })
|
|
27317
|
+
);
|
|
27295
27318
|
}
|
|
27296
27319
|
} catch (err) {
|
|
27297
27320
|
if (gen !== fetchGenRef.current) return;
|
|
27298
|
-
setSchemaError(err instanceof Error ? err.message : "Failed to load survey template");
|
|
27321
|
+
setSchemaError(err instanceof Error ? err.message : t("actionTypes.shared.errors.surveyTemplateLoad", { defaultValue: "Failed to load survey template" }));
|
|
27299
27322
|
update({ surveyAnswersSchema: [] });
|
|
27300
27323
|
} finally {
|
|
27301
27324
|
if (gen === fetchGenRef.current) setSchemaLoading(false);
|
|
@@ -27311,7 +27334,7 @@ var ClaimConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
27311
27334
|
const fetchCollections = useCallback93(async () => {
|
|
27312
27335
|
const deedDid = local.deedDid.trim();
|
|
27313
27336
|
if (!deedDid) {
|
|
27314
|
-
setError("Please enter a
|
|
27337
|
+
setError(t("actionTypes.shared.errors.didRequired", { defaultValue: "Please enter a {{did}} first", did: "DID" }));
|
|
27315
27338
|
return;
|
|
27316
27339
|
}
|
|
27317
27340
|
const persisted = { ...local, deedDid };
|
|
@@ -27324,14 +27347,18 @@ var ClaimConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
27324
27347
|
const fetched = response?.collections || [];
|
|
27325
27348
|
setCollections(fetched);
|
|
27326
27349
|
if (fetched.length === 0) {
|
|
27327
|
-
setError(
|
|
27350
|
+
setError(
|
|
27351
|
+
t("actionTypes.shared.errors.noCollections", { defaultValue: "No {{claimCollections}} found for this {{did}}", claimCollections: "claim collections", did: "DID" })
|
|
27352
|
+
);
|
|
27328
27353
|
}
|
|
27329
27354
|
if (local.collectionId && !fetched.some((c) => c.id === local.collectionId)) {
|
|
27330
27355
|
update({ collectionId: "" });
|
|
27331
27356
|
}
|
|
27332
27357
|
} catch (err) {
|
|
27333
27358
|
setCollections([]);
|
|
27334
|
-
setError(
|
|
27359
|
+
setError(
|
|
27360
|
+
err instanceof Error ? err.message : t("actionTypes.shared.errors.fetchCollections", { defaultValue: "Failed to fetch {{claimCollections}}", claimCollections: "claim collections" })
|
|
27361
|
+
);
|
|
27335
27362
|
} finally {
|
|
27336
27363
|
setLoadingCollections(false);
|
|
27337
27364
|
}
|
|
@@ -27347,8 +27374,12 @@ var ClaimConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
27347
27374
|
DataInput,
|
|
27348
27375
|
{
|
|
27349
27376
|
label: "DID",
|
|
27350
|
-
placeholder: "Enter deed DID",
|
|
27351
|
-
description: "
|
|
27377
|
+
placeholder: t("actionTypes.shared.didPlaceholder", { defaultValue: "Enter deed {{did}}", did: "DID" }),
|
|
27378
|
+
description: t("actionTypes.shared.didDescription", {
|
|
27379
|
+
defaultValue: "The {{did}} identifier for fetching {{claimCollections}}.",
|
|
27380
|
+
did: "DID",
|
|
27381
|
+
claimCollections: "claim collections"
|
|
27382
|
+
}),
|
|
27352
27383
|
value: local.deedDid,
|
|
27353
27384
|
onChange: (value) => update({ deedDid: value }),
|
|
27354
27385
|
editorDocument: editor?.document || [],
|
|
@@ -27365,12 +27396,12 @@ var ClaimConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
27365
27396
|
if (entityDid) update({ deedDid: entityDid });
|
|
27366
27397
|
}
|
|
27367
27398
|
},
|
|
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(
|
|
27399
|
+
t("actionTypes.shared.useCurrentEntity", { defaultValue: "Use Current {{entity}}", entity: "Entity" })
|
|
27400
|
+
), /* @__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
27401
|
BaseSelect,
|
|
27371
27402
|
{
|
|
27372
27403
|
label: "Claim Collection",
|
|
27373
|
-
placeholder: "Select a collection",
|
|
27404
|
+
placeholder: t("actionTypes.shared.collectionPlaceholder", { defaultValue: "Select a collection" }),
|
|
27374
27405
|
value: local.collectionId || null,
|
|
27375
27406
|
onChange: (value) => {
|
|
27376
27407
|
const next = value || "";
|
|
@@ -27380,7 +27411,10 @@ var ClaimConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
27380
27411
|
required: true,
|
|
27381
27412
|
searchable: true
|
|
27382
27413
|
}
|
|
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" },
|
|
27414
|
+
), 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", {
|
|
27415
|
+
count: local.surveyAnswersSchema.length,
|
|
27416
|
+
defaultValue: local.surveyAnswersSchema.length === 1 ? "typed survey field" : "typed survey fields"
|
|
27417
|
+
}), ". ", 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
27418
|
};
|
|
27385
27419
|
|
|
27386
27420
|
// src/mantine/blocks/action/actionTypes/claim/ClaimFlowDetail.tsx
|
|
@@ -27427,6 +27461,7 @@ var ClaimFlowDetail = ({
|
|
|
27427
27461
|
unlockSigning,
|
|
27428
27462
|
registerRuntimeInputs
|
|
27429
27463
|
}) => {
|
|
27464
|
+
const t = useTranslate();
|
|
27430
27465
|
const handlers = useBlocknoteHandlers();
|
|
27431
27466
|
const handlersRef = useRef29(handlers);
|
|
27432
27467
|
useEffect95(() => {
|
|
@@ -27565,7 +27600,7 @@ var ClaimFlowDetail = ({
|
|
|
27565
27600
|
} catch (err) {
|
|
27566
27601
|
setClaims([]);
|
|
27567
27602
|
setAdminAddress("");
|
|
27568
|
-
setError(err instanceof Error ? err.message : "Failed to load claim data");
|
|
27603
|
+
setError(err instanceof Error ? err.message : t("actionTypes.claim.flow.errors.loadClaimData", { defaultValue: "Failed to load claim data" }));
|
|
27569
27604
|
} finally {
|
|
27570
27605
|
setLoadingClaims(false);
|
|
27571
27606
|
}
|
|
@@ -27653,7 +27688,7 @@ var ClaimFlowDetail = ({
|
|
|
27653
27688
|
} catch (err) {
|
|
27654
27689
|
if (mounted) {
|
|
27655
27690
|
setIsServiceAgentAuthorized(false);
|
|
27656
|
-
setAuthError(err instanceof Error ? err.message : "Failed to verify authorization");
|
|
27691
|
+
setAuthError(err instanceof Error ? err.message : t("actionTypes.claim.flow.errors.verifyAuth", { defaultValue: "Failed to verify authorization" }));
|
|
27657
27692
|
}
|
|
27658
27693
|
} finally {
|
|
27659
27694
|
if (mounted) {
|
|
@@ -27688,7 +27723,7 @@ var ClaimFlowDetail = ({
|
|
|
27688
27723
|
setSurveyJson(templateResult.surveyTemplate);
|
|
27689
27724
|
}
|
|
27690
27725
|
} catch (err) {
|
|
27691
|
-
if (!cancelled) setError(err instanceof Error ? err.message : "Failed to load claim details");
|
|
27726
|
+
if (!cancelled) setError(err instanceof Error ? err.message : t("actionTypes.claim.flow.errors.loadClaimDetails", { defaultValue: "Failed to load claim details" }));
|
|
27692
27727
|
} finally {
|
|
27693
27728
|
if (!cancelled) setLoadingClaimDetail(false);
|
|
27694
27729
|
}
|
|
@@ -27726,13 +27761,13 @@ var ClaimFlowDetail = ({
|
|
|
27726
27761
|
const template = await handlers2.getDeedSurveyTemplate(deedDid, collectionId);
|
|
27727
27762
|
if (!template?.surveyTemplate) {
|
|
27728
27763
|
setSurveyJson(null);
|
|
27729
|
-
setError("No survey template found for this DID");
|
|
27764
|
+
setError(t("actionTypes.claim.flow.errors.noSurveyTemplate", { defaultValue: "No survey template found for this {{did}}", did: "DID" }));
|
|
27730
27765
|
return;
|
|
27731
27766
|
}
|
|
27732
27767
|
setSurveyJson(template.surveyTemplate);
|
|
27733
27768
|
} catch (err) {
|
|
27734
27769
|
setSurveyJson(null);
|
|
27735
|
-
setError(err instanceof Error ? err.message : "Failed to load survey template");
|
|
27770
|
+
setError(err instanceof Error ? err.message : t("actionTypes.shared.errors.surveyTemplateLoad", { defaultValue: "Failed to load survey template" }));
|
|
27736
27771
|
} finally {
|
|
27737
27772
|
setLoadingSurvey(false);
|
|
27738
27773
|
}
|
|
@@ -27740,16 +27775,16 @@ var ClaimFlowDetail = ({
|
|
|
27740
27775
|
const handleSurveyComplete = useCallback94(
|
|
27741
27776
|
async (sender) => {
|
|
27742
27777
|
if (authChecking || !isServiceAgentAuthorized) {
|
|
27743
|
-
setError("You need service agent authorization for this collection to submit claims.");
|
|
27778
|
+
setError(t("actionTypes.claim.flow.errors.notAuthorized", { defaultValue: "You need service agent authorization for this collection to submit claims." }));
|
|
27744
27779
|
return;
|
|
27745
27780
|
}
|
|
27746
27781
|
if (!adminAddress) {
|
|
27747
|
-
setError("Admin address could not be resolved for this collection");
|
|
27782
|
+
setError(t("actionTypes.claim.flow.errors.noAdminAddress", { defaultValue: "Admin address could not be resolved for this collection" }));
|
|
27748
27783
|
return;
|
|
27749
27784
|
}
|
|
27750
27785
|
const actionDef = getAction("qi/claim.submit");
|
|
27751
27786
|
if (!actionDef) {
|
|
27752
|
-
setError("claim action is not registered");
|
|
27787
|
+
setError(t("actionTypes.claim.flow.errors.actionNotRegistered", { defaultValue: "claim action is not registered" }));
|
|
27753
27788
|
return;
|
|
27754
27789
|
}
|
|
27755
27790
|
const submissionProps = {
|
|
@@ -27817,7 +27852,7 @@ var ClaimFlowDetail = ({
|
|
|
27817
27852
|
// TODO: collect PIN from user for invocation signing
|
|
27818
27853
|
});
|
|
27819
27854
|
if (!outcome.success) {
|
|
27820
|
-
throw new Error(outcome.error || "Claim execution failed");
|
|
27855
|
+
throw new Error(outcome.error || t("actionTypes.claim.flow.errors.executionFailed", { defaultValue: "Claim execution failed" }));
|
|
27821
27856
|
}
|
|
27822
27857
|
const output = outcome.result?.payload || {};
|
|
27823
27858
|
updateRuntime({
|
|
@@ -27832,7 +27867,7 @@ var ClaimFlowDetail = ({
|
|
|
27832
27867
|
setPrefillData(null);
|
|
27833
27868
|
await fetchClaimsAndAdmin();
|
|
27834
27869
|
} catch (err) {
|
|
27835
|
-
const message = err instanceof Error ? err.message : "Failed to submit claim";
|
|
27870
|
+
const message = err instanceof Error ? err.message : t("actionTypes.claim.flow.errors.submitFailed", { defaultValue: "Failed to submit claim" });
|
|
27836
27871
|
if (!submittedEmitted) {
|
|
27837
27872
|
handlers.onAnalyticsEvent?.("editor_flow_submission_failed", { ...submissionProps, reason: message });
|
|
27838
27873
|
}
|
|
@@ -27892,17 +27927,24 @@ var ClaimFlowDetail = ({
|
|
|
27892
27927
|
});
|
|
27893
27928
|
}, [surveyModel, handlers, editor, deedDid, collectionId, block.id, block?.props?.title]);
|
|
27894
27929
|
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
|
-
|
|
27930
|
+
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", {
|
|
27931
|
+
address: truncateAddress3(disputeDetails.evaluatorDid),
|
|
27932
|
+
defaultValue: `By ${truncateAddress3(disputeDetails.evaluatorDid)}`
|
|
27933
|
+
}) : "", 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));
|
|
27934
|
+
}
|
|
27935
|
+
return /* @__PURE__ */ React265.createElement(Stack182, { gap: "md" }, !deedDid || !collectionId ? /* @__PURE__ */ React265.createElement(Alert50, { color: "yellow", styles: actionAlertStyles }, t("actionTypes.shared.errors.configRequired", {
|
|
27936
|
+
defaultValue: "Configure {{did}} and {{claimCollection}} in template mode before running this action.",
|
|
27937
|
+
did: "DID",
|
|
27938
|
+
claimCollection: "claim collection"
|
|
27939
|
+
})) : /* @__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
27940
|
BasePrimaryButton,
|
|
27899
27941
|
{
|
|
27900
27942
|
leftSection: loadingSurvey || authChecking ? /* @__PURE__ */ React265.createElement(Loader47, { size: 14 }) : /* @__PURE__ */ React265.createElement(IconPlayerPlay4, { size: 14 }),
|
|
27901
27943
|
onClick: startSurvey,
|
|
27902
27944
|
disabled: isDisabled || loadingSurvey || submitting || authChecking || !isServiceAgentAuthorized || !adminAddress
|
|
27903
27945
|
},
|
|
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) => {
|
|
27946
|
+
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" })
|
|
27947
|
+
), !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
27948
|
const status = getClaimStatusInfo(claim);
|
|
27907
27949
|
const profile = profilesByDid[claim.agentDid];
|
|
27908
27950
|
const displayName = profile?.displayname || claim.agentDid || claim.agentAddress;
|
|
@@ -27929,7 +27971,7 @@ var ClaimFlowDetail = ({
|
|
|
27929
27971
|
},
|
|
27930
27972
|
profile?.avatarUrl ? null : avatarLabel
|
|
27931
27973
|
), /* @__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));
|
|
27974
|
+
}))), 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
27975
|
};
|
|
27934
27976
|
|
|
27935
27977
|
// src/mantine/blocks/action/actionTypes/claim/index.ts
|
|
@@ -27970,6 +28012,7 @@ function serializeEvaluateClaimActionInputs(inputs) {
|
|
|
27970
28012
|
|
|
27971
28013
|
// src/mantine/blocks/action/actionTypes/evaluateClaim/EvaluateClaimConfig.tsx
|
|
27972
28014
|
var EvaluateClaimConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
28015
|
+
const t = useTranslate();
|
|
27973
28016
|
const handlers = useBlocknoteHandlers();
|
|
27974
28017
|
const [local, setLocal] = useState118(() => parseEvaluateClaimActionInputs(inputs));
|
|
27975
28018
|
const [collections, setCollections] = useState118([]);
|
|
@@ -28008,11 +28051,15 @@ var EvaluateClaimConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
28008
28051
|
const surveySchema = extractSurveyAnswerSchema(result?.surveyTemplate);
|
|
28009
28052
|
update({ surveyAnswersSchema: surveySchema });
|
|
28010
28053
|
if (surveySchema.length === 0) {
|
|
28011
|
-
setSchemaError(
|
|
28054
|
+
setSchemaError(
|
|
28055
|
+
t("actionTypes.evaluateClaim.config.surveyHasNoQuestions", {
|
|
28056
|
+
defaultValue: "Survey has no recognised questions \u2014 downstream blocks will only see baseline evaluation fields."
|
|
28057
|
+
})
|
|
28058
|
+
);
|
|
28012
28059
|
}
|
|
28013
28060
|
} catch (err) {
|
|
28014
28061
|
if (gen !== fetchGenRef.current) return;
|
|
28015
|
-
setSchemaError(err instanceof Error ? err.message : "Failed to load survey template");
|
|
28062
|
+
setSchemaError(err instanceof Error ? err.message : t("actionTypes.shared.errors.surveyTemplateLoad", { defaultValue: "Failed to load survey template" }));
|
|
28016
28063
|
update({ surveyAnswersSchema: [] });
|
|
28017
28064
|
} finally {
|
|
28018
28065
|
if (gen === fetchGenRef.current) setSchemaLoading(false);
|
|
@@ -28028,7 +28075,7 @@ var EvaluateClaimConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
28028
28075
|
const fetchCollections = useCallback95(async () => {
|
|
28029
28076
|
const deedDid = local.deedDid.trim();
|
|
28030
28077
|
if (!deedDid) {
|
|
28031
|
-
setError("Please enter a
|
|
28078
|
+
setError(t("actionTypes.shared.errors.didRequired", { defaultValue: "Please enter a {{did}} first", did: "DID" }));
|
|
28032
28079
|
return;
|
|
28033
28080
|
}
|
|
28034
28081
|
const persisted = { ...local, deedDid };
|
|
@@ -28041,14 +28088,18 @@ var EvaluateClaimConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
28041
28088
|
const fetched = response?.collections || [];
|
|
28042
28089
|
setCollections(fetched);
|
|
28043
28090
|
if (fetched.length === 0) {
|
|
28044
|
-
setError(
|
|
28091
|
+
setError(
|
|
28092
|
+
t("actionTypes.shared.errors.noCollections", { defaultValue: "No {{claimCollections}} found for this {{did}}", claimCollections: "claim collections", did: "DID" })
|
|
28093
|
+
);
|
|
28045
28094
|
}
|
|
28046
28095
|
if (local.collectionId && !fetched.some((c) => c.id === local.collectionId)) {
|
|
28047
28096
|
update({ collectionId: "" });
|
|
28048
28097
|
}
|
|
28049
28098
|
} catch (err) {
|
|
28050
28099
|
setCollections([]);
|
|
28051
|
-
setError(
|
|
28100
|
+
setError(
|
|
28101
|
+
err instanceof Error ? err.message : t("actionTypes.shared.errors.fetchCollections", { defaultValue: "Failed to fetch {{claimCollections}}", claimCollections: "claim collections" })
|
|
28102
|
+
);
|
|
28052
28103
|
} finally {
|
|
28053
28104
|
setLoadingCollections(false);
|
|
28054
28105
|
}
|
|
@@ -28066,8 +28117,12 @@ var EvaluateClaimConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
28066
28117
|
DataInput,
|
|
28067
28118
|
{
|
|
28068
28119
|
label: "DID",
|
|
28069
|
-
placeholder: "Enter deed DID",
|
|
28070
|
-
description: "
|
|
28120
|
+
placeholder: t("actionTypes.shared.didPlaceholder", { defaultValue: "Enter deed {{did}}", did: "DID" }),
|
|
28121
|
+
description: t("actionTypes.shared.didDescription", {
|
|
28122
|
+
defaultValue: "The {{did}} identifier for fetching {{claimCollections}}.",
|
|
28123
|
+
did: "DID",
|
|
28124
|
+
claimCollections: "claim collections"
|
|
28125
|
+
}),
|
|
28071
28126
|
value: local.deedDid,
|
|
28072
28127
|
onChange: (value) => update({ deedDid: value }),
|
|
28073
28128
|
editorDocument: editor?.document || [],
|
|
@@ -28084,12 +28139,12 @@ var EvaluateClaimConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
28084
28139
|
if (entityDid) update({ deedDid: entityDid });
|
|
28085
28140
|
}
|
|
28086
28141
|
},
|
|
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(
|
|
28142
|
+
t("actionTypes.shared.useCurrentEntity", { defaultValue: "Use Current {{entity}}", entity: "Entity" })
|
|
28143
|
+
), /* @__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
28144
|
BaseSelect,
|
|
28090
28145
|
{
|
|
28091
28146
|
label: "Claim Collection",
|
|
28092
|
-
placeholder: "Select a collection",
|
|
28147
|
+
placeholder: t("actionTypes.shared.collectionPlaceholder", { defaultValue: "Select a collection" }),
|
|
28093
28148
|
value: local.collectionId || null,
|
|
28094
28149
|
onChange: (value) => {
|
|
28095
28150
|
const next = value || "";
|
|
@@ -28099,11 +28154,17 @@ var EvaluateClaimConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
28099
28154
|
required: true,
|
|
28100
28155
|
searchable: true
|
|
28101
28156
|
}
|
|
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" },
|
|
28157
|
+
), 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", {
|
|
28158
|
+
count: local.surveyAnswersSchema.length,
|
|
28159
|
+
defaultValue: local.surveyAnswersSchema.length === 1 ? "typed field" : "typed fields"
|
|
28160
|
+
}), ". ", 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", {
|
|
28161
|
+
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.",
|
|
28162
|
+
xero: "Xero"
|
|
28163
|
+
})), /* @__PURE__ */ React266.createElement(
|
|
28103
28164
|
BaseSelect,
|
|
28104
28165
|
{
|
|
28105
|
-
label: "
|
|
28106
|
-
placeholder: xeroInvoiceOptions.length === 0 ? "No invoice blocks in this flow" : "Select a block",
|
|
28166
|
+
label: t("actionTypes.evaluateClaim.config.xeroInvoiceBlock", { defaultValue: "{{xero}} invoice block", xero: "Xero" }),
|
|
28167
|
+
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
28168
|
value: local.xeroInvoiceBlockId || null,
|
|
28108
28169
|
onChange: (value) => update({ xeroInvoiceBlockId: value || "" }),
|
|
28109
28170
|
data: xeroInvoiceOptions,
|
|
@@ -28114,8 +28175,8 @@ var EvaluateClaimConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
28114
28175
|
), /* @__PURE__ */ React266.createElement(
|
|
28115
28176
|
BaseSelect,
|
|
28116
28177
|
{
|
|
28117
|
-
label: "
|
|
28118
|
-
placeholder: xeroPaymentOptions.length === 0 ? "No payment blocks in this flow" : "Select a block",
|
|
28178
|
+
label: t("actionTypes.evaluateClaim.config.xeroPaymentBlock", { defaultValue: "{{xero}} payment block (settlement)", xero: "Xero" }),
|
|
28179
|
+
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
28180
|
value: local.xeroPaymentBlockId || null,
|
|
28120
28181
|
onChange: (value) => update({ xeroPaymentBlockId: value || "" }),
|
|
28121
28182
|
data: xeroPaymentOptions,
|
|
@@ -28336,6 +28397,7 @@ function isImage(file) {
|
|
|
28336
28397
|
return t.startsWith("image/") || ["png", "jpg", "jpeg", "gif", "webp", "svg", "bmp"].includes(ext);
|
|
28337
28398
|
}
|
|
28338
28399
|
var ClaimAttachments = ({ surveyModel, credentialSubject }) => {
|
|
28400
|
+
const t = useTranslate();
|
|
28339
28401
|
const { fetchClaimMedia } = useBlocknoteHandlers();
|
|
28340
28402
|
const [active, setActive] = useState119(null);
|
|
28341
28403
|
const [resolved, setResolved] = useState119({});
|
|
@@ -28438,7 +28500,7 @@ var ClaimAttachments = ({ surveyModel, credentialSubject }) => {
|
|
|
28438
28500
|
[fetchClaimMedia, resolveBlob]
|
|
28439
28501
|
);
|
|
28440
28502
|
if (items.length === 0) {
|
|
28441
|
-
return /* @__PURE__ */ React268.createElement(Text163, { size: "xs", c: "dimmed" }, "No attachments in this submission.");
|
|
28503
|
+
return /* @__PURE__ */ React268.createElement(Text163, { size: "xs", c: "dimmed" }, t("actionTypes.evaluateClaim.attachments.empty", { defaultValue: "No attachments in this submission." }));
|
|
28442
28504
|
}
|
|
28443
28505
|
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
28506
|
const IconCmp = kindIcon(item);
|
|
@@ -28536,6 +28598,7 @@ var EvaluateClaimFlowDetail = ({
|
|
|
28536
28598
|
unlockSigning,
|
|
28537
28599
|
registerRuntimeInputs
|
|
28538
28600
|
}) => {
|
|
28601
|
+
const t = useTranslate();
|
|
28539
28602
|
const handlers = useBlocknoteHandlers();
|
|
28540
28603
|
const handlersRef = useRef32(handlers);
|
|
28541
28604
|
useEffect98(() => {
|
|
@@ -28592,6 +28655,8 @@ var EvaluateClaimFlowDetail = ({
|
|
|
28592
28655
|
const [profilesByDid, setProfilesByDid] = useState120({});
|
|
28593
28656
|
const [disputeDetails, setDisputeDetails] = useState120(null);
|
|
28594
28657
|
const [loadingDispute, setLoadingDispute] = useState120(false);
|
|
28658
|
+
const [evaluationOutcomePatch, setEvaluationOutcomePatch] = useState120(null);
|
|
28659
|
+
const [evaluationAmount, setEvaluationAmount] = useState120(null);
|
|
28595
28660
|
const xeroBlocks = useMemo103(
|
|
28596
28661
|
() => resolveXeroBindings(editor?.document, parsed.xeroInvoiceBlockId, parsed.xeroPaymentBlockId),
|
|
28597
28662
|
[editor, parsed.xeroInvoiceBlockId, parsed.xeroPaymentBlockId]
|
|
@@ -28781,6 +28846,18 @@ var EvaluateClaimFlowDetail = ({
|
|
|
28781
28846
|
});
|
|
28782
28847
|
return model;
|
|
28783
28848
|
}, [outcomeTemplateJson]);
|
|
28849
|
+
useEffect98(() => {
|
|
28850
|
+
if (!outcomeSurveyModel) return;
|
|
28851
|
+
const evaluated = selectedClaim ? isClaimEvaluated(selectedClaim) : false;
|
|
28852
|
+
if (evaluated) {
|
|
28853
|
+
if (evaluationOutcomePatch) {
|
|
28854
|
+
outcomeSurveyModel.data = evaluationOutcomePatch;
|
|
28855
|
+
}
|
|
28856
|
+
outcomeSurveyModel.mode = "display";
|
|
28857
|
+
} else {
|
|
28858
|
+
outcomeSurveyModel.mode = "edit";
|
|
28859
|
+
}
|
|
28860
|
+
}, [outcomeSurveyModel, evaluationOutcomePatch, selectedClaim]);
|
|
28784
28861
|
const refreshClaims = useCallback97(async () => {
|
|
28785
28862
|
if (!deedDid || !collectionId) return;
|
|
28786
28863
|
const handlers2 = handlersRef.current;
|
|
@@ -28798,7 +28875,7 @@ var EvaluateClaimFlowDetail = ({
|
|
|
28798
28875
|
} catch (err) {
|
|
28799
28876
|
setClaims([]);
|
|
28800
28877
|
setAdminAddress("");
|
|
28801
|
-
setError(err instanceof Error ? err.message : "Failed to load claims");
|
|
28878
|
+
setError(err instanceof Error ? err.message : t("actionTypes.evaluateClaim.flow.errors.loadClaims", { defaultValue: "Failed to load claims" }));
|
|
28802
28879
|
} finally {
|
|
28803
28880
|
setLoadingClaims(false);
|
|
28804
28881
|
}
|
|
@@ -28842,7 +28919,7 @@ var EvaluateClaimFlowDetail = ({
|
|
|
28842
28919
|
} catch (evalErr) {
|
|
28843
28920
|
setEvaluationResult({
|
|
28844
28921
|
success: false,
|
|
28845
|
-
error: evalErr instanceof Error ? evalErr.message : "Failed to evaluate claim with rubric"
|
|
28922
|
+
error: evalErr instanceof Error ? evalErr.message : t("actionTypes.evaluateClaim.flow.errors.rubricEvaluation", { defaultValue: "Failed to evaluate claim with rubric" })
|
|
28846
28923
|
});
|
|
28847
28924
|
} finally {
|
|
28848
28925
|
setEvaluationLoading(false);
|
|
@@ -28852,7 +28929,7 @@ var EvaluateClaimFlowDetail = ({
|
|
|
28852
28929
|
setClaimData(null);
|
|
28853
28930
|
setSurveyJson(null);
|
|
28854
28931
|
setEvaluationResult(null);
|
|
28855
|
-
setError(err instanceof Error ? err.message : "Failed to load claim details");
|
|
28932
|
+
setError(err instanceof Error ? err.message : t("actionTypes.claim.flow.errors.loadClaimDetails", { defaultValue: "Failed to load claim details" }));
|
|
28856
28933
|
} finally {
|
|
28857
28934
|
setSurveyLoading(false);
|
|
28858
28935
|
}
|
|
@@ -28904,7 +28981,7 @@ var EvaluateClaimFlowDetail = ({
|
|
|
28904
28981
|
if (cancelled) return;
|
|
28905
28982
|
setInvoiceRunInputs(null);
|
|
28906
28983
|
setInvoicePreview(null);
|
|
28907
|
-
setInvoicePreviewError(err instanceof Error ? err.message : "Failed to resolve bill preview.");
|
|
28984
|
+
setInvoicePreviewError(err instanceof Error ? err.message : t("actionTypes.evaluateClaim.flow.errors.billPreview", { defaultValue: "Failed to resolve bill preview." }));
|
|
28908
28985
|
}
|
|
28909
28986
|
};
|
|
28910
28987
|
void run();
|
|
@@ -29001,7 +29078,7 @@ var EvaluateClaimFlowDetail = ({
|
|
|
29001
29078
|
} catch (err) {
|
|
29002
29079
|
if (mounted) {
|
|
29003
29080
|
setIsEvaluatorAuthorized(false);
|
|
29004
|
-
setAuthError(err instanceof Error ? err.message : "Failed to verify authorization");
|
|
29081
|
+
setAuthError(err instanceof Error ? err.message : t("actionTypes.claim.flow.errors.verifyAuth", { defaultValue: "Failed to verify authorization" }));
|
|
29005
29082
|
}
|
|
29006
29083
|
} finally {
|
|
29007
29084
|
if (mounted) {
|
|
@@ -29020,6 +29097,8 @@ var EvaluateClaimFlowDetail = ({
|
|
|
29020
29097
|
setSurveyJson(null);
|
|
29021
29098
|
setEvaluationResult(null);
|
|
29022
29099
|
setDisputeDetails(null);
|
|
29100
|
+
setEvaluationOutcomePatch(null);
|
|
29101
|
+
setEvaluationAmount(null);
|
|
29023
29102
|
return void 0;
|
|
29024
29103
|
}
|
|
29025
29104
|
const handlers2 = handlersRef.current;
|
|
@@ -29028,10 +29107,14 @@ var EvaluateClaimFlowDetail = ({
|
|
|
29028
29107
|
setPaymentRows([createPaymentRow2()]);
|
|
29029
29108
|
setOutcomeResponses({});
|
|
29030
29109
|
setOutcomeComplete(false);
|
|
29110
|
+
setEvaluationOutcomePatch(null);
|
|
29111
|
+
setEvaluationAmount(null);
|
|
29031
29112
|
loadClaimDetail(selectedClaim);
|
|
29032
|
-
|
|
29113
|
+
let cancelled = false;
|
|
29114
|
+
const claimStatusKey = getClaimStatusInfo(selectedClaim).key;
|
|
29115
|
+
const isDisputed = claimStatusKey === "disputed";
|
|
29116
|
+
const isEvaluated = isClaimEvaluated(selectedClaim);
|
|
29033
29117
|
if (isDisputed && typeof handlers2.getClaimDisputeDetails === "function") {
|
|
29034
|
-
let cancelled = false;
|
|
29035
29118
|
setLoadingDispute(true);
|
|
29036
29119
|
handlers2.getClaimDisputeDetails(selectedClaim.claimId).then((details) => {
|
|
29037
29120
|
if (!cancelled) setDisputeDetails(details);
|
|
@@ -29040,12 +29123,23 @@ var EvaluateClaimFlowDetail = ({
|
|
|
29040
29123
|
}).finally(() => {
|
|
29041
29124
|
if (!cancelled) setLoadingDispute(false);
|
|
29042
29125
|
});
|
|
29043
|
-
|
|
29044
|
-
|
|
29045
|
-
};
|
|
29126
|
+
} else {
|
|
29127
|
+
setDisputeDetails(null);
|
|
29046
29128
|
}
|
|
29047
|
-
|
|
29048
|
-
|
|
29129
|
+
if (isEvaluated && typeof handlers2.getClaimEvaluationDetails === "function") {
|
|
29130
|
+
handlers2.getClaimEvaluationDetails(selectedClaim.claimId).then((details) => {
|
|
29131
|
+
if (cancelled) return;
|
|
29132
|
+
setEvaluationOutcomePatch(details?.patch ?? null);
|
|
29133
|
+
setEvaluationAmount(Array.isArray(details?.amount) && details.amount.length > 0 ? details.amount : null);
|
|
29134
|
+
}).catch(() => {
|
|
29135
|
+
if (cancelled) return;
|
|
29136
|
+
setEvaluationOutcomePatch(null);
|
|
29137
|
+
setEvaluationAmount(null);
|
|
29138
|
+
});
|
|
29139
|
+
}
|
|
29140
|
+
return () => {
|
|
29141
|
+
cancelled = true;
|
|
29142
|
+
};
|
|
29049
29143
|
}, [selectedClaim, loadClaimDetail]);
|
|
29050
29144
|
const isClaimAlreadyEvaluated = useMemo103(() => {
|
|
29051
29145
|
if (!selectedClaim) return false;
|
|
@@ -29108,7 +29202,9 @@ var EvaluateClaimFlowDetail = ({
|
|
|
29108
29202
|
const invoiceId = String(output.invoiceId || "");
|
|
29109
29203
|
if (!invoiceId) {
|
|
29110
29204
|
xwarn("handleCaptureBill: Xero returned no invoiceId", { output });
|
|
29111
|
-
throw new Error(
|
|
29205
|
+
throw new Error(
|
|
29206
|
+
t("actionTypes.evaluateClaim.flow.errors.noInvoiceId", { defaultValue: "{{xero}} did not return an InvoiceID \u2014 bill may not have been created.", xero: "Xero" })
|
|
29207
|
+
);
|
|
29112
29208
|
}
|
|
29113
29209
|
const invoiceTotal = typeof output.total === "number" ? output.total : Number(output.total);
|
|
29114
29210
|
const invoiceTotalForCache = Number.isFinite(invoiceTotal) && invoiceTotal > 0 ? invoiceTotal : void 0;
|
|
@@ -29120,7 +29216,7 @@ var EvaluateClaimFlowDetail = ({
|
|
|
29120
29216
|
capturedAt: Date.now()
|
|
29121
29217
|
});
|
|
29122
29218
|
} catch (err) {
|
|
29123
|
-
const message = err instanceof Error ? err.message : "Failed to capture bill in Xero";
|
|
29219
|
+
const message = err instanceof Error ? err.message : t("actionTypes.evaluateClaim.flow.errors.captureBill", { defaultValue: "Failed to capture bill in {{xero}}", xero: "Xero" });
|
|
29124
29220
|
xwarn("handleCaptureBill: error", { error: message });
|
|
29125
29221
|
setCaptureError(message);
|
|
29126
29222
|
} finally {
|
|
@@ -29198,7 +29294,7 @@ var EvaluateClaimFlowDetail = ({
|
|
|
29198
29294
|
});
|
|
29199
29295
|
}
|
|
29200
29296
|
} catch (err) {
|
|
29201
|
-
const message = err instanceof Error ? err.message : "Failed to record payment in Xero";
|
|
29297
|
+
const message = err instanceof Error ? err.message : t("actionTypes.evaluateClaim.flow.errors.recordPayment", { defaultValue: "Failed to record payment in {{xero}}", xero: "Xero" });
|
|
29202
29298
|
xwarn("runSettlement: error", { error: message });
|
|
29203
29299
|
setSettlementError(message);
|
|
29204
29300
|
}
|
|
@@ -29260,7 +29356,7 @@ var EvaluateClaimFlowDetail = ({
|
|
|
29260
29356
|
try {
|
|
29261
29357
|
if (isDispute) {
|
|
29262
29358
|
if (!services.claim?.disputeClaim) {
|
|
29263
|
-
throw new Error("disputeClaim handler is not available on the claim service");
|
|
29359
|
+
throw new Error(t("actionTypes.evaluateClaim.flow.errors.disputeHandlerMissing", { defaultValue: "disputeClaim handler is not available on the claim service" }));
|
|
29264
29360
|
}
|
|
29265
29361
|
await services.claim.disputeClaim(actorDid, deedDid, {
|
|
29266
29362
|
subjectId: selectedClaim.claimId,
|
|
@@ -29284,7 +29380,7 @@ var EvaluateClaimFlowDetail = ({
|
|
|
29284
29380
|
return;
|
|
29285
29381
|
}
|
|
29286
29382
|
const actionDef = getAction("qi/claim.evaluate");
|
|
29287
|
-
if (!actionDef) throw new Error("evaluateClaim action is not registered");
|
|
29383
|
+
if (!actionDef) throw new Error(t("actionTypes.evaluateClaim.flow.errors.actionNotRegistered", { defaultValue: "evaluateClaim action is not registered" }));
|
|
29288
29384
|
let actionEvents = [];
|
|
29289
29385
|
const outcome = await executeNode({
|
|
29290
29386
|
node: flowNode,
|
|
@@ -29341,7 +29437,7 @@ var EvaluateClaimFlowDetail = ({
|
|
|
29341
29437
|
},
|
|
29342
29438
|
pin: ""
|
|
29343
29439
|
});
|
|
29344
|
-
if (!outcome.success) throw new Error(outcome.error || "Claim evaluation failed");
|
|
29440
|
+
if (!outcome.success) throw new Error(outcome.error || t("actionTypes.evaluateClaim.flow.errors.evaluationFailed", { defaultValue: "Claim evaluation failed" }));
|
|
29345
29441
|
const output = outcome.result?.payload || {};
|
|
29346
29442
|
updateRuntime({ state: "completed", executedAt: Date.now(), error: void 0, output });
|
|
29347
29443
|
if (actionEvents.length > 0) {
|
|
@@ -29369,7 +29465,7 @@ var EvaluateClaimFlowDetail = ({
|
|
|
29369
29465
|
setDecision("");
|
|
29370
29466
|
await refreshClaims();
|
|
29371
29467
|
} catch (err) {
|
|
29372
|
-
const message = err instanceof Error ? err.message : "Failed to evaluate claim";
|
|
29468
|
+
const message = err instanceof Error ? err.message : t("actionTypes.evaluateClaim.flow.errors.evaluateFailed", { defaultValue: "Failed to evaluate claim" });
|
|
29373
29469
|
setError(message);
|
|
29374
29470
|
updateRuntime({ state: "idle", error: void 0 });
|
|
29375
29471
|
} finally {
|
|
@@ -29411,7 +29507,7 @@ var EvaluateClaimFlowDetail = ({
|
|
|
29411
29507
|
const selectedClaimProfile = profilesByDid[selectedClaim.agentDid];
|
|
29412
29508
|
const selectedDisplayName = selectedClaimProfile?.displayname || selectedClaim.agentDid || selectedClaim.agentAddress;
|
|
29413
29509
|
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 }, "
|
|
29510
|
+
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
29511
|
Box57,
|
|
29416
29512
|
{
|
|
29417
29513
|
style: {
|
|
@@ -29432,14 +29528,17 @@ var EvaluateClaimFlowDetail = ({
|
|
|
29432
29528
|
}
|
|
29433
29529
|
},
|
|
29434
29530
|
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 ?
|
|
29531
|
+
), /* @__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", {
|
|
29532
|
+
address: truncateAddress4(disputeDetails.evaluatorDid),
|
|
29533
|
+
defaultValue: `By ${truncateAddress4(disputeDetails.evaluatorDid)}`
|
|
29534
|
+
}) : "", 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
29535
|
CollapsibleSection,
|
|
29437
29536
|
{
|
|
29438
29537
|
title: "Xero Bill",
|
|
29439
29538
|
defaultOpen: true,
|
|
29440
|
-
badge: capturedInvoiceId ? /* @__PURE__ */ React269.createElement(Badge50, { color: "green", size: "sm", variant: "light" }, "Captured") : null
|
|
29539
|
+
badge: capturedInvoiceId ? /* @__PURE__ */ React269.createElement(Badge50, { color: "green", size: "sm", variant: "light" }, t("actionTypes.evaluateClaim.flow.xero.captured", { defaultValue: "Captured" })) : null
|
|
29441
29540
|
},
|
|
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 }, "
|
|
29541
|
+
/* @__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
29542
|
XeroConnectionBar,
|
|
29444
29543
|
{
|
|
29445
29544
|
effectiveConnection: xeroEffective.effectiveConnection,
|
|
@@ -29452,7 +29551,10 @@ var EvaluateClaimFlowDetail = ({
|
|
|
29452
29551
|
onClearOverride: handleClearOverride,
|
|
29453
29552
|
editorDocument
|
|
29454
29553
|
}
|
|
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" }, "
|
|
29554
|
+
), 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", {
|
|
29555
|
+
error: settlementError,
|
|
29556
|
+
defaultValue: `Bill captured but settlement failed \u2014 manual reconciliation needed: ${settlementError}`
|
|
29557
|
+
}))), !capturedInvoiceId && /* @__PURE__ */ React269.createElement(
|
|
29456
29558
|
BasePrimaryButton,
|
|
29457
29559
|
{
|
|
29458
29560
|
size: "xs",
|
|
@@ -29460,28 +29562,30 @@ var EvaluateClaimFlowDetail = ({
|
|
|
29460
29562
|
loading: capturingBill,
|
|
29461
29563
|
disabled: !invoiceRunInputs || capturingBill || isClaimAlreadyEvaluated || !xeroEffective.effectiveConnection
|
|
29462
29564
|
},
|
|
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.")))
|
|
29565
|
+
capturingBill ? t("actionTypes.evaluateClaim.flow.xero.capturing", { defaultValue: "Capturing\u2026" }) : t("actionTypes.evaluateClaim.flow.xero.captureBill", { defaultValue: "Capture {{bill}}", bill: "Bill" })
|
|
29566
|
+
), 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
29567
|
), (outcomeTemplateLoading || outcomeTemplateJson) && /* @__PURE__ */ React269.createElement(
|
|
29466
29568
|
CollapsibleSection,
|
|
29467
29569
|
{
|
|
29468
|
-
title: "Outcome",
|
|
29570
|
+
title: t("actionTypes.evaluateClaim.flow.section.outcome", { defaultValue: "Outcome" }),
|
|
29469
29571
|
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)" }))
|
|
29572
|
+
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
29573
|
},
|
|
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(
|
|
29574
|
+
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." }))
|
|
29575
|
+
), !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
29576
|
BaseTextArea,
|
|
29475
29577
|
{
|
|
29476
|
-
label: "Message to claimant",
|
|
29477
|
-
placeholder: "
|
|
29578
|
+
label: t("actionTypes.evaluateClaim.flow.dispute.messageLabel", { defaultValue: "Message to claimant" }),
|
|
29579
|
+
placeholder: t("actionTypes.evaluateClaim.flow.dispute.messagePlaceholder", {
|
|
29580
|
+
defaultValue: "Explain why this claim is being disputed so the youth can correct it."
|
|
29581
|
+
}),
|
|
29478
29582
|
value: disputeReason,
|
|
29479
29583
|
onChange: (event) => setDisputeReason(event.currentTarget.value),
|
|
29480
29584
|
minRows: 4,
|
|
29481
29585
|
required: true,
|
|
29482
29586
|
disabled: isDisabled || submitting || isClaimAlreadyEvaluated
|
|
29483
29587
|
}
|
|
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" }, "
|
|
29588
|
+
)) : /* @__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
29589
|
BaseSelect,
|
|
29486
29590
|
{
|
|
29487
29591
|
value: row.denom,
|
|
@@ -29489,7 +29593,7 @@ var EvaluateClaimFlowDetail = ({
|
|
|
29489
29593
|
data: [
|
|
29490
29594
|
{ value: USDC_DENOM5, label: "USDC" },
|
|
29491
29595
|
{ value: IXO_DENOM5, label: "IXO" },
|
|
29492
|
-
{ value: CUSTOM_DENOM2, label: "Custom" }
|
|
29596
|
+
{ value: CUSTOM_DENOM2, label: t("actionTypes.evaluateClaim.flow.payment.custom", { defaultValue: "Custom" }) }
|
|
29493
29597
|
],
|
|
29494
29598
|
clearable: false,
|
|
29495
29599
|
disabled: isDisabled || submitting
|
|
@@ -29497,7 +29601,7 @@ var EvaluateClaimFlowDetail = ({
|
|
|
29497
29601
|
), row.denom === CUSTOM_DENOM2 && /* @__PURE__ */ React269.createElement(
|
|
29498
29602
|
BaseTextInput,
|
|
29499
29603
|
{
|
|
29500
|
-
placeholder: "Custom denom (e.g. ibc/... or uixo)",
|
|
29604
|
+
placeholder: t("actionTypes.evaluateClaim.flow.payment.customDenomPlaceholder", { defaultValue: "Custom denom (e.g. ibc/... or uixo)" }),
|
|
29501
29605
|
value: row.customDenom,
|
|
29502
29606
|
onChange: (event) => updatePaymentRow(row.id, { customDenom: event.currentTarget.value }),
|
|
29503
29607
|
disabled: isDisabled || submitting
|
|
@@ -29508,33 +29612,47 @@ var EvaluateClaimFlowDetail = ({
|
|
|
29508
29612
|
min: 0,
|
|
29509
29613
|
value: row.amount,
|
|
29510
29614
|
onChange: (value) => updatePaymentRow(row.id, { amount: value }),
|
|
29511
|
-
placeholder: "Amount",
|
|
29615
|
+
placeholder: t("actionTypes.evaluateClaim.flow.payment.amountPlaceholder", { defaultValue: "Amount" }),
|
|
29512
29616
|
disabled: isDisabled || submitting
|
|
29513
29617
|
}
|
|
29514
|
-
))), /* @__PURE__ */ React269.createElement(Button55, { variant: "light", size: "xs", onClick: addPaymentRow, disabled: isDisabled || submitting },
|
|
29618
|
+
))), /* @__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(
|
|
29619
|
+
Checkbox13,
|
|
29620
|
+
{
|
|
29621
|
+
label: t("actionTypes.evaluateClaim.flow.generateUdid", { defaultValue: "Generate UDID proof before signing" }),
|
|
29622
|
+
checked: createUdid,
|
|
29623
|
+
onChange: (event) => setCreateUdid(event.currentTarget.checked)
|
|
29624
|
+
}
|
|
29625
|
+
))), 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", {
|
|
29626
|
+
amount: evaluationAmount.map(formatCoin).join(", "),
|
|
29627
|
+
defaultValue: `Transferred on-chain: ${evaluationAmount.map(formatCoin).join(", ")}`
|
|
29628
|
+
})))), !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
29629
|
BaseSelect,
|
|
29516
29630
|
{
|
|
29517
|
-
label: "Decision",
|
|
29518
|
-
placeholder: "Select decision",
|
|
29631
|
+
label: t("actionTypes.evaluateClaim.flow.decision.label", { defaultValue: "Decision" }),
|
|
29632
|
+
placeholder: t("actionTypes.evaluateClaim.flow.decision.placeholder", { defaultValue: "Select decision" }),
|
|
29519
29633
|
value: decision || null,
|
|
29520
29634
|
onChange: (value) => setDecision(value || ""),
|
|
29521
29635
|
data: [
|
|
29522
|
-
{ value: "approve", label: "Approve" },
|
|
29523
|
-
{ value: "reject", label: "Reject" },
|
|
29524
|
-
{ value: "dispute", label: "Dispute" }
|
|
29636
|
+
{ value: "approve", label: t("actionTypes.evaluateClaim.flow.decision.approve", { defaultValue: "Approve" }) },
|
|
29637
|
+
{ value: "reject", label: t("actionTypes.evaluateClaim.flow.decision.reject", { defaultValue: "Reject" }) },
|
|
29638
|
+
{ value: "dispute", label: t("actionTypes.evaluateClaim.flow.decision.dispute", { defaultValue: "Dispute" }) }
|
|
29525
29639
|
],
|
|
29526
|
-
disabled: isDisabled || submitting
|
|
29640
|
+
disabled: isDisabled || submitting
|
|
29527
29641
|
}
|
|
29528
29642
|
), error && /* @__PURE__ */ React269.createElement(Alert52, { color: "red", styles: actionAlertStyles }, error), /* @__PURE__ */ React269.createElement(MediaPreviewModal, { file: surveyActiveFile, onClose: () => setSurveyActiveFile(null) }));
|
|
29529
29643
|
}
|
|
29530
29644
|
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" }
|
|
29645
|
+
{ value: "all", label: t("actionTypes.evaluateClaim.flow.filter.all", { defaultValue: "All" }) },
|
|
29646
|
+
{ value: "pending", label: t("actionTypes.evaluateClaim.flow.filter.pending", { defaultValue: "Pending" }) },
|
|
29647
|
+
{ value: "approved", label: t("actionTypes.evaluateClaim.flow.filter.approved", { defaultValue: "Approved" }) },
|
|
29648
|
+
{ value: "rejected", label: t("actionTypes.evaluateClaim.flow.filter.rejected", { defaultValue: "Rejected" }) },
|
|
29649
|
+
{ value: "disputed", label: t("actionTypes.evaluateClaim.flow.filter.disputed", { defaultValue: "Disputed" }) }
|
|
29536
29650
|
];
|
|
29537
|
-
return /* @__PURE__ */ React269.createElement(Stack186, { gap: "md" }, !deedDid || !collectionId ? /* @__PURE__ */ React269.createElement(Alert52, { color: "yellow", styles: actionAlertStyles }, "
|
|
29651
|
+
return /* @__PURE__ */ React269.createElement(Stack186, { gap: "md" }, !deedDid || !collectionId ? /* @__PURE__ */ React269.createElement(Alert52, { color: "yellow", styles: actionAlertStyles }, t("actionTypes.shared.errors.configRequired", {
|
|
29652
|
+
defaultValue: "Configure {{did}} and {{claimCollection}} in template mode before running this action.",
|
|
29653
|
+
did: "DID",
|
|
29654
|
+
claimCollection: "claim collection"
|
|
29655
|
+
})) : /* @__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
29656
|
UnstyledButton6,
|
|
29539
29657
|
{
|
|
29540
29658
|
key: tab.value,
|
|
@@ -29548,7 +29666,7 @@ var EvaluateClaimFlowDetail = ({
|
|
|
29548
29666
|
}
|
|
29549
29667
|
},
|
|
29550
29668
|
/* @__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) => {
|
|
29669
|
+
))), /* @__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
29670
|
const status = getClaimStatusInfo(claim);
|
|
29553
29671
|
const profile = profilesByDid[claim.agentDid];
|
|
29554
29672
|
const displayName = profile?.displayname || claim.agentDid || claim.agentAddress;
|
|
@@ -39166,6 +39284,7 @@ registerActionTypeUI("qi/oracle.deploy", {
|
|
|
39166
39284
|
// src/mantine/blocks/action/ActionBlock.tsx
|
|
39167
39285
|
function ActionBlock({ editor, block }) {
|
|
39168
39286
|
const { docType } = useBlocknoteContext();
|
|
39287
|
+
const t = useTranslate();
|
|
39169
39288
|
const { actions } = useBlockConditions(block, editor);
|
|
39170
39289
|
if (docType === "template") {
|
|
39171
39290
|
return /* @__PURE__ */ React338.createElement(ActionTemplateView, { editor, block });
|
|
@@ -39186,7 +39305,7 @@ function ActionBlock({ editor, block }) {
|
|
|
39186
39305
|
editor,
|
|
39187
39306
|
isDisabled: shouldDisable ? {
|
|
39188
39307
|
isDisabled: "disable",
|
|
39189
|
-
message: "This action is currently disabled by conditions"
|
|
39308
|
+
message: t("actionBlock.disabledByConditions", { defaultValue: "This action is currently disabled by conditions" })
|
|
39190
39309
|
} : void 0
|
|
39191
39310
|
}
|
|
39192
39311
|
);
|
|
@@ -40823,10 +40942,11 @@ var blockSpecs = {
|
|
|
40823
40942
|
secrets: SecretsBlockSpec,
|
|
40824
40943
|
skills: SkillsBlockSpec
|
|
40825
40944
|
};
|
|
40826
|
-
var getExtraSlashMenuItems = (editor) => {
|
|
40945
|
+
var getExtraSlashMenuItems = (editor, translate) => {
|
|
40946
|
+
const t = translate ?? ((key, opts) => opts?.defaultValue ?? key);
|
|
40827
40947
|
const slashMenuList = [
|
|
40828
40948
|
{
|
|
40829
|
-
title: "Checkbox",
|
|
40949
|
+
title: t("palette.items.checkbox.title", { defaultValue: "Checkbox" }),
|
|
40830
40950
|
icon: icon(IconCheckbox4),
|
|
40831
40951
|
onItemClick: () => {
|
|
40832
40952
|
editor.insertBlocks(
|
|
@@ -40851,10 +40971,10 @@ var getExtraSlashMenuItems = (editor) => {
|
|
|
40851
40971
|
},
|
|
40852
40972
|
aliases: ["checkbox", "task", "todo"],
|
|
40853
40973
|
group: "Basics",
|
|
40854
|
-
subtext: "Add an interactive checkbox with flow permissions"
|
|
40974
|
+
subtext: t("palette.items.checkbox.subtext", { defaultValue: "Add an interactive checkbox with flow permissions" })
|
|
40855
40975
|
},
|
|
40856
40976
|
{
|
|
40857
|
-
title: "
|
|
40977
|
+
title: t("palette.items.domainCreator.title", { defaultValue: "{{domain}} Creator", domain: "Domain" }),
|
|
40858
40978
|
icon: icon(IconFileDescription4),
|
|
40859
40979
|
onItemClick: () => {
|
|
40860
40980
|
editor.insertBlocks(
|
|
@@ -40875,7 +40995,7 @@ var getExtraSlashMenuItems = (editor) => {
|
|
|
40875
40995
|
},
|
|
40876
40996
|
aliases: ["domain", "creator", "domain-creator"],
|
|
40877
40997
|
group: "Domains",
|
|
40878
|
-
subtext: "Launch a survey-driven domain creation flow"
|
|
40998
|
+
subtext: t("palette.items.domainCreator.subtext", { defaultValue: "Launch a survey-driven {{domain}} creation {{flow}}", domain: "domain", flow: "flow" })
|
|
40879
40999
|
},
|
|
40880
41000
|
{
|
|
40881
41001
|
title: "Governance Group",
|
|
@@ -40904,10 +41024,13 @@ var getExtraSlashMenuItems = (editor) => {
|
|
|
40904
41024
|
},
|
|
40905
41025
|
aliases: ["governance", "group", "dao-group", "multisig", "staking"],
|
|
40906
41026
|
group: "DAO",
|
|
40907
|
-
subtext: "
|
|
41027
|
+
subtext: t("palette.items.governanceGroup.subtext", {
|
|
41028
|
+
defaultValue: "Create a {{governanceGroup}} (categorical, multisig, or staking)",
|
|
41029
|
+
governanceGroup: "governance group"
|
|
41030
|
+
})
|
|
40908
41031
|
},
|
|
40909
41032
|
{
|
|
40910
|
-
title: "List",
|
|
41033
|
+
title: t("palette.items.list.title", { defaultValue: "List" }),
|
|
40911
41034
|
icon: icon(IconList),
|
|
40912
41035
|
onItemClick: () => {
|
|
40913
41036
|
editor.insertBlocks(
|
|
@@ -40927,10 +41050,10 @@ var getExtraSlashMenuItems = (editor) => {
|
|
|
40927
41050
|
},
|
|
40928
41051
|
aliases: ["list", "data", "dynamic"],
|
|
40929
41052
|
group: "Domains",
|
|
40930
|
-
subtext: "Create a dynamic list from
|
|
41053
|
+
subtext: t("palette.items.list.subtext", { defaultValue: "Create a dynamic list from {{did}} data", did: "DID" })
|
|
40931
41054
|
},
|
|
40932
41055
|
{
|
|
40933
|
-
title: "Enum Checklist",
|
|
41056
|
+
title: t("palette.items.enumChecklist.title", { defaultValue: "Enum Checklist" }),
|
|
40934
41057
|
icon: icon(IconChecklist7),
|
|
40935
41058
|
onItemClick: () => {
|
|
40936
41059
|
editor.insertBlocks(
|
|
@@ -40949,10 +41072,10 @@ var getExtraSlashMenuItems = (editor) => {
|
|
|
40949
41072
|
},
|
|
40950
41073
|
aliases: ["enum", "enum-checklist", "enum-list", "enum-checklist-block"],
|
|
40951
41074
|
group: "Domains",
|
|
40952
|
-
subtext: "Create a predefined enum checklist"
|
|
41075
|
+
subtext: t("palette.items.enumChecklist.subtext", { defaultValue: "Create a predefined enum checklist" })
|
|
40953
41076
|
},
|
|
40954
41077
|
{
|
|
40955
|
-
title: "Overview",
|
|
41078
|
+
title: t("palette.items.overview.title", { defaultValue: "Overview" }),
|
|
40956
41079
|
icon: icon(IconLayoutDashboard),
|
|
40957
41080
|
onItemClick: () => {
|
|
40958
41081
|
editor.insertBlocks(
|
|
@@ -40968,10 +41091,10 @@ var getExtraSlashMenuItems = (editor) => {
|
|
|
40968
41091
|
},
|
|
40969
41092
|
aliases: ["overview", "overview-block", "data-overview"],
|
|
40970
41093
|
group: "Domains",
|
|
40971
|
-
subtext: "Create an overview from domain card
|
|
41094
|
+
subtext: t("palette.items.overview.subtext", { defaultValue: "Create an overview from {{domainCard}} data", domainCard: "domain card" })
|
|
40972
41095
|
},
|
|
40973
41096
|
{
|
|
40974
|
-
title: "Proposal",
|
|
41097
|
+
title: t("palette.items.proposal.title", { defaultValue: "Proposal" }),
|
|
40975
41098
|
icon: icon(IconGavel),
|
|
40976
41099
|
onItemClick: () => {
|
|
40977
41100
|
editor.insertBlocks(
|
|
@@ -40993,10 +41116,10 @@ var getExtraSlashMenuItems = (editor) => {
|
|
|
40993
41116
|
},
|
|
40994
41117
|
aliases: ["proposal", "create-proposal", "dao-proposal", "governance"],
|
|
40995
41118
|
group: "DAO",
|
|
40996
|
-
subtext: "Create a new
|
|
41119
|
+
subtext: t("palette.items.proposal.subtext", { defaultValue: "Create a new {{dao}} proposal", dao: "DAO" })
|
|
40997
41120
|
},
|
|
40998
41121
|
{
|
|
40999
|
-
title: "Visualization",
|
|
41122
|
+
title: t("palette.items.visualization.title", { defaultValue: "Visualization" }),
|
|
41000
41123
|
icon: icon(IconChartBar),
|
|
41001
41124
|
onItemClick: () => {
|
|
41002
41125
|
editor.insertBlocks(
|
|
@@ -41016,10 +41139,10 @@ var getExtraSlashMenuItems = (editor) => {
|
|
|
41016
41139
|
},
|
|
41017
41140
|
aliases: ["visualization", "chart", "graph", "table", "ag-ui"],
|
|
41018
41141
|
group: "Basics",
|
|
41019
|
-
subtext: "Add an
|
|
41142
|
+
subtext: t("palette.items.visualization.subtext", { defaultValue: "Add an {{agUi}} visualization (chart, table, etc.)", agUi: "AG-UI" })
|
|
41020
41143
|
},
|
|
41021
41144
|
{
|
|
41022
|
-
title: "Dynamic List",
|
|
41145
|
+
title: t("palette.items.dynamicList.title", { defaultValue: "Dynamic List" }),
|
|
41023
41146
|
icon: icon(IconTable),
|
|
41024
41147
|
onItemClick: () => {
|
|
41025
41148
|
editor.insertBlocks(
|
|
@@ -41042,10 +41165,10 @@ var getExtraSlashMenuItems = (editor) => {
|
|
|
41042
41165
|
},
|
|
41043
41166
|
aliases: ["dynamic-list", "action-list", "ag-ui-list", "oracle-list"],
|
|
41044
41167
|
group: "Basics",
|
|
41045
|
-
subtext: "Add a dynamic list from
|
|
41168
|
+
subtext: t("palette.items.dynamicList.subtext", { defaultValue: "Add a dynamic list from {{agUi}} with snapshot support", agUi: "AG-UI" })
|
|
41046
41169
|
},
|
|
41047
41170
|
{
|
|
41048
|
-
title: "Protocol Selector",
|
|
41171
|
+
title: t("palette.items.protocolSelector.title", { defaultValue: "Protocol Selector" }),
|
|
41049
41172
|
icon: icon(IconGitBranch),
|
|
41050
41173
|
onItemClick: () => {
|
|
41051
41174
|
editor.insertBlocks(
|
|
@@ -41070,10 +41193,10 @@ var getExtraSlashMenuItems = (editor) => {
|
|
|
41070
41193
|
},
|
|
41071
41194
|
aliases: ["protocol", "protocol-selector", "select-protocol", "domain-type"],
|
|
41072
41195
|
group: "Domains",
|
|
41073
|
-
subtext: "Select a protocol from a predefined list"
|
|
41196
|
+
subtext: t("palette.items.protocolSelector.subtext", { defaultValue: "Select a protocol from a predefined list" })
|
|
41074
41197
|
},
|
|
41075
41198
|
{
|
|
41076
|
-
title: "Sign to Create",
|
|
41199
|
+
title: t("palette.items.signToCreate.title", { defaultValue: "Sign to Create" }),
|
|
41077
41200
|
icon: icon(IconPencil2),
|
|
41078
41201
|
onItemClick: () => {
|
|
41079
41202
|
editor.insertBlocks(
|
|
@@ -41099,7 +41222,7 @@ var getExtraSlashMenuItems = (editor) => {
|
|
|
41099
41222
|
},
|
|
41100
41223
|
aliases: ["domain-sign"],
|
|
41101
41224
|
group: "Domains",
|
|
41102
|
-
subtext: "Sign
|
|
41225
|
+
subtext: t("palette.items.signToCreate.subtext", { defaultValue: "Sign {{domainCard}} and create {{entity}} on-chain", domainCard: "domain card", entity: "entity" })
|
|
41103
41226
|
},
|
|
41104
41227
|
{
|
|
41105
41228
|
title: "Domain Card",
|
|
@@ -41127,10 +41250,10 @@ var getExtraSlashMenuItems = (editor) => {
|
|
|
41127
41250
|
},
|
|
41128
41251
|
aliases: ["domain-card", "domain-viewer", "card-preview"],
|
|
41129
41252
|
group: "Domains",
|
|
41130
|
-
subtext: "Preview
|
|
41253
|
+
subtext: t("palette.items.domainCard.subtext", { defaultValue: "Preview {{domainCard}} before signing", domainCard: "domain card" })
|
|
41131
41254
|
},
|
|
41132
41255
|
{
|
|
41133
|
-
title: "Action",
|
|
41256
|
+
title: t("palette.items.action.title", { defaultValue: "Action" }),
|
|
41134
41257
|
icon: icon(IconBolt10),
|
|
41135
41258
|
onItemClick: () => {
|
|
41136
41259
|
editor.insertBlocks(
|
|
@@ -41154,10 +41277,10 @@ var getExtraSlashMenuItems = (editor) => {
|
|
|
41154
41277
|
},
|
|
41155
41278
|
aliases: ["action", "generic-action", "workflow", "execute"],
|
|
41156
41279
|
group: "Basics",
|
|
41157
|
-
subtext: "Run any registered action from the action registry"
|
|
41280
|
+
subtext: t("palette.items.action.subtext", { defaultValue: "Run any registered action from the action registry" })
|
|
41158
41281
|
},
|
|
41159
41282
|
{
|
|
41160
|
-
title: "
|
|
41283
|
+
title: t("palette.items.flowLink.title", { defaultValue: "{{flow}} Link", flow: "Flow" }),
|
|
41161
41284
|
icon: icon(IconExternalLink3),
|
|
41162
41285
|
onItemClick: () => {
|
|
41163
41286
|
editor.insertBlocks(
|
|
@@ -41179,10 +41302,10 @@ var getExtraSlashMenuItems = (editor) => {
|
|
|
41179
41302
|
},
|
|
41180
41303
|
aliases: ["flow-link", "link", "navigate", "redirect"],
|
|
41181
41304
|
group: "Flows",
|
|
41182
|
-
subtext: "Link to other flow documents"
|
|
41305
|
+
subtext: t("palette.items.flowLink.subtext", { defaultValue: "Link to other {{flow}} documents", flow: "flow" })
|
|
41183
41306
|
},
|
|
41184
41307
|
{
|
|
41185
|
-
title: "Location",
|
|
41308
|
+
title: t("palette.items.location.title", { defaultValue: "Location" }),
|
|
41186
41309
|
icon: icon(IconMapPin3),
|
|
41187
41310
|
onItemClick: () => {
|
|
41188
41311
|
editor.insertBlocks(
|
|
@@ -41202,10 +41325,10 @@ var getExtraSlashMenuItems = (editor) => {
|
|
|
41202
41325
|
},
|
|
41203
41326
|
aliases: ["location", "map", "gps", "coordinates"],
|
|
41204
41327
|
group: "Basics",
|
|
41205
|
-
subtext: "Set a location on a map"
|
|
41328
|
+
subtext: t("palette.items.location.subtext", { defaultValue: "Set a location on a map" })
|
|
41206
41329
|
},
|
|
41207
41330
|
{
|
|
41208
|
-
title: "Embed",
|
|
41331
|
+
title: t("palette.items.embed.title", { defaultValue: "Embed" }),
|
|
41209
41332
|
icon: icon(IconCode3),
|
|
41210
41333
|
onItemClick: () => {
|
|
41211
41334
|
editor.insertBlocks(
|
|
@@ -41227,10 +41350,10 @@ var getExtraSlashMenuItems = (editor) => {
|
|
|
41227
41350
|
},
|
|
41228
41351
|
aliases: ["embed", "iframe", "website", "external"],
|
|
41229
41352
|
group: "Basics",
|
|
41230
|
-
subtext: "Embed an external website or content via iframe"
|
|
41353
|
+
subtext: t("palette.items.embed.subtext", { defaultValue: "Embed an external website or content via iframe" })
|
|
41231
41354
|
},
|
|
41232
41355
|
{
|
|
41233
|
-
title: "Secrets",
|
|
41356
|
+
title: t("palette.items.secrets.title", { defaultValue: "Secrets" }),
|
|
41234
41357
|
icon: icon(IconKey3),
|
|
41235
41358
|
onItemClick: () => {
|
|
41236
41359
|
editor.insertBlocks(
|
|
@@ -41258,10 +41381,10 @@ var getExtraSlashMenuItems = (editor) => {
|
|
|
41258
41381
|
},
|
|
41259
41382
|
aliases: ["secrets", "credentials", "keys", "oracle-credentials"],
|
|
41260
41383
|
group: "Basics",
|
|
41261
|
-
subtext: "Display generated credentials with copy-to-clipboard"
|
|
41384
|
+
subtext: t("palette.items.secrets.subtext", { defaultValue: "Display generated credentials with copy-to-clipboard" })
|
|
41262
41385
|
},
|
|
41263
41386
|
{
|
|
41264
|
-
title: "Skills",
|
|
41387
|
+
title: t("palette.items.skills.title", { defaultValue: "Skills" }),
|
|
41265
41388
|
icon: icon(IconTools2),
|
|
41266
41389
|
onItemClick: () => {
|
|
41267
41390
|
editor.insertBlocks(
|
|
@@ -41284,7 +41407,7 @@ var getExtraSlashMenuItems = (editor) => {
|
|
|
41284
41407
|
},
|
|
41285
41408
|
aliases: ["skills", "mcp", "tools", "capabilities"],
|
|
41286
41409
|
group: "Basics",
|
|
41287
|
-
subtext: "Manage skills and
|
|
41410
|
+
subtext: t("palette.items.skills.subtext", { defaultValue: "Manage skills and {{mcp}} server configurations", mcp: "MCP" })
|
|
41288
41411
|
}
|
|
41289
41412
|
];
|
|
41290
41413
|
return slashMenuList;
|
|
@@ -42555,6 +42678,22 @@ var GROUP_ORDER = {
|
|
|
42555
42678
|
DAO: 7,
|
|
42556
42679
|
Flows: 8
|
|
42557
42680
|
};
|
|
42681
|
+
function translateGroupLabel(groupKey, t) {
|
|
42682
|
+
if (!groupKey) return groupKey;
|
|
42683
|
+
const map = {
|
|
42684
|
+
Headings: { key: "palette.groups.headings", defaultValue: "Headings" },
|
|
42685
|
+
"Basic blocks": { key: "palette.groups.basicBlocks", defaultValue: "Basic blocks" },
|
|
42686
|
+
Media: { key: "palette.groups.media", defaultValue: "Media" },
|
|
42687
|
+
Advanced: { key: "palette.groups.advanced", defaultValue: "Advanced" },
|
|
42688
|
+
Others: { key: "palette.groups.others", defaultValue: "Others" },
|
|
42689
|
+
Basics: { key: "palette.groups.basics", defaultValue: "Basics" },
|
|
42690
|
+
Domains: { key: "palette.groups.domains", defaultValue: "Domains" },
|
|
42691
|
+
DAO: { key: "palette.groups.dao", defaultValue: "DAO" },
|
|
42692
|
+
Flows: { key: "palette.groups.flows", defaultValue: "Flows" }
|
|
42693
|
+
};
|
|
42694
|
+
const entry = map[groupKey];
|
|
42695
|
+
return entry ? t(entry.key, { defaultValue: entry.defaultValue }) : groupKey;
|
|
42696
|
+
}
|
|
42558
42697
|
function PaletteItem({ item, isSelected, onClick, id }) {
|
|
42559
42698
|
const ref = useRef42(null);
|
|
42560
42699
|
const [hovered, setHovered] = useState179(false);
|
|
@@ -42628,6 +42767,7 @@ function PaletteItem({ item, isSelected, onClick, id }) {
|
|
|
42628
42767
|
);
|
|
42629
42768
|
}
|
|
42630
42769
|
function CommandPalette({ items, onItemClick, loadingState, selectedIndex }) {
|
|
42770
|
+
const t = useTranslate();
|
|
42631
42771
|
const groupedItems = useMemo152(() => {
|
|
42632
42772
|
const groups = [];
|
|
42633
42773
|
let currentGroup;
|
|
@@ -42660,7 +42800,7 @@ function CommandPalette({ items, onItemClick, loadingState, selectedIndex }) {
|
|
|
42660
42800
|
boxShadow: "0 4px 16px rgba(0, 0, 0, 0.2)"
|
|
42661
42801
|
}
|
|
42662
42802
|
},
|
|
42663
|
-
/* @__PURE__ */ React364.createElement(Text238, { size: "sm", style: { color: "var(--mantine-color-neutralColor-7) !important", textAlign: "center" } }, "Loading...")
|
|
42803
|
+
/* @__PURE__ */ React364.createElement(Text238, { size: "sm", style: { color: "var(--mantine-color-neutralColor-7) !important", textAlign: "center" } }, t("palette.loading", { defaultValue: "Loading..." }))
|
|
42664
42804
|
);
|
|
42665
42805
|
}
|
|
42666
42806
|
return /* @__PURE__ */ React364.createElement(
|
|
@@ -42703,7 +42843,7 @@ function CommandPalette({ items, onItemClick, loadingState, selectedIndex }) {
|
|
|
42703
42843
|
fontSize: 11
|
|
42704
42844
|
}
|
|
42705
42845
|
},
|
|
42706
|
-
group.label
|
|
42846
|
+
translateGroupLabel(group.label, t)
|
|
42707
42847
|
), group.items.map(({ item, globalIndex }) => /* @__PURE__ */ React364.createElement(
|
|
42708
42848
|
PaletteItem,
|
|
42709
42849
|
{
|
|
@@ -42724,7 +42864,7 @@ function CommandPalette({ items, onItemClick, loadingState, selectedIndex }) {
|
|
|
42724
42864
|
padding: "12px"
|
|
42725
42865
|
}
|
|
42726
42866
|
},
|
|
42727
|
-
"No results"
|
|
42867
|
+
t("palette.noResults", { defaultValue: "No results" })
|
|
42728
42868
|
)
|
|
42729
42869
|
)
|
|
42730
42870
|
);
|
|
@@ -43612,6 +43752,7 @@ function insertPlainTextAtSelection(root, text) {
|
|
|
43612
43752
|
placeCaretAfter(textNode);
|
|
43613
43753
|
}
|
|
43614
43754
|
function PageTitle({ editor, editable }) {
|
|
43755
|
+
const t = useTranslate();
|
|
43615
43756
|
const [title, setTitle] = useState184("");
|
|
43616
43757
|
const [hasIcon, setHasIcon] = useState184(false);
|
|
43617
43758
|
const titleRef = useRef44(null);
|
|
@@ -43721,8 +43862,8 @@ function PageTitle({ editor, editable }) {
|
|
|
43721
43862
|
contentEditable: editable !== false,
|
|
43722
43863
|
suppressContentEditableWarning: true,
|
|
43723
43864
|
role: "textbox",
|
|
43724
|
-
"aria-label": "Page title",
|
|
43725
|
-
"data-placeholder": "New page",
|
|
43865
|
+
"aria-label": t("pageTitle.ariaLabel", { defaultValue: "Page title" }),
|
|
43866
|
+
"data-placeholder": t("pageTitle.placeholder", { defaultValue: "New page" }),
|
|
43726
43867
|
fz: 40,
|
|
43727
43868
|
fw: 700,
|
|
43728
43869
|
lh: 1.2,
|
|
@@ -44114,6 +44255,24 @@ var DEFAULT_ICON_MAP = {
|
|
|
44114
44255
|
Emoji: icon(IconMoodSmile2),
|
|
44115
44256
|
"Page Break": icon(IconPageBreak)
|
|
44116
44257
|
};
|
|
44258
|
+
var BUILTIN_TITLE_KEYS = {
|
|
44259
|
+
"Heading 1": "palette.builtin.heading1",
|
|
44260
|
+
"Heading 2": "palette.builtin.heading2",
|
|
44261
|
+
"Heading 3": "palette.builtin.heading3",
|
|
44262
|
+
Quote: "palette.builtin.quote",
|
|
44263
|
+
"Numbered List": "palette.builtin.numberedList",
|
|
44264
|
+
"Bullet List": "palette.builtin.bulletList",
|
|
44265
|
+
"Check List": "palette.builtin.checkList",
|
|
44266
|
+
Paragraph: "palette.builtin.paragraph",
|
|
44267
|
+
"Code Block": "palette.builtin.codeBlock",
|
|
44268
|
+
Table: "palette.builtin.table",
|
|
44269
|
+
Image: "palette.builtin.image",
|
|
44270
|
+
Video: "palette.builtin.video",
|
|
44271
|
+
Audio: "palette.builtin.audio",
|
|
44272
|
+
File: "palette.builtin.file",
|
|
44273
|
+
Emoji: "palette.builtin.emoji",
|
|
44274
|
+
"Page Break": "palette.builtin.pageBreak"
|
|
44275
|
+
};
|
|
44117
44276
|
function SanitizedThemeBoundary({ children }) {
|
|
44118
44277
|
const parentTheme = useMantineTheme();
|
|
44119
44278
|
const sanitizedTheme = useMemo156(() => sanitizeThemeForMantine7(parentTheme), [parentTheme]);
|
|
@@ -44139,6 +44298,7 @@ function IxoEditorContent({
|
|
|
44139
44298
|
}) {
|
|
44140
44299
|
const { activePanel } = usePanelStore();
|
|
44141
44300
|
const isPanelOpen = activePanel !== null;
|
|
44301
|
+
const t = useTranslate();
|
|
44142
44302
|
const editorContent = /* @__PURE__ */ React373.createElement(
|
|
44143
44303
|
BlockNoteView,
|
|
44144
44304
|
{
|
|
@@ -44160,11 +44320,15 @@ function IxoEditorContent({
|
|
|
44160
44320
|
triggerCharacter: "/",
|
|
44161
44321
|
suggestionMenuComponent: CommandPalette,
|
|
44162
44322
|
getItems: async (query) => {
|
|
44163
|
-
const customItems = getExtraSlashMenuItems(editor);
|
|
44164
|
-
const defaultItems = getDefaultReactSlashMenuItems(editor).map((item) =>
|
|
44165
|
-
|
|
44166
|
-
|
|
44167
|
-
|
|
44323
|
+
const customItems = getExtraSlashMenuItems(editor, t);
|
|
44324
|
+
const defaultItems = getDefaultReactSlashMenuItems(editor).map((item) => {
|
|
44325
|
+
const titleKey = BUILTIN_TITLE_KEYS[item.title];
|
|
44326
|
+
return {
|
|
44327
|
+
...item,
|
|
44328
|
+
icon: DEFAULT_ICON_MAP[item.title] ?? item.icon,
|
|
44329
|
+
title: titleKey ? t(titleKey, { defaultValue: item.title }) : item.title
|
|
44330
|
+
};
|
|
44331
|
+
});
|
|
44168
44332
|
const allItems = [...defaultItems, ...customItems];
|
|
44169
44333
|
allItems.sort((a, b) => {
|
|
44170
44334
|
const groupA = a.group || "";
|
|
@@ -44232,7 +44396,8 @@ function IxoEditor({
|
|
|
44232
44396
|
mapConfig,
|
|
44233
44397
|
connectedUsers,
|
|
44234
44398
|
awarenessInstance,
|
|
44235
|
-
belowTitleSlot
|
|
44399
|
+
belowTitleSlot,
|
|
44400
|
+
translate
|
|
44236
44401
|
}) {
|
|
44237
44402
|
if (!editor) {
|
|
44238
44403
|
return null;
|
|
@@ -44260,7 +44425,8 @@ function IxoEditor({
|
|
|
44260
44425
|
domainCardRenderer,
|
|
44261
44426
|
mapConfig,
|
|
44262
44427
|
connectedUsers,
|
|
44263
|
-
awarenessInstance
|
|
44428
|
+
awarenessInstance,
|
|
44429
|
+
translate
|
|
44264
44430
|
},
|
|
44265
44431
|
/* @__PURE__ */ React373.createElement(
|
|
44266
44432
|
IxoEditorContent,
|
|
@@ -44981,6 +45147,7 @@ export {
|
|
|
44981
45147
|
BlocknoteProvider,
|
|
44982
45148
|
useBlocknoteContext,
|
|
44983
45149
|
useBlocknoteHandlers,
|
|
45150
|
+
useTranslate,
|
|
44984
45151
|
useBlockPresence,
|
|
44985
45152
|
useTrackBlockFocus,
|
|
44986
45153
|
StakeType,
|
|
@@ -45017,4 +45184,4 @@ export {
|
|
|
45017
45184
|
getExtraSlashMenuItems,
|
|
45018
45185
|
useCreateIxoEditor
|
|
45019
45186
|
};
|
|
45020
|
-
//# sourceMappingURL=chunk-
|
|
45187
|
+
//# sourceMappingURL=chunk-OSIGG4JK.mjs.map
|