@ixo/editor 2.31.1 → 2.32.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,7 +13768,7 @@ 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 useRef10, useEffect as
|
|
13771
|
+
import React151, { useMemo as useMemo43, useRef as useRef10, useEffect as useEffect44, useCallback as useCallback39 } from "react";
|
|
13772
13772
|
import { Stack as Stack113, Text as Text87, Loader as Loader19, Center as Center9, Alert as Alert20, Title as Title6, Flex as Flex27, ActionIcon as ActionIcon26 } from "@mantine/core";
|
|
13773
13773
|
|
|
13774
13774
|
// src/mantine/hooks/useCurrentUser.ts
|
|
@@ -15011,6 +15011,37 @@ var UserPlus = ({ size = 24, color = "currentColor", style }) => {
|
|
|
15011
15011
|
};
|
|
15012
15012
|
var UserPlus_default = UserPlus;
|
|
15013
15013
|
|
|
15014
|
+
// src/mantine/blocks/bid/flow/hooks/useUserBid.ts
|
|
15015
|
+
import { useState as useState58, useEffect as useEffect41, useCallback as useCallback37 } from "react";
|
|
15016
|
+
function useUserBid(collectionId, userDid) {
|
|
15017
|
+
const handlers = useBlocknoteHandlers();
|
|
15018
|
+
const [userBid, setUserBid] = useState58(null);
|
|
15019
|
+
const [loading, setLoading] = useState58(true);
|
|
15020
|
+
const [error, setError] = useState58(null);
|
|
15021
|
+
const fetchUserBid = useCallback37(async () => {
|
|
15022
|
+
if (!collectionId || !userDid) {
|
|
15023
|
+
setLoading(false);
|
|
15024
|
+
return;
|
|
15025
|
+
}
|
|
15026
|
+
try {
|
|
15027
|
+
setLoading(true);
|
|
15028
|
+
setError(null);
|
|
15029
|
+
const formattedDid = userDid.startsWith("did:ixo:") ? userDid : `did:ixo:${userDid}`;
|
|
15030
|
+
const response = await handlers.queryBidsByDid({ collectionId, did: formattedDid });
|
|
15031
|
+
setUserBid(Array.isArray(response?.data) && response.data.length > 0 ? response.data[0] : null);
|
|
15032
|
+
} catch (err) {
|
|
15033
|
+
setError(err instanceof Error ? err.message : "Failed to fetch user bid");
|
|
15034
|
+
setUserBid(null);
|
|
15035
|
+
} finally {
|
|
15036
|
+
setLoading(false);
|
|
15037
|
+
}
|
|
15038
|
+
}, [collectionId, userDid, handlers]);
|
|
15039
|
+
useEffect41(() => {
|
|
15040
|
+
fetchUserBid();
|
|
15041
|
+
}, [fetchUserBid]);
|
|
15042
|
+
return { userBid, loading, error, refetch: fetchUserBid };
|
|
15043
|
+
}
|
|
15044
|
+
|
|
15014
15045
|
// src/mantine/blocks/bid/flow/components/BidCollectionItem.tsx
|
|
15015
15046
|
var BidCollectionItem = ({ collection, deedId, adminAddress, userRole, onRefresh, execution, executeHookedActions }) => {
|
|
15016
15047
|
const {
|
|
@@ -15023,6 +15054,7 @@ var BidCollectionItem = ({ collection, deedId, adminAddress, userRole, onRefresh
|
|
|
15023
15054
|
actorDid: execution.actorDid,
|
|
15024
15055
|
flowUri: execution.flowUri
|
|
15025
15056
|
});
|
|
15057
|
+
const { userBid, loading: userBidLoading } = useUserBid(collection.id, execution.actorDid);
|
|
15026
15058
|
const executionRef = React146.useRef(execution);
|
|
15027
15059
|
const executeHookedActionsRef = React146.useRef(executeHookedActions);
|
|
15028
15060
|
const onRefreshRef = React146.useRef(onRefresh);
|
|
@@ -15118,13 +15150,16 @@ var BidCollectionItem = ({ collection, deedId, adminAddress, userRole, onRefresh
|
|
|
15118
15150
|
);
|
|
15119
15151
|
const { open: openBidsList } = usePanel(bidsListPanelId, bidsListPanelContent);
|
|
15120
15152
|
const renderActionButton = () => {
|
|
15121
|
-
if (authLoading) {
|
|
15153
|
+
if (authLoading || userBidLoading) {
|
|
15122
15154
|
return /* @__PURE__ */ React146.createElement(Loader16, { size: "xs" });
|
|
15123
15155
|
}
|
|
15124
15156
|
if (userRole === "PO" /* Owner */) {
|
|
15125
15157
|
return /* @__PURE__ */ React146.createElement(ActionIcon23, { variant: "subtle", size: "lg", onClick: openBidsList }, /* @__PURE__ */ React146.createElement(IconArrowRight3, { size: 20 }));
|
|
15126
15158
|
} else if (userRole === "SA" /* ServiceProvider */ || userRole === "EA" /* Evaluator */) {
|
|
15127
15159
|
return /* @__PURE__ */ React146.createElement(Badge21, { size: "sm", color: getRoleColor(userRole) }, getRoleLabel(userRole));
|
|
15160
|
+
} else if (userBid) {
|
|
15161
|
+
const roleLabel = getRoleLabel(userBid.role);
|
|
15162
|
+
return /* @__PURE__ */ React146.createElement(Tooltip13, { label: `Applied as ${roleLabel}`, withArrow: true }, /* @__PURE__ */ React146.createElement(Badge21, { size: "xs", variant: "filled", color: "blue" }, "In Progress"));
|
|
15128
15163
|
} else {
|
|
15129
15164
|
if (!isAuthorized) {
|
|
15130
15165
|
return /* @__PURE__ */ React146.createElement(Tooltip13, { label: reason || "You are not authorized to apply", withArrow: true }, /* @__PURE__ */ React146.createElement(Button30, { size: "xs", variant: "light", disabled: true, leftSection: /* @__PURE__ */ React146.createElement(IconLock, { size: 14 }) }, "Apply"));
|
|
@@ -15142,11 +15177,11 @@ var BidCollectionItem = ({ collection, deedId, adminAddress, userRole, onRefresh
|
|
|
15142
15177
|
};
|
|
15143
15178
|
|
|
15144
15179
|
// src/mantine/blocks/evaluator/flow/EvaluationCollectionItem.tsx
|
|
15145
|
-
import React149, { useMemo as useMemo42, useEffect as
|
|
15180
|
+
import React149, { useMemo as useMemo42, useEffect as useEffect43, useRef as useRef9 } from "react";
|
|
15146
15181
|
import { Stack as Stack111, Text as Text85, ActionIcon as ActionIcon25, Tooltip as Tooltip15 } from "@mantine/core";
|
|
15147
15182
|
|
|
15148
15183
|
// src/mantine/blocks/evaluator/flow/ClaimsList.tsx
|
|
15149
|
-
import React148, { useState as
|
|
15184
|
+
import React148, { useState as useState59, useEffect as useEffect42, useCallback as useCallback38, useMemo as useMemo41 } from "react";
|
|
15150
15185
|
import { Paper as Paper14, CloseButton as CloseButton5, Title as Title5, 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 } from "@mantine/core";
|
|
15151
15186
|
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";
|
|
15152
15187
|
import { Survey as Survey4, SurveyModel as SurveyModel4 } from "@ixo/surveys";
|
|
@@ -15592,21 +15627,21 @@ var ClaimsList = ({ collectionId, collectionName, deedId, adminAddress, onEvalua
|
|
|
15592
15627
|
const { closePanel } = usePanelStore();
|
|
15593
15628
|
const handlers = useBlocknoteHandlers();
|
|
15594
15629
|
const { editor } = useBlocknoteContext();
|
|
15595
|
-
const [viewMode, setViewMode] =
|
|
15596
|
-
const [claims, setClaims] =
|
|
15597
|
-
const [loading, setLoading] =
|
|
15598
|
-
const [error, setError] =
|
|
15599
|
-
const [selectedClaim, setSelectedClaim] =
|
|
15600
|
-
const [claimData, setClaimData] =
|
|
15601
|
-
const [surveyJson, setSurveyJson] =
|
|
15602
|
-
const [surveyLoading, setSurveyLoading] =
|
|
15603
|
-
const [surveyError, setSurveyError] =
|
|
15604
|
-
const [evaluating, setEvaluating] =
|
|
15605
|
-
const [rubricData, setRubricData] =
|
|
15606
|
-
const [evaluationResult, setEvaluationResult] =
|
|
15607
|
-
const [evaluationLoading, setEvaluationLoading] =
|
|
15608
|
-
const [activeTab, setActiveTab] =
|
|
15609
|
-
const fetchClaims =
|
|
15630
|
+
const [viewMode, setViewMode] = useState59("list");
|
|
15631
|
+
const [claims, setClaims] = useState59([]);
|
|
15632
|
+
const [loading, setLoading] = useState59(true);
|
|
15633
|
+
const [error, setError] = useState59(null);
|
|
15634
|
+
const [selectedClaim, setSelectedClaim] = useState59(null);
|
|
15635
|
+
const [claimData, setClaimData] = useState59(null);
|
|
15636
|
+
const [surveyJson, setSurveyJson] = useState59(null);
|
|
15637
|
+
const [surveyLoading, setSurveyLoading] = useState59(false);
|
|
15638
|
+
const [surveyError, setSurveyError] = useState59(null);
|
|
15639
|
+
const [evaluating, setEvaluating] = useState59(false);
|
|
15640
|
+
const [rubricData, setRubricData] = useState59(null);
|
|
15641
|
+
const [evaluationResult, setEvaluationResult] = useState59(null);
|
|
15642
|
+
const [evaluationLoading, setEvaluationLoading] = useState59(false);
|
|
15643
|
+
const [activeTab, setActiveTab] = useState59("submission");
|
|
15644
|
+
const fetchClaims = useCallback38(async () => {
|
|
15610
15645
|
try {
|
|
15611
15646
|
setLoading(true);
|
|
15612
15647
|
setError(null);
|
|
@@ -15621,10 +15656,10 @@ var ClaimsList = ({ collectionId, collectionName, deedId, adminAddress, onEvalua
|
|
|
15621
15656
|
setLoading(false);
|
|
15622
15657
|
}
|
|
15623
15658
|
}, [collectionId]);
|
|
15624
|
-
|
|
15659
|
+
useEffect42(() => {
|
|
15625
15660
|
fetchClaims();
|
|
15626
15661
|
}, [fetchClaims]);
|
|
15627
|
-
const fetchClaimAndSurvey =
|
|
15662
|
+
const fetchClaimAndSurvey = useCallback38(
|
|
15628
15663
|
async (claim) => {
|
|
15629
15664
|
try {
|
|
15630
15665
|
setSurveyLoading(true);
|
|
@@ -15671,7 +15706,7 @@ var ClaimsList = ({ collectionId, collectionName, deedId, adminAddress, onEvalua
|
|
|
15671
15706
|
},
|
|
15672
15707
|
[collectionId, deedId]
|
|
15673
15708
|
);
|
|
15674
|
-
const handleViewClaim =
|
|
15709
|
+
const handleViewClaim = useCallback38(
|
|
15675
15710
|
(claim) => {
|
|
15676
15711
|
setSelectedClaim(claim);
|
|
15677
15712
|
fetchClaimAndSurvey(claim);
|
|
@@ -15679,7 +15714,7 @@ var ClaimsList = ({ collectionId, collectionName, deedId, adminAddress, onEvalua
|
|
|
15679
15714
|
},
|
|
15680
15715
|
[fetchClaimAndSurvey]
|
|
15681
15716
|
);
|
|
15682
|
-
const handleBackToList =
|
|
15717
|
+
const handleBackToList = useCallback38(() => {
|
|
15683
15718
|
setViewMode("list");
|
|
15684
15719
|
setSelectedClaim(null);
|
|
15685
15720
|
setClaimData(null);
|
|
@@ -15714,7 +15749,7 @@ var ClaimsList = ({ collectionId, collectionName, deedId, adminAddress, onEvalua
|
|
|
15714
15749
|
}),
|
|
15715
15750
|
[]
|
|
15716
15751
|
);
|
|
15717
|
-
const handleApprove =
|
|
15752
|
+
const handleApprove = useCallback38(async () => {
|
|
15718
15753
|
if (!selectedClaim) return;
|
|
15719
15754
|
try {
|
|
15720
15755
|
setEvaluating(true);
|
|
@@ -15807,7 +15842,7 @@ var ClaimsList = ({ collectionId, collectionName, deedId, adminAddress, onEvalua
|
|
|
15807
15842
|
setEvaluating(false);
|
|
15808
15843
|
}
|
|
15809
15844
|
}, [selectedClaim, handlers, deedId, collectionId, adminAddress, evaluationResult, handleBackToList, onEvaluationComplete, editor]);
|
|
15810
|
-
const handleReject =
|
|
15845
|
+
const handleReject = useCallback38(async () => {
|
|
15811
15846
|
if (!selectedClaim) return;
|
|
15812
15847
|
try {
|
|
15813
15848
|
setEvaluating(true);
|
|
@@ -16004,9 +16039,9 @@ var ClaimsList = ({ collectionId, collectionName, deedId, adminAddress, onEvalua
|
|
|
16004
16039
|
};
|
|
16005
16040
|
var ClaimListItem = ({ claim, onViewClaim }) => {
|
|
16006
16041
|
const handlers = useBlocknoteHandlers();
|
|
16007
|
-
const [userProfile, setUserProfile] =
|
|
16008
|
-
const [loadingProfile, setLoadingProfile] =
|
|
16009
|
-
|
|
16042
|
+
const [userProfile, setUserProfile] = useState59(null);
|
|
16043
|
+
const [loadingProfile, setLoadingProfile] = useState59(false);
|
|
16044
|
+
useEffect42(() => {
|
|
16010
16045
|
const fetchUserProfile = async () => {
|
|
16011
16046
|
if (!claim.agentDid) return;
|
|
16012
16047
|
try {
|
|
@@ -16074,7 +16109,7 @@ import { IconArrowRight as IconArrowRight5 } from "@tabler/icons-react";
|
|
|
16074
16109
|
var EvaluationCollectionItem = ({ collection, deedId, adminAddress, userRole, onRefresh }) => {
|
|
16075
16110
|
const { getCurrentUser } = useBlocknoteHandlers();
|
|
16076
16111
|
const getCurrentUserRef = useRef9(getCurrentUser);
|
|
16077
|
-
|
|
16112
|
+
useEffect43(() => {
|
|
16078
16113
|
getCurrentUserRef.current = getCurrentUser;
|
|
16079
16114
|
}, [getCurrentUser]);
|
|
16080
16115
|
const currentUser = getCurrentUserRef.current();
|
|
@@ -16219,7 +16254,7 @@ var ClaimFlowView = ({ editor, block }) => {
|
|
|
16219
16254
|
[flowNode, runtime, ucanManager, userAddress, delegationStore, verifySignature, flowOwnerDid, flowUri]
|
|
16220
16255
|
);
|
|
16221
16256
|
const executionRef = useRef10(executionValue);
|
|
16222
|
-
|
|
16257
|
+
useEffect44(() => {
|
|
16223
16258
|
executionRef.current = executionValue;
|
|
16224
16259
|
}, [executionValue]);
|
|
16225
16260
|
const execution = useMemo43(
|
|
@@ -16269,13 +16304,14 @@ var ClaimFlowView = ({ editor, block }) => {
|
|
|
16269
16304
|
}
|
|
16270
16305
|
}, [block.props.selectedCollections]);
|
|
16271
16306
|
const did = block.props.deedDid;
|
|
16307
|
+
const title = block.props.title || "Submit Claim";
|
|
16272
16308
|
const adminAddress = block.props.adminAddress || "";
|
|
16273
16309
|
const { collections, loading, error, refetch } = useCollections(did, selectedCollectionIds, block, editor);
|
|
16274
16310
|
const refetchRef = useRef10(refetch);
|
|
16275
|
-
|
|
16311
|
+
useEffect44(() => {
|
|
16276
16312
|
refetchRef.current = refetch;
|
|
16277
16313
|
}, [refetch]);
|
|
16278
|
-
const stableRefetch =
|
|
16314
|
+
const stableRefetch = useCallback39(() => {
|
|
16279
16315
|
refetchRef.current();
|
|
16280
16316
|
}, []);
|
|
16281
16317
|
if (!did) {
|
|
@@ -16284,7 +16320,7 @@ var ClaimFlowView = ({ editor, block }) => {
|
|
|
16284
16320
|
if (selectedCollectionIds.length === 0) {
|
|
16285
16321
|
return /* @__PURE__ */ React151.createElement(Center9, { py: "xl" }, /* @__PURE__ */ React151.createElement(Text87, { size: "sm", c: "dimmed" }, "No claim collections selected"));
|
|
16286
16322
|
}
|
|
16287
|
-
return /* @__PURE__ */ React151.createElement(Stack113, { w: "100%" }, /* @__PURE__ */ React151.createElement(Flex27, { px: 5, align: "center", justify: "space-between" }, /* @__PURE__ */ React151.createElement(Title6, { order: 4 },
|
|
16323
|
+
return /* @__PURE__ */ React151.createElement(Stack113, { w: "100%" }, /* @__PURE__ */ React151.createElement(Flex27, { px: 5, align: "center", justify: "space-between" }, /* @__PURE__ */ React151.createElement(Title6, { 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(
|
|
16288
16324
|
ClaimCollectionsList,
|
|
16289
16325
|
{
|
|
16290
16326
|
listType: "claims",
|
|
@@ -16363,10 +16399,10 @@ import React156, { useMemo as useMemo45 } from "react";
|
|
|
16363
16399
|
import { Group as Group52, Stack as Stack114, Text as Text88 } from "@mantine/core";
|
|
16364
16400
|
|
|
16365
16401
|
// src/mantine/blocks/bid/template/TemplateConfig.tsx
|
|
16366
|
-
import React155, { useCallback as
|
|
16402
|
+
import React155, { useCallback as useCallback41 } from "react";
|
|
16367
16403
|
|
|
16368
16404
|
// src/mantine/blocks/bid/template/GeneralTab.tsx
|
|
16369
|
-
import React154, { useEffect as
|
|
16405
|
+
import React154, { useEffect as useEffect45, useState as useState60, useCallback as useCallback40, useMemo as useMemo44 } from "react";
|
|
16370
16406
|
var GeneralTab7 = ({
|
|
16371
16407
|
title,
|
|
16372
16408
|
description,
|
|
@@ -16379,12 +16415,12 @@ var GeneralTab7 = ({
|
|
|
16379
16415
|
onSelectedCollectionsChange,
|
|
16380
16416
|
onAdminAddressChange
|
|
16381
16417
|
}) => {
|
|
16382
|
-
const [localTitle, setLocalTitle] =
|
|
16383
|
-
const [localDescription, setLocalDescription] =
|
|
16384
|
-
|
|
16418
|
+
const [localTitle, setLocalTitle] = useState60(title || "");
|
|
16419
|
+
const [localDescription, setLocalDescription] = useState60(description || "");
|
|
16420
|
+
useEffect45(() => {
|
|
16385
16421
|
setLocalTitle(title || "");
|
|
16386
16422
|
}, [title]);
|
|
16387
|
-
|
|
16423
|
+
useEffect45(() => {
|
|
16388
16424
|
setLocalDescription(description || "");
|
|
16389
16425
|
}, [description]);
|
|
16390
16426
|
const parsedSelectedCollections = useMemo44(() => {
|
|
@@ -16394,14 +16430,14 @@ var GeneralTab7 = ({
|
|
|
16394
16430
|
return [];
|
|
16395
16431
|
}
|
|
16396
16432
|
}, [selectedCollections]);
|
|
16397
|
-
const handleCollectionsChange =
|
|
16433
|
+
const handleCollectionsChange = useCallback40(
|
|
16398
16434
|
(collections) => {
|
|
16399
16435
|
const stringified = JSON.stringify(collections || []);
|
|
16400
16436
|
onSelectedCollectionsChange(stringified);
|
|
16401
16437
|
},
|
|
16402
16438
|
[onSelectedCollectionsChange]
|
|
16403
16439
|
);
|
|
16404
|
-
const handleAdminAddressChange =
|
|
16440
|
+
const handleAdminAddressChange = useCallback40(
|
|
16405
16441
|
(adminAddress2) => {
|
|
16406
16442
|
if (onAdminAddressChange) {
|
|
16407
16443
|
onAdminAddressChange(adminAddress2);
|
|
@@ -16631,7 +16667,7 @@ var bidActions = [
|
|
|
16631
16667
|
// src/mantine/blocks/bid/template/TemplateConfig.tsx
|
|
16632
16668
|
var TemplateConfig7 = ({ editor, block }) => {
|
|
16633
16669
|
const { closePanel } = usePanelStore();
|
|
16634
|
-
const updateProp =
|
|
16670
|
+
const updateProp = useCallback41(
|
|
16635
16671
|
(key, value) => {
|
|
16636
16672
|
editor.updateBlock(block, {
|
|
16637
16673
|
props: {
|
|
@@ -16725,7 +16761,7 @@ var BidTemplateView = ({ editor, block }) => {
|
|
|
16725
16761
|
};
|
|
16726
16762
|
|
|
16727
16763
|
// src/mantine/blocks/bid/flow/components/FlowView.tsx
|
|
16728
|
-
import React157, { useMemo as useMemo46, useRef as useRef11, useEffect as
|
|
16764
|
+
import React157, { useMemo as useMemo46, useRef as useRef11, useEffect as useEffect46, useCallback as useCallback42 } from "react";
|
|
16729
16765
|
import { Stack as Stack115, Text as Text89, Loader as Loader20, Center as Center10, Alert as Alert21, Title as Title7, Flex as Flex28, ActionIcon as ActionIcon27 } from "@mantine/core";
|
|
16730
16766
|
import { IconSettings as IconSettings4, IconRefresh as IconRefresh5, IconAlertCircle as IconAlertCircle6 } from "@tabler/icons-react";
|
|
16731
16767
|
var BID_FLOW_PANEL_ID = "bid-flow-panel";
|
|
@@ -16769,7 +16805,7 @@ var BidFlowView = ({ editor, block }) => {
|
|
|
16769
16805
|
[flowNode, runtime, ucanManager, userAddress, editor, flowUri, delegationStore, verifySignature, flowOwnerDid]
|
|
16770
16806
|
);
|
|
16771
16807
|
const executionRef = useRef11(executionValue);
|
|
16772
|
-
|
|
16808
|
+
useEffect46(() => {
|
|
16773
16809
|
executionRef.current = executionValue;
|
|
16774
16810
|
}, [executionValue]);
|
|
16775
16811
|
const execution = useMemo46(
|
|
@@ -16823,13 +16859,14 @@ var BidFlowView = ({ editor, block }) => {
|
|
|
16823
16859
|
}, [block.props.selectedCollections]);
|
|
16824
16860
|
const did = block.props.did;
|
|
16825
16861
|
const adminAddress = block.props.adminAddress || "";
|
|
16862
|
+
const title = block.props.title || "Bid Application";
|
|
16826
16863
|
const { collections, loading, error, refetch } = useCollections(did, selectedCollectionIds, block, editor);
|
|
16827
16864
|
const { executeHookedActions } = useHookedActions({ block, editor });
|
|
16828
16865
|
const refetchRef = useRef11(refetch);
|
|
16829
|
-
|
|
16866
|
+
useEffect46(() => {
|
|
16830
16867
|
refetchRef.current = refetch;
|
|
16831
16868
|
}, [refetch]);
|
|
16832
|
-
const stableRefetch =
|
|
16869
|
+
const stableRefetch = useCallback42(() => {
|
|
16833
16870
|
refetchRef.current();
|
|
16834
16871
|
}, []);
|
|
16835
16872
|
if (!did) {
|
|
@@ -16838,7 +16875,7 @@ var BidFlowView = ({ editor, block }) => {
|
|
|
16838
16875
|
if (selectedCollectionIds.length === 0) {
|
|
16839
16876
|
return /* @__PURE__ */ React157.createElement(Center10, { py: "xl" }, /* @__PURE__ */ React157.createElement(Text89, { size: "sm", c: "dimmed" }, "No claim collections selected"));
|
|
16840
16877
|
}
|
|
16841
|
-
return /* @__PURE__ */ React157.createElement(Stack115, { w: "100%" }, /* @__PURE__ */ React157.createElement(Flex28, { px: 5, align: "center", justify: "space-between" }, /* @__PURE__ */ React157.createElement(Title7, { order: 4 },
|
|
16878
|
+
return /* @__PURE__ */ React157.createElement(Stack115, { w: "100%" }, /* @__PURE__ */ React157.createElement(Flex28, { px: 5, align: "center", justify: "space-between" }, /* @__PURE__ */ React157.createElement(Title7, { 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(
|
|
16842
16879
|
ClaimCollectionsList,
|
|
16843
16880
|
{
|
|
16844
16881
|
listType: "bids",
|
|
@@ -16909,10 +16946,10 @@ import React162, { useMemo as useMemo48 } from "react";
|
|
|
16909
16946
|
import { Group as Group53, Stack as Stack116, Text as Text90 } from "@mantine/core";
|
|
16910
16947
|
|
|
16911
16948
|
// src/mantine/blocks/evaluator/template/TemplateConfig.tsx
|
|
16912
|
-
import React161, { useCallback as
|
|
16949
|
+
import React161, { useCallback as useCallback44 } from "react";
|
|
16913
16950
|
|
|
16914
16951
|
// src/mantine/blocks/evaluator/template/GeneralTab.tsx
|
|
16915
|
-
import React160, { useEffect as
|
|
16952
|
+
import React160, { useEffect as useEffect47, useState as useState61, useCallback as useCallback43, useMemo as useMemo47 } from "react";
|
|
16916
16953
|
var GeneralTab8 = ({
|
|
16917
16954
|
title,
|
|
16918
16955
|
description,
|
|
@@ -16925,12 +16962,12 @@ var GeneralTab8 = ({
|
|
|
16925
16962
|
onSelectedCollectionsChange,
|
|
16926
16963
|
onAdminAddressChange
|
|
16927
16964
|
}) => {
|
|
16928
|
-
const [localTitle, setLocalTitle] =
|
|
16929
|
-
const [localDescription, setLocalDescription] =
|
|
16930
|
-
|
|
16965
|
+
const [localTitle, setLocalTitle] = useState61(title || "");
|
|
16966
|
+
const [localDescription, setLocalDescription] = useState61(description || "");
|
|
16967
|
+
useEffect47(() => {
|
|
16931
16968
|
setLocalTitle(title || "");
|
|
16932
16969
|
}, [title]);
|
|
16933
|
-
|
|
16970
|
+
useEffect47(() => {
|
|
16934
16971
|
setLocalDescription(description || "");
|
|
16935
16972
|
}, [description]);
|
|
16936
16973
|
const parsedSelectedCollections = useMemo47(() => {
|
|
@@ -16940,14 +16977,14 @@ var GeneralTab8 = ({
|
|
|
16940
16977
|
return [];
|
|
16941
16978
|
}
|
|
16942
16979
|
}, [selectedCollections]);
|
|
16943
|
-
const handleCollectionsChange =
|
|
16980
|
+
const handleCollectionsChange = useCallback43(
|
|
16944
16981
|
(collections) => {
|
|
16945
16982
|
const stringified = JSON.stringify(collections || []);
|
|
16946
16983
|
onSelectedCollectionsChange(stringified);
|
|
16947
16984
|
},
|
|
16948
16985
|
[onSelectedCollectionsChange]
|
|
16949
16986
|
);
|
|
16950
|
-
const handleAdminAddressChange =
|
|
16987
|
+
const handleAdminAddressChange = useCallback43(
|
|
16951
16988
|
(adminAddress2) => {
|
|
16952
16989
|
if (onAdminAddressChange) {
|
|
16953
16990
|
onAdminAddressChange(adminAddress2);
|
|
@@ -16996,7 +17033,7 @@ var GeneralTab8 = ({
|
|
|
16996
17033
|
// src/mantine/blocks/evaluator/template/TemplateConfig.tsx
|
|
16997
17034
|
var TemplateConfig8 = ({ editor, block }) => {
|
|
16998
17035
|
const { closePanel } = usePanelStore();
|
|
16999
|
-
const updateProp =
|
|
17036
|
+
const updateProp = useCallback44(
|
|
17000
17037
|
(key, value) => {
|
|
17001
17038
|
editor.updateBlock(block, {
|
|
17002
17039
|
props: {
|
|
@@ -17088,6 +17125,7 @@ var EvaluatorFlowView = ({ editor, block }) => {
|
|
|
17088
17125
|
}, [block.props.selectedCollections]);
|
|
17089
17126
|
const did = block.props.deedDid;
|
|
17090
17127
|
const adminAddress = block.props.adminAddress || "";
|
|
17128
|
+
const title = block.props.title || "Evaluate Claims";
|
|
17091
17129
|
const { collections, loading, error, refetch } = useCollections(did, selectedCollectionIds, block, editor);
|
|
17092
17130
|
if (!did) {
|
|
17093
17131
|
return /* @__PURE__ */ React163.createElement(Center11, { py: "xl" }, /* @__PURE__ */ React163.createElement(Text91, { size: "sm", c: "dimmed" }, "Please configure the evaluator block in template mode first"));
|
|
@@ -17095,7 +17133,7 @@ var EvaluatorFlowView = ({ editor, block }) => {
|
|
|
17095
17133
|
if (selectedCollectionIds.length === 0) {
|
|
17096
17134
|
return /* @__PURE__ */ React163.createElement(Center11, { py: "xl" }, /* @__PURE__ */ React163.createElement(Text91, { size: "sm", c: "dimmed" }, "No claim collections selected"));
|
|
17097
17135
|
}
|
|
17098
|
-
return /* @__PURE__ */ React163.createElement(Stack117, { w: "100%" }, /* @__PURE__ */ React163.createElement(Flex29, { px: 5, align: "center", justify: "space-between" }, /* @__PURE__ */ React163.createElement(Title8, { order: 4 },
|
|
17136
|
+
return /* @__PURE__ */ React163.createElement(Stack117, { w: "100%" }, /* @__PURE__ */ React163.createElement(Flex29, { px: 5, align: "center", justify: "space-between" }, /* @__PURE__ */ React163.createElement(Title8, { 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 }));
|
|
17099
17137
|
};
|
|
17100
17138
|
|
|
17101
17139
|
// src/mantine/blocks/evaluator/EvaluatorBlock.tsx
|
|
@@ -17147,14 +17185,14 @@ import React167 from "react";
|
|
|
17147
17185
|
import { createReactBlockSpec as createReactBlockSpec12 } from "@blocknote/react";
|
|
17148
17186
|
|
|
17149
17187
|
// src/mantine/blocks/visualization/VisualizationBlock.tsx
|
|
17150
|
-
import React166, { useMemo as useMemo50, useCallback as
|
|
17188
|
+
import React166, { useMemo as useMemo50, useCallback as useCallback45, useRef as useRef12, useState as useState62, useEffect as useEffect48 } from "react";
|
|
17151
17189
|
import { Box as Box34, Stack as Stack118, Text as Text92, Paper as Paper15, Group as Group54 } from "@mantine/core";
|
|
17152
17190
|
function VisualizationBlock({ block, editor }) {
|
|
17153
17191
|
const { visualizationRenderer } = useBlocknoteContext();
|
|
17154
17192
|
const { vizType, config, title, preferences } = block.props;
|
|
17155
17193
|
const containerRef = useRef12(null);
|
|
17156
|
-
const [hasValidDimensions, setHasValidDimensions] =
|
|
17157
|
-
|
|
17194
|
+
const [hasValidDimensions, setHasValidDimensions] = useState62(false);
|
|
17195
|
+
useEffect48(() => {
|
|
17158
17196
|
const container = containerRef.current;
|
|
17159
17197
|
if (!container) return;
|
|
17160
17198
|
const checkDimensions = () => {
|
|
@@ -17184,7 +17222,7 @@ function VisualizationBlock({ block, editor }) {
|
|
|
17184
17222
|
return {};
|
|
17185
17223
|
}
|
|
17186
17224
|
}, [preferences]);
|
|
17187
|
-
const handlePreferencesChange =
|
|
17225
|
+
const handlePreferencesChange = useCallback45(
|
|
17188
17226
|
(newPreferences) => {
|
|
17189
17227
|
if (editor) {
|
|
17190
17228
|
editor.updateBlock(block, {
|
|
@@ -17251,17 +17289,17 @@ import React170, { useMemo as useMemo51 } from "react";
|
|
|
17251
17289
|
import { Badge as Badge24, Group as Group55, Stack as Stack119, Text as Text93 } from "@mantine/core";
|
|
17252
17290
|
|
|
17253
17291
|
// src/mantine/blocks/domainCreator/template/TemplateConfig.tsx
|
|
17254
|
-
import React169, { useCallback as
|
|
17292
|
+
import React169, { useCallback as useCallback46 } from "react";
|
|
17255
17293
|
|
|
17256
17294
|
// src/mantine/blocks/domainCreator/template/GeneralTab.tsx
|
|
17257
|
-
import React168, { useEffect as
|
|
17295
|
+
import React168, { useEffect as useEffect49, useState as useState63 } from "react";
|
|
17258
17296
|
var GeneralTab9 = ({ title, description, icon, onTitleChange, onDescriptionChange, onIconChange }) => {
|
|
17259
|
-
const [localTitle, setLocalTitle] =
|
|
17260
|
-
const [localDescription, setLocalDescription] =
|
|
17261
|
-
const [localIcon, setLocalIcon] =
|
|
17262
|
-
|
|
17263
|
-
|
|
17264
|
-
|
|
17297
|
+
const [localTitle, setLocalTitle] = useState63(title || "");
|
|
17298
|
+
const [localDescription, setLocalDescription] = useState63(description || "");
|
|
17299
|
+
const [localIcon, setLocalIcon] = useState63(icon || "file-text");
|
|
17300
|
+
useEffect49(() => setLocalTitle(title || ""), [title]);
|
|
17301
|
+
useEffect49(() => setLocalDescription(description || ""), [description]);
|
|
17302
|
+
useEffect49(() => setLocalIcon(icon || "file-text"), [icon]);
|
|
17265
17303
|
return /* @__PURE__ */ React168.createElement(BaseSection, null, /* @__PURE__ */ React168.createElement(
|
|
17266
17304
|
BaseTextInput,
|
|
17267
17305
|
{
|
|
@@ -17306,7 +17344,7 @@ var GeneralTab9 = ({ title, description, icon, onTitleChange, onDescriptionChang
|
|
|
17306
17344
|
// src/mantine/blocks/domainCreator/template/TemplateConfig.tsx
|
|
17307
17345
|
var TemplateConfig9 = ({ editor, block }) => {
|
|
17308
17346
|
const { closePanel } = usePanelStore();
|
|
17309
|
-
const updateProp =
|
|
17347
|
+
const updateProp = useCallback46(
|
|
17310
17348
|
(key, value) => {
|
|
17311
17349
|
editor.updateBlock(block, {
|
|
17312
17350
|
props: {
|
|
@@ -17357,12 +17395,12 @@ var DomainCreatorTemplateView = ({ editor, block }) => {
|
|
|
17357
17395
|
};
|
|
17358
17396
|
|
|
17359
17397
|
// src/mantine/blocks/domainCreator/flow/FlowView.tsx
|
|
17360
|
-
import React172, { useCallback as
|
|
17398
|
+
import React172, { useCallback as useCallback48, useMemo as useMemo53, useState as useState65 } from "react";
|
|
17361
17399
|
import { ActionIcon as ActionIcon29, Badge as Badge25, Group as Group57, Stack as Stack121, Text as Text95, Tooltip as Tooltip16 } from "@mantine/core";
|
|
17362
17400
|
import { IconChevronRight as IconChevronRight6, IconCheck as IconCheck6, IconAlertCircle as IconAlertCircle9 } from "@tabler/icons-react";
|
|
17363
17401
|
|
|
17364
17402
|
// src/mantine/blocks/domainCreator/flow/DomainCreatorSurveyPanel.tsx
|
|
17365
|
-
import React171, { useCallback as
|
|
17403
|
+
import React171, { useCallback as useCallback47, useEffect as useEffect50, useMemo as useMemo52, useRef as useRef13, useState as useState64 } from "react";
|
|
17366
17404
|
import { Alert as Alert23, Button as Button32, Group as Group56, Loader as Loader22, Stack as Stack120, Text as Text94 } from "@mantine/core";
|
|
17367
17405
|
import { useDebouncedCallback } from "@mantine/hooks";
|
|
17368
17406
|
import { IconAlertCircle as IconAlertCircle8, IconCheck as IconCheck5 } from "@tabler/icons-react";
|
|
@@ -18423,10 +18461,10 @@ var DomainCreatorSurveyPanel = ({ editor, block, onComplete, entityDid: existing
|
|
|
18423
18461
|
const { handlers } = useBlocknoteContext();
|
|
18424
18462
|
const existingBlockEntityDid = block.props.entityDid;
|
|
18425
18463
|
const existingBlockEntityType = block.props.entityType;
|
|
18426
|
-
const [flowStep, setFlowStep] =
|
|
18427
|
-
const [error, setError] =
|
|
18428
|
-
const [createdEntityDid, setCreatedEntityDid] =
|
|
18429
|
-
const [createdEntityType, setCreatedEntityType] =
|
|
18464
|
+
const [flowStep, setFlowStep] = useState64(existingBlockEntityDid ? "success" : "survey");
|
|
18465
|
+
const [error, setError] = useState64(null);
|
|
18466
|
+
const [createdEntityDid, setCreatedEntityDid] = useState64(existingBlockEntityDid || null);
|
|
18467
|
+
const [createdEntityType, setCreatedEntityType] = useState64(existingBlockEntityType || null);
|
|
18430
18468
|
const isUpdatingFromProp = useRef13(false);
|
|
18431
18469
|
const lastSyncedAnswers = useRef13("");
|
|
18432
18470
|
const surveyModel = useMemo52(() => {
|
|
@@ -18436,7 +18474,7 @@ var DomainCreatorSurveyPanel = ({ editor, block, onComplete, entityDid: existing
|
|
|
18436
18474
|
model.questionsOnPageMode = "singlePage";
|
|
18437
18475
|
return model;
|
|
18438
18476
|
}, []);
|
|
18439
|
-
const syncPropToSurvey =
|
|
18477
|
+
const syncPropToSurvey = useCallback47(
|
|
18440
18478
|
(answersJson) => {
|
|
18441
18479
|
if (!answersJson || answersJson === lastSyncedAnswers.current) return;
|
|
18442
18480
|
try {
|
|
@@ -18468,13 +18506,13 @@ var DomainCreatorSurveyPanel = ({ editor, block, onComplete, entityDid: existing
|
|
|
18468
18506
|
}
|
|
18469
18507
|
});
|
|
18470
18508
|
}, SYNC_DEBOUNCE_MS);
|
|
18471
|
-
|
|
18509
|
+
useEffect50(() => {
|
|
18472
18510
|
const answersJson = block.props.answers;
|
|
18473
18511
|
if (answersJson) {
|
|
18474
18512
|
syncPropToSurvey(answersJson);
|
|
18475
18513
|
}
|
|
18476
18514
|
}, [block.props.answers, syncPropToSurvey]);
|
|
18477
|
-
|
|
18515
|
+
useEffect50(() => {
|
|
18478
18516
|
const handleValueChanged = () => {
|
|
18479
18517
|
if (isUpdatingFromProp.current) return;
|
|
18480
18518
|
syncSurveyToProp(surveyModel.data);
|
|
@@ -18484,7 +18522,7 @@ var DomainCreatorSurveyPanel = ({ editor, block, onComplete, entityDid: existing
|
|
|
18484
18522
|
surveyModel.onValueChanged.remove(handleValueChanged);
|
|
18485
18523
|
};
|
|
18486
18524
|
}, [surveyModel, syncSurveyToProp]);
|
|
18487
|
-
|
|
18525
|
+
useEffect50(() => {
|
|
18488
18526
|
const needsSchema = !block.props.surveySchema;
|
|
18489
18527
|
const needsAnswers = !block.props.answers;
|
|
18490
18528
|
if (needsSchema || needsAnswers) {
|
|
@@ -18506,7 +18544,7 @@ var DomainCreatorSurveyPanel = ({ editor, block, onComplete, entityDid: existing
|
|
|
18506
18544
|
});
|
|
18507
18545
|
}
|
|
18508
18546
|
}, [editor, block]);
|
|
18509
|
-
const processDomainCreation =
|
|
18547
|
+
const processDomainCreation = useCallback47(
|
|
18510
18548
|
async (data) => {
|
|
18511
18549
|
if (!handlers) {
|
|
18512
18550
|
throw new Error("Handlers not available");
|
|
@@ -18584,7 +18622,7 @@ var DomainCreatorSurveyPanel = ({ editor, block, onComplete, entityDid: existing
|
|
|
18584
18622
|
},
|
|
18585
18623
|
[handlers, existingEntityDid, issuerDidOverride]
|
|
18586
18624
|
);
|
|
18587
|
-
const handleSurveyComplete =
|
|
18625
|
+
const handleSurveyComplete = useCallback47(
|
|
18588
18626
|
async (sender) => {
|
|
18589
18627
|
const data = sender.data || {};
|
|
18590
18628
|
try {
|
|
@@ -18612,21 +18650,21 @@ var DomainCreatorSurveyPanel = ({ editor, block, onComplete, entityDid: existing
|
|
|
18612
18650
|
},
|
|
18613
18651
|
[processDomainCreation, onComplete, editor, block]
|
|
18614
18652
|
);
|
|
18615
|
-
|
|
18653
|
+
useEffect50(() => {
|
|
18616
18654
|
surveyModel.onComplete.add(handleSurveyComplete);
|
|
18617
18655
|
return () => {
|
|
18618
18656
|
surveyModel.onComplete.remove(handleSurveyComplete);
|
|
18619
18657
|
};
|
|
18620
18658
|
}, [handleSurveyComplete, surveyModel]);
|
|
18621
|
-
const handleRetry =
|
|
18659
|
+
const handleRetry = useCallback47(() => {
|
|
18622
18660
|
setFlowStep("survey");
|
|
18623
18661
|
setError(null);
|
|
18624
18662
|
surveyModel.clear();
|
|
18625
18663
|
}, [surveyModel]);
|
|
18626
|
-
const handleClose =
|
|
18664
|
+
const handleClose = useCallback47(() => {
|
|
18627
18665
|
closePanel();
|
|
18628
18666
|
}, [closePanel]);
|
|
18629
|
-
const handleVisitEntity =
|
|
18667
|
+
const handleVisitEntity = useCallback47(() => {
|
|
18630
18668
|
if (createdEntityDid && createdEntityType && handlers?.redirectToEntityOverview) {
|
|
18631
18669
|
handlers.redirectToEntityOverview(createdEntityDid, createdEntityType);
|
|
18632
18670
|
}
|
|
@@ -18659,11 +18697,11 @@ var DomainCreatorSurveyPanel = ({ editor, block, onComplete, entityDid: existing
|
|
|
18659
18697
|
// src/mantine/blocks/domainCreator/flow/FlowView.tsx
|
|
18660
18698
|
var DOMAIN_CREATOR_FLOW_PANEL_ID = "domain-creator-flow-panel";
|
|
18661
18699
|
var DomainCreatorFlowView = ({ editor, block }) => {
|
|
18662
|
-
const [hasOpened, setHasOpened] =
|
|
18663
|
-
const [submissionStatus, setSubmissionStatus] =
|
|
18700
|
+
const [hasOpened, setHasOpened] = useState65(false);
|
|
18701
|
+
const [submissionStatus, setSubmissionStatus] = useState65("idle");
|
|
18664
18702
|
const lastSubmission = block.props.lastSubmission ? JSON.parse(block.props.lastSubmission) : null;
|
|
18665
18703
|
const hasExistingSubmission = lastSubmission?.entityDid;
|
|
18666
|
-
const handleComplete =
|
|
18704
|
+
const handleComplete = useCallback48(
|
|
18667
18705
|
(data) => {
|
|
18668
18706
|
editor.updateBlock(block, {
|
|
18669
18707
|
props: {
|
|
@@ -18749,30 +18787,30 @@ import React178, { useMemo as useMemo56 } from "react";
|
|
|
18749
18787
|
import { Badge as Badge27, Group as Group59, Stack as Stack124, Text as Text98 } from "@mantine/core";
|
|
18750
18788
|
|
|
18751
18789
|
// src/mantine/blocks/email/template/TemplateConfig.tsx
|
|
18752
|
-
import React177, { useCallback as
|
|
18790
|
+
import React177, { useCallback as useCallback51, useMemo as useMemo55 } from "react";
|
|
18753
18791
|
|
|
18754
18792
|
// src/mantine/blocks/email/template/GeneralTab.tsx
|
|
18755
|
-
import React175, { useEffect as
|
|
18793
|
+
import React175, { useEffect as useEffect51, useState as useState66, useCallback as useCallback49, useRef as useRef14 } from "react";
|
|
18756
18794
|
import { Divider as Divider14, Loader as Loader23, Select as Select4, Stack as Stack122, Text as Text96 } from "@mantine/core";
|
|
18757
18795
|
var GeneralTab10 = ({ editor, blockId, getCurrentBlock, onTitleChange, onTemplateChange, onToChange }) => {
|
|
18758
18796
|
const handlers = useBlocknoteHandlers();
|
|
18759
18797
|
const block = getCurrentBlock();
|
|
18760
18798
|
const blockProps = block.props;
|
|
18761
|
-
const [localTitle, setLocalTitle] =
|
|
18762
|
-
const [localTemplateName, setLocalTemplateName] =
|
|
18763
|
-
const [localTo, setLocalTo] =
|
|
18764
|
-
const [templates, setTemplates] =
|
|
18765
|
-
const [loadingTemplates, setLoadingTemplates] =
|
|
18766
|
-
const [loadingContent, setLoadingContent] =
|
|
18767
|
-
const [error, setError] =
|
|
18768
|
-
|
|
18799
|
+
const [localTitle, setLocalTitle] = useState66(blockProps.title || "");
|
|
18800
|
+
const [localTemplateName, setLocalTemplateName] = useState66(blockProps.templateName || "");
|
|
18801
|
+
const [localTo, setLocalTo] = useState66(blockProps.to || "");
|
|
18802
|
+
const [templates, setTemplates] = useState66([]);
|
|
18803
|
+
const [loadingTemplates, setLoadingTemplates] = useState66(false);
|
|
18804
|
+
const [loadingContent, setLoadingContent] = useState66(false);
|
|
18805
|
+
const [error, setError] = useState66(null);
|
|
18806
|
+
useEffect51(() => {
|
|
18769
18807
|
const currentBlock = getCurrentBlock();
|
|
18770
18808
|
setLocalTitle(currentBlock.props.title || "");
|
|
18771
18809
|
setLocalTemplateName(currentBlock.props.templateName || "");
|
|
18772
18810
|
setLocalTo(currentBlock.props.to || "");
|
|
18773
18811
|
}, [getCurrentBlock]);
|
|
18774
18812
|
const hasLoadedTemplates = useRef14(false);
|
|
18775
|
-
|
|
18813
|
+
useEffect51(() => {
|
|
18776
18814
|
if (hasLoadedTemplates.current) return;
|
|
18777
18815
|
async function loadTemplates() {
|
|
18778
18816
|
if (!handlers.listEmailTemplates) {
|
|
@@ -18794,7 +18832,7 @@ var GeneralTab10 = ({ editor, blockId, getCurrentBlock, onTitleChange, onTemplat
|
|
|
18794
18832
|
}
|
|
18795
18833
|
loadTemplates();
|
|
18796
18834
|
}, [handlers.listEmailTemplates]);
|
|
18797
|
-
const handleTemplateSelect =
|
|
18835
|
+
const handleTemplateSelect = useCallback49(
|
|
18798
18836
|
async (selectedTemplateName) => {
|
|
18799
18837
|
if (!selectedTemplateName) {
|
|
18800
18838
|
setLocalTemplateName("");
|
|
@@ -18883,7 +18921,7 @@ var GeneralTab10 = ({ editor, blockId, getCurrentBlock, onTitleChange, onTemplat
|
|
|
18883
18921
|
};
|
|
18884
18922
|
|
|
18885
18923
|
// src/mantine/blocks/email/template/VariablesTab.tsx
|
|
18886
|
-
import React176, { useMemo as useMemo54, useCallback as
|
|
18924
|
+
import React176, { useMemo as useMemo54, useCallback as useCallback50, useState as useState67, useEffect as useEffect52 } from "react";
|
|
18887
18925
|
import { Alert as Alert24, Badge as Badge26, Divider as Divider15, Group as Group58, Stack as Stack123, Text as Text97 } from "@mantine/core";
|
|
18888
18926
|
import { IconInfoCircle as IconInfoCircle4, IconCheck as IconCheck7 } from "@tabler/icons-react";
|
|
18889
18927
|
var VariablesTab = ({ editor, blockId, getCurrentBlock, onVariablesChange }) => {
|
|
@@ -18903,8 +18941,8 @@ var VariablesTab = ({ editor, blockId, getCurrentBlock, onVariablesChange }) =>
|
|
|
18903
18941
|
return {};
|
|
18904
18942
|
}
|
|
18905
18943
|
}, [blockProps.variables]);
|
|
18906
|
-
const [localMapping, setLocalMapping] =
|
|
18907
|
-
|
|
18944
|
+
const [localMapping, setLocalMapping] = useState67(parsedVariableMapping);
|
|
18945
|
+
useEffect52(() => {
|
|
18908
18946
|
const currentBlock = getCurrentBlock();
|
|
18909
18947
|
try {
|
|
18910
18948
|
const mapping = JSON.parse(currentBlock.props.variables || "{}");
|
|
@@ -18913,7 +18951,7 @@ var VariablesTab = ({ editor, blockId, getCurrentBlock, onVariablesChange }) =>
|
|
|
18913
18951
|
setLocalMapping({});
|
|
18914
18952
|
}
|
|
18915
18953
|
}, [getCurrentBlock]);
|
|
18916
|
-
const handleVariableChange =
|
|
18954
|
+
const handleVariableChange = useCallback50(
|
|
18917
18955
|
(variableName, value) => {
|
|
18918
18956
|
const updated = { ...localMapping, [variableName]: value };
|
|
18919
18957
|
setLocalMapping(updated);
|
|
@@ -18946,11 +18984,11 @@ var VariablesTab = ({ editor, blockId, getCurrentBlock, onVariablesChange }) =>
|
|
|
18946
18984
|
// src/mantine/blocks/email/template/TemplateConfig.tsx
|
|
18947
18985
|
var TemplateConfig10 = ({ editor, block }) => {
|
|
18948
18986
|
const { closePanel } = usePanelStore();
|
|
18949
|
-
const getCurrentBlock =
|
|
18987
|
+
const getCurrentBlock = useCallback51(() => {
|
|
18950
18988
|
const currentBlock = editor.document.find((b) => b.id === block.id);
|
|
18951
18989
|
return currentBlock || block;
|
|
18952
18990
|
}, [editor, block.id]);
|
|
18953
|
-
const updateProp =
|
|
18991
|
+
const updateProp = useCallback51(
|
|
18954
18992
|
(key, value) => {
|
|
18955
18993
|
const currentBlock = getCurrentBlock();
|
|
18956
18994
|
editor.updateBlock(currentBlock, {
|
|
@@ -18962,7 +19000,7 @@ var TemplateConfig10 = ({ editor, block }) => {
|
|
|
18962
19000
|
},
|
|
18963
19001
|
[editor, getCurrentBlock]
|
|
18964
19002
|
);
|
|
18965
|
-
const handleTemplateChange =
|
|
19003
|
+
const handleTemplateChange = useCallback51(
|
|
18966
19004
|
(updates) => {
|
|
18967
19005
|
const currentBlock = getCurrentBlock();
|
|
18968
19006
|
editor.updateBlock(currentBlock, {
|
|
@@ -18974,7 +19012,7 @@ var TemplateConfig10 = ({ editor, block }) => {
|
|
|
18974
19012
|
},
|
|
18975
19013
|
[editor, getCurrentBlock]
|
|
18976
19014
|
);
|
|
18977
|
-
const handleVariablesChange =
|
|
19015
|
+
const handleVariablesChange = useCallback51(
|
|
18978
19016
|
(variables) => {
|
|
18979
19017
|
updateProp("variables", variables);
|
|
18980
19018
|
},
|
|
@@ -19044,11 +19082,11 @@ import { Group as Group60, Stack as Stack125, Text as Text99, ActionIcon as Acti
|
|
|
19044
19082
|
import { IconSend as IconSend4, IconCheck as IconCheck8, IconX as IconX11 } from "@tabler/icons-react";
|
|
19045
19083
|
|
|
19046
19084
|
// src/mantine/blocks/email/flow/hooks/useEmailActions.ts
|
|
19047
|
-
import { useState as
|
|
19085
|
+
import { useState as useState68, useCallback as useCallback52 } from "react";
|
|
19048
19086
|
function useEmailActions({ block, editor }) {
|
|
19049
19087
|
const handlers = useBlocknoteHandlers();
|
|
19050
|
-
const [loading, setLoading] =
|
|
19051
|
-
const updateBlockStatus =
|
|
19088
|
+
const [loading, setLoading] = useState68(false);
|
|
19089
|
+
const updateBlockStatus = useCallback52(
|
|
19052
19090
|
(updates) => {
|
|
19053
19091
|
editor.updateBlock(block, {
|
|
19054
19092
|
props: { ...block.props, ...updates }
|
|
@@ -19056,7 +19094,7 @@ function useEmailActions({ block, editor }) {
|
|
|
19056
19094
|
},
|
|
19057
19095
|
[editor, block]
|
|
19058
19096
|
);
|
|
19059
|
-
const sendEmail =
|
|
19097
|
+
const sendEmail = useCallback52(async () => {
|
|
19060
19098
|
if (!handlers.sendEmail) {
|
|
19061
19099
|
updateBlockStatus({
|
|
19062
19100
|
status: "error",
|
|
@@ -19123,7 +19161,7 @@ function useEmailActions({ block, editor }) {
|
|
|
19123
19161
|
setLoading(false);
|
|
19124
19162
|
}
|
|
19125
19163
|
}, [block, editor, handlers, updateBlockStatus]);
|
|
19126
|
-
const resetStatus =
|
|
19164
|
+
const resetStatus = useCallback52(() => {
|
|
19127
19165
|
updateBlockStatus({
|
|
19128
19166
|
status: "idle",
|
|
19129
19167
|
error: ""
|
|
@@ -19280,15 +19318,15 @@ import React188 from "react";
|
|
|
19280
19318
|
import React184, { useMemo as useMemo59 } from "react";
|
|
19281
19319
|
|
|
19282
19320
|
// src/mantine/blocks/protocolSelector/template/TemplateConfig.tsx
|
|
19283
|
-
import React183, { useCallback as
|
|
19321
|
+
import React183, { useCallback as useCallback53 } from "react";
|
|
19284
19322
|
|
|
19285
19323
|
// src/mantine/blocks/protocolSelector/template/GeneralTab.tsx
|
|
19286
|
-
import React182, { useEffect as
|
|
19324
|
+
import React182, { useEffect as useEffect53, useMemo as useMemo58, useState as useState69 } from "react";
|
|
19287
19325
|
import { Divider as Divider17, Stack as Stack126, Text as Text100, PillsInput as PillsInput2, Pill as Pill2, Box as Box35 } from "@mantine/core";
|
|
19288
19326
|
var GeneralTab11 = ({ title, description, protocolDids, onTitleChange, onDescriptionChange, onProtocolDidsChange }) => {
|
|
19289
|
-
const [localTitle, setLocalTitle] =
|
|
19290
|
-
const [localDescription, setLocalDescription] =
|
|
19291
|
-
const [inputValue, setInputValue] =
|
|
19327
|
+
const [localTitle, setLocalTitle] = useState69(title || "");
|
|
19328
|
+
const [localDescription, setLocalDescription] = useState69(description || "");
|
|
19329
|
+
const [inputValue, setInputValue] = useState69("");
|
|
19292
19330
|
const localDids = useMemo58(() => {
|
|
19293
19331
|
try {
|
|
19294
19332
|
const parsed = JSON.parse(protocolDids || "[]");
|
|
@@ -19297,10 +19335,10 @@ var GeneralTab11 = ({ title, description, protocolDids, onTitleChange, onDescrip
|
|
|
19297
19335
|
return [];
|
|
19298
19336
|
}
|
|
19299
19337
|
}, [protocolDids]);
|
|
19300
|
-
|
|
19338
|
+
useEffect53(() => {
|
|
19301
19339
|
setLocalTitle(title || "");
|
|
19302
19340
|
}, [title]);
|
|
19303
|
-
|
|
19341
|
+
useEffect53(() => {
|
|
19304
19342
|
setLocalDescription(description || "");
|
|
19305
19343
|
}, [description]);
|
|
19306
19344
|
const handleAddDid = () => {
|
|
@@ -19358,7 +19396,7 @@ var GeneralTab11 = ({ title, description, protocolDids, onTitleChange, onDescrip
|
|
|
19358
19396
|
// src/mantine/blocks/protocolSelector/template/TemplateConfig.tsx
|
|
19359
19397
|
var TemplateConfig11 = ({ editor, block }) => {
|
|
19360
19398
|
const { closePanel } = usePanelStore();
|
|
19361
|
-
const updateProp =
|
|
19399
|
+
const updateProp = useCallback53(
|
|
19362
19400
|
(key, value) => {
|
|
19363
19401
|
editor.updateBlock(block, {
|
|
19364
19402
|
props: {
|
|
@@ -19433,7 +19471,7 @@ import { Badge as Badge29, Box as Box38, Group as Group63, Stack as Stack129, Te
|
|
|
19433
19471
|
import { IconCircleDashed as IconCircleDashed3, IconChecks } from "@tabler/icons-react";
|
|
19434
19472
|
|
|
19435
19473
|
// src/mantine/blocks/protocolSelector/flow/ProtocolSelectionPanel.tsx
|
|
19436
|
-
import React186, { useState as
|
|
19474
|
+
import React186, { useState as useState70, useEffect as useEffect54, useMemo as useMemo60, useCallback as useCallback54 } from "react";
|
|
19437
19475
|
import { Stack as Stack128, Text as Text102, Box as Box37, Group as Group62, Loader as Loader25 } from "@mantine/core";
|
|
19438
19476
|
|
|
19439
19477
|
// src/icons/EntityAvatar.tsx
|
|
@@ -19471,8 +19509,8 @@ var ProtocolSelectionPanel = ({ editor, block }) => {
|
|
|
19471
19509
|
return [];
|
|
19472
19510
|
}
|
|
19473
19511
|
}, [block.props.protocolDids]);
|
|
19474
|
-
const [protocols, setProtocols] =
|
|
19475
|
-
|
|
19512
|
+
const [protocols, setProtocols] = useState70([]);
|
|
19513
|
+
useEffect54(() => {
|
|
19476
19514
|
if (protocolDids.length === 0) {
|
|
19477
19515
|
setProtocols([]);
|
|
19478
19516
|
return;
|
|
@@ -19540,7 +19578,7 @@ var ProtocolSelectionPanel = ({ editor, block }) => {
|
|
|
19540
19578
|
}
|
|
19541
19579
|
});
|
|
19542
19580
|
}, [protocolDids, handlers]);
|
|
19543
|
-
const handleSelectProtocol =
|
|
19581
|
+
const handleSelectProtocol = useCallback54(
|
|
19544
19582
|
(protocol) => {
|
|
19545
19583
|
editor.updateBlock(block, {
|
|
19546
19584
|
props: {
|
|
@@ -19696,22 +19734,22 @@ import React192, { useMemo as useMemo62 } from "react";
|
|
|
19696
19734
|
import { Badge as Badge30, Group as Group64, Stack as Stack130, Text as Text105 } from "@mantine/core";
|
|
19697
19735
|
|
|
19698
19736
|
// src/mantine/blocks/form/template/TemplateConfig.tsx
|
|
19699
|
-
import React191, { useCallback as
|
|
19737
|
+
import React191, { useCallback as useCallback55 } from "react";
|
|
19700
19738
|
import { Paper as Paper16, CloseButton as CloseButton6, Title as Title9 } from "@mantine/core";
|
|
19701
19739
|
|
|
19702
19740
|
// src/mantine/blocks/form/template/GeneralTab.tsx
|
|
19703
|
-
import React190, { useEffect as
|
|
19741
|
+
import React190, { useEffect as useEffect55, useState as useState71 } from "react";
|
|
19704
19742
|
import { Text as Text104 } from "@mantine/core";
|
|
19705
19743
|
var GeneralTab12 = ({ title, description, icon, surveySchema, onTitleChange, onDescriptionChange, onIconChange, onSurveySchemaChange }) => {
|
|
19706
|
-
const [localTitle, setLocalTitle] =
|
|
19707
|
-
const [localDescription, setLocalDescription] =
|
|
19708
|
-
const [localIcon, setLocalIcon] =
|
|
19709
|
-
const [localSchema, setLocalSchema] =
|
|
19710
|
-
const [schemaError, setSchemaError] =
|
|
19711
|
-
|
|
19712
|
-
|
|
19713
|
-
|
|
19714
|
-
|
|
19744
|
+
const [localTitle, setLocalTitle] = useState71(title || "");
|
|
19745
|
+
const [localDescription, setLocalDescription] = useState71(description || "");
|
|
19746
|
+
const [localIcon, setLocalIcon] = useState71(icon || "checklist");
|
|
19747
|
+
const [localSchema, setLocalSchema] = useState71(surveySchema || "");
|
|
19748
|
+
const [schemaError, setSchemaError] = useState71(null);
|
|
19749
|
+
useEffect55(() => setLocalTitle(title || ""), [title]);
|
|
19750
|
+
useEffect55(() => setLocalDescription(description || ""), [description]);
|
|
19751
|
+
useEffect55(() => setLocalIcon(icon || "checklist"), [icon]);
|
|
19752
|
+
useEffect55(() => setLocalSchema(surveySchema || ""), [surveySchema]);
|
|
19715
19753
|
const handleSchemaChange = (value) => {
|
|
19716
19754
|
setLocalSchema(value);
|
|
19717
19755
|
setSchemaError(null);
|
|
@@ -19781,7 +19819,7 @@ var GeneralTab12 = ({ title, description, icon, surveySchema, onTitleChange, onD
|
|
|
19781
19819
|
// src/mantine/blocks/form/template/TemplateConfig.tsx
|
|
19782
19820
|
var TemplateConfig12 = ({ editor, block }) => {
|
|
19783
19821
|
const { closePanel } = usePanelStore();
|
|
19784
|
-
const updateProp =
|
|
19822
|
+
const updateProp = useCallback55(
|
|
19785
19823
|
(key, value) => {
|
|
19786
19824
|
editor.updateBlock(block, {
|
|
19787
19825
|
props: {
|
|
@@ -19855,12 +19893,12 @@ var FormTemplateView = ({ editor, block }) => {
|
|
|
19855
19893
|
};
|
|
19856
19894
|
|
|
19857
19895
|
// src/mantine/blocks/form/flow/FlowView.tsx
|
|
19858
|
-
import React194, { useMemo as useMemo64, useState as
|
|
19896
|
+
import React194, { useMemo as useMemo64, useState as useState72, useCallback as useCallback57 } from "react";
|
|
19859
19897
|
import { ActionIcon as ActionIcon31, Badge as Badge31, Group as Group65, Stack as Stack131, Text as Text107, Tooltip as Tooltip19 } from "@mantine/core";
|
|
19860
19898
|
import { IconChevronRight as IconChevronRight7 } from "@tabler/icons-react";
|
|
19861
19899
|
|
|
19862
19900
|
// src/mantine/blocks/form/flow/FormPanel.tsx
|
|
19863
|
-
import React193, { useCallback as
|
|
19901
|
+
import React193, { useCallback as useCallback56, useEffect as useEffect56, useMemo as useMemo63, useRef as useRef15 } from "react";
|
|
19864
19902
|
import { Alert as Alert26, Text as Text106 } from "@mantine/core";
|
|
19865
19903
|
import { useDebouncedCallback as useDebouncedCallback2 } from "@mantine/hooks";
|
|
19866
19904
|
import { IconAlertCircle as IconAlertCircle10 } from "@tabler/icons-react";
|
|
@@ -19904,7 +19942,7 @@ var FormPanel = ({ editor, block, onComplete }) => {
|
|
|
19904
19942
|
model.completeText = "Complete";
|
|
19905
19943
|
return model;
|
|
19906
19944
|
}, [surveySchema]);
|
|
19907
|
-
const syncPropToSurvey =
|
|
19945
|
+
const syncPropToSurvey = useCallback56(
|
|
19908
19946
|
(answersJson) => {
|
|
19909
19947
|
if (!surveyModel || !answersJson || answersJson === lastSyncedAnswers.current) return;
|
|
19910
19948
|
try {
|
|
@@ -19936,13 +19974,13 @@ var FormPanel = ({ editor, block, onComplete }) => {
|
|
|
19936
19974
|
}
|
|
19937
19975
|
});
|
|
19938
19976
|
}, SYNC_DEBOUNCE_MS2);
|
|
19939
|
-
|
|
19977
|
+
useEffect56(() => {
|
|
19940
19978
|
const answersJson = block.props.answers;
|
|
19941
19979
|
if (answersJson) {
|
|
19942
19980
|
syncPropToSurvey(answersJson);
|
|
19943
19981
|
}
|
|
19944
19982
|
}, [block.props.answers, syncPropToSurvey]);
|
|
19945
|
-
|
|
19983
|
+
useEffect56(() => {
|
|
19946
19984
|
if (!surveyModel) return;
|
|
19947
19985
|
const handleValueChanged = () => {
|
|
19948
19986
|
if (isUpdatingFromProp.current) return;
|
|
@@ -19953,7 +19991,7 @@ var FormPanel = ({ editor, block, onComplete }) => {
|
|
|
19953
19991
|
surveyModel.onValueChanged.remove(handleValueChanged);
|
|
19954
19992
|
};
|
|
19955
19993
|
}, [surveyModel, syncSurveyToProp]);
|
|
19956
|
-
const handleSurveyComplete =
|
|
19994
|
+
const handleSurveyComplete = useCallback56(
|
|
19957
19995
|
(sender) => {
|
|
19958
19996
|
const data = sender.data || {};
|
|
19959
19997
|
const finalAnswersJson = JSON.stringify(data);
|
|
@@ -19970,14 +20008,14 @@ var FormPanel = ({ editor, block, onComplete }) => {
|
|
|
19970
20008
|
},
|
|
19971
20009
|
[editor, block, onComplete]
|
|
19972
20010
|
);
|
|
19973
|
-
|
|
20011
|
+
useEffect56(() => {
|
|
19974
20012
|
if (!surveyModel) return;
|
|
19975
20013
|
surveyModel.onComplete.add(handleSurveyComplete);
|
|
19976
20014
|
return () => {
|
|
19977
20015
|
surveyModel.onComplete.remove(handleSurveyComplete);
|
|
19978
20016
|
};
|
|
19979
20017
|
}, [handleSurveyComplete, surveyModel]);
|
|
19980
|
-
const handleClose =
|
|
20018
|
+
const handleClose = useCallback56(() => {
|
|
19981
20019
|
closePanel();
|
|
19982
20020
|
}, [closePanel]);
|
|
19983
20021
|
if (!surveySchema) {
|
|
@@ -19997,10 +20035,10 @@ var FormPanel = ({ editor, block, onComplete }) => {
|
|
|
19997
20035
|
// src/mantine/blocks/form/flow/FlowView.tsx
|
|
19998
20036
|
var FORM_FLOW_PANEL_ID = "form-flow-panel";
|
|
19999
20037
|
var FormFlowView = ({ editor, block }) => {
|
|
20000
|
-
const [hasOpened, setHasOpened] =
|
|
20038
|
+
const [hasOpened, setHasOpened] = useState72(false);
|
|
20001
20039
|
const status = block.props.status || "pending";
|
|
20002
20040
|
const isCompleted = status === "completed";
|
|
20003
|
-
const handleComplete =
|
|
20041
|
+
const handleComplete = useCallback57(() => {
|
|
20004
20042
|
editor.updateBlock(block, {
|
|
20005
20043
|
props: {
|
|
20006
20044
|
...block.props,
|
|
@@ -20095,17 +20133,17 @@ import React199, { useMemo as useMemo65 } from "react";
|
|
|
20095
20133
|
import { Badge as Badge32, Group as Group66, Stack as Stack132, Text as Text108 } from "@mantine/core";
|
|
20096
20134
|
|
|
20097
20135
|
// src/mantine/blocks/domainCreatorSign/template/TemplateConfig.tsx
|
|
20098
|
-
import React198, { useCallback as
|
|
20136
|
+
import React198, { useCallback as useCallback58 } from "react";
|
|
20099
20137
|
|
|
20100
20138
|
// src/mantine/blocks/domainCreatorSign/template/GeneralTab.tsx
|
|
20101
|
-
import React197, { useEffect as
|
|
20139
|
+
import React197, { useEffect as useEffect57, useState as useState73 } from "react";
|
|
20102
20140
|
var GeneralTab13 = ({ title, description, icon, onTitleChange, onDescriptionChange, onIconChange }) => {
|
|
20103
|
-
const [localTitle, setLocalTitle] =
|
|
20104
|
-
const [localDescription, setLocalDescription] =
|
|
20105
|
-
const [localIcon, setLocalIcon] =
|
|
20106
|
-
|
|
20107
|
-
|
|
20108
|
-
|
|
20141
|
+
const [localTitle, setLocalTitle] = useState73(title || "");
|
|
20142
|
+
const [localDescription, setLocalDescription] = useState73(description || "");
|
|
20143
|
+
const [localIcon, setLocalIcon] = useState73(icon || "file-text");
|
|
20144
|
+
useEffect57(() => setLocalTitle(title || ""), [title]);
|
|
20145
|
+
useEffect57(() => setLocalDescription(description || ""), [description]);
|
|
20146
|
+
useEffect57(() => setLocalIcon(icon || "file-text"), [icon]);
|
|
20109
20147
|
return /* @__PURE__ */ React197.createElement(BaseSection, null, /* @__PURE__ */ React197.createElement(
|
|
20110
20148
|
BaseTextInput,
|
|
20111
20149
|
{
|
|
@@ -20150,7 +20188,7 @@ var GeneralTab13 = ({ title, description, icon, onTitleChange, onDescriptionChan
|
|
|
20150
20188
|
// src/mantine/blocks/domainCreatorSign/template/TemplateConfig.tsx
|
|
20151
20189
|
var TemplateConfig13 = ({ editor, block }) => {
|
|
20152
20190
|
const { closePanel } = usePanelStore();
|
|
20153
|
-
const updateProp =
|
|
20191
|
+
const updateProp = useCallback58(
|
|
20154
20192
|
(key, value) => {
|
|
20155
20193
|
editor.updateBlock(block, {
|
|
20156
20194
|
props: {
|
|
@@ -20209,14 +20247,14 @@ var DomainCreatorSignTemplateView = ({ editor, block }) => {
|
|
|
20209
20247
|
};
|
|
20210
20248
|
|
|
20211
20249
|
// src/mantine/blocks/domainCreatorSign/flow/FlowView.tsx
|
|
20212
|
-
import React202, { useCallback as
|
|
20250
|
+
import React202, { useCallback as useCallback60, useMemo as useMemo66, useEffect as useEffect58 } from "react";
|
|
20213
20251
|
import { ActionIcon as ActionIcon32, Badge as Badge34, Group as Group69, Stack as Stack135, Text as Text111, Tooltip as Tooltip21 } from "@mantine/core";
|
|
20214
20252
|
import { IconChevronRight as IconChevronRight8 } from "@tabler/icons-react";
|
|
20215
20253
|
|
|
20216
20254
|
// src/mantine/blocks/domainCreatorSign/flow/SignPanel.tsx
|
|
20217
20255
|
import { Alert as Alert27, Button as Button34, Group as Group68, Loader as Loader26, Stack as Stack134, Text as Text110 } from "@mantine/core";
|
|
20218
20256
|
import { IconAlertCircle as IconAlertCircle11, IconCheck as IconCheck9 } from "@tabler/icons-react";
|
|
20219
|
-
import React201, { useCallback as
|
|
20257
|
+
import React201, { useCallback as useCallback59, useState as useState75 } from "react";
|
|
20220
20258
|
|
|
20221
20259
|
// src/mantine/blocks/domainCreatorSign/utils/buildLinkedEntityResource.ts
|
|
20222
20260
|
function parseLinkedEntities2(entitiesString) {
|
|
@@ -20239,11 +20277,11 @@ function buildGovernanceGroupLinkedEntities(linkedEntities) {
|
|
|
20239
20277
|
// src/mantine/components/Base/BaseSigning.tsx
|
|
20240
20278
|
import { Badge as Badge33, Box as Box39, Flex as Flex30, Group as Group67, Slider, Stack as Stack133, Tabs as Tabs4, Text as Text109, Tooltip as Tooltip20 } from "@mantine/core";
|
|
20241
20279
|
import { IconClock as IconClock2, IconFeather as IconFeather2, IconUsers as IconUsers3, IconArrowsExchange as IconArrowsExchange2, IconCalendar as IconCalendar2, IconLeaf as IconLeaf2, IconBolt } from "@tabler/icons-react";
|
|
20242
|
-
import React200, { useState as
|
|
20280
|
+
import React200, { useState as useState74 } from "react";
|
|
20243
20281
|
function BaseSigning({ handleSign }) {
|
|
20244
|
-
const [value, setValue] =
|
|
20245
|
-
const [isSigned, setIsSigned] =
|
|
20246
|
-
const [activeTab, setActiveTab] =
|
|
20282
|
+
const [value, setValue] = useState74(23);
|
|
20283
|
+
const [isSigned, setIsSigned] = useState74(false);
|
|
20284
|
+
const [activeTab, setActiveTab] = useState74("agents");
|
|
20247
20285
|
const handleSlideEnd = (sliderValue) => {
|
|
20248
20286
|
if (sliderValue >= 60) {
|
|
20249
20287
|
setValue(73);
|
|
@@ -20357,22 +20395,22 @@ function BaseSigning({ handleSign }) {
|
|
|
20357
20395
|
var SignPanel = ({ editor, block, onComplete, onError }) => {
|
|
20358
20396
|
const { closePanel } = usePanelStore();
|
|
20359
20397
|
const { handlers } = useBlocknoteContext();
|
|
20360
|
-
const [flowStep, setFlowStep] =
|
|
20361
|
-
const [error, setError] =
|
|
20362
|
-
const [createdEntityDid, setCreatedEntityDid] =
|
|
20363
|
-
const getDomainCardData =
|
|
20398
|
+
const [flowStep, setFlowStep] = useState75(block.props.status === "completed" ? "success" : block.props.status === "error" ? "error" : "ready");
|
|
20399
|
+
const [error, setError] = useState75(block.props.errorMessage || null);
|
|
20400
|
+
const [createdEntityDid, setCreatedEntityDid] = useState75(block.props.entityDid || null);
|
|
20401
|
+
const getDomainCardData = useCallback59(() => {
|
|
20364
20402
|
try {
|
|
20365
20403
|
return JSON.parse(block.props.domainCardData || "{}");
|
|
20366
20404
|
} catch {
|
|
20367
20405
|
return null;
|
|
20368
20406
|
}
|
|
20369
20407
|
}, [block.props.domainCardData]);
|
|
20370
|
-
const getDate100YearsFromNow =
|
|
20408
|
+
const getDate100YearsFromNow = useCallback59(() => {
|
|
20371
20409
|
const date = /* @__PURE__ */ new Date();
|
|
20372
20410
|
date.setFullYear(date.getFullYear() + 100);
|
|
20373
20411
|
return date.toISOString();
|
|
20374
20412
|
}, []);
|
|
20375
|
-
const processSignAndCreate =
|
|
20413
|
+
const processSignAndCreate = useCallback59(async () => {
|
|
20376
20414
|
if (!handlers) {
|
|
20377
20415
|
throw new Error("Handlers not available");
|
|
20378
20416
|
}
|
|
@@ -20460,7 +20498,7 @@ var SignPanel = ({ editor, block, onComplete, onError }) => {
|
|
|
20460
20498
|
transactionHash
|
|
20461
20499
|
};
|
|
20462
20500
|
}, [handlers, getDomainCardData, block, editor, getDate100YearsFromNow]);
|
|
20463
|
-
const handleSign =
|
|
20501
|
+
const handleSign = useCallback59(async () => {
|
|
20464
20502
|
try {
|
|
20465
20503
|
const result = await processSignAndCreate();
|
|
20466
20504
|
setCreatedEntityDid(result.entityDid);
|
|
@@ -20474,7 +20512,7 @@ var SignPanel = ({ editor, block, onComplete, onError }) => {
|
|
|
20474
20512
|
onError?.(errorMessage);
|
|
20475
20513
|
}
|
|
20476
20514
|
}, [processSignAndCreate, onComplete, onError]);
|
|
20477
|
-
const handleRetry =
|
|
20515
|
+
const handleRetry = useCallback59(() => {
|
|
20478
20516
|
setFlowStep("ready");
|
|
20479
20517
|
setError(null);
|
|
20480
20518
|
editor.updateBlock(block, {
|
|
@@ -20485,10 +20523,10 @@ var SignPanel = ({ editor, block, onComplete, onError }) => {
|
|
|
20485
20523
|
}
|
|
20486
20524
|
});
|
|
20487
20525
|
}, [editor, block]);
|
|
20488
|
-
const handleClose =
|
|
20526
|
+
const handleClose = useCallback59(() => {
|
|
20489
20527
|
closePanel();
|
|
20490
20528
|
}, [closePanel]);
|
|
20491
|
-
const handleVisitEntity =
|
|
20529
|
+
const handleVisitEntity = useCallback59(() => {
|
|
20492
20530
|
const entityType = block.props.entityType || "dao";
|
|
20493
20531
|
if (createdEntityDid && handlers?.redirectToEntityOverview) {
|
|
20494
20532
|
handlers.redirectToEntityOverview(createdEntityDid, entityType);
|
|
@@ -20536,7 +20574,7 @@ var DomainCreatorSignFlowView = ({ editor, block }) => {
|
|
|
20536
20574
|
const status = block.props.status || "pending";
|
|
20537
20575
|
const domainCardData = block.props.domainCardData || "{}";
|
|
20538
20576
|
const isDataReady = isDomainCardDataReady(domainCardData);
|
|
20539
|
-
|
|
20577
|
+
useEffect58(() => {
|
|
20540
20578
|
if (status === "pending" && isDataReady) {
|
|
20541
20579
|
editor.updateBlock(block, {
|
|
20542
20580
|
props: {
|
|
@@ -20546,7 +20584,7 @@ var DomainCreatorSignFlowView = ({ editor, block }) => {
|
|
|
20546
20584
|
});
|
|
20547
20585
|
}
|
|
20548
20586
|
}, [isDataReady, status, editor, block]);
|
|
20549
|
-
const handleComplete =
|
|
20587
|
+
const handleComplete = useCallback60(
|
|
20550
20588
|
(result) => {
|
|
20551
20589
|
editor.updateBlock(block, {
|
|
20552
20590
|
props: {
|
|
@@ -20559,7 +20597,7 @@ var DomainCreatorSignFlowView = ({ editor, block }) => {
|
|
|
20559
20597
|
},
|
|
20560
20598
|
[editor, block]
|
|
20561
20599
|
);
|
|
20562
|
-
const handleError =
|
|
20600
|
+
const handleError = useCallback60(
|
|
20563
20601
|
(errorMessage) => {
|
|
20564
20602
|
editor.updateBlock(block, {
|
|
20565
20603
|
props: {
|
|
@@ -20684,18 +20722,18 @@ import React207, { useMemo as useMemo67 } from "react";
|
|
|
20684
20722
|
import { Badge as Badge35, Group as Group70, Stack as Stack136, Text as Text112 } from "@mantine/core";
|
|
20685
20723
|
|
|
20686
20724
|
// src/mantine/blocks/domainCardViewer/template/TemplateConfig.tsx
|
|
20687
|
-
import React206, { useCallback as
|
|
20725
|
+
import React206, { useCallback as useCallback61 } from "react";
|
|
20688
20726
|
import { Paper as Paper17, CloseButton as CloseButton7, Title as Title10 } from "@mantine/core";
|
|
20689
20727
|
|
|
20690
20728
|
// src/mantine/blocks/domainCardViewer/template/GeneralTab.tsx
|
|
20691
|
-
import React205, { useEffect as
|
|
20729
|
+
import React205, { useEffect as useEffect59, useState as useState76 } from "react";
|
|
20692
20730
|
var GeneralTab14 = ({ title, description, icon, onTitleChange, onDescriptionChange, onIconChange }) => {
|
|
20693
|
-
const [localTitle, setLocalTitle] =
|
|
20694
|
-
const [localDescription, setLocalDescription] =
|
|
20695
|
-
const [localIcon, setLocalIcon] =
|
|
20696
|
-
|
|
20697
|
-
|
|
20698
|
-
|
|
20731
|
+
const [localTitle, setLocalTitle] = useState76(title || "");
|
|
20732
|
+
const [localDescription, setLocalDescription] = useState76(description || "");
|
|
20733
|
+
const [localIcon, setLocalIcon] = useState76(icon || "dots-circle");
|
|
20734
|
+
useEffect59(() => setLocalTitle(title || ""), [title]);
|
|
20735
|
+
useEffect59(() => setLocalDescription(description || ""), [description]);
|
|
20736
|
+
useEffect59(() => setLocalIcon(icon || "dots-circle"), [icon]);
|
|
20699
20737
|
return /* @__PURE__ */ React205.createElement(BaseSection, null, /* @__PURE__ */ React205.createElement(
|
|
20700
20738
|
BaseTextInput,
|
|
20701
20739
|
{
|
|
@@ -20740,7 +20778,7 @@ var GeneralTab14 = ({ title, description, icon, onTitleChange, onDescriptionChan
|
|
|
20740
20778
|
// src/mantine/blocks/domainCardViewer/template/TemplateConfig.tsx
|
|
20741
20779
|
var TemplateConfig14 = ({ editor, block }) => {
|
|
20742
20780
|
const { closePanel } = usePanelStore();
|
|
20743
|
-
const updateProp =
|
|
20781
|
+
const updateProp = useCallback61(
|
|
20744
20782
|
(key, value) => {
|
|
20745
20783
|
editor.updateBlock(block, {
|
|
20746
20784
|
props: {
|
|
@@ -20811,7 +20849,7 @@ var DomainCardViewerTemplateView = ({ editor, block }) => {
|
|
|
20811
20849
|
};
|
|
20812
20850
|
|
|
20813
20851
|
// src/mantine/blocks/domainCardViewer/flow/FlowView.tsx
|
|
20814
|
-
import React209, { useMemo as useMemo69, useCallback as
|
|
20852
|
+
import React209, { useMemo as useMemo69, useCallback as useCallback62, useEffect as useEffect60 } from "react";
|
|
20815
20853
|
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";
|
|
20816
20854
|
import { IconChevronRight as IconChevronRight9, IconLoader, IconTestPipe, IconTrash as IconTrash6 } from "@tabler/icons-react";
|
|
20817
20855
|
|
|
@@ -21126,7 +21164,7 @@ var DomainCardViewerFlowView = ({ editor, block }) => {
|
|
|
21126
21164
|
const status = block.props.status || "pending";
|
|
21127
21165
|
const domainPreviewData = block.props.domainPreviewData || "{}";
|
|
21128
21166
|
const isDataReady = isPreviewDataReady(domainPreviewData);
|
|
21129
|
-
|
|
21167
|
+
useEffect60(() => {
|
|
21130
21168
|
if (status === "pending" && isDataReady) {
|
|
21131
21169
|
editor.updateBlock(block, {
|
|
21132
21170
|
props: {
|
|
@@ -21136,7 +21174,7 @@ var DomainCardViewerFlowView = ({ editor, block }) => {
|
|
|
21136
21174
|
});
|
|
21137
21175
|
}
|
|
21138
21176
|
}, [isDataReady, status, editor, block]);
|
|
21139
|
-
const handleApprove =
|
|
21177
|
+
const handleApprove = useCallback62(() => {
|
|
21140
21178
|
editor.updateBlock(block, {
|
|
21141
21179
|
props: {
|
|
21142
21180
|
...block.props,
|
|
@@ -21147,7 +21185,7 @@ var DomainCardViewerFlowView = ({ editor, block }) => {
|
|
|
21147
21185
|
const panelId = `${DOMAIN_CARD_VIEWER_FLOW_PANEL_ID}-${block.id}`;
|
|
21148
21186
|
const panelContent = useMemo69(() => /* @__PURE__ */ React209.createElement(ViewerPanel, { editor, block, onApprove: handleApprove }), [editor, block, handleApprove]);
|
|
21149
21187
|
const { open } = usePanel(panelId, panelContent);
|
|
21150
|
-
const handleInjectDummyData =
|
|
21188
|
+
const handleInjectDummyData = useCallback62(
|
|
21151
21189
|
(e) => {
|
|
21152
21190
|
e.stopPropagation();
|
|
21153
21191
|
editor.updateBlock(block, {
|
|
@@ -21163,7 +21201,7 @@ var DomainCardViewerFlowView = ({ editor, block }) => {
|
|
|
21163
21201
|
},
|
|
21164
21202
|
[editor, block]
|
|
21165
21203
|
);
|
|
21166
|
-
const handleSetLoading =
|
|
21204
|
+
const handleSetLoading = useCallback62(
|
|
21167
21205
|
(e) => {
|
|
21168
21206
|
e.stopPropagation();
|
|
21169
21207
|
editor.updateBlock(block, {
|
|
@@ -21176,7 +21214,7 @@ var DomainCardViewerFlowView = ({ editor, block }) => {
|
|
|
21176
21214
|
},
|
|
21177
21215
|
[editor, block]
|
|
21178
21216
|
);
|
|
21179
|
-
const handleClearData =
|
|
21217
|
+
const handleClearData = useCallback62(
|
|
21180
21218
|
(e) => {
|
|
21181
21219
|
e.stopPropagation();
|
|
21182
21220
|
editor.updateBlock(block, {
|
|
@@ -21279,10 +21317,10 @@ import React214, { useMemo as useMemo70 } from "react";
|
|
|
21279
21317
|
import { Badge as Badge37, Group as Group72, Stack as Stack140, Text as Text116 } from "@mantine/core";
|
|
21280
21318
|
|
|
21281
21319
|
// src/mantine/blocks/governanceGroup/template/TemplateConfig.tsx
|
|
21282
|
-
import React213, { useCallback as
|
|
21320
|
+
import React213, { useCallback as useCallback63 } from "react";
|
|
21283
21321
|
|
|
21284
21322
|
// src/mantine/blocks/governanceGroup/template/GeneralTab.tsx
|
|
21285
|
-
import React212, { useEffect as
|
|
21323
|
+
import React212, { useEffect as useEffect61, useState as useState77 } from "react";
|
|
21286
21324
|
import { Card as Card19, SimpleGrid as SimpleGrid2, Stack as Stack139, Text as Text115, ThemeIcon as ThemeIcon3 } from "@mantine/core";
|
|
21287
21325
|
import { IconUsers as IconUsers4, IconSignature, IconPhoto as IconPhoto2, IconCoin } from "@tabler/icons-react";
|
|
21288
21326
|
|
|
@@ -21322,12 +21360,12 @@ var GROUP_TYPE_ICONS = {
|
|
|
21322
21360
|
tokenStaking: /* @__PURE__ */ React212.createElement(IconCoin, { size: 20 })
|
|
21323
21361
|
};
|
|
21324
21362
|
var GeneralTab15 = ({ title, description, icon, groupType, onTitleChange, onDescriptionChange, onIconChange, onGroupTypeChange }) => {
|
|
21325
|
-
const [localTitle, setLocalTitle] =
|
|
21326
|
-
const [localDescription, setLocalDescription] =
|
|
21327
|
-
const [localIcon, setLocalIcon] =
|
|
21328
|
-
|
|
21329
|
-
|
|
21330
|
-
|
|
21363
|
+
const [localTitle, setLocalTitle] = useState77(title || "");
|
|
21364
|
+
const [localDescription, setLocalDescription] = useState77(description || "");
|
|
21365
|
+
const [localIcon, setLocalIcon] = useState77(icon || "users");
|
|
21366
|
+
useEffect61(() => setLocalTitle(title || ""), [title]);
|
|
21367
|
+
useEffect61(() => setLocalDescription(description || ""), [description]);
|
|
21368
|
+
useEffect61(() => setLocalIcon(icon || "users"), [icon]);
|
|
21331
21369
|
return /* @__PURE__ */ React212.createElement(BaseSection, null, /* @__PURE__ */ React212.createElement(Stack139, { gap: "md" }, /* @__PURE__ */ React212.createElement(Text115, { size: "sm", fw: 500 }, "Group Type"), /* @__PURE__ */ React212.createElement(SimpleGrid2, { cols: 2, spacing: "sm" }, GROUP_TYPE_CONFIGS.map((config) => {
|
|
21332
21370
|
const isSelected = groupType === config.type;
|
|
21333
21371
|
return /* @__PURE__ */ React212.createElement(
|
|
@@ -22115,7 +22153,7 @@ var getSurveyForGroupType = (groupType) => {
|
|
|
22115
22153
|
// src/mantine/blocks/governanceGroup/template/TemplateConfig.tsx
|
|
22116
22154
|
var TemplateConfig15 = ({ editor, block }) => {
|
|
22117
22155
|
const { closePanel } = usePanelStore();
|
|
22118
|
-
const updateProp =
|
|
22156
|
+
const updateProp = useCallback63(
|
|
22119
22157
|
(key, value) => {
|
|
22120
22158
|
editor.updateBlock(block, {
|
|
22121
22159
|
props: {
|
|
@@ -22126,7 +22164,7 @@ var TemplateConfig15 = ({ editor, block }) => {
|
|
|
22126
22164
|
},
|
|
22127
22165
|
[editor, block]
|
|
22128
22166
|
);
|
|
22129
|
-
const handleGroupTypeChange =
|
|
22167
|
+
const handleGroupTypeChange = useCallback63(
|
|
22130
22168
|
(groupType) => {
|
|
22131
22169
|
const surveySchema = getSurveyForGroupType(groupType);
|
|
22132
22170
|
editor.updateBlock(block, {
|
|
@@ -22196,12 +22234,12 @@ var GovernanceGroupTemplateView = ({ editor, block }) => {
|
|
|
22196
22234
|
};
|
|
22197
22235
|
|
|
22198
22236
|
// src/mantine/blocks/governanceGroup/flow/FlowView.tsx
|
|
22199
|
-
import React216, { useCallback as
|
|
22237
|
+
import React216, { useCallback as useCallback65, useEffect as useEffect63, useMemo as useMemo72, useRef as useRef17, useState as useState79 } from "react";
|
|
22200
22238
|
import { ActionIcon as ActionIcon34, Badge as Badge38, Group as Group74, Stack as Stack142, Text as Text118, Tooltip as Tooltip23 } from "@mantine/core";
|
|
22201
22239
|
import { IconChevronRight as IconChevronRight10 } from "@tabler/icons-react";
|
|
22202
22240
|
|
|
22203
22241
|
// src/mantine/blocks/governanceGroup/flow/GovernanceGroupPanel.tsx
|
|
22204
|
-
import React215, { useCallback as
|
|
22242
|
+
import React215, { useCallback as useCallback64, useEffect as useEffect62, useMemo as useMemo71, useRef as useRef16, useState as useState78 } from "react";
|
|
22205
22243
|
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";
|
|
22206
22244
|
import { useDebouncedCallback as useDebouncedCallback3 } from "@mantine/hooks";
|
|
22207
22245
|
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";
|
|
@@ -22241,11 +22279,11 @@ var GovernanceGroupPanel = ({ editor, block, onComplete }) => {
|
|
|
22241
22279
|
if (existingGroupType) return "survey";
|
|
22242
22280
|
return "typeSelection";
|
|
22243
22281
|
};
|
|
22244
|
-
const [flowStep, setFlowStep] =
|
|
22245
|
-
const [selectedGroupType, setSelectedGroupType] =
|
|
22246
|
-
const [error, setError] =
|
|
22247
|
-
const [createdCoreAddress, setCreatedCoreAddress] =
|
|
22248
|
-
const [createdGroupAddress, setCreatedGroupAddress] =
|
|
22282
|
+
const [flowStep, setFlowStep] = useState78(getInitialFlowStep);
|
|
22283
|
+
const [selectedGroupType, setSelectedGroupType] = useState78(existingGroupType || null);
|
|
22284
|
+
const [error, setError] = useState78(null);
|
|
22285
|
+
const [createdCoreAddress, setCreatedCoreAddress] = useState78(existingCoreAddress || null);
|
|
22286
|
+
const [createdGroupAddress, setCreatedGroupAddress] = useState78(block.props.groupAddress || null);
|
|
22249
22287
|
const isUpdatingFromProp = useRef16(false);
|
|
22250
22288
|
const lastSyncedAnswers = useRef16("");
|
|
22251
22289
|
const surveyModel = useMemo71(() => {
|
|
@@ -22258,7 +22296,7 @@ var GovernanceGroupPanel = ({ editor, block, onComplete }) => {
|
|
|
22258
22296
|
model.questionsOnPageMode = "singlePage";
|
|
22259
22297
|
return model;
|
|
22260
22298
|
}, [selectedGroupType]);
|
|
22261
|
-
const syncPropToSurvey =
|
|
22299
|
+
const syncPropToSurvey = useCallback64(
|
|
22262
22300
|
(answersJson) => {
|
|
22263
22301
|
if (!answersJson || answersJson === lastSyncedAnswers.current || !surveyModel) return;
|
|
22264
22302
|
try {
|
|
@@ -22290,13 +22328,13 @@ var GovernanceGroupPanel = ({ editor, block, onComplete }) => {
|
|
|
22290
22328
|
}
|
|
22291
22329
|
});
|
|
22292
22330
|
}, SYNC_DEBOUNCE_MS3);
|
|
22293
|
-
|
|
22331
|
+
useEffect62(() => {
|
|
22294
22332
|
const answersJson = block.props.answers;
|
|
22295
22333
|
if (answersJson && surveyModel) {
|
|
22296
22334
|
syncPropToSurvey(answersJson);
|
|
22297
22335
|
}
|
|
22298
22336
|
}, [block.props.answers, syncPropToSurvey, surveyModel]);
|
|
22299
|
-
|
|
22337
|
+
useEffect62(() => {
|
|
22300
22338
|
if (!surveyModel) return;
|
|
22301
22339
|
const handleValueChanged = () => {
|
|
22302
22340
|
if (isUpdatingFromProp.current) return;
|
|
@@ -22321,7 +22359,7 @@ var GovernanceGroupPanel = ({ editor, block, onComplete }) => {
|
|
|
22321
22359
|
lastSyncedAnswers.current = "";
|
|
22322
22360
|
setFlowStep("survey");
|
|
22323
22361
|
};
|
|
22324
|
-
const processGroupCreation =
|
|
22362
|
+
const processGroupCreation = useCallback64(
|
|
22325
22363
|
async (data) => {
|
|
22326
22364
|
if (!handlers) {
|
|
22327
22365
|
throw new Error("Handlers not available");
|
|
@@ -22343,7 +22381,7 @@ var GovernanceGroupPanel = ({ editor, block, onComplete }) => {
|
|
|
22343
22381
|
},
|
|
22344
22382
|
[handlers, selectedGroupType]
|
|
22345
22383
|
);
|
|
22346
|
-
const handleSurveyComplete =
|
|
22384
|
+
const handleSurveyComplete = useCallback64(
|
|
22347
22385
|
async (sender) => {
|
|
22348
22386
|
const data = sender.data || {};
|
|
22349
22387
|
try {
|
|
@@ -22380,19 +22418,19 @@ var GovernanceGroupPanel = ({ editor, block, onComplete }) => {
|
|
|
22380
22418
|
},
|
|
22381
22419
|
[processGroupCreation, onComplete, editor, block, selectedGroupType]
|
|
22382
22420
|
);
|
|
22383
|
-
|
|
22421
|
+
useEffect62(() => {
|
|
22384
22422
|
if (!surveyModel) return;
|
|
22385
22423
|
surveyModel.onComplete.add(handleSurveyComplete);
|
|
22386
22424
|
return () => {
|
|
22387
22425
|
surveyModel.onComplete.remove(handleSurveyComplete);
|
|
22388
22426
|
};
|
|
22389
22427
|
}, [handleSurveyComplete, surveyModel]);
|
|
22390
|
-
const handleRetry =
|
|
22428
|
+
const handleRetry = useCallback64(() => {
|
|
22391
22429
|
setFlowStep("survey");
|
|
22392
22430
|
setError(null);
|
|
22393
22431
|
surveyModel?.clear();
|
|
22394
22432
|
}, [surveyModel]);
|
|
22395
|
-
const handleBackToTypeSelection =
|
|
22433
|
+
const handleBackToTypeSelection = useCallback64(() => {
|
|
22396
22434
|
setSelectedGroupType(null);
|
|
22397
22435
|
setFlowStep("typeSelection");
|
|
22398
22436
|
editor.updateBlock(block, {
|
|
@@ -22404,7 +22442,7 @@ var GovernanceGroupPanel = ({ editor, block, onComplete }) => {
|
|
|
22404
22442
|
}
|
|
22405
22443
|
});
|
|
22406
22444
|
}, [editor, block]);
|
|
22407
|
-
const handleClose =
|
|
22445
|
+
const handleClose = useCallback64(() => {
|
|
22408
22446
|
closePanel();
|
|
22409
22447
|
}, [closePanel]);
|
|
22410
22448
|
if (flowStep === "typeSelection") {
|
|
@@ -22447,13 +22485,13 @@ var GovernanceGroupPanel = ({ editor, block, onComplete }) => {
|
|
|
22447
22485
|
// src/mantine/blocks/governanceGroup/flow/FlowView.tsx
|
|
22448
22486
|
var GOVERNANCE_GROUP_FLOW_PANEL_ID = "governance-group-flow-panel";
|
|
22449
22487
|
var GovernanceGroupFlowView = ({ editor, block }) => {
|
|
22450
|
-
const [hasOpened, setHasOpened] =
|
|
22451
|
-
const [submissionStatus, setSubmissionStatus] =
|
|
22488
|
+
const [hasOpened, setHasOpened] = useState79(false);
|
|
22489
|
+
const [submissionStatus, setSubmissionStatus] = useState79("idle");
|
|
22452
22490
|
const lastSubmission = block.props.lastSubmission ? JSON.parse(block.props.lastSubmission) : null;
|
|
22453
22491
|
const hasExistingSubmission = lastSubmission?.coreAddress;
|
|
22454
22492
|
const editorRef = useRef17(editor);
|
|
22455
22493
|
const blockRef = useRef17(block);
|
|
22456
|
-
|
|
22494
|
+
useEffect63(() => {
|
|
22457
22495
|
editorRef.current = editor;
|
|
22458
22496
|
blockRef.current = block;
|
|
22459
22497
|
});
|
|
@@ -22476,7 +22514,7 @@ var GovernanceGroupFlowView = ({ editor, block }) => {
|
|
|
22476
22514
|
[]
|
|
22477
22515
|
);
|
|
22478
22516
|
const handleCompleteRef = useRef17();
|
|
22479
|
-
const handleComplete =
|
|
22517
|
+
const handleComplete = useCallback65((data) => {
|
|
22480
22518
|
const currentEditor = editorRef.current;
|
|
22481
22519
|
const currentBlock = blockRef.current;
|
|
22482
22520
|
currentEditor.updateBlock(currentBlock, {
|
|
@@ -22496,10 +22534,10 @@ var GovernanceGroupFlowView = ({ editor, block }) => {
|
|
|
22496
22534
|
});
|
|
22497
22535
|
setSubmissionStatus("success");
|
|
22498
22536
|
}, []);
|
|
22499
|
-
|
|
22537
|
+
useEffect63(() => {
|
|
22500
22538
|
handleCompleteRef.current = handleComplete;
|
|
22501
22539
|
});
|
|
22502
|
-
const stableHandleComplete =
|
|
22540
|
+
const stableHandleComplete = useCallback65(
|
|
22503
22541
|
(data) => {
|
|
22504
22542
|
handleCompleteRef.current?.(data);
|
|
22505
22543
|
},
|
|
@@ -22643,14 +22681,14 @@ function generateId(prefix) {
|
|
|
22643
22681
|
}
|
|
22644
22682
|
|
|
22645
22683
|
// src/mantine/blocks/flowLink/template/WorkspacePageSelector.tsx
|
|
22646
|
-
import React220, { useEffect as
|
|
22684
|
+
import React220, { useEffect as useEffect64, useState as useState80 } from "react";
|
|
22647
22685
|
import { Loader as Loader29, Alert as Alert30 } from "@mantine/core";
|
|
22648
22686
|
var WorkspacePageSelector = ({ selectedPageId, onSelect }) => {
|
|
22649
22687
|
const handlers = useBlocknoteHandlers();
|
|
22650
|
-
const [pages, setPages] =
|
|
22651
|
-
const [loading, setLoading] =
|
|
22652
|
-
const [error, setError] =
|
|
22653
|
-
|
|
22688
|
+
const [pages, setPages] = useState80([]);
|
|
22689
|
+
const [loading, setLoading] = useState80(false);
|
|
22690
|
+
const [error, setError] = useState80(null);
|
|
22691
|
+
useEffect64(() => {
|
|
22654
22692
|
const fetchPages = async () => {
|
|
22655
22693
|
if (!handlers.getWorkspacePages) {
|
|
22656
22694
|
setError("Workspace pages not supported");
|
|
@@ -22870,15 +22908,15 @@ import React225, { useMemo as useMemo75 } from "react";
|
|
|
22870
22908
|
import { Badge as Badge40, Group as Group78, Stack as Stack147, Text as Text122, Tooltip as Tooltip25 } from "@mantine/core";
|
|
22871
22909
|
|
|
22872
22910
|
// src/mantine/blocks/flowLink/flow/FlowLinkPanel.tsx
|
|
22873
|
-
import React224, { useState as
|
|
22911
|
+
import React224, { useState as useState81, useEffect as useEffect65, useCallback as useCallback66 } from "react";
|
|
22874
22912
|
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";
|
|
22875
22913
|
import { IconRefresh as IconRefresh7, IconCheck as IconCheck12, IconClock as IconClock3, IconCircleDashed as IconCircleDashed4 } from "@tabler/icons-react";
|
|
22876
22914
|
var FlowLinkPanel = ({ block }) => {
|
|
22877
22915
|
const { closePanel } = usePanelStore();
|
|
22878
22916
|
const handlers = useBlocknoteHandlers();
|
|
22879
22917
|
const links = safeParseJSONArray(block.props.links).sort((a, b) => a.position - b.position);
|
|
22880
|
-
const [linksWithStatus, setLinksWithStatus] =
|
|
22881
|
-
const fetchStatuses =
|
|
22918
|
+
const [linksWithStatus, setLinksWithStatus] = useState81(links.map((link) => ({ ...link })));
|
|
22919
|
+
const fetchStatuses = useCallback66(async () => {
|
|
22882
22920
|
if (!handlers.getFlowStatus) {
|
|
22883
22921
|
return;
|
|
22884
22922
|
}
|
|
@@ -22895,7 +22933,7 @@ var FlowLinkPanel = ({ block }) => {
|
|
|
22895
22933
|
);
|
|
22896
22934
|
setLinksWithStatus(updatedLinks);
|
|
22897
22935
|
}, [handlers, links]);
|
|
22898
|
-
|
|
22936
|
+
useEffect65(() => {
|
|
22899
22937
|
fetchStatuses();
|
|
22900
22938
|
}, []);
|
|
22901
22939
|
const handleNavigate = (link) => {
|
|
@@ -23196,7 +23234,7 @@ blockRegistry.register({
|
|
|
23196
23234
|
});
|
|
23197
23235
|
|
|
23198
23236
|
// src/mantine/blocks/hooks/useBlockDependencies.ts
|
|
23199
|
-
import { useMemo as useMemo76, useEffect as
|
|
23237
|
+
import { useMemo as useMemo76, useEffect as useEffect66, useState as useState82, useCallback as useCallback67 } from "react";
|
|
23200
23238
|
|
|
23201
23239
|
// src/mantine/blocks/hooks/useDependsOn.ts
|
|
23202
23240
|
import { useMemo as useMemo77 } from "react";
|
|
@@ -23766,11 +23804,11 @@ import { useCreateBlockNote as useCreateBlockNote2 } from "@blocknote/react";
|
|
|
23766
23804
|
import { BlockNoteSchema as BlockNoteSchema2, defaultBlockSpecs as defaultBlockSpecs2, defaultInlineContentSpecs as defaultInlineContentSpecs2, defaultStyleSpecs as defaultStyleSpecs2 } from "@blocknote/core";
|
|
23767
23805
|
|
|
23768
23806
|
// src/core/hooks/useMatrixProvider.ts
|
|
23769
|
-
import { useEffect as
|
|
23807
|
+
import { useEffect as useEffect67, useState as useState83, useRef as useRef18, useCallback as useCallback68, useMemo as useMemo78 } from "react";
|
|
23770
23808
|
import { MatrixProvider } from "@ixo/matrix-crdt";
|
|
23771
23809
|
function useMatrixProvider({ matrixClient, roomId, yDoc }) {
|
|
23772
|
-
const [matrixProvider, setProvider] =
|
|
23773
|
-
const [status, setStatus] =
|
|
23810
|
+
const [matrixProvider, setProvider] = useState83(null);
|
|
23811
|
+
const [status, setStatus] = useState83("disconnected");
|
|
23774
23812
|
const isMountedRef = useRef18(true);
|
|
23775
23813
|
const providerRef = useRef18(null);
|
|
23776
23814
|
const retryTimeoutRef = useRef18(null);
|
|
@@ -23787,22 +23825,22 @@ function useMatrixProvider({ matrixClient, roomId, yDoc }) {
|
|
|
23787
23825
|
}),
|
|
23788
23826
|
[]
|
|
23789
23827
|
);
|
|
23790
|
-
const handleDocumentAvailable =
|
|
23828
|
+
const handleDocumentAvailable = useCallback68(() => {
|
|
23791
23829
|
if (isMountedRef.current) {
|
|
23792
23830
|
setStatus("connected");
|
|
23793
23831
|
}
|
|
23794
23832
|
}, []);
|
|
23795
|
-
const handleDocumentUnavailable =
|
|
23833
|
+
const handleDocumentUnavailable = useCallback68(() => {
|
|
23796
23834
|
if (isMountedRef.current) {
|
|
23797
23835
|
setStatus("failed");
|
|
23798
23836
|
}
|
|
23799
23837
|
}, []);
|
|
23800
|
-
const handleCanWriteChanged =
|
|
23838
|
+
const handleCanWriteChanged = useCallback68(() => {
|
|
23801
23839
|
if (isMountedRef.current && providerRef.current) {
|
|
23802
23840
|
setStatus(providerRef.current.canWrite ? "connected" : "failed");
|
|
23803
23841
|
}
|
|
23804
23842
|
}, []);
|
|
23805
|
-
const initProvider =
|
|
23843
|
+
const initProvider = useCallback68(async () => {
|
|
23806
23844
|
if (!isMountedRef.current) return;
|
|
23807
23845
|
if (retryTimeoutRef.current) {
|
|
23808
23846
|
clearTimeout(retryTimeoutRef.current);
|
|
@@ -23835,7 +23873,7 @@ function useMatrixProvider({ matrixClient, roomId, yDoc }) {
|
|
|
23835
23873
|
}
|
|
23836
23874
|
}
|
|
23837
23875
|
}, [matrixClient, providerOptions, handleDocumentAvailable, handleDocumentUnavailable, handleCanWriteChanged]);
|
|
23838
|
-
|
|
23876
|
+
useEffect67(() => {
|
|
23839
23877
|
isMountedRef.current = true;
|
|
23840
23878
|
initProvider();
|
|
23841
23879
|
return () => {
|
|
@@ -23852,7 +23890,7 @@ function useMatrixProvider({ matrixClient, roomId, yDoc }) {
|
|
|
23852
23890
|
setStatus("disconnected");
|
|
23853
23891
|
};
|
|
23854
23892
|
}, [initProvider]);
|
|
23855
|
-
|
|
23893
|
+
useEffect67(() => {
|
|
23856
23894
|
return () => {
|
|
23857
23895
|
isMountedRef.current = false;
|
|
23858
23896
|
};
|
|
@@ -23871,7 +23909,7 @@ function useCollaborativeYDoc(_options) {
|
|
|
23871
23909
|
}
|
|
23872
23910
|
|
|
23873
23911
|
// src/mantine/hooks/useCollaborativeIxoEditor.ts
|
|
23874
|
-
import { useMemo as useMemo80, useEffect as
|
|
23912
|
+
import { useMemo as useMemo80, useEffect as useEffect68, useState as useState84 } from "react";
|
|
23875
23913
|
|
|
23876
23914
|
// src/core/lib/matrixMetadata.ts
|
|
23877
23915
|
var COVER_IMAGE_EVENT_TYPE = "ixo.page.cover_image";
|
|
@@ -24056,7 +24094,7 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
24056
24094
|
roomId: options.roomId
|
|
24057
24095
|
});
|
|
24058
24096
|
const metadataManager = useMemo80(() => new MatrixMetadataManager(matrixClient, options.roomId), [matrixClient, options.roomId]);
|
|
24059
|
-
|
|
24097
|
+
useEffect68(() => {
|
|
24060
24098
|
return () => {
|
|
24061
24099
|
metadataManager.dispose();
|
|
24062
24100
|
};
|
|
@@ -24308,12 +24346,12 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
24308
24346
|
return void 0;
|
|
24309
24347
|
};
|
|
24310
24348
|
}
|
|
24311
|
-
|
|
24349
|
+
useEffect68(() => {
|
|
24312
24350
|
if (ixoEditor) {
|
|
24313
24351
|
ixoEditor.isEditable = editable;
|
|
24314
24352
|
}
|
|
24315
24353
|
}, [ixoEditor, editable]);
|
|
24316
|
-
|
|
24354
|
+
useEffect68(() => {
|
|
24317
24355
|
if (connectionStatus !== "connected") {
|
|
24318
24356
|
return;
|
|
24319
24357
|
}
|
|
@@ -24335,9 +24373,9 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
24335
24373
|
titleText.insert(0, options.title);
|
|
24336
24374
|
}
|
|
24337
24375
|
}, [connectionStatus, root, titleText, permissions.write, options.docId, options.title, memoizedUser.id]);
|
|
24338
|
-
const [connectedUsers, setConnectedUsers] =
|
|
24376
|
+
const [connectedUsers, setConnectedUsers] = useState84([]);
|
|
24339
24377
|
const webrtcProvider = matrixProvider?.webrtcProvider;
|
|
24340
|
-
|
|
24378
|
+
useEffect68(() => {
|
|
24341
24379
|
if (!matrixProvider?.awarenessInstance || !webrtcProvider || connectionStatus !== "connected") {
|
|
24342
24380
|
return;
|
|
24343
24381
|
}
|
|
@@ -24356,7 +24394,7 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
24356
24394
|
awareness.off("change", updateUsers);
|
|
24357
24395
|
};
|
|
24358
24396
|
}, [matrixProvider, webrtcProvider, connectionStatus]);
|
|
24359
|
-
|
|
24397
|
+
useEffect68(() => {
|
|
24360
24398
|
if (!matrixProvider?.awarenessInstance || !webrtcProvider || connectionStatus !== "connected") {
|
|
24361
24399
|
return;
|
|
24362
24400
|
}
|
|
@@ -24394,7 +24432,7 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
24394
24432
|
}
|
|
24395
24433
|
|
|
24396
24434
|
// src/mantine/components/Base/BaseIconPicker.tsx
|
|
24397
|
-
import React229, { useState as
|
|
24435
|
+
import React229, { useState as useState85, useMemo as useMemo81, useEffect as useEffect69 } from "react";
|
|
24398
24436
|
import { TextInput as TextInput7, Tabs as Tabs5, Box as Box41, Stack as Stack148, UnstyledButton as UnstyledButton2, Text as Text123, Center as Center12, ScrollArea as ScrollArea8, Group as Group79, Popover as Popover4 } from "@mantine/core";
|
|
24399
24437
|
import * as TablerIcons from "@tabler/icons-react";
|
|
24400
24438
|
import { IconSearch as IconSearch6, IconX as IconX12, IconChevronLeft, IconChevronRight as IconChevronRight11 } from "@tabler/icons-react";
|
|
@@ -24452,9 +24490,9 @@ var localStorageService = {
|
|
|
24452
24490
|
var iconsKey = "editor_recent_icons";
|
|
24453
24491
|
var ICONS_PER_PAGE = 500;
|
|
24454
24492
|
function BaseIconPicker({ opened, onClose, onSelectIcon, onUploadClick, children, currentIcon }) {
|
|
24455
|
-
const [searchQuery, setSearchQuery] =
|
|
24456
|
-
const [activeTab, setActiveTab] =
|
|
24457
|
-
const [currentPage, setCurrentPage] =
|
|
24493
|
+
const [searchQuery, setSearchQuery] = useState85("");
|
|
24494
|
+
const [activeTab, setActiveTab] = useState85("icons");
|
|
24495
|
+
const [currentPage, setCurrentPage] = useState85(1);
|
|
24458
24496
|
const allIcons = useMemo81(() => {
|
|
24459
24497
|
const iconEntries = Object.entries(TablerIcons).filter(([name]) => name.startsWith("Icon") && name !== "IconProps");
|
|
24460
24498
|
return iconEntries;
|
|
@@ -24464,7 +24502,7 @@ function BaseIconPicker({ opened, onClose, onSelectIcon, onUploadClick, children
|
|
|
24464
24502
|
const query = searchQuery.toLowerCase();
|
|
24465
24503
|
return allIcons.filter(([name]) => name.toLowerCase().includes(query));
|
|
24466
24504
|
}, [allIcons, searchQuery]);
|
|
24467
|
-
|
|
24505
|
+
useEffect69(() => {
|
|
24468
24506
|
setCurrentPage(1);
|
|
24469
24507
|
}, [searchQuery]);
|
|
24470
24508
|
const paginatedIcons = useMemo81(() => {
|
|
@@ -24575,7 +24613,7 @@ function BaseIconPicker({ opened, onClose, onSelectIcon, onUploadClick, children
|
|
|
24575
24613
|
}
|
|
24576
24614
|
|
|
24577
24615
|
// src/mantine/components/CoverImage.tsx
|
|
24578
|
-
import React231, { useState as
|
|
24616
|
+
import React231, { useState as useState86, useRef as useRef19, useEffect as useEffect70 } from "react";
|
|
24579
24617
|
import { Box as Box43, Group as Group80 } from "@mantine/core";
|
|
24580
24618
|
|
|
24581
24619
|
// src/core/lib/imageTransform.ts
|
|
@@ -24761,14 +24799,14 @@ function PageIcon({ src, iconSize = 64, useCenter = false, style }) {
|
|
|
24761
24799
|
import { useDisclosure as useDisclosure5 } from "@mantine/hooks";
|
|
24762
24800
|
function CoverImage({ coverImageUrl, logoUrl }) {
|
|
24763
24801
|
const { editor, handlers, editable } = useBlocknoteContext();
|
|
24764
|
-
const [isHovering, setIsHovering] =
|
|
24765
|
-
const [isRepositioning, setIsRepositioning] =
|
|
24766
|
-
const [coverPosition, setCoverPosition] =
|
|
24802
|
+
const [isHovering, setIsHovering] = useState86(false);
|
|
24803
|
+
const [isRepositioning, setIsRepositioning] = useState86(false);
|
|
24804
|
+
const [coverPosition, setCoverPosition] = useState86(50);
|
|
24767
24805
|
const coverFileInputRef = useRef19(null);
|
|
24768
24806
|
const logoFileInputRef = useRef19(null);
|
|
24769
24807
|
const [opened, { open, close }] = useDisclosure5(false);
|
|
24770
|
-
const [metadata, setMetadata] =
|
|
24771
|
-
|
|
24808
|
+
const [metadata, setMetadata] = useState86(() => editor?.getPageMetadata?.() || null);
|
|
24809
|
+
useEffect70(() => {
|
|
24772
24810
|
if (!editor?._metadataManager) {
|
|
24773
24811
|
return;
|
|
24774
24812
|
}
|
|
@@ -25043,7 +25081,7 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
25043
25081
|
}
|
|
25044
25082
|
|
|
25045
25083
|
// src/mantine/components/PageHeader.tsx
|
|
25046
|
-
import React232, { useState as
|
|
25084
|
+
import React232, { useState as useState87, useRef as useRef20, useEffect as useEffect71 } from "react";
|
|
25047
25085
|
function PageHeader({
|
|
25048
25086
|
title = "New page",
|
|
25049
25087
|
icon,
|
|
@@ -25055,11 +25093,11 @@ function PageHeader({
|
|
|
25055
25093
|
isFavorited = false,
|
|
25056
25094
|
menuItems = []
|
|
25057
25095
|
}) {
|
|
25058
|
-
const [isMenuOpen, setIsMenuOpen] =
|
|
25059
|
-
const [isPrivacyOpen, setIsPrivacyOpen] =
|
|
25096
|
+
const [isMenuOpen, setIsMenuOpen] = useState87(false);
|
|
25097
|
+
const [isPrivacyOpen, setIsPrivacyOpen] = useState87(false);
|
|
25060
25098
|
const menuRef = useRef20(null);
|
|
25061
25099
|
const privacyRef = useRef20(null);
|
|
25062
|
-
|
|
25100
|
+
useEffect71(() => {
|
|
25063
25101
|
function handleClickOutside(event) {
|
|
25064
25102
|
if (menuRef.current && !menuRef.current.contains(event.target)) {
|
|
25065
25103
|
setIsMenuOpen(false);
|
|
@@ -25257,7 +25295,7 @@ var styles = {
|
|
|
25257
25295
|
};
|
|
25258
25296
|
|
|
25259
25297
|
// src/mantine/components/ExternalDropZone.tsx
|
|
25260
|
-
import React233, { useCallback as
|
|
25298
|
+
import React233, { useCallback as useCallback69, useEffect as useEffect72, useRef as useRef21, useState as useState88 } from "react";
|
|
25261
25299
|
import { Box as Box44 } from "@mantine/core";
|
|
25262
25300
|
var SCROLL_ZONE_SIZE = 80;
|
|
25263
25301
|
var SCROLL_SPEED = 12;
|
|
@@ -25271,19 +25309,19 @@ var ExternalDropZone = ({
|
|
|
25271
25309
|
children
|
|
25272
25310
|
}) => {
|
|
25273
25311
|
const containerRef = useRef21(null);
|
|
25274
|
-
const [isValidDrag, setIsValidDrag] =
|
|
25275
|
-
const [isHoveringInPlacementMode, setIsHoveringInPlacementMode] =
|
|
25276
|
-
const [indicatorStyle, setIndicatorStyle] =
|
|
25312
|
+
const [isValidDrag, setIsValidDrag] = useState88(false);
|
|
25313
|
+
const [isHoveringInPlacementMode, setIsHoveringInPlacementMode] = useState88(false);
|
|
25314
|
+
const [indicatorStyle, setIndicatorStyle] = useState88({});
|
|
25277
25315
|
const dropPositionRef = useRef21(null);
|
|
25278
25316
|
const scrollAnimationRef = useRef21(null);
|
|
25279
25317
|
const scrollDirectionRef = useRef21(null);
|
|
25280
25318
|
const scrollContainerRef = useRef21(null);
|
|
25281
|
-
const getBlockElements =
|
|
25319
|
+
const getBlockElements = useCallback69(() => {
|
|
25282
25320
|
if (!containerRef.current) return [];
|
|
25283
25321
|
const blocks = containerRef.current.querySelectorAll('[data-node-type="blockContainer"]');
|
|
25284
25322
|
return Array.from(blocks);
|
|
25285
25323
|
}, []);
|
|
25286
|
-
const getScrollContainer =
|
|
25324
|
+
const getScrollContainer = useCallback69(() => {
|
|
25287
25325
|
if (scrollContainerRef.current) return scrollContainerRef.current;
|
|
25288
25326
|
let element = containerRef.current;
|
|
25289
25327
|
while (element) {
|
|
@@ -25298,7 +25336,7 @@ var ExternalDropZone = ({
|
|
|
25298
25336
|
scrollContainerRef.current = window;
|
|
25299
25337
|
return window;
|
|
25300
25338
|
}, []);
|
|
25301
|
-
const performScroll =
|
|
25339
|
+
const performScroll = useCallback69(() => {
|
|
25302
25340
|
const container = getScrollContainer();
|
|
25303
25341
|
const direction = scrollDirectionRef.current;
|
|
25304
25342
|
if (!direction) {
|
|
@@ -25313,7 +25351,7 @@ var ExternalDropZone = ({
|
|
|
25313
25351
|
}
|
|
25314
25352
|
scrollAnimationRef.current = requestAnimationFrame(performScroll);
|
|
25315
25353
|
}, [getScrollContainer]);
|
|
25316
|
-
const startAutoScroll =
|
|
25354
|
+
const startAutoScroll = useCallback69(
|
|
25317
25355
|
(direction) => {
|
|
25318
25356
|
if (scrollDirectionRef.current === direction) return;
|
|
25319
25357
|
scrollDirectionRef.current = direction;
|
|
@@ -25323,14 +25361,14 @@ var ExternalDropZone = ({
|
|
|
25323
25361
|
},
|
|
25324
25362
|
[performScroll]
|
|
25325
25363
|
);
|
|
25326
|
-
const stopAutoScroll =
|
|
25364
|
+
const stopAutoScroll = useCallback69(() => {
|
|
25327
25365
|
scrollDirectionRef.current = null;
|
|
25328
25366
|
if (scrollAnimationRef.current) {
|
|
25329
25367
|
cancelAnimationFrame(scrollAnimationRef.current);
|
|
25330
25368
|
scrollAnimationRef.current = null;
|
|
25331
25369
|
}
|
|
25332
25370
|
}, []);
|
|
25333
|
-
const checkAutoScroll =
|
|
25371
|
+
const checkAutoScroll = useCallback69(
|
|
25334
25372
|
(clientY) => {
|
|
25335
25373
|
const container = getScrollContainer();
|
|
25336
25374
|
let containerTop;
|
|
@@ -25353,7 +25391,7 @@ var ExternalDropZone = ({
|
|
|
25353
25391
|
},
|
|
25354
25392
|
[getScrollContainer, startAutoScroll, stopAutoScroll]
|
|
25355
25393
|
);
|
|
25356
|
-
const findDropPosition =
|
|
25394
|
+
const findDropPosition = useCallback69(
|
|
25357
25395
|
(clientY) => {
|
|
25358
25396
|
const blocks = getBlockElements();
|
|
25359
25397
|
if (blocks.length === 0 || !editor?.document) return null;
|
|
@@ -25386,7 +25424,7 @@ var ExternalDropZone = ({
|
|
|
25386
25424
|
},
|
|
25387
25425
|
[getBlockElements, editor]
|
|
25388
25426
|
);
|
|
25389
|
-
const handleDragOver =
|
|
25427
|
+
const handleDragOver = useCallback69(
|
|
25390
25428
|
(e) => {
|
|
25391
25429
|
if (!e.dataTransfer.types.includes(acceptedType)) return;
|
|
25392
25430
|
e.preventDefault();
|
|
@@ -25409,7 +25447,7 @@ var ExternalDropZone = ({
|
|
|
25409
25447
|
},
|
|
25410
25448
|
[acceptedType, findDropPosition, checkAutoScroll]
|
|
25411
25449
|
);
|
|
25412
|
-
const handleDragLeave =
|
|
25450
|
+
const handleDragLeave = useCallback69(
|
|
25413
25451
|
(e) => {
|
|
25414
25452
|
if (containerRef.current && !containerRef.current.contains(e.relatedTarget)) {
|
|
25415
25453
|
setIsValidDrag(false);
|
|
@@ -25419,7 +25457,7 @@ var ExternalDropZone = ({
|
|
|
25419
25457
|
},
|
|
25420
25458
|
[stopAutoScroll]
|
|
25421
25459
|
);
|
|
25422
|
-
const handleDrop =
|
|
25460
|
+
const handleDrop = useCallback69(
|
|
25423
25461
|
(e) => {
|
|
25424
25462
|
e.preventDefault();
|
|
25425
25463
|
e.stopPropagation();
|
|
@@ -25433,7 +25471,7 @@ var ExternalDropZone = ({
|
|
|
25433
25471
|
},
|
|
25434
25472
|
[onDrop, stopAutoScroll]
|
|
25435
25473
|
);
|
|
25436
|
-
|
|
25474
|
+
useEffect72(() => {
|
|
25437
25475
|
const handleGlobalDragEnd = () => {
|
|
25438
25476
|
setIsValidDrag(false);
|
|
25439
25477
|
dropPositionRef.current = null;
|
|
@@ -25442,7 +25480,7 @@ var ExternalDropZone = ({
|
|
|
25442
25480
|
window.addEventListener("dragend", handleGlobalDragEnd);
|
|
25443
25481
|
return () => window.removeEventListener("dragend", handleGlobalDragEnd);
|
|
25444
25482
|
}, [stopAutoScroll]);
|
|
25445
|
-
const handleOverlayMouseMove =
|
|
25483
|
+
const handleOverlayMouseMove = useCallback69(
|
|
25446
25484
|
(e) => {
|
|
25447
25485
|
setIsHoveringInPlacementMode(true);
|
|
25448
25486
|
checkAutoScroll(e.clientY);
|
|
@@ -25461,12 +25499,12 @@ var ExternalDropZone = ({
|
|
|
25461
25499
|
},
|
|
25462
25500
|
[findDropPosition, checkAutoScroll]
|
|
25463
25501
|
);
|
|
25464
|
-
const handleOverlayMouseLeave =
|
|
25502
|
+
const handleOverlayMouseLeave = useCallback69(() => {
|
|
25465
25503
|
setIsHoveringInPlacementMode(false);
|
|
25466
25504
|
dropPositionRef.current = null;
|
|
25467
25505
|
stopAutoScroll();
|
|
25468
25506
|
}, [stopAutoScroll]);
|
|
25469
|
-
const handleOverlayClick =
|
|
25507
|
+
const handleOverlayClick = useCallback69(
|
|
25470
25508
|
(e) => {
|
|
25471
25509
|
e.preventDefault();
|
|
25472
25510
|
e.stopPropagation();
|
|
@@ -25480,7 +25518,7 @@ var ExternalDropZone = ({
|
|
|
25480
25518
|
},
|
|
25481
25519
|
[onDrop, stopAutoScroll]
|
|
25482
25520
|
);
|
|
25483
|
-
const handleOverlayWheel =
|
|
25521
|
+
const handleOverlayWheel = useCallback69(
|
|
25484
25522
|
(e) => {
|
|
25485
25523
|
const container = getScrollContainer();
|
|
25486
25524
|
if (container === window) {
|
|
@@ -25491,7 +25529,7 @@ var ExternalDropZone = ({
|
|
|
25491
25529
|
},
|
|
25492
25530
|
[getScrollContainer]
|
|
25493
25531
|
);
|
|
25494
|
-
|
|
25532
|
+
useEffect72(() => {
|
|
25495
25533
|
if (!isPlacementMode) return;
|
|
25496
25534
|
const handleKeyDown = (e) => {
|
|
25497
25535
|
if (e.key === "Escape") {
|
|
@@ -25514,13 +25552,13 @@ var ExternalDropZone = ({
|
|
|
25514
25552
|
document.removeEventListener("click", handleGlobalClick, true);
|
|
25515
25553
|
};
|
|
25516
25554
|
}, [isPlacementMode, onPlacementCancel]);
|
|
25517
|
-
|
|
25555
|
+
useEffect72(() => {
|
|
25518
25556
|
if (!isPlacementMode) {
|
|
25519
25557
|
setIsHoveringInPlacementMode(false);
|
|
25520
25558
|
dropPositionRef.current = null;
|
|
25521
25559
|
}
|
|
25522
25560
|
}, [isPlacementMode]);
|
|
25523
|
-
|
|
25561
|
+
useEffect72(() => {
|
|
25524
25562
|
const isActive = isValidDrag || isPlacementMode && isHoveringInPlacementMode;
|
|
25525
25563
|
if (isActive) {
|
|
25526
25564
|
document.body.classList.add("external-artifact-drag-active");
|
|
@@ -25531,7 +25569,7 @@ var ExternalDropZone = ({
|
|
|
25531
25569
|
document.body.classList.remove("external-artifact-drag-active");
|
|
25532
25570
|
};
|
|
25533
25571
|
}, [isValidDrag, isPlacementMode, isHoveringInPlacementMode]);
|
|
25534
|
-
|
|
25572
|
+
useEffect72(() => {
|
|
25535
25573
|
return () => {
|
|
25536
25574
|
if (scrollAnimationRef.current) {
|
|
25537
25575
|
cancelAnimationFrame(scrollAnimationRef.current);
|
|
@@ -25583,7 +25621,7 @@ var ExternalDropZone = ({
|
|
|
25583
25621
|
};
|
|
25584
25622
|
|
|
25585
25623
|
// src/mantine/IxoEditor.tsx
|
|
25586
|
-
import React235, { useState as
|
|
25624
|
+
import React235, { useState as useState89, useEffect as useEffect73, useCallback as useCallback70 } from "react";
|
|
25587
25625
|
import { getDefaultReactSlashMenuItems, SuggestionMenuController } from "@blocknote/react";
|
|
25588
25626
|
import { BlockNoteView } from "@blocknote/mantine";
|
|
25589
25627
|
import { filterSuggestionItems } from "@blocknote/core";
|
|
@@ -25661,8 +25699,8 @@ function IxoEditorContent({
|
|
|
25661
25699
|
}) {
|
|
25662
25700
|
const { activePanel } = usePanelStore();
|
|
25663
25701
|
const isPanelOpen = activePanel !== null;
|
|
25664
|
-
const [isRoomPrivate, setIsRoomPrivate] =
|
|
25665
|
-
|
|
25702
|
+
const [isRoomPrivate, setIsRoomPrivate] = useState89(pageHeaderProps?.isPrivate ?? true);
|
|
25703
|
+
useEffect73(() => {
|
|
25666
25704
|
const matrixClient = editor.getMatrixClient?.();
|
|
25667
25705
|
const roomId = editor.getRoomId?.();
|
|
25668
25706
|
if (!matrixClient || !roomId) return;
|
|
@@ -25678,7 +25716,7 @@ function IxoEditorContent({
|
|
|
25678
25716
|
} catch {
|
|
25679
25717
|
}
|
|
25680
25718
|
}, [editor]);
|
|
25681
|
-
const handlePrivacyChange =
|
|
25719
|
+
const handlePrivacyChange = useCallback70(
|
|
25682
25720
|
async (makePrivate) => {
|
|
25683
25721
|
const matrixClient = editor.getMatrixClient?.();
|
|
25684
25722
|
const roomId = editor.getRoomId?.();
|
|
@@ -25833,7 +25871,7 @@ function IxoEditor({
|
|
|
25833
25871
|
}
|
|
25834
25872
|
|
|
25835
25873
|
// src/mantine/components/EntitySigningSetup.tsx
|
|
25836
|
-
import React236, { useState as
|
|
25874
|
+
import React236, { useState as useState90 } from "react";
|
|
25837
25875
|
import { Modal as Modal3, Stack as Stack149, Text as Text124, TextInput as TextInput8, Button as Button39, Alert as Alert31, Group as Group81 } from "@mantine/core";
|
|
25838
25876
|
import { IconAlertCircle as IconAlertCircle14, IconCheck as IconCheck13, IconKey as IconKey2 } from "@tabler/icons-react";
|
|
25839
25877
|
var EntitySigningSetup = ({
|
|
@@ -25843,11 +25881,11 @@ var EntitySigningSetup = ({
|
|
|
25843
25881
|
entityName,
|
|
25844
25882
|
onSetup
|
|
25845
25883
|
}) => {
|
|
25846
|
-
const [pin, setPin] =
|
|
25847
|
-
const [confirmPin, setConfirmPin] =
|
|
25848
|
-
const [loading, setLoading] =
|
|
25849
|
-
const [error, setError] =
|
|
25850
|
-
const [success, setSuccess] =
|
|
25884
|
+
const [pin, setPin] = useState90("");
|
|
25885
|
+
const [confirmPin, setConfirmPin] = useState90("");
|
|
25886
|
+
const [loading, setLoading] = useState90(false);
|
|
25887
|
+
const [error, setError] = useState90(null);
|
|
25888
|
+
const [success, setSuccess] = useState90(false);
|
|
25851
25889
|
const handleSetup = async () => {
|
|
25852
25890
|
if (pin.length < 4) {
|
|
25853
25891
|
setError("PIN must be at least 4 characters");
|
|
@@ -25929,7 +25967,7 @@ var EntitySigningSetup = ({
|
|
|
25929
25967
|
};
|
|
25930
25968
|
|
|
25931
25969
|
// src/mantine/components/FlowPermissionsPanel.tsx
|
|
25932
|
-
import React237, { useState as
|
|
25970
|
+
import React237, { useState as useState91, useEffect as useEffect74, useMemo as useMemo83 } from "react";
|
|
25933
25971
|
import { Stack as Stack150, Text as Text125, Paper as Paper19, Group as Group82, Badge as Badge41, Button as Button40, ActionIcon as ActionIcon37, Loader as Loader31, Alert as Alert32, Divider as Divider19 } from "@mantine/core";
|
|
25934
25972
|
import { IconPlus as IconPlus7, IconTrash as IconTrash8, IconShieldCheck as IconShieldCheck2, IconUser as IconUser5, IconRobot as IconRobot4, IconBuilding } from "@tabler/icons-react";
|
|
25935
25973
|
var FlowPermissionsPanel = ({
|
|
@@ -25940,11 +25978,11 @@ var FlowPermissionsPanel = ({
|
|
|
25940
25978
|
onRevokePermission,
|
|
25941
25979
|
getUserDisplayName
|
|
25942
25980
|
}) => {
|
|
25943
|
-
const [delegations, setDelegations] =
|
|
25944
|
-
const [loading, setLoading] =
|
|
25945
|
-
const [revoking, setRevoking] =
|
|
25981
|
+
const [delegations, setDelegations] = useState91([]);
|
|
25982
|
+
const [loading, setLoading] = useState91(true);
|
|
25983
|
+
const [revoking, setRevoking] = useState91(null);
|
|
25946
25984
|
const rootCapability = useMemo83(() => editor.getRootCapability?.(), [editor]);
|
|
25947
|
-
|
|
25985
|
+
useEffect74(() => {
|
|
25948
25986
|
const loadDelegations = async () => {
|
|
25949
25987
|
setLoading(true);
|
|
25950
25988
|
const allDelegations = editor.getAllDelegations?.() || [];
|
|
@@ -26028,7 +26066,7 @@ var FlowPermissionsPanel = ({
|
|
|
26028
26066
|
};
|
|
26029
26067
|
|
|
26030
26068
|
// src/mantine/components/GrantPermissionModal.tsx
|
|
26031
|
-
import React238, { useState as
|
|
26069
|
+
import React238, { useState as useState92, useCallback as useCallback71 } from "react";
|
|
26032
26070
|
import {
|
|
26033
26071
|
Modal as Modal4,
|
|
26034
26072
|
Stack as Stack151,
|
|
@@ -26060,21 +26098,21 @@ var GrantPermissionModal = ({
|
|
|
26060
26098
|
const singleBlockMode = !!targetBlockId || blocks.length === 1;
|
|
26061
26099
|
const fixedBlockId = targetBlockId || (blocks.length === 1 ? blocks[0].id : null);
|
|
26062
26100
|
const fixedBlock = fixedBlockId ? blocks.find((b) => b.id === fixedBlockId) || blocks[0] : null;
|
|
26063
|
-
const [recipientType, setRecipientType] =
|
|
26064
|
-
const [searchQuery, setSearchQuery] =
|
|
26065
|
-
const [searchResults, setSearchResults] =
|
|
26066
|
-
const [searching, setSearching] =
|
|
26067
|
-
const [selectedRecipient, setSelectedRecipient] =
|
|
26068
|
-
const [manualDid, setManualDid] =
|
|
26069
|
-
const [scopeType, setScopeType] =
|
|
26070
|
-
const [selectedBlocks, setSelectedBlocks] =
|
|
26071
|
-
const [expirationEnabled, setExpirationEnabled] =
|
|
26072
|
-
const [expirationDays, setExpirationDays] =
|
|
26073
|
-
const [canDelegate, setCanDelegate] =
|
|
26074
|
-
const [pin, setPin] =
|
|
26075
|
-
const [loading, setLoading] =
|
|
26076
|
-
const [error, setError] =
|
|
26077
|
-
const handleSearch =
|
|
26101
|
+
const [recipientType, setRecipientType] = useState92("user");
|
|
26102
|
+
const [searchQuery, setSearchQuery] = useState92("");
|
|
26103
|
+
const [searchResults, setSearchResults] = useState92([]);
|
|
26104
|
+
const [searching, setSearching] = useState92(false);
|
|
26105
|
+
const [selectedRecipient, setSelectedRecipient] = useState92(null);
|
|
26106
|
+
const [manualDid, setManualDid] = useState92("");
|
|
26107
|
+
const [scopeType, setScopeType] = useState92("full");
|
|
26108
|
+
const [selectedBlocks, setSelectedBlocks] = useState92([]);
|
|
26109
|
+
const [expirationEnabled, setExpirationEnabled] = useState92(false);
|
|
26110
|
+
const [expirationDays, setExpirationDays] = useState92(30);
|
|
26111
|
+
const [canDelegate, setCanDelegate] = useState92(false);
|
|
26112
|
+
const [pin, setPin] = useState92("");
|
|
26113
|
+
const [loading, setLoading] = useState92(false);
|
|
26114
|
+
const [error, setError] = useState92(null);
|
|
26115
|
+
const handleSearch = useCallback71(async () => {
|
|
26078
26116
|
if (searchQuery.length < 2) return;
|
|
26079
26117
|
setSearching(true);
|
|
26080
26118
|
try {
|
|
@@ -26371,4 +26409,4 @@ export {
|
|
|
26371
26409
|
ixoGraphQLClient,
|
|
26372
26410
|
getEntity
|
|
26373
26411
|
};
|
|
26374
|
-
//# sourceMappingURL=chunk-
|
|
26412
|
+
//# sourceMappingURL=chunk-XVUUV4EK.mjs.map
|