@ixo/editor 7.0.0 → 7.1.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.
|
@@ -608,6 +608,7 @@ function normalizeActorDid(value) {
|
|
|
608
608
|
}
|
|
609
609
|
var AuthorizationTab = ({ editor, block: initialBlock, flowUri = "", entityDid: entityDidProp = "" }) => {
|
|
610
610
|
const { handlers } = useBlocknoteContext();
|
|
611
|
+
const t = useTranslate();
|
|
611
612
|
const flowOwnerDid = useMemo3(() => {
|
|
612
613
|
return normalizeActorDid(editor.getFlowOwnerDid?.());
|
|
613
614
|
}, [editor]);
|
|
@@ -801,7 +802,7 @@ var AuthorizationTab = ({ editor, block: initialBlock, flowUri = "", entityDid:
|
|
|
801
802
|
)
|
|
802
803
|
);
|
|
803
804
|
}
|
|
804
|
-
return /* @__PURE__ */ React2.createElement(Stack2, { gap: "md" }, /* @__PURE__ */ React2.createElement(Stack2, { gap: "sm" }, /* @__PURE__ */ React2.createElement(Text2, { fw: 600, size: "sm" }, "Block Authorization"), rootCapabilityIsCar ? /* @__PURE__ */ React2.createElement(DismissibleAlert, { color: "green", variant: "light", icon: /* @__PURE__ */ React2.createElement(IconKey, { size: 16 }) }, /* @__PURE__ */ React2.createElement(Group2, { gap: "xs" }, /* @__PURE__ */ React2.createElement(Text2, { size: "xs", fw: 500 }, "
|
|
805
|
+
return /* @__PURE__ */ React2.createElement(Stack2, { gap: "md" }, /* @__PURE__ */ React2.createElement(Stack2, { gap: "sm" }, /* @__PURE__ */ React2.createElement(Text2, { fw: 600, size: "sm" }, "Block Authorization"), rootCapabilityIsCar ? /* @__PURE__ */ React2.createElement(DismissibleAlert, { color: "green", variant: "light", icon: /* @__PURE__ */ React2.createElement(IconKey, { size: 16 }) }, /* @__PURE__ */ React2.createElement(Group2, { gap: "xs" }, /* @__PURE__ */ React2.createElement(Text2, { size: "xs", fw: 500 }, t("authorizationTab.root.approved", { defaultValue: "Flow approved" })), /* @__PURE__ */ React2.createElement(Badge2, { size: "xs", variant: "light" }, "Owner: ", flowOwnerDid?.slice(-12) || "Unknown"))) : /* @__PURE__ */ React2.createElement(DismissibleAlert, { color: "orange", variant: "light", icon: /* @__PURE__ */ React2.createElement(IconKey, { size: 16 }) }, /* @__PURE__ */ React2.createElement(Stack2, { gap: 4 }, /* @__PURE__ */ React2.createElement(Text2, { size: "xs", fw: 500 }, rootCapability ? t("authorizationTab.root.upgradeTitle", { defaultValue: "Security update needed" }) : t("authorizationTab.root.notApprovedTitle", { defaultValue: "Approve the flow first" })), /* @__PURE__ */ React2.createElement(Text2, { size: "xs" }, rootCapability ? t("authorizationTab.root.upgradeBody", { defaultValue: "This flow needs a one-time security update before its steps can run." }) : t("authorizationTab.root.body", { defaultValue: "Steps can run, and you can give people access to them, once the flow is approved." })), isFlowOwner && canSign && /* @__PURE__ */ React2.createElement(
|
|
805
806
|
Button2,
|
|
806
807
|
{
|
|
807
808
|
size: "xs",
|
|
@@ -810,19 +811,19 @@ var AuthorizationTab = ({ editor, block: initialBlock, flowUri = "", entityDid:
|
|
|
810
811
|
loading: creatingRootCapability,
|
|
811
812
|
onClick: async () => {
|
|
812
813
|
const pin = await handlers?.requestPin?.({
|
|
813
|
-
title: "
|
|
814
|
-
description: "Enter your PIN to
|
|
814
|
+
title: t("authorizationTab.root.pinTitle", { defaultValue: "Approve this flow" }),
|
|
815
|
+
description: t("authorizationTab.root.pinDescription", { defaultValue: "Enter your PIN. You only need to do this once for this flow." })
|
|
815
816
|
});
|
|
816
817
|
if (pin) {
|
|
817
818
|
const result = await createRootCapability(pin);
|
|
818
819
|
if (!result.success) {
|
|
819
|
-
setRootCapabilityError(result.error || "
|
|
820
|
+
setRootCapabilityError(result.error || t("authorizationTab.root.failed", { defaultValue: "The flow couldn't be approved. Try again." }));
|
|
820
821
|
}
|
|
821
822
|
}
|
|
822
823
|
},
|
|
823
824
|
leftSection: /* @__PURE__ */ React2.createElement(IconKey, { size: 14 })
|
|
824
825
|
},
|
|
825
|
-
rootCapability ? "
|
|
826
|
+
rootCapability ? t("authorizationTab.root.upgradeButton", { defaultValue: "Approve update" }) : t("authorizationTab.root.approveButton", { defaultValue: "Approve flow" })
|
|
826
827
|
), rootCapabilityError && /* @__PURE__ */ React2.createElement(Text2, { size: "xs", c: "red" }, rootCapabilityError))), !isFlowOwner && flowOwnerDid && /* @__PURE__ */ React2.createElement(DismissibleAlert, { color: "blue", variant: "light" }, /* @__PURE__ */ React2.createElement(Text2, { size: "xs" }, "You are not the flow owner. Only the flow owner (", flowOwnerDid.slice(-16), ") can grant capabilities.")), /* @__PURE__ */ React2.createElement(Group2, { justify: "space-between" }, /* @__PURE__ */ React2.createElement(Text2, { size: "sm", fw: 500 }, "Granted Capabilities"), /* @__PURE__ */ React2.createElement(Button2, { variant: "light", size: "xs", leftSection: /* @__PURE__ */ React2.createElement(IconShieldPlus2, { size: 14 }), onClick: () => setViewMode("grant"), disabled: !canSign || !rootCapability || !isFlowOwner }, "Grant Permission")), !canSign && /* @__PURE__ */ React2.createElement(DismissibleAlert, { color: "yellow", variant: "light" }, /* @__PURE__ */ React2.createElement(Text2, { size: "xs" }, "User signing is not configured. Please set up user signing to grant capabilities.")), revokeError && /* @__PURE__ */ React2.createElement(DismissibleAlert, { color: "red", variant: "light" }, /* @__PURE__ */ React2.createElement(Text2, { size: "xs" }, revokeError)), blockCapabilities.length === 0 ? /* @__PURE__ */ React2.createElement(Text2, { size: "sm", c: "dimmed" }, "No capabilities granted for this block yet.") : /* @__PURE__ */ React2.createElement(Stack2, { gap: "xs" }, blockCapabilities.map((cap) => {
|
|
827
828
|
const cid = cap.cid ?? cap.id ?? "";
|
|
828
829
|
const audience = cap.audienceDid ?? cap.audience ?? "";
|
|
@@ -27560,4 +27561,4 @@ export {
|
|
|
27560
27561
|
ixoGraphQLClient,
|
|
27561
27562
|
getEntity
|
|
27562
27563
|
};
|
|
27563
|
-
//# sourceMappingURL=chunk-
|
|
27564
|
+
//# sourceMappingURL=chunk-VDEWPLOB.js.map
|