@ixo/editor 2.31.2 → 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(
|
|
@@ -16273,10 +16308,10 @@ var ClaimFlowView = ({ editor, block }) => {
|
|
|
16273
16308
|
const adminAddress = block.props.adminAddress || "";
|
|
16274
16309
|
const { collections, loading, error, refetch } = useCollections(did, selectedCollectionIds, block, editor);
|
|
16275
16310
|
const refetchRef = useRef10(refetch);
|
|
16276
|
-
|
|
16311
|
+
useEffect44(() => {
|
|
16277
16312
|
refetchRef.current = refetch;
|
|
16278
16313
|
}, [refetch]);
|
|
16279
|
-
const stableRefetch =
|
|
16314
|
+
const stableRefetch = useCallback39(() => {
|
|
16280
16315
|
refetchRef.current();
|
|
16281
16316
|
}, []);
|
|
16282
16317
|
if (!did) {
|
|
@@ -16364,10 +16399,10 @@ import React156, { useMemo as useMemo45 } from "react";
|
|
|
16364
16399
|
import { Group as Group52, Stack as Stack114, Text as Text88 } from "@mantine/core";
|
|
16365
16400
|
|
|
16366
16401
|
// src/mantine/blocks/bid/template/TemplateConfig.tsx
|
|
16367
|
-
import React155, { useCallback as
|
|
16402
|
+
import React155, { useCallback as useCallback41 } from "react";
|
|
16368
16403
|
|
|
16369
16404
|
// src/mantine/blocks/bid/template/GeneralTab.tsx
|
|
16370
|
-
import React154, { useEffect as
|
|
16405
|
+
import React154, { useEffect as useEffect45, useState as useState60, useCallback as useCallback40, useMemo as useMemo44 } from "react";
|
|
16371
16406
|
var GeneralTab7 = ({
|
|
16372
16407
|
title,
|
|
16373
16408
|
description,
|
|
@@ -16380,12 +16415,12 @@ var GeneralTab7 = ({
|
|
|
16380
16415
|
onSelectedCollectionsChange,
|
|
16381
16416
|
onAdminAddressChange
|
|
16382
16417
|
}) => {
|
|
16383
|
-
const [localTitle, setLocalTitle] =
|
|
16384
|
-
const [localDescription, setLocalDescription] =
|
|
16385
|
-
|
|
16418
|
+
const [localTitle, setLocalTitle] = useState60(title || "");
|
|
16419
|
+
const [localDescription, setLocalDescription] = useState60(description || "");
|
|
16420
|
+
useEffect45(() => {
|
|
16386
16421
|
setLocalTitle(title || "");
|
|
16387
16422
|
}, [title]);
|
|
16388
|
-
|
|
16423
|
+
useEffect45(() => {
|
|
16389
16424
|
setLocalDescription(description || "");
|
|
16390
16425
|
}, [description]);
|
|
16391
16426
|
const parsedSelectedCollections = useMemo44(() => {
|
|
@@ -16395,14 +16430,14 @@ var GeneralTab7 = ({
|
|
|
16395
16430
|
return [];
|
|
16396
16431
|
}
|
|
16397
16432
|
}, [selectedCollections]);
|
|
16398
|
-
const handleCollectionsChange =
|
|
16433
|
+
const handleCollectionsChange = useCallback40(
|
|
16399
16434
|
(collections) => {
|
|
16400
16435
|
const stringified = JSON.stringify(collections || []);
|
|
16401
16436
|
onSelectedCollectionsChange(stringified);
|
|
16402
16437
|
},
|
|
16403
16438
|
[onSelectedCollectionsChange]
|
|
16404
16439
|
);
|
|
16405
|
-
const handleAdminAddressChange =
|
|
16440
|
+
const handleAdminAddressChange = useCallback40(
|
|
16406
16441
|
(adminAddress2) => {
|
|
16407
16442
|
if (onAdminAddressChange) {
|
|
16408
16443
|
onAdminAddressChange(adminAddress2);
|
|
@@ -16632,7 +16667,7 @@ var bidActions = [
|
|
|
16632
16667
|
// src/mantine/blocks/bid/template/TemplateConfig.tsx
|
|
16633
16668
|
var TemplateConfig7 = ({ editor, block }) => {
|
|
16634
16669
|
const { closePanel } = usePanelStore();
|
|
16635
|
-
const updateProp =
|
|
16670
|
+
const updateProp = useCallback41(
|
|
16636
16671
|
(key, value) => {
|
|
16637
16672
|
editor.updateBlock(block, {
|
|
16638
16673
|
props: {
|
|
@@ -16726,7 +16761,7 @@ var BidTemplateView = ({ editor, block }) => {
|
|
|
16726
16761
|
};
|
|
16727
16762
|
|
|
16728
16763
|
// src/mantine/blocks/bid/flow/components/FlowView.tsx
|
|
16729
|
-
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";
|
|
16730
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";
|
|
16731
16766
|
import { IconSettings as IconSettings4, IconRefresh as IconRefresh5, IconAlertCircle as IconAlertCircle6 } from "@tabler/icons-react";
|
|
16732
16767
|
var BID_FLOW_PANEL_ID = "bid-flow-panel";
|
|
@@ -16770,7 +16805,7 @@ var BidFlowView = ({ editor, block }) => {
|
|
|
16770
16805
|
[flowNode, runtime, ucanManager, userAddress, editor, flowUri, delegationStore, verifySignature, flowOwnerDid]
|
|
16771
16806
|
);
|
|
16772
16807
|
const executionRef = useRef11(executionValue);
|
|
16773
|
-
|
|
16808
|
+
useEffect46(() => {
|
|
16774
16809
|
executionRef.current = executionValue;
|
|
16775
16810
|
}, [executionValue]);
|
|
16776
16811
|
const execution = useMemo46(
|
|
@@ -16828,10 +16863,10 @@ var BidFlowView = ({ editor, block }) => {
|
|
|
16828
16863
|
const { collections, loading, error, refetch } = useCollections(did, selectedCollectionIds, block, editor);
|
|
16829
16864
|
const { executeHookedActions } = useHookedActions({ block, editor });
|
|
16830
16865
|
const refetchRef = useRef11(refetch);
|
|
16831
|
-
|
|
16866
|
+
useEffect46(() => {
|
|
16832
16867
|
refetchRef.current = refetch;
|
|
16833
16868
|
}, [refetch]);
|
|
16834
|
-
const stableRefetch =
|
|
16869
|
+
const stableRefetch = useCallback42(() => {
|
|
16835
16870
|
refetchRef.current();
|
|
16836
16871
|
}, []);
|
|
16837
16872
|
if (!did) {
|
|
@@ -16911,10 +16946,10 @@ import React162, { useMemo as useMemo48 } from "react";
|
|
|
16911
16946
|
import { Group as Group53, Stack as Stack116, Text as Text90 } from "@mantine/core";
|
|
16912
16947
|
|
|
16913
16948
|
// src/mantine/blocks/evaluator/template/TemplateConfig.tsx
|
|
16914
|
-
import React161, { useCallback as
|
|
16949
|
+
import React161, { useCallback as useCallback44 } from "react";
|
|
16915
16950
|
|
|
16916
16951
|
// src/mantine/blocks/evaluator/template/GeneralTab.tsx
|
|
16917
|
-
import React160, { useEffect as
|
|
16952
|
+
import React160, { useEffect as useEffect47, useState as useState61, useCallback as useCallback43, useMemo as useMemo47 } from "react";
|
|
16918
16953
|
var GeneralTab8 = ({
|
|
16919
16954
|
title,
|
|
16920
16955
|
description,
|
|
@@ -16927,12 +16962,12 @@ var GeneralTab8 = ({
|
|
|
16927
16962
|
onSelectedCollectionsChange,
|
|
16928
16963
|
onAdminAddressChange
|
|
16929
16964
|
}) => {
|
|
16930
|
-
const [localTitle, setLocalTitle] =
|
|
16931
|
-
const [localDescription, setLocalDescription] =
|
|
16932
|
-
|
|
16965
|
+
const [localTitle, setLocalTitle] = useState61(title || "");
|
|
16966
|
+
const [localDescription, setLocalDescription] = useState61(description || "");
|
|
16967
|
+
useEffect47(() => {
|
|
16933
16968
|
setLocalTitle(title || "");
|
|
16934
16969
|
}, [title]);
|
|
16935
|
-
|
|
16970
|
+
useEffect47(() => {
|
|
16936
16971
|
setLocalDescription(description || "");
|
|
16937
16972
|
}, [description]);
|
|
16938
16973
|
const parsedSelectedCollections = useMemo47(() => {
|
|
@@ -16942,14 +16977,14 @@ var GeneralTab8 = ({
|
|
|
16942
16977
|
return [];
|
|
16943
16978
|
}
|
|
16944
16979
|
}, [selectedCollections]);
|
|
16945
|
-
const handleCollectionsChange =
|
|
16980
|
+
const handleCollectionsChange = useCallback43(
|
|
16946
16981
|
(collections) => {
|
|
16947
16982
|
const stringified = JSON.stringify(collections || []);
|
|
16948
16983
|
onSelectedCollectionsChange(stringified);
|
|
16949
16984
|
},
|
|
16950
16985
|
[onSelectedCollectionsChange]
|
|
16951
16986
|
);
|
|
16952
|
-
const handleAdminAddressChange =
|
|
16987
|
+
const handleAdminAddressChange = useCallback43(
|
|
16953
16988
|
(adminAddress2) => {
|
|
16954
16989
|
if (onAdminAddressChange) {
|
|
16955
16990
|
onAdminAddressChange(adminAddress2);
|
|
@@ -16998,7 +17033,7 @@ var GeneralTab8 = ({
|
|
|
16998
17033
|
// src/mantine/blocks/evaluator/template/TemplateConfig.tsx
|
|
16999
17034
|
var TemplateConfig8 = ({ editor, block }) => {
|
|
17000
17035
|
const { closePanel } = usePanelStore();
|
|
17001
|
-
const updateProp =
|
|
17036
|
+
const updateProp = useCallback44(
|
|
17002
17037
|
(key, value) => {
|
|
17003
17038
|
editor.updateBlock(block, {
|
|
17004
17039
|
props: {
|
|
@@ -17150,14 +17185,14 @@ import React167 from "react";
|
|
|
17150
17185
|
import { createReactBlockSpec as createReactBlockSpec12 } from "@blocknote/react";
|
|
17151
17186
|
|
|
17152
17187
|
// src/mantine/blocks/visualization/VisualizationBlock.tsx
|
|
17153
|
-
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";
|
|
17154
17189
|
import { Box as Box34, Stack as Stack118, Text as Text92, Paper as Paper15, Group as Group54 } from "@mantine/core";
|
|
17155
17190
|
function VisualizationBlock({ block, editor }) {
|
|
17156
17191
|
const { visualizationRenderer } = useBlocknoteContext();
|
|
17157
17192
|
const { vizType, config, title, preferences } = block.props;
|
|
17158
17193
|
const containerRef = useRef12(null);
|
|
17159
|
-
const [hasValidDimensions, setHasValidDimensions] =
|
|
17160
|
-
|
|
17194
|
+
const [hasValidDimensions, setHasValidDimensions] = useState62(false);
|
|
17195
|
+
useEffect48(() => {
|
|
17161
17196
|
const container = containerRef.current;
|
|
17162
17197
|
if (!container) return;
|
|
17163
17198
|
const checkDimensions = () => {
|
|
@@ -17187,7 +17222,7 @@ function VisualizationBlock({ block, editor }) {
|
|
|
17187
17222
|
return {};
|
|
17188
17223
|
}
|
|
17189
17224
|
}, [preferences]);
|
|
17190
|
-
const handlePreferencesChange =
|
|
17225
|
+
const handlePreferencesChange = useCallback45(
|
|
17191
17226
|
(newPreferences) => {
|
|
17192
17227
|
if (editor) {
|
|
17193
17228
|
editor.updateBlock(block, {
|
|
@@ -17254,17 +17289,17 @@ import React170, { useMemo as useMemo51 } from "react";
|
|
|
17254
17289
|
import { Badge as Badge24, Group as Group55, Stack as Stack119, Text as Text93 } from "@mantine/core";
|
|
17255
17290
|
|
|
17256
17291
|
// src/mantine/blocks/domainCreator/template/TemplateConfig.tsx
|
|
17257
|
-
import React169, { useCallback as
|
|
17292
|
+
import React169, { useCallback as useCallback46 } from "react";
|
|
17258
17293
|
|
|
17259
17294
|
// src/mantine/blocks/domainCreator/template/GeneralTab.tsx
|
|
17260
|
-
import React168, { useEffect as
|
|
17295
|
+
import React168, { useEffect as useEffect49, useState as useState63 } from "react";
|
|
17261
17296
|
var GeneralTab9 = ({ title, description, icon, onTitleChange, onDescriptionChange, onIconChange }) => {
|
|
17262
|
-
const [localTitle, setLocalTitle] =
|
|
17263
|
-
const [localDescription, setLocalDescription] =
|
|
17264
|
-
const [localIcon, setLocalIcon] =
|
|
17265
|
-
|
|
17266
|
-
|
|
17267
|
-
|
|
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]);
|
|
17268
17303
|
return /* @__PURE__ */ React168.createElement(BaseSection, null, /* @__PURE__ */ React168.createElement(
|
|
17269
17304
|
BaseTextInput,
|
|
17270
17305
|
{
|
|
@@ -17309,7 +17344,7 @@ var GeneralTab9 = ({ title, description, icon, onTitleChange, onDescriptionChang
|
|
|
17309
17344
|
// src/mantine/blocks/domainCreator/template/TemplateConfig.tsx
|
|
17310
17345
|
var TemplateConfig9 = ({ editor, block }) => {
|
|
17311
17346
|
const { closePanel } = usePanelStore();
|
|
17312
|
-
const updateProp =
|
|
17347
|
+
const updateProp = useCallback46(
|
|
17313
17348
|
(key, value) => {
|
|
17314
17349
|
editor.updateBlock(block, {
|
|
17315
17350
|
props: {
|
|
@@ -17360,12 +17395,12 @@ var DomainCreatorTemplateView = ({ editor, block }) => {
|
|
|
17360
17395
|
};
|
|
17361
17396
|
|
|
17362
17397
|
// src/mantine/blocks/domainCreator/flow/FlowView.tsx
|
|
17363
|
-
import React172, { useCallback as
|
|
17398
|
+
import React172, { useCallback as useCallback48, useMemo as useMemo53, useState as useState65 } from "react";
|
|
17364
17399
|
import { ActionIcon as ActionIcon29, Badge as Badge25, Group as Group57, Stack as Stack121, Text as Text95, Tooltip as Tooltip16 } from "@mantine/core";
|
|
17365
17400
|
import { IconChevronRight as IconChevronRight6, IconCheck as IconCheck6, IconAlertCircle as IconAlertCircle9 } from "@tabler/icons-react";
|
|
17366
17401
|
|
|
17367
17402
|
// src/mantine/blocks/domainCreator/flow/DomainCreatorSurveyPanel.tsx
|
|
17368
|
-
import React171, { useCallback as
|
|
17403
|
+
import React171, { useCallback as useCallback47, useEffect as useEffect50, useMemo as useMemo52, useRef as useRef13, useState as useState64 } from "react";
|
|
17369
17404
|
import { Alert as Alert23, Button as Button32, Group as Group56, Loader as Loader22, Stack as Stack120, Text as Text94 } from "@mantine/core";
|
|
17370
17405
|
import { useDebouncedCallback } from "@mantine/hooks";
|
|
17371
17406
|
import { IconAlertCircle as IconAlertCircle8, IconCheck as IconCheck5 } from "@tabler/icons-react";
|
|
@@ -18426,10 +18461,10 @@ var DomainCreatorSurveyPanel = ({ editor, block, onComplete, entityDid: existing
|
|
|
18426
18461
|
const { handlers } = useBlocknoteContext();
|
|
18427
18462
|
const existingBlockEntityDid = block.props.entityDid;
|
|
18428
18463
|
const existingBlockEntityType = block.props.entityType;
|
|
18429
|
-
const [flowStep, setFlowStep] =
|
|
18430
|
-
const [error, setError] =
|
|
18431
|
-
const [createdEntityDid, setCreatedEntityDid] =
|
|
18432
|
-
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);
|
|
18433
18468
|
const isUpdatingFromProp = useRef13(false);
|
|
18434
18469
|
const lastSyncedAnswers = useRef13("");
|
|
18435
18470
|
const surveyModel = useMemo52(() => {
|
|
@@ -18439,7 +18474,7 @@ var DomainCreatorSurveyPanel = ({ editor, block, onComplete, entityDid: existing
|
|
|
18439
18474
|
model.questionsOnPageMode = "singlePage";
|
|
18440
18475
|
return model;
|
|
18441
18476
|
}, []);
|
|
18442
|
-
const syncPropToSurvey =
|
|
18477
|
+
const syncPropToSurvey = useCallback47(
|
|
18443
18478
|
(answersJson) => {
|
|
18444
18479
|
if (!answersJson || answersJson === lastSyncedAnswers.current) return;
|
|
18445
18480
|
try {
|
|
@@ -18471,13 +18506,13 @@ var DomainCreatorSurveyPanel = ({ editor, block, onComplete, entityDid: existing
|
|
|
18471
18506
|
}
|
|
18472
18507
|
});
|
|
18473
18508
|
}, SYNC_DEBOUNCE_MS);
|
|
18474
|
-
|
|
18509
|
+
useEffect50(() => {
|
|
18475
18510
|
const answersJson = block.props.answers;
|
|
18476
18511
|
if (answersJson) {
|
|
18477
18512
|
syncPropToSurvey(answersJson);
|
|
18478
18513
|
}
|
|
18479
18514
|
}, [block.props.answers, syncPropToSurvey]);
|
|
18480
|
-
|
|
18515
|
+
useEffect50(() => {
|
|
18481
18516
|
const handleValueChanged = () => {
|
|
18482
18517
|
if (isUpdatingFromProp.current) return;
|
|
18483
18518
|
syncSurveyToProp(surveyModel.data);
|
|
@@ -18487,7 +18522,7 @@ var DomainCreatorSurveyPanel = ({ editor, block, onComplete, entityDid: existing
|
|
|
18487
18522
|
surveyModel.onValueChanged.remove(handleValueChanged);
|
|
18488
18523
|
};
|
|
18489
18524
|
}, [surveyModel, syncSurveyToProp]);
|
|
18490
|
-
|
|
18525
|
+
useEffect50(() => {
|
|
18491
18526
|
const needsSchema = !block.props.surveySchema;
|
|
18492
18527
|
const needsAnswers = !block.props.answers;
|
|
18493
18528
|
if (needsSchema || needsAnswers) {
|
|
@@ -18509,7 +18544,7 @@ var DomainCreatorSurveyPanel = ({ editor, block, onComplete, entityDid: existing
|
|
|
18509
18544
|
});
|
|
18510
18545
|
}
|
|
18511
18546
|
}, [editor, block]);
|
|
18512
|
-
const processDomainCreation =
|
|
18547
|
+
const processDomainCreation = useCallback47(
|
|
18513
18548
|
async (data) => {
|
|
18514
18549
|
if (!handlers) {
|
|
18515
18550
|
throw new Error("Handlers not available");
|
|
@@ -18587,7 +18622,7 @@ var DomainCreatorSurveyPanel = ({ editor, block, onComplete, entityDid: existing
|
|
|
18587
18622
|
},
|
|
18588
18623
|
[handlers, existingEntityDid, issuerDidOverride]
|
|
18589
18624
|
);
|
|
18590
|
-
const handleSurveyComplete =
|
|
18625
|
+
const handleSurveyComplete = useCallback47(
|
|
18591
18626
|
async (sender) => {
|
|
18592
18627
|
const data = sender.data || {};
|
|
18593
18628
|
try {
|
|
@@ -18615,21 +18650,21 @@ var DomainCreatorSurveyPanel = ({ editor, block, onComplete, entityDid: existing
|
|
|
18615
18650
|
},
|
|
18616
18651
|
[processDomainCreation, onComplete, editor, block]
|
|
18617
18652
|
);
|
|
18618
|
-
|
|
18653
|
+
useEffect50(() => {
|
|
18619
18654
|
surveyModel.onComplete.add(handleSurveyComplete);
|
|
18620
18655
|
return () => {
|
|
18621
18656
|
surveyModel.onComplete.remove(handleSurveyComplete);
|
|
18622
18657
|
};
|
|
18623
18658
|
}, [handleSurveyComplete, surveyModel]);
|
|
18624
|
-
const handleRetry =
|
|
18659
|
+
const handleRetry = useCallback47(() => {
|
|
18625
18660
|
setFlowStep("survey");
|
|
18626
18661
|
setError(null);
|
|
18627
18662
|
surveyModel.clear();
|
|
18628
18663
|
}, [surveyModel]);
|
|
18629
|
-
const handleClose =
|
|
18664
|
+
const handleClose = useCallback47(() => {
|
|
18630
18665
|
closePanel();
|
|
18631
18666
|
}, [closePanel]);
|
|
18632
|
-
const handleVisitEntity =
|
|
18667
|
+
const handleVisitEntity = useCallback47(() => {
|
|
18633
18668
|
if (createdEntityDid && createdEntityType && handlers?.redirectToEntityOverview) {
|
|
18634
18669
|
handlers.redirectToEntityOverview(createdEntityDid, createdEntityType);
|
|
18635
18670
|
}
|
|
@@ -18662,11 +18697,11 @@ var DomainCreatorSurveyPanel = ({ editor, block, onComplete, entityDid: existing
|
|
|
18662
18697
|
// src/mantine/blocks/domainCreator/flow/FlowView.tsx
|
|
18663
18698
|
var DOMAIN_CREATOR_FLOW_PANEL_ID = "domain-creator-flow-panel";
|
|
18664
18699
|
var DomainCreatorFlowView = ({ editor, block }) => {
|
|
18665
|
-
const [hasOpened, setHasOpened] =
|
|
18666
|
-
const [submissionStatus, setSubmissionStatus] =
|
|
18700
|
+
const [hasOpened, setHasOpened] = useState65(false);
|
|
18701
|
+
const [submissionStatus, setSubmissionStatus] = useState65("idle");
|
|
18667
18702
|
const lastSubmission = block.props.lastSubmission ? JSON.parse(block.props.lastSubmission) : null;
|
|
18668
18703
|
const hasExistingSubmission = lastSubmission?.entityDid;
|
|
18669
|
-
const handleComplete =
|
|
18704
|
+
const handleComplete = useCallback48(
|
|
18670
18705
|
(data) => {
|
|
18671
18706
|
editor.updateBlock(block, {
|
|
18672
18707
|
props: {
|
|
@@ -18752,30 +18787,30 @@ import React178, { useMemo as useMemo56 } from "react";
|
|
|
18752
18787
|
import { Badge as Badge27, Group as Group59, Stack as Stack124, Text as Text98 } from "@mantine/core";
|
|
18753
18788
|
|
|
18754
18789
|
// src/mantine/blocks/email/template/TemplateConfig.tsx
|
|
18755
|
-
import React177, { useCallback as
|
|
18790
|
+
import React177, { useCallback as useCallback51, useMemo as useMemo55 } from "react";
|
|
18756
18791
|
|
|
18757
18792
|
// src/mantine/blocks/email/template/GeneralTab.tsx
|
|
18758
|
-
import React175, { useEffect as
|
|
18793
|
+
import React175, { useEffect as useEffect51, useState as useState66, useCallback as useCallback49, useRef as useRef14 } from "react";
|
|
18759
18794
|
import { Divider as Divider14, Loader as Loader23, Select as Select4, Stack as Stack122, Text as Text96 } from "@mantine/core";
|
|
18760
18795
|
var GeneralTab10 = ({ editor, blockId, getCurrentBlock, onTitleChange, onTemplateChange, onToChange }) => {
|
|
18761
18796
|
const handlers = useBlocknoteHandlers();
|
|
18762
18797
|
const block = getCurrentBlock();
|
|
18763
18798
|
const blockProps = block.props;
|
|
18764
|
-
const [localTitle, setLocalTitle] =
|
|
18765
|
-
const [localTemplateName, setLocalTemplateName] =
|
|
18766
|
-
const [localTo, setLocalTo] =
|
|
18767
|
-
const [templates, setTemplates] =
|
|
18768
|
-
const [loadingTemplates, setLoadingTemplates] =
|
|
18769
|
-
const [loadingContent, setLoadingContent] =
|
|
18770
|
-
const [error, setError] =
|
|
18771
|
-
|
|
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(() => {
|
|
18772
18807
|
const currentBlock = getCurrentBlock();
|
|
18773
18808
|
setLocalTitle(currentBlock.props.title || "");
|
|
18774
18809
|
setLocalTemplateName(currentBlock.props.templateName || "");
|
|
18775
18810
|
setLocalTo(currentBlock.props.to || "");
|
|
18776
18811
|
}, [getCurrentBlock]);
|
|
18777
18812
|
const hasLoadedTemplates = useRef14(false);
|
|
18778
|
-
|
|
18813
|
+
useEffect51(() => {
|
|
18779
18814
|
if (hasLoadedTemplates.current) return;
|
|
18780
18815
|
async function loadTemplates() {
|
|
18781
18816
|
if (!handlers.listEmailTemplates) {
|
|
@@ -18797,7 +18832,7 @@ var GeneralTab10 = ({ editor, blockId, getCurrentBlock, onTitleChange, onTemplat
|
|
|
18797
18832
|
}
|
|
18798
18833
|
loadTemplates();
|
|
18799
18834
|
}, [handlers.listEmailTemplates]);
|
|
18800
|
-
const handleTemplateSelect =
|
|
18835
|
+
const handleTemplateSelect = useCallback49(
|
|
18801
18836
|
async (selectedTemplateName) => {
|
|
18802
18837
|
if (!selectedTemplateName) {
|
|
18803
18838
|
setLocalTemplateName("");
|
|
@@ -18886,7 +18921,7 @@ var GeneralTab10 = ({ editor, blockId, getCurrentBlock, onTitleChange, onTemplat
|
|
|
18886
18921
|
};
|
|
18887
18922
|
|
|
18888
18923
|
// src/mantine/blocks/email/template/VariablesTab.tsx
|
|
18889
|
-
import React176, { useMemo as useMemo54, useCallback as
|
|
18924
|
+
import React176, { useMemo as useMemo54, useCallback as useCallback50, useState as useState67, useEffect as useEffect52 } from "react";
|
|
18890
18925
|
import { Alert as Alert24, Badge as Badge26, Divider as Divider15, Group as Group58, Stack as Stack123, Text as Text97 } from "@mantine/core";
|
|
18891
18926
|
import { IconInfoCircle as IconInfoCircle4, IconCheck as IconCheck7 } from "@tabler/icons-react";
|
|
18892
18927
|
var VariablesTab = ({ editor, blockId, getCurrentBlock, onVariablesChange }) => {
|
|
@@ -18906,8 +18941,8 @@ var VariablesTab = ({ editor, blockId, getCurrentBlock, onVariablesChange }) =>
|
|
|
18906
18941
|
return {};
|
|
18907
18942
|
}
|
|
18908
18943
|
}, [blockProps.variables]);
|
|
18909
|
-
const [localMapping, setLocalMapping] =
|
|
18910
|
-
|
|
18944
|
+
const [localMapping, setLocalMapping] = useState67(parsedVariableMapping);
|
|
18945
|
+
useEffect52(() => {
|
|
18911
18946
|
const currentBlock = getCurrentBlock();
|
|
18912
18947
|
try {
|
|
18913
18948
|
const mapping = JSON.parse(currentBlock.props.variables || "{}");
|
|
@@ -18916,7 +18951,7 @@ var VariablesTab = ({ editor, blockId, getCurrentBlock, onVariablesChange }) =>
|
|
|
18916
18951
|
setLocalMapping({});
|
|
18917
18952
|
}
|
|
18918
18953
|
}, [getCurrentBlock]);
|
|
18919
|
-
const handleVariableChange =
|
|
18954
|
+
const handleVariableChange = useCallback50(
|
|
18920
18955
|
(variableName, value) => {
|
|
18921
18956
|
const updated = { ...localMapping, [variableName]: value };
|
|
18922
18957
|
setLocalMapping(updated);
|
|
@@ -18949,11 +18984,11 @@ var VariablesTab = ({ editor, blockId, getCurrentBlock, onVariablesChange }) =>
|
|
|
18949
18984
|
// src/mantine/blocks/email/template/TemplateConfig.tsx
|
|
18950
18985
|
var TemplateConfig10 = ({ editor, block }) => {
|
|
18951
18986
|
const { closePanel } = usePanelStore();
|
|
18952
|
-
const getCurrentBlock =
|
|
18987
|
+
const getCurrentBlock = useCallback51(() => {
|
|
18953
18988
|
const currentBlock = editor.document.find((b) => b.id === block.id);
|
|
18954
18989
|
return currentBlock || block;
|
|
18955
18990
|
}, [editor, block.id]);
|
|
18956
|
-
const updateProp =
|
|
18991
|
+
const updateProp = useCallback51(
|
|
18957
18992
|
(key, value) => {
|
|
18958
18993
|
const currentBlock = getCurrentBlock();
|
|
18959
18994
|
editor.updateBlock(currentBlock, {
|
|
@@ -18965,7 +19000,7 @@ var TemplateConfig10 = ({ editor, block }) => {
|
|
|
18965
19000
|
},
|
|
18966
19001
|
[editor, getCurrentBlock]
|
|
18967
19002
|
);
|
|
18968
|
-
const handleTemplateChange =
|
|
19003
|
+
const handleTemplateChange = useCallback51(
|
|
18969
19004
|
(updates) => {
|
|
18970
19005
|
const currentBlock = getCurrentBlock();
|
|
18971
19006
|
editor.updateBlock(currentBlock, {
|
|
@@ -18977,7 +19012,7 @@ var TemplateConfig10 = ({ editor, block }) => {
|
|
|
18977
19012
|
},
|
|
18978
19013
|
[editor, getCurrentBlock]
|
|
18979
19014
|
);
|
|
18980
|
-
const handleVariablesChange =
|
|
19015
|
+
const handleVariablesChange = useCallback51(
|
|
18981
19016
|
(variables) => {
|
|
18982
19017
|
updateProp("variables", variables);
|
|
18983
19018
|
},
|
|
@@ -19047,11 +19082,11 @@ import { Group as Group60, Stack as Stack125, Text as Text99, ActionIcon as Acti
|
|
|
19047
19082
|
import { IconSend as IconSend4, IconCheck as IconCheck8, IconX as IconX11 } from "@tabler/icons-react";
|
|
19048
19083
|
|
|
19049
19084
|
// src/mantine/blocks/email/flow/hooks/useEmailActions.ts
|
|
19050
|
-
import { useState as
|
|
19085
|
+
import { useState as useState68, useCallback as useCallback52 } from "react";
|
|
19051
19086
|
function useEmailActions({ block, editor }) {
|
|
19052
19087
|
const handlers = useBlocknoteHandlers();
|
|
19053
|
-
const [loading, setLoading] =
|
|
19054
|
-
const updateBlockStatus =
|
|
19088
|
+
const [loading, setLoading] = useState68(false);
|
|
19089
|
+
const updateBlockStatus = useCallback52(
|
|
19055
19090
|
(updates) => {
|
|
19056
19091
|
editor.updateBlock(block, {
|
|
19057
19092
|
props: { ...block.props, ...updates }
|
|
@@ -19059,7 +19094,7 @@ function useEmailActions({ block, editor }) {
|
|
|
19059
19094
|
},
|
|
19060
19095
|
[editor, block]
|
|
19061
19096
|
);
|
|
19062
|
-
const sendEmail =
|
|
19097
|
+
const sendEmail = useCallback52(async () => {
|
|
19063
19098
|
if (!handlers.sendEmail) {
|
|
19064
19099
|
updateBlockStatus({
|
|
19065
19100
|
status: "error",
|
|
@@ -19126,7 +19161,7 @@ function useEmailActions({ block, editor }) {
|
|
|
19126
19161
|
setLoading(false);
|
|
19127
19162
|
}
|
|
19128
19163
|
}, [block, editor, handlers, updateBlockStatus]);
|
|
19129
|
-
const resetStatus =
|
|
19164
|
+
const resetStatus = useCallback52(() => {
|
|
19130
19165
|
updateBlockStatus({
|
|
19131
19166
|
status: "idle",
|
|
19132
19167
|
error: ""
|
|
@@ -19283,15 +19318,15 @@ import React188 from "react";
|
|
|
19283
19318
|
import React184, { useMemo as useMemo59 } from "react";
|
|
19284
19319
|
|
|
19285
19320
|
// src/mantine/blocks/protocolSelector/template/TemplateConfig.tsx
|
|
19286
|
-
import React183, { useCallback as
|
|
19321
|
+
import React183, { useCallback as useCallback53 } from "react";
|
|
19287
19322
|
|
|
19288
19323
|
// src/mantine/blocks/protocolSelector/template/GeneralTab.tsx
|
|
19289
|
-
import React182, { useEffect as
|
|
19324
|
+
import React182, { useEffect as useEffect53, useMemo as useMemo58, useState as useState69 } from "react";
|
|
19290
19325
|
import { Divider as Divider17, Stack as Stack126, Text as Text100, PillsInput as PillsInput2, Pill as Pill2, Box as Box35 } from "@mantine/core";
|
|
19291
19326
|
var GeneralTab11 = ({ title, description, protocolDids, onTitleChange, onDescriptionChange, onProtocolDidsChange }) => {
|
|
19292
|
-
const [localTitle, setLocalTitle] =
|
|
19293
|
-
const [localDescription, setLocalDescription] =
|
|
19294
|
-
const [inputValue, setInputValue] =
|
|
19327
|
+
const [localTitle, setLocalTitle] = useState69(title || "");
|
|
19328
|
+
const [localDescription, setLocalDescription] = useState69(description || "");
|
|
19329
|
+
const [inputValue, setInputValue] = useState69("");
|
|
19295
19330
|
const localDids = useMemo58(() => {
|
|
19296
19331
|
try {
|
|
19297
19332
|
const parsed = JSON.parse(protocolDids || "[]");
|
|
@@ -19300,10 +19335,10 @@ var GeneralTab11 = ({ title, description, protocolDids, onTitleChange, onDescrip
|
|
|
19300
19335
|
return [];
|
|
19301
19336
|
}
|
|
19302
19337
|
}, [protocolDids]);
|
|
19303
|
-
|
|
19338
|
+
useEffect53(() => {
|
|
19304
19339
|
setLocalTitle(title || "");
|
|
19305
19340
|
}, [title]);
|
|
19306
|
-
|
|
19341
|
+
useEffect53(() => {
|
|
19307
19342
|
setLocalDescription(description || "");
|
|
19308
19343
|
}, [description]);
|
|
19309
19344
|
const handleAddDid = () => {
|
|
@@ -19361,7 +19396,7 @@ var GeneralTab11 = ({ title, description, protocolDids, onTitleChange, onDescrip
|
|
|
19361
19396
|
// src/mantine/blocks/protocolSelector/template/TemplateConfig.tsx
|
|
19362
19397
|
var TemplateConfig11 = ({ editor, block }) => {
|
|
19363
19398
|
const { closePanel } = usePanelStore();
|
|
19364
|
-
const updateProp =
|
|
19399
|
+
const updateProp = useCallback53(
|
|
19365
19400
|
(key, value) => {
|
|
19366
19401
|
editor.updateBlock(block, {
|
|
19367
19402
|
props: {
|
|
@@ -19436,7 +19471,7 @@ import { Badge as Badge29, Box as Box38, Group as Group63, Stack as Stack129, Te
|
|
|
19436
19471
|
import { IconCircleDashed as IconCircleDashed3, IconChecks } from "@tabler/icons-react";
|
|
19437
19472
|
|
|
19438
19473
|
// src/mantine/blocks/protocolSelector/flow/ProtocolSelectionPanel.tsx
|
|
19439
|
-
import React186, { useState as
|
|
19474
|
+
import React186, { useState as useState70, useEffect as useEffect54, useMemo as useMemo60, useCallback as useCallback54 } from "react";
|
|
19440
19475
|
import { Stack as Stack128, Text as Text102, Box as Box37, Group as Group62, Loader as Loader25 } from "@mantine/core";
|
|
19441
19476
|
|
|
19442
19477
|
// src/icons/EntityAvatar.tsx
|
|
@@ -19474,8 +19509,8 @@ var ProtocolSelectionPanel = ({ editor, block }) => {
|
|
|
19474
19509
|
return [];
|
|
19475
19510
|
}
|
|
19476
19511
|
}, [block.props.protocolDids]);
|
|
19477
|
-
const [protocols, setProtocols] =
|
|
19478
|
-
|
|
19512
|
+
const [protocols, setProtocols] = useState70([]);
|
|
19513
|
+
useEffect54(() => {
|
|
19479
19514
|
if (protocolDids.length === 0) {
|
|
19480
19515
|
setProtocols([]);
|
|
19481
19516
|
return;
|
|
@@ -19543,7 +19578,7 @@ var ProtocolSelectionPanel = ({ editor, block }) => {
|
|
|
19543
19578
|
}
|
|
19544
19579
|
});
|
|
19545
19580
|
}, [protocolDids, handlers]);
|
|
19546
|
-
const handleSelectProtocol =
|
|
19581
|
+
const handleSelectProtocol = useCallback54(
|
|
19547
19582
|
(protocol) => {
|
|
19548
19583
|
editor.updateBlock(block, {
|
|
19549
19584
|
props: {
|
|
@@ -19699,22 +19734,22 @@ import React192, { useMemo as useMemo62 } from "react";
|
|
|
19699
19734
|
import { Badge as Badge30, Group as Group64, Stack as Stack130, Text as Text105 } from "@mantine/core";
|
|
19700
19735
|
|
|
19701
19736
|
// src/mantine/blocks/form/template/TemplateConfig.tsx
|
|
19702
|
-
import React191, { useCallback as
|
|
19737
|
+
import React191, { useCallback as useCallback55 } from "react";
|
|
19703
19738
|
import { Paper as Paper16, CloseButton as CloseButton6, Title as Title9 } from "@mantine/core";
|
|
19704
19739
|
|
|
19705
19740
|
// src/mantine/blocks/form/template/GeneralTab.tsx
|
|
19706
|
-
import React190, { useEffect as
|
|
19741
|
+
import React190, { useEffect as useEffect55, useState as useState71 } from "react";
|
|
19707
19742
|
import { Text as Text104 } from "@mantine/core";
|
|
19708
19743
|
var GeneralTab12 = ({ title, description, icon, surveySchema, onTitleChange, onDescriptionChange, onIconChange, onSurveySchemaChange }) => {
|
|
19709
|
-
const [localTitle, setLocalTitle] =
|
|
19710
|
-
const [localDescription, setLocalDescription] =
|
|
19711
|
-
const [localIcon, setLocalIcon] =
|
|
19712
|
-
const [localSchema, setLocalSchema] =
|
|
19713
|
-
const [schemaError, setSchemaError] =
|
|
19714
|
-
|
|
19715
|
-
|
|
19716
|
-
|
|
19717
|
-
|
|
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]);
|
|
19718
19753
|
const handleSchemaChange = (value) => {
|
|
19719
19754
|
setLocalSchema(value);
|
|
19720
19755
|
setSchemaError(null);
|
|
@@ -19784,7 +19819,7 @@ var GeneralTab12 = ({ title, description, icon, surveySchema, onTitleChange, onD
|
|
|
19784
19819
|
// src/mantine/blocks/form/template/TemplateConfig.tsx
|
|
19785
19820
|
var TemplateConfig12 = ({ editor, block }) => {
|
|
19786
19821
|
const { closePanel } = usePanelStore();
|
|
19787
|
-
const updateProp =
|
|
19822
|
+
const updateProp = useCallback55(
|
|
19788
19823
|
(key, value) => {
|
|
19789
19824
|
editor.updateBlock(block, {
|
|
19790
19825
|
props: {
|
|
@@ -19858,12 +19893,12 @@ var FormTemplateView = ({ editor, block }) => {
|
|
|
19858
19893
|
};
|
|
19859
19894
|
|
|
19860
19895
|
// src/mantine/blocks/form/flow/FlowView.tsx
|
|
19861
|
-
import React194, { useMemo as useMemo64, useState as
|
|
19896
|
+
import React194, { useMemo as useMemo64, useState as useState72, useCallback as useCallback57 } from "react";
|
|
19862
19897
|
import { ActionIcon as ActionIcon31, Badge as Badge31, Group as Group65, Stack as Stack131, Text as Text107, Tooltip as Tooltip19 } from "@mantine/core";
|
|
19863
19898
|
import { IconChevronRight as IconChevronRight7 } from "@tabler/icons-react";
|
|
19864
19899
|
|
|
19865
19900
|
// src/mantine/blocks/form/flow/FormPanel.tsx
|
|
19866
|
-
import React193, { useCallback as
|
|
19901
|
+
import React193, { useCallback as useCallback56, useEffect as useEffect56, useMemo as useMemo63, useRef as useRef15 } from "react";
|
|
19867
19902
|
import { Alert as Alert26, Text as Text106 } from "@mantine/core";
|
|
19868
19903
|
import { useDebouncedCallback as useDebouncedCallback2 } from "@mantine/hooks";
|
|
19869
19904
|
import { IconAlertCircle as IconAlertCircle10 } from "@tabler/icons-react";
|
|
@@ -19907,7 +19942,7 @@ var FormPanel = ({ editor, block, onComplete }) => {
|
|
|
19907
19942
|
model.completeText = "Complete";
|
|
19908
19943
|
return model;
|
|
19909
19944
|
}, [surveySchema]);
|
|
19910
|
-
const syncPropToSurvey =
|
|
19945
|
+
const syncPropToSurvey = useCallback56(
|
|
19911
19946
|
(answersJson) => {
|
|
19912
19947
|
if (!surveyModel || !answersJson || answersJson === lastSyncedAnswers.current) return;
|
|
19913
19948
|
try {
|
|
@@ -19939,13 +19974,13 @@ var FormPanel = ({ editor, block, onComplete }) => {
|
|
|
19939
19974
|
}
|
|
19940
19975
|
});
|
|
19941
19976
|
}, SYNC_DEBOUNCE_MS2);
|
|
19942
|
-
|
|
19977
|
+
useEffect56(() => {
|
|
19943
19978
|
const answersJson = block.props.answers;
|
|
19944
19979
|
if (answersJson) {
|
|
19945
19980
|
syncPropToSurvey(answersJson);
|
|
19946
19981
|
}
|
|
19947
19982
|
}, [block.props.answers, syncPropToSurvey]);
|
|
19948
|
-
|
|
19983
|
+
useEffect56(() => {
|
|
19949
19984
|
if (!surveyModel) return;
|
|
19950
19985
|
const handleValueChanged = () => {
|
|
19951
19986
|
if (isUpdatingFromProp.current) return;
|
|
@@ -19956,7 +19991,7 @@ var FormPanel = ({ editor, block, onComplete }) => {
|
|
|
19956
19991
|
surveyModel.onValueChanged.remove(handleValueChanged);
|
|
19957
19992
|
};
|
|
19958
19993
|
}, [surveyModel, syncSurveyToProp]);
|
|
19959
|
-
const handleSurveyComplete =
|
|
19994
|
+
const handleSurveyComplete = useCallback56(
|
|
19960
19995
|
(sender) => {
|
|
19961
19996
|
const data = sender.data || {};
|
|
19962
19997
|
const finalAnswersJson = JSON.stringify(data);
|
|
@@ -19973,14 +20008,14 @@ var FormPanel = ({ editor, block, onComplete }) => {
|
|
|
19973
20008
|
},
|
|
19974
20009
|
[editor, block, onComplete]
|
|
19975
20010
|
);
|
|
19976
|
-
|
|
20011
|
+
useEffect56(() => {
|
|
19977
20012
|
if (!surveyModel) return;
|
|
19978
20013
|
surveyModel.onComplete.add(handleSurveyComplete);
|
|
19979
20014
|
return () => {
|
|
19980
20015
|
surveyModel.onComplete.remove(handleSurveyComplete);
|
|
19981
20016
|
};
|
|
19982
20017
|
}, [handleSurveyComplete, surveyModel]);
|
|
19983
|
-
const handleClose =
|
|
20018
|
+
const handleClose = useCallback56(() => {
|
|
19984
20019
|
closePanel();
|
|
19985
20020
|
}, [closePanel]);
|
|
19986
20021
|
if (!surveySchema) {
|
|
@@ -20000,10 +20035,10 @@ var FormPanel = ({ editor, block, onComplete }) => {
|
|
|
20000
20035
|
// src/mantine/blocks/form/flow/FlowView.tsx
|
|
20001
20036
|
var FORM_FLOW_PANEL_ID = "form-flow-panel";
|
|
20002
20037
|
var FormFlowView = ({ editor, block }) => {
|
|
20003
|
-
const [hasOpened, setHasOpened] =
|
|
20038
|
+
const [hasOpened, setHasOpened] = useState72(false);
|
|
20004
20039
|
const status = block.props.status || "pending";
|
|
20005
20040
|
const isCompleted = status === "completed";
|
|
20006
|
-
const handleComplete =
|
|
20041
|
+
const handleComplete = useCallback57(() => {
|
|
20007
20042
|
editor.updateBlock(block, {
|
|
20008
20043
|
props: {
|
|
20009
20044
|
...block.props,
|
|
@@ -20098,17 +20133,17 @@ import React199, { useMemo as useMemo65 } from "react";
|
|
|
20098
20133
|
import { Badge as Badge32, Group as Group66, Stack as Stack132, Text as Text108 } from "@mantine/core";
|
|
20099
20134
|
|
|
20100
20135
|
// src/mantine/blocks/domainCreatorSign/template/TemplateConfig.tsx
|
|
20101
|
-
import React198, { useCallback as
|
|
20136
|
+
import React198, { useCallback as useCallback58 } from "react";
|
|
20102
20137
|
|
|
20103
20138
|
// src/mantine/blocks/domainCreatorSign/template/GeneralTab.tsx
|
|
20104
|
-
import React197, { useEffect as
|
|
20139
|
+
import React197, { useEffect as useEffect57, useState as useState73 } from "react";
|
|
20105
20140
|
var GeneralTab13 = ({ title, description, icon, onTitleChange, onDescriptionChange, onIconChange }) => {
|
|
20106
|
-
const [localTitle, setLocalTitle] =
|
|
20107
|
-
const [localDescription, setLocalDescription] =
|
|
20108
|
-
const [localIcon, setLocalIcon] =
|
|
20109
|
-
|
|
20110
|
-
|
|
20111
|
-
|
|
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]);
|
|
20112
20147
|
return /* @__PURE__ */ React197.createElement(BaseSection, null, /* @__PURE__ */ React197.createElement(
|
|
20113
20148
|
BaseTextInput,
|
|
20114
20149
|
{
|
|
@@ -20153,7 +20188,7 @@ var GeneralTab13 = ({ title, description, icon, onTitleChange, onDescriptionChan
|
|
|
20153
20188
|
// src/mantine/blocks/domainCreatorSign/template/TemplateConfig.tsx
|
|
20154
20189
|
var TemplateConfig13 = ({ editor, block }) => {
|
|
20155
20190
|
const { closePanel } = usePanelStore();
|
|
20156
|
-
const updateProp =
|
|
20191
|
+
const updateProp = useCallback58(
|
|
20157
20192
|
(key, value) => {
|
|
20158
20193
|
editor.updateBlock(block, {
|
|
20159
20194
|
props: {
|
|
@@ -20212,14 +20247,14 @@ var DomainCreatorSignTemplateView = ({ editor, block }) => {
|
|
|
20212
20247
|
};
|
|
20213
20248
|
|
|
20214
20249
|
// src/mantine/blocks/domainCreatorSign/flow/FlowView.tsx
|
|
20215
|
-
import React202, { useCallback as
|
|
20250
|
+
import React202, { useCallback as useCallback60, useMemo as useMemo66, useEffect as useEffect58 } from "react";
|
|
20216
20251
|
import { ActionIcon as ActionIcon32, Badge as Badge34, Group as Group69, Stack as Stack135, Text as Text111, Tooltip as Tooltip21 } from "@mantine/core";
|
|
20217
20252
|
import { IconChevronRight as IconChevronRight8 } from "@tabler/icons-react";
|
|
20218
20253
|
|
|
20219
20254
|
// src/mantine/blocks/domainCreatorSign/flow/SignPanel.tsx
|
|
20220
20255
|
import { Alert as Alert27, Button as Button34, Group as Group68, Loader as Loader26, Stack as Stack134, Text as Text110 } from "@mantine/core";
|
|
20221
20256
|
import { IconAlertCircle as IconAlertCircle11, IconCheck as IconCheck9 } from "@tabler/icons-react";
|
|
20222
|
-
import React201, { useCallback as
|
|
20257
|
+
import React201, { useCallback as useCallback59, useState as useState75 } from "react";
|
|
20223
20258
|
|
|
20224
20259
|
// src/mantine/blocks/domainCreatorSign/utils/buildLinkedEntityResource.ts
|
|
20225
20260
|
function parseLinkedEntities2(entitiesString) {
|
|
@@ -20242,11 +20277,11 @@ function buildGovernanceGroupLinkedEntities(linkedEntities) {
|
|
|
20242
20277
|
// src/mantine/components/Base/BaseSigning.tsx
|
|
20243
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";
|
|
20244
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";
|
|
20245
|
-
import React200, { useState as
|
|
20280
|
+
import React200, { useState as useState74 } from "react";
|
|
20246
20281
|
function BaseSigning({ handleSign }) {
|
|
20247
|
-
const [value, setValue] =
|
|
20248
|
-
const [isSigned, setIsSigned] =
|
|
20249
|
-
const [activeTab, setActiveTab] =
|
|
20282
|
+
const [value, setValue] = useState74(23);
|
|
20283
|
+
const [isSigned, setIsSigned] = useState74(false);
|
|
20284
|
+
const [activeTab, setActiveTab] = useState74("agents");
|
|
20250
20285
|
const handleSlideEnd = (sliderValue) => {
|
|
20251
20286
|
if (sliderValue >= 60) {
|
|
20252
20287
|
setValue(73);
|
|
@@ -20360,22 +20395,22 @@ function BaseSigning({ handleSign }) {
|
|
|
20360
20395
|
var SignPanel = ({ editor, block, onComplete, onError }) => {
|
|
20361
20396
|
const { closePanel } = usePanelStore();
|
|
20362
20397
|
const { handlers } = useBlocknoteContext();
|
|
20363
|
-
const [flowStep, setFlowStep] =
|
|
20364
|
-
const [error, setError] =
|
|
20365
|
-
const [createdEntityDid, setCreatedEntityDid] =
|
|
20366
|
-
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(() => {
|
|
20367
20402
|
try {
|
|
20368
20403
|
return JSON.parse(block.props.domainCardData || "{}");
|
|
20369
20404
|
} catch {
|
|
20370
20405
|
return null;
|
|
20371
20406
|
}
|
|
20372
20407
|
}, [block.props.domainCardData]);
|
|
20373
|
-
const getDate100YearsFromNow =
|
|
20408
|
+
const getDate100YearsFromNow = useCallback59(() => {
|
|
20374
20409
|
const date = /* @__PURE__ */ new Date();
|
|
20375
20410
|
date.setFullYear(date.getFullYear() + 100);
|
|
20376
20411
|
return date.toISOString();
|
|
20377
20412
|
}, []);
|
|
20378
|
-
const processSignAndCreate =
|
|
20413
|
+
const processSignAndCreate = useCallback59(async () => {
|
|
20379
20414
|
if (!handlers) {
|
|
20380
20415
|
throw new Error("Handlers not available");
|
|
20381
20416
|
}
|
|
@@ -20463,7 +20498,7 @@ var SignPanel = ({ editor, block, onComplete, onError }) => {
|
|
|
20463
20498
|
transactionHash
|
|
20464
20499
|
};
|
|
20465
20500
|
}, [handlers, getDomainCardData, block, editor, getDate100YearsFromNow]);
|
|
20466
|
-
const handleSign =
|
|
20501
|
+
const handleSign = useCallback59(async () => {
|
|
20467
20502
|
try {
|
|
20468
20503
|
const result = await processSignAndCreate();
|
|
20469
20504
|
setCreatedEntityDid(result.entityDid);
|
|
@@ -20477,7 +20512,7 @@ var SignPanel = ({ editor, block, onComplete, onError }) => {
|
|
|
20477
20512
|
onError?.(errorMessage);
|
|
20478
20513
|
}
|
|
20479
20514
|
}, [processSignAndCreate, onComplete, onError]);
|
|
20480
|
-
const handleRetry =
|
|
20515
|
+
const handleRetry = useCallback59(() => {
|
|
20481
20516
|
setFlowStep("ready");
|
|
20482
20517
|
setError(null);
|
|
20483
20518
|
editor.updateBlock(block, {
|
|
@@ -20488,10 +20523,10 @@ var SignPanel = ({ editor, block, onComplete, onError }) => {
|
|
|
20488
20523
|
}
|
|
20489
20524
|
});
|
|
20490
20525
|
}, [editor, block]);
|
|
20491
|
-
const handleClose =
|
|
20526
|
+
const handleClose = useCallback59(() => {
|
|
20492
20527
|
closePanel();
|
|
20493
20528
|
}, [closePanel]);
|
|
20494
|
-
const handleVisitEntity =
|
|
20529
|
+
const handleVisitEntity = useCallback59(() => {
|
|
20495
20530
|
const entityType = block.props.entityType || "dao";
|
|
20496
20531
|
if (createdEntityDid && handlers?.redirectToEntityOverview) {
|
|
20497
20532
|
handlers.redirectToEntityOverview(createdEntityDid, entityType);
|
|
@@ -20539,7 +20574,7 @@ var DomainCreatorSignFlowView = ({ editor, block }) => {
|
|
|
20539
20574
|
const status = block.props.status || "pending";
|
|
20540
20575
|
const domainCardData = block.props.domainCardData || "{}";
|
|
20541
20576
|
const isDataReady = isDomainCardDataReady(domainCardData);
|
|
20542
|
-
|
|
20577
|
+
useEffect58(() => {
|
|
20543
20578
|
if (status === "pending" && isDataReady) {
|
|
20544
20579
|
editor.updateBlock(block, {
|
|
20545
20580
|
props: {
|
|
@@ -20549,7 +20584,7 @@ var DomainCreatorSignFlowView = ({ editor, block }) => {
|
|
|
20549
20584
|
});
|
|
20550
20585
|
}
|
|
20551
20586
|
}, [isDataReady, status, editor, block]);
|
|
20552
|
-
const handleComplete =
|
|
20587
|
+
const handleComplete = useCallback60(
|
|
20553
20588
|
(result) => {
|
|
20554
20589
|
editor.updateBlock(block, {
|
|
20555
20590
|
props: {
|
|
@@ -20562,7 +20597,7 @@ var DomainCreatorSignFlowView = ({ editor, block }) => {
|
|
|
20562
20597
|
},
|
|
20563
20598
|
[editor, block]
|
|
20564
20599
|
);
|
|
20565
|
-
const handleError =
|
|
20600
|
+
const handleError = useCallback60(
|
|
20566
20601
|
(errorMessage) => {
|
|
20567
20602
|
editor.updateBlock(block, {
|
|
20568
20603
|
props: {
|
|
@@ -20687,18 +20722,18 @@ import React207, { useMemo as useMemo67 } from "react";
|
|
|
20687
20722
|
import { Badge as Badge35, Group as Group70, Stack as Stack136, Text as Text112 } from "@mantine/core";
|
|
20688
20723
|
|
|
20689
20724
|
// src/mantine/blocks/domainCardViewer/template/TemplateConfig.tsx
|
|
20690
|
-
import React206, { useCallback as
|
|
20725
|
+
import React206, { useCallback as useCallback61 } from "react";
|
|
20691
20726
|
import { Paper as Paper17, CloseButton as CloseButton7, Title as Title10 } from "@mantine/core";
|
|
20692
20727
|
|
|
20693
20728
|
// src/mantine/blocks/domainCardViewer/template/GeneralTab.tsx
|
|
20694
|
-
import React205, { useEffect as
|
|
20729
|
+
import React205, { useEffect as useEffect59, useState as useState76 } from "react";
|
|
20695
20730
|
var GeneralTab14 = ({ title, description, icon, onTitleChange, onDescriptionChange, onIconChange }) => {
|
|
20696
|
-
const [localTitle, setLocalTitle] =
|
|
20697
|
-
const [localDescription, setLocalDescription] =
|
|
20698
|
-
const [localIcon, setLocalIcon] =
|
|
20699
|
-
|
|
20700
|
-
|
|
20701
|
-
|
|
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]);
|
|
20702
20737
|
return /* @__PURE__ */ React205.createElement(BaseSection, null, /* @__PURE__ */ React205.createElement(
|
|
20703
20738
|
BaseTextInput,
|
|
20704
20739
|
{
|
|
@@ -20743,7 +20778,7 @@ var GeneralTab14 = ({ title, description, icon, onTitleChange, onDescriptionChan
|
|
|
20743
20778
|
// src/mantine/blocks/domainCardViewer/template/TemplateConfig.tsx
|
|
20744
20779
|
var TemplateConfig14 = ({ editor, block }) => {
|
|
20745
20780
|
const { closePanel } = usePanelStore();
|
|
20746
|
-
const updateProp =
|
|
20781
|
+
const updateProp = useCallback61(
|
|
20747
20782
|
(key, value) => {
|
|
20748
20783
|
editor.updateBlock(block, {
|
|
20749
20784
|
props: {
|
|
@@ -20814,7 +20849,7 @@ var DomainCardViewerTemplateView = ({ editor, block }) => {
|
|
|
20814
20849
|
};
|
|
20815
20850
|
|
|
20816
20851
|
// src/mantine/blocks/domainCardViewer/flow/FlowView.tsx
|
|
20817
|
-
import React209, { useMemo as useMemo69, useCallback as
|
|
20852
|
+
import React209, { useMemo as useMemo69, useCallback as useCallback62, useEffect as useEffect60 } from "react";
|
|
20818
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";
|
|
20819
20854
|
import { IconChevronRight as IconChevronRight9, IconLoader, IconTestPipe, IconTrash as IconTrash6 } from "@tabler/icons-react";
|
|
20820
20855
|
|
|
@@ -21129,7 +21164,7 @@ var DomainCardViewerFlowView = ({ editor, block }) => {
|
|
|
21129
21164
|
const status = block.props.status || "pending";
|
|
21130
21165
|
const domainPreviewData = block.props.domainPreviewData || "{}";
|
|
21131
21166
|
const isDataReady = isPreviewDataReady(domainPreviewData);
|
|
21132
|
-
|
|
21167
|
+
useEffect60(() => {
|
|
21133
21168
|
if (status === "pending" && isDataReady) {
|
|
21134
21169
|
editor.updateBlock(block, {
|
|
21135
21170
|
props: {
|
|
@@ -21139,7 +21174,7 @@ var DomainCardViewerFlowView = ({ editor, block }) => {
|
|
|
21139
21174
|
});
|
|
21140
21175
|
}
|
|
21141
21176
|
}, [isDataReady, status, editor, block]);
|
|
21142
|
-
const handleApprove =
|
|
21177
|
+
const handleApprove = useCallback62(() => {
|
|
21143
21178
|
editor.updateBlock(block, {
|
|
21144
21179
|
props: {
|
|
21145
21180
|
...block.props,
|
|
@@ -21150,7 +21185,7 @@ var DomainCardViewerFlowView = ({ editor, block }) => {
|
|
|
21150
21185
|
const panelId = `${DOMAIN_CARD_VIEWER_FLOW_PANEL_ID}-${block.id}`;
|
|
21151
21186
|
const panelContent = useMemo69(() => /* @__PURE__ */ React209.createElement(ViewerPanel, { editor, block, onApprove: handleApprove }), [editor, block, handleApprove]);
|
|
21152
21187
|
const { open } = usePanel(panelId, panelContent);
|
|
21153
|
-
const handleInjectDummyData =
|
|
21188
|
+
const handleInjectDummyData = useCallback62(
|
|
21154
21189
|
(e) => {
|
|
21155
21190
|
e.stopPropagation();
|
|
21156
21191
|
editor.updateBlock(block, {
|
|
@@ -21166,7 +21201,7 @@ var DomainCardViewerFlowView = ({ editor, block }) => {
|
|
|
21166
21201
|
},
|
|
21167
21202
|
[editor, block]
|
|
21168
21203
|
);
|
|
21169
|
-
const handleSetLoading =
|
|
21204
|
+
const handleSetLoading = useCallback62(
|
|
21170
21205
|
(e) => {
|
|
21171
21206
|
e.stopPropagation();
|
|
21172
21207
|
editor.updateBlock(block, {
|
|
@@ -21179,7 +21214,7 @@ var DomainCardViewerFlowView = ({ editor, block }) => {
|
|
|
21179
21214
|
},
|
|
21180
21215
|
[editor, block]
|
|
21181
21216
|
);
|
|
21182
|
-
const handleClearData =
|
|
21217
|
+
const handleClearData = useCallback62(
|
|
21183
21218
|
(e) => {
|
|
21184
21219
|
e.stopPropagation();
|
|
21185
21220
|
editor.updateBlock(block, {
|
|
@@ -21282,10 +21317,10 @@ import React214, { useMemo as useMemo70 } from "react";
|
|
|
21282
21317
|
import { Badge as Badge37, Group as Group72, Stack as Stack140, Text as Text116 } from "@mantine/core";
|
|
21283
21318
|
|
|
21284
21319
|
// src/mantine/blocks/governanceGroup/template/TemplateConfig.tsx
|
|
21285
|
-
import React213, { useCallback as
|
|
21320
|
+
import React213, { useCallback as useCallback63 } from "react";
|
|
21286
21321
|
|
|
21287
21322
|
// src/mantine/blocks/governanceGroup/template/GeneralTab.tsx
|
|
21288
|
-
import React212, { useEffect as
|
|
21323
|
+
import React212, { useEffect as useEffect61, useState as useState77 } from "react";
|
|
21289
21324
|
import { Card as Card19, SimpleGrid as SimpleGrid2, Stack as Stack139, Text as Text115, ThemeIcon as ThemeIcon3 } from "@mantine/core";
|
|
21290
21325
|
import { IconUsers as IconUsers4, IconSignature, IconPhoto as IconPhoto2, IconCoin } from "@tabler/icons-react";
|
|
21291
21326
|
|
|
@@ -21325,12 +21360,12 @@ var GROUP_TYPE_ICONS = {
|
|
|
21325
21360
|
tokenStaking: /* @__PURE__ */ React212.createElement(IconCoin, { size: 20 })
|
|
21326
21361
|
};
|
|
21327
21362
|
var GeneralTab15 = ({ title, description, icon, groupType, onTitleChange, onDescriptionChange, onIconChange, onGroupTypeChange }) => {
|
|
21328
|
-
const [localTitle, setLocalTitle] =
|
|
21329
|
-
const [localDescription, setLocalDescription] =
|
|
21330
|
-
const [localIcon, setLocalIcon] =
|
|
21331
|
-
|
|
21332
|
-
|
|
21333
|
-
|
|
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]);
|
|
21334
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) => {
|
|
21335
21370
|
const isSelected = groupType === config.type;
|
|
21336
21371
|
return /* @__PURE__ */ React212.createElement(
|
|
@@ -22118,7 +22153,7 @@ var getSurveyForGroupType = (groupType) => {
|
|
|
22118
22153
|
// src/mantine/blocks/governanceGroup/template/TemplateConfig.tsx
|
|
22119
22154
|
var TemplateConfig15 = ({ editor, block }) => {
|
|
22120
22155
|
const { closePanel } = usePanelStore();
|
|
22121
|
-
const updateProp =
|
|
22156
|
+
const updateProp = useCallback63(
|
|
22122
22157
|
(key, value) => {
|
|
22123
22158
|
editor.updateBlock(block, {
|
|
22124
22159
|
props: {
|
|
@@ -22129,7 +22164,7 @@ var TemplateConfig15 = ({ editor, block }) => {
|
|
|
22129
22164
|
},
|
|
22130
22165
|
[editor, block]
|
|
22131
22166
|
);
|
|
22132
|
-
const handleGroupTypeChange =
|
|
22167
|
+
const handleGroupTypeChange = useCallback63(
|
|
22133
22168
|
(groupType) => {
|
|
22134
22169
|
const surveySchema = getSurveyForGroupType(groupType);
|
|
22135
22170
|
editor.updateBlock(block, {
|
|
@@ -22199,12 +22234,12 @@ var GovernanceGroupTemplateView = ({ editor, block }) => {
|
|
|
22199
22234
|
};
|
|
22200
22235
|
|
|
22201
22236
|
// src/mantine/blocks/governanceGroup/flow/FlowView.tsx
|
|
22202
|
-
import React216, { useCallback as
|
|
22237
|
+
import React216, { useCallback as useCallback65, useEffect as useEffect63, useMemo as useMemo72, useRef as useRef17, useState as useState79 } from "react";
|
|
22203
22238
|
import { ActionIcon as ActionIcon34, Badge as Badge38, Group as Group74, Stack as Stack142, Text as Text118, Tooltip as Tooltip23 } from "@mantine/core";
|
|
22204
22239
|
import { IconChevronRight as IconChevronRight10 } from "@tabler/icons-react";
|
|
22205
22240
|
|
|
22206
22241
|
// src/mantine/blocks/governanceGroup/flow/GovernanceGroupPanel.tsx
|
|
22207
|
-
import React215, { useCallback as
|
|
22242
|
+
import React215, { useCallback as useCallback64, useEffect as useEffect62, useMemo as useMemo71, useRef as useRef16, useState as useState78 } from "react";
|
|
22208
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";
|
|
22209
22244
|
import { useDebouncedCallback as useDebouncedCallback3 } from "@mantine/hooks";
|
|
22210
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";
|
|
@@ -22244,11 +22279,11 @@ var GovernanceGroupPanel = ({ editor, block, onComplete }) => {
|
|
|
22244
22279
|
if (existingGroupType) return "survey";
|
|
22245
22280
|
return "typeSelection";
|
|
22246
22281
|
};
|
|
22247
|
-
const [flowStep, setFlowStep] =
|
|
22248
|
-
const [selectedGroupType, setSelectedGroupType] =
|
|
22249
|
-
const [error, setError] =
|
|
22250
|
-
const [createdCoreAddress, setCreatedCoreAddress] =
|
|
22251
|
-
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);
|
|
22252
22287
|
const isUpdatingFromProp = useRef16(false);
|
|
22253
22288
|
const lastSyncedAnswers = useRef16("");
|
|
22254
22289
|
const surveyModel = useMemo71(() => {
|
|
@@ -22261,7 +22296,7 @@ var GovernanceGroupPanel = ({ editor, block, onComplete }) => {
|
|
|
22261
22296
|
model.questionsOnPageMode = "singlePage";
|
|
22262
22297
|
return model;
|
|
22263
22298
|
}, [selectedGroupType]);
|
|
22264
|
-
const syncPropToSurvey =
|
|
22299
|
+
const syncPropToSurvey = useCallback64(
|
|
22265
22300
|
(answersJson) => {
|
|
22266
22301
|
if (!answersJson || answersJson === lastSyncedAnswers.current || !surveyModel) return;
|
|
22267
22302
|
try {
|
|
@@ -22293,13 +22328,13 @@ var GovernanceGroupPanel = ({ editor, block, onComplete }) => {
|
|
|
22293
22328
|
}
|
|
22294
22329
|
});
|
|
22295
22330
|
}, SYNC_DEBOUNCE_MS3);
|
|
22296
|
-
|
|
22331
|
+
useEffect62(() => {
|
|
22297
22332
|
const answersJson = block.props.answers;
|
|
22298
22333
|
if (answersJson && surveyModel) {
|
|
22299
22334
|
syncPropToSurvey(answersJson);
|
|
22300
22335
|
}
|
|
22301
22336
|
}, [block.props.answers, syncPropToSurvey, surveyModel]);
|
|
22302
|
-
|
|
22337
|
+
useEffect62(() => {
|
|
22303
22338
|
if (!surveyModel) return;
|
|
22304
22339
|
const handleValueChanged = () => {
|
|
22305
22340
|
if (isUpdatingFromProp.current) return;
|
|
@@ -22324,7 +22359,7 @@ var GovernanceGroupPanel = ({ editor, block, onComplete }) => {
|
|
|
22324
22359
|
lastSyncedAnswers.current = "";
|
|
22325
22360
|
setFlowStep("survey");
|
|
22326
22361
|
};
|
|
22327
|
-
const processGroupCreation =
|
|
22362
|
+
const processGroupCreation = useCallback64(
|
|
22328
22363
|
async (data) => {
|
|
22329
22364
|
if (!handlers) {
|
|
22330
22365
|
throw new Error("Handlers not available");
|
|
@@ -22346,7 +22381,7 @@ var GovernanceGroupPanel = ({ editor, block, onComplete }) => {
|
|
|
22346
22381
|
},
|
|
22347
22382
|
[handlers, selectedGroupType]
|
|
22348
22383
|
);
|
|
22349
|
-
const handleSurveyComplete =
|
|
22384
|
+
const handleSurveyComplete = useCallback64(
|
|
22350
22385
|
async (sender) => {
|
|
22351
22386
|
const data = sender.data || {};
|
|
22352
22387
|
try {
|
|
@@ -22383,19 +22418,19 @@ var GovernanceGroupPanel = ({ editor, block, onComplete }) => {
|
|
|
22383
22418
|
},
|
|
22384
22419
|
[processGroupCreation, onComplete, editor, block, selectedGroupType]
|
|
22385
22420
|
);
|
|
22386
|
-
|
|
22421
|
+
useEffect62(() => {
|
|
22387
22422
|
if (!surveyModel) return;
|
|
22388
22423
|
surveyModel.onComplete.add(handleSurveyComplete);
|
|
22389
22424
|
return () => {
|
|
22390
22425
|
surveyModel.onComplete.remove(handleSurveyComplete);
|
|
22391
22426
|
};
|
|
22392
22427
|
}, [handleSurveyComplete, surveyModel]);
|
|
22393
|
-
const handleRetry =
|
|
22428
|
+
const handleRetry = useCallback64(() => {
|
|
22394
22429
|
setFlowStep("survey");
|
|
22395
22430
|
setError(null);
|
|
22396
22431
|
surveyModel?.clear();
|
|
22397
22432
|
}, [surveyModel]);
|
|
22398
|
-
const handleBackToTypeSelection =
|
|
22433
|
+
const handleBackToTypeSelection = useCallback64(() => {
|
|
22399
22434
|
setSelectedGroupType(null);
|
|
22400
22435
|
setFlowStep("typeSelection");
|
|
22401
22436
|
editor.updateBlock(block, {
|
|
@@ -22407,7 +22442,7 @@ var GovernanceGroupPanel = ({ editor, block, onComplete }) => {
|
|
|
22407
22442
|
}
|
|
22408
22443
|
});
|
|
22409
22444
|
}, [editor, block]);
|
|
22410
|
-
const handleClose =
|
|
22445
|
+
const handleClose = useCallback64(() => {
|
|
22411
22446
|
closePanel();
|
|
22412
22447
|
}, [closePanel]);
|
|
22413
22448
|
if (flowStep === "typeSelection") {
|
|
@@ -22450,13 +22485,13 @@ var GovernanceGroupPanel = ({ editor, block, onComplete }) => {
|
|
|
22450
22485
|
// src/mantine/blocks/governanceGroup/flow/FlowView.tsx
|
|
22451
22486
|
var GOVERNANCE_GROUP_FLOW_PANEL_ID = "governance-group-flow-panel";
|
|
22452
22487
|
var GovernanceGroupFlowView = ({ editor, block }) => {
|
|
22453
|
-
const [hasOpened, setHasOpened] =
|
|
22454
|
-
const [submissionStatus, setSubmissionStatus] =
|
|
22488
|
+
const [hasOpened, setHasOpened] = useState79(false);
|
|
22489
|
+
const [submissionStatus, setSubmissionStatus] = useState79("idle");
|
|
22455
22490
|
const lastSubmission = block.props.lastSubmission ? JSON.parse(block.props.lastSubmission) : null;
|
|
22456
22491
|
const hasExistingSubmission = lastSubmission?.coreAddress;
|
|
22457
22492
|
const editorRef = useRef17(editor);
|
|
22458
22493
|
const blockRef = useRef17(block);
|
|
22459
|
-
|
|
22494
|
+
useEffect63(() => {
|
|
22460
22495
|
editorRef.current = editor;
|
|
22461
22496
|
blockRef.current = block;
|
|
22462
22497
|
});
|
|
@@ -22479,7 +22514,7 @@ var GovernanceGroupFlowView = ({ editor, block }) => {
|
|
|
22479
22514
|
[]
|
|
22480
22515
|
);
|
|
22481
22516
|
const handleCompleteRef = useRef17();
|
|
22482
|
-
const handleComplete =
|
|
22517
|
+
const handleComplete = useCallback65((data) => {
|
|
22483
22518
|
const currentEditor = editorRef.current;
|
|
22484
22519
|
const currentBlock = blockRef.current;
|
|
22485
22520
|
currentEditor.updateBlock(currentBlock, {
|
|
@@ -22499,10 +22534,10 @@ var GovernanceGroupFlowView = ({ editor, block }) => {
|
|
|
22499
22534
|
});
|
|
22500
22535
|
setSubmissionStatus("success");
|
|
22501
22536
|
}, []);
|
|
22502
|
-
|
|
22537
|
+
useEffect63(() => {
|
|
22503
22538
|
handleCompleteRef.current = handleComplete;
|
|
22504
22539
|
});
|
|
22505
|
-
const stableHandleComplete =
|
|
22540
|
+
const stableHandleComplete = useCallback65(
|
|
22506
22541
|
(data) => {
|
|
22507
22542
|
handleCompleteRef.current?.(data);
|
|
22508
22543
|
},
|
|
@@ -22646,14 +22681,14 @@ function generateId(prefix) {
|
|
|
22646
22681
|
}
|
|
22647
22682
|
|
|
22648
22683
|
// src/mantine/blocks/flowLink/template/WorkspacePageSelector.tsx
|
|
22649
|
-
import React220, { useEffect as
|
|
22684
|
+
import React220, { useEffect as useEffect64, useState as useState80 } from "react";
|
|
22650
22685
|
import { Loader as Loader29, Alert as Alert30 } from "@mantine/core";
|
|
22651
22686
|
var WorkspacePageSelector = ({ selectedPageId, onSelect }) => {
|
|
22652
22687
|
const handlers = useBlocknoteHandlers();
|
|
22653
|
-
const [pages, setPages] =
|
|
22654
|
-
const [loading, setLoading] =
|
|
22655
|
-
const [error, setError] =
|
|
22656
|
-
|
|
22688
|
+
const [pages, setPages] = useState80([]);
|
|
22689
|
+
const [loading, setLoading] = useState80(false);
|
|
22690
|
+
const [error, setError] = useState80(null);
|
|
22691
|
+
useEffect64(() => {
|
|
22657
22692
|
const fetchPages = async () => {
|
|
22658
22693
|
if (!handlers.getWorkspacePages) {
|
|
22659
22694
|
setError("Workspace pages not supported");
|
|
@@ -22873,15 +22908,15 @@ import React225, { useMemo as useMemo75 } from "react";
|
|
|
22873
22908
|
import { Badge as Badge40, Group as Group78, Stack as Stack147, Text as Text122, Tooltip as Tooltip25 } from "@mantine/core";
|
|
22874
22909
|
|
|
22875
22910
|
// src/mantine/blocks/flowLink/flow/FlowLinkPanel.tsx
|
|
22876
|
-
import React224, { useState as
|
|
22911
|
+
import React224, { useState as useState81, useEffect as useEffect65, useCallback as useCallback66 } from "react";
|
|
22877
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";
|
|
22878
22913
|
import { IconRefresh as IconRefresh7, IconCheck as IconCheck12, IconClock as IconClock3, IconCircleDashed as IconCircleDashed4 } from "@tabler/icons-react";
|
|
22879
22914
|
var FlowLinkPanel = ({ block }) => {
|
|
22880
22915
|
const { closePanel } = usePanelStore();
|
|
22881
22916
|
const handlers = useBlocknoteHandlers();
|
|
22882
22917
|
const links = safeParseJSONArray(block.props.links).sort((a, b) => a.position - b.position);
|
|
22883
|
-
const [linksWithStatus, setLinksWithStatus] =
|
|
22884
|
-
const fetchStatuses =
|
|
22918
|
+
const [linksWithStatus, setLinksWithStatus] = useState81(links.map((link) => ({ ...link })));
|
|
22919
|
+
const fetchStatuses = useCallback66(async () => {
|
|
22885
22920
|
if (!handlers.getFlowStatus) {
|
|
22886
22921
|
return;
|
|
22887
22922
|
}
|
|
@@ -22898,7 +22933,7 @@ var FlowLinkPanel = ({ block }) => {
|
|
|
22898
22933
|
);
|
|
22899
22934
|
setLinksWithStatus(updatedLinks);
|
|
22900
22935
|
}, [handlers, links]);
|
|
22901
|
-
|
|
22936
|
+
useEffect65(() => {
|
|
22902
22937
|
fetchStatuses();
|
|
22903
22938
|
}, []);
|
|
22904
22939
|
const handleNavigate = (link) => {
|
|
@@ -23199,7 +23234,7 @@ blockRegistry.register({
|
|
|
23199
23234
|
});
|
|
23200
23235
|
|
|
23201
23236
|
// src/mantine/blocks/hooks/useBlockDependencies.ts
|
|
23202
|
-
import { useMemo as useMemo76, useEffect as
|
|
23237
|
+
import { useMemo as useMemo76, useEffect as useEffect66, useState as useState82, useCallback as useCallback67 } from "react";
|
|
23203
23238
|
|
|
23204
23239
|
// src/mantine/blocks/hooks/useDependsOn.ts
|
|
23205
23240
|
import { useMemo as useMemo77 } from "react";
|
|
@@ -23769,11 +23804,11 @@ import { useCreateBlockNote as useCreateBlockNote2 } from "@blocknote/react";
|
|
|
23769
23804
|
import { BlockNoteSchema as BlockNoteSchema2, defaultBlockSpecs as defaultBlockSpecs2, defaultInlineContentSpecs as defaultInlineContentSpecs2, defaultStyleSpecs as defaultStyleSpecs2 } from "@blocknote/core";
|
|
23770
23805
|
|
|
23771
23806
|
// src/core/hooks/useMatrixProvider.ts
|
|
23772
|
-
import { useEffect as
|
|
23807
|
+
import { useEffect as useEffect67, useState as useState83, useRef as useRef18, useCallback as useCallback68, useMemo as useMemo78 } from "react";
|
|
23773
23808
|
import { MatrixProvider } from "@ixo/matrix-crdt";
|
|
23774
23809
|
function useMatrixProvider({ matrixClient, roomId, yDoc }) {
|
|
23775
|
-
const [matrixProvider, setProvider] =
|
|
23776
|
-
const [status, setStatus] =
|
|
23810
|
+
const [matrixProvider, setProvider] = useState83(null);
|
|
23811
|
+
const [status, setStatus] = useState83("disconnected");
|
|
23777
23812
|
const isMountedRef = useRef18(true);
|
|
23778
23813
|
const providerRef = useRef18(null);
|
|
23779
23814
|
const retryTimeoutRef = useRef18(null);
|
|
@@ -23790,22 +23825,22 @@ function useMatrixProvider({ matrixClient, roomId, yDoc }) {
|
|
|
23790
23825
|
}),
|
|
23791
23826
|
[]
|
|
23792
23827
|
);
|
|
23793
|
-
const handleDocumentAvailable =
|
|
23828
|
+
const handleDocumentAvailable = useCallback68(() => {
|
|
23794
23829
|
if (isMountedRef.current) {
|
|
23795
23830
|
setStatus("connected");
|
|
23796
23831
|
}
|
|
23797
23832
|
}, []);
|
|
23798
|
-
const handleDocumentUnavailable =
|
|
23833
|
+
const handleDocumentUnavailable = useCallback68(() => {
|
|
23799
23834
|
if (isMountedRef.current) {
|
|
23800
23835
|
setStatus("failed");
|
|
23801
23836
|
}
|
|
23802
23837
|
}, []);
|
|
23803
|
-
const handleCanWriteChanged =
|
|
23838
|
+
const handleCanWriteChanged = useCallback68(() => {
|
|
23804
23839
|
if (isMountedRef.current && providerRef.current) {
|
|
23805
23840
|
setStatus(providerRef.current.canWrite ? "connected" : "failed");
|
|
23806
23841
|
}
|
|
23807
23842
|
}, []);
|
|
23808
|
-
const initProvider =
|
|
23843
|
+
const initProvider = useCallback68(async () => {
|
|
23809
23844
|
if (!isMountedRef.current) return;
|
|
23810
23845
|
if (retryTimeoutRef.current) {
|
|
23811
23846
|
clearTimeout(retryTimeoutRef.current);
|
|
@@ -23838,7 +23873,7 @@ function useMatrixProvider({ matrixClient, roomId, yDoc }) {
|
|
|
23838
23873
|
}
|
|
23839
23874
|
}
|
|
23840
23875
|
}, [matrixClient, providerOptions, handleDocumentAvailable, handleDocumentUnavailable, handleCanWriteChanged]);
|
|
23841
|
-
|
|
23876
|
+
useEffect67(() => {
|
|
23842
23877
|
isMountedRef.current = true;
|
|
23843
23878
|
initProvider();
|
|
23844
23879
|
return () => {
|
|
@@ -23855,7 +23890,7 @@ function useMatrixProvider({ matrixClient, roomId, yDoc }) {
|
|
|
23855
23890
|
setStatus("disconnected");
|
|
23856
23891
|
};
|
|
23857
23892
|
}, [initProvider]);
|
|
23858
|
-
|
|
23893
|
+
useEffect67(() => {
|
|
23859
23894
|
return () => {
|
|
23860
23895
|
isMountedRef.current = false;
|
|
23861
23896
|
};
|
|
@@ -23874,7 +23909,7 @@ function useCollaborativeYDoc(_options) {
|
|
|
23874
23909
|
}
|
|
23875
23910
|
|
|
23876
23911
|
// src/mantine/hooks/useCollaborativeIxoEditor.ts
|
|
23877
|
-
import { useMemo as useMemo80, useEffect as
|
|
23912
|
+
import { useMemo as useMemo80, useEffect as useEffect68, useState as useState84 } from "react";
|
|
23878
23913
|
|
|
23879
23914
|
// src/core/lib/matrixMetadata.ts
|
|
23880
23915
|
var COVER_IMAGE_EVENT_TYPE = "ixo.page.cover_image";
|
|
@@ -24059,7 +24094,7 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
24059
24094
|
roomId: options.roomId
|
|
24060
24095
|
});
|
|
24061
24096
|
const metadataManager = useMemo80(() => new MatrixMetadataManager(matrixClient, options.roomId), [matrixClient, options.roomId]);
|
|
24062
|
-
|
|
24097
|
+
useEffect68(() => {
|
|
24063
24098
|
return () => {
|
|
24064
24099
|
metadataManager.dispose();
|
|
24065
24100
|
};
|
|
@@ -24311,12 +24346,12 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
24311
24346
|
return void 0;
|
|
24312
24347
|
};
|
|
24313
24348
|
}
|
|
24314
|
-
|
|
24349
|
+
useEffect68(() => {
|
|
24315
24350
|
if (ixoEditor) {
|
|
24316
24351
|
ixoEditor.isEditable = editable;
|
|
24317
24352
|
}
|
|
24318
24353
|
}, [ixoEditor, editable]);
|
|
24319
|
-
|
|
24354
|
+
useEffect68(() => {
|
|
24320
24355
|
if (connectionStatus !== "connected") {
|
|
24321
24356
|
return;
|
|
24322
24357
|
}
|
|
@@ -24338,9 +24373,9 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
24338
24373
|
titleText.insert(0, options.title);
|
|
24339
24374
|
}
|
|
24340
24375
|
}, [connectionStatus, root, titleText, permissions.write, options.docId, options.title, memoizedUser.id]);
|
|
24341
|
-
const [connectedUsers, setConnectedUsers] =
|
|
24376
|
+
const [connectedUsers, setConnectedUsers] = useState84([]);
|
|
24342
24377
|
const webrtcProvider = matrixProvider?.webrtcProvider;
|
|
24343
|
-
|
|
24378
|
+
useEffect68(() => {
|
|
24344
24379
|
if (!matrixProvider?.awarenessInstance || !webrtcProvider || connectionStatus !== "connected") {
|
|
24345
24380
|
return;
|
|
24346
24381
|
}
|
|
@@ -24359,7 +24394,7 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
24359
24394
|
awareness.off("change", updateUsers);
|
|
24360
24395
|
};
|
|
24361
24396
|
}, [matrixProvider, webrtcProvider, connectionStatus]);
|
|
24362
|
-
|
|
24397
|
+
useEffect68(() => {
|
|
24363
24398
|
if (!matrixProvider?.awarenessInstance || !webrtcProvider || connectionStatus !== "connected") {
|
|
24364
24399
|
return;
|
|
24365
24400
|
}
|
|
@@ -24397,7 +24432,7 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
24397
24432
|
}
|
|
24398
24433
|
|
|
24399
24434
|
// src/mantine/components/Base/BaseIconPicker.tsx
|
|
24400
|
-
import React229, { useState as
|
|
24435
|
+
import React229, { useState as useState85, useMemo as useMemo81, useEffect as useEffect69 } from "react";
|
|
24401
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";
|
|
24402
24437
|
import * as TablerIcons from "@tabler/icons-react";
|
|
24403
24438
|
import { IconSearch as IconSearch6, IconX as IconX12, IconChevronLeft, IconChevronRight as IconChevronRight11 } from "@tabler/icons-react";
|
|
@@ -24455,9 +24490,9 @@ var localStorageService = {
|
|
|
24455
24490
|
var iconsKey = "editor_recent_icons";
|
|
24456
24491
|
var ICONS_PER_PAGE = 500;
|
|
24457
24492
|
function BaseIconPicker({ opened, onClose, onSelectIcon, onUploadClick, children, currentIcon }) {
|
|
24458
|
-
const [searchQuery, setSearchQuery] =
|
|
24459
|
-
const [activeTab, setActiveTab] =
|
|
24460
|
-
const [currentPage, setCurrentPage] =
|
|
24493
|
+
const [searchQuery, setSearchQuery] = useState85("");
|
|
24494
|
+
const [activeTab, setActiveTab] = useState85("icons");
|
|
24495
|
+
const [currentPage, setCurrentPage] = useState85(1);
|
|
24461
24496
|
const allIcons = useMemo81(() => {
|
|
24462
24497
|
const iconEntries = Object.entries(TablerIcons).filter(([name]) => name.startsWith("Icon") && name !== "IconProps");
|
|
24463
24498
|
return iconEntries;
|
|
@@ -24467,7 +24502,7 @@ function BaseIconPicker({ opened, onClose, onSelectIcon, onUploadClick, children
|
|
|
24467
24502
|
const query = searchQuery.toLowerCase();
|
|
24468
24503
|
return allIcons.filter(([name]) => name.toLowerCase().includes(query));
|
|
24469
24504
|
}, [allIcons, searchQuery]);
|
|
24470
|
-
|
|
24505
|
+
useEffect69(() => {
|
|
24471
24506
|
setCurrentPage(1);
|
|
24472
24507
|
}, [searchQuery]);
|
|
24473
24508
|
const paginatedIcons = useMemo81(() => {
|
|
@@ -24578,7 +24613,7 @@ function BaseIconPicker({ opened, onClose, onSelectIcon, onUploadClick, children
|
|
|
24578
24613
|
}
|
|
24579
24614
|
|
|
24580
24615
|
// src/mantine/components/CoverImage.tsx
|
|
24581
|
-
import React231, { useState as
|
|
24616
|
+
import React231, { useState as useState86, useRef as useRef19, useEffect as useEffect70 } from "react";
|
|
24582
24617
|
import { Box as Box43, Group as Group80 } from "@mantine/core";
|
|
24583
24618
|
|
|
24584
24619
|
// src/core/lib/imageTransform.ts
|
|
@@ -24764,14 +24799,14 @@ function PageIcon({ src, iconSize = 64, useCenter = false, style }) {
|
|
|
24764
24799
|
import { useDisclosure as useDisclosure5 } from "@mantine/hooks";
|
|
24765
24800
|
function CoverImage({ coverImageUrl, logoUrl }) {
|
|
24766
24801
|
const { editor, handlers, editable } = useBlocknoteContext();
|
|
24767
|
-
const [isHovering, setIsHovering] =
|
|
24768
|
-
const [isRepositioning, setIsRepositioning] =
|
|
24769
|
-
const [coverPosition, setCoverPosition] =
|
|
24802
|
+
const [isHovering, setIsHovering] = useState86(false);
|
|
24803
|
+
const [isRepositioning, setIsRepositioning] = useState86(false);
|
|
24804
|
+
const [coverPosition, setCoverPosition] = useState86(50);
|
|
24770
24805
|
const coverFileInputRef = useRef19(null);
|
|
24771
24806
|
const logoFileInputRef = useRef19(null);
|
|
24772
24807
|
const [opened, { open, close }] = useDisclosure5(false);
|
|
24773
|
-
const [metadata, setMetadata] =
|
|
24774
|
-
|
|
24808
|
+
const [metadata, setMetadata] = useState86(() => editor?.getPageMetadata?.() || null);
|
|
24809
|
+
useEffect70(() => {
|
|
24775
24810
|
if (!editor?._metadataManager) {
|
|
24776
24811
|
return;
|
|
24777
24812
|
}
|
|
@@ -25046,7 +25081,7 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
25046
25081
|
}
|
|
25047
25082
|
|
|
25048
25083
|
// src/mantine/components/PageHeader.tsx
|
|
25049
|
-
import React232, { useState as
|
|
25084
|
+
import React232, { useState as useState87, useRef as useRef20, useEffect as useEffect71 } from "react";
|
|
25050
25085
|
function PageHeader({
|
|
25051
25086
|
title = "New page",
|
|
25052
25087
|
icon,
|
|
@@ -25058,11 +25093,11 @@ function PageHeader({
|
|
|
25058
25093
|
isFavorited = false,
|
|
25059
25094
|
menuItems = []
|
|
25060
25095
|
}) {
|
|
25061
|
-
const [isMenuOpen, setIsMenuOpen] =
|
|
25062
|
-
const [isPrivacyOpen, setIsPrivacyOpen] =
|
|
25096
|
+
const [isMenuOpen, setIsMenuOpen] = useState87(false);
|
|
25097
|
+
const [isPrivacyOpen, setIsPrivacyOpen] = useState87(false);
|
|
25063
25098
|
const menuRef = useRef20(null);
|
|
25064
25099
|
const privacyRef = useRef20(null);
|
|
25065
|
-
|
|
25100
|
+
useEffect71(() => {
|
|
25066
25101
|
function handleClickOutside(event) {
|
|
25067
25102
|
if (menuRef.current && !menuRef.current.contains(event.target)) {
|
|
25068
25103
|
setIsMenuOpen(false);
|
|
@@ -25260,7 +25295,7 @@ var styles = {
|
|
|
25260
25295
|
};
|
|
25261
25296
|
|
|
25262
25297
|
// src/mantine/components/ExternalDropZone.tsx
|
|
25263
|
-
import React233, { useCallback as
|
|
25298
|
+
import React233, { useCallback as useCallback69, useEffect as useEffect72, useRef as useRef21, useState as useState88 } from "react";
|
|
25264
25299
|
import { Box as Box44 } from "@mantine/core";
|
|
25265
25300
|
var SCROLL_ZONE_SIZE = 80;
|
|
25266
25301
|
var SCROLL_SPEED = 12;
|
|
@@ -25274,19 +25309,19 @@ var ExternalDropZone = ({
|
|
|
25274
25309
|
children
|
|
25275
25310
|
}) => {
|
|
25276
25311
|
const containerRef = useRef21(null);
|
|
25277
|
-
const [isValidDrag, setIsValidDrag] =
|
|
25278
|
-
const [isHoveringInPlacementMode, setIsHoveringInPlacementMode] =
|
|
25279
|
-
const [indicatorStyle, setIndicatorStyle] =
|
|
25312
|
+
const [isValidDrag, setIsValidDrag] = useState88(false);
|
|
25313
|
+
const [isHoveringInPlacementMode, setIsHoveringInPlacementMode] = useState88(false);
|
|
25314
|
+
const [indicatorStyle, setIndicatorStyle] = useState88({});
|
|
25280
25315
|
const dropPositionRef = useRef21(null);
|
|
25281
25316
|
const scrollAnimationRef = useRef21(null);
|
|
25282
25317
|
const scrollDirectionRef = useRef21(null);
|
|
25283
25318
|
const scrollContainerRef = useRef21(null);
|
|
25284
|
-
const getBlockElements =
|
|
25319
|
+
const getBlockElements = useCallback69(() => {
|
|
25285
25320
|
if (!containerRef.current) return [];
|
|
25286
25321
|
const blocks = containerRef.current.querySelectorAll('[data-node-type="blockContainer"]');
|
|
25287
25322
|
return Array.from(blocks);
|
|
25288
25323
|
}, []);
|
|
25289
|
-
const getScrollContainer =
|
|
25324
|
+
const getScrollContainer = useCallback69(() => {
|
|
25290
25325
|
if (scrollContainerRef.current) return scrollContainerRef.current;
|
|
25291
25326
|
let element = containerRef.current;
|
|
25292
25327
|
while (element) {
|
|
@@ -25301,7 +25336,7 @@ var ExternalDropZone = ({
|
|
|
25301
25336
|
scrollContainerRef.current = window;
|
|
25302
25337
|
return window;
|
|
25303
25338
|
}, []);
|
|
25304
|
-
const performScroll =
|
|
25339
|
+
const performScroll = useCallback69(() => {
|
|
25305
25340
|
const container = getScrollContainer();
|
|
25306
25341
|
const direction = scrollDirectionRef.current;
|
|
25307
25342
|
if (!direction) {
|
|
@@ -25316,7 +25351,7 @@ var ExternalDropZone = ({
|
|
|
25316
25351
|
}
|
|
25317
25352
|
scrollAnimationRef.current = requestAnimationFrame(performScroll);
|
|
25318
25353
|
}, [getScrollContainer]);
|
|
25319
|
-
const startAutoScroll =
|
|
25354
|
+
const startAutoScroll = useCallback69(
|
|
25320
25355
|
(direction) => {
|
|
25321
25356
|
if (scrollDirectionRef.current === direction) return;
|
|
25322
25357
|
scrollDirectionRef.current = direction;
|
|
@@ -25326,14 +25361,14 @@ var ExternalDropZone = ({
|
|
|
25326
25361
|
},
|
|
25327
25362
|
[performScroll]
|
|
25328
25363
|
);
|
|
25329
|
-
const stopAutoScroll =
|
|
25364
|
+
const stopAutoScroll = useCallback69(() => {
|
|
25330
25365
|
scrollDirectionRef.current = null;
|
|
25331
25366
|
if (scrollAnimationRef.current) {
|
|
25332
25367
|
cancelAnimationFrame(scrollAnimationRef.current);
|
|
25333
25368
|
scrollAnimationRef.current = null;
|
|
25334
25369
|
}
|
|
25335
25370
|
}, []);
|
|
25336
|
-
const checkAutoScroll =
|
|
25371
|
+
const checkAutoScroll = useCallback69(
|
|
25337
25372
|
(clientY) => {
|
|
25338
25373
|
const container = getScrollContainer();
|
|
25339
25374
|
let containerTop;
|
|
@@ -25356,7 +25391,7 @@ var ExternalDropZone = ({
|
|
|
25356
25391
|
},
|
|
25357
25392
|
[getScrollContainer, startAutoScroll, stopAutoScroll]
|
|
25358
25393
|
);
|
|
25359
|
-
const findDropPosition =
|
|
25394
|
+
const findDropPosition = useCallback69(
|
|
25360
25395
|
(clientY) => {
|
|
25361
25396
|
const blocks = getBlockElements();
|
|
25362
25397
|
if (blocks.length === 0 || !editor?.document) return null;
|
|
@@ -25389,7 +25424,7 @@ var ExternalDropZone = ({
|
|
|
25389
25424
|
},
|
|
25390
25425
|
[getBlockElements, editor]
|
|
25391
25426
|
);
|
|
25392
|
-
const handleDragOver =
|
|
25427
|
+
const handleDragOver = useCallback69(
|
|
25393
25428
|
(e) => {
|
|
25394
25429
|
if (!e.dataTransfer.types.includes(acceptedType)) return;
|
|
25395
25430
|
e.preventDefault();
|
|
@@ -25412,7 +25447,7 @@ var ExternalDropZone = ({
|
|
|
25412
25447
|
},
|
|
25413
25448
|
[acceptedType, findDropPosition, checkAutoScroll]
|
|
25414
25449
|
);
|
|
25415
|
-
const handleDragLeave =
|
|
25450
|
+
const handleDragLeave = useCallback69(
|
|
25416
25451
|
(e) => {
|
|
25417
25452
|
if (containerRef.current && !containerRef.current.contains(e.relatedTarget)) {
|
|
25418
25453
|
setIsValidDrag(false);
|
|
@@ -25422,7 +25457,7 @@ var ExternalDropZone = ({
|
|
|
25422
25457
|
},
|
|
25423
25458
|
[stopAutoScroll]
|
|
25424
25459
|
);
|
|
25425
|
-
const handleDrop =
|
|
25460
|
+
const handleDrop = useCallback69(
|
|
25426
25461
|
(e) => {
|
|
25427
25462
|
e.preventDefault();
|
|
25428
25463
|
e.stopPropagation();
|
|
@@ -25436,7 +25471,7 @@ var ExternalDropZone = ({
|
|
|
25436
25471
|
},
|
|
25437
25472
|
[onDrop, stopAutoScroll]
|
|
25438
25473
|
);
|
|
25439
|
-
|
|
25474
|
+
useEffect72(() => {
|
|
25440
25475
|
const handleGlobalDragEnd = () => {
|
|
25441
25476
|
setIsValidDrag(false);
|
|
25442
25477
|
dropPositionRef.current = null;
|
|
@@ -25445,7 +25480,7 @@ var ExternalDropZone = ({
|
|
|
25445
25480
|
window.addEventListener("dragend", handleGlobalDragEnd);
|
|
25446
25481
|
return () => window.removeEventListener("dragend", handleGlobalDragEnd);
|
|
25447
25482
|
}, [stopAutoScroll]);
|
|
25448
|
-
const handleOverlayMouseMove =
|
|
25483
|
+
const handleOverlayMouseMove = useCallback69(
|
|
25449
25484
|
(e) => {
|
|
25450
25485
|
setIsHoveringInPlacementMode(true);
|
|
25451
25486
|
checkAutoScroll(e.clientY);
|
|
@@ -25464,12 +25499,12 @@ var ExternalDropZone = ({
|
|
|
25464
25499
|
},
|
|
25465
25500
|
[findDropPosition, checkAutoScroll]
|
|
25466
25501
|
);
|
|
25467
|
-
const handleOverlayMouseLeave =
|
|
25502
|
+
const handleOverlayMouseLeave = useCallback69(() => {
|
|
25468
25503
|
setIsHoveringInPlacementMode(false);
|
|
25469
25504
|
dropPositionRef.current = null;
|
|
25470
25505
|
stopAutoScroll();
|
|
25471
25506
|
}, [stopAutoScroll]);
|
|
25472
|
-
const handleOverlayClick =
|
|
25507
|
+
const handleOverlayClick = useCallback69(
|
|
25473
25508
|
(e) => {
|
|
25474
25509
|
e.preventDefault();
|
|
25475
25510
|
e.stopPropagation();
|
|
@@ -25483,7 +25518,7 @@ var ExternalDropZone = ({
|
|
|
25483
25518
|
},
|
|
25484
25519
|
[onDrop, stopAutoScroll]
|
|
25485
25520
|
);
|
|
25486
|
-
const handleOverlayWheel =
|
|
25521
|
+
const handleOverlayWheel = useCallback69(
|
|
25487
25522
|
(e) => {
|
|
25488
25523
|
const container = getScrollContainer();
|
|
25489
25524
|
if (container === window) {
|
|
@@ -25494,7 +25529,7 @@ var ExternalDropZone = ({
|
|
|
25494
25529
|
},
|
|
25495
25530
|
[getScrollContainer]
|
|
25496
25531
|
);
|
|
25497
|
-
|
|
25532
|
+
useEffect72(() => {
|
|
25498
25533
|
if (!isPlacementMode) return;
|
|
25499
25534
|
const handleKeyDown = (e) => {
|
|
25500
25535
|
if (e.key === "Escape") {
|
|
@@ -25517,13 +25552,13 @@ var ExternalDropZone = ({
|
|
|
25517
25552
|
document.removeEventListener("click", handleGlobalClick, true);
|
|
25518
25553
|
};
|
|
25519
25554
|
}, [isPlacementMode, onPlacementCancel]);
|
|
25520
|
-
|
|
25555
|
+
useEffect72(() => {
|
|
25521
25556
|
if (!isPlacementMode) {
|
|
25522
25557
|
setIsHoveringInPlacementMode(false);
|
|
25523
25558
|
dropPositionRef.current = null;
|
|
25524
25559
|
}
|
|
25525
25560
|
}, [isPlacementMode]);
|
|
25526
|
-
|
|
25561
|
+
useEffect72(() => {
|
|
25527
25562
|
const isActive = isValidDrag || isPlacementMode && isHoveringInPlacementMode;
|
|
25528
25563
|
if (isActive) {
|
|
25529
25564
|
document.body.classList.add("external-artifact-drag-active");
|
|
@@ -25534,7 +25569,7 @@ var ExternalDropZone = ({
|
|
|
25534
25569
|
document.body.classList.remove("external-artifact-drag-active");
|
|
25535
25570
|
};
|
|
25536
25571
|
}, [isValidDrag, isPlacementMode, isHoveringInPlacementMode]);
|
|
25537
|
-
|
|
25572
|
+
useEffect72(() => {
|
|
25538
25573
|
return () => {
|
|
25539
25574
|
if (scrollAnimationRef.current) {
|
|
25540
25575
|
cancelAnimationFrame(scrollAnimationRef.current);
|
|
@@ -25586,7 +25621,7 @@ var ExternalDropZone = ({
|
|
|
25586
25621
|
};
|
|
25587
25622
|
|
|
25588
25623
|
// src/mantine/IxoEditor.tsx
|
|
25589
|
-
import React235, { useState as
|
|
25624
|
+
import React235, { useState as useState89, useEffect as useEffect73, useCallback as useCallback70 } from "react";
|
|
25590
25625
|
import { getDefaultReactSlashMenuItems, SuggestionMenuController } from "@blocknote/react";
|
|
25591
25626
|
import { BlockNoteView } from "@blocknote/mantine";
|
|
25592
25627
|
import { filterSuggestionItems } from "@blocknote/core";
|
|
@@ -25664,8 +25699,8 @@ function IxoEditorContent({
|
|
|
25664
25699
|
}) {
|
|
25665
25700
|
const { activePanel } = usePanelStore();
|
|
25666
25701
|
const isPanelOpen = activePanel !== null;
|
|
25667
|
-
const [isRoomPrivate, setIsRoomPrivate] =
|
|
25668
|
-
|
|
25702
|
+
const [isRoomPrivate, setIsRoomPrivate] = useState89(pageHeaderProps?.isPrivate ?? true);
|
|
25703
|
+
useEffect73(() => {
|
|
25669
25704
|
const matrixClient = editor.getMatrixClient?.();
|
|
25670
25705
|
const roomId = editor.getRoomId?.();
|
|
25671
25706
|
if (!matrixClient || !roomId) return;
|
|
@@ -25681,7 +25716,7 @@ function IxoEditorContent({
|
|
|
25681
25716
|
} catch {
|
|
25682
25717
|
}
|
|
25683
25718
|
}, [editor]);
|
|
25684
|
-
const handlePrivacyChange =
|
|
25719
|
+
const handlePrivacyChange = useCallback70(
|
|
25685
25720
|
async (makePrivate) => {
|
|
25686
25721
|
const matrixClient = editor.getMatrixClient?.();
|
|
25687
25722
|
const roomId = editor.getRoomId?.();
|
|
@@ -25836,7 +25871,7 @@ function IxoEditor({
|
|
|
25836
25871
|
}
|
|
25837
25872
|
|
|
25838
25873
|
// src/mantine/components/EntitySigningSetup.tsx
|
|
25839
|
-
import React236, { useState as
|
|
25874
|
+
import React236, { useState as useState90 } from "react";
|
|
25840
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";
|
|
25841
25876
|
import { IconAlertCircle as IconAlertCircle14, IconCheck as IconCheck13, IconKey as IconKey2 } from "@tabler/icons-react";
|
|
25842
25877
|
var EntitySigningSetup = ({
|
|
@@ -25846,11 +25881,11 @@ var EntitySigningSetup = ({
|
|
|
25846
25881
|
entityName,
|
|
25847
25882
|
onSetup
|
|
25848
25883
|
}) => {
|
|
25849
|
-
const [pin, setPin] =
|
|
25850
|
-
const [confirmPin, setConfirmPin] =
|
|
25851
|
-
const [loading, setLoading] =
|
|
25852
|
-
const [error, setError] =
|
|
25853
|
-
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);
|
|
25854
25889
|
const handleSetup = async () => {
|
|
25855
25890
|
if (pin.length < 4) {
|
|
25856
25891
|
setError("PIN must be at least 4 characters");
|
|
@@ -25932,7 +25967,7 @@ var EntitySigningSetup = ({
|
|
|
25932
25967
|
};
|
|
25933
25968
|
|
|
25934
25969
|
// src/mantine/components/FlowPermissionsPanel.tsx
|
|
25935
|
-
import React237, { useState as
|
|
25970
|
+
import React237, { useState as useState91, useEffect as useEffect74, useMemo as useMemo83 } from "react";
|
|
25936
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";
|
|
25937
25972
|
import { IconPlus as IconPlus7, IconTrash as IconTrash8, IconShieldCheck as IconShieldCheck2, IconUser as IconUser5, IconRobot as IconRobot4, IconBuilding } from "@tabler/icons-react";
|
|
25938
25973
|
var FlowPermissionsPanel = ({
|
|
@@ -25943,11 +25978,11 @@ var FlowPermissionsPanel = ({
|
|
|
25943
25978
|
onRevokePermission,
|
|
25944
25979
|
getUserDisplayName
|
|
25945
25980
|
}) => {
|
|
25946
|
-
const [delegations, setDelegations] =
|
|
25947
|
-
const [loading, setLoading] =
|
|
25948
|
-
const [revoking, setRevoking] =
|
|
25981
|
+
const [delegations, setDelegations] = useState91([]);
|
|
25982
|
+
const [loading, setLoading] = useState91(true);
|
|
25983
|
+
const [revoking, setRevoking] = useState91(null);
|
|
25949
25984
|
const rootCapability = useMemo83(() => editor.getRootCapability?.(), [editor]);
|
|
25950
|
-
|
|
25985
|
+
useEffect74(() => {
|
|
25951
25986
|
const loadDelegations = async () => {
|
|
25952
25987
|
setLoading(true);
|
|
25953
25988
|
const allDelegations = editor.getAllDelegations?.() || [];
|
|
@@ -26031,7 +26066,7 @@ var FlowPermissionsPanel = ({
|
|
|
26031
26066
|
};
|
|
26032
26067
|
|
|
26033
26068
|
// src/mantine/components/GrantPermissionModal.tsx
|
|
26034
|
-
import React238, { useState as
|
|
26069
|
+
import React238, { useState as useState92, useCallback as useCallback71 } from "react";
|
|
26035
26070
|
import {
|
|
26036
26071
|
Modal as Modal4,
|
|
26037
26072
|
Stack as Stack151,
|
|
@@ -26063,21 +26098,21 @@ var GrantPermissionModal = ({
|
|
|
26063
26098
|
const singleBlockMode = !!targetBlockId || blocks.length === 1;
|
|
26064
26099
|
const fixedBlockId = targetBlockId || (blocks.length === 1 ? blocks[0].id : null);
|
|
26065
26100
|
const fixedBlock = fixedBlockId ? blocks.find((b) => b.id === fixedBlockId) || blocks[0] : null;
|
|
26066
|
-
const [recipientType, setRecipientType] =
|
|
26067
|
-
const [searchQuery, setSearchQuery] =
|
|
26068
|
-
const [searchResults, setSearchResults] =
|
|
26069
|
-
const [searching, setSearching] =
|
|
26070
|
-
const [selectedRecipient, setSelectedRecipient] =
|
|
26071
|
-
const [manualDid, setManualDid] =
|
|
26072
|
-
const [scopeType, setScopeType] =
|
|
26073
|
-
const [selectedBlocks, setSelectedBlocks] =
|
|
26074
|
-
const [expirationEnabled, setExpirationEnabled] =
|
|
26075
|
-
const [expirationDays, setExpirationDays] =
|
|
26076
|
-
const [canDelegate, setCanDelegate] =
|
|
26077
|
-
const [pin, setPin] =
|
|
26078
|
-
const [loading, setLoading] =
|
|
26079
|
-
const [error, setError] =
|
|
26080
|
-
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 () => {
|
|
26081
26116
|
if (searchQuery.length < 2) return;
|
|
26082
26117
|
setSearching(true);
|
|
26083
26118
|
try {
|
|
@@ -26374,4 +26409,4 @@ export {
|
|
|
26374
26409
|
ixoGraphQLClient,
|
|
26375
26410
|
getEntity
|
|
26376
26411
|
};
|
|
26377
|
-
//# sourceMappingURL=chunk-
|
|
26412
|
+
//# sourceMappingURL=chunk-XVUUV4EK.mjs.map
|