@ixo/editor 5.32.0 → 5.34.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.
@@ -65,7 +65,7 @@ import {
65
65
  transformSurveyToCredentialSubject,
66
66
  updateXeroWorkReviewPayloadForEditor,
67
67
  upsertXeroWorkItemForEditor
68
- } from "./chunk-BCQTKXDM.mjs";
68
+ } from "./chunk-TK2RJ4KB.mjs";
69
69
 
70
70
  // src/mantine/hooks/usePanel.ts
71
71
  import { useCallback, useMemo, useEffect, useRef } from "react";
@@ -26761,6 +26761,7 @@ function getRoleLabel2(role, translate) {
26761
26761
  var USDC_DENOM4 = "ibc/6BBE9BD4246F8E04948D5A4EEE7164B2630263B9EBB5E7DC5F0A46C62A2FF97B";
26762
26762
  var IXO_DENOM4 = "uixo";
26763
26763
  var CUSTOM_DENOM = "__custom__";
26764
+ var DECIMALS4 = 6;
26764
26765
  var createPaymentRow = () => ({
26765
26766
  id: `payment-${Math.random().toString(36).slice(2, 9)}`,
26766
26767
  denom: IXO_DENOM4,
@@ -26922,7 +26923,7 @@ var EvaluateBidFlowDetail = ({
26922
26923
  const denom = row.denom === CUSTOM_DENOM ? row.customDenom.trim() : row.denom || "";
26923
26924
  const amount = Number(row.amount);
26924
26925
  if (!denom || !Number.isFinite(amount) || amount <= 0) return null;
26925
- return { denom, amount: String(row.amount) };
26926
+ return { denom, amount: (amount * Math.pow(10, DECIMALS4)).toString() };
26926
26927
  }).filter((entry) => !!entry);
26927
26928
  }, [paymentRows]);
26928
26929
  useEffect97(() => {
@@ -28927,7 +28928,7 @@ var CollectionUsersConfig = ({ inputs, onInputsChange, editor, blockId }) => {
28927
28928
 
28928
28929
  // src/mantine/blocks/action/actionTypes/collectionUsers/CollectionUsersFlowDetail.tsx
28929
28930
  import React275, { useCallback as useCallback105, useEffect as useEffect103, useMemo as useMemo109, useRef as useRef35, useState as useState129 } from "react";
28930
- import { ActionIcon as ActionIcon43, Alert as Alert60, Badge as Badge50, Box as Box56, Button as Button60, Divider as Divider22, Group as Group105, Loader as Loader55, Radio as Radio5, SegmentedControl as SegmentedControl9, Stack as Stack191, Text as Text169 } from "@mantine/core";
28931
+ import { ActionIcon as ActionIcon43, Alert as Alert60, Badge as Badge50, Box as Box56, Button as Button60, Divider as Divider22, Group as Group105, JsonInput as JsonInput2, Loader as Loader55, Radio as Radio5, SegmentedControl as SegmentedControl9, Stack as Stack191, Text as Text169 } from "@mantine/core";
28931
28932
  import { useDebouncedValue } from "@mantine/hooks";
28932
28933
  import { IconAlertCircle as IconAlertCircle26, IconArrowLeft as IconArrowLeft10, IconCheck as IconCheck24, IconRefresh as IconRefresh9, IconTrash as IconTrash10 } from "@tabler/icons-react";
28933
28934
  var LOG2 = "[collection.users]";
@@ -28935,9 +28936,11 @@ function roleLabel(role) {
28935
28936
  return role === "submit" ? "Submit (Contributor)" : "Evaluate (Evaluator)";
28936
28937
  }
28937
28938
  var MIN_AGENT_QUOTA = 1;
28938
- var DEFAULT_EVALUATOR_QUOTA = 50;
28939
+ var DEFAULT_CONTRIBUTOR_QUOTA = 100;
28940
+ var DEFAULT_EVALUATOR_QUOTA = 100;
28939
28941
  var IXO_DENOM5 = "uixo";
28940
28942
  var USDC_DENOM5 = "ibc/6BBE9BD4246F8E04948D5A4EEE7164B2630263B9EBB5E7DC5F0A46C62A2FF97B";
28943
+ var DENOM_DECIMALS = 6;
28941
28944
  var EMPTY_MAX_AMOUNTS = { ixo: "", usdc: "" };
28942
28945
  function formatQuota2(value) {
28943
28946
  if (value == null || value === "") return "\u2014";
@@ -28956,6 +28959,19 @@ function toIxoDid(value) {
28956
28959
  function getGranteeDid(grantee) {
28957
28960
  return toIxoDid(grantee.did || grantee.address);
28958
28961
  }
28962
+ function toBaseUnits(displayAmount) {
28963
+ const trimmed = String(displayAmount ?? "").trim();
28964
+ const n = Number(trimmed);
28965
+ if (!Number.isFinite(n) || n <= 0) return "0";
28966
+ const [intPart = "", fracRaw = ""] = trimmed.split(".");
28967
+ const frac = fracRaw.slice(0, DENOM_DECIMALS).padEnd(DENOM_DECIMALS, "0");
28968
+ return `${intPart}${frac}`.replace(/^0+/, "") || "0";
28969
+ }
28970
+ function fromBaseUnits(baseAmount) {
28971
+ const n = Number(baseAmount);
28972
+ if (!Number.isFinite(n)) return String(baseAmount ?? "");
28973
+ return String(n / Math.pow(10, DENOM_DECIMALS));
28974
+ }
28959
28975
  function buildMaxAmounts(values) {
28960
28976
  return [
28961
28977
  { denom: IXO_DENOM5, amount: values.ixo },
@@ -28963,11 +28979,11 @@ function buildMaxAmounts(values) {
28963
28979
  ].filter((coin) => {
28964
28980
  const amount = Number(coin.amount);
28965
28981
  return Number.isFinite(amount) && amount > 0;
28966
- });
28982
+ }).map((coin) => ({ denom: coin.denom, amount: toBaseUnits(coin.amount) }));
28967
28983
  }
28968
28984
  function formatCoin2(coin) {
28969
28985
  const denom = coin.denom === IXO_DENOM5 ? "IXO" : coin.denom === USDC_DENOM5 ? "USDC" : coin.denom;
28970
- return `${coin.amount} ${denom}`;
28986
+ return `${fromBaseUnits(coin.amount)} ${denom}`;
28971
28987
  }
28972
28988
  function MaxAmountsInput({ value, onChange, disabled }) {
28973
28989
  return /* @__PURE__ */ React275.createElement(Stack191, { gap: "xs" }, /* @__PURE__ */ React275.createElement(Text169, { size: "xs", c: "dimmed" }, "Evaluator max amounts"), /* @__PURE__ */ React275.createElement(Group105, { grow: true, align: "flex-start" }, /* @__PURE__ */ React275.createElement(
@@ -29104,7 +29120,7 @@ var CollectionUsersFlowDetail = ({
29104
29120
  const [activeOp, setActiveOp] = useState129("add");
29105
29121
  const [addAddress, setAddAddress] = useState129("");
29106
29122
  const [addRole, setAddRole] = useState129("submit");
29107
- const [addQuota, setAddQuota] = useState129(String(MIN_AGENT_QUOTA));
29123
+ const [addQuota, setAddQuota] = useState129(String(DEFAULT_CONTRIBUTOR_QUOTA));
29108
29124
  const [addMaxAmounts, setAddMaxAmounts] = useState129(EMPTY_MAX_AMOUNTS);
29109
29125
  const [granteeKind, setGranteeKind] = useState129("user");
29110
29126
  const [members, setMembers] = useState129([]);
@@ -29167,7 +29183,7 @@ var CollectionUsersFlowDetail = ({
29167
29183
  }
29168
29184
  }, [granteeKind, classification, canEnumerate, enumerateGroupMembers]);
29169
29185
  useEffect103(() => {
29170
- setAddQuota(String(addRole === "evaluate" ? DEFAULT_EVALUATOR_QUOTA : MIN_AGENT_QUOTA));
29186
+ setAddQuota(String(addRole === "evaluate" ? DEFAULT_EVALUATOR_QUOTA : DEFAULT_CONTRIBUTOR_QUOTA));
29171
29187
  }, [addRole]);
29172
29188
  const isGroup = !!classification?.daodao;
29173
29189
  const canExerciseGrant = !!classification?.daodao?.canExerciseGrant;
@@ -29330,7 +29346,7 @@ var CollectionUsersFlowDetail = ({
29330
29346
  console.log(`${LOG2} execute success`, { operation: runtimeInputs.operation, transactionHash: payload.transactionHash });
29331
29347
  if (runtimeInputs.operation === "add") {
29332
29348
  setAddAddress("");
29333
- setAddQuota(String(runtimeInputs.role === "evaluate" ? DEFAULT_EVALUATOR_QUOTA : MIN_AGENT_QUOTA));
29349
+ setAddQuota(String(runtimeInputs.role === "evaluate" ? DEFAULT_EVALUATOR_QUOTA : DEFAULT_CONTRIBUTOR_QUOTA));
29334
29350
  setAddMaxAmounts(EMPTY_MAX_AMOUNTS);
29335
29351
  setGranteeKind("user");
29336
29352
  setMembers([]);
@@ -29422,20 +29438,19 @@ var CollectionUsersFlowDetail = ({
29422
29438
  "Revoke"
29423
29439
  ))
29424
29440
  );
29425
- }), revokeTarget && /* @__PURE__ */ React275.createElement(Alert60, { color: "red", styles: actionAlertStyles }, "Slide to sign to revoke ", roleLabel(revokeTarget.role), " from ", truncateAddress4(revokeTarget.address), ".")), !configMissing && section === "add" && /* @__PURE__ */ React275.createElement(Stack191, { gap: "sm" }, revokeTarget && /* @__PURE__ */ React275.createElement(Alert60, { color: "yellow", styles: actionAlertStyles }, "A revoke is currently armed. Switch to the Users tab to sign it, or change the grantee below to arm an add instead."), /* @__PURE__ */ React275.createElement(
29426
- BaseTextInput,
29441
+ }), revokeTarget && /* @__PURE__ */ React275.createElement(Alert60, { color: "red", styles: actionAlertStyles }, "Slide to sign to revoke ", roleLabel(revokeTarget.role), " from ", truncateAddress4(revokeTarget.address), ".")), !configMissing && section === "add" && /* @__PURE__ */ React275.createElement(Stack191, { gap: "sm" }, revokeTarget && /* @__PURE__ */ React275.createElement(Alert60, { color: "yellow", styles: actionAlertStyles }, "A revoke is currently armed. Switch to the Users tab to sign it, or change the grantee below to arm an add instead."), /* @__PURE__ */ React275.createElement(Stack191, { gap: 4 }, /* @__PURE__ */ React275.createElement(Text169, { size: "sm", fw: 500 }, "Grantee address"), /* @__PURE__ */ React275.createElement(
29442
+ RecipientInput,
29427
29443
  {
29428
- label: "Grantee address",
29429
- placeholder: "ixo1\u2026",
29430
29444
  value: addAddress,
29431
- onChange: (e) => {
29445
+ onChange: (address) => {
29432
29446
  setActiveOp("add");
29433
29447
  setRevokeTarget(null);
29434
- setAddAddress(e.currentTarget.value);
29448
+ setAddAddress(address);
29435
29449
  },
29436
- disabled: isDisabled || isRunning
29450
+ isDisabled: isDisabled || isRunning,
29451
+ placeholder: "Search by name / @user:\u2026, or paste an ixo1\u2026 address"
29437
29452
  }
29438
- ), canClassify ? /* @__PURE__ */ React275.createElement(Button60, { size: "xs", variant: "light", onClick: runClassify, disabled: !addAddress.trim() || classifying || isRunning, loading: classifying }, "Check address") : /* @__PURE__ */ React275.createElement(Text169, { size: "xs", c: "dimmed" }, "Address classification is unavailable in this host \u2014 the grantee will be added as a plain account."), classifyError && /* @__PURE__ */ React275.createElement(Alert60, { color: "red", styles: actionAlertStyles }, classifyError), isGroup && /* @__PURE__ */ React275.createElement(Box56, { style: { border: "1px solid var(--mantine-color-neutralColor-6)", borderRadius: 8, padding: 12 } }, /* @__PURE__ */ React275.createElement(Stack191, { gap: "xs" }, /* @__PURE__ */ React275.createElement(Text169, { size: "sm", fw: 600 }, "Add the group, or all the members of the group?"), /* @__PURE__ */ React275.createElement(Text169, { size: "xs", c: "dimmed" }, "Detected a DAO DAO group (", classification?.daodao?.type, "). Choose how to grant access."), /* @__PURE__ */ React275.createElement(Radio5.Group, { value: granteeKind, onChange: (value) => setGranteeKind(value) }, /* @__PURE__ */ React275.createElement(Stack191, { gap: "xs", mt: "xs" }, /* @__PURE__ */ React275.createElement(
29453
+ )), canClassify ? /* @__PURE__ */ React275.createElement(Button60, { size: "xs", variant: "light", onClick: runClassify, disabled: !addAddress.trim() || classifying || isRunning, loading: classifying }, "Check address") : /* @__PURE__ */ React275.createElement(Text169, { size: "xs", c: "dimmed" }, "Address classification is unavailable in this host \u2014 the grantee will be added as a plain account."), classifyError && /* @__PURE__ */ React275.createElement(Alert60, { color: "red", styles: actionAlertStyles }, classifyError), isGroup && /* @__PURE__ */ React275.createElement(Box56, { style: { border: "1px solid var(--mantine-color-neutralColor-6)", borderRadius: 8, padding: 12 } }, /* @__PURE__ */ React275.createElement(Stack191, { gap: "xs" }, /* @__PURE__ */ React275.createElement(Text169, { size: "sm", fw: 600 }, "Add the group, or all the members of the group?"), /* @__PURE__ */ React275.createElement(Text169, { size: "xs", c: "dimmed" }, "Detected a DAO DAO group (", classification?.daodao?.type, "). Choose how to grant access."), /* @__PURE__ */ React275.createElement(Radio5.Group, { value: granteeKind, onChange: (value) => setGranteeKind(value) }, /* @__PURE__ */ React275.createElement(Stack191, { gap: "xs", mt: "xs" }, /* @__PURE__ */ React275.createElement(
29439
29454
  Radio5,
29440
29455
  {
29441
29456
  value: "group-account",
@@ -29480,7 +29495,7 @@ var BidInboxSection = ({ deedDid, collectionId, adminAddress, isDisabled, handle
29480
29495
  const [selectedBidId, setSelectedBidId] = useState129("");
29481
29496
  const [decision, setDecision] = useState129("");
29482
29497
  const [rejectReason, setRejectReason] = useState129("");
29483
- const [approveQuota, setApproveQuota] = useState129(String(MIN_AGENT_QUOTA));
29498
+ const [approveQuota, setApproveQuota] = useState129(String(DEFAULT_CONTRIBUTOR_QUOTA));
29484
29499
  const [approveMaxAmounts, setApproveMaxAmounts] = useState129(EMPTY_MAX_AMOUNTS);
29485
29500
  const [submitting, setSubmitting] = useState129(false);
29486
29501
  const [profilesByDid, setProfilesByDid] = useState129({});
@@ -29508,7 +29523,7 @@ var BidInboxSection = ({ deedDid, collectionId, adminAddress, isDisabled, handle
29508
29523
  setSelectedBidId("");
29509
29524
  setDecision("");
29510
29525
  setRejectReason("");
29511
- setApproveQuota(String(MIN_AGENT_QUOTA));
29526
+ setApproveQuota(String(DEFAULT_CONTRIBUTOR_QUOTA));
29512
29527
  setApproveMaxAmounts(EMPTY_MAX_AMOUNTS);
29513
29528
  if (deedDid && collectionId) refreshBids();
29514
29529
  }, [deedDid, collectionId, refreshBids]);
@@ -29516,7 +29531,7 @@ var BidInboxSection = ({ deedDid, collectionId, adminAddress, isDisabled, handle
29516
29531
  setDecision("");
29517
29532
  setRejectReason("");
29518
29533
  setApproveMaxAmounts(EMPTY_MAX_AMOUNTS);
29519
- setApproveQuota(String(selectedBidIsEvaluator ? DEFAULT_EVALUATOR_QUOTA : MIN_AGENT_QUOTA));
29534
+ setApproveQuota(String(selectedBidIsEvaluator ? DEFAULT_EVALUATOR_QUOTA : DEFAULT_CONTRIBUTOR_QUOTA));
29520
29535
  }, [selectedBidId, selectedBidIsEvaluator]);
29521
29536
  useEffect103(() => {
29522
29537
  let mounted = true;
@@ -29583,7 +29598,7 @@ var BidInboxSection = ({ deedDid, collectionId, adminAddress, isDisabled, handle
29583
29598
  setSelectedBidId("");
29584
29599
  setDecision("");
29585
29600
  setRejectReason("");
29586
- setApproveQuota(String(MIN_AGENT_QUOTA));
29601
+ setApproveQuota(String(DEFAULT_CONTRIBUTOR_QUOTA));
29587
29602
  setApproveMaxAmounts(EMPTY_MAX_AMOUNTS);
29588
29603
  await refreshBids();
29589
29604
  } catch (err) {
@@ -29598,6 +29613,11 @@ var BidInboxSection = ({ deedDid, collectionId, adminAddress, isDisabled, handle
29598
29613
  const role = String(selectedBid.role || "").toLowerCase();
29599
29614
  const isEvaluator = role === "evaluation_agent" || role === "ea";
29600
29615
  const maxAmounts = isEvaluator ? buildMaxAmounts(approveMaxAmounts) : [];
29616
+ let bidData = null;
29617
+ try {
29618
+ bidData = typeof selectedBid.data === "string" ? JSON.parse(selectedBid.data) : selectedBid.data;
29619
+ } catch {
29620
+ }
29601
29621
  const approvalDiffs = [
29602
29622
  { key: "role", label: "Role", before: null, after: getBidRoleLabel(selectedBid.role), changeType: "add" },
29603
29623
  { key: "grantee", label: "Grantee", before: null, after: displayName, changeType: "add" },
@@ -29620,7 +29640,27 @@ var BidInboxSection = ({ deedDid, collectionId, adminAddress, isDisabled, handle
29620
29640
  }
29621
29641
  ] : []
29622
29642
  ];
29623
- return /* @__PURE__ */ React275.createElement(Stack191, { gap: "md" }, /* @__PURE__ */ React275.createElement(Group105, { gap: "xs", align: "center" }, /* @__PURE__ */ React275.createElement(ActionIcon43, { variant: "subtle", color: "gray", size: "sm", onClick: () => setSelectedBidId("") }, /* @__PURE__ */ React275.createElement(IconArrowLeft10, { size: 16 })), /* @__PURE__ */ React275.createElement(Text169, { fw: 500, size: "sm", truncate: true, style: { flex: 1, minWidth: 0 } }, "Bid #", selectedBid.id)), /* @__PURE__ */ React275.createElement(Stack191, { gap: 4 }, /* @__PURE__ */ React275.createElement(Text169, { size: "sm", fw: 600, truncate: true }, displayName), /* @__PURE__ */ React275.createElement(Group105, { gap: "xs" }, /* @__PURE__ */ React275.createElement(Badge50, { size: "xs", variant: "light", color: getRoleColor3(selectedBid.role) }, getBidRoleLabel(selectedBid.role)), /* @__PURE__ */ React275.createElement(Text169, { size: "xs", c: "dimmed" }, truncateAddress4(selectedBid.address)))), /* @__PURE__ */ React275.createElement(
29643
+ return /* @__PURE__ */ React275.createElement(Stack191, { gap: "md" }, /* @__PURE__ */ React275.createElement(Group105, { gap: "xs", align: "center" }, /* @__PURE__ */ React275.createElement(ActionIcon43, { variant: "subtle", color: "gray", size: "sm", onClick: () => setSelectedBidId("") }, /* @__PURE__ */ React275.createElement(IconArrowLeft10, { size: 16 })), /* @__PURE__ */ React275.createElement(Text169, { fw: 500, size: "sm", truncate: true, style: { flex: 1, minWidth: 0 } }, "Bid #", selectedBid.id)), /* @__PURE__ */ React275.createElement(Stack191, { gap: 4 }, /* @__PURE__ */ React275.createElement(Text169, { size: "sm", fw: 600, truncate: true }, displayName), /* @__PURE__ */ React275.createElement(Group105, { gap: "xs" }, /* @__PURE__ */ React275.createElement(Badge50, { size: "xs", variant: "light", color: getRoleColor3(selectedBid.role) }, getBidRoleLabel(selectedBid.role)), /* @__PURE__ */ React275.createElement(Text169, { size: "xs", c: "dimmed" }, truncateAddress4(selectedBid.address)))), /* @__PURE__ */ React275.createElement(CollapsibleSection, { title: "Inputs" }, bidData && typeof bidData === "object" ? /* @__PURE__ */ React275.createElement(
29644
+ JsonInput2,
29645
+ {
29646
+ value: JSON.stringify(bidData, null, 2),
29647
+ readOnly: true,
29648
+ autosize: true,
29649
+ minRows: 6,
29650
+ maxRows: 20,
29651
+ radius: "md",
29652
+ styles: {
29653
+ input: {
29654
+ fontFamily: "ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace",
29655
+ fontSize: 12,
29656
+ lineHeight: 1.5,
29657
+ background: "var(--mantine-color-neutralColor-3)",
29658
+ border: "1px solid var(--mantine-color-neutralColor-5)",
29659
+ color: "var(--mantine-color-neutralColor-8)"
29660
+ }
29661
+ }
29662
+ }
29663
+ ) : /* @__PURE__ */ React275.createElement(Text169, { size: "xs", c: "dimmed" }, "No input data available.")), /* @__PURE__ */ React275.createElement(
29624
29664
  BaseSelect,
29625
29665
  {
29626
29666
  label: "Decision",
@@ -30175,7 +30215,7 @@ var ClaimAttachments = ({ surveyModel, credentialSubject, entityDid }) => {
30175
30215
  var USDC_DENOM6 = "ibc/6BBE9BD4246F8E04948D5A4EEE7164B2630263B9EBB5E7DC5F0A46C62A2FF97B";
30176
30216
  var IXO_DENOM6 = "uixo";
30177
30217
  var CUSTOM_DENOM2 = "__custom__";
30178
- var DECIMALS4 = 6;
30218
+ var DECIMALS5 = 6;
30179
30219
  var createPaymentRow2 = () => ({
30180
30220
  id: `payment-${Math.random().toString(36).slice(2, 9)}`,
30181
30221
  denom: USDC_DENOM6,
@@ -30591,7 +30631,7 @@ var EvaluateClaimFlowDetail = ({
30591
30631
  }
30592
30632
  return {
30593
30633
  denom,
30594
- amount: (amount * Math.pow(10, DECIMALS4)).toString()
30634
+ amount: (amount * Math.pow(10, DECIMALS5)).toString()
30595
30635
  };
30596
30636
  }).filter((entry) => !!entry);
30597
30637
  }, [paymentRows]);
@@ -47315,4 +47355,4 @@ export {
47315
47355
  ixoGraphQLClient,
47316
47356
  getEntity
47317
47357
  };
47318
- //# sourceMappingURL=chunk-ZTHT4HPN.mjs.map
47358
+ //# sourceMappingURL=chunk-4AAU3G26.mjs.map