@ixo/editor 2.6.0 → 2.8.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.
@@ -10956,13 +10956,14 @@ var surveyTheme = {
10956
10956
  backgroundOpacity: 0,
10957
10957
  cssVariables: {
10958
10958
  // Input backgrounds - match BaseTextInput
10959
- "-sjs-editorpanel-backcolor": "transparent",
10960
- "--sjs-editor-background": "transparent",
10961
- "--sjs-general-backcolor": "transparent",
10962
- "--sjs-general-backcolor-dark": "transparent",
10963
- "--sjs-general-backcolor-dim": "transparent",
10964
- "--sjs-general-backcolor-dim-light": "transparent",
10965
- "--sjs-general-backcolor-dim-dark": "transparent",
10959
+ "-sjs-editorpanel-backcolor": "#1a1a1a",
10960
+ "--sjs-editor-background": "#1a1a1a",
10961
+ "--sjs-general-backcolor": "#2a2a2a",
10962
+ // this one
10963
+ "--sjs-general-backcolor-dark": "#1a1a1a",
10964
+ "--sjs-general-backcolor-dim": "rgba(255, 255, 255, 0.04)",
10965
+ "--sjs-general-backcolor-dim-light": "rgba(255, 255, 255, 0.04)",
10966
+ "--sjs-general-backcolor-dim-dark": "rgba(255, 255, 255, 0.04)",
10966
10967
  // Text colors - match BaseTextInput
10967
10968
  "--sjs-general-forecolor": "#f1f3f5",
10968
10969
  "--sjs-general-forecolor-light": "#f1f3f5",
@@ -14437,9 +14438,12 @@ function deepEqual(a, b) {
14437
14438
  var DomainCreatorSurveyPanel = ({ editor, block, onComplete, entityDid: existingEntityDid, issuerDid: issuerDidOverride }) => {
14438
14439
  const { closePanel } = usePanelStore();
14439
14440
  const { handlers } = useBlocknoteContext();
14440
- const [flowStep, setFlowStep] = useState51("survey");
14441
+ const existingBlockEntityDid = block.props.entityDid;
14442
+ const existingBlockEntityType = block.props.entityType;
14443
+ const [flowStep, setFlowStep] = useState51(existingBlockEntityDid ? "success" : "survey");
14441
14444
  const [error, setError] = useState51(null);
14442
- const [createdEntityDid, setCreatedEntityDid] = useState51(null);
14445
+ const [createdEntityDid, setCreatedEntityDid] = useState51(existingBlockEntityDid || null);
14446
+ const [createdEntityType, setCreatedEntityType] = useState51(existingBlockEntityType || null);
14443
14447
  const isUpdatingFromProp = useRef7(false);
14444
14448
  const lastSyncedAnswers = useRef7("");
14445
14449
  const surveyModel = useMemo43(() => {
@@ -14582,14 +14586,16 @@ var DomainCreatorSurveyPanel = ({ editor, block, onComplete, entityDid: existing
14582
14586
  description: `Domain Card for ${data["schema:name"] || "Domain"}`
14583
14587
  });
14584
14588
  setFlowStep("creating");
14589
+ const entityType = data["type_2"] || data["daoType"] || "dao";
14585
14590
  const { entityDid: newEntityDid, transactionHash } = await handlers.createDomain({
14586
- entityType: data["type_2"] || data["daoType"] || "dao",
14591
+ entityType,
14587
14592
  linkedResource: [domainCardLinkedResource],
14588
14593
  startDate: data["schema:validFrom"],
14589
14594
  endDate: data["schema:validUntil"]
14590
14595
  });
14591
14596
  return {
14592
14597
  entityDid: newEntityDid,
14598
+ entityType,
14593
14599
  transactionHash
14594
14600
  };
14595
14601
  },
@@ -14601,7 +14607,15 @@ var DomainCreatorSurveyPanel = ({ editor, block, onComplete, entityDid: existing
14601
14607
  try {
14602
14608
  const result = await processDomainCreation(data);
14603
14609
  setCreatedEntityDid(result.entityDid);
14610
+ setCreatedEntityType(result.entityType);
14604
14611
  setFlowStep("success");
14612
+ editor.updateBlock(block, {
14613
+ props: {
14614
+ ...block.props,
14615
+ entityDid: result.entityDid,
14616
+ entityType: result.entityType
14617
+ }
14618
+ });
14605
14619
  onComplete?.({
14606
14620
  surveyData: data,
14607
14621
  entityDid: result.entityDid,
@@ -14613,7 +14627,7 @@ var DomainCreatorSurveyPanel = ({ editor, block, onComplete, entityDid: existing
14613
14627
  setFlowStep("error");
14614
14628
  }
14615
14629
  },
14616
- [processDomainCreation, onComplete]
14630
+ [processDomainCreation, onComplete, editor, block]
14617
14631
  );
14618
14632
  useEffect39(() => {
14619
14633
  surveyModel.onComplete.add(handleSurveyComplete);
@@ -14629,6 +14643,11 @@ var DomainCreatorSurveyPanel = ({ editor, block, onComplete, entityDid: existing
14629
14643
  const handleClose = useCallback36(() => {
14630
14644
  closePanel();
14631
14645
  }, [closePanel]);
14646
+ const handleVisitEntity = useCallback36(() => {
14647
+ if (createdEntityDid && createdEntityType && handlers?.redirectToEntityOverview) {
14648
+ handlers.redirectToEntityOverview(createdEntityDid, createdEntityType);
14649
+ }
14650
+ }, [createdEntityDid, createdEntityType, handlers]);
14632
14651
  if (flowStep === "signing" || flowStep === "uploading" || flowStep === "creating") {
14633
14652
  const stepMessages = {
14634
14653
  signing: "Signing Domain Card credential...",
@@ -14638,12 +14657,12 @@ var DomainCreatorSurveyPanel = ({ editor, block, onComplete, entityDid: existing
14638
14657
  return /* @__PURE__ */ React156.createElement(Stack105, { gap: "md", p: "md", align: "center", justify: "center", style: { minHeight: 300 } }, /* @__PURE__ */ React156.createElement(Loader22, { size: "lg" }), /* @__PURE__ */ React156.createElement(Text79, { size: "sm", c: "dimmed" }, stepMessages[flowStep]));
14639
14658
  }
14640
14659
  if (flowStep === "success") {
14641
- return /* @__PURE__ */ React156.createElement(Stack105, { gap: "md", p: "md" }, /* @__PURE__ */ React156.createElement(Alert23, { icon: /* @__PURE__ */ React156.createElement(IconCheck3, { size: 16 }), title: "Domain Created Successfully", color: "green" }, /* @__PURE__ */ React156.createElement(Stack105, { gap: "xs" }, /* @__PURE__ */ React156.createElement(Text79, { size: "sm" }, "Your domain has been created and the Domain Card credential has been signed and stored."), createdEntityDid && /* @__PURE__ */ React156.createElement(Text79, { size: "xs", c: "dimmed" }, "Entity DID: ", createdEntityDid))), /* @__PURE__ */ React156.createElement(Button30, { onClick: handleClose }, "Close"));
14660
+ return /* @__PURE__ */ React156.createElement(Stack105, { gap: "md", p: "md" }, /* @__PURE__ */ React156.createElement(Alert23, { icon: /* @__PURE__ */ React156.createElement(IconCheck3, { size: 16 }), title: "Domain Created Successfully", color: "green" }, /* @__PURE__ */ React156.createElement(Stack105, { gap: "xs" }, /* @__PURE__ */ React156.createElement(Text79, { size: "sm" }, "Your domain has been created and the Domain Card credential has been signed and stored."), createdEntityDid && /* @__PURE__ */ React156.createElement(Text79, { size: "xs", c: "dimmed", style: { textTransform: "uppercase" } }, "Entity DID: ", createdEntityDid))), /* @__PURE__ */ React156.createElement(Button30, { onClick: handleVisitEntity }, "Visit Entity"));
14642
14661
  }
14643
14662
  if (flowStep === "error") {
14644
14663
  return /* @__PURE__ */ React156.createElement(Stack105, { gap: "md", p: "md" }, /* @__PURE__ */ React156.createElement(Alert23, { icon: /* @__PURE__ */ React156.createElement(IconAlertCircle9, { size: 16 }), title: "Domain Creation Failed", color: "red" }, /* @__PURE__ */ React156.createElement(Text79, { size: "sm" }, error || "An unexpected error occurred")), /* @__PURE__ */ React156.createElement(Group47, null, /* @__PURE__ */ React156.createElement(Button30, { variant: "outline", onClick: handleRetry }, "Try Again"), /* @__PURE__ */ React156.createElement(Button30, { variant: "subtle", onClick: handleClose }, "Close")));
14645
14664
  }
14646
- return /* @__PURE__ */ React156.createElement(Stack105, { gap: "md", p: "md" }, /* @__PURE__ */ React156.createElement(Group47, { justify: "space-between", align: "flex-start" }, /* @__PURE__ */ React156.createElement(Stack105, { gap: 4 }, /* @__PURE__ */ React156.createElement(Title11, { order: 3 }, "Domain Creator"), /* @__PURE__ */ React156.createElement(Text79, { size: "sm", c: "dimmed" }, "Complete the survey to create a new domain with a signed Domain Card credential.")), /* @__PURE__ */ React156.createElement(CloseButton6, { onClick: handleClose, title: "Close panel" })), /* @__PURE__ */ React156.createElement(Survey5, { model: surveyModel }));
14665
+ return /* @__PURE__ */ React156.createElement(Stack105, { bg: "#1a1a1a", gap: "md", p: "md" }, /* @__PURE__ */ React156.createElement(Group47, { justify: "space-between", align: "flex-start" }, /* @__PURE__ */ React156.createElement(Stack105, { gap: 4 }, /* @__PURE__ */ React156.createElement(Title11, { order: 3 }, "Domain Creator"), /* @__PURE__ */ React156.createElement(Text79, { size: "sm", c: "dimmed" }, "Complete the survey to create a new domain with a signed Domain Card credential.")), /* @__PURE__ */ React156.createElement(CloseButton6, { onClick: handleClose, title: "Close panel" })), /* @__PURE__ */ React156.createElement(Survey5, { model: surveyModel }));
14647
14666
  };
14648
14667
 
14649
14668
  // src/mantine/blocks/domainCreator/flow/FlowView.tsx
@@ -14712,7 +14731,9 @@ var DomainCreatorBlockSpec = createReactBlockSpec11(
14712
14731
  icon: { default: "file-text" },
14713
14732
  surveySchema: { default: "" },
14714
14733
  answers: { default: "" },
14715
- lastSubmission: { default: "" }
14734
+ lastSubmission: { default: "" },
14735
+ entityDid: { default: "" },
14736
+ entityType: { default: "" }
14716
14737
  },
14717
14738
  content: "none"
14718
14739
  },
@@ -17245,4 +17266,4 @@ export {
17245
17266
  ixoGraphQLClient,
17246
17267
  getEntity
17247
17268
  };
17248
- //# sourceMappingURL=chunk-JDX7FG5C.mjs.map
17269
+ //# sourceMappingURL=chunk-IHPJ6TAG.mjs.map