@ixo/editor 2.16.3 → 2.17.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.
@@ -16744,14 +16744,14 @@ var DomainCreatorSignTemplateView = ({ editor, block }) => {
16744
16744
  };
16745
16745
 
16746
16746
  // src/mantine/blocks/domainCreatorSign/flow/FlowView.tsx
16747
- import React185, { useCallback as useCallback47, useMemo as useMemo56 } from "react";
16747
+ import React185, { useCallback as useCallback47, useMemo as useMemo56, useEffect as useEffect47 } from "react";
16748
16748
  import { ActionIcon as ActionIcon27, Badge as Badge28, Group as Group59, Stack as Stack122, Text as Text96, Tooltip as Tooltip18 } from "@mantine/core";
16749
16749
  import { IconChevronRight as IconChevronRight8 } from "@tabler/icons-react";
16750
16750
 
16751
16751
  // src/mantine/blocks/domainCreatorSign/flow/SignPanel.tsx
16752
- import React184, { useCallback as useCallback46, useState as useState64 } from "react";
16753
16752
  import { Alert as Alert24, Button as Button32, CloseButton as CloseButton13, Group as Group58, Loader as Loader24, Stack as Stack121, Text as Text95, Title as Title16 } from "@mantine/core";
16754
16753
  import { IconAlertCircle as IconAlertCircle11, IconCheck as IconCheck5, IconSignature } from "@tabler/icons-react";
16754
+ import React184, { useCallback as useCallback46, useState as useState64 } from "react";
16755
16755
  var SignPanel = ({ editor, block, onComplete, onError }) => {
16756
16756
  const { closePanel } = usePanelStore();
16757
16757
  const { handlers } = useBlocknoteContext();
@@ -16765,6 +16765,11 @@ var SignPanel = ({ editor, block, onComplete, onError }) => {
16765
16765
  return null;
16766
16766
  }
16767
16767
  }, [block.props.domainCardData]);
16768
+ const getDate100YearsFromNow = useCallback46(() => {
16769
+ const date = /* @__PURE__ */ new Date();
16770
+ date.setFullYear(date.getFullYear() + 100);
16771
+ return date.toISOString();
16772
+ }, []);
16768
16773
  const processSignAndCreate = useCallback46(async () => {
16769
16774
  if (!handlers) {
16770
16775
  throw new Error("Handlers not available");
@@ -16782,25 +16787,30 @@ var SignPanel = ({ editor, block, onComplete, onError }) => {
16782
16787
  throw new Error("requestPin handler not available");
16783
16788
  }
16784
16789
  const domainCardData2 = getDomainCardData();
16785
- if (!domainCardData2 || !domainCardData2.name) {
16790
+ if (!domainCardData2 || !domainCardData2.credentialSubject?.name) {
16786
16791
  throw new Error("Domain card data is missing or invalid");
16787
16792
  }
16788
- const entityType = block.props.entityType || domainCardData2.type?.[0]?.replace("ixo:", "") || "dao";
16793
+ const extractEntityType = (type) => {
16794
+ return type.replace(/^schema:/i, "").toLowerCase();
16795
+ };
16796
+ const entityType = block.props.entityType || (domainCardData2.credentialSubject?.type?.[0] ? extractEntityType(domainCardData2.credentialSubject.type[0]) : "dao");
16789
16797
  const issuerDid = handlers.getEntityDid?.() || handlers.getCurrentUser?.()?.address;
16790
16798
  if (!issuerDid) {
16791
16799
  throw new Error("Unable to determine issuer DID");
16792
16800
  }
16793
16801
  const entityDid = "did:ixo:entity:pending";
16802
+ const validFrom = domainCardData2.validFrom || (/* @__PURE__ */ new Date()).toISOString();
16803
+ const validUntil = domainCardData2.validUntil || getDate100YearsFromNow();
16794
16804
  const credentialSubject = {
16795
- ...domainCardData2,
16805
+ ...domainCardData2.credentialSubject,
16796
16806
  id: entityDid
16797
16807
  };
16798
16808
  const unsignedCredential = buildVerifiableCredential({
16799
16809
  entityDid,
16800
16810
  issuerDid,
16801
16811
  credentialSubject,
16802
- validFrom: domainCardData2.validFrom || (/* @__PURE__ */ new Date()).toISOString(),
16803
- validUntil: domainCardData2.validUntil
16812
+ validFrom,
16813
+ validUntil
16804
16814
  });
16805
16815
  setFlowStep("signing");
16806
16816
  editor.updateBlock(block, { props: { ...block.props, status: "signing" } });
@@ -16828,22 +16838,23 @@ var SignPanel = ({ editor, block, onComplete, onError }) => {
16828
16838
  entityDid,
16829
16839
  cid: uploadResult.cid,
16830
16840
  serviceEndpoint: uploadResult.url,
16831
- description: `Domain Card for ${domainCardData2.name || "Domain"}`
16841
+ description: `Domain Card for ${domainCardData2.credentialSubject?.name || "Domain"}`
16832
16842
  });
16833
16843
  setFlowStep("creating");
16834
16844
  editor.updateBlock(block, { props: { ...block.props, status: "creating" } });
16845
+ const endDate = domainCardData2.endDate || validUntil;
16835
16846
  const { entityDid: newEntityDid, transactionHash } = await handlers.createDomain({
16836
16847
  entityType,
16837
16848
  linkedResource: [domainCardLinkedResource],
16838
- startDate: domainCardData2.validFrom,
16839
- endDate: domainCardData2.validUntil
16849
+ startDate: validFrom,
16850
+ endDate
16840
16851
  });
16841
16852
  return {
16842
16853
  entityDid: newEntityDid,
16843
16854
  entityType,
16844
16855
  transactionHash
16845
16856
  };
16846
- }, [handlers, getDomainCardData, block, editor]);
16857
+ }, [handlers, getDomainCardData, block, editor, getDate100YearsFromNow]);
16847
16858
  const handleSign = useCallback46(async () => {
16848
16859
  try {
16849
16860
  const result = await processSignAndCreate();
@@ -16893,13 +16904,34 @@ var SignPanel = ({ editor, block, onComplete, onError }) => {
16893
16904
  return /* @__PURE__ */ React184.createElement(Stack121, { gap: "md", p: "md" }, /* @__PURE__ */ React184.createElement(Group58, { justify: "space-between", align: "flex-start" }, /* @__PURE__ */ React184.createElement(Title16, { order: 5 }, block.props.title || "Sign to Create"), /* @__PURE__ */ React184.createElement(CloseButton13, { onClick: handleClose, title: "Close panel" })), /* @__PURE__ */ React184.createElement(Alert24, { icon: /* @__PURE__ */ React184.createElement(IconAlertCircle11, { size: 16 }), title: "Domain Creation Failed", color: "red" }, /* @__PURE__ */ React184.createElement(Text95, { size: "sm" }, error || "An unexpected error occurred")), /* @__PURE__ */ React184.createElement(Group58, null, /* @__PURE__ */ React184.createElement(Button32, { variant: "outline", onClick: handleRetry }, "Try Again"), /* @__PURE__ */ React184.createElement(Button32, { variant: "subtle", onClick: handleClose }, "Close")));
16894
16905
  }
16895
16906
  const domainCardData = getDomainCardData();
16896
- return /* @__PURE__ */ React184.createElement(Stack121, { gap: "md", p: "md" }, /* @__PURE__ */ React184.createElement(Group58, { justify: "space-between", align: "flex-start" }, /* @__PURE__ */ React184.createElement(Stack121, { gap: 4 }, /* @__PURE__ */ React184.createElement(Title16, { order: 5 }, block.props.title || "Sign to Create"), /* @__PURE__ */ React184.createElement(Text95, { size: "sm", c: "dimmed" }, "Review and sign to create your domain.")), /* @__PURE__ */ React184.createElement(CloseButton13, { onClick: handleClose, title: "Close panel" })), /* @__PURE__ */ React184.createElement(Stack121, { gap: "xs", p: "md", style: { backgroundColor: "var(--mantine-color-dark-6)", borderRadius: 8 } }, /* @__PURE__ */ React184.createElement(Text95, { fw: 600, size: "sm" }, "Domain Card Summary"), /* @__PURE__ */ React184.createElement(Group58, { gap: "xs" }, /* @__PURE__ */ React184.createElement(Text95, { size: "xs", c: "dimmed", style: { width: 80 } }, "Name:"), /* @__PURE__ */ React184.createElement(Text95, { size: "xs" }, domainCardData?.name || "Not set")), /* @__PURE__ */ React184.createElement(Group58, { gap: "xs" }, /* @__PURE__ */ React184.createElement(Text95, { size: "xs", c: "dimmed", style: { width: 80 } }, "Type:"), /* @__PURE__ */ React184.createElement(Text95, { size: "xs" }, block.props.entityType || domainCardData?.type?.[0] || "dao")), domainCardData?.description && /* @__PURE__ */ React184.createElement(Group58, { gap: "xs", align: "flex-start" }, /* @__PURE__ */ React184.createElement(Text95, { size: "xs", c: "dimmed", style: { width: 80 } }, "Description:"), /* @__PURE__ */ React184.createElement(Text95, { size: "xs", lineClamp: 2, style: { flex: 1 } }, domainCardData.description))), /* @__PURE__ */ React184.createElement(Button32, { leftSection: /* @__PURE__ */ React184.createElement(IconSignature, { size: 18 }), onClick: handleSign, fullWidth: true }, "Sign & Create Domain"));
16907
+ return /* @__PURE__ */ React184.createElement(Stack121, { gap: "md", p: "md" }, /* @__PURE__ */ React184.createElement(Group58, { justify: "space-between", align: "flex-start" }, /* @__PURE__ */ React184.createElement(Stack121, { gap: 4 }, /* @__PURE__ */ React184.createElement(Title16, { order: 5 }, block.props.title || "Sign to Create"), /* @__PURE__ */ React184.createElement(Text95, { size: "sm", c: "dimmed" }, "Review and sign to create your domain.")), /* @__PURE__ */ React184.createElement(CloseButton13, { onClick: handleClose, title: "Close panel" })), /* @__PURE__ */ React184.createElement(Stack121, { gap: "xs", p: "md", style: { backgroundColor: "var(--mantine-color-dark-6)", borderRadius: 8 } }, /* @__PURE__ */ React184.createElement(Text95, { fw: 600, size: "sm" }, "Domain Card Summary"), /* @__PURE__ */ React184.createElement(Group58, { gap: "xs" }, /* @__PURE__ */ React184.createElement(Text95, { size: "xs", c: "dimmed", style: { width: 80 } }, "Name:"), /* @__PURE__ */ React184.createElement(Text95, { size: "xs" }, domainCardData?.credentialSubject?.name || "Not set")), /* @__PURE__ */ React184.createElement(Group58, { gap: "xs" }, /* @__PURE__ */ React184.createElement(Text95, { size: "xs", c: "dimmed", style: { width: 80 } }, "Type:"), /* @__PURE__ */ React184.createElement(Text95, { size: "xs" }, block.props.entityType || (domainCardData?.credentialSubject?.type?.[0]?.replace(/^schema:/i, "").toLowerCase() ?? "dao"))), domainCardData?.credentialSubject?.description && /* @__PURE__ */ React184.createElement(Group58, { gap: "xs", align: "flex-start" }, /* @__PURE__ */ React184.createElement(Text95, { size: "xs", c: "dimmed", style: { width: 80 } }, "Description:"), /* @__PURE__ */ React184.createElement(Text95, { size: "xs", lineClamp: 2, style: { flex: 1 } }, domainCardData.credentialSubject.description))), /* @__PURE__ */ React184.createElement(Button32, { leftSection: /* @__PURE__ */ React184.createElement(IconSignature, { size: 18 }), onClick: handleSign, fullWidth: true }, "Sign & Create Domain"));
16897
16908
  };
16898
16909
 
16899
16910
  // src/mantine/blocks/domainCreatorSign/flow/FlowView.tsx
16900
16911
  var DOMAIN_CREATOR_SIGN_FLOW_PANEL_ID = "domain-creator-sign-flow-panel";
16912
+ function isDomainCardDataReady(domainCardData) {
16913
+ if (!domainCardData || domainCardData === "{}") return false;
16914
+ try {
16915
+ const parsed = JSON.parse(domainCardData);
16916
+ return Boolean(parsed && typeof parsed === "object" && parsed.name);
16917
+ } catch {
16918
+ return false;
16919
+ }
16920
+ }
16901
16921
  var DomainCreatorSignFlowView = ({ editor, block }) => {
16902
16922
  const status = block.props.status || "pending";
16923
+ const domainCardData = block.props.domainCardData || "{}";
16924
+ const isDataReady = isDomainCardDataReady(domainCardData);
16925
+ useEffect47(() => {
16926
+ if (status === "pending" && isDataReady) {
16927
+ editor.updateBlock(block, {
16928
+ props: {
16929
+ ...block.props,
16930
+ status: "ready"
16931
+ }
16932
+ });
16933
+ }
16934
+ }, [isDataReady, status, editor, block]);
16903
16935
  const handleComplete = useCallback47(
16904
16936
  (result) => {
16905
16937
  editor.updateBlock(block, {
@@ -16960,7 +16992,7 @@ var DomainCreatorSignFlowView = ({ editor, block }) => {
16960
16992
  case "ready":
16961
16993
  return "Click to sign and create the domain";
16962
16994
  default:
16963
- return "Waiting for domain data to be approved";
16995
+ return "Waiting for domain card data";
16964
16996
  }
16965
16997
  };
16966
16998
  return /* @__PURE__ */ React185.createElement(BaseContainer, { onClick: isClickable ? handleOpen : void 0, style: { opacity: isClickable ? 1 : 0.7, cursor: isClickable ? "pointer" : "not-allowed" } }, /* @__PURE__ */ React185.createElement(Group59, { wrap: "nowrap", justify: "space-between", align: "center" }, /* @__PURE__ */ React185.createElement(Group59, { wrap: "nowrap", align: "center", style: { flex: 1 } }, getIcon("feather", block.props.icon), /* @__PURE__ */ React185.createElement(Stack122, { gap: 4, style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ React185.createElement(Group59, { gap: "xs", align: "center" }, /* @__PURE__ */ React185.createElement(Text96, { fw: 600, size: "sm" }, block.props.title || "Sign to Create"), /* @__PURE__ */ React185.createElement(Badge28, { size: "xs", variant: "filled", color: badgeProps.color, styles: { root: { backgroundColor: `var(--mantine-color-${badgeProps.color}-6)`, color: "white" } } }, badgeProps.text)), /* @__PURE__ */ React185.createElement(Text96, { size: "xs", c: "dimmed", lineClamp: 2 }, getDescriptionText()))), isClickable && /* @__PURE__ */ React185.createElement(Tooltip18, { label: status === "completed" ? "View details" : "Sign & Create", withArrow: true }, /* @__PURE__ */ React185.createElement(ActionIcon27, { variant: "subtle", color: "blue" }, /* @__PURE__ */ React185.createElement(IconChevronRight8, { size: 18 })))));
@@ -17022,14 +17054,14 @@ import React189, { useCallback as useCallback48 } from "react";
17022
17054
  import { Paper as Paper19, CloseButton as CloseButton14, Title as Title17 } from "@mantine/core";
17023
17055
 
17024
17056
  // src/mantine/blocks/domainCardViewer/template/GeneralTab.tsx
17025
- import React188, { useEffect as useEffect47, useState as useState65 } from "react";
17057
+ import React188, { useEffect as useEffect48, useState as useState65 } from "react";
17026
17058
  var GeneralTab13 = ({ title, description, icon, onTitleChange, onDescriptionChange, onIconChange }) => {
17027
17059
  const [localTitle, setLocalTitle] = useState65(title || "");
17028
17060
  const [localDescription, setLocalDescription] = useState65(description || "");
17029
17061
  const [localIcon, setLocalIcon] = useState65(icon || "dots-circle");
17030
- useEffect47(() => setLocalTitle(title || ""), [title]);
17031
- useEffect47(() => setLocalDescription(description || ""), [description]);
17032
- useEffect47(() => setLocalIcon(icon || "dots-circle"), [icon]);
17062
+ useEffect48(() => setLocalTitle(title || ""), [title]);
17063
+ useEffect48(() => setLocalDescription(description || ""), [description]);
17064
+ useEffect48(() => setLocalIcon(icon || "dots-circle"), [icon]);
17033
17065
  return /* @__PURE__ */ React188.createElement(BaseSection, null, /* @__PURE__ */ React188.createElement(
17034
17066
  BaseTextInput,
17035
17067
  {
@@ -17145,7 +17177,7 @@ var DomainCardViewerTemplateView = ({ editor, block }) => {
17145
17177
  };
17146
17178
 
17147
17179
  // src/mantine/blocks/domainCardViewer/flow/FlowView.tsx
17148
- import React192, { useMemo as useMemo59, useCallback as useCallback49, useEffect as useEffect48, useRef as useRef11 } from "react";
17180
+ import React192, { useMemo as useMemo59, useCallback as useCallback49, useEffect as useEffect49 } from "react";
17149
17181
  import { ActionIcon as ActionIcon28, Badge as Badge30, Button as Button34, Group as Group61, Stack as Stack125, Text as Text99, Tooltip as Tooltip19 } from "@mantine/core";
17150
17182
  import { IconChevronRight as IconChevronRight9, IconLoader, IconTestPipe, IconTrash as IconTrash5 } from "@tabler/icons-react";
17151
17183
 
@@ -17456,45 +17488,11 @@ function isPreviewDataReady(domainPreviewData) {
17456
17488
  return false;
17457
17489
  }
17458
17490
  }
17459
- function isDomainCardDataReady(domainCardData) {
17460
- if (!domainCardData || domainCardData === "{}") return false;
17461
- try {
17462
- const parsed = JSON.parse(domainCardData);
17463
- return Boolean(parsed && typeof parsed === "object" && parsed.name);
17464
- } catch {
17465
- return false;
17466
- }
17467
- }
17468
- function syncToDomainCreatorSignBlocks(editor, domainCardData, isApproved) {
17469
- const allBlocks = editor.document;
17470
- for (const docBlock of allBlocks) {
17471
- if (docBlock.type === "domainCreatorSign") {
17472
- const currentStatus = docBlock.props.status;
17473
- if (currentStatus === "completed" || currentStatus === "signing" || currentStatus === "uploading" || currentStatus === "creating") {
17474
- continue;
17475
- }
17476
- const newStatus = isApproved && isDomainCardDataReady(domainCardData) ? "ready" : "pending";
17477
- if (docBlock.props.domainCardData !== domainCardData || docBlock.props.status !== newStatus) {
17478
- editor.updateBlock(docBlock, {
17479
- props: {
17480
- ...docBlock.props,
17481
- domainCardData,
17482
- status: newStatus
17483
- }
17484
- });
17485
- }
17486
- }
17487
- }
17488
- }
17489
17491
  var DomainCardViewerFlowView = ({ editor, block }) => {
17490
17492
  const status = block.props.status || "pending";
17491
17493
  const domainPreviewData = block.props.domainPreviewData || "{}";
17492
- const domainCardData = block.props.domainCardData || "{}";
17493
17494
  const isDataReady = isPreviewDataReady(domainPreviewData);
17494
- const isApproved = status === "approved";
17495
- const prevDomainCardDataRef = useRef11(domainCardData);
17496
- const prevStatusRef = useRef11(status);
17497
- useEffect48(() => {
17495
+ useEffect49(() => {
17498
17496
  if (status === "pending" && isDataReady) {
17499
17497
  editor.updateBlock(block, {
17500
17498
  props: {
@@ -17504,15 +17502,6 @@ var DomainCardViewerFlowView = ({ editor, block }) => {
17504
17502
  });
17505
17503
  }
17506
17504
  }, [isDataReady, status, editor, block]);
17507
- useEffect48(() => {
17508
- const dataChanged = prevDomainCardDataRef.current !== domainCardData;
17509
- const statusChanged = prevStatusRef.current !== status;
17510
- if (dataChanged || statusChanged) {
17511
- syncToDomainCreatorSignBlocks(editor, domainCardData, isApproved);
17512
- prevDomainCardDataRef.current = domainCardData;
17513
- prevStatusRef.current = status;
17514
- }
17515
- }, [domainCardData, status, isApproved, editor]);
17516
17505
  const handleApprove = useCallback49(() => {
17517
17506
  editor.updateBlock(block, {
17518
17507
  props: {
@@ -17814,7 +17803,7 @@ blockRegistry.register({
17814
17803
  });
17815
17804
 
17816
17805
  // src/mantine/blocks/hooks/useBlockDependencies.ts
17817
- import { useMemo as useMemo60, useEffect as useEffect49, useState as useState66, useCallback as useCallback50 } from "react";
17806
+ import { useMemo as useMemo60, useEffect as useEffect50, useState as useState66, useCallback as useCallback50 } from "react";
17818
17807
 
17819
17808
  // src/mantine/blocks/hooks/useDependsOn.ts
17820
17809
  import { useMemo as useMemo61 } from "react";
@@ -18293,14 +18282,14 @@ import { useCreateBlockNote as useCreateBlockNote2 } from "@blocknote/react";
18293
18282
  import { BlockNoteSchema as BlockNoteSchema2, defaultBlockSpecs as defaultBlockSpecs2, defaultInlineContentSpecs as defaultInlineContentSpecs2, defaultStyleSpecs as defaultStyleSpecs2 } from "@blocknote/core";
18294
18283
 
18295
18284
  // src/core/hooks/useMatrixProvider.ts
18296
- import { useEffect as useEffect50, useState as useState67, useRef as useRef12, useCallback as useCallback51, useMemo as useMemo62 } from "react";
18285
+ import { useEffect as useEffect51, useState as useState67, useRef as useRef11, useCallback as useCallback51, useMemo as useMemo62 } from "react";
18297
18286
  import { MatrixProvider } from "@ixo/matrix-crdt";
18298
18287
  function useMatrixProvider({ matrixClient, roomId, yDoc }) {
18299
18288
  const [matrixProvider, setProvider] = useState67(null);
18300
18289
  const [status, setStatus] = useState67("disconnected");
18301
- const isMountedRef = useRef12(true);
18302
- const providerRef = useRef12(null);
18303
- const retryTimeoutRef = useRef12(null);
18290
+ const isMountedRef = useRef11(true);
18291
+ const providerRef = useRef11(null);
18292
+ const retryTimeoutRef = useRef11(null);
18304
18293
  const providerOptions = useMemo62(
18305
18294
  () => ({
18306
18295
  translator: {
@@ -18362,7 +18351,7 @@ function useMatrixProvider({ matrixClient, roomId, yDoc }) {
18362
18351
  }
18363
18352
  }
18364
18353
  }, [matrixClient, providerOptions, handleDocumentAvailable, handleDocumentUnavailable, handleCanWriteChanged]);
18365
- useEffect50(() => {
18354
+ useEffect51(() => {
18366
18355
  isMountedRef.current = true;
18367
18356
  initProvider();
18368
18357
  return () => {
@@ -18379,7 +18368,7 @@ function useMatrixProvider({ matrixClient, roomId, yDoc }) {
18379
18368
  setStatus("disconnected");
18380
18369
  };
18381
18370
  }, [initProvider]);
18382
- useEffect50(() => {
18371
+ useEffect51(() => {
18383
18372
  return () => {
18384
18373
  isMountedRef.current = false;
18385
18374
  };
@@ -18398,7 +18387,7 @@ function useCollaborativeYDoc(_options) {
18398
18387
  }
18399
18388
 
18400
18389
  // src/mantine/hooks/useCollaborativeIxoEditor.ts
18401
- import { useMemo as useMemo64, useEffect as useEffect51 } from "react";
18390
+ import { useMemo as useMemo64, useEffect as useEffect52 } from "react";
18402
18391
 
18403
18392
  // src/core/lib/matrixMetadata.ts
18404
18393
  var COVER_IMAGE_EVENT_TYPE = "ixo.page.cover_image";
@@ -18583,7 +18572,7 @@ function useCreateCollaborativeIxoEditor(options) {
18583
18572
  roomId: options.roomId
18584
18573
  });
18585
18574
  const metadataManager = useMemo64(() => new MatrixMetadataManager(matrixClient, options.roomId), [matrixClient, options.roomId]);
18586
- useEffect51(() => {
18575
+ useEffect52(() => {
18587
18576
  return () => {
18588
18577
  metadataManager.dispose();
18589
18578
  };
@@ -18804,12 +18793,12 @@ function useCreateCollaborativeIxoEditor(options) {
18804
18793
  return void 0;
18805
18794
  };
18806
18795
  }
18807
- useEffect51(() => {
18796
+ useEffect52(() => {
18808
18797
  if (ixoEditor) {
18809
18798
  ixoEditor.isEditable = editable;
18810
18799
  }
18811
18800
  }, [ixoEditor, editable]);
18812
- useEffect51(() => {
18801
+ useEffect52(() => {
18813
18802
  if (connectionStatus !== "connected") {
18814
18803
  return;
18815
18804
  }
@@ -18842,7 +18831,7 @@ function useCreateCollaborativeIxoEditor(options) {
18842
18831
  }
18843
18832
 
18844
18833
  // src/mantine/components/CoverImage.tsx
18845
- import React196, { useState as useState68, useRef as useRef13, useEffect as useEffect52 } from "react";
18834
+ import React196, { useState as useState68, useRef as useRef12, useEffect as useEffect53 } from "react";
18846
18835
  import { Box as Box35, Group as Group62 } from "@mantine/core";
18847
18836
 
18848
18837
  // src/core/lib/imageTransform.ts
@@ -19005,10 +18994,10 @@ function CoverImage({ coverImageUrl, logoUrl }) {
19005
18994
  const [isHovering, setIsHovering] = useState68(false);
19006
18995
  const [isRepositioning, setIsRepositioning] = useState68(false);
19007
18996
  const [coverPosition, setCoverPosition] = useState68(50);
19008
- const coverFileInputRef = useRef13(null);
19009
- const logoFileInputRef = useRef13(null);
18997
+ const coverFileInputRef = useRef12(null);
18998
+ const logoFileInputRef = useRef12(null);
19010
18999
  const [metadata, setMetadata] = useState68(() => editor?.getPageMetadata?.() || null);
19011
- useEffect52(() => {
19000
+ useEffect53(() => {
19012
19001
  if (!editor?._metadataManager) {
19013
19002
  return;
19014
19003
  }
@@ -19295,7 +19284,7 @@ function CoverImage({ coverImageUrl, logoUrl }) {
19295
19284
  }
19296
19285
 
19297
19286
  // src/mantine/components/PageHeader.tsx
19298
- import React197, { useState as useState69, useRef as useRef14, useEffect as useEffect53 } from "react";
19287
+ import React197, { useState as useState69, useRef as useRef13, useEffect as useEffect54 } from "react";
19299
19288
  function PageHeader({
19300
19289
  title = "New page",
19301
19290
  icon,
@@ -19307,8 +19296,8 @@ function PageHeader({
19307
19296
  menuItems = []
19308
19297
  }) {
19309
19298
  const [isMenuOpen, setIsMenuOpen] = useState69(false);
19310
- const menuRef = useRef14(null);
19311
- useEffect53(() => {
19299
+ const menuRef = useRef13(null);
19300
+ useEffect54(() => {
19312
19301
  function handleClickOutside(event) {
19313
19302
  if (menuRef.current && !menuRef.current.contains(event.target)) {
19314
19303
  setIsMenuOpen(false);
@@ -19488,7 +19477,7 @@ var styles = {
19488
19477
  };
19489
19478
 
19490
19479
  // src/mantine/components/ExternalDropZone.tsx
19491
- import React198, { useCallback as useCallback52, useEffect as useEffect54, useRef as useRef15, useState as useState70 } from "react";
19480
+ import React198, { useCallback as useCallback52, useEffect as useEffect55, useRef as useRef14, useState as useState70 } from "react";
19492
19481
  import { Box as Box36 } from "@mantine/core";
19493
19482
  var SCROLL_ZONE_SIZE = 80;
19494
19483
  var SCROLL_SPEED = 12;
@@ -19501,14 +19490,14 @@ var ExternalDropZone = ({
19501
19490
  onPlacementCancel,
19502
19491
  children
19503
19492
  }) => {
19504
- const containerRef = useRef15(null);
19493
+ const containerRef = useRef14(null);
19505
19494
  const [isValidDrag, setIsValidDrag] = useState70(false);
19506
19495
  const [isHoveringInPlacementMode, setIsHoveringInPlacementMode] = useState70(false);
19507
19496
  const [indicatorStyle, setIndicatorStyle] = useState70({});
19508
- const dropPositionRef = useRef15(null);
19509
- const scrollAnimationRef = useRef15(null);
19510
- const scrollDirectionRef = useRef15(null);
19511
- const scrollContainerRef = useRef15(null);
19497
+ const dropPositionRef = useRef14(null);
19498
+ const scrollAnimationRef = useRef14(null);
19499
+ const scrollDirectionRef = useRef14(null);
19500
+ const scrollContainerRef = useRef14(null);
19512
19501
  const getBlockElements = useCallback52(() => {
19513
19502
  if (!containerRef.current) return [];
19514
19503
  const blocks = containerRef.current.querySelectorAll('[data-node-type="blockContainer"]');
@@ -19664,7 +19653,7 @@ var ExternalDropZone = ({
19664
19653
  },
19665
19654
  [onDrop, stopAutoScroll]
19666
19655
  );
19667
- useEffect54(() => {
19656
+ useEffect55(() => {
19668
19657
  const handleGlobalDragEnd = () => {
19669
19658
  setIsValidDrag(false);
19670
19659
  dropPositionRef.current = null;
@@ -19722,7 +19711,7 @@ var ExternalDropZone = ({
19722
19711
  },
19723
19712
  [getScrollContainer]
19724
19713
  );
19725
- useEffect54(() => {
19714
+ useEffect55(() => {
19726
19715
  if (!isPlacementMode) return;
19727
19716
  const handleKeyDown = (e) => {
19728
19717
  if (e.key === "Escape") {
@@ -19745,13 +19734,13 @@ var ExternalDropZone = ({
19745
19734
  document.removeEventListener("click", handleGlobalClick, true);
19746
19735
  };
19747
19736
  }, [isPlacementMode, onPlacementCancel]);
19748
- useEffect54(() => {
19737
+ useEffect55(() => {
19749
19738
  if (!isPlacementMode) {
19750
19739
  setIsHoveringInPlacementMode(false);
19751
19740
  dropPositionRef.current = null;
19752
19741
  }
19753
19742
  }, [isPlacementMode]);
19754
- useEffect54(() => {
19743
+ useEffect55(() => {
19755
19744
  const isActive = isValidDrag || isPlacementMode && isHoveringInPlacementMode;
19756
19745
  if (isActive) {
19757
19746
  document.body.classList.add("external-artifact-drag-active");
@@ -19762,7 +19751,7 @@ var ExternalDropZone = ({
19762
19751
  document.body.classList.remove("external-artifact-drag-active");
19763
19752
  };
19764
19753
  }, [isValidDrag, isPlacementMode, isHoveringInPlacementMode]);
19765
- useEffect54(() => {
19754
+ useEffect55(() => {
19766
19755
  return () => {
19767
19756
  if (scrollAnimationRef.current) {
19768
19757
  cancelAnimationFrame(scrollAnimationRef.current);
@@ -20122,7 +20111,7 @@ var EntitySigningSetup = ({
20122
20111
  };
20123
20112
 
20124
20113
  // src/mantine/components/FlowPermissionsPanel.tsx
20125
- import React202, { useState as useState72, useEffect as useEffect55, useMemo as useMemo65 } from "react";
20114
+ import React202, { useState as useState72, useEffect as useEffect56, useMemo as useMemo65 } from "react";
20126
20115
  import { Stack as Stack127, Text as Text101, Paper as Paper21, Group as Group64, Badge as Badge31, Button as Button37, ActionIcon as ActionIcon29, Loader as Loader26, Alert as Alert27, Divider as Divider12 } from "@mantine/core";
20127
20116
  import { IconPlus as IconPlus5, IconTrash as IconTrash6, IconShieldCheck as IconShieldCheck2, IconUser as IconUser4, IconRobot as IconRobot3, IconBuilding } from "@tabler/icons-react";
20128
20117
  var FlowPermissionsPanel = ({
@@ -20137,7 +20126,7 @@ var FlowPermissionsPanel = ({
20137
20126
  const [loading, setLoading] = useState72(true);
20138
20127
  const [revoking, setRevoking] = useState72(null);
20139
20128
  const rootCapability = useMemo65(() => editor.getRootCapability?.(), [editor]);
20140
- useEffect55(() => {
20129
+ useEffect56(() => {
20141
20130
  const loadDelegations = async () => {
20142
20131
  setLoading(true);
20143
20132
  const allDelegations = editor.getAllDelegations?.() || [];
@@ -20554,4 +20543,4 @@ export {
20554
20543
  ixoGraphQLClient,
20555
20544
  getEntity
20556
20545
  };
20557
- //# sourceMappingURL=chunk-3A47Y7LN.mjs.map
20546
+ //# sourceMappingURL=chunk-KWCTPDGD.mjs.map