@ixo/editor 5.6.0 → 5.7.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.
@@ -26205,7 +26205,7 @@ var BidConfig = ({ inputs, onInputsChange, editor, blockId }) => {
26205
26205
  };
26206
26206
 
26207
26207
  // src/mantine/blocks/action/actionTypes/bid/BidFlowDetail.tsx
26208
- import React260, { useCallback as useCallback90, useEffect as useEffect91, useMemo as useMemo96, useState as useState112 } from "react";
26208
+ import React260, { useCallback as useCallback90, useEffect as useEffect91, useMemo as useMemo96, useRef as useRef26, useState as useState112 } from "react";
26209
26209
  import { Alert as Alert46, Loader as Loader43, Stack as Stack178, Text as Text156 } from "@mantine/core";
26210
26210
  import { IconPlayerPlay as IconPlayerPlay3 } from "@tabler/icons-react";
26211
26211
  import { SurveyModel as SurveyModel9 } from "@ixo/surveys";
@@ -26227,6 +26227,10 @@ var BidFlowDetail = ({
26227
26227
  registerRuntimeInputs
26228
26228
  }) => {
26229
26229
  const handlers = useBlocknoteHandlers();
26230
+ const handlersRef = useRef26(handlers);
26231
+ useEffect91(() => {
26232
+ handlersRef.current = handlers;
26233
+ }, [handlers]);
26230
26234
  const services = useMemo96(() => buildServicesFromHandlers(handlers), [handlers]);
26231
26235
  const flowNode = useMemo96(() => buildFlowNodeFromBlock(block), [block]);
26232
26236
  const runtimeManager = useMemo96(() => createRuntimeStateManager(editor), [editor]);
@@ -26302,10 +26306,11 @@ var BidFlowDetail = ({
26302
26306
  setError("Collection is required in template configuration.");
26303
26307
  return;
26304
26308
  }
26309
+ const handlers2 = handlersRef.current;
26305
26310
  setLoadingSurvey(true);
26306
26311
  setError(null);
26307
26312
  try {
26308
- const result = role === "service_agent" ? await handlers.getBidContributorSurveyTemplate(deedDid, collectionId) : await handlers.getBidEvaluatorSurveyTemplate(deedDid, collectionId);
26313
+ const result = role === "service_agent" ? await handlers2.getBidContributorSurveyTemplate(deedDid, collectionId) : await handlers2.getBidEvaluatorSurveyTemplate(deedDid, collectionId);
26309
26314
  if (!result?.surveyTemplate) {
26310
26315
  setSurveyJson(null);
26311
26316
  setError("No survey template found for the selected role.");
@@ -26318,7 +26323,7 @@ var BidFlowDetail = ({
26318
26323
  } finally {
26319
26324
  setLoadingSurvey(false);
26320
26325
  }
26321
- }, [handlers, role, deedDid, collectionId]);
26326
+ }, [role, deedDid, collectionId]);
26322
26327
  useEffect91(() => {
26323
26328
  setSurveyJson(null);
26324
26329
  setError(null);
@@ -26332,10 +26337,11 @@ var BidFlowDetail = ({
26332
26337
  setUserRole(null);
26333
26338
  return;
26334
26339
  }
26340
+ const handlers2 = handlersRef.current;
26335
26341
  setStatusLoading(true);
26336
26342
  try {
26337
26343
  const formattedDid = actorDid.startsWith("did:ixo:") ? actorDid : `did:ixo:${actorDid}`;
26338
- const [bidResponse, collectionsResponse] = await Promise.all([handlers.queryBidsByDid({ collectionId, did: formattedDid }), handlers.getClaimCollections(deedDid)]);
26344
+ const [bidResponse, collectionsResponse] = await Promise.all([handlers2.queryBidsByDid({ collectionId, did: formattedDid }), handlers2.getClaimCollections(deedDid)]);
26339
26345
  if (!mounted) return;
26340
26346
  const bid = Array.isArray(bidResponse?.data) && bidResponse.data.length > 0 ? bidResponse.data[0] : null;
26341
26347
  setUserBid(bid);
@@ -26344,7 +26350,7 @@ var BidFlowDetail = ({
26344
26350
  setUserRole(null);
26345
26351
  return;
26346
26352
  }
26347
- const roles = await handlers.getUserRoles({
26353
+ const roles = await handlers2.getUserRoles({
26348
26354
  userAddress: actorDid,
26349
26355
  adminAddress,
26350
26356
  deedDid,
@@ -26365,7 +26371,7 @@ var BidFlowDetail = ({
26365
26371
  return () => {
26366
26372
  mounted = false;
26367
26373
  };
26368
- }, [handlers, deedDid, collectionId, actorDid]);
26374
+ }, [deedDid, collectionId, actorDid]);
26369
26375
  const isApproved = userRole === "SA" /* ServiceProvider */ || userRole === "EA" /* Evaluator */;
26370
26376
  const isPending = !isApproved && !!userBid;
26371
26377
  const canSubmit = !isPending && !isApproved;
@@ -26664,7 +26670,7 @@ var EvaluateBidConfig = ({ inputs, onInputsChange, editor, blockId }) => {
26664
26670
  };
26665
26671
 
26666
26672
  // src/mantine/blocks/action/actionTypes/evaluateBid/EvaluateBidFlowDetail.tsx
26667
- import React263, { useCallback as useCallback92, useEffect as useEffect93, useMemo as useMemo98, useState as useState115 } from "react";
26673
+ import React263, { useCallback as useCallback92, useEffect as useEffect93, useMemo as useMemo98, useRef as useRef27, useState as useState115 } from "react";
26668
26674
  import { ActionIcon as ActionIcon39, Alert as Alert48, Badge as Badge49, Box as Box53, Button as Button52, Divider as Divider21, Group as Group101, JsonInput, Loader as Loader45, Stack as Stack180, Text as Text158, UnstyledButton as UnstyledButton4 } from "@mantine/core";
26669
26675
  import { IconArrowLeft as IconArrowLeft7, IconCheck as IconCheck20, IconFilter } from "@tabler/icons-react";
26670
26676
 
@@ -26754,6 +26760,10 @@ var EvaluateBidFlowDetail = ({
26754
26760
  registerRuntimeInputs
26755
26761
  }) => {
26756
26762
  const handlers = useBlocknoteHandlers();
26763
+ const handlersRef = useRef27(handlers);
26764
+ useEffect93(() => {
26765
+ handlersRef.current = handlers;
26766
+ }, [handlers]);
26757
26767
  const services = useMemo98(() => buildServicesFromHandlers(handlers), [handlers]);
26758
26768
  const flowNode = useMemo98(() => buildFlowNodeFromBlock(block), [block]);
26759
26769
  const runtimeManager = useMemo98(() => createRuntimeStateManager(editor), [editor]);
@@ -26799,10 +26809,11 @@ var EvaluateBidFlowDetail = ({
26799
26809
  }, [bids, activeFilter]);
26800
26810
  const refreshBids = useCallback92(async () => {
26801
26811
  if (!deedDid || !collectionId) return;
26812
+ const handlers2 = handlersRef.current;
26802
26813
  setLoadingBids(true);
26803
26814
  setError(null);
26804
26815
  try {
26805
- const [bidsResponse, collectionsResponse] = await Promise.all([handlers.queryBids({ collectionId }), handlers.getClaimCollections(deedDid)]);
26816
+ const [bidsResponse, collectionsResponse] = await Promise.all([handlers2.queryBids({ collectionId }), handlers2.getClaimCollections(deedDid)]);
26806
26817
  const fetchedBids = Array.isArray(bidsResponse?.data) ? bidsResponse.data : [];
26807
26818
  setBids(fetchedBids);
26808
26819
  if (selectedBidId && !fetchedBids.some((bid) => bid.id === selectedBidId)) {
@@ -26817,7 +26828,7 @@ var EvaluateBidFlowDetail = ({
26817
26828
  } finally {
26818
26829
  setLoadingBids(false);
26819
26830
  }
26820
- }, [handlers, deedDid, collectionId, selectedBidId]);
26831
+ }, [deedDid, collectionId, selectedBidId]);
26821
26832
  useEffect93(() => {
26822
26833
  setSelectedBidId("");
26823
26834
  setRejectReason("");
@@ -26841,10 +26852,11 @@ var EvaluateBidFlowDetail = ({
26841
26852
  mounted = false;
26842
26853
  };
26843
26854
  const loadProfiles = async () => {
26855
+ const handlers2 = handlersRef.current;
26844
26856
  const results = await Promise.all(
26845
26857
  missing.map(async (did) => {
26846
26858
  try {
26847
- const profile = await handlers.getMatrixInfoPerDid(did);
26859
+ const profile = await handlers2.getMatrixInfoPerDid(did);
26848
26860
  return [did, profile];
26849
26861
  } catch {
26850
26862
  return [did, null];
@@ -26866,7 +26878,7 @@ var EvaluateBidFlowDetail = ({
26866
26878
  return () => {
26867
26879
  mounted = false;
26868
26880
  };
26869
- }, [bids, handlers, profilesByDid]);
26881
+ }, [bids, profilesByDid]);
26870
26882
  const addPaymentRow = useCallback92(() => {
26871
26883
  setPaymentRows((prev) => [...prev, createPaymentRow()]);
26872
26884
  }, []);
@@ -27175,7 +27187,7 @@ registerActionTypeUI("qi/bid.evaluate", {
27175
27187
  });
27176
27188
 
27177
27189
  // src/mantine/blocks/action/actionTypes/claim/ClaimConfig.tsx
27178
- import React264, { useCallback as useCallback93, useEffect as useEffect94, useMemo as useMemo99, useRef as useRef26, useState as useState116 } from "react";
27190
+ import React264, { useCallback as useCallback93, useEffect as useEffect94, useMemo as useMemo99, useRef as useRef28, useState as useState116 } from "react";
27179
27191
  import { Alert as Alert49, Button as Button53, Loader as Loader46, Stack as Stack181, Text as Text159 } from "@mantine/core";
27180
27192
 
27181
27193
  // src/mantine/blocks/action/actionTypes/claim/types.ts
@@ -27206,7 +27218,7 @@ var ClaimConfig = ({ inputs, onInputsChange, editor, blockId }) => {
27206
27218
  const [collections, setCollections] = useState116([]);
27207
27219
  const [loadingCollections, setLoadingCollections] = useState116(false);
27208
27220
  const [error, setError] = useState116(null);
27209
- const localRef = useRef26(local);
27221
+ const localRef = useRef28(local);
27210
27222
  useEffect94(() => {
27211
27223
  localRef.current = local;
27212
27224
  }, [local]);
@@ -27226,7 +27238,7 @@ var ClaimConfig = ({ inputs, onInputsChange, editor, blockId }) => {
27226
27238
  );
27227
27239
  const [schemaLoading, setSchemaLoading] = useState116(false);
27228
27240
  const [schemaError, setSchemaError] = useState116(null);
27229
- const fetchGenRef = useRef26(0);
27241
+ const fetchGenRef = useRef28(0);
27230
27242
  const materialiseSurveySchema = useCallback93(
27231
27243
  async (deedDid, collectionId) => {
27232
27244
  if (!deedDid || !collectionId) return;
@@ -27332,7 +27344,7 @@ var ClaimConfig = ({ inputs, onInputsChange, editor, blockId }) => {
27332
27344
  };
27333
27345
 
27334
27346
  // src/mantine/blocks/action/actionTypes/claim/ClaimFlowDetail.tsx
27335
- import React265, { useCallback as useCallback94, useEffect as useEffect95, useMemo as useMemo100, useState as useState117 } from "react";
27347
+ import React265, { useCallback as useCallback94, useEffect as useEffect95, useMemo as useMemo100, useRef as useRef29, useState as useState117 } from "react";
27336
27348
  import { ActionIcon as ActionIcon40, Alert as Alert50, Box as Box54, Group as Group102, Loader as Loader47, Stack as Stack182, Text as Text160 } from "@mantine/core";
27337
27349
  import { IconArrowLeft as IconArrowLeft8, IconCheck as IconCheck21, IconPlayerPlay as IconPlayerPlay4 } from "@tabler/icons-react";
27338
27350
  import { SurveyModel as SurveyModel10 } from "@ixo/surveys";
@@ -27376,6 +27388,10 @@ var ClaimFlowDetail = ({
27376
27388
  registerRuntimeInputs
27377
27389
  }) => {
27378
27390
  const handlers = useBlocknoteHandlers();
27391
+ const handlersRef = useRef29(handlers);
27392
+ useEffect95(() => {
27393
+ handlersRef.current = handlers;
27394
+ }, [handlers]);
27379
27395
  const services = useMemo100(() => buildServicesFromHandlers(handlers), [handlers]);
27380
27396
  const flowNode = useMemo100(() => buildFlowNodeFromBlock(block), [block]);
27381
27397
  const runtimeManager = useMemo100(() => createRuntimeStateManager(editor), [editor]);
@@ -27485,12 +27501,13 @@ var ClaimFlowDetail = ({
27485
27501
  }, [provideSigningHandler, surveyModel]);
27486
27502
  const fetchClaimsAndAdmin = useCallback94(async () => {
27487
27503
  if (!deedDid || !collectionId || !actorDid) return;
27504
+ const handlers2 = handlersRef.current;
27488
27505
  setLoadingClaims(true);
27489
27506
  setError(null);
27490
27507
  try {
27491
27508
  const [claimsResponse, collectionsResponse] = await Promise.all([
27492
- handlers.getClaimsPerUserAddress({ collectionId, userAddress: actorDid }),
27493
- handlers.getClaimCollections(deedDid)
27509
+ handlers2.getClaimsPerUserAddress({ collectionId, userAddress: actorDid }),
27510
+ handlers2.getClaimCollections(deedDid)
27494
27511
  ]);
27495
27512
  const fetchedClaims = Array.isArray(claimsResponse) ? claimsResponse : [];
27496
27513
  console.log(
@@ -27512,7 +27529,7 @@ var ClaimFlowDetail = ({
27512
27529
  } finally {
27513
27530
  setLoadingClaims(false);
27514
27531
  }
27515
- }, [handlers, deedDid, collectionId, actorDid]);
27532
+ }, [deedDid, collectionId, actorDid]);
27516
27533
  useEffect95(() => {
27517
27534
  setSurveyJson(null);
27518
27535
  setPrefillData(null);
@@ -27532,10 +27549,11 @@ var ClaimFlowDetail = ({
27532
27549
  mounted = false;
27533
27550
  };
27534
27551
  const loadProfiles = async () => {
27552
+ const handlers2 = handlersRef.current;
27535
27553
  const results = await Promise.all(
27536
27554
  missing.map(async (did) => {
27537
27555
  try {
27538
- const profile = await handlers.getMatrixInfoPerDid(did);
27556
+ const profile = await handlers2.getMatrixInfoPerDid(did);
27539
27557
  return [did, profile];
27540
27558
  } catch {
27541
27559
  return [did, null];
@@ -27557,10 +27575,11 @@ var ClaimFlowDetail = ({
27557
27575
  return () => {
27558
27576
  mounted = false;
27559
27577
  };
27560
- }, [claims, handlers, profilesByDid]);
27578
+ }, [claims, profilesByDid]);
27561
27579
  useEffect95(() => {
27562
27580
  let mounted = true;
27563
27581
  const checkServiceAgentAuthorization = async () => {
27582
+ const handlers2 = handlersRef.current;
27564
27583
  if (!deedDid || !collectionId || !adminAddress || !actorDid) {
27565
27584
  if (mounted) {
27566
27585
  setIsServiceAgentAuthorized(false);
@@ -27569,7 +27588,7 @@ var ClaimFlowDetail = ({
27569
27588
  }
27570
27589
  return;
27571
27590
  }
27572
- if (typeof handlers.getUserRoles !== "function") {
27591
+ if (typeof handlers2.getUserRoles !== "function") {
27573
27592
  if (mounted) {
27574
27593
  setIsServiceAgentAuthorized(false);
27575
27594
  setAuthError(null);
@@ -27580,7 +27599,7 @@ var ClaimFlowDetail = ({
27580
27599
  setAuthChecking(true);
27581
27600
  setAuthError(null);
27582
27601
  try {
27583
- const roles = await handlers.getUserRoles({
27602
+ const roles = await handlers2.getUserRoles({
27584
27603
  userAddress: actorDid,
27585
27604
  adminAddress,
27586
27605
  deedDid,
@@ -27606,7 +27625,7 @@ var ClaimFlowDetail = ({
27606
27625
  return () => {
27607
27626
  mounted = false;
27608
27627
  };
27609
- }, [handlers, actorDid, adminAddress, deedDid, collectionId, authRetryKey]);
27628
+ }, [actorDid, adminAddress, deedDid, collectionId, authRetryKey]);
27610
27629
  useEffect95(() => {
27611
27630
  if (!selectedClaim) {
27612
27631
  setSelectedClaimData(null);
@@ -27615,12 +27634,13 @@ var ClaimFlowDetail = ({
27615
27634
  }
27616
27635
  let cancelled = false;
27617
27636
  const loadDetail = async () => {
27637
+ const handlers2 = handlersRef.current;
27618
27638
  setLoadingClaimDetail(true);
27619
27639
  setError(null);
27620
27640
  try {
27621
27641
  const [claimDataResult, templateResult] = await Promise.all([
27622
- handlers.getClaimData(collectionId, selectedClaim.claimId),
27623
- surveyJson ? Promise.resolve({ surveyTemplate: surveyJson }) : handlers.getDeedSurveyTemplate(deedDid, collectionId)
27642
+ handlers2.getClaimData(collectionId, selectedClaim.claimId),
27643
+ surveyJson ? Promise.resolve({ surveyTemplate: surveyJson }) : handlers2.getDeedSurveyTemplate(deedDid, collectionId)
27624
27644
  ]);
27625
27645
  if (cancelled) return;
27626
27646
  setSelectedClaimData(claimDataResult || null);
@@ -27632,10 +27652,10 @@ var ClaimFlowDetail = ({
27632
27652
  } finally {
27633
27653
  if (!cancelled) setLoadingClaimDetail(false);
27634
27654
  }
27635
- if (getClaimStatusInfo(selectedClaim).key === "disputed" && typeof handlers.getClaimDisputeDetails === "function") {
27655
+ if (getClaimStatusInfo(selectedClaim).key === "disputed" && typeof handlers2.getClaimDisputeDetails === "function") {
27636
27656
  setLoadingDispute(true);
27637
27657
  try {
27638
- const details = await handlers.getClaimDisputeDetails(selectedClaim.claimId);
27658
+ const details = await handlers2.getClaimDisputeDetails(selectedClaim.claimId);
27639
27659
  if (!cancelled) setDisputeDetails(details);
27640
27660
  } catch {
27641
27661
  if (!cancelled) setDisputeDetails(null);
@@ -27650,7 +27670,7 @@ var ClaimFlowDetail = ({
27650
27670
  return () => {
27651
27671
  cancelled = true;
27652
27672
  };
27653
- }, [selectedClaim, collectionId, deedDid, handlers, surveyJson]);
27673
+ }, [selectedClaim, collectionId, deedDid, surveyJson]);
27654
27674
  const amendAndResubmit = useCallback94(() => {
27655
27675
  if (!selectedClaimData) return;
27656
27676
  setPrefillData(selectedClaimData);
@@ -27658,11 +27678,12 @@ var ClaimFlowDetail = ({
27658
27678
  }, [selectedClaimData]);
27659
27679
  const startSurvey = useCallback94(async () => {
27660
27680
  if (!deedDid) return;
27681
+ const handlers2 = handlersRef.current;
27661
27682
  setLoadingSurvey(true);
27662
27683
  setError(null);
27663
27684
  setPrefillData(null);
27664
27685
  try {
27665
- const template = await handlers.getDeedSurveyTemplate(deedDid, collectionId);
27686
+ const template = await handlers2.getDeedSurveyTemplate(deedDid, collectionId);
27666
27687
  if (!template?.surveyTemplate) {
27667
27688
  setSurveyJson(null);
27668
27689
  setError("No survey template found for this DID");
@@ -27675,7 +27696,7 @@ var ClaimFlowDetail = ({
27675
27696
  } finally {
27676
27697
  setLoadingSurvey(false);
27677
27698
  }
27678
- }, [handlers, deedDid, collectionId]);
27699
+ }, [deedDid, collectionId]);
27679
27700
  const handleSurveyComplete = useCallback94(
27680
27701
  async (sender) => {
27681
27702
  if (authChecking || !isServiceAgentAuthorized) {
@@ -27879,7 +27900,7 @@ registerActionTypeUI("qi/claim.submit", {
27879
27900
  });
27880
27901
 
27881
27902
  // src/mantine/blocks/action/actionTypes/evaluateClaim/EvaluateClaimConfig.tsx
27882
- import React266, { useCallback as useCallback95, useEffect as useEffect96, useMemo as useMemo101, useRef as useRef27, useState as useState118 } from "react";
27903
+ import React266, { useCallback as useCallback95, useEffect as useEffect96, useMemo as useMemo101, useRef as useRef30, useState as useState118 } from "react";
27883
27904
  import { Alert as Alert51, Button as Button54, Loader as Loader48, Stack as Stack183, Text as Text161 } from "@mantine/core";
27884
27905
 
27885
27906
  // src/mantine/blocks/action/actionTypes/evaluateClaim/types.ts
@@ -27914,7 +27935,7 @@ var EvaluateClaimConfig = ({ inputs, onInputsChange, editor, blockId }) => {
27914
27935
  const [collections, setCollections] = useState118([]);
27915
27936
  const [loadingCollections, setLoadingCollections] = useState118(false);
27916
27937
  const [error, setError] = useState118(null);
27917
- const localRef = useRef27(local);
27938
+ const localRef = useRef30(local);
27918
27939
  useEffect96(() => {
27919
27940
  localRef.current = local;
27920
27941
  }, [local]);
@@ -27934,7 +27955,7 @@ var EvaluateClaimConfig = ({ inputs, onInputsChange, editor, blockId }) => {
27934
27955
  );
27935
27956
  const [schemaLoading, setSchemaLoading] = useState118(false);
27936
27957
  const [schemaError, setSchemaError] = useState118(null);
27937
- const fetchGenRef = useRef27(0);
27958
+ const fetchGenRef = useRef30(0);
27938
27959
  const materialiseSurveySchema = useCallback95(
27939
27960
  async (deedDid, collectionId) => {
27940
27961
  if (!deedDid || !collectionId) return;
@@ -28077,13 +28098,13 @@ function buildBlockOptions(editorDocument, actionType, excludeBlockId) {
28077
28098
  }
28078
28099
 
28079
28100
  // src/mantine/blocks/action/actionTypes/evaluateClaim/EvaluateClaimFlowDetail.tsx
28080
- import React269, { useCallback as useCallback97, useEffect as useEffect98, useMemo as useMemo103, useState as useState120 } from "react";
28101
+ import React269, { useCallback as useCallback97, useEffect as useEffect98, useMemo as useMemo103, useRef as useRef32, useState as useState120 } from "react";
28081
28102
  import { ActionIcon as ActionIcon41, Alert as Alert52, Box as Box57, Button as Button55, Checkbox as Checkbox13, Divider as Divider22, Group as Group105, Loader as Loader50, ScrollArea as ScrollArea8, Stack as Stack186, Text as Text164, UnstyledButton as UnstyledButton6 } from "@mantine/core";
28082
28103
  import { IconArrowLeft as IconArrowLeft9, IconCheck as IconCheck22, IconFilter as IconFilter2 } from "@tabler/icons-react";
28083
28104
  import { SurveyModel as SurveyModel11 } from "@ixo/surveys";
28084
28105
 
28085
28106
  // src/mantine/blocks/action/actionTypes/evaluateClaim/ClaimAttachments.tsx
28086
- import React268, { useCallback as useCallback96, useEffect as useEffect97, useMemo as useMemo102, useRef as useRef28, useState as useState119 } from "react";
28107
+ import React268, { useCallback as useCallback96, useEffect as useEffect97, useMemo as useMemo102, useRef as useRef31, useState as useState119 } from "react";
28087
28108
  import { Box as Box56, Group as Group104, Loader as Loader49, SimpleGrid as SimpleGrid4, Stack as Stack185, Text as Text163, Tooltip as Tooltip24, UnstyledButton as UnstyledButton5 } from "@mantine/core";
28088
28109
  import { IconFile as IconFile5, IconFileText as IconFileText6, IconMusic, IconPhoto as IconPhoto5, IconVideo } from "@tabler/icons-react";
28089
28110
 
@@ -28280,8 +28301,8 @@ var ClaimAttachments = ({ surveyModel, credentialSubject }) => {
28280
28301
  const [resolved, setResolved] = useState119({});
28281
28302
  const [pending, setPending] = useState119({});
28282
28303
  const [openingKey, setOpeningKey] = useState119(null);
28283
- const cacheRef = useRef28(/* @__PURE__ */ new Map());
28284
- const inflightRef = useRef28(/* @__PURE__ */ new Map());
28304
+ const cacheRef = useRef31(/* @__PURE__ */ new Map());
28305
+ const inflightRef = useRef31(/* @__PURE__ */ new Map());
28285
28306
  useEffect97(() => {
28286
28307
  return () => {
28287
28308
  for (const blobUrl of cacheRef.current.values()) URL.revokeObjectURL(blobUrl);
@@ -28476,6 +28497,10 @@ var EvaluateClaimFlowDetail = ({
28476
28497
  registerRuntimeInputs
28477
28498
  }) => {
28478
28499
  const handlers = useBlocknoteHandlers();
28500
+ const handlersRef = useRef32(handlers);
28501
+ useEffect98(() => {
28502
+ handlersRef.current = handlers;
28503
+ }, [handlers]);
28479
28504
  const services = useMemo103(() => buildServicesFromHandlers(handlers), [handlers]);
28480
28505
  const flowNode = useMemo103(() => buildFlowNodeFromBlock(block), [block]);
28481
28506
  const runtimeManager = useMemo103(() => createRuntimeStateManager(editor), [editor]);
@@ -28718,10 +28743,11 @@ var EvaluateClaimFlowDetail = ({
28718
28743
  }, [outcomeTemplateJson]);
28719
28744
  const refreshClaims = useCallback97(async () => {
28720
28745
  if (!deedDid || !collectionId) return;
28746
+ const handlers2 = handlersRef.current;
28721
28747
  setLoadingClaims(true);
28722
28748
  setError(null);
28723
28749
  try {
28724
- const [claimsResponse, collectionsResponse] = await Promise.all([handlers.getClaimsPerCollectionId({ collectionId }), handlers.getClaimCollections(deedDid)]);
28750
+ const [claimsResponse, collectionsResponse] = await Promise.all([handlers2.getClaimsPerCollectionId({ collectionId }), handlers2.getClaimCollections(deedDid)]);
28725
28751
  const fetchedClaims = Array.isArray(claimsResponse) ? claimsResponse : [];
28726
28752
  setClaims(fetchedClaims);
28727
28753
  if (selectedClaimId && !fetchedClaims.some((claim) => claim.claimId === selectedClaimId)) {
@@ -28736,22 +28762,23 @@ var EvaluateClaimFlowDetail = ({
28736
28762
  } finally {
28737
28763
  setLoadingClaims(false);
28738
28764
  }
28739
- }, [handlers, deedDid, collectionId, selectedClaimId]);
28765
+ }, [deedDid, collectionId, selectedClaimId]);
28740
28766
  const loadClaimDetail = useCallback97(
28741
28767
  async (claim) => {
28768
+ const handlers2 = handlersRef.current;
28742
28769
  setSurveyLoading(true);
28743
28770
  setEvaluationLoading(false);
28744
28771
  setEvaluationResult(null);
28745
28772
  setError(null);
28746
28773
  try {
28747
- const claimDataResult = await handlers.getClaimData(collectionId, claim.claimId);
28774
+ const claimDataResult = await handlers2.getClaimData(collectionId, claim.claimId);
28748
28775
  setClaimData(claimDataResult || null);
28749
- const surveyResult = await handlers.getDeedSurveyTemplate(deedDid, collectionId);
28776
+ const surveyResult = await handlers2.getDeedSurveyTemplate(deedDid, collectionId);
28750
28777
  setSurveyJson(surveyResult?.surveyTemplate || null);
28751
- if (handlers.getEvaluationTemplate) {
28778
+ if (handlers2.getEvaluationTemplate) {
28752
28779
  setOutcomeTemplateLoading(true);
28753
28780
  try {
28754
- const evalTemplateResult = await handlers.getEvaluationTemplate(deedDid);
28781
+ const evalTemplateResult = await handlers2.getEvaluationTemplate(deedDid);
28755
28782
  setOutcomeTemplateJson(evalTemplateResult?.surveyTemplate || null);
28756
28783
  } catch {
28757
28784
  setOutcomeTemplateJson(null);
@@ -28759,12 +28786,12 @@ var EvaluateClaimFlowDetail = ({
28759
28786
  setOutcomeTemplateLoading(false);
28760
28787
  }
28761
28788
  }
28762
- if (handlers.getDeedRubric && handlers.evaluateWithRubric && claimDataResult) {
28789
+ if (handlers2.getDeedRubric && handlers2.evaluateWithRubric && claimDataResult) {
28763
28790
  setEvaluationLoading(true);
28764
28791
  try {
28765
- const rubric = await handlers.getDeedRubric(deedDid);
28792
+ const rubric = await handlers2.getDeedRubric(deedDid);
28766
28793
  if (rubric) {
28767
- const evalResult = await handlers.evaluateWithRubric({
28794
+ const evalResult = await handlers2.evaluateWithRubric({
28768
28795
  rubric: typeof rubric.rubric === "string" ? rubric.rubric : JSON.stringify(rubric.rubric),
28769
28796
  claim: claimDataResult
28770
28797
  });
@@ -28790,7 +28817,7 @@ var EvaluateClaimFlowDetail = ({
28790
28817
  setSurveyLoading(false);
28791
28818
  }
28792
28819
  },
28793
- [handlers, collectionId, deedDid]
28820
+ [collectionId, deedDid]
28794
28821
  );
28795
28822
  useEffect98(() => {
28796
28823
  setSelectedClaimId("");
@@ -28870,10 +28897,11 @@ var EvaluateClaimFlowDetail = ({
28870
28897
  mounted = false;
28871
28898
  };
28872
28899
  const loadProfiles = async () => {
28900
+ const handlers2 = handlersRef.current;
28873
28901
  const results = await Promise.all(
28874
28902
  missing.map(async (did) => {
28875
28903
  try {
28876
- const profile = await handlers.getMatrixInfoPerDid(did);
28904
+ const profile = await handlers2.getMatrixInfoPerDid(did);
28877
28905
  return [did, profile];
28878
28906
  } catch {
28879
28907
  return [did, null];
@@ -28895,10 +28923,11 @@ var EvaluateClaimFlowDetail = ({
28895
28923
  return () => {
28896
28924
  mounted = false;
28897
28925
  };
28898
- }, [claims, handlers, profilesByDid]);
28926
+ }, [claims, profilesByDid]);
28899
28927
  useEffect98(() => {
28900
28928
  let mounted = true;
28901
28929
  const checkEvaluatorAuthorization = async () => {
28930
+ const handlers2 = handlersRef.current;
28902
28931
  if (!deedDid || !collectionId || !adminAddress || !actorDid) {
28903
28932
  if (mounted) {
28904
28933
  setIsEvaluatorAuthorized(false);
@@ -28907,7 +28936,7 @@ var EvaluateClaimFlowDetail = ({
28907
28936
  }
28908
28937
  return;
28909
28938
  }
28910
- if (typeof handlers.getUserRoles !== "function") {
28939
+ if (typeof handlers2.getUserRoles !== "function") {
28911
28940
  if (mounted) {
28912
28941
  setIsEvaluatorAuthorized(false);
28913
28942
  setAuthError(null);
@@ -28918,7 +28947,7 @@ var EvaluateClaimFlowDetail = ({
28918
28947
  setAuthChecking(true);
28919
28948
  setAuthError(null);
28920
28949
  try {
28921
- const roles = await handlers.getUserRoles({
28950
+ const roles = await handlers2.getUserRoles({
28922
28951
  userAddress: actorDid,
28923
28952
  adminAddress,
28924
28953
  deedDid,
@@ -28944,7 +28973,7 @@ var EvaluateClaimFlowDetail = ({
28944
28973
  return () => {
28945
28974
  mounted = false;
28946
28975
  };
28947
- }, [handlers, actorDid, adminAddress, deedDid, collectionId, authRetryKey]);
28976
+ }, [actorDid, adminAddress, deedDid, collectionId, authRetryKey]);
28948
28977
  useEffect98(() => {
28949
28978
  if (!selectedClaim) {
28950
28979
  setClaimData(null);
@@ -28953,6 +28982,7 @@ var EvaluateClaimFlowDetail = ({
28953
28982
  setDisputeDetails(null);
28954
28983
  return void 0;
28955
28984
  }
28985
+ const handlers2 = handlersRef.current;
28956
28986
  setDecision("");
28957
28987
  setDisputeReason("");
28958
28988
  setPaymentRows([createPaymentRow2()]);
@@ -28960,10 +28990,10 @@ var EvaluateClaimFlowDetail = ({
28960
28990
  setOutcomeComplete(false);
28961
28991
  loadClaimDetail(selectedClaim);
28962
28992
  const isDisputed = getClaimStatusInfo(selectedClaim).key === "disputed";
28963
- if (isDisputed && typeof handlers.getClaimDisputeDetails === "function") {
28993
+ if (isDisputed && typeof handlers2.getClaimDisputeDetails === "function") {
28964
28994
  let cancelled = false;
28965
28995
  setLoadingDispute(true);
28966
- handlers.getClaimDisputeDetails(selectedClaim.claimId).then((details) => {
28996
+ handlers2.getClaimDisputeDetails(selectedClaim.claimId).then((details) => {
28967
28997
  if (!cancelled) setDisputeDetails(details);
28968
28998
  }).catch(() => {
28969
28999
  if (!cancelled) setDisputeDetails(null);
@@ -28976,7 +29006,7 @@ var EvaluateClaimFlowDetail = ({
28976
29006
  }
28977
29007
  setDisputeDetails(null);
28978
29008
  return void 0;
28979
- }, [selectedClaim, loadClaimDetail, handlers]);
29009
+ }, [selectedClaim, loadClaimDetail]);
28980
29010
  const isClaimAlreadyEvaluated = useMemo103(() => {
28981
29011
  if (!selectedClaim) return false;
28982
29012
  return isClaimEvaluated(selectedClaim);
@@ -36742,7 +36772,7 @@ var OracleStoreSecretsConfig = ({ inputs, onInputsChange }) => {
36742
36772
  };
36743
36773
 
36744
36774
  // src/mantine/blocks/action/actionTypes/oracleStoreSecrets/OracleStoreSecretsFlowDetail.tsx
36745
- import React325, { useCallback as useCallback150, useEffect as useEffect134, useMemo as useMemo133, useRef as useRef29, useState as useState163 } from "react";
36775
+ import React325, { useCallback as useCallback150, useEffect as useEffect134, useMemo as useMemo133, useRef as useRef33, useState as useState163 } from "react";
36746
36776
  import { Alert as Alert79, Button as Button74, Collapse as Collapse11, Divider as Divider36, Group as Group127, Loader as Loader72, Stack as Stack242, Text as Text215 } from "@mantine/core";
36747
36777
  import { IconAlertCircle as IconAlertCircle33, IconCheck as IconCheck35, IconChevronDown as IconChevronDown11, IconChevronUp as IconChevronUp5, IconLock as IconLock2 } from "@tabler/icons-react";
36748
36778
  var EXPECTED_SECRETS = ["SECP_MNEMONIC", "MATRIX_ORACLE_ADMIN_PASSWORD", "MATRIX_ORACLE_ADMIN_ACCESS_TOKEN", "MATRIX_RECOVERY_PHRASE", "MATRIX_VALUE_PIN", "OPEN_ROUTER_API_KEY"];
@@ -36819,7 +36849,7 @@ var OracleStoreSecretsFlowDetail = ({ inputs, editor, block, runtime, updateRunt
36819
36849
  const [showAdditional, setShowAdditional] = useState163(false);
36820
36850
  const [networkConstants, setNetworkConstants] = useState163(null);
36821
36851
  const [isLoadingConstants, setIsLoadingConstants] = useState163(false);
36822
- const constantsFetchRef = useRef29(false);
36852
+ const constantsFetchRef = useRef33(false);
36823
36853
  const handleSaveOpenRouter = useCallback150(async () => {
36824
36854
  if (!openRouterDraft) return;
36825
36855
  if (!resolvedInputs.publicKeyMultibase) {
@@ -36937,7 +36967,7 @@ var OracleStoreSecretsFlowDetail = ({ inputs, editor, block, runtime, updateRunt
36937
36967
  schemaVersion,
36938
36968
  missingFields
36939
36969
  ]);
36940
- const idempotencyCheckRef = useRef29(false);
36970
+ const idempotencyCheckRef = useRef33(false);
36941
36971
  useEffect134(() => {
36942
36972
  if (idempotencyCheckRef.current) return;
36943
36973
  if (!inputsReady) return;
@@ -37616,7 +37646,7 @@ var OracleStoreSecretsAndConfigConfig = ({ inputs, onInputsChange }) => {
37616
37646
  };
37617
37647
 
37618
37648
  // src/mantine/blocks/action/actionTypes/oracleStoreSecretsAndConfig/OracleStoreSecretsAndConfigFlowDetail.tsx
37619
- import React329, { useCallback as useCallback154, useEffect as useEffect137, useMemo as useMemo135, useRef as useRef30, useState as useState166 } from "react";
37649
+ import React329, { useCallback as useCallback154, useEffect as useEffect137, useMemo as useMemo135, useRef as useRef34, useState as useState166 } from "react";
37620
37650
  import { Alert as Alert81, Button as Button76, Collapse as Collapse12, Divider as Divider39, Group as Group129, Loader as Loader74, Stack as Stack246, Text as Text219 } from "@mantine/core";
37621
37651
  import { IconAlertCircle as IconAlertCircle35, IconCheck as IconCheck37, IconChevronDown as IconChevronDown12, IconChevronUp as IconChevronUp6, IconLock as IconLock3 } from "@tabler/icons-react";
37622
37652
  var EXPECTED_SECRETS2 = ["SECP_MNEMONIC", "MATRIX_ORACLE_ADMIN_PASSWORD", "MATRIX_ORACLE_ADMIN_ACCESS_TOKEN", "MATRIX_RECOVERY_PHRASE", "MATRIX_VALUE_PIN", "OPEN_ROUTER_API_KEY"];
@@ -37712,7 +37742,7 @@ var OracleStoreSecretsAndConfigFlowDetail = ({ inputs, editor, block, runtime, u
37712
37742
  const [showAdditional, setShowAdditional] = useState166(false);
37713
37743
  const [networkConstants, setNetworkConstants] = useState166(null);
37714
37744
  const [isLoadingConstants, setIsLoadingConstants] = useState166(false);
37715
- const constantsFetchRef = useRef30(false);
37745
+ const constantsFetchRef = useRef34(false);
37716
37746
  const handleSaveOpenRouter = useCallback154(async () => {
37717
37747
  if (!openRouterDraft) return;
37718
37748
  if (!resolvedInputs.publicKeyMultibase) return;
@@ -37823,7 +37853,7 @@ var OracleStoreSecretsAndConfigFlowDetail = ({ inputs, editor, block, runtime, u
37823
37853
  schemaVersion,
37824
37854
  missingFields
37825
37855
  ]);
37826
- const idempotencyCheckRef = useRef30(false);
37856
+ const idempotencyCheckRef = useRef34(false);
37827
37857
  useEffect137(() => {
37828
37858
  if (idempotencyCheckRef.current) return;
37829
37859
  if (!inputsReady) return;
@@ -38163,7 +38193,7 @@ var OracleConfigureOracleConfig = ({ inputs, onInputsChange }) => {
38163
38193
  };
38164
38194
 
38165
38195
  // src/mantine/blocks/action/actionTypes/oracleConfigureOracle/OracleConfigureOracleFlowDetail.tsx
38166
- import React331, { useCallback as useCallback156, useEffect as useEffect139, useMemo as useMemo136, useRef as useRef31, useState as useState168 } from "react";
38196
+ import React331, { useCallback as useCallback156, useEffect as useEffect139, useMemo as useMemo136, useRef as useRef35, useState as useState168 } from "react";
38167
38197
  import { Alert as Alert82, Button as Button77, Collapse as Collapse13, Divider as Divider41, Group as Group130, Loader as Loader75, Stack as Stack248, Text as Text221 } from "@mantine/core";
38168
38198
  import { IconAlertCircle as IconAlertCircle36, IconCheck as IconCheck38, IconChevronDown as IconChevronDown13, IconChevronUp as IconChevronUp7, IconLock as IconLock4 } from "@tabler/icons-react";
38169
38199
  var EXPECTED_SECRETS3 = ["SECP_MNEMONIC", "MATRIX_ORACLE_ADMIN_PASSWORD", "MATRIX_ORACLE_ADMIN_ACCESS_TOKEN", "MATRIX_RECOVERY_PHRASE", "MATRIX_VALUE_PIN", "OPEN_ROUTER_API_KEY"];
@@ -38279,7 +38309,7 @@ var OracleConfigureOracleFlowDetail = ({ inputs, editor, block, runtime, updateR
38279
38309
  const [showAdditional, setShowAdditional] = useState168(false);
38280
38310
  const [networkConstants, setNetworkConstants] = useState168(null);
38281
38311
  const [isLoadingConstants, setIsLoadingConstants] = useState168(false);
38282
- const constantsFetchRef = useRef31(false);
38312
+ const constantsFetchRef = useRef35(false);
38283
38313
  const handleSaveOpenRouter = useCallback156(async () => {
38284
38314
  if (!openRouterDraft) return;
38285
38315
  if (!resolvedInputs.publicKeyMultibase) return;
@@ -38391,7 +38421,7 @@ var OracleConfigureOracleFlowDetail = ({ inputs, editor, block, runtime, updateR
38391
38421
  schemaVersion,
38392
38422
  missingFields
38393
38423
  ]);
38394
- const idempotencyCheckRef = useRef31(false);
38424
+ const idempotencyCheckRef = useRef35(false);
38395
38425
  useEffect139(() => {
38396
38426
  if (idempotencyCheckRef.current) return;
38397
38427
  if (!inputsReady) return;
@@ -39210,7 +39240,7 @@ import React342, { useCallback as useCallback161 } from "react";
39210
39240
  import { IconSettings as IconSettings19 } from "@tabler/icons-react";
39211
39241
 
39212
39242
  // src/mantine/blocks/location/template/GeneralTab.tsx
39213
- import React341, { useEffect as useEffect141, useRef as useRef32, useState as useState171 } from "react";
39243
+ import React341, { useEffect as useEffect141, useRef as useRef36, useState as useState171 } from "react";
39214
39244
  import { Box as Box63, Divider as Divider42, Stack as Stack255, Text as Text228 } from "@mantine/core";
39215
39245
 
39216
39246
  // src/core/hooks/useUnlMap.ts
@@ -39387,10 +39417,10 @@ var GeneralTab17 = ({ title, description, latitude, longitude, onTitleChange, on
39387
39417
  const [mapError, setMapError] = useState171(null);
39388
39418
  const { status, UnlSdk } = useUnlMap();
39389
39419
  const { mapConfig } = useBlocknoteContext();
39390
- const markerRef = useRef32(null);
39391
- const mapRef = useRef32(null);
39392
- const wrapperRef = useRef32(null);
39393
- const containerRef = useRef32(null);
39420
+ const markerRef = useRef36(null);
39421
+ const mapRef = useRef36(null);
39422
+ const wrapperRef = useRef36(null);
39423
+ const containerRef = useRef36(null);
39394
39424
  useEffect141(() => {
39395
39425
  setLocalTitle(title);
39396
39426
  }, [title]);
@@ -39523,15 +39553,15 @@ var TemplateConfig17 = ({ editor, block }) => {
39523
39553
  };
39524
39554
 
39525
39555
  // src/mantine/blocks/location/components/LocationMap.tsx
39526
- import React343, { useEffect as useEffect142, useRef as useRef33, useState as useState172 } from "react";
39556
+ import React343, { useEffect as useEffect142, useRef as useRef37, useState as useState172 } from "react";
39527
39557
  import { Box as Box64, Flex as Flex36, Loader as Loader79, Text as Text229 } from "@mantine/core";
39528
39558
  var UnlMap = ({ w = "100%", h = 200, latitude, longitude, zoom = 5, showMarker = true, showTilesControl = false }) => {
39529
39559
  const [mapError, setMapError] = useState172(null);
39530
39560
  const { mapConfig } = useBlocknoteContext();
39531
- const wrapperRef = useRef33(null);
39532
- const containerRef = useRef33(null);
39533
- const mapRef = useRef33(null);
39534
- const markerRef = useRef33(null);
39561
+ const wrapperRef = useRef37(null);
39562
+ const containerRef = useRef37(null);
39563
+ const mapRef = useRef37(null);
39564
+ const markerRef = useRef37(null);
39535
39565
  const { status, UnlSdk } = useUnlMap();
39536
39566
  useEffect142(() => {
39537
39567
  if (status !== "ready" || !UnlSdk || mapRef.current || !containerRef.current || !wrapperRef.current) return;
@@ -40144,7 +40174,7 @@ var SkillsTemplateView = ({ editor: _editor, block }) => {
40144
40174
  // src/mantine/blocks/skills/flow/SkillsFlowView.tsx
40145
40175
  import { ActionIcon as ActionIcon46, Badge as Badge57, Button as Button82, Collapse as Collapse15, Group as Group141, Loader as Loader80, Paper as Paper21, Stack as Stack263, Text as Text237, Tooltip as Tooltip30 } from "@mantine/core";
40146
40176
  import { IconBrain as IconBrain3, IconCheck as IconCheck43, IconPencil, IconPlus as IconPlus11, IconTrash as IconTrash11, IconX as IconX15 } from "@tabler/icons-react";
40147
- import React361, { useCallback as useCallback165, useEffect as useEffect144, useMemo as useMemo146, useRef as useRef34, useState as useState175 } from "react";
40177
+ import React361, { useCallback as useCallback165, useEffect as useEffect144, useMemo as useMemo146, useRef as useRef38, useState as useState175 } from "react";
40148
40178
  function parseSkills2(raw) {
40149
40179
  try {
40150
40180
  const parsed = JSON.parse(raw || "[]");
@@ -40176,7 +40206,7 @@ var SkillsFlowView = ({ editor, block }) => {
40176
40206
  const [validatingUrls, setValidatingUrls] = useState175({});
40177
40207
  const [capsules, setCapsules] = useState175([]);
40178
40208
  const [loadingCapsules, setLoadingCapsules] = useState175(false);
40179
- const capsulesFetchedRef = useRef34(false);
40209
+ const capsulesFetchedRef = useRef38(false);
40180
40210
  useEffect144(() => {
40181
40211
  if (capsulesFetchedRef.current || !handlers.getSkills) return;
40182
40212
  capsulesFetchedRef.current = true;
@@ -40184,7 +40214,7 @@ var SkillsFlowView = ({ editor, block }) => {
40184
40214
  handlers.getSkills().then((r) => setCapsules(r.capsules || [])).catch((err) => console.error("[skills] Failed to fetch capsules:", err)).finally(() => setLoadingCapsules(false));
40185
40215
  }, [handlers.getSkills]);
40186
40216
  const [network, setNetwork] = useState175("");
40187
- const networkFetchedRef = useRef34(false);
40217
+ const networkFetchedRef = useRef38(false);
40188
40218
  useEffect144(() => {
40189
40219
  if (networkFetchedRef.current || !handlers.getNetwork) return;
40190
40220
  networkFetchedRef.current = true;
@@ -41290,14 +41320,14 @@ import { useCreateBlockNote as useCreateBlockNote2 } from "@blocknote/react";
41290
41320
  import { BlockNoteSchema as BlockNoteSchema2, defaultBlockSpecs as defaultBlockSpecs2, defaultInlineContentSpecs as defaultInlineContentSpecs2, defaultStyleSpecs as defaultStyleSpecs2 } from "@blocknote/core";
41291
41321
 
41292
41322
  // src/core/hooks/useMatrixProvider.ts
41293
- import { useEffect as useEffect146, useState as useState177, useRef as useRef35, useCallback as useCallback167, useMemo as useMemo149 } from "react";
41323
+ import { useEffect as useEffect146, useState as useState177, useRef as useRef39, useCallback as useCallback167, useMemo as useMemo149 } from "react";
41294
41324
  import { MatrixProvider } from "@ixo/matrix-crdt";
41295
41325
  function useMatrixProvider({ matrixClient, roomId, yDoc }) {
41296
41326
  const [matrixProvider, setProvider] = useState177(null);
41297
41327
  const [status, setStatus] = useState177("disconnected");
41298
- const isMountedRef = useRef35(true);
41299
- const providerRef = useRef35(null);
41300
- const retryTimeoutRef = useRef35(null);
41328
+ const isMountedRef = useRef39(true);
41329
+ const providerRef = useRef39(null);
41330
+ const retryTimeoutRef = useRef39(null);
41301
41331
  const providerOptions = useMemo149(
41302
41332
  () => ({
41303
41333
  translator: {
@@ -41395,7 +41425,7 @@ function useCollaborativeYDoc(_options) {
41395
41425
  }
41396
41426
 
41397
41427
  // src/mantine/hooks/useCollaborativeIxoEditor.ts
41398
- import { useMemo as useMemo151, useEffect as useEffect148, useState as useState178, useRef as useRef37 } from "react";
41428
+ import { useMemo as useMemo151, useEffect as useEffect148, useState as useState178, useRef as useRef41 } from "react";
41399
41429
 
41400
41430
  // src/core/lib/matrixMetadata.ts
41401
41431
  var COVER_IMAGE_EVENT_TYPE = "ixo.page.cover_image";
@@ -41664,7 +41694,7 @@ function logInvocation(matrixClient, roomId, invocation) {
41664
41694
  }
41665
41695
 
41666
41696
  // src/mantine/hooks/useFlowLifecycle.ts
41667
- import { useEffect as useEffect147, useCallback as useCallback168, useRef as useRef36 } from "react";
41697
+ import { useEffect as useEffect147, useCallback as useCallback168, useRef as useRef40 } from "react";
41668
41698
 
41669
41699
  // src/mantine/hooks/useFlowTTLCleanup.ts
41670
41700
  function performTTLCleanup(editor) {
@@ -41901,8 +41931,8 @@ function isBlockEnabledInFlow(block, editorDocument) {
41901
41931
  // src/mantine/hooks/useFlowLifecycle.ts
41902
41932
  var DEFAULT_INTERVAL_MS = 3e4;
41903
41933
  function useFlowLifecycle({ editor, connectionStatus, enabled = true }) {
41904
- const hasRunInitialRef = useRef36(false);
41905
- const runningRef = useRef36(false);
41934
+ const hasRunInitialRef = useRef40(false);
41935
+ const runningRef = useRef40(false);
41906
41936
  const runPipeline = useCallback168(async () => {
41907
41937
  if (!editor || runningRef.current) return;
41908
41938
  runningRef.current = true;
@@ -42121,6 +42151,10 @@ function useCreateCollaborativeIxoEditor(options) {
42121
42151
  }),
42122
42152
  [theme, editable, sideMenu, slashMenu, formattingToolbar, linkToolbar, filePanel, tableHandles]
42123
42153
  );
42154
+ const [providerReady, setProviderReady] = useState178(false);
42155
+ useEffect148(() => {
42156
+ if (matrixProvider && !providerReady) setProviderReady(true);
42157
+ }, [matrixProvider, providerReady]);
42124
42158
  const editor = useCreateBlockNote2(
42125
42159
  {
42126
42160
  schema,
@@ -42129,7 +42163,7 @@ function useCreateCollaborativeIxoEditor(options) {
42129
42163
  collaboration: collaborationConfig,
42130
42164
  pasteHandler: ixoPasteHandler
42131
42165
  },
42132
- [matrixProvider]
42166
+ [providerReady]
42133
42167
  );
42134
42168
  const titleText = useMemo151(() => yDoc.getText("title"), [yDoc]);
42135
42169
  let ixoEditor;
@@ -42356,7 +42390,7 @@ function useCreateCollaborativeIxoEditor(options) {
42356
42390
  }
42357
42391
  }, [connectionStatus, root, titleText, permissions.write, options.docId, options.title, memoizedUser.id]);
42358
42392
  const [connectedUsers, setConnectedUsers] = useState178([]);
42359
- const activeBlockIdRef = useRef37(null);
42393
+ const activeBlockIdRef = useRef41(null);
42360
42394
  const awarenessInstance = matrixProvider?.awarenessInstance ?? null;
42361
42395
  useEffect148(() => {
42362
42396
  if (!awarenessInstance || connectionStatus !== "connected") {
@@ -42472,7 +42506,7 @@ function sanitizeThemeForMantine7(theme) {
42472
42506
  }
42473
42507
 
42474
42508
  // src/mantine/components/CommandPalette.tsx
42475
- import React364, { useEffect as useEffect149, useRef as useRef38, useState as useState179, useMemo as useMemo152, useCallback as useCallback169 } from "react";
42509
+ import React364, { useEffect as useEffect149, useRef as useRef42, useState as useState179, useMemo as useMemo152, useCallback as useCallback169 } from "react";
42476
42510
  import { Box as Box67, Text as Text238, Stack as Stack264 } from "@mantine/core";
42477
42511
  var GROUP_ORDER = {
42478
42512
  Headings: 0,
@@ -42486,7 +42520,7 @@ var GROUP_ORDER = {
42486
42520
  Flows: 8
42487
42521
  };
42488
42522
  function PaletteItem({ item, isSelected, onClick, id }) {
42489
- const ref = useRef38(null);
42523
+ const ref = useRef42(null);
42490
42524
  const [hovered, setHovered] = useState179(false);
42491
42525
  useEffect149(() => {
42492
42526
  if (isSelected && ref.current) {
@@ -42714,7 +42748,7 @@ function PanelContent({ theme: _theme }) {
42714
42748
  }
42715
42749
 
42716
42750
  // src/mantine/components/CoverImage.tsx
42717
- import React370, { useState as useState183, useRef as useRef39, useEffect as useEffect152, useMemo as useMemo155 } from "react";
42751
+ import React370, { useState as useState183, useRef as useRef43, useEffect as useEffect152, useMemo as useMemo155 } from "react";
42718
42752
  import { Box as Box72, Group as Group145 } from "@mantine/core";
42719
42753
  import { IconMoodSmile, IconPhoto as IconPhoto6, IconSettings as IconSettings22, IconArrowsMove, IconTrash as IconTrash13, IconRefresh as IconRefresh10 } from "@tabler/icons-react";
42720
42754
 
@@ -43202,8 +43236,8 @@ function CoverImage({ coverImageUrl, logoUrl }) {
43202
43236
  const [isHovering, setIsHovering] = useState183(false);
43203
43237
  const [isRepositioning, setIsRepositioning] = useState183(false);
43204
43238
  const [coverPosition, setCoverPosition] = useState183(() => editor?.getPageMetadata?.()?.coverPosition ?? 50);
43205
- const coverFileInputRef = useRef39(null);
43206
- const logoFileInputRef = useRef39(null);
43239
+ const coverFileInputRef = useRef43(null);
43240
+ const logoFileInputRef = useRef43(null);
43207
43241
  const [opened, { open, close }] = useDisclosure8(false);
43208
43242
  const [metadata, setMetadata] = useState183(() => editor?.getPageMetadata?.() || null);
43209
43243
  const settingsPanelContent = useMemo155(() => editor ? /* @__PURE__ */ React370.createElement(FlowSettingsPanel, { editor }) : null, [editor]);
@@ -43498,7 +43532,7 @@ function CoverImage({ coverImageUrl, logoUrl }) {
43498
43532
  }
43499
43533
 
43500
43534
  // src/mantine/components/PageTitle.tsx
43501
- import React371, { useState as useState184, useEffect as useEffect153, useRef as useRef40, useCallback as useCallback171 } from "react";
43535
+ import React371, { useState as useState184, useEffect as useEffect153, useRef as useRef44, useCallback as useCallback171 } from "react";
43502
43536
  import { Box as Box73 } from "@mantine/core";
43503
43537
  var DEFAULT_TITLE = "New page";
43504
43538
  function isUserTitle(name) {
@@ -43516,8 +43550,8 @@ function cleanEmptyEditable(el) {
43516
43550
  function PageTitle({ editor, editable }) {
43517
43551
  const [title, setTitle] = useState184("");
43518
43552
  const [hasIcon, setHasIcon] = useState184(false);
43519
- const titleRef = useRef40(null);
43520
- const isComposing = useRef40(false);
43553
+ const titleRef = useRef44(null);
43554
+ const isComposing = useRef44(false);
43521
43555
  useEffect153(() => {
43522
43556
  if (!editor?._metadataManager) return;
43523
43557
  const metadata = editor._metadataManager.getMetadata();
@@ -43668,7 +43702,7 @@ if (typeof document !== "undefined") {
43668
43702
  }
43669
43703
 
43670
43704
  // src/mantine/components/ExternalDropZone.tsx
43671
- import React372, { useCallback as useCallback172, useEffect as useEffect154, useRef as useRef41, useState as useState185 } from "react";
43705
+ import React372, { useCallback as useCallback172, useEffect as useEffect154, useRef as useRef45, useState as useState185 } from "react";
43672
43706
  import { Box as Box74 } from "@mantine/core";
43673
43707
  var SCROLL_ZONE_SIZE = 80;
43674
43708
  var SCROLL_SPEED = 12;
@@ -43681,14 +43715,14 @@ var ExternalDropZone = ({
43681
43715
  onPlacementCancel,
43682
43716
  children
43683
43717
  }) => {
43684
- const containerRef = useRef41(null);
43718
+ const containerRef = useRef45(null);
43685
43719
  const [isValidDrag, setIsValidDrag] = useState185(false);
43686
43720
  const [isHoveringInPlacementMode, setIsHoveringInPlacementMode] = useState185(false);
43687
43721
  const [indicatorStyle, setIndicatorStyle] = useState185({});
43688
- const dropPositionRef = useRef41(null);
43689
- const scrollAnimationRef = useRef41(null);
43690
- const scrollDirectionRef = useRef41(null);
43691
- const scrollContainerRef = useRef41(null);
43722
+ const dropPositionRef = useRef45(null);
43723
+ const scrollAnimationRef = useRef45(null);
43724
+ const scrollDirectionRef = useRef45(null);
43725
+ const scrollContainerRef = useRef45(null);
43692
43726
  const getBlockElements = useCallback172(() => {
43693
43727
  if (!containerRef.current) return [];
43694
43728
  const blocks = containerRef.current.querySelectorAll('[data-node-type="blockContainer"]');
@@ -44032,7 +44066,8 @@ function IxoEditorContent({
44032
44066
  externalDropType,
44033
44067
  dropIndicator,
44034
44068
  isPlacementMode,
44035
- onPlacementCancel
44069
+ onPlacementCancel,
44070
+ belowTitleSlot
44036
44071
  }) {
44037
44072
  const { activePanel } = usePanelStore();
44038
44073
  const isPanelOpen = activePanel !== null;
@@ -44087,6 +44122,7 @@ function IxoEditorContent({
44087
44122
  },
44088
44123
  /* @__PURE__ */ React373.createElement(CoverImage, { coverImageUrl, logoUrl }),
44089
44124
  /* @__PURE__ */ React373.createElement(PageTitle, { editor, editable: isEditable }),
44125
+ belowTitleSlot,
44090
44126
  (onExternalDrop || isPlacementMode) && isEditable ? /* @__PURE__ */ React373.createElement(
44091
44127
  ExternalDropZone,
44092
44128
  {
@@ -44126,7 +44162,8 @@ function IxoEditor({
44126
44162
  onPlacementCancel,
44127
44163
  mapConfig,
44128
44164
  connectedUsers,
44129
- awarenessInstance
44165
+ awarenessInstance,
44166
+ belowTitleSlot
44130
44167
  }) {
44131
44168
  if (!editor) {
44132
44169
  return null;
@@ -44172,7 +44209,8 @@ function IxoEditor({
44172
44209
  externalDropType,
44173
44210
  dropIndicator,
44174
44211
  isPlacementMode,
44175
- onPlacementCancel
44212
+ onPlacementCancel,
44213
+ belowTitleSlot
44176
44214
  },
44177
44215
  children
44178
44216
  )
@@ -44263,7 +44301,7 @@ function DebugButton({ editor }) {
44263
44301
  }
44264
44302
 
44265
44303
  // src/mantine/components/PageHeader.tsx
44266
- import React375, { useState as useState186, useRef as useRef42, useEffect as useEffect155 } from "react";
44304
+ import React375, { useState as useState186, useRef as useRef46, useEffect as useEffect155 } from "react";
44267
44305
  function PageHeader({
44268
44306
  title = "New page",
44269
44307
  icon: icon2,
@@ -44277,8 +44315,8 @@ function PageHeader({
44277
44315
  }) {
44278
44316
  const [isMenuOpen, setIsMenuOpen] = useState186(false);
44279
44317
  const [isPrivacyOpen, setIsPrivacyOpen] = useState186(false);
44280
- const menuRef = useRef42(null);
44281
- const privacyRef = useRef42(null);
44318
+ const menuRef = useRef46(null);
44319
+ const privacyRef = useRef46(null);
44282
44320
  useEffect155(() => {
44283
44321
  function handleClickOutside(event) {
44284
44322
  if (menuRef.current && !menuRef.current.contains(event.target)) {
@@ -44910,4 +44948,4 @@ export {
44910
44948
  getExtraSlashMenuItems,
44911
44949
  useCreateIxoEditor
44912
44950
  };
44913
- //# sourceMappingURL=chunk-CUDEZXQH.mjs.map
44951
+ //# sourceMappingURL=chunk-4QAMDIPO.mjs.map