@ixo/editor 3.0.0-beta.27 → 3.0.0-beta.28
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.
- package/dist/{chunk-WEEDXXFU.mjs → chunk-LQP2DPYM.mjs} +348 -170
- package/dist/chunk-LQP2DPYM.mjs.map +1 -0
- package/dist/{chunk-SUFKRSSM.mjs → chunk-NOMJJJDB.mjs} +107 -22
- package/dist/chunk-NOMJJJDB.mjs.map +1 -0
- package/dist/chunk-SZSEZY6Z.mjs +470 -0
- package/dist/chunk-SZSEZY6Z.mjs.map +1 -0
- package/dist/core/index.d.ts +34 -170
- package/dist/core/index.mjs +19 -1
- package/dist/{graphql-client-CJ0vMGiH.d.ts → graphql-client-CSiffz9I.d.ts} +1 -1
- package/dist/{index-aAHFla8N.d.ts → index-BmOZ-1iJ.d.ts} +2 -0
- package/dist/index.d.ts +3 -3
- package/dist/index.mjs +8 -2
- package/dist/index.mjs.map +1 -1
- package/dist/mantine/index.d.ts +4 -4
- package/dist/mantine/index.mjs +2 -2
- package/dist/{capabilityValidation-BSzFr-F6.d.ts → setup-C5MpJdyr.d.ts} +376 -2
- package/package.json +1 -1
- package/dist/chunk-SUFKRSSM.mjs.map +0 -1
- package/dist/chunk-WEEDXXFU.mjs.map +0 -1
|
@@ -14,10 +14,12 @@ import {
|
|
|
14
14
|
getAction,
|
|
15
15
|
getAllActions,
|
|
16
16
|
isActorAuthorized,
|
|
17
|
+
isNodeActive,
|
|
17
18
|
parseLinkedEntities,
|
|
19
|
+
resolveActionType,
|
|
18
20
|
sendDirectMessage,
|
|
19
21
|
transformSurveyToCredentialSubject
|
|
20
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-NOMJJJDB.mjs";
|
|
21
23
|
|
|
22
24
|
// src/mantine/hooks/useCreateIxoEditor.ts
|
|
23
25
|
import { useCreateBlockNote } from "@blocknote/react";
|
|
@@ -2265,6 +2267,10 @@ function computeExpiresAt(committedAt, ttlDuration) {
|
|
|
2265
2267
|
const expiresAt = new Date(committedAt.getTime() + days * 864e5 + hours * 36e5 + minutes * 6e4);
|
|
2266
2268
|
return expiresAt.toISOString();
|
|
2267
2269
|
}
|
|
2270
|
+
function durationToMs(iso) {
|
|
2271
|
+
const { days, hours, minutes } = parseDuration(iso);
|
|
2272
|
+
return days * 864e5 + hours * 36e5 + minutes * 6e4;
|
|
2273
|
+
}
|
|
2268
2274
|
var formatDate = (dateString) => {
|
|
2269
2275
|
if (!dateString) return "N/A";
|
|
2270
2276
|
try {
|
|
@@ -22862,7 +22868,7 @@ import React234, { useMemo as useMemo85 } from "react";
|
|
|
22862
22868
|
// src/mantine/blocks/action/template/TemplateConfig.tsx
|
|
22863
22869
|
import React233, { useCallback as useCallback69, useMemo as useMemo84 } from "react";
|
|
22864
22870
|
import { Stack as Stack154 } from "@mantine/core";
|
|
22865
|
-
import { IconCheck as IconCheck15, IconContract as IconContract4, IconSettings as IconSettings18, IconShieldCheck as IconShieldCheck13, IconUserCheck as IconUserCheck4 } from "@tabler/icons-react";
|
|
22871
|
+
import { IconCheck as IconCheck15, IconClock as IconClock11, IconContract as IconContract4, IconSettings as IconSettings18, IconShieldCheck as IconShieldCheck13, IconUserCheck as IconUserCheck4 } from "@tabler/icons-react";
|
|
22866
22872
|
|
|
22867
22873
|
// src/mantine/blocks/action/template/GeneralTab.tsx
|
|
22868
22874
|
import React232, { useEffect as useEffect72, useMemo as useMemo83, useState as useState87 } from "react";
|
|
@@ -22958,105 +22964,105 @@ function registerActionTypeUI(actionType, ui) {
|
|
|
22958
22964
|
registry.set(actionType, ui);
|
|
22959
22965
|
}
|
|
22960
22966
|
function getActionTypeUI(actionType) {
|
|
22961
|
-
return registry.get(actionType);
|
|
22967
|
+
return registry.get(resolveActionType(actionType));
|
|
22962
22968
|
}
|
|
22963
22969
|
|
|
22964
22970
|
// src/mantine/blocks/action/template/GeneralTab.tsx
|
|
22965
22971
|
var COMBO_ICON_SIZE = 20;
|
|
22966
22972
|
var ACTION_TYPE_META = {
|
|
22967
|
-
"email.send": {
|
|
22973
|
+
"qi/email.send": {
|
|
22968
22974
|
label: "Email",
|
|
22969
22975
|
description: "Send an email to a user",
|
|
22970
22976
|
icon: icon(IconMail6, COMBO_ICON_SIZE)
|
|
22971
22977
|
},
|
|
22972
|
-
"http.request": {
|
|
22978
|
+
"qi/http.request": {
|
|
22973
22979
|
label: "HTTP Request",
|
|
22974
22980
|
description: "Make an HTTP API request",
|
|
22975
22981
|
icon: icon(IconWorld2, COMBO_ICON_SIZE)
|
|
22976
22982
|
},
|
|
22977
|
-
"notification.push": {
|
|
22983
|
+
"qi/notification.push": {
|
|
22978
22984
|
label: "Push Notification",
|
|
22979
22985
|
description: "Send a push notification",
|
|
22980
22986
|
icon: icon(IconBell2, COMBO_ICON_SIZE)
|
|
22981
22987
|
},
|
|
22982
|
-
"human.checkbox.set": {
|
|
22988
|
+
"qi/human.checkbox.set": {
|
|
22983
22989
|
label: "Checkbox Set",
|
|
22984
22990
|
description: "Record a checkbox response",
|
|
22985
22991
|
icon: icon(IconCheckbox3, COMBO_ICON_SIZE)
|
|
22986
22992
|
},
|
|
22987
|
-
"form.submit": {
|
|
22993
|
+
"qi/form.submit": {
|
|
22988
22994
|
label: "Form Submit",
|
|
22989
22995
|
description: "Submit a form response",
|
|
22990
22996
|
icon: icon(IconClipboard, COMBO_ICON_SIZE)
|
|
22991
22997
|
},
|
|
22992
|
-
"human.form.submit": {
|
|
22998
|
+
"qi/human.form.submit": {
|
|
22993
22999
|
label: "Human Form Submit",
|
|
22994
23000
|
description: "Submit a human-completed form",
|
|
22995
23001
|
icon: icon(IconClipboardCheck, COMBO_ICON_SIZE)
|
|
22996
23002
|
},
|
|
22997
|
-
bid: {
|
|
23003
|
+
"qi/bid.submit": {
|
|
22998
23004
|
label: "Bid",
|
|
22999
23005
|
description: "Submit a bid application",
|
|
23000
23006
|
icon: icon(IconBriefcase2, COMBO_ICON_SIZE)
|
|
23001
23007
|
},
|
|
23002
|
-
|
|
23008
|
+
"qi/bid.evaluate": {
|
|
23003
23009
|
label: "Evaluate Bid",
|
|
23004
23010
|
description: "Approve or reject a bid",
|
|
23005
23011
|
icon: icon(IconScale, COMBO_ICON_SIZE)
|
|
23006
23012
|
},
|
|
23007
|
-
claim: {
|
|
23013
|
+
"qi/claim.submit": {
|
|
23008
23014
|
label: "Claim",
|
|
23009
23015
|
description: "Submit a claim",
|
|
23010
23016
|
icon: icon(IconFileText5, COMBO_ICON_SIZE)
|
|
23011
23017
|
},
|
|
23012
|
-
|
|
23018
|
+
"qi/claim.evaluate": {
|
|
23013
23019
|
label: "Evaluate Claim",
|
|
23014
23020
|
description: "Approve or reject a claim",
|
|
23015
23021
|
icon: icon(IconChecks4, COMBO_ICON_SIZE)
|
|
23016
23022
|
},
|
|
23017
|
-
"proposal.create": {
|
|
23023
|
+
"qi/proposal.create": {
|
|
23018
23024
|
label: "Create Proposal",
|
|
23019
23025
|
description: "Create an on-chain governance proposal",
|
|
23020
23026
|
icon: icon(IconFileText5, COMBO_ICON_SIZE)
|
|
23021
23027
|
},
|
|
23022
|
-
"proposal.vote": {
|
|
23028
|
+
"qi/proposal.vote": {
|
|
23023
23029
|
label: "Vote on Proposal",
|
|
23024
23030
|
description: "Cast a vote on a governance proposal",
|
|
23025
23031
|
icon: icon(IconThumbUp2, COMBO_ICON_SIZE)
|
|
23026
23032
|
},
|
|
23027
|
-
"protocol.select": {
|
|
23033
|
+
"qi/protocol.select": {
|
|
23028
23034
|
label: "Select Protocol",
|
|
23029
23035
|
description: "Select a protocol from a configured list",
|
|
23030
23036
|
icon: icon(IconBolt7, COMBO_ICON_SIZE)
|
|
23031
23037
|
},
|
|
23032
|
-
"domain.sign": {
|
|
23038
|
+
"qi/domain.sign": {
|
|
23033
23039
|
label: "Sign Domain",
|
|
23034
23040
|
description: "Sign a domain card credential",
|
|
23035
23041
|
icon: icon(IconSignature3, COMBO_ICON_SIZE)
|
|
23036
23042
|
},
|
|
23037
|
-
"domain.create": {
|
|
23043
|
+
"qi/domain.create": {
|
|
23038
23044
|
label: "Create Domain",
|
|
23039
23045
|
description: "Create a new domain entity on-chain",
|
|
23040
23046
|
icon: icon(IconBuildingEstate, COMBO_ICON_SIZE)
|
|
23041
23047
|
},
|
|
23042
|
-
"credential.store": {
|
|
23048
|
+
"qi/credential.store": {
|
|
23043
23049
|
label: "Store Credential",
|
|
23044
23050
|
description: "Store a verifiable credential in Matrix room state",
|
|
23045
23051
|
icon: icon(IconShieldCheck12, COMBO_ICON_SIZE)
|
|
23046
23052
|
},
|
|
23047
|
-
payment: {
|
|
23053
|
+
"qi/payment.execute": {
|
|
23048
23054
|
label: "Payment",
|
|
23049
23055
|
description: "Calculate, propose, and execute a payment",
|
|
23050
23056
|
icon: icon(IconCash, COMBO_ICON_SIZE)
|
|
23051
23057
|
},
|
|
23052
|
-
"matrix.dm": {
|
|
23058
|
+
"qi/matrix.dm": {
|
|
23053
23059
|
label: "Matrix DM",
|
|
23054
23060
|
description: "Send a direct message via Matrix",
|
|
23055
23061
|
icon: icon(IconMessageCircle, COMBO_ICON_SIZE)
|
|
23056
23062
|
}
|
|
23057
23063
|
};
|
|
23058
23064
|
function getActionMeta(actionType) {
|
|
23059
|
-
return ACTION_TYPE_META[actionType] || {
|
|
23065
|
+
return ACTION_TYPE_META[resolveActionType(actionType)] || {
|
|
23060
23066
|
label: actionType || "Select action",
|
|
23061
23067
|
description: actionType ? `Run ${actionType}` : "Choose an action type",
|
|
23062
23068
|
icon: icon(IconBolt7, COMBO_ICON_SIZE)
|
|
@@ -23177,27 +23183,27 @@ var TemplateConfig16 = ({ editor, block }) => {
|
|
|
23177
23183
|
const { closePanel } = usePanelStore();
|
|
23178
23184
|
const isValid = useMemo84(() => {
|
|
23179
23185
|
const title = (block.props.title || "").trim();
|
|
23180
|
-
const actionType = block.props.actionType || "";
|
|
23186
|
+
const actionType = resolveActionType(block.props.actionType || "");
|
|
23181
23187
|
if (!title || !actionType) return false;
|
|
23182
23188
|
try {
|
|
23183
23189
|
const inputs = JSON.parse(block.props.inputs || "{}");
|
|
23184
23190
|
switch (actionType) {
|
|
23185
|
-
case "email.send":
|
|
23191
|
+
case "qi/email.send":
|
|
23186
23192
|
if (!inputs.to?.trim()) return false;
|
|
23187
23193
|
break;
|
|
23188
|
-
case "http.request":
|
|
23194
|
+
case "qi/http.request":
|
|
23189
23195
|
if (!inputs.endpoint?.trim()) return false;
|
|
23190
23196
|
break;
|
|
23191
|
-
case "bid":
|
|
23192
|
-
case "claim":
|
|
23193
|
-
case "
|
|
23194
|
-
case "
|
|
23197
|
+
case "qi/bid.submit":
|
|
23198
|
+
case "qi/claim.submit":
|
|
23199
|
+
case "qi/bid.evaluate":
|
|
23200
|
+
case "qi/claim.evaluate":
|
|
23195
23201
|
if (!inputs.deedDid?.trim() || !inputs.collectionId?.trim()) return false;
|
|
23196
23202
|
break;
|
|
23197
|
-
case "form.submit":
|
|
23203
|
+
case "qi/form.submit":
|
|
23198
23204
|
if (!inputs.surveySchema?.trim()) return false;
|
|
23199
23205
|
break;
|
|
23200
|
-
case "payment":
|
|
23206
|
+
case "qi/payment.execute":
|
|
23201
23207
|
break;
|
|
23202
23208
|
}
|
|
23203
23209
|
} catch {
|
|
@@ -23260,6 +23266,12 @@ var TemplateConfig16 = ({ editor, block }) => {
|
|
|
23260
23266
|
value: "commitment",
|
|
23261
23267
|
icon: icon(IconContract4),
|
|
23262
23268
|
content: /* @__PURE__ */ React233.createElement(CommitmentTab, { editor, block })
|
|
23269
|
+
},
|
|
23270
|
+
{
|
|
23271
|
+
label: "TTL",
|
|
23272
|
+
value: "ttl",
|
|
23273
|
+
icon: icon(IconClock11),
|
|
23274
|
+
content: /* @__PURE__ */ React233.createElement(TtlTab, { editor, block })
|
|
23263
23275
|
}
|
|
23264
23276
|
];
|
|
23265
23277
|
return /* @__PURE__ */ React233.createElement(BaseRightPanelLayout, { title: "Configuration", onClose: closePanel, tabs, context: { editor, block } });
|
|
@@ -23950,7 +23962,7 @@ var HttpRequestFlowDetail = ({ inputs, editor, runtime, updateRuntime, isDisable
|
|
|
23950
23962
|
};
|
|
23951
23963
|
|
|
23952
23964
|
// src/mantine/blocks/action/actionTypes/httpRequest/index.ts
|
|
23953
|
-
registerActionTypeUI("http.request", {
|
|
23965
|
+
registerActionTypeUI("qi/http.request", {
|
|
23954
23966
|
configComponent: HttpRequestConfig,
|
|
23955
23967
|
flowDetailComponent: HttpRequestFlowDetail
|
|
23956
23968
|
});
|
|
@@ -24133,7 +24145,7 @@ var EmailSendConfig = ({ inputs, onInputsChange, editor, blockId }) => {
|
|
|
24133
24145
|
};
|
|
24134
24146
|
|
|
24135
24147
|
// src/mantine/blocks/action/actionTypes/emailSend/index.ts
|
|
24136
|
-
registerActionTypeUI("email.send", {
|
|
24148
|
+
registerActionTypeUI("qi/email.send", {
|
|
24137
24149
|
configComponent: EmailSendConfig
|
|
24138
24150
|
});
|
|
24139
24151
|
|
|
@@ -24380,7 +24392,7 @@ var BidFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isDisabled
|
|
|
24380
24392
|
if (!canSubmit) {
|
|
24381
24393
|
return;
|
|
24382
24394
|
}
|
|
24383
|
-
const actionDef = getAction("bid");
|
|
24395
|
+
const actionDef = getAction("qi/bid.submit");
|
|
24384
24396
|
if (!actionDef) {
|
|
24385
24397
|
setError("Bid action is not registered");
|
|
24386
24398
|
return;
|
|
@@ -24498,7 +24510,7 @@ var BidFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isDisabled
|
|
|
24498
24510
|
};
|
|
24499
24511
|
|
|
24500
24512
|
// src/mantine/blocks/action/actionTypes/bid/index.ts
|
|
24501
|
-
registerActionTypeUI("bid", {
|
|
24513
|
+
registerActionTypeUI("qi/bid.submit", {
|
|
24502
24514
|
configComponent: BidConfig,
|
|
24503
24515
|
flowDetailComponent: BidFlowDetail
|
|
24504
24516
|
});
|
|
@@ -24820,7 +24832,7 @@ var EvaluateBidFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, is
|
|
|
24820
24832
|
setError("Rejection reason is required");
|
|
24821
24833
|
return;
|
|
24822
24834
|
}
|
|
24823
|
-
const actionDef = getAction("
|
|
24835
|
+
const actionDef = getAction("qi/bid.evaluate");
|
|
24824
24836
|
if (!actionDef) {
|
|
24825
24837
|
setError("evaluateBid action is not registered");
|
|
24826
24838
|
return;
|
|
@@ -25073,7 +25085,7 @@ var EvaluateBidFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, is
|
|
|
25073
25085
|
};
|
|
25074
25086
|
|
|
25075
25087
|
// src/mantine/blocks/action/actionTypes/evaluateBid/index.ts
|
|
25076
|
-
registerActionTypeUI("
|
|
25088
|
+
registerActionTypeUI("qi/bid.evaluate", {
|
|
25077
25089
|
configComponent: EvaluateBidConfig,
|
|
25078
25090
|
flowDetailComponent: EvaluateBidFlowDetail
|
|
25079
25091
|
});
|
|
@@ -25394,7 +25406,7 @@ var ClaimFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isDisabl
|
|
|
25394
25406
|
setError("Admin address could not be resolved for this collection");
|
|
25395
25407
|
return;
|
|
25396
25408
|
}
|
|
25397
|
-
const actionDef = getAction("claim");
|
|
25409
|
+
const actionDef = getAction("qi/claim.submit");
|
|
25398
25410
|
if (!actionDef) {
|
|
25399
25411
|
setError("claim action is not registered");
|
|
25400
25412
|
return;
|
|
@@ -25532,7 +25544,7 @@ var ClaimFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isDisabl
|
|
|
25532
25544
|
};
|
|
25533
25545
|
|
|
25534
25546
|
// src/mantine/blocks/action/actionTypes/claim/index.ts
|
|
25535
|
-
registerActionTypeUI("claim", {
|
|
25547
|
+
registerActionTypeUI("qi/claim.submit", {
|
|
25536
25548
|
configComponent: ClaimConfig,
|
|
25537
25549
|
flowDetailComponent: ClaimFlowDetail
|
|
25538
25550
|
});
|
|
@@ -25995,7 +26007,7 @@ var EvaluateClaimFlowDetail = ({ inputs, editor, block, runtime, updateRuntime,
|
|
|
25995
26007
|
setError("Admin address could not be resolved for this collection");
|
|
25996
26008
|
return;
|
|
25997
26009
|
}
|
|
25998
|
-
const actionDef = getAction("
|
|
26010
|
+
const actionDef = getAction("qi/claim.evaluate");
|
|
25999
26011
|
if (!actionDef) {
|
|
26000
26012
|
setError("evaluateClaim action is not registered");
|
|
26001
26013
|
return;
|
|
@@ -26276,7 +26288,7 @@ var EvaluateClaimFlowDetail = ({ inputs, editor, block, runtime, updateRuntime,
|
|
|
26276
26288
|
};
|
|
26277
26289
|
|
|
26278
26290
|
// src/mantine/blocks/action/actionTypes/evaluateClaim/index.ts
|
|
26279
|
-
registerActionTypeUI("
|
|
26291
|
+
registerActionTypeUI("qi/claim.evaluate", {
|
|
26280
26292
|
configComponent: EvaluateClaimConfig,
|
|
26281
26293
|
flowDetailComponent: EvaluateClaimFlowDetail
|
|
26282
26294
|
});
|
|
@@ -26548,7 +26560,7 @@ var ProposalCreateFlowDetail = ({ inputs, editor, block, runtime, updateRuntime,
|
|
|
26548
26560
|
setError("Proposal description is required");
|
|
26549
26561
|
return;
|
|
26550
26562
|
}
|
|
26551
|
-
const actionDef = getAction("proposal.create");
|
|
26563
|
+
const actionDef = getAction("qi/proposal.create");
|
|
26552
26564
|
if (!actionDef) {
|
|
26553
26565
|
setError("proposal.create action is not registered");
|
|
26554
26566
|
return;
|
|
@@ -26697,7 +26709,7 @@ var ProposalCreateFlowDetail = ({ inputs, editor, block, runtime, updateRuntime,
|
|
|
26697
26709
|
};
|
|
26698
26710
|
|
|
26699
26711
|
// src/mantine/blocks/action/actionTypes/proposalCreate/index.ts
|
|
26700
|
-
registerActionTypeUI("proposal.create", {
|
|
26712
|
+
registerActionTypeUI("qi/proposal.create", {
|
|
26701
26713
|
configComponent: ProposalCreateConfig,
|
|
26702
26714
|
flowDetailComponent: ProposalCreateFlowDetail
|
|
26703
26715
|
});
|
|
@@ -26940,7 +26952,7 @@ var ProposalVoteFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, i
|
|
|
26940
26952
|
}, [handlers, proposalContractAddress, proposalId]);
|
|
26941
26953
|
const handleVote = useCallback83(async () => {
|
|
26942
26954
|
if (!selectedVote || !proposalId || !proposalContractAddress || isDisabled || submitting) return;
|
|
26943
|
-
const actionDef = getAction("proposal.vote");
|
|
26955
|
+
const actionDef = getAction("qi/proposal.vote");
|
|
26944
26956
|
if (!actionDef) {
|
|
26945
26957
|
setError("proposal.vote action is not registered");
|
|
26946
26958
|
return;
|
|
@@ -27174,7 +27186,7 @@ var ProposalVoteFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, i
|
|
|
27174
27186
|
};
|
|
27175
27187
|
|
|
27176
27188
|
// src/mantine/blocks/action/actionTypes/proposalVote/index.ts
|
|
27177
|
-
registerActionTypeUI("proposal.vote", {
|
|
27189
|
+
registerActionTypeUI("qi/proposal.vote", {
|
|
27178
27190
|
configComponent: ProposalVoteConfig,
|
|
27179
27191
|
flowDetailComponent: ProposalVoteFlowDetail
|
|
27180
27192
|
});
|
|
@@ -27331,7 +27343,7 @@ var ProtocolSelectFlowDetail = ({ inputs, block, runtime, updateRuntime, isDisab
|
|
|
27331
27343
|
};
|
|
27332
27344
|
|
|
27333
27345
|
// src/mantine/blocks/action/actionTypes/protocolSelect/index.ts
|
|
27334
|
-
registerActionTypeUI("protocol.select", {
|
|
27346
|
+
registerActionTypeUI("qi/protocol.select", {
|
|
27335
27347
|
configComponent: ProtocolSelectConfig,
|
|
27336
27348
|
flowDetailComponent: ProtocolSelectFlowDetail
|
|
27337
27349
|
});
|
|
@@ -27474,7 +27486,7 @@ var DomainSignFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isD
|
|
|
27474
27486
|
setError("No domain card data available. Ensure the domain card viewer block has pushed data to this action.");
|
|
27475
27487
|
return;
|
|
27476
27488
|
}
|
|
27477
|
-
const actionDef = getAction("domain.sign");
|
|
27489
|
+
const actionDef = getAction("qi/domain.sign");
|
|
27478
27490
|
if (!actionDef) {
|
|
27479
27491
|
setError("domain.sign action is not registered");
|
|
27480
27492
|
return;
|
|
@@ -27597,7 +27609,7 @@ var DomainSignFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isD
|
|
|
27597
27609
|
};
|
|
27598
27610
|
|
|
27599
27611
|
// src/mantine/blocks/action/actionTypes/domainSign/index.ts
|
|
27600
|
-
registerActionTypeUI("domain.sign", {
|
|
27612
|
+
registerActionTypeUI("qi/domain.sign", {
|
|
27601
27613
|
configComponent: DomainSignConfig,
|
|
27602
27614
|
flowDetailComponent: DomainSignFlowDetail
|
|
27603
27615
|
});
|
|
@@ -27712,7 +27724,7 @@ var DomainCreateFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, i
|
|
|
27712
27724
|
}, [surveySchema]);
|
|
27713
27725
|
const handleSurveyComplete = useCallback88(
|
|
27714
27726
|
async (sender) => {
|
|
27715
|
-
const actionDef = getAction("domain.create");
|
|
27727
|
+
const actionDef = getAction("qi/domain.create");
|
|
27716
27728
|
if (!actionDef) {
|
|
27717
27729
|
setError("domain.create action is not registered");
|
|
27718
27730
|
return;
|
|
@@ -27808,7 +27820,7 @@ var DomainCreateFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, i
|
|
|
27808
27820
|
};
|
|
27809
27821
|
|
|
27810
27822
|
// src/mantine/blocks/action/actionTypes/domainCreate/index.ts
|
|
27811
|
-
registerActionTypeUI("domain.create", {
|
|
27823
|
+
registerActionTypeUI("qi/domain.create", {
|
|
27812
27824
|
configComponent: DomainCreateConfig,
|
|
27813
27825
|
flowDetailComponent: DomainCreateFlowDetail
|
|
27814
27826
|
});
|
|
@@ -28231,8 +28243,8 @@ var FormSubmitFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isD
|
|
|
28231
28243
|
const handleSurveyComplete = useCallback94(
|
|
28232
28244
|
async (sender) => {
|
|
28233
28245
|
if (isDisabled || submitting) return;
|
|
28234
|
-
const actionType = String(block?.props?.actionType || "form.submit");
|
|
28235
|
-
const actionDef = getAction(actionType) || getAction("form.submit");
|
|
28246
|
+
const actionType = String(block?.props?.actionType || "qi/form.submit");
|
|
28247
|
+
const actionDef = getAction(actionType) || getAction("qi/form.submit");
|
|
28236
28248
|
if (!actionDef) {
|
|
28237
28249
|
setError(`${actionType} action is not registered`);
|
|
28238
28250
|
return;
|
|
@@ -28339,11 +28351,11 @@ var FormSubmitFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isD
|
|
|
28339
28351
|
};
|
|
28340
28352
|
|
|
28341
28353
|
// src/mantine/blocks/action/actionTypes/formSubmit/index.ts
|
|
28342
|
-
registerActionTypeUI("form.submit", {
|
|
28354
|
+
registerActionTypeUI("qi/form.submit", {
|
|
28343
28355
|
configComponent: FormSubmitConfig,
|
|
28344
28356
|
flowDetailComponent: FormSubmitFlowDetail
|
|
28345
28357
|
});
|
|
28346
|
-
registerActionTypeUI("human.form.submit", {
|
|
28358
|
+
registerActionTypeUI("qi/human.form.submit", {
|
|
28347
28359
|
configComponent: FormSubmitConfig,
|
|
28348
28360
|
flowDetailComponent: FormSubmitFlowDetail
|
|
28349
28361
|
});
|
|
@@ -28494,7 +28506,7 @@ var CredentialStoreFlowDetail = ({ inputs, editor, block, runtime, updateRuntime
|
|
|
28494
28506
|
const isCompleted = runtime.state === "completed";
|
|
28495
28507
|
const handleExecute = useCallback96(async () => {
|
|
28496
28508
|
if (isDisabled || submitting) return;
|
|
28497
|
-
const actionDef = getAction("credential.store");
|
|
28509
|
+
const actionDef = getAction("qi/credential.store");
|
|
28498
28510
|
if (!actionDef) {
|
|
28499
28511
|
setError("credential.store action is not registered");
|
|
28500
28512
|
return;
|
|
@@ -28584,7 +28596,7 @@ var CredentialStoreFlowDetail = ({ inputs, editor, block, runtime, updateRuntime
|
|
|
28584
28596
|
};
|
|
28585
28597
|
|
|
28586
28598
|
// src/mantine/blocks/action/actionTypes/credentialStore/index.ts
|
|
28587
|
-
registerActionTypeUI("credential.store", {
|
|
28599
|
+
registerActionTypeUI("qi/credential.store", {
|
|
28588
28600
|
configComponent: CredentialStoreConfig,
|
|
28589
28601
|
flowDetailComponent: CredentialStoreFlowDetail
|
|
28590
28602
|
});
|
|
@@ -28833,7 +28845,7 @@ var PaymentFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isDisa
|
|
|
28833
28845
|
setError("No skill configured on this block.");
|
|
28834
28846
|
return;
|
|
28835
28847
|
}
|
|
28836
|
-
const actionDef = getAction("payment");
|
|
28848
|
+
const actionDef = getAction("qi/payment.execute");
|
|
28837
28849
|
if (!actionDef) {
|
|
28838
28850
|
setError("Payment action is not registered");
|
|
28839
28851
|
return;
|
|
@@ -28979,7 +28991,7 @@ var PaymentFlowDetail = ({ inputs, editor, block, runtime, updateRuntime, isDisa
|
|
|
28979
28991
|
};
|
|
28980
28992
|
|
|
28981
28993
|
// src/mantine/blocks/action/actionTypes/payment/index.ts
|
|
28982
|
-
registerActionTypeUI("payment", {
|
|
28994
|
+
registerActionTypeUI("qi/payment.execute", {
|
|
28983
28995
|
configComponent: PaymentConfig,
|
|
28984
28996
|
flowDetailComponent: PaymentFlowDetail
|
|
28985
28997
|
});
|
|
@@ -29087,7 +29099,7 @@ var MatrixDmConfig = ({ inputs, onInputsChange, editor }) => {
|
|
|
29087
29099
|
};
|
|
29088
29100
|
|
|
29089
29101
|
// src/mantine/blocks/action/actionTypes/matrixDm/index.ts
|
|
29090
|
-
registerActionTypeUI("matrix.dm", {
|
|
29102
|
+
registerActionTypeUI("qi/matrix.dm", {
|
|
29091
29103
|
configComponent: MatrixDmConfig
|
|
29092
29104
|
});
|
|
29093
29105
|
|
|
@@ -30745,7 +30757,7 @@ function useCollaborativeYDoc(_options) {
|
|
|
30745
30757
|
}
|
|
30746
30758
|
|
|
30747
30759
|
// src/mantine/hooks/useCollaborativeIxoEditor.ts
|
|
30748
|
-
import { useMemo as useMemo117, useEffect as
|
|
30760
|
+
import { useMemo as useMemo117, useEffect as useEffect106, useState as useState128, useRef as useRef27 } from "react";
|
|
30749
30761
|
|
|
30750
30762
|
// src/core/lib/matrixMetadata.ts
|
|
30751
30763
|
var COVER_IMAGE_EVENT_TYPE = "ixo.page.cover_image";
|
|
@@ -30999,6 +31011,103 @@ function logInvocation(matrixClient, roomId, invocation) {
|
|
|
30999
31011
|
});
|
|
31000
31012
|
}
|
|
31001
31013
|
|
|
31014
|
+
// src/mantine/hooks/useFlowLifecycle.ts
|
|
31015
|
+
import { useEffect as useEffect105, useCallback as useCallback106, useRef as useRef26 } from "react";
|
|
31016
|
+
|
|
31017
|
+
// src/mantine/hooks/useFlowTTLCleanup.ts
|
|
31018
|
+
function performTTLCleanup(editor) {
|
|
31019
|
+
const runtimeMap = editor._yRuntime;
|
|
31020
|
+
if (!runtimeMap) return;
|
|
31021
|
+
const blocks = editor.document || [];
|
|
31022
|
+
const now = Date.now();
|
|
31023
|
+
const runtimeManager = createRuntimeStateManager(editor);
|
|
31024
|
+
for (const block of blocks) {
|
|
31025
|
+
const props = block.props;
|
|
31026
|
+
const blockId = block.id;
|
|
31027
|
+
if (!props) continue;
|
|
31028
|
+
const runtimeState = runtimeManager.get(blockId);
|
|
31029
|
+
if (!runtimeState.enabledAt) {
|
|
31030
|
+
try {
|
|
31031
|
+
const flowNode = buildFlowNodeFromBlock(block);
|
|
31032
|
+
if (!flowNode.activationCondition || isNodeActive(flowNode, runtimeManager).active) {
|
|
31033
|
+
runtimeManager.update(blockId, { enabledAt: now });
|
|
31034
|
+
}
|
|
31035
|
+
} catch {
|
|
31036
|
+
}
|
|
31037
|
+
}
|
|
31038
|
+
if (runtimeState.state === "completed") continue;
|
|
31039
|
+
let clearAssignment = false;
|
|
31040
|
+
let clearCommitment = false;
|
|
31041
|
+
if (props.ttlAbsoluteDueDate) {
|
|
31042
|
+
const dueMs = new Date(props.ttlAbsoluteDueDate).getTime();
|
|
31043
|
+
if (!isNaN(dueMs) && dueMs <= now) {
|
|
31044
|
+
clearAssignment = true;
|
|
31045
|
+
clearCommitment = true;
|
|
31046
|
+
}
|
|
31047
|
+
}
|
|
31048
|
+
if (!clearCommitment && props.commitment) {
|
|
31049
|
+
let commitment;
|
|
31050
|
+
try {
|
|
31051
|
+
commitment = typeof props.commitment === "string" ? JSON.parse(props.commitment) : props.commitment;
|
|
31052
|
+
} catch {
|
|
31053
|
+
}
|
|
31054
|
+
if (commitment?.commitmentExpiresAt) {
|
|
31055
|
+
const expiresMs = new Date(commitment.commitmentExpiresAt).getTime();
|
|
31056
|
+
if (!isNaN(expiresMs) && expiresMs <= now) {
|
|
31057
|
+
clearCommitment = true;
|
|
31058
|
+
}
|
|
31059
|
+
}
|
|
31060
|
+
}
|
|
31061
|
+
if ((!clearAssignment || !clearCommitment) && props.ttlFromEnablement) {
|
|
31062
|
+
const refreshedState = runtimeManager.get(blockId);
|
|
31063
|
+
if (refreshedState.enabledAt) {
|
|
31064
|
+
const ttlMs = durationToMs(props.ttlFromEnablement);
|
|
31065
|
+
if (ttlMs > 0 && refreshedState.enabledAt + ttlMs <= now) {
|
|
31066
|
+
clearAssignment = true;
|
|
31067
|
+
clearCommitment = true;
|
|
31068
|
+
}
|
|
31069
|
+
}
|
|
31070
|
+
}
|
|
31071
|
+
const propUpdates = {};
|
|
31072
|
+
if (clearAssignment && props.assignment) {
|
|
31073
|
+
let assignment;
|
|
31074
|
+
try {
|
|
31075
|
+
assignment = typeof props.assignment === "string" ? JSON.parse(props.assignment) : props.assignment;
|
|
31076
|
+
} catch {
|
|
31077
|
+
}
|
|
31078
|
+
if (assignment?.assignedActor?.did) {
|
|
31079
|
+
propUpdates.assignment = JSON.stringify({
|
|
31080
|
+
assignedActor: { did: "", avatar: "", displayName: "" },
|
|
31081
|
+
assignedBy: { did: "", avatar: "", displayName: "" },
|
|
31082
|
+
assignedTimestamp: ""
|
|
31083
|
+
});
|
|
31084
|
+
console.log(`[FlowTTL] Cleared expired assignment on block ${blockId}`);
|
|
31085
|
+
}
|
|
31086
|
+
}
|
|
31087
|
+
if (clearCommitment && props.commitment) {
|
|
31088
|
+
let commitment;
|
|
31089
|
+
try {
|
|
31090
|
+
commitment = typeof props.commitment === "string" ? JSON.parse(props.commitment) : props.commitment;
|
|
31091
|
+
} catch {
|
|
31092
|
+
}
|
|
31093
|
+
if (commitment?.committedActor?.did) {
|
|
31094
|
+
propUpdates.commitment = JSON.stringify({
|
|
31095
|
+
committedActor: { did: "", avatar: "", displayName: "" },
|
|
31096
|
+
committedTimestamp: "",
|
|
31097
|
+
commitmentExpiresAt: ""
|
|
31098
|
+
});
|
|
31099
|
+
console.log(`[FlowTTL] Cleared expired commitment on block ${blockId}`);
|
|
31100
|
+
}
|
|
31101
|
+
}
|
|
31102
|
+
if (Object.keys(propUpdates).length > 0) {
|
|
31103
|
+
const currentBlock = (editor.document || []).find((b) => b.id === blockId) || block;
|
|
31104
|
+
editor.updateBlock(currentBlock, {
|
|
31105
|
+
props: { ...currentBlock.props, ...propUpdates }
|
|
31106
|
+
});
|
|
31107
|
+
}
|
|
31108
|
+
}
|
|
31109
|
+
}
|
|
31110
|
+
|
|
31002
31111
|
// src/core/lib/flowEngine/dmNotificationState.ts
|
|
31003
31112
|
var DM_NOTIFICATIONS_KEY = "__dm_notifications";
|
|
31004
31113
|
function getDMNotificationState(runtimeMap) {
|
|
@@ -31019,6 +31128,128 @@ function shouldNotify(state, blockId, currentAssignedDid) {
|
|
|
31019
31128
|
return existing.assignedDid !== currentAssignedDid;
|
|
31020
31129
|
}
|
|
31021
31130
|
|
|
31131
|
+
// src/mantine/hooks/useFlowLoadDMNotifications.ts
|
|
31132
|
+
async function performDMNotificationScan(editor) {
|
|
31133
|
+
const matrixClient = editor.getMatrixClient?.();
|
|
31134
|
+
const runtimeMap = editor._yRuntime;
|
|
31135
|
+
if (!matrixClient || !runtimeMap) return;
|
|
31136
|
+
const currentUserId = matrixClient.getUserId();
|
|
31137
|
+
if (!currentUserId) return;
|
|
31138
|
+
const blocks = editor.document || [];
|
|
31139
|
+
const dedupState = getDMNotificationState(runtimeMap);
|
|
31140
|
+
const flowMetadata = editor.getFlowMetadata?.();
|
|
31141
|
+
const flowTitle = flowMetadata?.title || "Untitled Flow";
|
|
31142
|
+
const roomId = editor.getRoomId?.() || "";
|
|
31143
|
+
const selfDid = currentUserId.split(":")[0].replace("@", "").replace(/-/g, ":");
|
|
31144
|
+
const notifications = [];
|
|
31145
|
+
for (const block of blocks) {
|
|
31146
|
+
const props = block.props;
|
|
31147
|
+
if (!props?.assignment) continue;
|
|
31148
|
+
let assignment;
|
|
31149
|
+
try {
|
|
31150
|
+
assignment = typeof props.assignment === "string" ? JSON.parse(props.assignment) : props.assignment;
|
|
31151
|
+
} catch {
|
|
31152
|
+
continue;
|
|
31153
|
+
}
|
|
31154
|
+
const assignedDid = assignment?.assignedActor?.did;
|
|
31155
|
+
if (!assignedDid) continue;
|
|
31156
|
+
if (assignedDid === selfDid) continue;
|
|
31157
|
+
if (!shouldNotify(dedupState, block.id, assignedDid)) continue;
|
|
31158
|
+
if (!isBlockEnabledInFlow(block, blocks)) continue;
|
|
31159
|
+
if (!isBlockActivated(block, editor)) continue;
|
|
31160
|
+
const blockType = block.type || "block";
|
|
31161
|
+
const blockId = block.id;
|
|
31162
|
+
const message = `Action needed: You have been assigned to a "${blockType}" block in flow "${flowTitle}".${roomId ? ` Room: ${roomId}` : ""}`;
|
|
31163
|
+
notifications.push(
|
|
31164
|
+
sendDirectMessage(matrixClient, assignedDid, message).then(() => {
|
|
31165
|
+
setDMNotificationRecord(runtimeMap, blockId, {
|
|
31166
|
+
assignedDid,
|
|
31167
|
+
notifiedAt: Date.now(),
|
|
31168
|
+
notifiedBy: currentUserId
|
|
31169
|
+
});
|
|
31170
|
+
console.log(`[FlowDM] Notified ${assignedDid} for block ${blockId}`);
|
|
31171
|
+
}).catch((error) => {
|
|
31172
|
+
console.error(`[FlowDM] Failed to notify ${assignedDid} for block ${blockId}:`, error);
|
|
31173
|
+
})
|
|
31174
|
+
);
|
|
31175
|
+
}
|
|
31176
|
+
if (notifications.length > 0) {
|
|
31177
|
+
await Promise.allSettled(notifications);
|
|
31178
|
+
console.log(`[FlowDM] Processed ${notifications.length} DM notification(s)`);
|
|
31179
|
+
}
|
|
31180
|
+
}
|
|
31181
|
+
function isBlockEnabledInFlow(block, editorDocument) {
|
|
31182
|
+
const conditionConfig = parseConditionConfig(block.props?.conditions);
|
|
31183
|
+
if (!conditionConfig.enabled || conditionConfig.conditions.length === 0) {
|
|
31184
|
+
return true;
|
|
31185
|
+
}
|
|
31186
|
+
const { actions } = evaluateBlockConditions(conditionConfig, editorDocument);
|
|
31187
|
+
if (hasVisibilityConditions(conditionConfig)) {
|
|
31188
|
+
const showActionExists = actions.some((a) => a.action === "show");
|
|
31189
|
+
if (!showActionExists) return false;
|
|
31190
|
+
}
|
|
31191
|
+
if (hasEnableConditions(conditionConfig)) {
|
|
31192
|
+
const enableActionExists = actions.some((a) => a.action === "enable");
|
|
31193
|
+
if (!enableActionExists) return false;
|
|
31194
|
+
}
|
|
31195
|
+
return true;
|
|
31196
|
+
}
|
|
31197
|
+
function isBlockActivated(block, editor) {
|
|
31198
|
+
try {
|
|
31199
|
+
const flowNode = buildFlowNodeFromBlock(block);
|
|
31200
|
+
if (!flowNode.activationCondition) return true;
|
|
31201
|
+
const runtimeManager = createRuntimeStateManager(editor);
|
|
31202
|
+
const result = isNodeActive(flowNode, runtimeManager);
|
|
31203
|
+
return result.active;
|
|
31204
|
+
} catch {
|
|
31205
|
+
return true;
|
|
31206
|
+
}
|
|
31207
|
+
}
|
|
31208
|
+
|
|
31209
|
+
// src/mantine/hooks/useFlowLifecycle.ts
|
|
31210
|
+
var DEFAULT_INTERVAL_MS = 3e4;
|
|
31211
|
+
function useFlowLifecycle({ editor, connectionStatus, enabled = true }) {
|
|
31212
|
+
const hasRunInitialRef = useRef26(false);
|
|
31213
|
+
const runningRef = useRef26(false);
|
|
31214
|
+
const runPipeline = useCallback106(async () => {
|
|
31215
|
+
if (!editor || runningRef.current) return;
|
|
31216
|
+
runningRef.current = true;
|
|
31217
|
+
try {
|
|
31218
|
+
performTTLCleanup(editor);
|
|
31219
|
+
await performDMNotificationScan(editor);
|
|
31220
|
+
} catch (error) {
|
|
31221
|
+
console.error("[FlowLifecycle] Pipeline error:", error);
|
|
31222
|
+
} finally {
|
|
31223
|
+
runningRef.current = false;
|
|
31224
|
+
}
|
|
31225
|
+
}, [editor]);
|
|
31226
|
+
useEffect105(() => {
|
|
31227
|
+
if (!enabled || !editor || connectionStatus !== "connected" || hasRunInitialRef.current) return;
|
|
31228
|
+
if (editor.docType !== "flow") return;
|
|
31229
|
+
hasRunInitialRef.current = true;
|
|
31230
|
+
runPipeline();
|
|
31231
|
+
}, [editor, connectionStatus, enabled, runPipeline]);
|
|
31232
|
+
useEffect105(() => {
|
|
31233
|
+
if (!enabled || !editor || connectionStatus !== "connected") return;
|
|
31234
|
+
if (editor.docType !== "flow") return;
|
|
31235
|
+
const id = setInterval(runPipeline, DEFAULT_INTERVAL_MS);
|
|
31236
|
+
return () => clearInterval(id);
|
|
31237
|
+
}, [editor, connectionStatus, enabled, runPipeline]);
|
|
31238
|
+
useEffect105(() => {
|
|
31239
|
+
if (!enabled || !editor || connectionStatus !== "connected") return;
|
|
31240
|
+
if (editor.docType !== "flow") return;
|
|
31241
|
+
const runtimeMap = editor._yRuntime;
|
|
31242
|
+
if (!runtimeMap) return;
|
|
31243
|
+
const observer = () => {
|
|
31244
|
+
runPipeline();
|
|
31245
|
+
};
|
|
31246
|
+
runtimeMap.observe(observer);
|
|
31247
|
+
return () => {
|
|
31248
|
+
runtimeMap.unobserve(observer);
|
|
31249
|
+
};
|
|
31250
|
+
}, [editor, connectionStatus, enabled, runPipeline]);
|
|
31251
|
+
}
|
|
31252
|
+
|
|
31022
31253
|
// src/mantine/hooks/useCollaborativeIxoEditor.ts
|
|
31023
31254
|
var ROOT_CAPABILITY_KEY = "__root__";
|
|
31024
31255
|
function useCreateCollaborativeIxoEditor(options) {
|
|
@@ -31056,7 +31287,7 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
31056
31287
|
roomId: options.roomId
|
|
31057
31288
|
});
|
|
31058
31289
|
const metadataManager = useMemo117(() => new MatrixMetadataManager(matrixClient, options.roomId), [matrixClient, options.roomId]);
|
|
31059
|
-
|
|
31290
|
+
useEffect106(() => {
|
|
31060
31291
|
return () => {
|
|
31061
31292
|
metadataManager.dispose();
|
|
31062
31293
|
};
|
|
@@ -31350,12 +31581,12 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
31350
31581
|
return void 0;
|
|
31351
31582
|
};
|
|
31352
31583
|
}
|
|
31353
|
-
|
|
31584
|
+
useEffect106(() => {
|
|
31354
31585
|
if (ixoEditor) {
|
|
31355
31586
|
ixoEditor.isEditable = editable;
|
|
31356
31587
|
}
|
|
31357
31588
|
}, [ixoEditor, editable]);
|
|
31358
|
-
|
|
31589
|
+
useEffect106(() => {
|
|
31359
31590
|
if (connectionStatus !== "connected") {
|
|
31360
31591
|
return;
|
|
31361
31592
|
}
|
|
@@ -31378,9 +31609,9 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
31378
31609
|
}
|
|
31379
31610
|
}, [connectionStatus, root, titleText, permissions.write, options.docId, options.title, memoizedUser.id]);
|
|
31380
31611
|
const [connectedUsers, setConnectedUsers] = useState128([]);
|
|
31381
|
-
const activeBlockIdRef =
|
|
31612
|
+
const activeBlockIdRef = useRef27(null);
|
|
31382
31613
|
const awarenessInstance = matrixProvider?.awarenessInstance ?? null;
|
|
31383
|
-
|
|
31614
|
+
useEffect106(() => {
|
|
31384
31615
|
if (!awarenessInstance || connectionStatus !== "connected") {
|
|
31385
31616
|
return;
|
|
31386
31617
|
}
|
|
@@ -31398,7 +31629,7 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
31398
31629
|
awarenessInstance.off("change", updateUsers);
|
|
31399
31630
|
};
|
|
31400
31631
|
}, [awarenessInstance, connectionStatus]);
|
|
31401
|
-
|
|
31632
|
+
useEffect106(() => {
|
|
31402
31633
|
if (!awarenessInstance || connectionStatus !== "connected") {
|
|
31403
31634
|
return;
|
|
31404
31635
|
}
|
|
@@ -31426,60 +31657,7 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
31426
31657
|
awarenessInstance.setLocalState(null);
|
|
31427
31658
|
};
|
|
31428
31659
|
}, [awarenessInstance, connectionStatus, memoizedUser.id, memoizedUser.name, memoizedUser.color, memoizedUser.avatar]);
|
|
31429
|
-
|
|
31430
|
-
useEffect105(() => {
|
|
31431
|
-
if (!ixoEditor || connectionStatus !== "connected" || dmSentRef.current) return;
|
|
31432
|
-
if (ixoEditor.docType !== "flow") return;
|
|
31433
|
-
const editor2 = ixoEditor;
|
|
31434
|
-
const mx = editor2.getMatrixClient?.();
|
|
31435
|
-
const runtime = editor2._yRuntime;
|
|
31436
|
-
const currentUserId = mx?.getUserId();
|
|
31437
|
-
if (!mx || !runtime || !currentUserId) return;
|
|
31438
|
-
dmSentRef.current = true;
|
|
31439
|
-
const sendNotifications = async () => {
|
|
31440
|
-
const blocks = ixoEditor?.document || [];
|
|
31441
|
-
const dedupState = getDMNotificationState(runtime);
|
|
31442
|
-
const flowTitle = ixoEditor?.getFlowMetadata?.()?.title || "Untitled Flow";
|
|
31443
|
-
const roomId = ixoEditor?.getRoomId?.() || "";
|
|
31444
|
-
const selfDid = currentUserId.split(":")[0].replace("@", "").replace(/-/g, ":");
|
|
31445
|
-
const notifications = [];
|
|
31446
|
-
for (const block of blocks) {
|
|
31447
|
-
const props = block.props;
|
|
31448
|
-
if (!props?.assignment) continue;
|
|
31449
|
-
let assignment;
|
|
31450
|
-
try {
|
|
31451
|
-
assignment = typeof props.assignment === "string" ? JSON.parse(props.assignment) : props.assignment;
|
|
31452
|
-
} catch {
|
|
31453
|
-
continue;
|
|
31454
|
-
}
|
|
31455
|
-
const assignedDid = assignment?.assignedActor?.did;
|
|
31456
|
-
if (!assignedDid || assignedDid === selfDid) continue;
|
|
31457
|
-
if (!shouldNotify(dedupState, block.id, assignedDid)) continue;
|
|
31458
|
-
const blockType = block.type || "block";
|
|
31459
|
-
const blockId = block.id;
|
|
31460
|
-
const message = `Action needed: You have been assigned to a "${blockType}" block in flow "${flowTitle}".${roomId ? ` Room: ${roomId}` : ""}`;
|
|
31461
|
-
notifications.push(
|
|
31462
|
-
sendDirectMessage(mx, assignedDid, message).then(() => {
|
|
31463
|
-
setDMNotificationRecord(runtime, blockId, {
|
|
31464
|
-
assignedDid,
|
|
31465
|
-
notifiedAt: Date.now(),
|
|
31466
|
-
notifiedBy: currentUserId
|
|
31467
|
-
});
|
|
31468
|
-
console.log(`[FlowDM] Notified ${assignedDid} for block ${blockId}`);
|
|
31469
|
-
}).catch((error) => {
|
|
31470
|
-
console.error(`[FlowDM] Failed to notify ${assignedDid} for block ${blockId}:`, error);
|
|
31471
|
-
})
|
|
31472
|
-
);
|
|
31473
|
-
}
|
|
31474
|
-
if (notifications.length > 0) {
|
|
31475
|
-
await Promise.allSettled(notifications);
|
|
31476
|
-
console.log(`[FlowDM] Processed ${notifications.length} DM notification(s)`);
|
|
31477
|
-
}
|
|
31478
|
-
};
|
|
31479
|
-
sendNotifications().catch((error) => {
|
|
31480
|
-
console.error("[FlowDM] Unexpected error in sendNotifications:", error);
|
|
31481
|
-
});
|
|
31482
|
-
}, [ixoEditor, connectionStatus]);
|
|
31660
|
+
useFlowLifecycle({ editor: ixoEditor, connectionStatus, enabled: permissions.write });
|
|
31483
31661
|
return {
|
|
31484
31662
|
editor: ixoEditor,
|
|
31485
31663
|
connectionStatus,
|
|
@@ -31493,7 +31671,7 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
31493
31671
|
}
|
|
31494
31672
|
|
|
31495
31673
|
// src/mantine/IxoEditor.tsx
|
|
31496
|
-
import React295, { useState as useState134, useEffect as
|
|
31674
|
+
import React295, { useState as useState134, useEffect as useEffect112, useCallback as useCallback109 } from "react";
|
|
31497
31675
|
import { SuggestionMenuController } from "@blocknote/react";
|
|
31498
31676
|
import { BlockNoteView } from "@blocknote/mantine";
|
|
31499
31677
|
import { filterSuggestionItems } from "@blocknote/core";
|
|
@@ -31550,7 +31728,7 @@ function PanelContent({ theme }) {
|
|
|
31550
31728
|
}
|
|
31551
31729
|
|
|
31552
31730
|
// src/mantine/components/CoverImage.tsx
|
|
31553
|
-
import React292, { useState as useState131, useRef as
|
|
31731
|
+
import React292, { useState as useState131, useRef as useRef28, useEffect as useEffect109, useMemo as useMemo120 } from "react";
|
|
31554
31732
|
import { Box as Box60, Group as Group107 } from "@mantine/core";
|
|
31555
31733
|
|
|
31556
31734
|
// src/core/lib/imageTransform.ts
|
|
@@ -31709,7 +31887,7 @@ var CoverImageButton = forwardRef(({ isActive = false, onClick, children, style,
|
|
|
31709
31887
|
CoverImageButton.displayName = "CoverImageButton";
|
|
31710
31888
|
|
|
31711
31889
|
// src/mantine/components/Base/BaseIconPicker.tsx
|
|
31712
|
-
import React289, { useState as useState129, useMemo as useMemo118, useEffect as
|
|
31890
|
+
import React289, { useState as useState129, useMemo as useMemo118, useEffect as useEffect107 } from "react";
|
|
31713
31891
|
import { TextInput as TextInput8, Tabs as Tabs4, Box as Box57, Stack as Stack195, UnstyledButton as UnstyledButton5, Text as Text166, Center as Center13, ScrollArea as ScrollArea9, Group as Group105, Popover as Popover6 } from "@mantine/core";
|
|
31714
31892
|
import * as TablerIcons from "@tabler/icons-react";
|
|
31715
31893
|
import { IconSearch as IconSearch7, IconX as IconX14, IconChevronLeft, IconChevronRight as IconChevronRight14 } from "@tabler/icons-react";
|
|
@@ -31754,7 +31932,7 @@ function BaseIconPicker({ opened, onClose, onSelectIcon, onUploadClick, children
|
|
|
31754
31932
|
const query = searchQuery.toLowerCase();
|
|
31755
31933
|
return allIcons.filter(([name]) => name.toLowerCase().includes(query));
|
|
31756
31934
|
}, [allIcons, searchQuery]);
|
|
31757
|
-
|
|
31935
|
+
useEffect107(() => {
|
|
31758
31936
|
setCurrentPage(1);
|
|
31759
31937
|
}, [searchQuery]);
|
|
31760
31938
|
const paginatedIcons = useMemo118(() => {
|
|
@@ -31917,14 +32095,14 @@ function PageIcon({ src, iconSize = 64, useCenter = false, style }) {
|
|
|
31917
32095
|
import { useDisclosure as useDisclosure7 } from "@mantine/hooks";
|
|
31918
32096
|
|
|
31919
32097
|
// src/mantine/components/FlowSettingsPanel.tsx
|
|
31920
|
-
import React291, { useState as useState130, useEffect as
|
|
32098
|
+
import React291, { useState as useState130, useEffect as useEffect108, useCallback as useCallback107 } from "react";
|
|
31921
32099
|
import { Stack as Stack196, Group as Group106, Button as Button52, ActionIcon as ActionIcon37, Text as Text167, Box as Box59 } from "@mantine/core";
|
|
31922
32100
|
import { IconPlus as IconPlus11, IconTrash as IconTrash10 } from "@tabler/icons-react";
|
|
31923
32101
|
var SYSTEM_KEYS = /* @__PURE__ */ new Set(["@context", "_type", "schema_version", "doc_id", "title", "createdAt", "createdBy", "flowOwnerDid"]);
|
|
31924
32102
|
var FlowSettingsPanel = ({ editor }) => {
|
|
31925
32103
|
const { closePanel } = usePanelStore();
|
|
31926
32104
|
const [rows, setRows] = useState130([]);
|
|
31927
|
-
const loadSettings =
|
|
32105
|
+
const loadSettings = useCallback107(() => {
|
|
31928
32106
|
const metadata = editor.getFlowMetadata?.();
|
|
31929
32107
|
if (!metadata) return;
|
|
31930
32108
|
const customRows = [];
|
|
@@ -31935,10 +32113,10 @@ var FlowSettingsPanel = ({ editor }) => {
|
|
|
31935
32113
|
}
|
|
31936
32114
|
setRows(customRows);
|
|
31937
32115
|
}, [editor]);
|
|
31938
|
-
|
|
32116
|
+
useEffect108(() => {
|
|
31939
32117
|
loadSettings();
|
|
31940
32118
|
}, [loadSettings]);
|
|
31941
|
-
const handleKeyChange =
|
|
32119
|
+
const handleKeyChange = useCallback107(
|
|
31942
32120
|
(index, newKey) => {
|
|
31943
32121
|
setRows((prev) => {
|
|
31944
32122
|
const updated = [...prev];
|
|
@@ -31955,7 +32133,7 @@ var FlowSettingsPanel = ({ editor }) => {
|
|
|
31955
32133
|
},
|
|
31956
32134
|
[editor]
|
|
31957
32135
|
);
|
|
31958
|
-
const handleValueChange =
|
|
32136
|
+
const handleValueChange = useCallback107(
|
|
31959
32137
|
(index, newValue) => {
|
|
31960
32138
|
setRows((prev) => {
|
|
31961
32139
|
const updated = [...prev];
|
|
@@ -31969,10 +32147,10 @@ var FlowSettingsPanel = ({ editor }) => {
|
|
|
31969
32147
|
},
|
|
31970
32148
|
[editor]
|
|
31971
32149
|
);
|
|
31972
|
-
const handleAdd =
|
|
32150
|
+
const handleAdd = useCallback107(() => {
|
|
31973
32151
|
setRows((prev) => [...prev, { key: "", value: "" }]);
|
|
31974
32152
|
}, []);
|
|
31975
|
-
const handleDelete =
|
|
32153
|
+
const handleDelete = useCallback107(
|
|
31976
32154
|
(index) => {
|
|
31977
32155
|
setRows((prev) => {
|
|
31978
32156
|
const row = prev[index];
|
|
@@ -31994,13 +32172,13 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
31994
32172
|
const [isHovering, setIsHovering] = useState131(false);
|
|
31995
32173
|
const [isRepositioning, setIsRepositioning] = useState131(false);
|
|
31996
32174
|
const [coverPosition, setCoverPosition] = useState131(() => editor?.getPageMetadata?.()?.coverPosition ?? 50);
|
|
31997
|
-
const coverFileInputRef =
|
|
31998
|
-
const logoFileInputRef =
|
|
32175
|
+
const coverFileInputRef = useRef28(null);
|
|
32176
|
+
const logoFileInputRef = useRef28(null);
|
|
31999
32177
|
const [opened, { open, close }] = useDisclosure7(false);
|
|
32000
32178
|
const [metadata, setMetadata] = useState131(() => editor?.getPageMetadata?.() || null);
|
|
32001
32179
|
const settingsPanelContent = useMemo120(() => editor ? /* @__PURE__ */ React292.createElement(FlowSettingsPanel, { editor }) : null, [editor]);
|
|
32002
32180
|
const { open: openSettings } = usePanel("flow-settings-panel", settingsPanelContent);
|
|
32003
|
-
|
|
32181
|
+
useEffect109(() => {
|
|
32004
32182
|
if (!editor?._metadataManager) {
|
|
32005
32183
|
return;
|
|
32006
32184
|
}
|
|
@@ -32314,7 +32492,7 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
32314
32492
|
}
|
|
32315
32493
|
|
|
32316
32494
|
// src/mantine/components/PageHeader.tsx
|
|
32317
|
-
import React293, { useState as useState132, useRef as
|
|
32495
|
+
import React293, { useState as useState132, useRef as useRef29, useEffect as useEffect110 } from "react";
|
|
32318
32496
|
function PageHeader({
|
|
32319
32497
|
title = "New page",
|
|
32320
32498
|
icon: icon2,
|
|
@@ -32328,9 +32506,9 @@ function PageHeader({
|
|
|
32328
32506
|
}) {
|
|
32329
32507
|
const [isMenuOpen, setIsMenuOpen] = useState132(false);
|
|
32330
32508
|
const [isPrivacyOpen, setIsPrivacyOpen] = useState132(false);
|
|
32331
|
-
const menuRef =
|
|
32332
|
-
const privacyRef =
|
|
32333
|
-
|
|
32509
|
+
const menuRef = useRef29(null);
|
|
32510
|
+
const privacyRef = useRef29(null);
|
|
32511
|
+
useEffect110(() => {
|
|
32334
32512
|
function handleClickOutside(event) {
|
|
32335
32513
|
if (menuRef.current && !menuRef.current.contains(event.target)) {
|
|
32336
32514
|
setIsMenuOpen(false);
|
|
@@ -32528,7 +32706,7 @@ var styles = {
|
|
|
32528
32706
|
};
|
|
32529
32707
|
|
|
32530
32708
|
// src/mantine/components/ExternalDropZone.tsx
|
|
32531
|
-
import React294, { useCallback as
|
|
32709
|
+
import React294, { useCallback as useCallback108, useEffect as useEffect111, useRef as useRef30, useState as useState133 } from "react";
|
|
32532
32710
|
import { Box as Box61 } from "@mantine/core";
|
|
32533
32711
|
var SCROLL_ZONE_SIZE = 80;
|
|
32534
32712
|
var SCROLL_SPEED = 12;
|
|
@@ -32541,20 +32719,20 @@ var ExternalDropZone = ({
|
|
|
32541
32719
|
onPlacementCancel,
|
|
32542
32720
|
children
|
|
32543
32721
|
}) => {
|
|
32544
|
-
const containerRef =
|
|
32722
|
+
const containerRef = useRef30(null);
|
|
32545
32723
|
const [isValidDrag, setIsValidDrag] = useState133(false);
|
|
32546
32724
|
const [isHoveringInPlacementMode, setIsHoveringInPlacementMode] = useState133(false);
|
|
32547
32725
|
const [indicatorStyle, setIndicatorStyle] = useState133({});
|
|
32548
|
-
const dropPositionRef =
|
|
32549
|
-
const scrollAnimationRef =
|
|
32550
|
-
const scrollDirectionRef =
|
|
32551
|
-
const scrollContainerRef =
|
|
32552
|
-
const getBlockElements =
|
|
32726
|
+
const dropPositionRef = useRef30(null);
|
|
32727
|
+
const scrollAnimationRef = useRef30(null);
|
|
32728
|
+
const scrollDirectionRef = useRef30(null);
|
|
32729
|
+
const scrollContainerRef = useRef30(null);
|
|
32730
|
+
const getBlockElements = useCallback108(() => {
|
|
32553
32731
|
if (!containerRef.current) return [];
|
|
32554
32732
|
const blocks = containerRef.current.querySelectorAll('[data-node-type="blockContainer"]');
|
|
32555
32733
|
return Array.from(blocks);
|
|
32556
32734
|
}, []);
|
|
32557
|
-
const getScrollContainer =
|
|
32735
|
+
const getScrollContainer = useCallback108(() => {
|
|
32558
32736
|
if (scrollContainerRef.current) return scrollContainerRef.current;
|
|
32559
32737
|
let element = containerRef.current;
|
|
32560
32738
|
while (element) {
|
|
@@ -32569,7 +32747,7 @@ var ExternalDropZone = ({
|
|
|
32569
32747
|
scrollContainerRef.current = window;
|
|
32570
32748
|
return window;
|
|
32571
32749
|
}, []);
|
|
32572
|
-
const performScroll =
|
|
32750
|
+
const performScroll = useCallback108(() => {
|
|
32573
32751
|
const container = getScrollContainer();
|
|
32574
32752
|
const direction = scrollDirectionRef.current;
|
|
32575
32753
|
if (!direction) {
|
|
@@ -32584,7 +32762,7 @@ var ExternalDropZone = ({
|
|
|
32584
32762
|
}
|
|
32585
32763
|
scrollAnimationRef.current = requestAnimationFrame(performScroll);
|
|
32586
32764
|
}, [getScrollContainer]);
|
|
32587
|
-
const startAutoScroll =
|
|
32765
|
+
const startAutoScroll = useCallback108(
|
|
32588
32766
|
(direction) => {
|
|
32589
32767
|
if (scrollDirectionRef.current === direction) return;
|
|
32590
32768
|
scrollDirectionRef.current = direction;
|
|
@@ -32594,14 +32772,14 @@ var ExternalDropZone = ({
|
|
|
32594
32772
|
},
|
|
32595
32773
|
[performScroll]
|
|
32596
32774
|
);
|
|
32597
|
-
const stopAutoScroll =
|
|
32775
|
+
const stopAutoScroll = useCallback108(() => {
|
|
32598
32776
|
scrollDirectionRef.current = null;
|
|
32599
32777
|
if (scrollAnimationRef.current) {
|
|
32600
32778
|
cancelAnimationFrame(scrollAnimationRef.current);
|
|
32601
32779
|
scrollAnimationRef.current = null;
|
|
32602
32780
|
}
|
|
32603
32781
|
}, []);
|
|
32604
|
-
const checkAutoScroll =
|
|
32782
|
+
const checkAutoScroll = useCallback108(
|
|
32605
32783
|
(clientY) => {
|
|
32606
32784
|
const container = getScrollContainer();
|
|
32607
32785
|
let containerTop;
|
|
@@ -32624,7 +32802,7 @@ var ExternalDropZone = ({
|
|
|
32624
32802
|
},
|
|
32625
32803
|
[getScrollContainer, startAutoScroll, stopAutoScroll]
|
|
32626
32804
|
);
|
|
32627
|
-
const findDropPosition =
|
|
32805
|
+
const findDropPosition = useCallback108(
|
|
32628
32806
|
(clientY) => {
|
|
32629
32807
|
const blocks = getBlockElements();
|
|
32630
32808
|
if (blocks.length === 0 || !editor?.document) return null;
|
|
@@ -32657,7 +32835,7 @@ var ExternalDropZone = ({
|
|
|
32657
32835
|
},
|
|
32658
32836
|
[getBlockElements, editor]
|
|
32659
32837
|
);
|
|
32660
|
-
const handleDragOver =
|
|
32838
|
+
const handleDragOver = useCallback108(
|
|
32661
32839
|
(e) => {
|
|
32662
32840
|
if (!e.dataTransfer.types.includes(acceptedType)) return;
|
|
32663
32841
|
e.preventDefault();
|
|
@@ -32680,7 +32858,7 @@ var ExternalDropZone = ({
|
|
|
32680
32858
|
},
|
|
32681
32859
|
[acceptedType, findDropPosition, checkAutoScroll]
|
|
32682
32860
|
);
|
|
32683
|
-
const handleDragLeave =
|
|
32861
|
+
const handleDragLeave = useCallback108(
|
|
32684
32862
|
(e) => {
|
|
32685
32863
|
if (containerRef.current && !containerRef.current.contains(e.relatedTarget)) {
|
|
32686
32864
|
setIsValidDrag(false);
|
|
@@ -32690,7 +32868,7 @@ var ExternalDropZone = ({
|
|
|
32690
32868
|
},
|
|
32691
32869
|
[stopAutoScroll]
|
|
32692
32870
|
);
|
|
32693
|
-
const handleDrop =
|
|
32871
|
+
const handleDrop = useCallback108(
|
|
32694
32872
|
(e) => {
|
|
32695
32873
|
e.preventDefault();
|
|
32696
32874
|
e.stopPropagation();
|
|
@@ -32704,7 +32882,7 @@ var ExternalDropZone = ({
|
|
|
32704
32882
|
},
|
|
32705
32883
|
[onDrop, stopAutoScroll]
|
|
32706
32884
|
);
|
|
32707
|
-
|
|
32885
|
+
useEffect111(() => {
|
|
32708
32886
|
const handleGlobalDragEnd = () => {
|
|
32709
32887
|
setIsValidDrag(false);
|
|
32710
32888
|
dropPositionRef.current = null;
|
|
@@ -32713,7 +32891,7 @@ var ExternalDropZone = ({
|
|
|
32713
32891
|
window.addEventListener("dragend", handleGlobalDragEnd);
|
|
32714
32892
|
return () => window.removeEventListener("dragend", handleGlobalDragEnd);
|
|
32715
32893
|
}, [stopAutoScroll]);
|
|
32716
|
-
const handleOverlayMouseMove =
|
|
32894
|
+
const handleOverlayMouseMove = useCallback108(
|
|
32717
32895
|
(e) => {
|
|
32718
32896
|
setIsHoveringInPlacementMode(true);
|
|
32719
32897
|
checkAutoScroll(e.clientY);
|
|
@@ -32732,12 +32910,12 @@ var ExternalDropZone = ({
|
|
|
32732
32910
|
},
|
|
32733
32911
|
[findDropPosition, checkAutoScroll]
|
|
32734
32912
|
);
|
|
32735
|
-
const handleOverlayMouseLeave =
|
|
32913
|
+
const handleOverlayMouseLeave = useCallback108(() => {
|
|
32736
32914
|
setIsHoveringInPlacementMode(false);
|
|
32737
32915
|
dropPositionRef.current = null;
|
|
32738
32916
|
stopAutoScroll();
|
|
32739
32917
|
}, [stopAutoScroll]);
|
|
32740
|
-
const handleOverlayClick =
|
|
32918
|
+
const handleOverlayClick = useCallback108(
|
|
32741
32919
|
(e) => {
|
|
32742
32920
|
e.preventDefault();
|
|
32743
32921
|
e.stopPropagation();
|
|
@@ -32751,7 +32929,7 @@ var ExternalDropZone = ({
|
|
|
32751
32929
|
},
|
|
32752
32930
|
[onDrop, stopAutoScroll]
|
|
32753
32931
|
);
|
|
32754
|
-
const handleOverlayWheel =
|
|
32932
|
+
const handleOverlayWheel = useCallback108(
|
|
32755
32933
|
(e) => {
|
|
32756
32934
|
const container = getScrollContainer();
|
|
32757
32935
|
if (container === window) {
|
|
@@ -32762,7 +32940,7 @@ var ExternalDropZone = ({
|
|
|
32762
32940
|
},
|
|
32763
32941
|
[getScrollContainer]
|
|
32764
32942
|
);
|
|
32765
|
-
|
|
32943
|
+
useEffect111(() => {
|
|
32766
32944
|
if (!isPlacementMode) return;
|
|
32767
32945
|
const handleKeyDown = (e) => {
|
|
32768
32946
|
if (e.key === "Escape") {
|
|
@@ -32785,13 +32963,13 @@ var ExternalDropZone = ({
|
|
|
32785
32963
|
document.removeEventListener("click", handleGlobalClick, true);
|
|
32786
32964
|
};
|
|
32787
32965
|
}, [isPlacementMode, onPlacementCancel]);
|
|
32788
|
-
|
|
32966
|
+
useEffect111(() => {
|
|
32789
32967
|
if (!isPlacementMode) {
|
|
32790
32968
|
setIsHoveringInPlacementMode(false);
|
|
32791
32969
|
dropPositionRef.current = null;
|
|
32792
32970
|
}
|
|
32793
32971
|
}, [isPlacementMode]);
|
|
32794
|
-
|
|
32972
|
+
useEffect111(() => {
|
|
32795
32973
|
const isActive = isValidDrag || isPlacementMode && isHoveringInPlacementMode;
|
|
32796
32974
|
if (isActive) {
|
|
32797
32975
|
document.body.classList.add("external-artifact-drag-active");
|
|
@@ -32802,7 +32980,7 @@ var ExternalDropZone = ({
|
|
|
32802
32980
|
document.body.classList.remove("external-artifact-drag-active");
|
|
32803
32981
|
};
|
|
32804
32982
|
}, [isValidDrag, isPlacementMode, isHoveringInPlacementMode]);
|
|
32805
|
-
|
|
32983
|
+
useEffect111(() => {
|
|
32806
32984
|
return () => {
|
|
32807
32985
|
if (scrollAnimationRef.current) {
|
|
32808
32986
|
cancelAnimationFrame(scrollAnimationRef.current);
|
|
@@ -32876,7 +33054,7 @@ function IxoEditorContent({
|
|
|
32876
33054
|
const { activePanel } = usePanelStore();
|
|
32877
33055
|
const isPanelOpen = activePanel !== null;
|
|
32878
33056
|
const [isRoomPrivate, setIsRoomPrivate] = useState134(pageHeaderProps?.isPrivate ?? true);
|
|
32879
|
-
|
|
33057
|
+
useEffect112(() => {
|
|
32880
33058
|
const matrixClient = editor.getMatrixClient?.();
|
|
32881
33059
|
const roomId = editor.getRoomId?.();
|
|
32882
33060
|
if (!matrixClient || !roomId) return;
|
|
@@ -32892,7 +33070,7 @@ function IxoEditorContent({
|
|
|
32892
33070
|
} catch {
|
|
32893
33071
|
}
|
|
32894
33072
|
}, [editor]);
|
|
32895
|
-
const handlePrivacyChange =
|
|
33073
|
+
const handlePrivacyChange = useCallback109(
|
|
32896
33074
|
async (makePrivate) => {
|
|
32897
33075
|
const matrixClient = editor.getMatrixClient?.();
|
|
32898
33076
|
const roomId = editor.getRoomId?.();
|
|
@@ -33183,7 +33361,7 @@ var EntitySigningSetup = ({ opened, onClose, entityDid, entityName, onSetup }) =
|
|
|
33183
33361
|
};
|
|
33184
33362
|
|
|
33185
33363
|
// src/mantine/components/FlowPermissionsPanel.tsx
|
|
33186
|
-
import React298, { useState as useState136, useEffect as
|
|
33364
|
+
import React298, { useState as useState136, useEffect as useEffect113, useMemo as useMemo121 } from "react";
|
|
33187
33365
|
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";
|
|
33188
33366
|
import { IconPlus as IconPlus12, IconTrash as IconTrash11, IconShieldCheck as IconShieldCheck16, IconUser as IconUser14, IconRobot as IconRobot4, IconBuilding as IconBuilding2 } from "@tabler/icons-react";
|
|
33189
33367
|
var FlowPermissionsPanel = ({ editor, entityDid, entityName, onGrantPermission, onRevokePermission, getUserDisplayName }) => {
|
|
@@ -33191,7 +33369,7 @@ var FlowPermissionsPanel = ({ editor, entityDid, entityName, onGrantPermission,
|
|
|
33191
33369
|
const [loading, setLoading] = useState136(true);
|
|
33192
33370
|
const [revoking, setRevoking] = useState136(null);
|
|
33193
33371
|
const rootCapability = useMemo121(() => editor.getRootCapability?.(), [editor]);
|
|
33194
|
-
|
|
33372
|
+
useEffect113(() => {
|
|
33195
33373
|
const loadDelegations = async () => {
|
|
33196
33374
|
setLoading(true);
|
|
33197
33375
|
const allDelegations = editor.getAllDelegations?.() || [];
|
|
@@ -33257,7 +33435,7 @@ var FlowPermissionsPanel = ({ editor, entityDid, entityName, onGrantPermission,
|
|
|
33257
33435
|
};
|
|
33258
33436
|
|
|
33259
33437
|
// src/mantine/components/GrantPermissionModal.tsx
|
|
33260
|
-
import React299, { useState as useState137, useCallback as
|
|
33438
|
+
import React299, { useState as useState137, useCallback as useCallback110 } from "react";
|
|
33261
33439
|
import { Modal as Modal4, Stack as Stack199, Text as Text170, TextInput as TextInput10, Button as Button55, Group as Group110, Radio as Radio6, Checkbox as Checkbox13, Alert as Alert55, Paper as Paper19, Loader as Loader55, Badge as Badge44, ActionIcon as ActionIcon39, Divider as Divider30, NumberInput as NumberInput3 } from "@mantine/core";
|
|
33262
33440
|
import { IconSearch as IconSearch8, IconUser as IconUser15, IconRobot as IconRobot5, IconX as IconX15, IconShieldPlus as IconShieldPlus4 } from "@tabler/icons-react";
|
|
33263
33441
|
var GrantPermissionModal = ({ opened, onClose, flowUri, blocks, targetBlockId, searchUsers, getOracles, onGrant }) => {
|
|
@@ -33278,7 +33456,7 @@ var GrantPermissionModal = ({ opened, onClose, flowUri, blocks, targetBlockId, s
|
|
|
33278
33456
|
const [pin, setPin] = useState137("");
|
|
33279
33457
|
const [loading, setLoading] = useState137(false);
|
|
33280
33458
|
const [error, setError] = useState137(null);
|
|
33281
|
-
const handleSearch =
|
|
33459
|
+
const handleSearch = useCallback110(async () => {
|
|
33282
33460
|
if (searchQuery.length < 2) return;
|
|
33283
33461
|
setSearching(true);
|
|
33284
33462
|
try {
|
|
@@ -33535,4 +33713,4 @@ export {
|
|
|
33535
33713
|
getExtraSlashMenuItems,
|
|
33536
33714
|
useCreateIxoEditor
|
|
33537
33715
|
};
|
|
33538
|
-
//# sourceMappingURL=chunk-
|
|
33716
|
+
//# sourceMappingURL=chunk-LQP2DPYM.mjs.map
|