@ixo/editor 3.0.0-beta.26 → 3.0.0-beta.27
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.
|
@@ -1540,14 +1540,14 @@ var BlocknoteProvider = ({
|
|
|
1540
1540
|
}, [sharedProposals]);
|
|
1541
1541
|
const fetchSharedProposal = useCallback4(
|
|
1542
1542
|
async (proposalId, contractAddress, force = false) => {
|
|
1543
|
-
const
|
|
1544
|
-
const cached = sharedProposalsRef.current[
|
|
1543
|
+
const cacheKey2 = `${contractAddress}:${proposalId}`;
|
|
1544
|
+
const cached = sharedProposalsRef.current[cacheKey2];
|
|
1545
1545
|
if (!force && cached && Date.now() - cached.lastFetched < 3e4 && !cached.error) {
|
|
1546
1546
|
return cached.proposal;
|
|
1547
1547
|
}
|
|
1548
1548
|
setSharedProposals((prev) => ({
|
|
1549
1549
|
...prev,
|
|
1550
|
-
[
|
|
1550
|
+
[cacheKey2]: { ...prev[cacheKey2], loading: true }
|
|
1551
1551
|
}));
|
|
1552
1552
|
try {
|
|
1553
1553
|
if (!handlers) {
|
|
@@ -1556,7 +1556,7 @@ var BlocknoteProvider = ({
|
|
|
1556
1556
|
const proposal = await handlers.getProposal(contractAddress, proposalId);
|
|
1557
1557
|
setSharedProposals((prev) => ({
|
|
1558
1558
|
...prev,
|
|
1559
|
-
[
|
|
1559
|
+
[cacheKey2]: {
|
|
1560
1560
|
proposal,
|
|
1561
1561
|
lastFetched: Date.now(),
|
|
1562
1562
|
loading: false
|
|
@@ -1566,8 +1566,8 @@ var BlocknoteProvider = ({
|
|
|
1566
1566
|
} catch (error) {
|
|
1567
1567
|
setSharedProposals((prev) => ({
|
|
1568
1568
|
...prev,
|
|
1569
|
-
[
|
|
1570
|
-
...prev[
|
|
1569
|
+
[cacheKey2]: {
|
|
1570
|
+
...prev[cacheKey2],
|
|
1571
1571
|
loading: false,
|
|
1572
1572
|
error
|
|
1573
1573
|
}
|
|
@@ -1593,8 +1593,8 @@ var BlocknoteProvider = ({
|
|
|
1593
1593
|
});
|
|
1594
1594
|
}, []);
|
|
1595
1595
|
const subscribeToProposal = useCallback4(
|
|
1596
|
-
(
|
|
1597
|
-
return sharedProposals[
|
|
1596
|
+
(cacheKey2) => {
|
|
1597
|
+
return sharedProposals[cacheKey2]?.proposal;
|
|
1598
1598
|
},
|
|
1599
1599
|
[sharedProposals]
|
|
1600
1600
|
);
|
|
@@ -2192,24 +2192,24 @@ import { useState as useState6, useEffect as useEffect8, useCallback as useCallb
|
|
|
2192
2192
|
var useSharedProposal = ({ proposalId, contractAddress, autoFetch = true }) => {
|
|
2193
2193
|
const { sharedProposals, fetchSharedProposal, invalidateProposal, subscribeToProposal } = useBlocknoteContext();
|
|
2194
2194
|
const [localProposal, setLocalProposal] = useState6(null);
|
|
2195
|
-
const
|
|
2195
|
+
const cacheKey2 = `${contractAddress}:${proposalId}`;
|
|
2196
2196
|
useEffect8(() => {
|
|
2197
2197
|
if (!proposalId || !contractAddress || !autoFetch) return;
|
|
2198
2198
|
fetchSharedProposal(proposalId, contractAddress).then(setLocalProposal).catch(() => {
|
|
2199
2199
|
});
|
|
2200
2200
|
}, [proposalId, contractAddress, fetchSharedProposal, autoFetch]);
|
|
2201
2201
|
useEffect8(() => {
|
|
2202
|
-
const proposal = subscribeToProposal(
|
|
2202
|
+
const proposal = subscribeToProposal(cacheKey2);
|
|
2203
2203
|
if (proposal) {
|
|
2204
2204
|
setLocalProposal(proposal);
|
|
2205
2205
|
}
|
|
2206
|
-
}, [subscribeToProposal,
|
|
2206
|
+
}, [subscribeToProposal, cacheKey2]);
|
|
2207
2207
|
const refetch = useCallback10(() => fetchSharedProposal(proposalId, contractAddress, true), [fetchSharedProposal, proposalId, contractAddress]);
|
|
2208
2208
|
const invalidate = useCallback10(() => invalidateProposal(proposalId), [invalidateProposal, proposalId]);
|
|
2209
2209
|
return {
|
|
2210
2210
|
proposal: localProposal,
|
|
2211
|
-
loading: sharedProposals[
|
|
2212
|
-
error: sharedProposals[
|
|
2211
|
+
loading: sharedProposals[cacheKey2]?.loading ?? false,
|
|
2212
|
+
error: sharedProposals[cacheKey2]?.error,
|
|
2213
2213
|
refetch,
|
|
2214
2214
|
invalidate
|
|
2215
2215
|
};
|
|
@@ -23320,7 +23320,7 @@ var ActionTemplateView = ({ editor, block }) => {
|
|
|
23320
23320
|
// src/mantine/blocks/action/flow/FlowView.tsx
|
|
23321
23321
|
import React235, { useMemo as useMemo86, useState as useState88 } from "react";
|
|
23322
23322
|
import { Group as Group87, Stack as Stack156, Text as Text132, Button as Button40, Code as Code7, Loader as Loader32, Alert as Alert32, Box as Box45, Divider as Divider21 } from "@mantine/core";
|
|
23323
|
-
import { IconPlayerPlay as IconPlayerPlay2, IconAlertTriangle as IconAlertTriangle3, IconUser as IconUser13, IconBolt as IconBolt8 } from "@tabler/icons-react";
|
|
23323
|
+
import { IconPlayerPlay as IconPlayerPlay2, IconAlertTriangle as IconAlertTriangle3, IconUser as IconUser13, IconBolt as IconBolt8, IconShieldCheck as IconShieldCheck14 } from "@tabler/icons-react";
|
|
23324
23324
|
|
|
23325
23325
|
// src/mantine/hooks/useAutoCommitOnExecute.ts
|
|
23326
23326
|
import { useEffect as useEffect73, useRef as useRef21 } from "react";
|
|
@@ -23441,6 +23441,12 @@ var ActionFlowView = ({ editor, block, isDisabled }) => {
|
|
|
23441
23441
|
}
|
|
23442
23442
|
)
|
|
23443
23443
|
},
|
|
23444
|
+
{
|
|
23445
|
+
label: "Authorization",
|
|
23446
|
+
value: "authorization",
|
|
23447
|
+
icon: /* @__PURE__ */ React235.createElement(IconShieldCheck14, { size: 18, color: ICON_COLOR }),
|
|
23448
|
+
content: /* @__PURE__ */ React235.createElement(AuthorizationTab, { editor, block })
|
|
23449
|
+
},
|
|
23444
23450
|
{
|
|
23445
23451
|
label: "Assignment",
|
|
23446
23452
|
value: "assignment",
|
|
@@ -28421,7 +28427,7 @@ var CredentialStoreConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
28421
28427
|
// src/mantine/blocks/action/actionTypes/credentialStore/CredentialStoreFlowDetail.tsx
|
|
28422
28428
|
import React265, { useCallback as useCallback96, useMemo as useMemo106, useState as useState117 } from "react";
|
|
28423
28429
|
import { Alert as Alert51, Button as Button49, Code as Code10, Loader as Loader51, Stack as Stack185, Text as Text155 } from "@mantine/core";
|
|
28424
|
-
import { IconShieldCheck as
|
|
28430
|
+
import { IconShieldCheck as IconShieldCheck15 } from "@tabler/icons-react";
|
|
28425
28431
|
function safeParse(value) {
|
|
28426
28432
|
let result = value;
|
|
28427
28433
|
for (let i = 0; i < 2; i++) {
|
|
@@ -28574,7 +28580,7 @@ var CredentialStoreFlowDetail = ({ inputs, editor, block, runtime, updateRuntime
|
|
|
28574
28580
|
updateRuntime,
|
|
28575
28581
|
verifySignature
|
|
28576
28582
|
]);
|
|
28577
|
-
return /* @__PURE__ */ React265.createElement(Stack185, { gap: "md" }, !hasKey && /* @__PURE__ */ React265.createElement(Alert51, { color: "yellow", styles: actionAlertStyles }, "No credential key configured. Set one in template mode."), hasKey && !hasCredential && !isCompleted && /* @__PURE__ */ React265.createElement(Alert51, { color: "yellow", styles: actionAlertStyles }, "Waiting for credential data. It will be provided by a block reference or at execution time."), hasKey && hasCredential && !isCompleted && /* @__PURE__ */ React265.createElement(Stack185, { gap: "xs" }, /* @__PURE__ */ React265.createElement(Text155, { size: "xs", c: "dimmed" }, "Credential key: ", resolvedCredentialKey), /* @__PURE__ */ React265.createElement(CredentialPreview, { value: resolvedCredential }), /* @__PURE__ */ React265.createElement(Button49, { leftSection: submitting ? /* @__PURE__ */ React265.createElement(Loader51, { size: 14 }) : /* @__PURE__ */ React265.createElement(
|
|
28583
|
+
return /* @__PURE__ */ React265.createElement(Stack185, { gap: "md" }, !hasKey && /* @__PURE__ */ React265.createElement(Alert51, { color: "yellow", styles: actionAlertStyles }, "No credential key configured. Set one in template mode."), hasKey && !hasCredential && !isCompleted && /* @__PURE__ */ React265.createElement(Alert51, { color: "yellow", styles: actionAlertStyles }, "Waiting for credential data. It will be provided by a block reference or at execution time."), hasKey && hasCredential && !isCompleted && /* @__PURE__ */ React265.createElement(Stack185, { gap: "xs" }, /* @__PURE__ */ React265.createElement(Text155, { size: "xs", c: "dimmed" }, "Credential key: ", resolvedCredentialKey), /* @__PURE__ */ React265.createElement(CredentialPreview, { value: resolvedCredential }), /* @__PURE__ */ React265.createElement(Button49, { leftSection: submitting ? /* @__PURE__ */ React265.createElement(Loader51, { size: 14 }) : /* @__PURE__ */ React265.createElement(IconShieldCheck15, { size: 14 }), onClick: handleExecute, disabled: isDisabled || submitting, size: "sm" }, submitting ? "Storing..." : "Store Credential")), isCompleted && /* @__PURE__ */ React265.createElement(Alert51, { color: runtime.output?.duplicate ? "yellow" : "green", styles: actionAlertStyles }, runtime.output?.duplicate ? `Credential already stored under key "${runtime.output?.credentialKey || resolvedCredentialKey}" (duplicate).` : `Credential stored successfully under key "${runtime.output?.credentialKey || resolvedCredentialKey}".`), error && /* @__PURE__ */ React265.createElement(Alert51, { color: "red", styles: actionAlertStyles }, error), runtime.error?.message && !error && /* @__PURE__ */ React265.createElement(Alert51, { color: "red", styles: actionAlertStyles }, runtime.error.message));
|
|
28578
28584
|
};
|
|
28579
28585
|
|
|
28580
28586
|
// src/mantine/blocks/action/actionTypes/credentialStore/index.ts
|
|
@@ -30896,6 +30902,103 @@ var MatrixMetadataManager = class {
|
|
|
30896
30902
|
}
|
|
30897
30903
|
};
|
|
30898
30904
|
|
|
30905
|
+
// src/core/lib/matrixThreadLog.ts
|
|
30906
|
+
var THREAD_STATE_EVENT_TYPE = "ixo.flow.thread";
|
|
30907
|
+
function getThreadRootFromState(matrixClient, roomId, threadType) {
|
|
30908
|
+
try {
|
|
30909
|
+
const room = matrixClient.getRoom(roomId);
|
|
30910
|
+
if (!room) return null;
|
|
30911
|
+
const stateEvent = room.currentState.getStateEvents(THREAD_STATE_EVENT_TYPE, threadType);
|
|
30912
|
+
if (!stateEvent) return null;
|
|
30913
|
+
const content = stateEvent.getContent();
|
|
30914
|
+
return content?.thread_root_event_id || null;
|
|
30915
|
+
} catch {
|
|
30916
|
+
return null;
|
|
30917
|
+
}
|
|
30918
|
+
}
|
|
30919
|
+
async function createThreadRoot(matrixClient, roomId, threadType) {
|
|
30920
|
+
const response = await matrixClient.sendEvent(roomId, "m.room.message", {
|
|
30921
|
+
msgtype: "m.text",
|
|
30922
|
+
body: `[${threadType} log]`
|
|
30923
|
+
});
|
|
30924
|
+
const eventId = response.event_id;
|
|
30925
|
+
try {
|
|
30926
|
+
await matrixClient.sendStateEvent(roomId, THREAD_STATE_EVENT_TYPE, { thread_root_event_id: eventId }, threadType);
|
|
30927
|
+
} catch {
|
|
30928
|
+
}
|
|
30929
|
+
return eventId;
|
|
30930
|
+
}
|
|
30931
|
+
var threadRootCache = /* @__PURE__ */ new Map();
|
|
30932
|
+
var pendingCreation = /* @__PURE__ */ new Map();
|
|
30933
|
+
function cacheKey(roomId, threadType) {
|
|
30934
|
+
return `${roomId}:${threadType}`;
|
|
30935
|
+
}
|
|
30936
|
+
async function ensureThreadRoot(matrixClient, roomId, threadType) {
|
|
30937
|
+
const key = cacheKey(roomId, threadType);
|
|
30938
|
+
const cached = threadRootCache.get(key);
|
|
30939
|
+
if (cached) return cached;
|
|
30940
|
+
const pending = pendingCreation.get(key);
|
|
30941
|
+
if (pending) return pending;
|
|
30942
|
+
const existing = getThreadRootFromState(matrixClient, roomId, threadType);
|
|
30943
|
+
if (existing) {
|
|
30944
|
+
threadRootCache.set(key, existing);
|
|
30945
|
+
return existing;
|
|
30946
|
+
}
|
|
30947
|
+
const promise = createThreadRoot(matrixClient, roomId, threadType).then((eventId) => {
|
|
30948
|
+
threadRootCache.set(key, eventId);
|
|
30949
|
+
pendingCreation.delete(key);
|
|
30950
|
+
return eventId;
|
|
30951
|
+
}).catch((error) => {
|
|
30952
|
+
pendingCreation.delete(key);
|
|
30953
|
+
throw error;
|
|
30954
|
+
});
|
|
30955
|
+
pendingCreation.set(key, promise);
|
|
30956
|
+
return promise;
|
|
30957
|
+
}
|
|
30958
|
+
async function appendToThread(matrixClient, roomId, threadType, payload) {
|
|
30959
|
+
const threadRootId = await ensureThreadRoot(matrixClient, roomId, threadType);
|
|
30960
|
+
await matrixClient.sendEvent(roomId, "m.room.message", {
|
|
30961
|
+
msgtype: "m.text",
|
|
30962
|
+
body: JSON.stringify(payload),
|
|
30963
|
+
"m.relates_to": {
|
|
30964
|
+
rel_type: "m.thread",
|
|
30965
|
+
event_id: threadRootId
|
|
30966
|
+
}
|
|
30967
|
+
});
|
|
30968
|
+
}
|
|
30969
|
+
function logDelegation(matrixClient, roomId, delegation) {
|
|
30970
|
+
appendToThread(matrixClient, roomId, "delegations", {
|
|
30971
|
+
type: "delegation",
|
|
30972
|
+
cid: delegation.cid,
|
|
30973
|
+
issuerDid: delegation.issuerDid,
|
|
30974
|
+
audienceDid: delegation.audienceDid,
|
|
30975
|
+
capabilities: delegation.capabilities,
|
|
30976
|
+
expiration: delegation.expiration,
|
|
30977
|
+
createdAt: delegation.createdAt,
|
|
30978
|
+
format: delegation.format,
|
|
30979
|
+
proofCids: delegation.proofCids
|
|
30980
|
+
}).catch((error) => {
|
|
30981
|
+
console.warn("[MatrixThreadLog] Failed to log delegation:", delegation.cid, error);
|
|
30982
|
+
});
|
|
30983
|
+
}
|
|
30984
|
+
function logInvocation(matrixClient, roomId, invocation) {
|
|
30985
|
+
appendToThread(matrixClient, roomId, "invocations", {
|
|
30986
|
+
type: "invocation",
|
|
30987
|
+
cid: invocation.cid,
|
|
30988
|
+
invokerDid: invocation.invokerDid,
|
|
30989
|
+
capability: invocation.capability,
|
|
30990
|
+
executedAt: invocation.executedAt,
|
|
30991
|
+
flowId: invocation.flowId,
|
|
30992
|
+
blockId: invocation.blockId,
|
|
30993
|
+
result: invocation.result,
|
|
30994
|
+
error: invocation.error,
|
|
30995
|
+
proofCids: invocation.proofCids,
|
|
30996
|
+
claimId: invocation.claimId
|
|
30997
|
+
}).catch((error) => {
|
|
30998
|
+
console.warn("[MatrixThreadLog] Failed to log invocation:", invocation.cid, error);
|
|
30999
|
+
});
|
|
31000
|
+
}
|
|
31001
|
+
|
|
30899
31002
|
// src/core/lib/flowEngine/dmNotificationState.ts
|
|
30900
31003
|
var DM_NOTIFICATIONS_KEY = "__dm_notifications";
|
|
30901
31004
|
function getDMNotificationState(runtimeMap) {
|
|
@@ -30993,8 +31096,24 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
30993
31096
|
const runtimeMap = useMemo117(() => yDoc.getMap("runtime"), [yDoc]);
|
|
30994
31097
|
const delegationsMap = useMemo117(() => yDoc.getMap("delegations"), [yDoc]);
|
|
30995
31098
|
const invocationsMap = useMemo117(() => yDoc.getMap("invocations"), [yDoc]);
|
|
30996
|
-
const ucanDelegationStore = useMemo117(() =>
|
|
30997
|
-
|
|
31099
|
+
const ucanDelegationStore = useMemo117(() => {
|
|
31100
|
+
const store = createUcanDelegationStore(delegationsMap);
|
|
31101
|
+
const originalSet = store.set;
|
|
31102
|
+
store.set = (delegation) => {
|
|
31103
|
+
originalSet(delegation);
|
|
31104
|
+
logDelegation(matrixClient, options.roomId, delegation);
|
|
31105
|
+
};
|
|
31106
|
+
return store;
|
|
31107
|
+
}, [delegationsMap, matrixClient, options.roomId]);
|
|
31108
|
+
const invocationStore = useMemo117(() => {
|
|
31109
|
+
const store = createInvocationStore(invocationsMap);
|
|
31110
|
+
const originalAdd = store.add;
|
|
31111
|
+
store.add = (invocation) => {
|
|
31112
|
+
originalAdd(invocation);
|
|
31113
|
+
logInvocation(matrixClient, options.roomId, invocation);
|
|
31114
|
+
};
|
|
31115
|
+
return store;
|
|
31116
|
+
}, [invocationsMap, matrixClient, options.roomId]);
|
|
30998
31117
|
const userFragment = useMemo117(() => yDoc.getMap(memoizedUser.id), [yDoc, memoizedUser.id]);
|
|
30999
31118
|
const collaborationConfig = useMemo117(
|
|
31000
31119
|
() => ({
|
|
@@ -31108,6 +31227,17 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
31108
31227
|
return;
|
|
31109
31228
|
}
|
|
31110
31229
|
delegationsMap.set(capability.id, JSON.stringify(capability));
|
|
31230
|
+
logDelegation(matrixClient, options.roomId, {
|
|
31231
|
+
cid: capability.id,
|
|
31232
|
+
delegation: "",
|
|
31233
|
+
issuerDid: capability.issuer,
|
|
31234
|
+
audienceDid: capability.audience,
|
|
31235
|
+
capabilities: capability.capabilities,
|
|
31236
|
+
expiration: capability.expiration,
|
|
31237
|
+
createdAt: new Date(capability.issuedAt).getTime() || Date.now(),
|
|
31238
|
+
format: "legacy",
|
|
31239
|
+
proofCids: capability.proofs || []
|
|
31240
|
+
});
|
|
31111
31241
|
};
|
|
31112
31242
|
ixoEditor.getRootCapability = () => {
|
|
31113
31243
|
const rootId = delegationsMap.get(ROOT_CAPABILITY_KEY);
|
|
@@ -31300,8 +31430,9 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
31300
31430
|
useEffect105(() => {
|
|
31301
31431
|
if (!ixoEditor || connectionStatus !== "connected" || dmSentRef.current) return;
|
|
31302
31432
|
if (ixoEditor.docType !== "flow") return;
|
|
31303
|
-
const
|
|
31304
|
-
const
|
|
31433
|
+
const editor2 = ixoEditor;
|
|
31434
|
+
const mx = editor2.getMatrixClient?.();
|
|
31435
|
+
const runtime = editor2._yRuntime;
|
|
31305
31436
|
const currentUserId = mx?.getUserId();
|
|
31306
31437
|
if (!mx || !runtime || !currentUserId) return;
|
|
31307
31438
|
dmSentRef.current = true;
|
|
@@ -33054,7 +33185,7 @@ var EntitySigningSetup = ({ opened, onClose, entityDid, entityName, onSetup }) =
|
|
|
33054
33185
|
// src/mantine/components/FlowPermissionsPanel.tsx
|
|
33055
33186
|
import React298, { useState as useState136, useEffect as useEffect112, useMemo as useMemo121 } from "react";
|
|
33056
33187
|
import { Stack as Stack198, Text as Text169, Paper as Paper18, Group as Group109, Badge as Badge43, Button as Button54, ActionIcon as ActionIcon38, Loader as Loader54, Alert as Alert54, Divider as Divider29 } from "@mantine/core";
|
|
33057
|
-
import { IconPlus as IconPlus12, IconTrash as IconTrash11, IconShieldCheck as
|
|
33188
|
+
import { IconPlus as IconPlus12, IconTrash as IconTrash11, IconShieldCheck as IconShieldCheck16, IconUser as IconUser14, IconRobot as IconRobot4, IconBuilding as IconBuilding2 } from "@tabler/icons-react";
|
|
33058
33189
|
var FlowPermissionsPanel = ({ editor, entityDid, entityName, onGrantPermission, onRevokePermission, getUserDisplayName }) => {
|
|
33059
33190
|
const [delegations, setDelegations] = useState136([]);
|
|
33060
33191
|
const [loading, setLoading] = useState136(true);
|
|
@@ -33122,7 +33253,7 @@ var FlowPermissionsPanel = ({ editor, entityDid, entityName, onGrantPermission,
|
|
|
33122
33253
|
if (date < /* @__PURE__ */ new Date()) return "Expired";
|
|
33123
33254
|
return date.toLocaleDateString();
|
|
33124
33255
|
};
|
|
33125
|
-
return /* @__PURE__ */ React298.createElement(Stack198, { gap: "md" }, /* @__PURE__ */ React298.createElement(Stack198, { gap: "xs" }, /* @__PURE__ */ React298.createElement(Text169, { fw: 600, size: "sm" }, "Root Authority"), /* @__PURE__ */ React298.createElement(Paper18, { p: "sm", withBorder: true }, /* @__PURE__ */ React298.createElement(Group109, { gap: "xs" }, /* @__PURE__ */ React298.createElement(
|
|
33256
|
+
return /* @__PURE__ */ React298.createElement(Stack198, { gap: "md" }, /* @__PURE__ */ React298.createElement(Stack198, { gap: "xs" }, /* @__PURE__ */ React298.createElement(Text169, { fw: 600, size: "sm" }, "Root Authority"), /* @__PURE__ */ React298.createElement(Paper18, { p: "sm", withBorder: true }, /* @__PURE__ */ React298.createElement(Group109, { gap: "xs" }, /* @__PURE__ */ React298.createElement(IconShieldCheck16, { size: 20, color: "var(--mantine-color-green-6)" }), /* @__PURE__ */ React298.createElement(Stack198, { gap: 2, style: { flex: 1 } }, /* @__PURE__ */ React298.createElement(Text169, { size: "sm", fw: 500 }, entityName || entityDid), /* @__PURE__ */ React298.createElement(Text169, { size: "xs", c: "dimmed" }, rootCapability ? `Granted: ${new Date(rootCapability.issuedAt).toLocaleDateString()}` : "Root capability not set up")), /* @__PURE__ */ React298.createElement(Badge43, { color: "green", variant: "light" }, "Entity")))), /* @__PURE__ */ React298.createElement(Divider29, { label: "Delegated Permissions", labelPosition: "center" }), loading ? /* @__PURE__ */ React298.createElement(Group109, { justify: "center", py: "xl" }, /* @__PURE__ */ React298.createElement(Loader54, { size: "sm" })) : delegations.length === 0 ? /* @__PURE__ */ React298.createElement(Alert54, { color: "gray", variant: "light" }, /* @__PURE__ */ React298.createElement(Text169, { size: "sm" }, "No permissions have been granted yet.")) : /* @__PURE__ */ React298.createElement(Stack198, { gap: "xs" }, delegations.map(({ capability, displayName, type }) => /* @__PURE__ */ React298.createElement(Paper18, { key: capability.id, p: "sm", withBorder: true }, /* @__PURE__ */ React298.createElement(Group109, { justify: "space-between" }, /* @__PURE__ */ React298.createElement(Group109, { gap: "xs" }, getIcon2(type), /* @__PURE__ */ React298.createElement(Stack198, { gap: 2 }, /* @__PURE__ */ React298.createElement(Text169, { size: "sm", fw: 500 }, displayName), /* @__PURE__ */ React298.createElement(Text169, { size: "xs", c: "dimmed" }, formatCapabilities(capability.capabilities)), /* @__PURE__ */ React298.createElement(Group109, { gap: "xs" }, /* @__PURE__ */ React298.createElement(Text169, { size: "xs", c: "dimmed" }, "Expires: ", formatExpiration(capability.expiration)), /* @__PURE__ */ React298.createElement(Text169, { size: "xs", c: "dimmed" }, "\u2022"), /* @__PURE__ */ React298.createElement(Text169, { size: "xs", c: "dimmed" }, "Granted by: ", capability.issuer === entityDid ? "Entity" : capability.issuer.slice(-8))))), /* @__PURE__ */ React298.createElement(ActionIcon38, { color: "red", variant: "subtle", onClick: () => handleRevoke(capability.id), loading: revoking === capability.id, disabled: !!revoking }, /* @__PURE__ */ React298.createElement(IconTrash11, { size: 16 })))))), /* @__PURE__ */ React298.createElement(Button54, { leftSection: /* @__PURE__ */ React298.createElement(IconPlus12, { size: 16 }), variant: "light", onClick: onGrantPermission }, "Grant Permission"));
|
|
33126
33257
|
};
|
|
33127
33258
|
|
|
33128
33259
|
// src/mantine/components/GrantPermissionModal.tsx
|
|
@@ -33404,4 +33535,4 @@ export {
|
|
|
33404
33535
|
getExtraSlashMenuItems,
|
|
33405
33536
|
useCreateIxoEditor
|
|
33406
33537
|
};
|
|
33407
|
-
//# sourceMappingURL=chunk-
|
|
33538
|
+
//# sourceMappingURL=chunk-WEEDXXFU.mjs.map
|