@ixo/editor 2.32.0 → 2.33.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.
|
@@ -13768,8 +13768,8 @@ var ClaimTemplateView = ({ editor, block }) => {
|
|
|
13768
13768
|
};
|
|
13769
13769
|
|
|
13770
13770
|
// src/mantine/blocks/claim/flow/FlowView.tsx
|
|
13771
|
-
import React151, { useMemo as useMemo43, useRef as
|
|
13772
|
-
import { Stack as Stack113, Text as Text87, Loader as Loader19, Center as Center9, Alert as Alert20, Title as
|
|
13771
|
+
import React151, { useMemo as useMemo43, useRef as useRef11, useEffect as useEffect44, useCallback as useCallback40 } from "react";
|
|
13772
|
+
import { Stack as Stack113, Text as Text87, Loader as Loader19, Center as Center9, Alert as Alert20, Title as Title7, Flex as Flex27, ActionIcon as ActionIcon26 } from "@mantine/core";
|
|
13773
13773
|
|
|
13774
13774
|
// src/mantine/hooks/useCurrentUser.ts
|
|
13775
13775
|
import { useState as useState47, useEffect as useEffect31, useRef as useRef6 } from "react";
|
|
@@ -14378,7 +14378,7 @@ var ClaimCollectionItem = ({ collection, deedId, adminAddress, userRole, onRefre
|
|
|
14378
14378
|
|
|
14379
14379
|
// src/mantine/blocks/bid/flow/components/BidCollectionItem.tsx
|
|
14380
14380
|
import React146, { useMemo as useMemo39 } from "react";
|
|
14381
|
-
import { Stack as Stack108, Text as Text82, Button as Button30, Menu as Menu4, Badge as Badge21, ActionIcon as ActionIcon23, Box as
|
|
14381
|
+
import { Stack as Stack108, Text as Text82, Button as Button30, Menu as Menu4, Badge as Badge21, ActionIcon as ActionIcon23, Box as Box33, Tooltip as Tooltip13, Loader as Loader16 } from "@mantine/core";
|
|
14382
14382
|
import { IconChevronDown as IconChevronDown8, IconArrowRight as IconArrowRight3, IconLock } from "@tabler/icons-react";
|
|
14383
14383
|
|
|
14384
14384
|
// src/mantine/hooks/useBlockAuthorization.ts
|
|
@@ -14457,7 +14457,7 @@ function useBlockAuthorization({
|
|
|
14457
14457
|
}
|
|
14458
14458
|
|
|
14459
14459
|
// src/mantine/blocks/bid/flow/components/BidSurveyPanel.tsx
|
|
14460
|
-
import React140, { useMemo as useMemo35, useEffect as useEffect37 } from "react";
|
|
14460
|
+
import React140, { useMemo as useMemo35, useEffect as useEffect37, useRef as useRef9, useCallback as useCallback34 } from "react";
|
|
14461
14461
|
import { Loader as Loader13, Stack as Stack104, Text as Text78 } from "@mantine/core";
|
|
14462
14462
|
import { Survey as Survey2 } from "@ixo/surveys";
|
|
14463
14463
|
|
|
@@ -14581,6 +14581,13 @@ var BidSurveyPanel = ({ deedId, collectionId, role, onSubmitComplete, execution,
|
|
|
14581
14581
|
const { closePanel } = usePanelStore();
|
|
14582
14582
|
const { surveyModel, loading, error, handleSurveyComplete } = useBidSurvey(deedId, collectionId, role, onSubmitComplete, execution, executeHookedActions);
|
|
14583
14583
|
const roleLabel = role === "service_agent" ? "Service Agent" : "Evaluation Agent";
|
|
14584
|
+
const handleSurveyCompleteRef = useRef9(handleSurveyComplete);
|
|
14585
|
+
useEffect37(() => {
|
|
14586
|
+
handleSurveyCompleteRef.current = handleSurveyComplete;
|
|
14587
|
+
}, [handleSurveyComplete]);
|
|
14588
|
+
const stableHandleSurveyComplete = useCallback34((sender) => {
|
|
14589
|
+
handleSurveyCompleteRef.current(sender);
|
|
14590
|
+
}, []);
|
|
14584
14591
|
const surveyContainerStyle = useMemo35(
|
|
14585
14592
|
() => ({
|
|
14586
14593
|
flex: 1,
|
|
@@ -14593,18 +14600,18 @@ var BidSurveyPanel = ({ deedId, collectionId, role, onSubmitComplete, execution,
|
|
|
14593
14600
|
);
|
|
14594
14601
|
useEffect37(() => {
|
|
14595
14602
|
if (surveyModel) {
|
|
14596
|
-
surveyModel.onComplete.add(
|
|
14603
|
+
surveyModel.onComplete.add(stableHandleSurveyComplete);
|
|
14597
14604
|
return () => {
|
|
14598
|
-
surveyModel.onComplete.remove(
|
|
14605
|
+
surveyModel.onComplete.remove(stableHandleSurveyComplete);
|
|
14599
14606
|
};
|
|
14600
14607
|
}
|
|
14601
14608
|
return void 0;
|
|
14602
|
-
}, [surveyModel,
|
|
14609
|
+
}, [surveyModel, stableHandleSurveyComplete]);
|
|
14603
14610
|
return /* @__PURE__ */ React140.createElement(BaseRightPanelLayout, { isTemplate: false, onClose: closePanel, title: `${roleLabel} Application` }, /* @__PURE__ */ React140.createElement("div", { style: surveyContainerStyle }, loading && /* @__PURE__ */ React140.createElement(Stack104, { align: "center", justify: "center", style: { height: "100%" } }, /* @__PURE__ */ React140.createElement(Loader13, { size: "lg" }), /* @__PURE__ */ React140.createElement(Text78, { size: "sm", c: "dimmed" }, "Loading survey template...")), error && /* @__PURE__ */ React140.createElement(Stack104, { align: "center", justify: "center", style: { height: "100%", padding: "1rem" } }, /* @__PURE__ */ React140.createElement(Text78, { size: "sm", c: "red" }, error)), !loading && !error && surveyModel && /* @__PURE__ */ React140.createElement(Survey2, { model: surveyModel })));
|
|
14604
14611
|
};
|
|
14605
14612
|
|
|
14606
14613
|
// src/mantine/blocks/bid/flow/components/BidsList.tsx
|
|
14607
|
-
import React143, { useCallback as
|
|
14614
|
+
import React143, { useCallback as useCallback37 } from "react";
|
|
14608
14615
|
import { Stack as Stack107, Text as Text81, Loader as Loader15, Center as Center6, Alert as Alert18 } from "@mantine/core";
|
|
14609
14616
|
import { IconAlertCircle as IconAlertCircle3 } from "@tabler/icons-react";
|
|
14610
14617
|
|
|
@@ -14615,7 +14622,7 @@ import { IconArrowRight as IconArrowRight2 } from "@tabler/icons-react";
|
|
|
14615
14622
|
|
|
14616
14623
|
// src/mantine/blocks/bid/flow/components/BidViewPanel.tsx
|
|
14617
14624
|
import React141, { useMemo as useMemo37, useState as useState55 } from "react";
|
|
14618
|
-
import { Loader as Loader14, Stack as Stack105, Text as Text79, Button as Button29, Group as Group48, Modal as Modal2, Alert as Alert17 } from "@mantine/core";
|
|
14625
|
+
import { Loader as Loader14, Stack as Stack105, Text as Text79, Button as Button29, Group as Group48, Modal as Modal2, Alert as Alert17, Box as Box32, Title as Title5 } from "@mantine/core";
|
|
14619
14626
|
import { Survey as Survey3 } from "@ixo/surveys";
|
|
14620
14627
|
import { IconCheck as IconCheck3, IconX as IconX9, IconAlertCircle as IconAlertCircle2 } from "@tabler/icons-react";
|
|
14621
14628
|
|
|
@@ -14695,81 +14702,85 @@ function useBidView(bid, deedId) {
|
|
|
14695
14702
|
}
|
|
14696
14703
|
|
|
14697
14704
|
// src/mantine/blocks/bid/flow/hooks/useBidActions.ts
|
|
14698
|
-
import { useState as useState54, useCallback as
|
|
14705
|
+
import { useState as useState54, useCallback as useCallback35 } from "react";
|
|
14699
14706
|
function useBidActions(bid, deedId, adminAddress, execution, onRefresh, executeHookedActions) {
|
|
14700
14707
|
const handlers = useBlocknoteHandlers();
|
|
14701
14708
|
const { closePanel } = usePanelStore();
|
|
14702
14709
|
const [loading, setLoading] = useState54(false);
|
|
14703
14710
|
const [error, setError] = useState54(null);
|
|
14704
|
-
const approveBid =
|
|
14705
|
-
|
|
14706
|
-
|
|
14707
|
-
|
|
14708
|
-
|
|
14709
|
-
|
|
14710
|
-
|
|
14711
|
-
|
|
14712
|
-
|
|
14713
|
-
|
|
14714
|
-
|
|
14715
|
-
|
|
14716
|
-
|
|
14717
|
-
|
|
14718
|
-
|
|
14719
|
-
|
|
14720
|
-
|
|
14721
|
-
|
|
14722
|
-
|
|
14723
|
-
|
|
14724
|
-
|
|
14725
|
-
|
|
14726
|
-
|
|
14727
|
-
|
|
14728
|
-
|
|
14729
|
-
|
|
14730
|
-
|
|
14711
|
+
const approveBid = useCallback35(
|
|
14712
|
+
async (maxAmounts) => {
|
|
14713
|
+
try {
|
|
14714
|
+
setLoading(true);
|
|
14715
|
+
setError(null);
|
|
14716
|
+
const outcome = await executeNode({
|
|
14717
|
+
node: execution.flowNode,
|
|
14718
|
+
actorDid: execution.actorDid,
|
|
14719
|
+
context: {
|
|
14720
|
+
runtime: execution.runtime,
|
|
14721
|
+
ucanManager: execution.ucanManager,
|
|
14722
|
+
delegationStore: execution.delegationStore,
|
|
14723
|
+
verifySignature: execution.verifySignature,
|
|
14724
|
+
rootIssuer: execution.rootIssuer,
|
|
14725
|
+
flowUri: execution.flowUri
|
|
14726
|
+
},
|
|
14727
|
+
action: async () => {
|
|
14728
|
+
if (bid.role === "service_agent" || bid.role === "SA") {
|
|
14729
|
+
await handlers.approveServiceAgentApplication({
|
|
14730
|
+
adminAddress,
|
|
14731
|
+
collectionId: bid.collection,
|
|
14732
|
+
agentQuota: 30,
|
|
14733
|
+
deedDid: deedId,
|
|
14734
|
+
currentUserAddress: bid.address
|
|
14735
|
+
});
|
|
14736
|
+
} else if (bid.role === "evaluation_agent" || bid.role === "EA") {
|
|
14737
|
+
await handlers.approveEvaluatorApplication({
|
|
14738
|
+
adminAddress,
|
|
14739
|
+
collectionId: bid.collection,
|
|
14740
|
+
deedDid: deedId,
|
|
14741
|
+
evaluatorAddress: bid.address,
|
|
14742
|
+
agentQuota: 10,
|
|
14743
|
+
maxAmounts
|
|
14744
|
+
});
|
|
14745
|
+
} else {
|
|
14746
|
+
throw new Error(`Unknown role: ${bid.role}`);
|
|
14747
|
+
}
|
|
14748
|
+
await handlers.approveBid({
|
|
14749
|
+
bidId: bid.id,
|
|
14731
14750
|
collectionId: bid.collection,
|
|
14732
|
-
|
|
14733
|
-
evaluatorAddress: bid.address,
|
|
14734
|
-
agentQuota: 10
|
|
14751
|
+
did: bid.did
|
|
14735
14752
|
});
|
|
14736
|
-
|
|
14737
|
-
|
|
14753
|
+
return {
|
|
14754
|
+
claimId: bid.id,
|
|
14755
|
+
submittedByDid: execution.actorDid,
|
|
14756
|
+
evaluationStatus: "approved"
|
|
14757
|
+
};
|
|
14738
14758
|
}
|
|
14739
|
-
|
|
14740
|
-
|
|
14741
|
-
|
|
14742
|
-
did: bid.did
|
|
14743
|
-
});
|
|
14744
|
-
return {
|
|
14745
|
-
claimId: bid.id,
|
|
14746
|
-
submittedByDid: execution.actorDid,
|
|
14747
|
-
evaluationStatus: "approved"
|
|
14748
|
-
};
|
|
14759
|
+
});
|
|
14760
|
+
if (!outcome.success) {
|
|
14761
|
+
throw new Error(outcome.error || "Authorization failed");
|
|
14749
14762
|
}
|
|
14750
|
-
|
|
14751
|
-
|
|
14752
|
-
|
|
14753
|
-
|
|
14754
|
-
|
|
14755
|
-
|
|
14756
|
-
|
|
14757
|
-
|
|
14758
|
-
|
|
14759
|
-
|
|
14760
|
-
|
|
14761
|
-
|
|
14762
|
-
|
|
14763
|
-
|
|
14764
|
-
|
|
14765
|
-
|
|
14766
|
-
|
|
14767
|
-
|
|
14768
|
-
|
|
14769
|
-
|
|
14770
|
-
|
|
14771
|
-
}, [bid, deedId, adminAddress, handlers, closePanel, onRefresh, execution, executeHookedActions]);
|
|
14772
|
-
const rejectBid = useCallback34(
|
|
14763
|
+
executeHookedActions?.("approve", {
|
|
14764
|
+
bidId: bid.id,
|
|
14765
|
+
collectionId: bid.collection,
|
|
14766
|
+
role: bid.role,
|
|
14767
|
+
applicantAddress: bid.address,
|
|
14768
|
+
applicantDid: bid.did,
|
|
14769
|
+
approverDid: execution.actorDid,
|
|
14770
|
+
deedDid: deedId,
|
|
14771
|
+
status: "approved"
|
|
14772
|
+
});
|
|
14773
|
+
closePanel();
|
|
14774
|
+
onRefresh?.();
|
|
14775
|
+
} catch (err) {
|
|
14776
|
+
setError(err instanceof Error ? err.message : "Failed to approve bid");
|
|
14777
|
+
} finally {
|
|
14778
|
+
setLoading(false);
|
|
14779
|
+
}
|
|
14780
|
+
},
|
|
14781
|
+
[bid, deedId, adminAddress, handlers, closePanel, onRefresh, execution, executeHookedActions]
|
|
14782
|
+
);
|
|
14783
|
+
const rejectBid = useCallback35(
|
|
14773
14784
|
async (reason) => {
|
|
14774
14785
|
if (!reason.trim()) {
|
|
14775
14786
|
setError("Please provide a reason for rejection");
|
|
@@ -14831,6 +14842,12 @@ function useBidActions(bid, deedId, adminAddress, execution, onRefresh, executeH
|
|
|
14831
14842
|
}
|
|
14832
14843
|
|
|
14833
14844
|
// src/mantine/blocks/bid/flow/components/BidViewPanel.tsx
|
|
14845
|
+
var USDC_DENOM = "ibc/6BBE9BD4246F8E04948D5A4EEE7164B2630263B9EBB5E7DC5F0A46C62A2FF97B";
|
|
14846
|
+
var IXO_DENOM = "uixo";
|
|
14847
|
+
var DECIMALS = 6;
|
|
14848
|
+
var isEvaluatorRole = (role) => {
|
|
14849
|
+
return role === "evaluation_agent" || role === "EA";
|
|
14850
|
+
};
|
|
14834
14851
|
var BidViewPanel = ({ bid, deedId, adminAddress, onRefresh, execution, executeHookedActions }) => {
|
|
14835
14852
|
const { closePanel } = usePanelStore();
|
|
14836
14853
|
const { surveyModel, loading, error } = useBidView(bid, deedId);
|
|
@@ -14843,6 +14860,30 @@ var BidViewPanel = ({ bid, deedId, adminAddress, onRefresh, execution, executeHo
|
|
|
14843
14860
|
} = useBidActions(bid, deedId, adminAddress, execution, onRefresh, executeHookedActions);
|
|
14844
14861
|
const [rejectModalOpen, setRejectModalOpen] = useState55(false);
|
|
14845
14862
|
const [rejectReason, setRejectReason] = useState55("");
|
|
14863
|
+
const [maxUsdcAmount, setMaxUsdcAmount] = useState55("");
|
|
14864
|
+
const [maxIxoAmount, setMaxIxoAmount] = useState55("");
|
|
14865
|
+
const isEvaluator = isEvaluatorRole(bid.role);
|
|
14866
|
+
const buildMaxAmounts = () => {
|
|
14867
|
+
if (!isEvaluator) return void 0;
|
|
14868
|
+
const coins = [];
|
|
14869
|
+
if (maxUsdcAmount !== "" && Number(maxUsdcAmount) > 0) {
|
|
14870
|
+
coins.push({
|
|
14871
|
+
denom: USDC_DENOM,
|
|
14872
|
+
amount: (Number(maxUsdcAmount) * Math.pow(10, DECIMALS)).toString()
|
|
14873
|
+
});
|
|
14874
|
+
}
|
|
14875
|
+
if (maxIxoAmount !== "" && Number(maxIxoAmount) > 0) {
|
|
14876
|
+
coins.push({
|
|
14877
|
+
denom: IXO_DENOM,
|
|
14878
|
+
amount: (Number(maxIxoAmount) * Math.pow(10, DECIMALS)).toString()
|
|
14879
|
+
});
|
|
14880
|
+
}
|
|
14881
|
+
return coins.length > 0 ? coins : void 0;
|
|
14882
|
+
};
|
|
14883
|
+
const handleApprove = () => {
|
|
14884
|
+
const maxAmounts = buildMaxAmounts();
|
|
14885
|
+
approveBid(maxAmounts);
|
|
14886
|
+
};
|
|
14846
14887
|
const surveyContainerStyle = useMemo37(
|
|
14847
14888
|
() => ({
|
|
14848
14889
|
flex: 1,
|
|
@@ -14864,7 +14905,7 @@ var BidViewPanel = ({ bid, deedId, adminAddress, onRefresh, execution, executeHo
|
|
|
14864
14905
|
setRejectModalOpen(false);
|
|
14865
14906
|
}
|
|
14866
14907
|
};
|
|
14867
|
-
return /* @__PURE__ */ React141.createElement(BaseRightPanelLayout, { onClose: closePanel, title: `${getRoleLabel(bid.role)} Bid`, isTemplate: false }, !loading && !error && /* @__PURE__ */ React141.createElement(Stack105, { gap: "md", mb: "md" }, actionError && /* @__PURE__ */ React141.createElement(Alert17, { color: "red", icon: /* @__PURE__ */ React141.createElement(IconAlertCircle2, { size: 16 }), onClose: () => setActionError(null), withCloseButton: true }, actionError), /* @__PURE__ */ React141.createElement(Group48, { justify: "flex-end" }, /* @__PURE__ */ React141.createElement(Button29, { variant: "outline", color: "red", leftSection: /* @__PURE__ */ React141.createElement(IconX9, { size: 16 }), onClick: handleRejectClick, loading: actionLoading, disabled: actionLoading }, "Reject"), /* @__PURE__ */ React141.createElement(Button29, { variant: "filled", color: "green", leftSection: /* @__PURE__ */ React141.createElement(IconCheck3, { size: 16 }), onClick:
|
|
14908
|
+
return /* @__PURE__ */ React141.createElement(BaseRightPanelLayout, { onClose: closePanel, title: `${getRoleLabel(bid.role)} Bid`, isTemplate: false }, !loading && !error && /* @__PURE__ */ React141.createElement(Stack105, { gap: "md", mb: "md" }, actionError && /* @__PURE__ */ React141.createElement(Alert17, { color: "red", icon: /* @__PURE__ */ React141.createElement(IconAlertCircle2, { size: 16 }), onClose: () => setActionError(null), withCloseButton: true }, actionError), isEvaluator && /* @__PURE__ */ React141.createElement(Box32, null, /* @__PURE__ */ React141.createElement(Title5, { order: 6, c: "dimmed", mb: "xs" }, "Max Approval Amounts (Optional)"), /* @__PURE__ */ React141.createElement(Group48, { grow: true }, /* @__PURE__ */ React141.createElement(BaseNumberInput, { label: "USDC", placeholder: "0", min: 0, value: maxUsdcAmount, onChange: (val) => setMaxUsdcAmount(val) }), /* @__PURE__ */ React141.createElement(BaseNumberInput, { label: "IXO", placeholder: "0", min: 0, value: maxIxoAmount, onChange: (val) => setMaxIxoAmount(val) }))), /* @__PURE__ */ React141.createElement(Group48, { justify: "flex-end" }, /* @__PURE__ */ React141.createElement(Button29, { variant: "outline", color: "red", leftSection: /* @__PURE__ */ React141.createElement(IconX9, { size: 16 }), onClick: handleRejectClick, loading: actionLoading, disabled: actionLoading }, "Reject"), /* @__PURE__ */ React141.createElement(Button29, { variant: "filled", color: "green", leftSection: /* @__PURE__ */ React141.createElement(IconCheck3, { size: 16 }), onClick: handleApprove, loading: actionLoading, disabled: actionLoading }, "Approve"))), /* @__PURE__ */ React141.createElement("div", { style: surveyContainerStyle }, loading && /* @__PURE__ */ React141.createElement(Stack105, { align: "center", justify: "center", style: { height: "100%" } }, /* @__PURE__ */ React141.createElement(Loader14, { size: "lg" }), /* @__PURE__ */ React141.createElement(Text79, { size: "sm", c: "dimmed" }, "Loading bid details...")), error && /* @__PURE__ */ React141.createElement(Stack105, { align: "center", justify: "center", style: { height: "100%", padding: "1rem" } }, /* @__PURE__ */ React141.createElement(Text79, { size: "sm", c: "red" }, error)), !loading && !error && surveyModel && /* @__PURE__ */ React141.createElement(Survey3, { model: surveyModel })), /* @__PURE__ */ React141.createElement(Modal2, { opened: rejectModalOpen, onClose: () => setRejectModalOpen(false), title: "Reject Bid", centered: true }, /* @__PURE__ */ React141.createElement(Stack105, { gap: "md" }, /* @__PURE__ */ React141.createElement(Text79, { size: "sm" }, "Please provide a reason for rejecting this bid:"), /* @__PURE__ */ React141.createElement(BaseTextArea, { placeholder: "Enter rejection reason...", value: rejectReason, onChange: (e) => setRejectReason(e.currentTarget.value), minRows: 3 }), /* @__PURE__ */ React141.createElement(Group48, { justify: "flex-end" }, /* @__PURE__ */ React141.createElement(Button29, { variant: "outline", onClick: () => setRejectModalOpen(false), disabled: actionLoading }, "Cancel"), /* @__PURE__ */ React141.createElement(Button29, { color: "red", onClick: handleRejectConfirm, loading: actionLoading, disabled: !rejectReason.trim() }, "Reject Bid")))));
|
|
14868
14909
|
};
|
|
14869
14910
|
|
|
14870
14911
|
// src/mantine/hooks/useUserProfile.ts
|
|
@@ -14908,13 +14949,13 @@ var BidItem = ({ bid, deedId, adminAddress, onRefresh, execution, executeHookedA
|
|
|
14908
14949
|
};
|
|
14909
14950
|
|
|
14910
14951
|
// src/mantine/blocks/bid/flow/hooks/useBids.ts
|
|
14911
|
-
import { useState as useState57, useEffect as useEffect40, useCallback as
|
|
14952
|
+
import { useState as useState57, useEffect as useEffect40, useCallback as useCallback36 } from "react";
|
|
14912
14953
|
function useBids(collectionId) {
|
|
14913
14954
|
const handlers = useBlocknoteHandlers();
|
|
14914
14955
|
const [bids, setBids] = useState57([]);
|
|
14915
14956
|
const [loading, setLoading] = useState57(true);
|
|
14916
14957
|
const [error, setError] = useState57(null);
|
|
14917
|
-
const fetchBids =
|
|
14958
|
+
const fetchBids = useCallback36(async () => {
|
|
14918
14959
|
if (!collectionId) {
|
|
14919
14960
|
setLoading(false);
|
|
14920
14961
|
return;
|
|
@@ -14941,7 +14982,7 @@ function useBids(collectionId) {
|
|
|
14941
14982
|
var BidsList = ({ collectionId, deedId, adminAddress, onRefresh, execution, executeHookedActions }) => {
|
|
14942
14983
|
const { closePanel } = usePanelStore();
|
|
14943
14984
|
const { bids, loading, error, refetch } = useBids(collectionId);
|
|
14944
|
-
const handleRefresh =
|
|
14985
|
+
const handleRefresh = useCallback37(() => {
|
|
14945
14986
|
refetch();
|
|
14946
14987
|
onRefresh();
|
|
14947
14988
|
}, [refetch, onRefresh]);
|
|
@@ -15012,13 +15053,13 @@ var UserPlus = ({ size = 24, color = "currentColor", style }) => {
|
|
|
15012
15053
|
var UserPlus_default = UserPlus;
|
|
15013
15054
|
|
|
15014
15055
|
// src/mantine/blocks/bid/flow/hooks/useUserBid.ts
|
|
15015
|
-
import { useState as useState58, useEffect as useEffect41, useCallback as
|
|
15056
|
+
import { useState as useState58, useEffect as useEffect41, useCallback as useCallback38 } from "react";
|
|
15016
15057
|
function useUserBid(collectionId, userDid) {
|
|
15017
15058
|
const handlers = useBlocknoteHandlers();
|
|
15018
15059
|
const [userBid, setUserBid] = useState58(null);
|
|
15019
15060
|
const [loading, setLoading] = useState58(true);
|
|
15020
15061
|
const [error, setError] = useState58(null);
|
|
15021
|
-
const fetchUserBid =
|
|
15062
|
+
const fetchUserBid = useCallback38(async () => {
|
|
15022
15063
|
if (!collectionId || !userDid) {
|
|
15023
15064
|
setLoading(false);
|
|
15024
15065
|
return;
|
|
@@ -15173,16 +15214,16 @@ var BidCollectionItem = ({ collection, deedId, adminAddress, userRole, onRefresh
|
|
|
15173
15214
|
}
|
|
15174
15215
|
return /* @__PURE__ */ React146.createElement(UserPlus_default, null);
|
|
15175
15216
|
};
|
|
15176
|
-
return /* @__PURE__ */ React146.createElement(ListItemContainer, { isChecked: false }, /* @__PURE__ */ React146.createElement(
|
|
15217
|
+
return /* @__PURE__ */ React146.createElement(ListItemContainer, { isChecked: false }, /* @__PURE__ */ React146.createElement(Box33, { mr: "md", style: { display: "flex", alignItems: "center" } }, getCollectionIcon()), /* @__PURE__ */ React146.createElement(Stack108, { gap: 4, style: { flex: 1 } }, /* @__PURE__ */ React146.createElement(Text82, { size: "sm", fw: 500 }, getCollectionName(collection)), collection.description && /* @__PURE__ */ React146.createElement(Text82, { size: "xs", c: "dimmed" }, collection.description)), renderActionButton());
|
|
15177
15218
|
};
|
|
15178
15219
|
|
|
15179
15220
|
// src/mantine/blocks/evaluator/flow/EvaluationCollectionItem.tsx
|
|
15180
|
-
import React149, { useMemo as useMemo42, useEffect as useEffect43, useRef as
|
|
15221
|
+
import React149, { useMemo as useMemo42, useEffect as useEffect43, useRef as useRef10 } from "react";
|
|
15181
15222
|
import { Stack as Stack111, Text as Text85, ActionIcon as ActionIcon25, Tooltip as Tooltip15 } from "@mantine/core";
|
|
15182
15223
|
|
|
15183
15224
|
// src/mantine/blocks/evaluator/flow/ClaimsList.tsx
|
|
15184
|
-
import React148, { useState as useState59, useEffect as useEffect42, useCallback as
|
|
15185
|
-
import { Paper as Paper14, CloseButton as CloseButton5, Title as
|
|
15225
|
+
import React148, { useState as useState59, useEffect as useEffect42, useCallback as useCallback39, useMemo as useMemo41 } from "react";
|
|
15226
|
+
import { Paper as Paper14, CloseButton as CloseButton5, Title as Title6, Loader as Loader17, Stack as Stack110, Text as Text84, ActionIcon as ActionIcon24, Alert as Alert19, Badge as Badge23, Group as Group51, Button as Button31, Divider as Divider13, Tabs as Tabs3, ScrollArea as ScrollArea6, Box as Box35, Select as Select4 } from "@mantine/core";
|
|
15186
15227
|
import { IconAlertCircle as IconAlertCircle4, IconArrowRight as IconArrowRight4, IconRefresh as IconRefresh3, IconArrowLeft as IconArrowLeft4, IconFileText as IconFileText3, IconRobot as IconRobot3, IconChecklist as IconChecklist3 } from "@tabler/icons-react";
|
|
15187
15228
|
import { Survey as Survey4, SurveyModel as SurveyModel4 } from "@ixo/surveys";
|
|
15188
15229
|
|
|
@@ -15346,7 +15387,7 @@ var surveyTheme2 = {
|
|
|
15346
15387
|
|
|
15347
15388
|
// src/mantine/blocks/evaluator/flow/RubricEvaluationResults.tsx
|
|
15348
15389
|
import React147, { useMemo as useMemo40 } from "react";
|
|
15349
|
-
import { Paper as Paper13, Stack as Stack109, Text as Text83, Badge as Badge22, Group as Group50, Progress as Progress3, Accordion as Accordion4, ThemeIcon as ThemeIcon2, Timeline, Box as
|
|
15390
|
+
import { Paper as Paper13, Stack as Stack109, Text as Text83, Badge as Badge22, Group as Group50, Progress as Progress3, Accordion as Accordion4, ThemeIcon as ThemeIcon2, Timeline, Box as Box34, Tooltip as Tooltip14, Divider as Divider12, Card as Card18, RingProgress, Center as Center7 } from "@mantine/core";
|
|
15350
15391
|
import { IconCheck as IconCheck4, IconX as IconX10, IconAlertTriangle as IconAlertTriangle2, IconClock, IconBrain, IconUser as IconUser4, IconArrowUp as IconArrowUp4, IconCalculator, IconCloud, IconChecklist as IconChecklist2, IconInfoCircle as IconInfoCircle3 } from "@tabler/icons-react";
|
|
15351
15392
|
var getOutcomeConfig = (outcome) => {
|
|
15352
15393
|
switch (outcome) {
|
|
@@ -15570,7 +15611,7 @@ var RubricEvaluationResults = ({ evaluation }) => {
|
|
|
15570
15611
|
formatDuration(step.duration)
|
|
15571
15612
|
)))
|
|
15572
15613
|
},
|
|
15573
|
-
/* @__PURE__ */ React147.createElement(
|
|
15614
|
+
/* @__PURE__ */ React147.createElement(Box34, { mt: "xs" }, step.message && /* @__PURE__ */ React147.createElement(Text83, { size: "sm", c: "dimmed", mb: "xs" }, step.message), step.error && /* @__PURE__ */ React147.createElement(
|
|
15574
15615
|
Paper13,
|
|
15575
15616
|
{
|
|
15576
15617
|
p: "xs",
|
|
@@ -15613,7 +15654,7 @@ var RubricEvaluationResults = ({ evaluation }) => {
|
|
|
15613
15654
|
);
|
|
15614
15655
|
})
|
|
15615
15656
|
)))
|
|
15616
|
-
), stats && /* @__PURE__ */ React147.createElement(
|
|
15657
|
+
), stats && /* @__PURE__ */ React147.createElement(Box34, null, /* @__PURE__ */ React147.createElement(Group50, { justify: "space-between", mb: 4 }, /* @__PURE__ */ React147.createElement(Text83, { size: "xs", c: "dimmed" }, "Overall Progress"), /* @__PURE__ */ React147.createElement(Text83, { size: "xs", c: "dimmed" }, stats.passed, "/", stats.total, " checks passed")), /* @__PURE__ */ React147.createElement(Progress3.Root, { size: "lg", radius: "xl" }, /* @__PURE__ */ React147.createElement(Progress3.Section, { value: stats.passed / stats.total * 100, color: "green" }, /* @__PURE__ */ React147.createElement(Progress3.Label, null, stats.passed, " passed")), /* @__PURE__ */ React147.createElement(Progress3.Section, { value: stats.failed / stats.total * 100, color: "red" }, /* @__PURE__ */ React147.createElement(Progress3.Label, null, stats.failed, " failed")))));
|
|
15617
15658
|
};
|
|
15618
15659
|
|
|
15619
15660
|
// src/mantine/blocks/evaluator/flow/ClaimsList.tsx
|
|
@@ -15623,6 +15664,13 @@ var SURVEY_THEME_VARIABLES2 = Object.entries(surveyTheme2.cssVariables ?? {}).re
|
|
|
15623
15664
|
}, {});
|
|
15624
15665
|
var SURVEY_THEME_BACKGROUND2 = SURVEY_THEME_VARIABLES2["--sjs-general-backcolor"] ?? "#050505";
|
|
15625
15666
|
var SURVEY_THEME_FOREGROUND2 = SURVEY_THEME_VARIABLES2["--sjs-general-forecolor"] ?? "#ffffff";
|
|
15667
|
+
var USDC_DENOM2 = "ibc/6BBE9BD4246F8E04948D5A4EEE7164B2630263B9EBB5E7DC5F0A46C62A2FF97B";
|
|
15668
|
+
var IXO_DENOM2 = "uixo";
|
|
15669
|
+
var DECIMALS2 = 6;
|
|
15670
|
+
var COIN_OPTIONS = [
|
|
15671
|
+
{ value: USDC_DENOM2, label: "USDC" },
|
|
15672
|
+
{ value: IXO_DENOM2, label: "IXO" }
|
|
15673
|
+
];
|
|
15626
15674
|
var ClaimsList = ({ collectionId, collectionName, deedId, adminAddress, onEvaluationComplete }) => {
|
|
15627
15675
|
const { closePanel } = usePanelStore();
|
|
15628
15676
|
const handlers = useBlocknoteHandlers();
|
|
@@ -15641,7 +15689,18 @@ var ClaimsList = ({ collectionId, collectionName, deedId, adminAddress, onEvalua
|
|
|
15641
15689
|
const [evaluationResult, setEvaluationResult] = useState59(null);
|
|
15642
15690
|
const [evaluationLoading, setEvaluationLoading] = useState59(false);
|
|
15643
15691
|
const [activeTab, setActiveTab] = useState59("submission");
|
|
15644
|
-
const
|
|
15692
|
+
const [selectedDenom, setSelectedDenom] = useState59(USDC_DENOM2);
|
|
15693
|
+
const [paymentAmount, setPaymentAmount] = useState59("");
|
|
15694
|
+
const buildPaymentCoin = useCallback39(() => {
|
|
15695
|
+
if (!selectedDenom || paymentAmount === "" || Number(paymentAmount) <= 0) {
|
|
15696
|
+
return void 0;
|
|
15697
|
+
}
|
|
15698
|
+
return {
|
|
15699
|
+
denom: selectedDenom,
|
|
15700
|
+
amount: (Number(paymentAmount) * Math.pow(10, DECIMALS2)).toString()
|
|
15701
|
+
};
|
|
15702
|
+
}, [selectedDenom, paymentAmount]);
|
|
15703
|
+
const fetchClaims = useCallback39(async () => {
|
|
15645
15704
|
try {
|
|
15646
15705
|
setLoading(true);
|
|
15647
15706
|
setError(null);
|
|
@@ -15659,7 +15718,7 @@ var ClaimsList = ({ collectionId, collectionName, deedId, adminAddress, onEvalua
|
|
|
15659
15718
|
useEffect42(() => {
|
|
15660
15719
|
fetchClaims();
|
|
15661
15720
|
}, [fetchClaims]);
|
|
15662
|
-
const fetchClaimAndSurvey =
|
|
15721
|
+
const fetchClaimAndSurvey = useCallback39(
|
|
15663
15722
|
async (claim) => {
|
|
15664
15723
|
try {
|
|
15665
15724
|
setSurveyLoading(true);
|
|
@@ -15706,7 +15765,7 @@ var ClaimsList = ({ collectionId, collectionName, deedId, adminAddress, onEvalua
|
|
|
15706
15765
|
},
|
|
15707
15766
|
[collectionId, deedId]
|
|
15708
15767
|
);
|
|
15709
|
-
const handleViewClaim =
|
|
15768
|
+
const handleViewClaim = useCallback39(
|
|
15710
15769
|
(claim) => {
|
|
15711
15770
|
setSelectedClaim(claim);
|
|
15712
15771
|
fetchClaimAndSurvey(claim);
|
|
@@ -15714,7 +15773,7 @@ var ClaimsList = ({ collectionId, collectionName, deedId, adminAddress, onEvalua
|
|
|
15714
15773
|
},
|
|
15715
15774
|
[fetchClaimAndSurvey]
|
|
15716
15775
|
);
|
|
15717
|
-
const handleBackToList =
|
|
15776
|
+
const handleBackToList = useCallback39(() => {
|
|
15718
15777
|
setViewMode("list");
|
|
15719
15778
|
setSelectedClaim(null);
|
|
15720
15779
|
setClaimData(null);
|
|
@@ -15724,6 +15783,8 @@ var ClaimsList = ({ collectionId, collectionName, deedId, adminAddress, onEvalua
|
|
|
15724
15783
|
setRubricData(null);
|
|
15725
15784
|
setEvaluationResult(null);
|
|
15726
15785
|
setActiveTab("submission");
|
|
15786
|
+
setSelectedDenom(USDC_DENOM2);
|
|
15787
|
+
setPaymentAmount("");
|
|
15727
15788
|
fetchClaims();
|
|
15728
15789
|
}, [fetchClaims]);
|
|
15729
15790
|
const surveyModel = useMemo41(() => {
|
|
@@ -15749,7 +15810,7 @@ var ClaimsList = ({ collectionId, collectionName, deedId, adminAddress, onEvalua
|
|
|
15749
15810
|
}),
|
|
15750
15811
|
[]
|
|
15751
15812
|
);
|
|
15752
|
-
const handleApprove =
|
|
15813
|
+
const handleApprove = useCallback39(async () => {
|
|
15753
15814
|
if (!selectedClaim) return;
|
|
15754
15815
|
try {
|
|
15755
15816
|
setEvaluating(true);
|
|
@@ -15818,6 +15879,7 @@ var ClaimsList = ({ collectionId, collectionName, deedId, adminAddress, onEvalua
|
|
|
15818
15879
|
verificationProof = udidResponse.url;
|
|
15819
15880
|
console.log("\u{1F50D} verificationProof set to:", verificationProof);
|
|
15820
15881
|
}
|
|
15882
|
+
const paymentCoin = buildPaymentCoin();
|
|
15821
15883
|
await handlers.evaluateClaim(
|
|
15822
15884
|
currentUser.address,
|
|
15823
15885
|
// granteeAddress (evaluator address)
|
|
@@ -15831,8 +15893,7 @@ var ClaimsList = ({ collectionId, collectionName, deedId, adminAddress, onEvalua
|
|
|
15831
15893
|
// EvaluationStatus.APPROVED
|
|
15832
15894
|
verificationProof,
|
|
15833
15895
|
// URL of the stored UDID
|
|
15834
|
-
amount:
|
|
15835
|
-
// Optional - pass undefined for now
|
|
15896
|
+
amount: paymentCoin
|
|
15836
15897
|
}
|
|
15837
15898
|
);
|
|
15838
15899
|
handleBackToList();
|
|
@@ -15841,8 +15902,8 @@ var ClaimsList = ({ collectionId, collectionName, deedId, adminAddress, onEvalua
|
|
|
15841
15902
|
setSurveyError(error2 instanceof Error ? error2.message : "Failed to approve claim");
|
|
15842
15903
|
setEvaluating(false);
|
|
15843
15904
|
}
|
|
15844
|
-
}, [selectedClaim, handlers, deedId, collectionId, adminAddress, evaluationResult, handleBackToList, onEvaluationComplete, editor]);
|
|
15845
|
-
const handleReject =
|
|
15905
|
+
}, [selectedClaim, handlers, deedId, collectionId, adminAddress, evaluationResult, handleBackToList, onEvaluationComplete, editor, buildPaymentCoin]);
|
|
15906
|
+
const handleReject = useCallback39(async () => {
|
|
15846
15907
|
if (!selectedClaim) return;
|
|
15847
15908
|
try {
|
|
15848
15909
|
setEvaluating(true);
|
|
@@ -15911,6 +15972,7 @@ var ClaimsList = ({ collectionId, collectionName, deedId, adminAddress, onEvalua
|
|
|
15911
15972
|
verificationProof = udidResponse.url;
|
|
15912
15973
|
console.log("\u{1F50D} verificationProof set to:", verificationProof);
|
|
15913
15974
|
}
|
|
15975
|
+
const paymentCoin = buildPaymentCoin();
|
|
15914
15976
|
await handlers.evaluateClaim(
|
|
15915
15977
|
currentUser.address,
|
|
15916
15978
|
// granteeAddress (evaluator address)
|
|
@@ -15924,8 +15986,7 @@ var ClaimsList = ({ collectionId, collectionName, deedId, adminAddress, onEvalua
|
|
|
15924
15986
|
// EvaluationStatus.REJECTED
|
|
15925
15987
|
verificationProof,
|
|
15926
15988
|
// URL of the stored UDID
|
|
15927
|
-
amount:
|
|
15928
|
-
// Optional - pass undefined for now
|
|
15989
|
+
amount: paymentCoin
|
|
15929
15990
|
}
|
|
15930
15991
|
);
|
|
15931
15992
|
handleBackToList();
|
|
@@ -15935,7 +15996,7 @@ var ClaimsList = ({ collectionId, collectionName, deedId, adminAddress, onEvalua
|
|
|
15935
15996
|
} finally {
|
|
15936
15997
|
setEvaluating(false);
|
|
15937
15998
|
}
|
|
15938
|
-
}, [selectedClaim, handlers, deedId, collectionId, adminAddress, evaluationResult, handleBackToList, onEvaluationComplete, editor]);
|
|
15999
|
+
}, [selectedClaim, handlers, deedId, collectionId, adminAddress, evaluationResult, handleBackToList, onEvaluationComplete, editor, buildPaymentCoin]);
|
|
15939
16000
|
const isClaimAlreadyEvaluated = useMemo41(() => {
|
|
15940
16001
|
if (!selectedClaim) return false;
|
|
15941
16002
|
if ("status" in selectedClaim && selectedClaim.status) {
|
|
@@ -15974,7 +16035,7 @@ var ClaimsList = ({ collectionId, collectionName, deedId, adminAddress, onEvalua
|
|
|
15974
16035
|
marginBottom: "1rem"
|
|
15975
16036
|
}
|
|
15976
16037
|
},
|
|
15977
|
-
/* @__PURE__ */ React148.createElement("div", { style: { display: "flex", alignItems: "center", gap: "0.5rem" } }, viewMode === "survey" && /* @__PURE__ */ React148.createElement(ActionIcon24, { variant: "subtle", onClick: handleBackToList }, /* @__PURE__ */ React148.createElement(IconArrowLeft4, { size: 20 })), /* @__PURE__ */ React148.createElement(
|
|
16038
|
+
/* @__PURE__ */ React148.createElement("div", { style: { display: "flex", alignItems: "center", gap: "0.5rem" } }, viewMode === "survey" && /* @__PURE__ */ React148.createElement(ActionIcon24, { variant: "subtle", onClick: handleBackToList }, /* @__PURE__ */ React148.createElement(IconArrowLeft4, { size: 20 })), /* @__PURE__ */ React148.createElement(Title6, { order: 3 }, viewMode === "list" ? `${collectionName} - Claims` : `Evaluate Claim #${selectedClaim?.claimId}`), viewMode === "list" && !loading && claims.length > 0 && /* @__PURE__ */ React148.createElement(Badge23, { size: "lg", variant: "light" }, claims.length)),
|
|
15978
16039
|
/* @__PURE__ */ React148.createElement(Group51, { gap: "xs" }, viewMode === "list" && /* @__PURE__ */ React148.createElement(ActionIcon24, { variant: "subtle", onClick: fetchClaims, loading, title: "Refresh claims" }, /* @__PURE__ */ React148.createElement(IconRefresh3, { size: 18 })), /* @__PURE__ */ React148.createElement(CloseButton5, { onClick: closePanel }))
|
|
15979
16040
|
),
|
|
15980
16041
|
/* @__PURE__ */ React148.createElement(
|
|
@@ -16032,7 +16093,22 @@ var ClaimsList = ({ collectionId, collectionName, deedId, adminAddress, onEvalua
|
|
|
16032
16093
|
rightSection: evaluationLoading ? /* @__PURE__ */ React148.createElement(Loader17, { size: 12 }) : evaluationResult?.trace?.result?.outcome ? /* @__PURE__ */ React148.createElement(Badge23, { size: "xs", color: evaluationResult.trace.result.outcome === "pass" ? "green" : evaluationResult.trace.result.outcome === "fail" ? "red" : "orange" }, evaluationResult.trace.result.outcome) : null
|
|
16033
16094
|
},
|
|
16034
16095
|
"AI Evaluation"
|
|
16035
|
-
)), /* @__PURE__ */ React148.createElement(Tabs3.Panel, { value: "submission", style: { flex: 1, overflow: "hidden", display: activeTab === "submission" ? "flex" : "none" } }, /* @__PURE__ */ React148.createElement(ScrollArea6, { style: { flex: 1 } }, /* @__PURE__ */ React148.createElement("div", { style: surveyContainerStyle }, surveyModel && /* @__PURE__ */ React148.createElement(Survey4, { model: surveyModel })))), /* @__PURE__ */ React148.createElement(Tabs3.Panel, { value: "evaluation", style: { flex: 1, overflow: "hidden", display: activeTab === "evaluation" ? "flex" : "none" } }, /* @__PURE__ */ React148.createElement(ScrollArea6, { style: { flex: 1, padding: "1rem" } }, evaluationLoading ? /* @__PURE__ */ React148.createElement(Stack110, { align: "center", justify: "center", py: "xl" }, /* @__PURE__ */ React148.createElement(Loader17, { size: "lg" }), /* @__PURE__ */ React148.createElement(Text84, { size: "sm", c: "dimmed" }, "Running AI evaluation...")) : evaluationResult ? /* @__PURE__ */ React148.createElement(RubricEvaluationResults, { evaluation: evaluationResult }) : rubricData === null && !evaluationLoading ? /* @__PURE__ */ React148.createElement(Alert19, { color: "yellow", title: "No Rubric Available", icon: /* @__PURE__ */ React148.createElement(IconChecklist3, { size: 18 }) }, /* @__PURE__ */ React148.createElement(Text84, { size: "sm" }, "No evaluation rubric is configured for this deed. Manual evaluation is required.")) : /* @__PURE__ */ React148.createElement(Alert19, { color: "gray", title: "Evaluation Not Available", icon: /* @__PURE__ */ React148.createElement(IconAlertCircle4, { size: 18 }) }, /* @__PURE__ */ React148.createElement(Text84, { size: "sm" }, "Evaluation data is not available for this claim."))))), /* @__PURE__ */ React148.createElement(Divider13, null), /* @__PURE__ */ React148.createElement(
|
|
16096
|
+
)), /* @__PURE__ */ React148.createElement(Tabs3.Panel, { value: "submission", style: { flex: 1, overflow: "hidden", display: activeTab === "submission" ? "flex" : "none" } }, /* @__PURE__ */ React148.createElement(ScrollArea6, { style: { flex: 1 } }, /* @__PURE__ */ React148.createElement("div", { style: surveyContainerStyle }, surveyModel && /* @__PURE__ */ React148.createElement(Survey4, { model: surveyModel })))), /* @__PURE__ */ React148.createElement(Tabs3.Panel, { value: "evaluation", style: { flex: 1, overflow: "hidden", display: activeTab === "evaluation" ? "flex" : "none" } }, /* @__PURE__ */ React148.createElement(ScrollArea6, { style: { flex: 1, padding: "1rem" } }, evaluationLoading ? /* @__PURE__ */ React148.createElement(Stack110, { align: "center", justify: "center", py: "xl" }, /* @__PURE__ */ React148.createElement(Loader17, { size: "lg" }), /* @__PURE__ */ React148.createElement(Text84, { size: "sm", c: "dimmed" }, "Running AI evaluation...")) : evaluationResult ? /* @__PURE__ */ React148.createElement(RubricEvaluationResults, { evaluation: evaluationResult }) : rubricData === null && !evaluationLoading ? /* @__PURE__ */ React148.createElement(Alert19, { color: "yellow", title: "No Rubric Available", icon: /* @__PURE__ */ React148.createElement(IconChecklist3, { size: 18 }) }, /* @__PURE__ */ React148.createElement(Text84, { size: "sm" }, "No evaluation rubric is configured for this deed. Manual evaluation is required.")) : /* @__PURE__ */ React148.createElement(Alert19, { color: "gray", title: "Evaluation Not Available", icon: /* @__PURE__ */ React148.createElement(IconAlertCircle4, { size: 18 }) }, /* @__PURE__ */ React148.createElement(Text84, { size: "sm" }, "Evaluation data is not available for this claim."))))), /* @__PURE__ */ React148.createElement(Divider13, null), /* @__PURE__ */ React148.createElement(Box35, null, /* @__PURE__ */ React148.createElement(Text84, { size: "sm", fw: 500, c: "dimmed", mb: "xs" }, "Payment Amount (Optional)"), /* @__PURE__ */ React148.createElement(Group51, { grow: true }, /* @__PURE__ */ React148.createElement(
|
|
16097
|
+
Select4,
|
|
16098
|
+
{
|
|
16099
|
+
data: COIN_OPTIONS,
|
|
16100
|
+
value: selectedDenom,
|
|
16101
|
+
onChange: setSelectedDenom,
|
|
16102
|
+
allowDeselect: false,
|
|
16103
|
+
styles: {
|
|
16104
|
+
input: {
|
|
16105
|
+
backgroundColor: "#1a1a1a",
|
|
16106
|
+
borderColor: "#333",
|
|
16107
|
+
color: "#f1f3f5"
|
|
16108
|
+
}
|
|
16109
|
+
}
|
|
16110
|
+
}
|
|
16111
|
+
), /* @__PURE__ */ React148.createElement(BaseNumberInput, { placeholder: "0", min: 0, value: paymentAmount, onChange: (val) => setPaymentAmount(val) }))), /* @__PURE__ */ React148.createElement(Stack110, { gap: "sm" }, /* @__PURE__ */ React148.createElement(Group51, { grow: true }, /* @__PURE__ */ React148.createElement(Button31, { color: "green", onClick: handleApprove, loading: evaluating, disabled: evaluating || isClaimAlreadyEvaluated }, "Approve Claim"), /* @__PURE__ */ React148.createElement(Button31, { color: "red", variant: "outline", onClick: handleReject, loading: evaluating, disabled: evaluating || isClaimAlreadyEvaluated }, "Reject Claim")), evaluationResult?.trace?.result?.outcome === "escalated" && /* @__PURE__ */ React148.createElement(Alert19, { color: "orange", title: "Escalation Required", icon: /* @__PURE__ */ React148.createElement(IconAlertCircle4, { size: 18 }) }, /* @__PURE__ */ React148.createElement(Text84, { size: "sm" }, "This claim has been flagged for human review. Please carefully review all details before making a decision.", evaluationResult.trace.result.escalatedTo && /* @__PURE__ */ React148.createElement(Text84, { size: "xs", c: "dimmed", mt: "xs" }, "Escalated to: ", evaluationResult.trace.result.escalatedTo)))))
|
|
16036
16112
|
)
|
|
16037
16113
|
)
|
|
16038
16114
|
);
|
|
@@ -16108,7 +16184,7 @@ var ClaimListItem = ({ claim, onViewClaim }) => {
|
|
|
16108
16184
|
import { IconArrowRight as IconArrowRight5 } from "@tabler/icons-react";
|
|
16109
16185
|
var EvaluationCollectionItem = ({ collection, deedId, adminAddress, userRole, onRefresh }) => {
|
|
16110
16186
|
const { getCurrentUser } = useBlocknoteHandlers();
|
|
16111
|
-
const getCurrentUserRef =
|
|
16187
|
+
const getCurrentUserRef = useRef10(getCurrentUser);
|
|
16112
16188
|
useEffect43(() => {
|
|
16113
16189
|
getCurrentUserRef.current = getCurrentUser;
|
|
16114
16190
|
}, [getCurrentUser]);
|
|
@@ -16253,7 +16329,7 @@ var ClaimFlowView = ({ editor, block }) => {
|
|
|
16253
16329
|
}),
|
|
16254
16330
|
[flowNode, runtime, ucanManager, userAddress, delegationStore, verifySignature, flowOwnerDid, flowUri]
|
|
16255
16331
|
);
|
|
16256
|
-
const executionRef =
|
|
16332
|
+
const executionRef = useRef11(executionValue);
|
|
16257
16333
|
useEffect44(() => {
|
|
16258
16334
|
executionRef.current = executionValue;
|
|
16259
16335
|
}, [executionValue]);
|
|
@@ -16307,11 +16383,11 @@ var ClaimFlowView = ({ editor, block }) => {
|
|
|
16307
16383
|
const title = block.props.title || "Submit Claim";
|
|
16308
16384
|
const adminAddress = block.props.adminAddress || "";
|
|
16309
16385
|
const { collections, loading, error, refetch } = useCollections(did, selectedCollectionIds, block, editor);
|
|
16310
|
-
const refetchRef =
|
|
16386
|
+
const refetchRef = useRef11(refetch);
|
|
16311
16387
|
useEffect44(() => {
|
|
16312
16388
|
refetchRef.current = refetch;
|
|
16313
16389
|
}, [refetch]);
|
|
16314
|
-
const stableRefetch =
|
|
16390
|
+
const stableRefetch = useCallback40(() => {
|
|
16315
16391
|
refetchRef.current();
|
|
16316
16392
|
}, []);
|
|
16317
16393
|
if (!did) {
|
|
@@ -16320,7 +16396,7 @@ var ClaimFlowView = ({ editor, block }) => {
|
|
|
16320
16396
|
if (selectedCollectionIds.length === 0) {
|
|
16321
16397
|
return /* @__PURE__ */ React151.createElement(Center9, { py: "xl" }, /* @__PURE__ */ React151.createElement(Text87, { size: "sm", c: "dimmed" }, "No claim collections selected"));
|
|
16322
16398
|
}
|
|
16323
|
-
return /* @__PURE__ */ React151.createElement(Stack113, { w: "100%" }, /* @__PURE__ */ React151.createElement(Flex27, { px: 5, align: "center", justify: "space-between" }, /* @__PURE__ */ React151.createElement(
|
|
16399
|
+
return /* @__PURE__ */ React151.createElement(Stack113, { w: "100%" }, /* @__PURE__ */ React151.createElement(Flex27, { px: 5, align: "center", justify: "space-between" }, /* @__PURE__ */ React151.createElement(Title7, { order: 4 }, title), /* @__PURE__ */ React151.createElement(Flex27, { gap: "xs" }, /* @__PURE__ */ React151.createElement(AssignmentDisplay, { block, onClick: openAssignment }), /* @__PURE__ */ React151.createElement(ActionIcon26, { variant: "subtle", size: "sm", onClick: stableRefetch, loading }, /* @__PURE__ */ React151.createElement(IconRefresh4, { size: 18 })), editable && /* @__PURE__ */ React151.createElement(ActionIcon26, { variant: "subtle", size: "sm", onClick: open }, /* @__PURE__ */ React151.createElement(IconSettings3, { size: 18 })))), loading ? /* @__PURE__ */ React151.createElement(Center9, { py: "xl" }, /* @__PURE__ */ React151.createElement(Loader19, { size: "md" })) : error ? /* @__PURE__ */ React151.createElement(Alert20, { color: "red", title: "Failed to load collections", icon: /* @__PURE__ */ React151.createElement(IconAlertCircle5, { size: 18 }) }, /* @__PURE__ */ React151.createElement(Text87, { size: "sm" }, error)) : /* @__PURE__ */ React151.createElement(
|
|
16324
16400
|
ClaimCollectionsList,
|
|
16325
16401
|
{
|
|
16326
16402
|
listType: "claims",
|
|
@@ -16399,10 +16475,10 @@ import React156, { useMemo as useMemo45 } from "react";
|
|
|
16399
16475
|
import { Group as Group52, Stack as Stack114, Text as Text88 } from "@mantine/core";
|
|
16400
16476
|
|
|
16401
16477
|
// src/mantine/blocks/bid/template/TemplateConfig.tsx
|
|
16402
|
-
import React155, { useCallback as
|
|
16478
|
+
import React155, { useCallback as useCallback42 } from "react";
|
|
16403
16479
|
|
|
16404
16480
|
// src/mantine/blocks/bid/template/GeneralTab.tsx
|
|
16405
|
-
import React154, { useEffect as useEffect45, useState as useState60, useCallback as
|
|
16481
|
+
import React154, { useEffect as useEffect45, useState as useState60, useCallback as useCallback41, useMemo as useMemo44 } from "react";
|
|
16406
16482
|
var GeneralTab7 = ({
|
|
16407
16483
|
title,
|
|
16408
16484
|
description,
|
|
@@ -16430,14 +16506,14 @@ var GeneralTab7 = ({
|
|
|
16430
16506
|
return [];
|
|
16431
16507
|
}
|
|
16432
16508
|
}, [selectedCollections]);
|
|
16433
|
-
const handleCollectionsChange =
|
|
16509
|
+
const handleCollectionsChange = useCallback41(
|
|
16434
16510
|
(collections) => {
|
|
16435
16511
|
const stringified = JSON.stringify(collections || []);
|
|
16436
16512
|
onSelectedCollectionsChange(stringified);
|
|
16437
16513
|
},
|
|
16438
16514
|
[onSelectedCollectionsChange]
|
|
16439
16515
|
);
|
|
16440
|
-
const handleAdminAddressChange =
|
|
16516
|
+
const handleAdminAddressChange = useCallback41(
|
|
16441
16517
|
(adminAddress2) => {
|
|
16442
16518
|
if (onAdminAddressChange) {
|
|
16443
16519
|
onAdminAddressChange(adminAddress2);
|
|
@@ -16667,7 +16743,7 @@ var bidActions = [
|
|
|
16667
16743
|
// src/mantine/blocks/bid/template/TemplateConfig.tsx
|
|
16668
16744
|
var TemplateConfig7 = ({ editor, block }) => {
|
|
16669
16745
|
const { closePanel } = usePanelStore();
|
|
16670
|
-
const updateProp =
|
|
16746
|
+
const updateProp = useCallback42(
|
|
16671
16747
|
(key, value) => {
|
|
16672
16748
|
editor.updateBlock(block, {
|
|
16673
16749
|
props: {
|
|
@@ -16761,8 +16837,8 @@ var BidTemplateView = ({ editor, block }) => {
|
|
|
16761
16837
|
};
|
|
16762
16838
|
|
|
16763
16839
|
// src/mantine/blocks/bid/flow/components/FlowView.tsx
|
|
16764
|
-
import React157, { useMemo as useMemo46, useRef as
|
|
16765
|
-
import { Stack as Stack115, Text as Text89, Loader as Loader20, Center as Center10, Alert as Alert21, Title as
|
|
16840
|
+
import React157, { useMemo as useMemo46, useRef as useRef12, useEffect as useEffect46, useCallback as useCallback43 } from "react";
|
|
16841
|
+
import { Stack as Stack115, Text as Text89, Loader as Loader20, Center as Center10, Alert as Alert21, Title as Title8, Flex as Flex28, ActionIcon as ActionIcon27 } from "@mantine/core";
|
|
16766
16842
|
import { IconSettings as IconSettings4, IconRefresh as IconRefresh5, IconAlertCircle as IconAlertCircle6 } from "@tabler/icons-react";
|
|
16767
16843
|
var BID_FLOW_PANEL_ID = "bid-flow-panel";
|
|
16768
16844
|
var BID_ASSIGNMENT_PANEL_ID2 = "bid-assignment-panel";
|
|
@@ -16804,7 +16880,7 @@ var BidFlowView = ({ editor, block }) => {
|
|
|
16804
16880
|
}),
|
|
16805
16881
|
[flowNode, runtime, ucanManager, userAddress, editor, flowUri, delegationStore, verifySignature, flowOwnerDid]
|
|
16806
16882
|
);
|
|
16807
|
-
const executionRef =
|
|
16883
|
+
const executionRef = useRef12(executionValue);
|
|
16808
16884
|
useEffect46(() => {
|
|
16809
16885
|
executionRef.current = executionValue;
|
|
16810
16886
|
}, [executionValue]);
|
|
@@ -16862,11 +16938,11 @@ var BidFlowView = ({ editor, block }) => {
|
|
|
16862
16938
|
const title = block.props.title || "Bid Application";
|
|
16863
16939
|
const { collections, loading, error, refetch } = useCollections(did, selectedCollectionIds, block, editor);
|
|
16864
16940
|
const { executeHookedActions } = useHookedActions({ block, editor });
|
|
16865
|
-
const refetchRef =
|
|
16941
|
+
const refetchRef = useRef12(refetch);
|
|
16866
16942
|
useEffect46(() => {
|
|
16867
16943
|
refetchRef.current = refetch;
|
|
16868
16944
|
}, [refetch]);
|
|
16869
|
-
const stableRefetch =
|
|
16945
|
+
const stableRefetch = useCallback43(() => {
|
|
16870
16946
|
refetchRef.current();
|
|
16871
16947
|
}, []);
|
|
16872
16948
|
if (!did) {
|
|
@@ -16875,7 +16951,7 @@ var BidFlowView = ({ editor, block }) => {
|
|
|
16875
16951
|
if (selectedCollectionIds.length === 0) {
|
|
16876
16952
|
return /* @__PURE__ */ React157.createElement(Center10, { py: "xl" }, /* @__PURE__ */ React157.createElement(Text89, { size: "sm", c: "dimmed" }, "No claim collections selected"));
|
|
16877
16953
|
}
|
|
16878
|
-
return /* @__PURE__ */ React157.createElement(Stack115, { w: "100%" }, /* @__PURE__ */ React157.createElement(Flex28, { px: 5, align: "center", justify: "space-between" }, /* @__PURE__ */ React157.createElement(
|
|
16954
|
+
return /* @__PURE__ */ React157.createElement(Stack115, { w: "100%" }, /* @__PURE__ */ React157.createElement(Flex28, { px: 5, align: "center", justify: "space-between" }, /* @__PURE__ */ React157.createElement(Title8, { order: 4 }, title), /* @__PURE__ */ React157.createElement(Flex28, { gap: "xs" }, /* @__PURE__ */ React157.createElement(AssignmentDisplay, { block, onClick: openAssignment }), /* @__PURE__ */ React157.createElement(ActionIcon27, { variant: "subtle", size: "sm", onClick: stableRefetch, loading }, /* @__PURE__ */ React157.createElement(IconRefresh5, { size: 18 })), editable && /* @__PURE__ */ React157.createElement(ActionIcon27, { variant: "subtle", size: "sm", onClick: open }, /* @__PURE__ */ React157.createElement(IconSettings4, { size: 18 })))), loading ? /* @__PURE__ */ React157.createElement(Center10, { py: "xl" }, /* @__PURE__ */ React157.createElement(Loader20, { size: "md" })) : error ? /* @__PURE__ */ React157.createElement(Alert21, { color: "red", title: "Failed to load collections", icon: /* @__PURE__ */ React157.createElement(IconAlertCircle6, { size: 18 }) }, /* @__PURE__ */ React157.createElement(Text89, { size: "sm" }, error)) : /* @__PURE__ */ React157.createElement(
|
|
16879
16955
|
ClaimCollectionsList,
|
|
16880
16956
|
{
|
|
16881
16957
|
listType: "bids",
|
|
@@ -16946,10 +17022,10 @@ import React162, { useMemo as useMemo48 } from "react";
|
|
|
16946
17022
|
import { Group as Group53, Stack as Stack116, Text as Text90 } from "@mantine/core";
|
|
16947
17023
|
|
|
16948
17024
|
// src/mantine/blocks/evaluator/template/TemplateConfig.tsx
|
|
16949
|
-
import React161, { useCallback as
|
|
17025
|
+
import React161, { useCallback as useCallback45 } from "react";
|
|
16950
17026
|
|
|
16951
17027
|
// src/mantine/blocks/evaluator/template/GeneralTab.tsx
|
|
16952
|
-
import React160, { useEffect as useEffect47, useState as useState61, useCallback as
|
|
17028
|
+
import React160, { useEffect as useEffect47, useState as useState61, useCallback as useCallback44, useMemo as useMemo47 } from "react";
|
|
16953
17029
|
var GeneralTab8 = ({
|
|
16954
17030
|
title,
|
|
16955
17031
|
description,
|
|
@@ -16977,14 +17053,14 @@ var GeneralTab8 = ({
|
|
|
16977
17053
|
return [];
|
|
16978
17054
|
}
|
|
16979
17055
|
}, [selectedCollections]);
|
|
16980
|
-
const handleCollectionsChange =
|
|
17056
|
+
const handleCollectionsChange = useCallback44(
|
|
16981
17057
|
(collections) => {
|
|
16982
17058
|
const stringified = JSON.stringify(collections || []);
|
|
16983
17059
|
onSelectedCollectionsChange(stringified);
|
|
16984
17060
|
},
|
|
16985
17061
|
[onSelectedCollectionsChange]
|
|
16986
17062
|
);
|
|
16987
|
-
const handleAdminAddressChange =
|
|
17063
|
+
const handleAdminAddressChange = useCallback44(
|
|
16988
17064
|
(adminAddress2) => {
|
|
16989
17065
|
if (onAdminAddressChange) {
|
|
16990
17066
|
onAdminAddressChange(adminAddress2);
|
|
@@ -17033,7 +17109,7 @@ var GeneralTab8 = ({
|
|
|
17033
17109
|
// src/mantine/blocks/evaluator/template/TemplateConfig.tsx
|
|
17034
17110
|
var TemplateConfig8 = ({ editor, block }) => {
|
|
17035
17111
|
const { closePanel } = usePanelStore();
|
|
17036
|
-
const updateProp =
|
|
17112
|
+
const updateProp = useCallback45(
|
|
17037
17113
|
(key, value) => {
|
|
17038
17114
|
editor.updateBlock(block, {
|
|
17039
17115
|
props: {
|
|
@@ -17102,7 +17178,7 @@ var EvaluatorTemplateView = ({ editor, block }) => {
|
|
|
17102
17178
|
|
|
17103
17179
|
// src/mantine/blocks/evaluator/flow/FlowView.tsx
|
|
17104
17180
|
import React163, { useMemo as useMemo49 } from "react";
|
|
17105
|
-
import { Stack as Stack117, Text as Text91, Loader as Loader21, Center as Center11, Alert as Alert22, Title as
|
|
17181
|
+
import { Stack as Stack117, Text as Text91, Loader as Loader21, Center as Center11, Alert as Alert22, Title as Title9, Flex as Flex29, ActionIcon as ActionIcon28 } from "@mantine/core";
|
|
17106
17182
|
import { IconSettings as IconSettings5, IconRefresh as IconRefresh6, IconAlertCircle as IconAlertCircle7 } from "@tabler/icons-react";
|
|
17107
17183
|
var EVALUATOR_ASSIGNMENT_PANEL_ID2 = "evaluator-assignment-panel";
|
|
17108
17184
|
var EvaluatorFlowView = ({ editor, block }) => {
|
|
@@ -17133,7 +17209,7 @@ var EvaluatorFlowView = ({ editor, block }) => {
|
|
|
17133
17209
|
if (selectedCollectionIds.length === 0) {
|
|
17134
17210
|
return /* @__PURE__ */ React163.createElement(Center11, { py: "xl" }, /* @__PURE__ */ React163.createElement(Text91, { size: "sm", c: "dimmed" }, "No claim collections selected"));
|
|
17135
17211
|
}
|
|
17136
|
-
return /* @__PURE__ */ React163.createElement(Stack117, { w: "100%" }, /* @__PURE__ */ React163.createElement(Flex29, { px: 5, align: "center", justify: "space-between" }, /* @__PURE__ */ React163.createElement(
|
|
17212
|
+
return /* @__PURE__ */ React163.createElement(Stack117, { w: "100%" }, /* @__PURE__ */ React163.createElement(Flex29, { px: 5, align: "center", justify: "space-between" }, /* @__PURE__ */ React163.createElement(Title9, { order: 4 }, title), /* @__PURE__ */ React163.createElement(Flex29, { gap: "xs" }, /* @__PURE__ */ React163.createElement(AssignmentDisplay, { block, onClick: openAssignment }), /* @__PURE__ */ React163.createElement(ActionIcon28, { variant: "subtle", size: "sm", onClick: refetch, loading }, /* @__PURE__ */ React163.createElement(IconRefresh6, { size: 18 })), editable && /* @__PURE__ */ React163.createElement(ActionIcon28, { variant: "subtle", size: "sm" }, /* @__PURE__ */ React163.createElement(IconSettings5, { size: 18 })))), loading ? /* @__PURE__ */ React163.createElement(Center11, { py: "xl" }, /* @__PURE__ */ React163.createElement(Loader21, { size: "md" })) : error ? /* @__PURE__ */ React163.createElement(Alert22, { color: "red", title: "Failed to load collections", icon: /* @__PURE__ */ React163.createElement(IconAlertCircle7, { size: 18 }) }, /* @__PURE__ */ React163.createElement(Text91, { size: "sm" }, error)) : /* @__PURE__ */ React163.createElement(ClaimCollectionsList, { listType: "evaluations", collections, deedId: did, adminAddress, userAddress, onRefresh: refetch }));
|
|
17137
17213
|
};
|
|
17138
17214
|
|
|
17139
17215
|
// src/mantine/blocks/evaluator/EvaluatorBlock.tsx
|
|
@@ -17185,12 +17261,12 @@ import React167 from "react";
|
|
|
17185
17261
|
import { createReactBlockSpec as createReactBlockSpec12 } from "@blocknote/react";
|
|
17186
17262
|
|
|
17187
17263
|
// src/mantine/blocks/visualization/VisualizationBlock.tsx
|
|
17188
|
-
import React166, { useMemo as useMemo50, useCallback as
|
|
17189
|
-
import { Box as
|
|
17264
|
+
import React166, { useMemo as useMemo50, useCallback as useCallback46, useRef as useRef13, useState as useState62, useEffect as useEffect48 } from "react";
|
|
17265
|
+
import { Box as Box36, Stack as Stack118, Text as Text92, Paper as Paper15, Group as Group54 } from "@mantine/core";
|
|
17190
17266
|
function VisualizationBlock({ block, editor }) {
|
|
17191
17267
|
const { visualizationRenderer } = useBlocknoteContext();
|
|
17192
17268
|
const { vizType, config, title, preferences } = block.props;
|
|
17193
|
-
const containerRef =
|
|
17269
|
+
const containerRef = useRef13(null);
|
|
17194
17270
|
const [hasValidDimensions, setHasValidDimensions] = useState62(false);
|
|
17195
17271
|
useEffect48(() => {
|
|
17196
17272
|
const container = containerRef.current;
|
|
@@ -17222,7 +17298,7 @@ function VisualizationBlock({ block, editor }) {
|
|
|
17222
17298
|
return {};
|
|
17223
17299
|
}
|
|
17224
17300
|
}, [preferences]);
|
|
17225
|
-
const handlePreferencesChange =
|
|
17301
|
+
const handlePreferencesChange = useCallback46(
|
|
17226
17302
|
(newPreferences) => {
|
|
17227
17303
|
if (editor) {
|
|
17228
17304
|
editor.updateBlock(block, {
|
|
@@ -17241,7 +17317,7 @@ function VisualizationBlock({ block, editor }) {
|
|
|
17241
17317
|
if (visualizationRenderer) {
|
|
17242
17318
|
const renderedContent = visualizationRenderer(vizType, parsedConfig, parsedPreferences, handlePreferencesChange);
|
|
17243
17319
|
if (renderedContent) {
|
|
17244
|
-
return /* @__PURE__ */ React166.createElement(
|
|
17320
|
+
return /* @__PURE__ */ React166.createElement(Box36, { ref: containerRef, w: "100%", miw: 200, mih: 200 }, hasValidDimensions ? renderedContent : null);
|
|
17245
17321
|
}
|
|
17246
17322
|
}
|
|
17247
17323
|
return /* @__PURE__ */ React166.createElement(Paper15, { p: "lg", withBorder: true, radius: "lg", w: "100%" }, /* @__PURE__ */ React166.createElement(Stack118, { gap: "sm" }, /* @__PURE__ */ React166.createElement(Text92, { fz: "18", ta: "center" }, "Visualization Block"), /* @__PURE__ */ React166.createElement(Paper15, { p: "sm", bg: "var(--mantine-color-dark-6)", radius: "sm" }, /* @__PURE__ */ React166.createElement(Stack118, { gap: "xs" }, !title && /* @__PURE__ */ React166.createElement(Group54, { gap: "xs" }, /* @__PURE__ */ React166.createElement(Text92, { size: "xs", c: "dimmed", fw: 500 }, "Title:"), /* @__PURE__ */ React166.createElement(Text92, { size: "xs", c: "white" }, title || "No title")), /* @__PURE__ */ React166.createElement(Group54, { gap: "xs" }, /* @__PURE__ */ React166.createElement(Text92, { size: "xs", c: "dimmed", fw: 500 }, "Type:"), /* @__PURE__ */ React166.createElement(Text92, { size: "xs", c: "white" }, vizType)))), /* @__PURE__ */ React166.createElement(Text92, { c: "dimmed", fz: "sm", fs: "italic", ta: "center" }, "View in a compatible client to see the full visualization.")));
|
|
@@ -17289,7 +17365,7 @@ import React170, { useMemo as useMemo51 } from "react";
|
|
|
17289
17365
|
import { Badge as Badge24, Group as Group55, Stack as Stack119, Text as Text93 } from "@mantine/core";
|
|
17290
17366
|
|
|
17291
17367
|
// src/mantine/blocks/domainCreator/template/TemplateConfig.tsx
|
|
17292
|
-
import React169, { useCallback as
|
|
17368
|
+
import React169, { useCallback as useCallback47 } from "react";
|
|
17293
17369
|
|
|
17294
17370
|
// src/mantine/blocks/domainCreator/template/GeneralTab.tsx
|
|
17295
17371
|
import React168, { useEffect as useEffect49, useState as useState63 } from "react";
|
|
@@ -17344,7 +17420,7 @@ var GeneralTab9 = ({ title, description, icon, onTitleChange, onDescriptionChang
|
|
|
17344
17420
|
// src/mantine/blocks/domainCreator/template/TemplateConfig.tsx
|
|
17345
17421
|
var TemplateConfig9 = ({ editor, block }) => {
|
|
17346
17422
|
const { closePanel } = usePanelStore();
|
|
17347
|
-
const updateProp =
|
|
17423
|
+
const updateProp = useCallback47(
|
|
17348
17424
|
(key, value) => {
|
|
17349
17425
|
editor.updateBlock(block, {
|
|
17350
17426
|
props: {
|
|
@@ -17395,12 +17471,12 @@ var DomainCreatorTemplateView = ({ editor, block }) => {
|
|
|
17395
17471
|
};
|
|
17396
17472
|
|
|
17397
17473
|
// src/mantine/blocks/domainCreator/flow/FlowView.tsx
|
|
17398
|
-
import React172, { useCallback as
|
|
17474
|
+
import React172, { useCallback as useCallback49, useMemo as useMemo53, useState as useState65 } from "react";
|
|
17399
17475
|
import { ActionIcon as ActionIcon29, Badge as Badge25, Group as Group57, Stack as Stack121, Text as Text95, Tooltip as Tooltip16 } from "@mantine/core";
|
|
17400
17476
|
import { IconChevronRight as IconChevronRight6, IconCheck as IconCheck6, IconAlertCircle as IconAlertCircle9 } from "@tabler/icons-react";
|
|
17401
17477
|
|
|
17402
17478
|
// src/mantine/blocks/domainCreator/flow/DomainCreatorSurveyPanel.tsx
|
|
17403
|
-
import React171, { useCallback as
|
|
17479
|
+
import React171, { useCallback as useCallback48, useEffect as useEffect50, useMemo as useMemo52, useRef as useRef14, useState as useState64 } from "react";
|
|
17404
17480
|
import { Alert as Alert23, Button as Button32, Group as Group56, Loader as Loader22, Stack as Stack120, Text as Text94 } from "@mantine/core";
|
|
17405
17481
|
import { useDebouncedCallback } from "@mantine/hooks";
|
|
17406
17482
|
import { IconAlertCircle as IconAlertCircle8, IconCheck as IconCheck5 } from "@tabler/icons-react";
|
|
@@ -18465,8 +18541,8 @@ var DomainCreatorSurveyPanel = ({ editor, block, onComplete, entityDid: existing
|
|
|
18465
18541
|
const [error, setError] = useState64(null);
|
|
18466
18542
|
const [createdEntityDid, setCreatedEntityDid] = useState64(existingBlockEntityDid || null);
|
|
18467
18543
|
const [createdEntityType, setCreatedEntityType] = useState64(existingBlockEntityType || null);
|
|
18468
|
-
const isUpdatingFromProp =
|
|
18469
|
-
const lastSyncedAnswers =
|
|
18544
|
+
const isUpdatingFromProp = useRef14(false);
|
|
18545
|
+
const lastSyncedAnswers = useRef14("");
|
|
18470
18546
|
const surveyModel = useMemo52(() => {
|
|
18471
18547
|
const model = new SurveyModel5(tempDomainCreatorSurvey);
|
|
18472
18548
|
model.applyTheme(surveyTheme);
|
|
@@ -18474,7 +18550,7 @@ var DomainCreatorSurveyPanel = ({ editor, block, onComplete, entityDid: existing
|
|
|
18474
18550
|
model.questionsOnPageMode = "singlePage";
|
|
18475
18551
|
return model;
|
|
18476
18552
|
}, []);
|
|
18477
|
-
const syncPropToSurvey =
|
|
18553
|
+
const syncPropToSurvey = useCallback48(
|
|
18478
18554
|
(answersJson) => {
|
|
18479
18555
|
if (!answersJson || answersJson === lastSyncedAnswers.current) return;
|
|
18480
18556
|
try {
|
|
@@ -18544,7 +18620,7 @@ var DomainCreatorSurveyPanel = ({ editor, block, onComplete, entityDid: existing
|
|
|
18544
18620
|
});
|
|
18545
18621
|
}
|
|
18546
18622
|
}, [editor, block]);
|
|
18547
|
-
const processDomainCreation =
|
|
18623
|
+
const processDomainCreation = useCallback48(
|
|
18548
18624
|
async (data) => {
|
|
18549
18625
|
if (!handlers) {
|
|
18550
18626
|
throw new Error("Handlers not available");
|
|
@@ -18622,7 +18698,7 @@ var DomainCreatorSurveyPanel = ({ editor, block, onComplete, entityDid: existing
|
|
|
18622
18698
|
},
|
|
18623
18699
|
[handlers, existingEntityDid, issuerDidOverride]
|
|
18624
18700
|
);
|
|
18625
|
-
const handleSurveyComplete =
|
|
18701
|
+
const handleSurveyComplete = useCallback48(
|
|
18626
18702
|
async (sender) => {
|
|
18627
18703
|
const data = sender.data || {};
|
|
18628
18704
|
try {
|
|
@@ -18656,15 +18732,15 @@ var DomainCreatorSurveyPanel = ({ editor, block, onComplete, entityDid: existing
|
|
|
18656
18732
|
surveyModel.onComplete.remove(handleSurveyComplete);
|
|
18657
18733
|
};
|
|
18658
18734
|
}, [handleSurveyComplete, surveyModel]);
|
|
18659
|
-
const handleRetry =
|
|
18735
|
+
const handleRetry = useCallback48(() => {
|
|
18660
18736
|
setFlowStep("survey");
|
|
18661
18737
|
setError(null);
|
|
18662
18738
|
surveyModel.clear();
|
|
18663
18739
|
}, [surveyModel]);
|
|
18664
|
-
const handleClose =
|
|
18740
|
+
const handleClose = useCallback48(() => {
|
|
18665
18741
|
closePanel();
|
|
18666
18742
|
}, [closePanel]);
|
|
18667
|
-
const handleVisitEntity =
|
|
18743
|
+
const handleVisitEntity = useCallback48(() => {
|
|
18668
18744
|
if (createdEntityDid && createdEntityType && handlers?.redirectToEntityOverview) {
|
|
18669
18745
|
handlers.redirectToEntityOverview(createdEntityDid, createdEntityType);
|
|
18670
18746
|
}
|
|
@@ -18701,7 +18777,7 @@ var DomainCreatorFlowView = ({ editor, block }) => {
|
|
|
18701
18777
|
const [submissionStatus, setSubmissionStatus] = useState65("idle");
|
|
18702
18778
|
const lastSubmission = block.props.lastSubmission ? JSON.parse(block.props.lastSubmission) : null;
|
|
18703
18779
|
const hasExistingSubmission = lastSubmission?.entityDid;
|
|
18704
|
-
const handleComplete =
|
|
18780
|
+
const handleComplete = useCallback49(
|
|
18705
18781
|
(data) => {
|
|
18706
18782
|
editor.updateBlock(block, {
|
|
18707
18783
|
props: {
|
|
@@ -18787,11 +18863,11 @@ import React178, { useMemo as useMemo56 } from "react";
|
|
|
18787
18863
|
import { Badge as Badge27, Group as Group59, Stack as Stack124, Text as Text98 } from "@mantine/core";
|
|
18788
18864
|
|
|
18789
18865
|
// src/mantine/blocks/email/template/TemplateConfig.tsx
|
|
18790
|
-
import React177, { useCallback as
|
|
18866
|
+
import React177, { useCallback as useCallback52, useMemo as useMemo55 } from "react";
|
|
18791
18867
|
|
|
18792
18868
|
// src/mantine/blocks/email/template/GeneralTab.tsx
|
|
18793
|
-
import React175, { useEffect as useEffect51, useState as useState66, useCallback as
|
|
18794
|
-
import { Divider as Divider14, Loader as Loader23, Select as
|
|
18869
|
+
import React175, { useEffect as useEffect51, useState as useState66, useCallback as useCallback50, useRef as useRef15 } from "react";
|
|
18870
|
+
import { Divider as Divider14, Loader as Loader23, Select as Select5, Stack as Stack122, Text as Text96 } from "@mantine/core";
|
|
18795
18871
|
var GeneralTab10 = ({ editor, blockId, getCurrentBlock, onTitleChange, onTemplateChange, onToChange }) => {
|
|
18796
18872
|
const handlers = useBlocknoteHandlers();
|
|
18797
18873
|
const block = getCurrentBlock();
|
|
@@ -18809,7 +18885,7 @@ var GeneralTab10 = ({ editor, blockId, getCurrentBlock, onTitleChange, onTemplat
|
|
|
18809
18885
|
setLocalTemplateName(currentBlock.props.templateName || "");
|
|
18810
18886
|
setLocalTo(currentBlock.props.to || "");
|
|
18811
18887
|
}, [getCurrentBlock]);
|
|
18812
|
-
const hasLoadedTemplates =
|
|
18888
|
+
const hasLoadedTemplates = useRef15(false);
|
|
18813
18889
|
useEffect51(() => {
|
|
18814
18890
|
if (hasLoadedTemplates.current) return;
|
|
18815
18891
|
async function loadTemplates() {
|
|
@@ -18832,7 +18908,7 @@ var GeneralTab10 = ({ editor, blockId, getCurrentBlock, onTitleChange, onTemplat
|
|
|
18832
18908
|
}
|
|
18833
18909
|
loadTemplates();
|
|
18834
18910
|
}, [handlers.listEmailTemplates]);
|
|
18835
|
-
const handleTemplateSelect =
|
|
18911
|
+
const handleTemplateSelect = useCallback50(
|
|
18836
18912
|
async (selectedTemplateName) => {
|
|
18837
18913
|
if (!selectedTemplateName) {
|
|
18838
18914
|
setLocalTemplateName("");
|
|
@@ -18890,7 +18966,7 @@ var GeneralTab10 = ({ editor, blockId, getCurrentBlock, onTitleChange, onTemplat
|
|
|
18890
18966
|
}
|
|
18891
18967
|
}
|
|
18892
18968
|
)), /* @__PURE__ */ React175.createElement(Divider14, { variant: "dashed" }), /* @__PURE__ */ React175.createElement(Stack122, { gap: "xs" }, /* @__PURE__ */ React175.createElement(Text96, { size: "sm", fw: 600 }, "Email Template"), /* @__PURE__ */ React175.createElement(Text96, { size: "xs", c: "dimmed" }, "Select a Mailgun template to use for this email."), /* @__PURE__ */ React175.createElement(
|
|
18893
|
-
|
|
18969
|
+
Select5,
|
|
18894
18970
|
{
|
|
18895
18971
|
placeholder: loadingTemplates ? "Loading templates..." : "Select a template",
|
|
18896
18972
|
data: templates.map((t) => ({ value: t.name, label: t.name })),
|
|
@@ -18921,7 +18997,7 @@ var GeneralTab10 = ({ editor, blockId, getCurrentBlock, onTitleChange, onTemplat
|
|
|
18921
18997
|
};
|
|
18922
18998
|
|
|
18923
18999
|
// src/mantine/blocks/email/template/VariablesTab.tsx
|
|
18924
|
-
import React176, { useMemo as useMemo54, useCallback as
|
|
19000
|
+
import React176, { useMemo as useMemo54, useCallback as useCallback51, useState as useState67, useEffect as useEffect52 } from "react";
|
|
18925
19001
|
import { Alert as Alert24, Badge as Badge26, Divider as Divider15, Group as Group58, Stack as Stack123, Text as Text97 } from "@mantine/core";
|
|
18926
19002
|
import { IconInfoCircle as IconInfoCircle4, IconCheck as IconCheck7 } from "@tabler/icons-react";
|
|
18927
19003
|
var VariablesTab = ({ editor, blockId, getCurrentBlock, onVariablesChange }) => {
|
|
@@ -18951,7 +19027,7 @@ var VariablesTab = ({ editor, blockId, getCurrentBlock, onVariablesChange }) =>
|
|
|
18951
19027
|
setLocalMapping({});
|
|
18952
19028
|
}
|
|
18953
19029
|
}, [getCurrentBlock]);
|
|
18954
|
-
const handleVariableChange =
|
|
19030
|
+
const handleVariableChange = useCallback51(
|
|
18955
19031
|
(variableName, value) => {
|
|
18956
19032
|
const updated = { ...localMapping, [variableName]: value };
|
|
18957
19033
|
setLocalMapping(updated);
|
|
@@ -18984,11 +19060,11 @@ var VariablesTab = ({ editor, blockId, getCurrentBlock, onVariablesChange }) =>
|
|
|
18984
19060
|
// src/mantine/blocks/email/template/TemplateConfig.tsx
|
|
18985
19061
|
var TemplateConfig10 = ({ editor, block }) => {
|
|
18986
19062
|
const { closePanel } = usePanelStore();
|
|
18987
|
-
const getCurrentBlock =
|
|
19063
|
+
const getCurrentBlock = useCallback52(() => {
|
|
18988
19064
|
const currentBlock = editor.document.find((b) => b.id === block.id);
|
|
18989
19065
|
return currentBlock || block;
|
|
18990
19066
|
}, [editor, block.id]);
|
|
18991
|
-
const updateProp =
|
|
19067
|
+
const updateProp = useCallback52(
|
|
18992
19068
|
(key, value) => {
|
|
18993
19069
|
const currentBlock = getCurrentBlock();
|
|
18994
19070
|
editor.updateBlock(currentBlock, {
|
|
@@ -19000,7 +19076,7 @@ var TemplateConfig10 = ({ editor, block }) => {
|
|
|
19000
19076
|
},
|
|
19001
19077
|
[editor, getCurrentBlock]
|
|
19002
19078
|
);
|
|
19003
|
-
const handleTemplateChange =
|
|
19079
|
+
const handleTemplateChange = useCallback52(
|
|
19004
19080
|
(updates) => {
|
|
19005
19081
|
const currentBlock = getCurrentBlock();
|
|
19006
19082
|
editor.updateBlock(currentBlock, {
|
|
@@ -19012,7 +19088,7 @@ var TemplateConfig10 = ({ editor, block }) => {
|
|
|
19012
19088
|
},
|
|
19013
19089
|
[editor, getCurrentBlock]
|
|
19014
19090
|
);
|
|
19015
|
-
const handleVariablesChange =
|
|
19091
|
+
const handleVariablesChange = useCallback52(
|
|
19016
19092
|
(variables) => {
|
|
19017
19093
|
updateProp("variables", variables);
|
|
19018
19094
|
},
|
|
@@ -19082,11 +19158,11 @@ import { Group as Group60, Stack as Stack125, Text as Text99, ActionIcon as Acti
|
|
|
19082
19158
|
import { IconSend as IconSend4, IconCheck as IconCheck8, IconX as IconX11 } from "@tabler/icons-react";
|
|
19083
19159
|
|
|
19084
19160
|
// src/mantine/blocks/email/flow/hooks/useEmailActions.ts
|
|
19085
|
-
import { useState as useState68, useCallback as
|
|
19161
|
+
import { useState as useState68, useCallback as useCallback53 } from "react";
|
|
19086
19162
|
function useEmailActions({ block, editor }) {
|
|
19087
19163
|
const handlers = useBlocknoteHandlers();
|
|
19088
19164
|
const [loading, setLoading] = useState68(false);
|
|
19089
|
-
const updateBlockStatus =
|
|
19165
|
+
const updateBlockStatus = useCallback53(
|
|
19090
19166
|
(updates) => {
|
|
19091
19167
|
editor.updateBlock(block, {
|
|
19092
19168
|
props: { ...block.props, ...updates }
|
|
@@ -19094,7 +19170,7 @@ function useEmailActions({ block, editor }) {
|
|
|
19094
19170
|
},
|
|
19095
19171
|
[editor, block]
|
|
19096
19172
|
);
|
|
19097
|
-
const sendEmail =
|
|
19173
|
+
const sendEmail = useCallback53(async () => {
|
|
19098
19174
|
if (!handlers.sendEmail) {
|
|
19099
19175
|
updateBlockStatus({
|
|
19100
19176
|
status: "error",
|
|
@@ -19161,7 +19237,7 @@ function useEmailActions({ block, editor }) {
|
|
|
19161
19237
|
setLoading(false);
|
|
19162
19238
|
}
|
|
19163
19239
|
}, [block, editor, handlers, updateBlockStatus]);
|
|
19164
|
-
const resetStatus =
|
|
19240
|
+
const resetStatus = useCallback53(() => {
|
|
19165
19241
|
updateBlockStatus({
|
|
19166
19242
|
status: "idle",
|
|
19167
19243
|
error: ""
|
|
@@ -19318,11 +19394,11 @@ import React188 from "react";
|
|
|
19318
19394
|
import React184, { useMemo as useMemo59 } from "react";
|
|
19319
19395
|
|
|
19320
19396
|
// src/mantine/blocks/protocolSelector/template/TemplateConfig.tsx
|
|
19321
|
-
import React183, { useCallback as
|
|
19397
|
+
import React183, { useCallback as useCallback54 } from "react";
|
|
19322
19398
|
|
|
19323
19399
|
// src/mantine/blocks/protocolSelector/template/GeneralTab.tsx
|
|
19324
19400
|
import React182, { useEffect as useEffect53, useMemo as useMemo58, useState as useState69 } from "react";
|
|
19325
|
-
import { Divider as Divider17, Stack as Stack126, Text as Text100, PillsInput as PillsInput2, Pill as Pill2, Box as
|
|
19401
|
+
import { Divider as Divider17, Stack as Stack126, Text as Text100, PillsInput as PillsInput2, Pill as Pill2, Box as Box37 } from "@mantine/core";
|
|
19326
19402
|
var GeneralTab11 = ({ title, description, protocolDids, onTitleChange, onDescriptionChange, onProtocolDidsChange }) => {
|
|
19327
19403
|
const [localTitle, setLocalTitle] = useState69(title || "");
|
|
19328
19404
|
const [localDescription, setLocalDescription] = useState69(description || "");
|
|
@@ -19390,13 +19466,13 @@ var GeneralTab11 = ({ title, description, protocolDids, onTitleChange, onDescrip
|
|
|
19390
19466
|
}
|
|
19391
19467
|
}
|
|
19392
19468
|
}
|
|
19393
|
-
))), localDids.length > 0 && /* @__PURE__ */ React182.createElement(
|
|
19469
|
+
))), localDids.length > 0 && /* @__PURE__ */ React182.createElement(Box37, { mt: "xs" }, /* @__PURE__ */ React182.createElement(Text100, { size: "xs", c: "dimmed" }, localDids.length, " protocol", localDids.length !== 1 ? "s" : "", " configured"))));
|
|
19394
19470
|
};
|
|
19395
19471
|
|
|
19396
19472
|
// src/mantine/blocks/protocolSelector/template/TemplateConfig.tsx
|
|
19397
19473
|
var TemplateConfig11 = ({ editor, block }) => {
|
|
19398
19474
|
const { closePanel } = usePanelStore();
|
|
19399
|
-
const updateProp =
|
|
19475
|
+
const updateProp = useCallback54(
|
|
19400
19476
|
(key, value) => {
|
|
19401
19477
|
editor.updateBlock(block, {
|
|
19402
19478
|
props: {
|
|
@@ -19433,7 +19509,7 @@ var TemplateConfig11 = ({ editor, block }) => {
|
|
|
19433
19509
|
};
|
|
19434
19510
|
|
|
19435
19511
|
// src/mantine/blocks/protocolSelector/template/TemplateView.tsx
|
|
19436
|
-
import { Box as
|
|
19512
|
+
import { Box as Box38, Group as Group61, Stack as Stack127, Text as Text101 } from "@mantine/core";
|
|
19437
19513
|
import { IconCircleDashed as IconCircleDashed2 } from "@tabler/icons-react";
|
|
19438
19514
|
var PROTOCOL_SELECTOR_TEMPLATE_PANEL_ID = "protocol-selector-template-panel";
|
|
19439
19515
|
var ProtocolSelectorTemplateView = ({ editor, block }) => {
|
|
@@ -19449,7 +19525,7 @@ var ProtocolSelectorTemplateView = ({ editor, block }) => {
|
|
|
19449
19525
|
}
|
|
19450
19526
|
}, [block.props.protocolDids]);
|
|
19451
19527
|
return /* @__PURE__ */ React184.createElement(BaseContainer, { onClick: open }, /* @__PURE__ */ React184.createElement(Group61, { wrap: "nowrap", justify: "space-between", align: "center" }, /* @__PURE__ */ React184.createElement(Group61, { wrap: "nowrap", align: "center", gap: "md" }, /* @__PURE__ */ React184.createElement(
|
|
19452
|
-
|
|
19528
|
+
Box38,
|
|
19453
19529
|
{
|
|
19454
19530
|
style: {
|
|
19455
19531
|
width: 40,
|
|
@@ -19467,12 +19543,12 @@ var ProtocolSelectorTemplateView = ({ editor, block }) => {
|
|
|
19467
19543
|
|
|
19468
19544
|
// src/mantine/blocks/protocolSelector/flow/FlowView.tsx
|
|
19469
19545
|
import React187, { useMemo as useMemo61 } from "react";
|
|
19470
|
-
import { Badge as Badge29, Box as
|
|
19546
|
+
import { Badge as Badge29, Box as Box40, Group as Group63, Stack as Stack129, Text as Text103, Tooltip as Tooltip18 } from "@mantine/core";
|
|
19471
19547
|
import { IconCircleDashed as IconCircleDashed3, IconChecks } from "@tabler/icons-react";
|
|
19472
19548
|
|
|
19473
19549
|
// src/mantine/blocks/protocolSelector/flow/ProtocolSelectionPanel.tsx
|
|
19474
|
-
import React186, { useState as useState70, useEffect as useEffect54, useMemo as useMemo60, useCallback as
|
|
19475
|
-
import { Stack as Stack128, Text as Text102, Box as
|
|
19550
|
+
import React186, { useState as useState70, useEffect as useEffect54, useMemo as useMemo60, useCallback as useCallback55 } from "react";
|
|
19551
|
+
import { Stack as Stack128, Text as Text102, Box as Box39, Group as Group62, Loader as Loader25 } from "@mantine/core";
|
|
19476
19552
|
|
|
19477
19553
|
// src/icons/EntityAvatar.tsx
|
|
19478
19554
|
import React185 from "react";
|
|
@@ -19578,7 +19654,7 @@ var ProtocolSelectionPanel = ({ editor, block }) => {
|
|
|
19578
19654
|
}
|
|
19579
19655
|
});
|
|
19580
19656
|
}, [protocolDids, handlers]);
|
|
19581
|
-
const handleSelectProtocol =
|
|
19657
|
+
const handleSelectProtocol = useCallback55(
|
|
19582
19658
|
(protocol) => {
|
|
19583
19659
|
editor.updateBlock(block, {
|
|
19584
19660
|
props: {
|
|
@@ -19594,10 +19670,10 @@ var ProtocolSelectionPanel = ({ editor, block }) => {
|
|
|
19594
19670
|
[editor, block, closePanel]
|
|
19595
19671
|
);
|
|
19596
19672
|
const selectedDid = block.props.selectedProtocolDid;
|
|
19597
|
-
return /* @__PURE__ */ React186.createElement(BaseRightPanelLayout, { title: block.props.title || "Select Protocol", onClose: closePanel }, /* @__PURE__ */ React186.createElement(Stack128, { gap: "sm", style: { flex: 1, overflow: "auto" } }, protocols.length === 0 ? /* @__PURE__ */ React186.createElement(
|
|
19673
|
+
return /* @__PURE__ */ React186.createElement(BaseRightPanelLayout, { title: block.props.title || "Select Protocol", onClose: closePanel }, /* @__PURE__ */ React186.createElement(Stack128, { gap: "sm", style: { flex: 1, overflow: "auto" } }, protocols.length === 0 ? /* @__PURE__ */ React186.createElement(Box39, { py: "md" }, /* @__PURE__ */ React186.createElement(Text102, { c: "dimmed", ta: "center" }, "No protocols configured.", /* @__PURE__ */ React186.createElement("br", null), "Add protocol DIDs in template mode.")) : protocols.map((protocol) => {
|
|
19598
19674
|
const isSelected = protocol.did === selectedDid;
|
|
19599
19675
|
return /* @__PURE__ */ React186.createElement(
|
|
19600
|
-
|
|
19676
|
+
Box39,
|
|
19601
19677
|
{
|
|
19602
19678
|
key: protocol.did,
|
|
19603
19679
|
onClick: () => !protocol.loading && handleSelectProtocol(protocol),
|
|
@@ -19631,7 +19707,7 @@ var ProtocolSelectorFlowView = ({ editor, block, isDisabled }) => {
|
|
|
19631
19707
|
open();
|
|
19632
19708
|
};
|
|
19633
19709
|
const containerContent = /* @__PURE__ */ React187.createElement(BaseContainer, { onClick: disabled ? void 0 : handleClick }, /* @__PURE__ */ React187.createElement(Group63, { wrap: "nowrap", justify: "space-between", align: "center" }, /* @__PURE__ */ React187.createElement(Group63, { wrap: "nowrap", align: "center", gap: "md" }, /* @__PURE__ */ React187.createElement(
|
|
19634
|
-
|
|
19710
|
+
Box40,
|
|
19635
19711
|
{
|
|
19636
19712
|
style: {
|
|
19637
19713
|
display: "flex",
|
|
@@ -19643,7 +19719,7 @@ var ProtocolSelectorFlowView = ({ editor, block, isDisabled }) => {
|
|
|
19643
19719
|
/* @__PURE__ */ React187.createElement(IconCircleDashed3, { size: 26, color: "white" })
|
|
19644
19720
|
), /* @__PURE__ */ React187.createElement(Stack129, { gap: 2, style: { flex: 1 } }, /* @__PURE__ */ React187.createElement(Text103, { fw: 500, size: "sm", lineClamp: 1, style: { opacity: disabled ? 0.5 : 1 } }, block.props.title || "Select Protocol"), isCompleted && block.props.selectedProtocolType ? /* @__PURE__ */ React187.createElement(Badge29, { size: "sm", styles: { root: { backgroundColor: "var(--mantine-primary-color-light)", color: "var(--mantine-primary-color-filled)" } } }, block.props.selectedProtocolType) : /* @__PURE__ */ React187.createElement(Text103, { size: "xs", c: "dimmed", style: { opacity: disabled ? 0.5 : 1 } }, "Selection"))), /* @__PURE__ */ React187.createElement(Stack129, { gap: 2, align: "flex-end" }, isCompleted ? /* @__PURE__ */ React187.createElement(React187.Fragment, null, /* @__PURE__ */ React187.createElement(Group63, { gap: 4 }, /* @__PURE__ */ React187.createElement(IconChecks, { size: 16, color: "var(--mantine-color-green-4)" }), /* @__PURE__ */ React187.createElement(Text103, { size: "sm", c: "green.4", fw: 500 }, "Completed")), /* @__PURE__ */ React187.createElement(Text103, { size: "xs", c: "dimmed", lineClamp: 1 }, block.props.selectedProtocolName || block.props.selectedProtocolDid)) : /* @__PURE__ */ React187.createElement(React187.Fragment, null, /* @__PURE__ */ React187.createElement(Text103, { size: "sm" }, "Pending"), /* @__PURE__ */ React187.createElement(Text103, { size: "xs", c: "dimmed" }, "Complete now")))));
|
|
19645
19721
|
if (disabled && isDisabled?.message) {
|
|
19646
|
-
return /* @__PURE__ */ React187.createElement(Tooltip18, { label: isDisabled.message, position: "top", withArrow: true }, /* @__PURE__ */ React187.createElement(
|
|
19722
|
+
return /* @__PURE__ */ React187.createElement(Tooltip18, { label: isDisabled.message, position: "top", withArrow: true }, /* @__PURE__ */ React187.createElement(Box40, { style: { cursor: "not-allowed" } }, containerContent));
|
|
19647
19723
|
}
|
|
19648
19724
|
return containerContent;
|
|
19649
19725
|
};
|
|
@@ -19734,8 +19810,8 @@ import React192, { useMemo as useMemo62 } from "react";
|
|
|
19734
19810
|
import { Badge as Badge30, Group as Group64, Stack as Stack130, Text as Text105 } from "@mantine/core";
|
|
19735
19811
|
|
|
19736
19812
|
// src/mantine/blocks/form/template/TemplateConfig.tsx
|
|
19737
|
-
import React191, { useCallback as
|
|
19738
|
-
import { Paper as Paper16, CloseButton as CloseButton6, Title as
|
|
19813
|
+
import React191, { useCallback as useCallback56 } from "react";
|
|
19814
|
+
import { Paper as Paper16, CloseButton as CloseButton6, Title as Title10 } from "@mantine/core";
|
|
19739
19815
|
|
|
19740
19816
|
// src/mantine/blocks/form/template/GeneralTab.tsx
|
|
19741
19817
|
import React190, { useEffect as useEffect55, useState as useState71 } from "react";
|
|
@@ -19819,7 +19895,7 @@ var GeneralTab12 = ({ title, description, icon, surveySchema, onTitleChange, onD
|
|
|
19819
19895
|
// src/mantine/blocks/form/template/TemplateConfig.tsx
|
|
19820
19896
|
var TemplateConfig12 = ({ editor, block }) => {
|
|
19821
19897
|
const { closePanel } = usePanelStore();
|
|
19822
|
-
const updateProp =
|
|
19898
|
+
const updateProp = useCallback56(
|
|
19823
19899
|
(key, value) => {
|
|
19824
19900
|
editor.updateBlock(block, {
|
|
19825
19901
|
props: {
|
|
@@ -19851,7 +19927,7 @@ var TemplateConfig12 = ({ editor, block }) => {
|
|
|
19851
19927
|
marginBottom: "1rem"
|
|
19852
19928
|
}
|
|
19853
19929
|
},
|
|
19854
|
-
/* @__PURE__ */ React191.createElement(
|
|
19930
|
+
/* @__PURE__ */ React191.createElement(Title10, { order: 3 }, "Form Settings"),
|
|
19855
19931
|
/* @__PURE__ */ React191.createElement(CloseButton6, { onClick: closePanel })
|
|
19856
19932
|
),
|
|
19857
19933
|
/* @__PURE__ */ React191.createElement(
|
|
@@ -19893,12 +19969,12 @@ var FormTemplateView = ({ editor, block }) => {
|
|
|
19893
19969
|
};
|
|
19894
19970
|
|
|
19895
19971
|
// src/mantine/blocks/form/flow/FlowView.tsx
|
|
19896
|
-
import React194, { useMemo as useMemo64, useState as useState72, useCallback as
|
|
19972
|
+
import React194, { useMemo as useMemo64, useState as useState72, useCallback as useCallback58 } from "react";
|
|
19897
19973
|
import { ActionIcon as ActionIcon31, Badge as Badge31, Group as Group65, Stack as Stack131, Text as Text107, Tooltip as Tooltip19 } from "@mantine/core";
|
|
19898
19974
|
import { IconChevronRight as IconChevronRight7 } from "@tabler/icons-react";
|
|
19899
19975
|
|
|
19900
19976
|
// src/mantine/blocks/form/flow/FormPanel.tsx
|
|
19901
|
-
import React193, { useCallback as
|
|
19977
|
+
import React193, { useCallback as useCallback57, useEffect as useEffect56, useMemo as useMemo63, useRef as useRef16 } from "react";
|
|
19902
19978
|
import { Alert as Alert26, Text as Text106 } from "@mantine/core";
|
|
19903
19979
|
import { useDebouncedCallback as useDebouncedCallback2 } from "@mantine/hooks";
|
|
19904
19980
|
import { IconAlertCircle as IconAlertCircle10 } from "@tabler/icons-react";
|
|
@@ -19923,8 +19999,8 @@ function deepEqual2(a, b) {
|
|
|
19923
19999
|
}
|
|
19924
20000
|
var FormPanel = ({ editor, block, onComplete }) => {
|
|
19925
20001
|
const { closePanel } = usePanelStore();
|
|
19926
|
-
const isUpdatingFromProp =
|
|
19927
|
-
const lastSyncedAnswers =
|
|
20002
|
+
const isUpdatingFromProp = useRef16(false);
|
|
20003
|
+
const lastSyncedAnswers = useRef16("");
|
|
19928
20004
|
const surveySchema = useMemo63(() => {
|
|
19929
20005
|
if (!block.props.surveySchema) return null;
|
|
19930
20006
|
try {
|
|
@@ -19942,7 +20018,7 @@ var FormPanel = ({ editor, block, onComplete }) => {
|
|
|
19942
20018
|
model.completeText = "Complete";
|
|
19943
20019
|
return model;
|
|
19944
20020
|
}, [surveySchema]);
|
|
19945
|
-
const syncPropToSurvey =
|
|
20021
|
+
const syncPropToSurvey = useCallback57(
|
|
19946
20022
|
(answersJson) => {
|
|
19947
20023
|
if (!surveyModel || !answersJson || answersJson === lastSyncedAnswers.current) return;
|
|
19948
20024
|
try {
|
|
@@ -19991,7 +20067,7 @@ var FormPanel = ({ editor, block, onComplete }) => {
|
|
|
19991
20067
|
surveyModel.onValueChanged.remove(handleValueChanged);
|
|
19992
20068
|
};
|
|
19993
20069
|
}, [surveyModel, syncSurveyToProp]);
|
|
19994
|
-
const handleSurveyComplete =
|
|
20070
|
+
const handleSurveyComplete = useCallback57(
|
|
19995
20071
|
(sender) => {
|
|
19996
20072
|
const data = sender.data || {};
|
|
19997
20073
|
const finalAnswersJson = JSON.stringify(data);
|
|
@@ -20015,7 +20091,7 @@ var FormPanel = ({ editor, block, onComplete }) => {
|
|
|
20015
20091
|
surveyModel.onComplete.remove(handleSurveyComplete);
|
|
20016
20092
|
};
|
|
20017
20093
|
}, [handleSurveyComplete, surveyModel]);
|
|
20018
|
-
const handleClose =
|
|
20094
|
+
const handleClose = useCallback57(() => {
|
|
20019
20095
|
closePanel();
|
|
20020
20096
|
}, [closePanel]);
|
|
20021
20097
|
if (!surveySchema) {
|
|
@@ -20038,7 +20114,7 @@ var FormFlowView = ({ editor, block }) => {
|
|
|
20038
20114
|
const [hasOpened, setHasOpened] = useState72(false);
|
|
20039
20115
|
const status = block.props.status || "pending";
|
|
20040
20116
|
const isCompleted = status === "completed";
|
|
20041
|
-
const handleComplete =
|
|
20117
|
+
const handleComplete = useCallback58(() => {
|
|
20042
20118
|
editor.updateBlock(block, {
|
|
20043
20119
|
props: {
|
|
20044
20120
|
...block.props,
|
|
@@ -20133,7 +20209,7 @@ import React199, { useMemo as useMemo65 } from "react";
|
|
|
20133
20209
|
import { Badge as Badge32, Group as Group66, Stack as Stack132, Text as Text108 } from "@mantine/core";
|
|
20134
20210
|
|
|
20135
20211
|
// src/mantine/blocks/domainCreatorSign/template/TemplateConfig.tsx
|
|
20136
|
-
import React198, { useCallback as
|
|
20212
|
+
import React198, { useCallback as useCallback59 } from "react";
|
|
20137
20213
|
|
|
20138
20214
|
// src/mantine/blocks/domainCreatorSign/template/GeneralTab.tsx
|
|
20139
20215
|
import React197, { useEffect as useEffect57, useState as useState73 } from "react";
|
|
@@ -20188,7 +20264,7 @@ var GeneralTab13 = ({ title, description, icon, onTitleChange, onDescriptionChan
|
|
|
20188
20264
|
// src/mantine/blocks/domainCreatorSign/template/TemplateConfig.tsx
|
|
20189
20265
|
var TemplateConfig13 = ({ editor, block }) => {
|
|
20190
20266
|
const { closePanel } = usePanelStore();
|
|
20191
|
-
const updateProp =
|
|
20267
|
+
const updateProp = useCallback59(
|
|
20192
20268
|
(key, value) => {
|
|
20193
20269
|
editor.updateBlock(block, {
|
|
20194
20270
|
props: {
|
|
@@ -20247,14 +20323,14 @@ var DomainCreatorSignTemplateView = ({ editor, block }) => {
|
|
|
20247
20323
|
};
|
|
20248
20324
|
|
|
20249
20325
|
// src/mantine/blocks/domainCreatorSign/flow/FlowView.tsx
|
|
20250
|
-
import React202, { useCallback as
|
|
20326
|
+
import React202, { useCallback as useCallback61, useMemo as useMemo66, useEffect as useEffect58 } from "react";
|
|
20251
20327
|
import { ActionIcon as ActionIcon32, Badge as Badge34, Group as Group69, Stack as Stack135, Text as Text111, Tooltip as Tooltip21 } from "@mantine/core";
|
|
20252
20328
|
import { IconChevronRight as IconChevronRight8 } from "@tabler/icons-react";
|
|
20253
20329
|
|
|
20254
20330
|
// src/mantine/blocks/domainCreatorSign/flow/SignPanel.tsx
|
|
20255
20331
|
import { Alert as Alert27, Button as Button34, Group as Group68, Loader as Loader26, Stack as Stack134, Text as Text110 } from "@mantine/core";
|
|
20256
20332
|
import { IconAlertCircle as IconAlertCircle11, IconCheck as IconCheck9 } from "@tabler/icons-react";
|
|
20257
|
-
import React201, { useCallback as
|
|
20333
|
+
import React201, { useCallback as useCallback60, useState as useState75 } from "react";
|
|
20258
20334
|
|
|
20259
20335
|
// src/mantine/blocks/domainCreatorSign/utils/buildLinkedEntityResource.ts
|
|
20260
20336
|
function parseLinkedEntities2(entitiesString) {
|
|
@@ -20275,7 +20351,7 @@ function buildGovernanceGroupLinkedEntities(linkedEntities) {
|
|
|
20275
20351
|
}
|
|
20276
20352
|
|
|
20277
20353
|
// src/mantine/components/Base/BaseSigning.tsx
|
|
20278
|
-
import { Badge as Badge33, Box as
|
|
20354
|
+
import { Badge as Badge33, Box as Box41, Flex as Flex30, Group as Group67, Slider, Stack as Stack133, Tabs as Tabs4, Text as Text109, Tooltip as Tooltip20 } from "@mantine/core";
|
|
20279
20355
|
import { IconClock as IconClock2, IconFeather as IconFeather2, IconUsers as IconUsers3, IconArrowsExchange as IconArrowsExchange2, IconCalendar as IconCalendar2, IconLeaf as IconLeaf2, IconBolt } from "@tabler/icons-react";
|
|
20280
20356
|
import React200, { useState as useState74 } from "react";
|
|
20281
20357
|
function BaseSigning({ handleSign }) {
|
|
@@ -20310,7 +20386,7 @@ function BaseSigning({ handleSign }) {
|
|
|
20310
20386
|
c: "var(--mantine-color-accent-2)",
|
|
20311
20387
|
fw: 400,
|
|
20312
20388
|
tt: "capitalize",
|
|
20313
|
-
leftSection: /* @__PURE__ */ React200.createElement(
|
|
20389
|
+
leftSection: /* @__PURE__ */ React200.createElement(Box41, { style: { display: "inline-flex", alignItems: "center", lineHeight: 1 } }, /* @__PURE__ */ React200.createElement(IconClock2, { size: 14 })),
|
|
20314
20390
|
styles: {
|
|
20315
20391
|
root: {
|
|
20316
20392
|
display: "inline-flex",
|
|
@@ -20320,7 +20396,7 @@ function BaseSigning({ handleSign }) {
|
|
|
20320
20396
|
},
|
|
20321
20397
|
"12h 5min"
|
|
20322
20398
|
)),
|
|
20323
|
-
/* @__PURE__ */ React200.createElement(
|
|
20399
|
+
/* @__PURE__ */ React200.createElement(Box41, { mb: "sm", bg: "neutralColor.5", p: 8, style: { borderRadius: 8 } }, /* @__PURE__ */ React200.createElement(
|
|
20324
20400
|
Tabs4,
|
|
20325
20401
|
{
|
|
20326
20402
|
value: activeTab,
|
|
@@ -20355,7 +20431,7 @@ function BaseSigning({ handleSign }) {
|
|
|
20355
20431
|
/* @__PURE__ */ React200.createElement(Tabs4.Panel, { value: "charge" }, /* @__PURE__ */ React200.createElement(Text109, { c: "white", size: "sm" }, "Charge content")),
|
|
20356
20432
|
/* @__PURE__ */ React200.createElement(Tabs4.Panel, { value: "impact" }, /* @__PURE__ */ React200.createElement(Text109, { c: "white", size: "sm" }, "Impact content"))
|
|
20357
20433
|
)),
|
|
20358
|
-
isSigned ? /* @__PURE__ */ React200.createElement(
|
|
20434
|
+
isSigned ? /* @__PURE__ */ React200.createElement(Box41, { bg: "dark.6", p: "sm", style: { borderRadius: "var(--mantine-radius-md)" } }, /* @__PURE__ */ React200.createElement(Group67, { justify: "center" }, /* @__PURE__ */ React200.createElement(Text109, { size: "sm", c: "dimmed" }, "Transaction signed successfully"))) : /* @__PURE__ */ React200.createElement(
|
|
20359
20435
|
Slider,
|
|
20360
20436
|
{
|
|
20361
20437
|
value,
|
|
@@ -20398,19 +20474,19 @@ var SignPanel = ({ editor, block, onComplete, onError }) => {
|
|
|
20398
20474
|
const [flowStep, setFlowStep] = useState75(block.props.status === "completed" ? "success" : block.props.status === "error" ? "error" : "ready");
|
|
20399
20475
|
const [error, setError] = useState75(block.props.errorMessage || null);
|
|
20400
20476
|
const [createdEntityDid, setCreatedEntityDid] = useState75(block.props.entityDid || null);
|
|
20401
|
-
const getDomainCardData =
|
|
20477
|
+
const getDomainCardData = useCallback60(() => {
|
|
20402
20478
|
try {
|
|
20403
20479
|
return JSON.parse(block.props.domainCardData || "{}");
|
|
20404
20480
|
} catch {
|
|
20405
20481
|
return null;
|
|
20406
20482
|
}
|
|
20407
20483
|
}, [block.props.domainCardData]);
|
|
20408
|
-
const getDate100YearsFromNow =
|
|
20484
|
+
const getDate100YearsFromNow = useCallback60(() => {
|
|
20409
20485
|
const date = /* @__PURE__ */ new Date();
|
|
20410
20486
|
date.setFullYear(date.getFullYear() + 100);
|
|
20411
20487
|
return date.toISOString();
|
|
20412
20488
|
}, []);
|
|
20413
|
-
const processSignAndCreate =
|
|
20489
|
+
const processSignAndCreate = useCallback60(async () => {
|
|
20414
20490
|
if (!handlers) {
|
|
20415
20491
|
throw new Error("Handlers not available");
|
|
20416
20492
|
}
|
|
@@ -20498,7 +20574,7 @@ var SignPanel = ({ editor, block, onComplete, onError }) => {
|
|
|
20498
20574
|
transactionHash
|
|
20499
20575
|
};
|
|
20500
20576
|
}, [handlers, getDomainCardData, block, editor, getDate100YearsFromNow]);
|
|
20501
|
-
const handleSign =
|
|
20577
|
+
const handleSign = useCallback60(async () => {
|
|
20502
20578
|
try {
|
|
20503
20579
|
const result = await processSignAndCreate();
|
|
20504
20580
|
setCreatedEntityDid(result.entityDid);
|
|
@@ -20512,7 +20588,7 @@ var SignPanel = ({ editor, block, onComplete, onError }) => {
|
|
|
20512
20588
|
onError?.(errorMessage);
|
|
20513
20589
|
}
|
|
20514
20590
|
}, [processSignAndCreate, onComplete, onError]);
|
|
20515
|
-
const handleRetry =
|
|
20591
|
+
const handleRetry = useCallback60(() => {
|
|
20516
20592
|
setFlowStep("ready");
|
|
20517
20593
|
setError(null);
|
|
20518
20594
|
editor.updateBlock(block, {
|
|
@@ -20523,10 +20599,10 @@ var SignPanel = ({ editor, block, onComplete, onError }) => {
|
|
|
20523
20599
|
}
|
|
20524
20600
|
});
|
|
20525
20601
|
}, [editor, block]);
|
|
20526
|
-
const handleClose =
|
|
20602
|
+
const handleClose = useCallback60(() => {
|
|
20527
20603
|
closePanel();
|
|
20528
20604
|
}, [closePanel]);
|
|
20529
|
-
const handleVisitEntity =
|
|
20605
|
+
const handleVisitEntity = useCallback60(() => {
|
|
20530
20606
|
const entityType = block.props.entityType || "dao";
|
|
20531
20607
|
if (createdEntityDid && handlers?.redirectToEntityOverview) {
|
|
20532
20608
|
handlers.redirectToEntityOverview(createdEntityDid, entityType);
|
|
@@ -20584,7 +20660,7 @@ var DomainCreatorSignFlowView = ({ editor, block }) => {
|
|
|
20584
20660
|
});
|
|
20585
20661
|
}
|
|
20586
20662
|
}, [isDataReady, status, editor, block]);
|
|
20587
|
-
const handleComplete =
|
|
20663
|
+
const handleComplete = useCallback61(
|
|
20588
20664
|
(result) => {
|
|
20589
20665
|
editor.updateBlock(block, {
|
|
20590
20666
|
props: {
|
|
@@ -20597,7 +20673,7 @@ var DomainCreatorSignFlowView = ({ editor, block }) => {
|
|
|
20597
20673
|
},
|
|
20598
20674
|
[editor, block]
|
|
20599
20675
|
);
|
|
20600
|
-
const handleError =
|
|
20676
|
+
const handleError = useCallback61(
|
|
20601
20677
|
(errorMessage) => {
|
|
20602
20678
|
editor.updateBlock(block, {
|
|
20603
20679
|
props: {
|
|
@@ -20722,8 +20798,8 @@ import React207, { useMemo as useMemo67 } from "react";
|
|
|
20722
20798
|
import { Badge as Badge35, Group as Group70, Stack as Stack136, Text as Text112 } from "@mantine/core";
|
|
20723
20799
|
|
|
20724
20800
|
// src/mantine/blocks/domainCardViewer/template/TemplateConfig.tsx
|
|
20725
|
-
import React206, { useCallback as
|
|
20726
|
-
import { Paper as Paper17, CloseButton as CloseButton7, Title as
|
|
20801
|
+
import React206, { useCallback as useCallback62 } from "react";
|
|
20802
|
+
import { Paper as Paper17, CloseButton as CloseButton7, Title as Title11 } from "@mantine/core";
|
|
20727
20803
|
|
|
20728
20804
|
// src/mantine/blocks/domainCardViewer/template/GeneralTab.tsx
|
|
20729
20805
|
import React205, { useEffect as useEffect59, useState as useState76 } from "react";
|
|
@@ -20778,7 +20854,7 @@ var GeneralTab14 = ({ title, description, icon, onTitleChange, onDescriptionChan
|
|
|
20778
20854
|
// src/mantine/blocks/domainCardViewer/template/TemplateConfig.tsx
|
|
20779
20855
|
var TemplateConfig14 = ({ editor, block }) => {
|
|
20780
20856
|
const { closePanel } = usePanelStore();
|
|
20781
|
-
const updateProp =
|
|
20857
|
+
const updateProp = useCallback62(
|
|
20782
20858
|
(key, value) => {
|
|
20783
20859
|
editor.updateBlock(block, {
|
|
20784
20860
|
props: {
|
|
@@ -20810,7 +20886,7 @@ var TemplateConfig14 = ({ editor, block }) => {
|
|
|
20810
20886
|
marginBottom: "1rem"
|
|
20811
20887
|
}
|
|
20812
20888
|
},
|
|
20813
|
-
/* @__PURE__ */ React206.createElement(
|
|
20889
|
+
/* @__PURE__ */ React206.createElement(Title11, { order: 5 }, "Domain Card Settings"),
|
|
20814
20890
|
/* @__PURE__ */ React206.createElement(CloseButton7, { onClick: closePanel })
|
|
20815
20891
|
),
|
|
20816
20892
|
/* @__PURE__ */ React206.createElement(
|
|
@@ -20849,13 +20925,13 @@ var DomainCardViewerTemplateView = ({ editor, block }) => {
|
|
|
20849
20925
|
};
|
|
20850
20926
|
|
|
20851
20927
|
// src/mantine/blocks/domainCardViewer/flow/FlowView.tsx
|
|
20852
|
-
import React209, { useMemo as useMemo69, useCallback as
|
|
20928
|
+
import React209, { useMemo as useMemo69, useCallback as useCallback63, useEffect as useEffect60 } from "react";
|
|
20853
20929
|
import { ActionIcon as ActionIcon33, Badge as Badge36, Button as Button36, Group as Group71, Stack as Stack138, Text as Text114, Tooltip as Tooltip22 } from "@mantine/core";
|
|
20854
20930
|
import { IconChevronRight as IconChevronRight9, IconLoader, IconTestPipe, IconTrash as IconTrash6 } from "@tabler/icons-react";
|
|
20855
20931
|
|
|
20856
20932
|
// src/mantine/blocks/domainCardViewer/flow/ViewerPanel.tsx
|
|
20857
20933
|
import React208, { useMemo as useMemo68 } from "react";
|
|
20858
|
-
import { Paper as Paper18, CloseButton as CloseButton8, Title as
|
|
20934
|
+
import { Paper as Paper18, CloseButton as CloseButton8, Title as Title12, Stack as Stack137, Text as Text113, Loader as Loader27, Alert as Alert28, Button as Button35, Box as Box42, ScrollArea as ScrollArea7, Code as Code6 } from "@mantine/core";
|
|
20859
20935
|
import { IconAlertCircle as IconAlertCircle12, IconCheck as IconCheck10, IconSparkles as IconSparkles3 } from "@tabler/icons-react";
|
|
20860
20936
|
function parsePreviewData(jsonString) {
|
|
20861
20937
|
if (!jsonString || jsonString === "{}") return null;
|
|
@@ -20866,7 +20942,7 @@ function parsePreviewData(jsonString) {
|
|
|
20866
20942
|
}
|
|
20867
20943
|
}
|
|
20868
20944
|
var JsonViewer = ({ data }) => {
|
|
20869
|
-
return /* @__PURE__ */ React208.createElement(ScrollArea7, { h: "100%", offsetScrollbars: true }, /* @__PURE__ */ React208.createElement(Stack137, { gap: "md" }, data.name && /* @__PURE__ */ React208.createElement(
|
|
20945
|
+
return /* @__PURE__ */ React208.createElement(ScrollArea7, { h: "100%", offsetScrollbars: true }, /* @__PURE__ */ React208.createElement(Stack137, { gap: "md" }, data.name && /* @__PURE__ */ React208.createElement(Box42, null, /* @__PURE__ */ React208.createElement(Text113, { size: "xs", c: "dimmed", tt: "uppercase", fw: 600 }, "Name"), /* @__PURE__ */ React208.createElement(Text113, { size: "lg", fw: 600 }, data.name)), data.summary && /* @__PURE__ */ React208.createElement(Box42, null, /* @__PURE__ */ React208.createElement(Text113, { size: "xs", c: "dimmed", tt: "uppercase", fw: 600 }, "Summary"), /* @__PURE__ */ React208.createElement(Text113, { size: "sm" }, data.summary)), data.description && /* @__PURE__ */ React208.createElement(Box42, null, /* @__PURE__ */ React208.createElement(Text113, { size: "xs", c: "dimmed", tt: "uppercase", fw: 600 }, "Description"), /* @__PURE__ */ React208.createElement(Text113, { size: "sm" }, data.description)), data.entity_type && data.entity_type.length > 0 && /* @__PURE__ */ React208.createElement(Box42, null, /* @__PURE__ */ React208.createElement(Text113, { size: "xs", c: "dimmed", tt: "uppercase", fw: 600 }, "Type"), /* @__PURE__ */ React208.createElement(Text113, { size: "sm" }, data.entity_type.join(", "))), data.keywords && data.keywords.length > 0 && /* @__PURE__ */ React208.createElement(Box42, null, /* @__PURE__ */ React208.createElement(Text113, { size: "xs", c: "dimmed", tt: "uppercase", fw: 600 }, "Keywords"), /* @__PURE__ */ React208.createElement(Text113, { size: "sm" }, data.keywords.join(", "))), data.faq && data.faq.length > 0 && /* @__PURE__ */ React208.createElement(Box42, null, /* @__PURE__ */ React208.createElement(Text113, { size: "xs", c: "dimmed", tt: "uppercase", fw: 600, mb: "xs" }, "FAQ"), /* @__PURE__ */ React208.createElement(Stack137, { gap: "sm" }, data.faq.map((item, index) => /* @__PURE__ */ React208.createElement(Box42, { key: index, p: "sm", style: { borderRadius: 8, backgroundColor: "var(--mantine-color-dark-6)" } }, /* @__PURE__ */ React208.createElement(Text113, { size: "sm", fw: 500, mb: 4 }, item.question), /* @__PURE__ */ React208.createElement(Text113, { size: "xs", c: "dimmed" }, item.answer))))), /* @__PURE__ */ React208.createElement(Box42, null, /* @__PURE__ */ React208.createElement(Text113, { size: "xs", c: "dimmed", tt: "uppercase", fw: 600, mb: "xs" }, "Raw Data"), /* @__PURE__ */ React208.createElement(Code6, { block: true, style: { fontSize: 11, maxHeight: 200, overflow: "auto" } }, JSON.stringify(data, null, 2)))));
|
|
20870
20946
|
};
|
|
20871
20947
|
var ViewerPanel = ({ block, onApprove }) => {
|
|
20872
20948
|
const { closePanel } = usePanelStore();
|
|
@@ -20902,10 +20978,10 @@ var ViewerPanel = ({ block, onApprove }) => {
|
|
|
20902
20978
|
flexShrink: 0
|
|
20903
20979
|
}
|
|
20904
20980
|
},
|
|
20905
|
-
/* @__PURE__ */ React208.createElement(
|
|
20981
|
+
/* @__PURE__ */ React208.createElement(Title12, { order: 5 }, block.props.title || "Domain Card"),
|
|
20906
20982
|
/* @__PURE__ */ React208.createElement(CloseButton8, { onClick: closePanel })
|
|
20907
20983
|
),
|
|
20908
|
-
/* @__PURE__ */ React208.createElement(
|
|
20984
|
+
/* @__PURE__ */ React208.createElement(Box42, { style: { flex: 1, overflow: "hidden", display: "flex", flexDirection: "column" } }, isLoading && /* @__PURE__ */ React208.createElement(Stack137, { align: "center", justify: "center", style: { flex: 1 }, gap: "md" }, /* @__PURE__ */ React208.createElement(Loader27, { size: "lg", color: "blue" }), /* @__PURE__ */ React208.createElement(Stack137, { align: "center", gap: "xs" }, /* @__PURE__ */ React208.createElement(IconSparkles3, { size: 24, color: "var(--mantine-color-blue-5)" }), /* @__PURE__ */ React208.createElement(Text113, { size: "sm", c: "dimmed", ta: "center" }, loadingMessage))), isError && /* @__PURE__ */ React208.createElement(Stack137, { style: { flex: 1 }, gap: "md" }, /* @__PURE__ */ React208.createElement(Alert28, { icon: /* @__PURE__ */ React208.createElement(IconAlertCircle12, { size: 16 }), title: "Error", color: "red", variant: "light" }, errorMessage), /* @__PURE__ */ React208.createElement(Text113, { size: "sm", c: "dimmed", ta: "center" }, "Please ask the oracle to try again.")), (isReady || isApproved) && hasData && /* @__PURE__ */ React208.createElement(Box42, { style: { flex: 1, overflow: "hidden" } }, domainCardRenderer ? (
|
|
20909
20985
|
// Use custom renderer from web app
|
|
20910
20986
|
/* @__PURE__ */ React208.createElement(ScrollArea7, { h: "100%", offsetScrollbars: true }, domainCardRenderer(domainPreviewData))
|
|
20911
20987
|
) : (
|
|
@@ -20913,7 +20989,7 @@ var ViewerPanel = ({ block, onApprove }) => {
|
|
|
20913
20989
|
/* @__PURE__ */ React208.createElement(JsonViewer, { data: domainPreviewData })
|
|
20914
20990
|
)), !isLoading && !isError && !hasData && /* @__PURE__ */ React208.createElement(Stack137, { align: "center", justify: "center", style: { flex: 1 }, gap: "md" }, /* @__PURE__ */ React208.createElement(Text113, { size: "sm", c: "dimmed", ta: "center" }, "No domain data available yet."))),
|
|
20915
20991
|
isReady && hasData && /* @__PURE__ */ React208.createElement(
|
|
20916
|
-
|
|
20992
|
+
Box42,
|
|
20917
20993
|
{
|
|
20918
20994
|
pt: "md",
|
|
20919
20995
|
mt: "md",
|
|
@@ -20927,7 +21003,7 @@ var ViewerPanel = ({ block, onApprove }) => {
|
|
|
20927
21003
|
/* @__PURE__ */ React208.createElement(Button35, { fullWidth: true, color: "teal", leftSection: /* @__PURE__ */ React208.createElement(IconCheck10, { size: 16 }), onClick: onApprove }, "Approve")
|
|
20928
21004
|
),
|
|
20929
21005
|
isApproved && /* @__PURE__ */ React208.createElement(
|
|
20930
|
-
|
|
21006
|
+
Box42,
|
|
20931
21007
|
{
|
|
20932
21008
|
pt: "md",
|
|
20933
21009
|
mt: "md",
|
|
@@ -21174,7 +21250,7 @@ var DomainCardViewerFlowView = ({ editor, block }) => {
|
|
|
21174
21250
|
});
|
|
21175
21251
|
}
|
|
21176
21252
|
}, [isDataReady, status, editor, block]);
|
|
21177
|
-
const handleApprove =
|
|
21253
|
+
const handleApprove = useCallback63(() => {
|
|
21178
21254
|
editor.updateBlock(block, {
|
|
21179
21255
|
props: {
|
|
21180
21256
|
...block.props,
|
|
@@ -21185,7 +21261,7 @@ var DomainCardViewerFlowView = ({ editor, block }) => {
|
|
|
21185
21261
|
const panelId = `${DOMAIN_CARD_VIEWER_FLOW_PANEL_ID}-${block.id}`;
|
|
21186
21262
|
const panelContent = useMemo69(() => /* @__PURE__ */ React209.createElement(ViewerPanel, { editor, block, onApprove: handleApprove }), [editor, block, handleApprove]);
|
|
21187
21263
|
const { open } = usePanel(panelId, panelContent);
|
|
21188
|
-
const handleInjectDummyData =
|
|
21264
|
+
const handleInjectDummyData = useCallback63(
|
|
21189
21265
|
(e) => {
|
|
21190
21266
|
e.stopPropagation();
|
|
21191
21267
|
editor.updateBlock(block, {
|
|
@@ -21201,7 +21277,7 @@ var DomainCardViewerFlowView = ({ editor, block }) => {
|
|
|
21201
21277
|
},
|
|
21202
21278
|
[editor, block]
|
|
21203
21279
|
);
|
|
21204
|
-
const handleSetLoading =
|
|
21280
|
+
const handleSetLoading = useCallback63(
|
|
21205
21281
|
(e) => {
|
|
21206
21282
|
e.stopPropagation();
|
|
21207
21283
|
editor.updateBlock(block, {
|
|
@@ -21214,7 +21290,7 @@ var DomainCardViewerFlowView = ({ editor, block }) => {
|
|
|
21214
21290
|
},
|
|
21215
21291
|
[editor, block]
|
|
21216
21292
|
);
|
|
21217
|
-
const handleClearData =
|
|
21293
|
+
const handleClearData = useCallback63(
|
|
21218
21294
|
(e) => {
|
|
21219
21295
|
e.stopPropagation();
|
|
21220
21296
|
editor.updateBlock(block, {
|
|
@@ -21317,7 +21393,7 @@ import React214, { useMemo as useMemo70 } from "react";
|
|
|
21317
21393
|
import { Badge as Badge37, Group as Group72, Stack as Stack140, Text as Text116 } from "@mantine/core";
|
|
21318
21394
|
|
|
21319
21395
|
// src/mantine/blocks/governanceGroup/template/TemplateConfig.tsx
|
|
21320
|
-
import React213, { useCallback as
|
|
21396
|
+
import React213, { useCallback as useCallback64 } from "react";
|
|
21321
21397
|
|
|
21322
21398
|
// src/mantine/blocks/governanceGroup/template/GeneralTab.tsx
|
|
21323
21399
|
import React212, { useEffect as useEffect61, useState as useState77 } from "react";
|
|
@@ -22153,7 +22229,7 @@ var getSurveyForGroupType = (groupType) => {
|
|
|
22153
22229
|
// src/mantine/blocks/governanceGroup/template/TemplateConfig.tsx
|
|
22154
22230
|
var TemplateConfig15 = ({ editor, block }) => {
|
|
22155
22231
|
const { closePanel } = usePanelStore();
|
|
22156
|
-
const updateProp =
|
|
22232
|
+
const updateProp = useCallback64(
|
|
22157
22233
|
(key, value) => {
|
|
22158
22234
|
editor.updateBlock(block, {
|
|
22159
22235
|
props: {
|
|
@@ -22164,7 +22240,7 @@ var TemplateConfig15 = ({ editor, block }) => {
|
|
|
22164
22240
|
},
|
|
22165
22241
|
[editor, block]
|
|
22166
22242
|
);
|
|
22167
|
-
const handleGroupTypeChange =
|
|
22243
|
+
const handleGroupTypeChange = useCallback64(
|
|
22168
22244
|
(groupType) => {
|
|
22169
22245
|
const surveySchema = getSurveyForGroupType(groupType);
|
|
22170
22246
|
editor.updateBlock(block, {
|
|
@@ -22234,12 +22310,12 @@ var GovernanceGroupTemplateView = ({ editor, block }) => {
|
|
|
22234
22310
|
};
|
|
22235
22311
|
|
|
22236
22312
|
// src/mantine/blocks/governanceGroup/flow/FlowView.tsx
|
|
22237
|
-
import React216, { useCallback as
|
|
22313
|
+
import React216, { useCallback as useCallback66, useEffect as useEffect63, useMemo as useMemo72, useRef as useRef18, useState as useState79 } from "react";
|
|
22238
22314
|
import { ActionIcon as ActionIcon34, Badge as Badge38, Group as Group74, Stack as Stack142, Text as Text118, Tooltip as Tooltip23 } from "@mantine/core";
|
|
22239
22315
|
import { IconChevronRight as IconChevronRight10 } from "@tabler/icons-react";
|
|
22240
22316
|
|
|
22241
22317
|
// src/mantine/blocks/governanceGroup/flow/GovernanceGroupPanel.tsx
|
|
22242
|
-
import React215, { useCallback as
|
|
22318
|
+
import React215, { useCallback as useCallback65, useEffect as useEffect62, useMemo as useMemo71, useRef as useRef17, useState as useState78 } from "react";
|
|
22243
22319
|
import { Alert as Alert29, Button as Button37, Card as Card20, Group as Group73, Loader as Loader28, SimpleGrid as SimpleGrid3, Stack as Stack141, Text as Text117, ThemeIcon as ThemeIcon4 } from "@mantine/core";
|
|
22244
22320
|
import { useDebouncedCallback as useDebouncedCallback3 } from "@mantine/hooks";
|
|
22245
22321
|
import { IconAlertCircle as IconAlertCircle13, IconCheck as IconCheck11, IconUsers as IconUsers5, IconSignature as IconSignature2, IconPhoto as IconPhoto3, IconCoin as IconCoin2, IconArrowLeft as IconArrowLeft5 } from "@tabler/icons-react";
|
|
@@ -22284,8 +22360,8 @@ var GovernanceGroupPanel = ({ editor, block, onComplete }) => {
|
|
|
22284
22360
|
const [error, setError] = useState78(null);
|
|
22285
22361
|
const [createdCoreAddress, setCreatedCoreAddress] = useState78(existingCoreAddress || null);
|
|
22286
22362
|
const [createdGroupAddress, setCreatedGroupAddress] = useState78(block.props.groupAddress || null);
|
|
22287
|
-
const isUpdatingFromProp =
|
|
22288
|
-
const lastSyncedAnswers =
|
|
22363
|
+
const isUpdatingFromProp = useRef17(false);
|
|
22364
|
+
const lastSyncedAnswers = useRef17("");
|
|
22289
22365
|
const surveyModel = useMemo71(() => {
|
|
22290
22366
|
if (!selectedGroupType) return null;
|
|
22291
22367
|
const surveySchema = getSurveyForGroupType(selectedGroupType);
|
|
@@ -22296,7 +22372,7 @@ var GovernanceGroupPanel = ({ editor, block, onComplete }) => {
|
|
|
22296
22372
|
model.questionsOnPageMode = "singlePage";
|
|
22297
22373
|
return model;
|
|
22298
22374
|
}, [selectedGroupType]);
|
|
22299
|
-
const syncPropToSurvey =
|
|
22375
|
+
const syncPropToSurvey = useCallback65(
|
|
22300
22376
|
(answersJson) => {
|
|
22301
22377
|
if (!answersJson || answersJson === lastSyncedAnswers.current || !surveyModel) return;
|
|
22302
22378
|
try {
|
|
@@ -22359,7 +22435,7 @@ var GovernanceGroupPanel = ({ editor, block, onComplete }) => {
|
|
|
22359
22435
|
lastSyncedAnswers.current = "";
|
|
22360
22436
|
setFlowStep("survey");
|
|
22361
22437
|
};
|
|
22362
|
-
const processGroupCreation =
|
|
22438
|
+
const processGroupCreation = useCallback65(
|
|
22363
22439
|
async (data) => {
|
|
22364
22440
|
if (!handlers) {
|
|
22365
22441
|
throw new Error("Handlers not available");
|
|
@@ -22381,7 +22457,7 @@ var GovernanceGroupPanel = ({ editor, block, onComplete }) => {
|
|
|
22381
22457
|
},
|
|
22382
22458
|
[handlers, selectedGroupType]
|
|
22383
22459
|
);
|
|
22384
|
-
const handleSurveyComplete =
|
|
22460
|
+
const handleSurveyComplete = useCallback65(
|
|
22385
22461
|
async (sender) => {
|
|
22386
22462
|
const data = sender.data || {};
|
|
22387
22463
|
try {
|
|
@@ -22425,12 +22501,12 @@ var GovernanceGroupPanel = ({ editor, block, onComplete }) => {
|
|
|
22425
22501
|
surveyModel.onComplete.remove(handleSurveyComplete);
|
|
22426
22502
|
};
|
|
22427
22503
|
}, [handleSurveyComplete, surveyModel]);
|
|
22428
|
-
const handleRetry =
|
|
22504
|
+
const handleRetry = useCallback65(() => {
|
|
22429
22505
|
setFlowStep("survey");
|
|
22430
22506
|
setError(null);
|
|
22431
22507
|
surveyModel?.clear();
|
|
22432
22508
|
}, [surveyModel]);
|
|
22433
|
-
const handleBackToTypeSelection =
|
|
22509
|
+
const handleBackToTypeSelection = useCallback65(() => {
|
|
22434
22510
|
setSelectedGroupType(null);
|
|
22435
22511
|
setFlowStep("typeSelection");
|
|
22436
22512
|
editor.updateBlock(block, {
|
|
@@ -22442,7 +22518,7 @@ var GovernanceGroupPanel = ({ editor, block, onComplete }) => {
|
|
|
22442
22518
|
}
|
|
22443
22519
|
});
|
|
22444
22520
|
}, [editor, block]);
|
|
22445
|
-
const handleClose =
|
|
22521
|
+
const handleClose = useCallback65(() => {
|
|
22446
22522
|
closePanel();
|
|
22447
22523
|
}, [closePanel]);
|
|
22448
22524
|
if (flowStep === "typeSelection") {
|
|
@@ -22489,8 +22565,8 @@ var GovernanceGroupFlowView = ({ editor, block }) => {
|
|
|
22489
22565
|
const [submissionStatus, setSubmissionStatus] = useState79("idle");
|
|
22490
22566
|
const lastSubmission = block.props.lastSubmission ? JSON.parse(block.props.lastSubmission) : null;
|
|
22491
22567
|
const hasExistingSubmission = lastSubmission?.coreAddress;
|
|
22492
|
-
const editorRef =
|
|
22493
|
-
const blockRef =
|
|
22568
|
+
const editorRef = useRef18(editor);
|
|
22569
|
+
const blockRef = useRef18(block);
|
|
22494
22570
|
useEffect63(() => {
|
|
22495
22571
|
editorRef.current = editor;
|
|
22496
22572
|
blockRef.current = block;
|
|
@@ -22513,8 +22589,8 @@ var GovernanceGroupFlowView = ({ editor, block }) => {
|
|
|
22513
22589
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
22514
22590
|
[]
|
|
22515
22591
|
);
|
|
22516
|
-
const handleCompleteRef =
|
|
22517
|
-
const handleComplete =
|
|
22592
|
+
const handleCompleteRef = useRef18();
|
|
22593
|
+
const handleComplete = useCallback66((data) => {
|
|
22518
22594
|
const currentEditor = editorRef.current;
|
|
22519
22595
|
const currentBlock = blockRef.current;
|
|
22520
22596
|
currentEditor.updateBlock(currentBlock, {
|
|
@@ -22537,7 +22613,7 @@ var GovernanceGroupFlowView = ({ editor, block }) => {
|
|
|
22537
22613
|
useEffect63(() => {
|
|
22538
22614
|
handleCompleteRef.current = handleComplete;
|
|
22539
22615
|
});
|
|
22540
|
-
const stableHandleComplete =
|
|
22616
|
+
const stableHandleComplete = useCallback66(
|
|
22541
22617
|
(data) => {
|
|
22542
22618
|
handleCompleteRef.current?.(data);
|
|
22543
22619
|
},
|
|
@@ -22908,7 +22984,7 @@ import React225, { useMemo as useMemo75 } from "react";
|
|
|
22908
22984
|
import { Badge as Badge40, Group as Group78, Stack as Stack147, Text as Text122, Tooltip as Tooltip25 } from "@mantine/core";
|
|
22909
22985
|
|
|
22910
22986
|
// src/mantine/blocks/flowLink/flow/FlowLinkPanel.tsx
|
|
22911
|
-
import React224, { useState as useState81, useEffect as useEffect65, useCallback as
|
|
22987
|
+
import React224, { useState as useState81, useEffect as useEffect65, useCallback as useCallback67 } from "react";
|
|
22912
22988
|
import { Stack as Stack146, Text as Text121, Card as Card22, Group as Group77, Badge as Badge39, ActionIcon as ActionIcon36, Loader as Loader30, Tooltip as Tooltip24 } from "@mantine/core";
|
|
22913
22989
|
import { IconRefresh as IconRefresh7, IconCheck as IconCheck12, IconClock as IconClock3, IconCircleDashed as IconCircleDashed4 } from "@tabler/icons-react";
|
|
22914
22990
|
var FlowLinkPanel = ({ block }) => {
|
|
@@ -22916,7 +22992,7 @@ var FlowLinkPanel = ({ block }) => {
|
|
|
22916
22992
|
const handlers = useBlocknoteHandlers();
|
|
22917
22993
|
const links = safeParseJSONArray(block.props.links).sort((a, b) => a.position - b.position);
|
|
22918
22994
|
const [linksWithStatus, setLinksWithStatus] = useState81(links.map((link) => ({ ...link })));
|
|
22919
|
-
const fetchStatuses =
|
|
22995
|
+
const fetchStatuses = useCallback67(async () => {
|
|
22920
22996
|
if (!handlers.getFlowStatus) {
|
|
22921
22997
|
return;
|
|
22922
22998
|
}
|
|
@@ -23234,7 +23310,7 @@ blockRegistry.register({
|
|
|
23234
23310
|
});
|
|
23235
23311
|
|
|
23236
23312
|
// src/mantine/blocks/hooks/useBlockDependencies.ts
|
|
23237
|
-
import { useMemo as useMemo76, useEffect as useEffect66, useState as useState82, useCallback as
|
|
23313
|
+
import { useMemo as useMemo76, useEffect as useEffect66, useState as useState82, useCallback as useCallback68 } from "react";
|
|
23238
23314
|
|
|
23239
23315
|
// src/mantine/blocks/hooks/useDependsOn.ts
|
|
23240
23316
|
import { useMemo as useMemo77 } from "react";
|
|
@@ -23804,14 +23880,14 @@ import { useCreateBlockNote as useCreateBlockNote2 } from "@blocknote/react";
|
|
|
23804
23880
|
import { BlockNoteSchema as BlockNoteSchema2, defaultBlockSpecs as defaultBlockSpecs2, defaultInlineContentSpecs as defaultInlineContentSpecs2, defaultStyleSpecs as defaultStyleSpecs2 } from "@blocknote/core";
|
|
23805
23881
|
|
|
23806
23882
|
// src/core/hooks/useMatrixProvider.ts
|
|
23807
|
-
import { useEffect as useEffect67, useState as useState83, useRef as
|
|
23883
|
+
import { useEffect as useEffect67, useState as useState83, useRef as useRef19, useCallback as useCallback69, useMemo as useMemo78 } from "react";
|
|
23808
23884
|
import { MatrixProvider } from "@ixo/matrix-crdt";
|
|
23809
23885
|
function useMatrixProvider({ matrixClient, roomId, yDoc }) {
|
|
23810
23886
|
const [matrixProvider, setProvider] = useState83(null);
|
|
23811
23887
|
const [status, setStatus] = useState83("disconnected");
|
|
23812
|
-
const isMountedRef =
|
|
23813
|
-
const providerRef =
|
|
23814
|
-
const retryTimeoutRef =
|
|
23888
|
+
const isMountedRef = useRef19(true);
|
|
23889
|
+
const providerRef = useRef19(null);
|
|
23890
|
+
const retryTimeoutRef = useRef19(null);
|
|
23815
23891
|
const providerOptions = useMemo78(
|
|
23816
23892
|
() => ({
|
|
23817
23893
|
translator: {
|
|
@@ -23825,22 +23901,22 @@ function useMatrixProvider({ matrixClient, roomId, yDoc }) {
|
|
|
23825
23901
|
}),
|
|
23826
23902
|
[]
|
|
23827
23903
|
);
|
|
23828
|
-
const handleDocumentAvailable =
|
|
23904
|
+
const handleDocumentAvailable = useCallback69(() => {
|
|
23829
23905
|
if (isMountedRef.current) {
|
|
23830
23906
|
setStatus("connected");
|
|
23831
23907
|
}
|
|
23832
23908
|
}, []);
|
|
23833
|
-
const handleDocumentUnavailable =
|
|
23909
|
+
const handleDocumentUnavailable = useCallback69(() => {
|
|
23834
23910
|
if (isMountedRef.current) {
|
|
23835
23911
|
setStatus("failed");
|
|
23836
23912
|
}
|
|
23837
23913
|
}, []);
|
|
23838
|
-
const handleCanWriteChanged =
|
|
23914
|
+
const handleCanWriteChanged = useCallback69(() => {
|
|
23839
23915
|
if (isMountedRef.current && providerRef.current) {
|
|
23840
23916
|
setStatus(providerRef.current.canWrite ? "connected" : "failed");
|
|
23841
23917
|
}
|
|
23842
23918
|
}, []);
|
|
23843
|
-
const initProvider =
|
|
23919
|
+
const initProvider = useCallback69(async () => {
|
|
23844
23920
|
if (!isMountedRef.current) return;
|
|
23845
23921
|
if (retryTimeoutRef.current) {
|
|
23846
23922
|
clearTimeout(retryTimeoutRef.current);
|
|
@@ -24433,7 +24509,7 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
24433
24509
|
|
|
24434
24510
|
// src/mantine/components/Base/BaseIconPicker.tsx
|
|
24435
24511
|
import React229, { useState as useState85, useMemo as useMemo81, useEffect as useEffect69 } from "react";
|
|
24436
|
-
import { TextInput as TextInput7, Tabs as Tabs5, Box as
|
|
24512
|
+
import { TextInput as TextInput7, Tabs as Tabs5, Box as Box43, Stack as Stack148, UnstyledButton as UnstyledButton2, Text as Text123, Center as Center12, ScrollArea as ScrollArea8, Group as Group79, Popover as Popover4 } from "@mantine/core";
|
|
24437
24513
|
import * as TablerIcons from "@tabler/icons-react";
|
|
24438
24514
|
import { IconSearch as IconSearch6, IconX as IconX12, IconChevronLeft, IconChevronRight as IconChevronRight11 } from "@tabler/icons-react";
|
|
24439
24515
|
|
|
@@ -24529,7 +24605,7 @@ function BaseIconPicker({ opened, onClose, onSelectIcon, onUploadClick, children
|
|
|
24529
24605
|
return /* @__PURE__ */ React229.createElement(Center12, { py: "xl" }, /* @__PURE__ */ React229.createElement(Text123, { c: "dimmed", size: "sm" }, "No icons found"));
|
|
24530
24606
|
}
|
|
24531
24607
|
return /* @__PURE__ */ React229.createElement(
|
|
24532
|
-
|
|
24608
|
+
Box43,
|
|
24533
24609
|
{
|
|
24534
24610
|
style: {
|
|
24535
24611
|
display: "grid",
|
|
@@ -24599,7 +24675,7 @@ function BaseIconPicker({ opened, onClose, onSelectIcon, onUploadClick, children
|
|
|
24599
24675
|
}
|
|
24600
24676
|
}
|
|
24601
24677
|
}
|
|
24602
|
-
), !searchQuery && /* @__PURE__ */ React229.createElement(
|
|
24678
|
+
), !searchQuery && /* @__PURE__ */ React229.createElement(Box43, { mb: "md" }, /* @__PURE__ */ React229.createElement(Text123, { size: "sm", fw: 500, mb: "xs", px: "xs" }, "Recent"), /* @__PURE__ */ React229.createElement(ScrollArea8.Autosize, { scrollbarSize: 0, mah: 60 }, renderIconGrid(recentIcons))), /* @__PURE__ */ React229.createElement(Box43, null, /* @__PURE__ */ React229.createElement(Group79, { justify: "space-between", mb: "xs", px: "xs" }, /* @__PURE__ */ React229.createElement(Text123, { size: "sm", fw: 500 }, searchQuery ? "Results" : "Icons"), totalPages > 1 && /* @__PURE__ */ React229.createElement(Group79, { gap: "xs" }, /* @__PURE__ */ React229.createElement(Text123, { size: "xs", c: "dimmed" }, "Page ", currentPage, " of ", totalPages, " (", filteredIcons.length, " total)"), /* @__PURE__ */ React229.createElement(BaseButton, { size: "xs", onClick: () => setCurrentPage((p) => Math.max(1, p - 1)), disabled: currentPage === 1, leftSection: /* @__PURE__ */ React229.createElement(IconChevronLeft, { size: 14 }) }, "Prev"), /* @__PURE__ */ React229.createElement(
|
|
24603
24679
|
BaseButton,
|
|
24604
24680
|
{
|
|
24605
24681
|
size: "xs",
|
|
@@ -24613,8 +24689,8 @@ function BaseIconPicker({ opened, onClose, onSelectIcon, onUploadClick, children
|
|
|
24613
24689
|
}
|
|
24614
24690
|
|
|
24615
24691
|
// src/mantine/components/CoverImage.tsx
|
|
24616
|
-
import React231, { useState as useState86, useRef as
|
|
24617
|
-
import { Box as
|
|
24692
|
+
import React231, { useState as useState86, useRef as useRef20, useEffect as useEffect70 } from "react";
|
|
24693
|
+
import { Box as Box45, Group as Group80 } from "@mantine/core";
|
|
24618
24694
|
|
|
24619
24695
|
// src/core/lib/imageTransform.ts
|
|
24620
24696
|
var CLOUDFLARE_CDN_BASE = "https://www.ixo.earth/cdn-cgi/image";
|
|
@@ -24748,7 +24824,7 @@ function transformIconImage(sourceUrl, size = "default", customOptions) {
|
|
|
24748
24824
|
|
|
24749
24825
|
// src/mantine/components/Base/PageIcon.tsx
|
|
24750
24826
|
import React230, { useMemo as useMemo82 } from "react";
|
|
24751
|
-
import { Center as Center13, Box as
|
|
24827
|
+
import { Center as Center13, Box as Box44 } from "@mantine/core";
|
|
24752
24828
|
import * as TablerIcons2 from "@tabler/icons-react";
|
|
24753
24829
|
function PageIcon({ src, iconSize = 64, useCenter = false, style }) {
|
|
24754
24830
|
const isIconName = src && !src.startsWith("http");
|
|
@@ -24760,7 +24836,7 @@ function PageIcon({ src, iconSize = 64, useCenter = false, style }) {
|
|
|
24760
24836
|
}
|
|
24761
24837
|
return null;
|
|
24762
24838
|
}, [isIconName, src]);
|
|
24763
|
-
const Container = useCenter ? Center13 :
|
|
24839
|
+
const Container = useCenter ? Center13 : Box44;
|
|
24764
24840
|
if (!src) return null;
|
|
24765
24841
|
if (IconComponent) {
|
|
24766
24842
|
return /* @__PURE__ */ React230.createElement(
|
|
@@ -24802,8 +24878,8 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
24802
24878
|
const [isHovering, setIsHovering] = useState86(false);
|
|
24803
24879
|
const [isRepositioning, setIsRepositioning] = useState86(false);
|
|
24804
24880
|
const [coverPosition, setCoverPosition] = useState86(50);
|
|
24805
|
-
const coverFileInputRef =
|
|
24806
|
-
const logoFileInputRef =
|
|
24881
|
+
const coverFileInputRef = useRef20(null);
|
|
24882
|
+
const logoFileInputRef = useRef20(null);
|
|
24807
24883
|
const [opened, { open, close }] = useDisclosure5(false);
|
|
24808
24884
|
const [metadata, setMetadata] = useState86(() => editor?.getPageMetadata?.() || null);
|
|
24809
24885
|
useEffect70(() => {
|
|
@@ -24889,7 +24965,7 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
24889
24965
|
}
|
|
24890
24966
|
if (!hasCover) {
|
|
24891
24967
|
return /* @__PURE__ */ React231.createElement(
|
|
24892
|
-
|
|
24968
|
+
Box45,
|
|
24893
24969
|
{
|
|
24894
24970
|
style: {
|
|
24895
24971
|
position: "relative",
|
|
@@ -24925,7 +25001,7 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
24925
25001
|
),
|
|
24926
25002
|
/* @__PURE__ */ React231.createElement(CoverImageButton, { onClick: () => coverFileInputRef.current?.click() }, "Add cover")
|
|
24927
25003
|
), logoSrc && /* @__PURE__ */ React231.createElement(
|
|
24928
|
-
|
|
25004
|
+
Box45,
|
|
24929
25005
|
{
|
|
24930
25006
|
style: {
|
|
24931
25007
|
position: "relative",
|
|
@@ -24972,7 +25048,7 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
24972
25048
|
);
|
|
24973
25049
|
}
|
|
24974
25050
|
return /* @__PURE__ */ React231.createElement(
|
|
24975
|
-
|
|
25051
|
+
Box45,
|
|
24976
25052
|
{
|
|
24977
25053
|
style: {
|
|
24978
25054
|
position: "relative",
|
|
@@ -25025,7 +25101,7 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
25025
25101
|
/* @__PURE__ */ React231.createElement(CoverImageButton, { onClick: handleRemoveCover }, "Remove")
|
|
25026
25102
|
),
|
|
25027
25103
|
/* @__PURE__ */ React231.createElement("div", { style: { maxWidth: "900px", margin: "0 auto", position: "absolute", bottom: 0, left: -40, right: 0, height: "70px" } }, /* @__PURE__ */ React231.createElement(
|
|
25028
|
-
|
|
25104
|
+
Box45,
|
|
25029
25105
|
{
|
|
25030
25106
|
style: {
|
|
25031
25107
|
position: "absolute",
|
|
@@ -25081,7 +25157,7 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
25081
25157
|
}
|
|
25082
25158
|
|
|
25083
25159
|
// src/mantine/components/PageHeader.tsx
|
|
25084
|
-
import React232, { useState as useState87, useRef as
|
|
25160
|
+
import React232, { useState as useState87, useRef as useRef21, useEffect as useEffect71 } from "react";
|
|
25085
25161
|
function PageHeader({
|
|
25086
25162
|
title = "New page",
|
|
25087
25163
|
icon,
|
|
@@ -25095,8 +25171,8 @@ function PageHeader({
|
|
|
25095
25171
|
}) {
|
|
25096
25172
|
const [isMenuOpen, setIsMenuOpen] = useState87(false);
|
|
25097
25173
|
const [isPrivacyOpen, setIsPrivacyOpen] = useState87(false);
|
|
25098
|
-
const menuRef =
|
|
25099
|
-
const privacyRef =
|
|
25174
|
+
const menuRef = useRef21(null);
|
|
25175
|
+
const privacyRef = useRef21(null);
|
|
25100
25176
|
useEffect71(() => {
|
|
25101
25177
|
function handleClickOutside(event) {
|
|
25102
25178
|
if (menuRef.current && !menuRef.current.contains(event.target)) {
|
|
@@ -25295,8 +25371,8 @@ var styles = {
|
|
|
25295
25371
|
};
|
|
25296
25372
|
|
|
25297
25373
|
// src/mantine/components/ExternalDropZone.tsx
|
|
25298
|
-
import React233, { useCallback as
|
|
25299
|
-
import { Box as
|
|
25374
|
+
import React233, { useCallback as useCallback70, useEffect as useEffect72, useRef as useRef22, useState as useState88 } from "react";
|
|
25375
|
+
import { Box as Box46 } from "@mantine/core";
|
|
25300
25376
|
var SCROLL_ZONE_SIZE = 80;
|
|
25301
25377
|
var SCROLL_SPEED = 12;
|
|
25302
25378
|
var ExternalDropZone = ({
|
|
@@ -25308,20 +25384,20 @@ var ExternalDropZone = ({
|
|
|
25308
25384
|
onPlacementCancel,
|
|
25309
25385
|
children
|
|
25310
25386
|
}) => {
|
|
25311
|
-
const containerRef =
|
|
25387
|
+
const containerRef = useRef22(null);
|
|
25312
25388
|
const [isValidDrag, setIsValidDrag] = useState88(false);
|
|
25313
25389
|
const [isHoveringInPlacementMode, setIsHoveringInPlacementMode] = useState88(false);
|
|
25314
25390
|
const [indicatorStyle, setIndicatorStyle] = useState88({});
|
|
25315
|
-
const dropPositionRef =
|
|
25316
|
-
const scrollAnimationRef =
|
|
25317
|
-
const scrollDirectionRef =
|
|
25318
|
-
const scrollContainerRef =
|
|
25319
|
-
const getBlockElements =
|
|
25391
|
+
const dropPositionRef = useRef22(null);
|
|
25392
|
+
const scrollAnimationRef = useRef22(null);
|
|
25393
|
+
const scrollDirectionRef = useRef22(null);
|
|
25394
|
+
const scrollContainerRef = useRef22(null);
|
|
25395
|
+
const getBlockElements = useCallback70(() => {
|
|
25320
25396
|
if (!containerRef.current) return [];
|
|
25321
25397
|
const blocks = containerRef.current.querySelectorAll('[data-node-type="blockContainer"]');
|
|
25322
25398
|
return Array.from(blocks);
|
|
25323
25399
|
}, []);
|
|
25324
|
-
const getScrollContainer =
|
|
25400
|
+
const getScrollContainer = useCallback70(() => {
|
|
25325
25401
|
if (scrollContainerRef.current) return scrollContainerRef.current;
|
|
25326
25402
|
let element = containerRef.current;
|
|
25327
25403
|
while (element) {
|
|
@@ -25336,7 +25412,7 @@ var ExternalDropZone = ({
|
|
|
25336
25412
|
scrollContainerRef.current = window;
|
|
25337
25413
|
return window;
|
|
25338
25414
|
}, []);
|
|
25339
|
-
const performScroll =
|
|
25415
|
+
const performScroll = useCallback70(() => {
|
|
25340
25416
|
const container = getScrollContainer();
|
|
25341
25417
|
const direction = scrollDirectionRef.current;
|
|
25342
25418
|
if (!direction) {
|
|
@@ -25351,7 +25427,7 @@ var ExternalDropZone = ({
|
|
|
25351
25427
|
}
|
|
25352
25428
|
scrollAnimationRef.current = requestAnimationFrame(performScroll);
|
|
25353
25429
|
}, [getScrollContainer]);
|
|
25354
|
-
const startAutoScroll =
|
|
25430
|
+
const startAutoScroll = useCallback70(
|
|
25355
25431
|
(direction) => {
|
|
25356
25432
|
if (scrollDirectionRef.current === direction) return;
|
|
25357
25433
|
scrollDirectionRef.current = direction;
|
|
@@ -25361,14 +25437,14 @@ var ExternalDropZone = ({
|
|
|
25361
25437
|
},
|
|
25362
25438
|
[performScroll]
|
|
25363
25439
|
);
|
|
25364
|
-
const stopAutoScroll =
|
|
25440
|
+
const stopAutoScroll = useCallback70(() => {
|
|
25365
25441
|
scrollDirectionRef.current = null;
|
|
25366
25442
|
if (scrollAnimationRef.current) {
|
|
25367
25443
|
cancelAnimationFrame(scrollAnimationRef.current);
|
|
25368
25444
|
scrollAnimationRef.current = null;
|
|
25369
25445
|
}
|
|
25370
25446
|
}, []);
|
|
25371
|
-
const checkAutoScroll =
|
|
25447
|
+
const checkAutoScroll = useCallback70(
|
|
25372
25448
|
(clientY) => {
|
|
25373
25449
|
const container = getScrollContainer();
|
|
25374
25450
|
let containerTop;
|
|
@@ -25391,7 +25467,7 @@ var ExternalDropZone = ({
|
|
|
25391
25467
|
},
|
|
25392
25468
|
[getScrollContainer, startAutoScroll, stopAutoScroll]
|
|
25393
25469
|
);
|
|
25394
|
-
const findDropPosition =
|
|
25470
|
+
const findDropPosition = useCallback70(
|
|
25395
25471
|
(clientY) => {
|
|
25396
25472
|
const blocks = getBlockElements();
|
|
25397
25473
|
if (blocks.length === 0 || !editor?.document) return null;
|
|
@@ -25424,7 +25500,7 @@ var ExternalDropZone = ({
|
|
|
25424
25500
|
},
|
|
25425
25501
|
[getBlockElements, editor]
|
|
25426
25502
|
);
|
|
25427
|
-
const handleDragOver =
|
|
25503
|
+
const handleDragOver = useCallback70(
|
|
25428
25504
|
(e) => {
|
|
25429
25505
|
if (!e.dataTransfer.types.includes(acceptedType)) return;
|
|
25430
25506
|
e.preventDefault();
|
|
@@ -25447,7 +25523,7 @@ var ExternalDropZone = ({
|
|
|
25447
25523
|
},
|
|
25448
25524
|
[acceptedType, findDropPosition, checkAutoScroll]
|
|
25449
25525
|
);
|
|
25450
|
-
const handleDragLeave =
|
|
25526
|
+
const handleDragLeave = useCallback70(
|
|
25451
25527
|
(e) => {
|
|
25452
25528
|
if (containerRef.current && !containerRef.current.contains(e.relatedTarget)) {
|
|
25453
25529
|
setIsValidDrag(false);
|
|
@@ -25457,7 +25533,7 @@ var ExternalDropZone = ({
|
|
|
25457
25533
|
},
|
|
25458
25534
|
[stopAutoScroll]
|
|
25459
25535
|
);
|
|
25460
|
-
const handleDrop =
|
|
25536
|
+
const handleDrop = useCallback70(
|
|
25461
25537
|
(e) => {
|
|
25462
25538
|
e.preventDefault();
|
|
25463
25539
|
e.stopPropagation();
|
|
@@ -25480,7 +25556,7 @@ var ExternalDropZone = ({
|
|
|
25480
25556
|
window.addEventListener("dragend", handleGlobalDragEnd);
|
|
25481
25557
|
return () => window.removeEventListener("dragend", handleGlobalDragEnd);
|
|
25482
25558
|
}, [stopAutoScroll]);
|
|
25483
|
-
const handleOverlayMouseMove =
|
|
25559
|
+
const handleOverlayMouseMove = useCallback70(
|
|
25484
25560
|
(e) => {
|
|
25485
25561
|
setIsHoveringInPlacementMode(true);
|
|
25486
25562
|
checkAutoScroll(e.clientY);
|
|
@@ -25499,12 +25575,12 @@ var ExternalDropZone = ({
|
|
|
25499
25575
|
},
|
|
25500
25576
|
[findDropPosition, checkAutoScroll]
|
|
25501
25577
|
);
|
|
25502
|
-
const handleOverlayMouseLeave =
|
|
25578
|
+
const handleOverlayMouseLeave = useCallback70(() => {
|
|
25503
25579
|
setIsHoveringInPlacementMode(false);
|
|
25504
25580
|
dropPositionRef.current = null;
|
|
25505
25581
|
stopAutoScroll();
|
|
25506
25582
|
}, [stopAutoScroll]);
|
|
25507
|
-
const handleOverlayClick =
|
|
25583
|
+
const handleOverlayClick = useCallback70(
|
|
25508
25584
|
(e) => {
|
|
25509
25585
|
e.preventDefault();
|
|
25510
25586
|
e.stopPropagation();
|
|
@@ -25518,7 +25594,7 @@ var ExternalDropZone = ({
|
|
|
25518
25594
|
},
|
|
25519
25595
|
[onDrop, stopAutoScroll]
|
|
25520
25596
|
);
|
|
25521
|
-
const handleOverlayWheel =
|
|
25597
|
+
const handleOverlayWheel = useCallback70(
|
|
25522
25598
|
(e) => {
|
|
25523
25599
|
const container = getScrollContainer();
|
|
25524
25600
|
if (container === window) {
|
|
@@ -25581,7 +25657,7 @@ var ExternalDropZone = ({
|
|
|
25581
25657
|
}) : dropIndicator;
|
|
25582
25658
|
const shouldShowIndicator = isValidDrag || isPlacementMode && isHoveringInPlacementMode;
|
|
25583
25659
|
return /* @__PURE__ */ React233.createElement(
|
|
25584
|
-
|
|
25660
|
+
Box46,
|
|
25585
25661
|
{
|
|
25586
25662
|
ref: containerRef,
|
|
25587
25663
|
style: {
|
|
@@ -25597,7 +25673,7 @@ var ExternalDropZone = ({
|
|
|
25597
25673
|
},
|
|
25598
25674
|
children,
|
|
25599
25675
|
isPlacementMode && /* @__PURE__ */ React233.createElement(
|
|
25600
|
-
|
|
25676
|
+
Box46,
|
|
25601
25677
|
{
|
|
25602
25678
|
style: {
|
|
25603
25679
|
position: "absolute",
|
|
@@ -25616,12 +25692,12 @@ var ExternalDropZone = ({
|
|
|
25616
25692
|
onWheel: handleOverlayWheel
|
|
25617
25693
|
}
|
|
25618
25694
|
),
|
|
25619
|
-
shouldShowIndicator && indicatorWithPosition && /* @__PURE__ */ React233.createElement(
|
|
25695
|
+
shouldShowIndicator && indicatorWithPosition && /* @__PURE__ */ React233.createElement(Box46, { style: { ...indicatorStyle, background: "none", border: "none", boxShadow: "none" } }, indicatorWithPosition)
|
|
25620
25696
|
);
|
|
25621
25697
|
};
|
|
25622
25698
|
|
|
25623
25699
|
// src/mantine/IxoEditor.tsx
|
|
25624
|
-
import React235, { useState as useState89, useEffect as useEffect73, useCallback as
|
|
25700
|
+
import React235, { useState as useState89, useEffect as useEffect73, useCallback as useCallback71 } from "react";
|
|
25625
25701
|
import { getDefaultReactSlashMenuItems, SuggestionMenuController } from "@blocknote/react";
|
|
25626
25702
|
import { BlockNoteView } from "@blocknote/mantine";
|
|
25627
25703
|
import { filterSuggestionItems } from "@blocknote/core";
|
|
@@ -25629,7 +25705,7 @@ import { MantineProvider } from "@mantine/core";
|
|
|
25629
25705
|
|
|
25630
25706
|
// src/mantine/components/PanelContent.tsx
|
|
25631
25707
|
import React234 from "react";
|
|
25632
|
-
import { Box as
|
|
25708
|
+
import { Box as Box47 } from "@mantine/core";
|
|
25633
25709
|
var panelStyles = {
|
|
25634
25710
|
light: {
|
|
25635
25711
|
backgroundColor: "#ffffff",
|
|
@@ -25659,7 +25735,7 @@ function PanelContent({ theme }) {
|
|
|
25659
25735
|
const isOpen = activePanel !== null;
|
|
25660
25736
|
const content = activePanel ? registeredPanels.get(activePanel) : null;
|
|
25661
25737
|
return /* @__PURE__ */ React234.createElement(
|
|
25662
|
-
|
|
25738
|
+
Box47,
|
|
25663
25739
|
{
|
|
25664
25740
|
pos: "sticky",
|
|
25665
25741
|
right: 0,
|
|
@@ -25716,7 +25792,7 @@ function IxoEditorContent({
|
|
|
25716
25792
|
} catch {
|
|
25717
25793
|
}
|
|
25718
25794
|
}, [editor]);
|
|
25719
|
-
const handlePrivacyChange =
|
|
25795
|
+
const handlePrivacyChange = useCallback71(
|
|
25720
25796
|
async (makePrivate) => {
|
|
25721
25797
|
const matrixClient = editor.getMatrixClient?.();
|
|
25722
25798
|
const roomId = editor.getRoomId?.();
|
|
@@ -26066,7 +26142,7 @@ var FlowPermissionsPanel = ({
|
|
|
26066
26142
|
};
|
|
26067
26143
|
|
|
26068
26144
|
// src/mantine/components/GrantPermissionModal.tsx
|
|
26069
|
-
import React238, { useState as useState92, useCallback as
|
|
26145
|
+
import React238, { useState as useState92, useCallback as useCallback72 } from "react";
|
|
26070
26146
|
import {
|
|
26071
26147
|
Modal as Modal4,
|
|
26072
26148
|
Stack as Stack151,
|
|
@@ -26112,7 +26188,7 @@ var GrantPermissionModal = ({
|
|
|
26112
26188
|
const [pin, setPin] = useState92("");
|
|
26113
26189
|
const [loading, setLoading] = useState92(false);
|
|
26114
26190
|
const [error, setError] = useState92(null);
|
|
26115
|
-
const handleSearch =
|
|
26191
|
+
const handleSearch = useCallback72(async () => {
|
|
26116
26192
|
if (searchQuery.length < 2) return;
|
|
26117
26193
|
setSearching(true);
|
|
26118
26194
|
try {
|
|
@@ -26409,4 +26485,4 @@ export {
|
|
|
26409
26485
|
ixoGraphQLClient,
|
|
26410
26486
|
getEntity
|
|
26411
26487
|
};
|
|
26412
|
-
//# sourceMappingURL=chunk-
|
|
26488
|
+
//# sourceMappingURL=chunk-GXVDLVQA.mjs.map
|