@ixo/editor 2.24.0 → 2.26.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.
- package/dist/{chunk-HEO27URH.mjs → chunk-CZDCWQZR.mjs} +809 -413
- package/dist/chunk-CZDCWQZR.mjs.map +1 -0
- package/dist/{graphql-client-NK7QyJtH.d.ts → graphql-client-sR5y0LAb.d.ts} +58 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +1 -1
- package/dist/mantine/index.d.ts +2 -2
- package/dist/mantine/index.mjs +1 -1
- package/package.json +2 -1
- package/dist/chunk-HEO27URH.mjs.map +0 -1
|
@@ -1198,6 +1198,26 @@ var CONDITIONABLE_PROPERTIES = {
|
|
|
1198
1198
|
type: "string",
|
|
1199
1199
|
description: "Description of the governance group block"
|
|
1200
1200
|
}
|
|
1201
|
+
],
|
|
1202
|
+
flowLink: [
|
|
1203
|
+
{
|
|
1204
|
+
name: "title",
|
|
1205
|
+
displayName: "Title",
|
|
1206
|
+
type: "string",
|
|
1207
|
+
description: "Block title"
|
|
1208
|
+
},
|
|
1209
|
+
{
|
|
1210
|
+
name: "description",
|
|
1211
|
+
displayName: "Description",
|
|
1212
|
+
type: "string",
|
|
1213
|
+
description: "Block description"
|
|
1214
|
+
},
|
|
1215
|
+
{
|
|
1216
|
+
name: "linksCount",
|
|
1217
|
+
displayName: "Links count",
|
|
1218
|
+
type: "number",
|
|
1219
|
+
description: "Number of configured links"
|
|
1220
|
+
}
|
|
1201
1221
|
]
|
|
1202
1222
|
};
|
|
1203
1223
|
function getConditionableProperties(blockType, block) {
|
|
@@ -1362,7 +1382,16 @@ function PropertyValueInput({ property, value, onChange, disabled = false }) {
|
|
|
1362
1382
|
import { Card } from "@mantine/core";
|
|
1363
1383
|
import React8 from "react";
|
|
1364
1384
|
function BaseContainer({ children, onClick, style }) {
|
|
1365
|
-
return /* @__PURE__ */ React8.createElement(
|
|
1385
|
+
return /* @__PURE__ */ React8.createElement(
|
|
1386
|
+
Card,
|
|
1387
|
+
{
|
|
1388
|
+
withBorder: true,
|
|
1389
|
+
radius: "lg",
|
|
1390
|
+
style: { width: "100%", borderColor: "var(--mantine-color-neutralColor-6)", cursor: onClick ? "pointer" : "default", position: "relative", ...style },
|
|
1391
|
+
onClick
|
|
1392
|
+
},
|
|
1393
|
+
children
|
|
1394
|
+
);
|
|
1366
1395
|
}
|
|
1367
1396
|
|
|
1368
1397
|
// src/mantine/blocks/components/ConditionBuilder/ConditionRow.tsx
|
|
@@ -2016,7 +2045,8 @@ import {
|
|
|
2016
2045
|
IconMail,
|
|
2017
2046
|
IconFeather,
|
|
2018
2047
|
IconDotsCircleHorizontal,
|
|
2019
|
-
IconUsers as IconUsers2
|
|
2048
|
+
IconUsers as IconUsers2,
|
|
2049
|
+
IconExternalLink
|
|
2020
2050
|
} from "@tabler/icons-react";
|
|
2021
2051
|
var ICON_MAP = {
|
|
2022
2052
|
"square-check": IconSquareCheck,
|
|
@@ -2031,7 +2061,8 @@ var ICON_MAP = {
|
|
|
2031
2061
|
mail: IconMail,
|
|
2032
2062
|
feather: IconFeather,
|
|
2033
2063
|
"dots-circle": IconDotsCircleHorizontal,
|
|
2034
|
-
users: IconUsers2
|
|
2064
|
+
users: IconUsers2,
|
|
2065
|
+
"external-link": IconExternalLink
|
|
2035
2066
|
};
|
|
2036
2067
|
var getIcon = (fallback = "square-check", key, color = "white", size = 26, stroke = 1.5) => {
|
|
2037
2068
|
const validKey = key in ICON_MAP ? key : fallback;
|
|
@@ -12315,7 +12346,7 @@ var ClaimTemplateView = ({ editor, block }) => {
|
|
|
12315
12346
|
|
|
12316
12347
|
// src/mantine/blocks/claim/flow/FlowView.tsx
|
|
12317
12348
|
import React147, { useMemo as useMemo41 } from "react";
|
|
12318
|
-
import { Stack as Stack109, Text as Text83, Loader as Loader17, Center as Center9, Alert as Alert19, Title as
|
|
12349
|
+
import { Stack as Stack109, Text as Text83, Loader as Loader17, Center as Center9, Alert as Alert19, Title as Title6, Flex as Flex27, ActionIcon as ActionIcon24 } from "@mantine/core";
|
|
12319
12350
|
|
|
12320
12351
|
// src/mantine/hooks/useCurrentUser.ts
|
|
12321
12352
|
import { useState as useState44, useEffect as useEffect27, useRef as useRef4 } from "react";
|
|
@@ -12490,7 +12521,7 @@ import { Stack as Stack99, Text as Text73, ActionIcon as ActionIcon19, Tooltip a
|
|
|
12490
12521
|
|
|
12491
12522
|
// src/mantine/blocks/claim/flow/ClaimsListSheet.tsx
|
|
12492
12523
|
import React134, { useState as useState47, useEffect as useEffect30, useCallback as useCallback27, useMemo as useMemo29 } from "react";
|
|
12493
|
-
import {
|
|
12524
|
+
import { Loader as Loader10, Stack as Stack98, Text as Text72, ActionIcon as ActionIcon18, Alert as Alert15, Box as Box31, Group as Group43 } from "@mantine/core";
|
|
12494
12525
|
import { IconArrowLeft as IconArrowLeft3, IconAlertCircle } from "@tabler/icons-react";
|
|
12495
12526
|
import { Survey, SurveyModel } from "@ixo/surveys";
|
|
12496
12527
|
|
|
@@ -12802,83 +12833,70 @@ var ClaimsListSheet = ({ collectionId, collectionName, deedId, adminAddress, use
|
|
|
12802
12833
|
return "yellow";
|
|
12803
12834
|
}
|
|
12804
12835
|
};
|
|
12805
|
-
return /* @__PURE__ */ React134.createElement(
|
|
12806
|
-
|
|
12836
|
+
return /* @__PURE__ */ React134.createElement(BaseRightPanelLayout, { title: viewMode === "list" ? collectionName : "Submit New Claim", onClose: closePanel }, /* @__PURE__ */ React134.createElement(
|
|
12837
|
+
Box31,
|
|
12807
12838
|
{
|
|
12839
|
+
pos: "relative",
|
|
12808
12840
|
style: {
|
|
12809
|
-
height: "
|
|
12810
|
-
|
|
12811
|
-
|
|
12812
|
-
|
|
12841
|
+
height: "calc(100vh - 120px)",
|
|
12842
|
+
overflow: "hidden",
|
|
12843
|
+
marginLeft: -40,
|
|
12844
|
+
marginRight: -40,
|
|
12845
|
+
paddingLeft: 40,
|
|
12846
|
+
paddingRight: 40
|
|
12813
12847
|
}
|
|
12814
12848
|
},
|
|
12815
12849
|
/* @__PURE__ */ React134.createElement(
|
|
12816
|
-
|
|
12850
|
+
Box31,
|
|
12817
12851
|
{
|
|
12852
|
+
pos: "absolute",
|
|
12853
|
+
top: 0,
|
|
12854
|
+
left: 0,
|
|
12855
|
+
right: 0,
|
|
12856
|
+
bottom: 0,
|
|
12857
|
+
px: 40,
|
|
12818
12858
|
style: {
|
|
12819
12859
|
display: "flex",
|
|
12820
|
-
|
|
12821
|
-
|
|
12822
|
-
|
|
12860
|
+
flexDirection: "column",
|
|
12861
|
+
overflow: "auto",
|
|
12862
|
+
transform: viewMode === "list" ? "translateX(0)" : "translateX(-100%)",
|
|
12863
|
+
opacity: viewMode === "list" ? 1 : 0,
|
|
12864
|
+
transition: "transform 300ms ease-out, opacity 300ms ease-out",
|
|
12865
|
+
pointerEvents: viewMode === "list" ? "auto" : "none"
|
|
12823
12866
|
}
|
|
12824
12867
|
},
|
|
12825
|
-
/* @__PURE__ */ React134.createElement("
|
|
12826
|
-
|
|
12868
|
+
/* @__PURE__ */ React134.createElement(Stack98, { gap: "md", h: "100%" }, /* @__PURE__ */ React134.createElement(BaseButton, { onClick: handleNewClaim, fullWidth: true }, "New Claim"), loading ? /* @__PURE__ */ React134.createElement(Stack98, { align: "center", justify: "center", style: { flex: 1 } }, /* @__PURE__ */ React134.createElement(Loader10, { size: "lg" }), /* @__PURE__ */ React134.createElement(Text72, { size: "sm", c: "dimmed" }, "Loading claims...")) : error ? /* @__PURE__ */ React134.createElement(Alert15, { color: "red", title: "Failed to load claims", icon: /* @__PURE__ */ React134.createElement(IconAlertCircle, { size: 18 }) }, /* @__PURE__ */ React134.createElement(Text72, { size: "sm" }, error)) : claims.length === 0 ? /* @__PURE__ */ React134.createElement(Stack98, { align: "center", justify: "center", style: { flex: 1 } }, /* @__PURE__ */ React134.createElement(Text72, { size: "sm", c: "dimmed", ta: "center" }, 'No claims found. Click "New Claim" to submit your first claim.')) : /* @__PURE__ */ React134.createElement(Stack98, { gap: "xs" }, claims.map((claim) => {
|
|
12869
|
+
const status = getClaimStatus(claim.paymentsStatus);
|
|
12870
|
+
return /* @__PURE__ */ React134.createElement(ListItemContainer, { key: claim.claimId, isChecked: false }, /* @__PURE__ */ React134.createElement(Stack98, { gap: 4, style: { flex: 1 } }, /* @__PURE__ */ React134.createElement(Text72, { size: "sm", fw: 500 }, "Claim #", claim.claimId), /* @__PURE__ */ React134.createElement(Text72, { size: "xs", c: "dimmed" }, "Submitted: ", formatDate(claim.submissionDate))), /* @__PURE__ */ React134.createElement(Text72, { size: "xs", fw: 500, c: getStatusColor2(status) }, status.toUpperCase()));
|
|
12871
|
+
})))
|
|
12827
12872
|
),
|
|
12828
12873
|
/* @__PURE__ */ React134.createElement(
|
|
12829
|
-
|
|
12874
|
+
Box31,
|
|
12830
12875
|
{
|
|
12876
|
+
pos: "absolute",
|
|
12877
|
+
top: 0,
|
|
12878
|
+
left: 0,
|
|
12879
|
+
right: 0,
|
|
12880
|
+
bottom: 0,
|
|
12881
|
+
px: 40,
|
|
12831
12882
|
style: {
|
|
12832
|
-
|
|
12833
|
-
|
|
12834
|
-
|
|
12883
|
+
display: "flex",
|
|
12884
|
+
flexDirection: "column",
|
|
12885
|
+
overflow: "auto",
|
|
12886
|
+
transform: viewMode === "survey" ? "translateX(0)" : "translateX(100%)",
|
|
12887
|
+
opacity: viewMode === "survey" ? 1 : 0,
|
|
12888
|
+
transition: "transform 300ms ease-out, opacity 300ms ease-out",
|
|
12889
|
+
pointerEvents: viewMode === "survey" ? "auto" : "none",
|
|
12890
|
+
scrollbarWidth: "none",
|
|
12891
|
+
msOverflowStyle: "none",
|
|
12892
|
+
"&::-webkit-scrollbar": {
|
|
12893
|
+
display: "none"
|
|
12894
|
+
}
|
|
12835
12895
|
}
|
|
12836
12896
|
},
|
|
12837
|
-
/* @__PURE__ */ React134.createElement(
|
|
12838
|
-
"div",
|
|
12839
|
-
{
|
|
12840
|
-
style: {
|
|
12841
|
-
position: "absolute",
|
|
12842
|
-
top: 0,
|
|
12843
|
-
left: 0,
|
|
12844
|
-
right: 0,
|
|
12845
|
-
bottom: 0,
|
|
12846
|
-
display: "flex",
|
|
12847
|
-
flexDirection: "column",
|
|
12848
|
-
overflow: "auto",
|
|
12849
|
-
transform: viewMode === "list" ? "translateX(0)" : "translateX(-100%)",
|
|
12850
|
-
opacity: viewMode === "list" ? 1 : 0,
|
|
12851
|
-
transition: "transform 0.3s ease-out, opacity 0.3s ease-out",
|
|
12852
|
-
pointerEvents: viewMode === "list" ? "auto" : "none"
|
|
12853
|
-
}
|
|
12854
|
-
},
|
|
12855
|
-
/* @__PURE__ */ React134.createElement(Stack98, { gap: "md", style: { flex: 1 } }, /* @__PURE__ */ React134.createElement(Button28, { onClick: handleNewClaim, fullWidth: true }, "New Claim"), loading ? /* @__PURE__ */ React134.createElement(Stack98, { align: "center", justify: "center", style: { flex: 1 } }, /* @__PURE__ */ React134.createElement(Loader10, { size: "lg" }), /* @__PURE__ */ React134.createElement(Text72, { size: "sm", c: "dimmed" }, "Loading claims...")) : error ? /* @__PURE__ */ React134.createElement(Alert15, { color: "red", title: "Failed to load claims", icon: /* @__PURE__ */ React134.createElement(IconAlertCircle, { size: 18 }) }, /* @__PURE__ */ React134.createElement(Text72, { size: "sm" }, error)) : claims.length === 0 ? /* @__PURE__ */ React134.createElement(Stack98, { align: "center", justify: "center", style: { flex: 1 } }, /* @__PURE__ */ React134.createElement(Text72, { size: "sm", c: "dimmed", ta: "center" }, 'No claims found. Click "New Claim" to submit your first claim.')) : /* @__PURE__ */ React134.createElement(Stack98, { gap: "xs" }, claims.map((claim) => {
|
|
12856
|
-
const status = getClaimStatus(claim.paymentsStatus);
|
|
12857
|
-
return /* @__PURE__ */ React134.createElement(ListItemContainer, { key: claim.claimId, isChecked: false }, /* @__PURE__ */ React134.createElement(Stack98, { gap: 4, style: { flex: 1 } }, /* @__PURE__ */ React134.createElement(Text72, { size: "sm", fw: 500 }, "Claim #", claim.claimId), /* @__PURE__ */ React134.createElement(Text72, { size: "xs", c: "dimmed" }, "Submitted: ", formatDate(claim.submissionDate))), /* @__PURE__ */ React134.createElement(Text72, { size: "xs", fw: 500, c: getStatusColor2(status) }, status.toUpperCase()));
|
|
12858
|
-
})))
|
|
12859
|
-
),
|
|
12860
|
-
/* @__PURE__ */ React134.createElement(
|
|
12861
|
-
"div",
|
|
12862
|
-
{
|
|
12863
|
-
style: {
|
|
12864
|
-
position: "absolute",
|
|
12865
|
-
top: 0,
|
|
12866
|
-
left: 0,
|
|
12867
|
-
right: 0,
|
|
12868
|
-
bottom: 0,
|
|
12869
|
-
display: "flex",
|
|
12870
|
-
flexDirection: "column",
|
|
12871
|
-
overflow: "auto",
|
|
12872
|
-
transform: viewMode === "survey" ? "translateX(0)" : "translateX(100%)",
|
|
12873
|
-
opacity: viewMode === "survey" ? 1 : 0,
|
|
12874
|
-
transition: "transform 0.3s ease-out, opacity 0.3s ease-out",
|
|
12875
|
-
pointerEvents: viewMode === "survey" ? "auto" : "none"
|
|
12876
|
-
}
|
|
12877
|
-
},
|
|
12878
|
-
/* @__PURE__ */ React134.createElement("div", null, surveyLoading && /* @__PURE__ */ React134.createElement(Stack98, { align: "center", justify: "center", style: { height: "100%" } }, /* @__PURE__ */ React134.createElement(Loader10, { size: "lg" }), /* @__PURE__ */ React134.createElement(Text72, { size: "sm", c: "dimmed" }, "Loading survey template...")), surveyError && /* @__PURE__ */ React134.createElement(Stack98, { align: "center", justify: "center", style: { height: "100%", padding: "1rem" } }, /* @__PURE__ */ React134.createElement(Text72, { size: "sm", c: "red" }, surveyError)), !surveyLoading && !surveyError && surveyModel && /* @__PURE__ */ React134.createElement(Survey, { model: surveyModel }))
|
|
12879
|
-
)
|
|
12897
|
+
/* @__PURE__ */ React134.createElement(Stack98, { gap: "md" }, /* @__PURE__ */ React134.createElement(Group43, { gap: "xs" }, /* @__PURE__ */ React134.createElement(ActionIcon18, { variant: "subtle", onClick: handleBackToList, size: "md" }, /* @__PURE__ */ React134.createElement(IconArrowLeft3, { size: 20 })), /* @__PURE__ */ React134.createElement(Text72, { size: "sm", c: "dimmed" }, "Back to claims list")), /* @__PURE__ */ React134.createElement(Box31, null, surveyLoading && /* @__PURE__ */ React134.createElement(Stack98, { align: "center", justify: "center", mih: 200 }, /* @__PURE__ */ React134.createElement(Loader10, { size: "lg" }), /* @__PURE__ */ React134.createElement(Text72, { size: "sm", c: "dimmed" }, "Loading survey template...")), surveyError && /* @__PURE__ */ React134.createElement(Alert15, { color: "red", icon: /* @__PURE__ */ React134.createElement(IconAlertCircle, { size: 18 }) }, /* @__PURE__ */ React134.createElement(Text72, { size: "sm" }, surveyError)), !surveyLoading && !surveyError && surveyModel && /* @__PURE__ */ React134.createElement(Survey, { model: surveyModel })))
|
|
12880
12898
|
)
|
|
12881
|
-
);
|
|
12899
|
+
));
|
|
12882
12900
|
};
|
|
12883
12901
|
|
|
12884
12902
|
// src/mantine/blocks/claim/flow/ClaimCollectionItem.tsx
|
|
@@ -12937,7 +12955,7 @@ var ClaimCollectionItem = ({ collection, deedId, adminAddress, userRole, onRefre
|
|
|
12937
12955
|
|
|
12938
12956
|
// src/mantine/blocks/bid/flow/components/BidCollectionItem.tsx
|
|
12939
12957
|
import React142, { useMemo as useMemo37 } from "react";
|
|
12940
|
-
import { Stack as Stack104, Text as Text78, Button as
|
|
12958
|
+
import { Stack as Stack104, Text as Text78, Button as Button29, Menu as Menu3, Badge as Badge18, ActionIcon as ActionIcon21, Box as Box32, Tooltip as Tooltip13, Loader as Loader14 } from "@mantine/core";
|
|
12941
12959
|
import { IconChevronDown as IconChevronDown8, IconArrowRight as IconArrowRight3, IconLock } from "@tabler/icons-react";
|
|
12942
12960
|
|
|
12943
12961
|
// src/mantine/hooks/useBlockAuthorization.ts
|
|
@@ -13159,12 +13177,12 @@ import { IconAlertCircle as IconAlertCircle3 } from "@tabler/icons-react";
|
|
|
13159
13177
|
|
|
13160
13178
|
// src/mantine/blocks/bid/flow/components/BidItem.tsx
|
|
13161
13179
|
import React138, { useMemo as useMemo36 } from "react";
|
|
13162
|
-
import { Stack as Stack102, Text as Text76, Badge as Badge17, Group as
|
|
13180
|
+
import { Stack as Stack102, Text as Text76, Badge as Badge17, Group as Group45, ActionIcon as ActionIcon20 } from "@mantine/core";
|
|
13163
13181
|
import { IconArrowRight as IconArrowRight2 } from "@tabler/icons-react";
|
|
13164
13182
|
|
|
13165
13183
|
// src/mantine/blocks/bid/flow/components/BidViewPanel.tsx
|
|
13166
13184
|
import React137, { useMemo as useMemo35, useState as useState52 } from "react";
|
|
13167
|
-
import { Loader as Loader12, Stack as Stack101, Text as Text75, Button as
|
|
13185
|
+
import { Loader as Loader12, Stack as Stack101, Text as Text75, Button as Button28, Group as Group44, Modal as Modal2, Alert as Alert16 } from "@mantine/core";
|
|
13168
13186
|
import { Survey as Survey3 } from "@ixo/surveys";
|
|
13169
13187
|
import { IconCheck as IconCheck3, IconX as IconX8, IconAlertCircle as IconAlertCircle2 } from "@tabler/icons-react";
|
|
13170
13188
|
|
|
@@ -13386,7 +13404,7 @@ var BidViewPanel = ({ bid, deedId, adminAddress, onRefresh, execution }) => {
|
|
|
13386
13404
|
setRejectModalOpen(false);
|
|
13387
13405
|
}
|
|
13388
13406
|
};
|
|
13389
|
-
return /* @__PURE__ */ React137.createElement(BaseRightPanelLayout, { onClose: closePanel, title: `${getRoleLabel(bid.role)} Bid`, isTemplate: false }, !loading && !error && /* @__PURE__ */ React137.createElement(Stack101, { gap: "md", mb: "md" }, actionError && /* @__PURE__ */ React137.createElement(Alert16, { color: "red", icon: /* @__PURE__ */ React137.createElement(IconAlertCircle2, { size: 16 }), onClose: () => setActionError(null), withCloseButton: true }, actionError), /* @__PURE__ */ React137.createElement(
|
|
13407
|
+
return /* @__PURE__ */ React137.createElement(BaseRightPanelLayout, { onClose: closePanel, title: `${getRoleLabel(bid.role)} Bid`, isTemplate: false }, !loading && !error && /* @__PURE__ */ React137.createElement(Stack101, { gap: "md", mb: "md" }, actionError && /* @__PURE__ */ React137.createElement(Alert16, { color: "red", icon: /* @__PURE__ */ React137.createElement(IconAlertCircle2, { size: 16 }), onClose: () => setActionError(null), withCloseButton: true }, actionError), /* @__PURE__ */ React137.createElement(Group44, { justify: "flex-end" }, /* @__PURE__ */ React137.createElement(Button28, { variant: "outline", color: "red", leftSection: /* @__PURE__ */ React137.createElement(IconX8, { size: 16 }), onClick: handleRejectClick, loading: actionLoading, disabled: actionLoading }, "Reject"), /* @__PURE__ */ React137.createElement(Button28, { variant: "filled", color: "green", leftSection: /* @__PURE__ */ React137.createElement(IconCheck3, { size: 16 }), onClick: approveBid, loading: actionLoading, disabled: actionLoading }, "Approve"))), /* @__PURE__ */ React137.createElement("div", { style: surveyContainerStyle }, loading && /* @__PURE__ */ React137.createElement(Stack101, { align: "center", justify: "center", style: { height: "100%" } }, /* @__PURE__ */ React137.createElement(Loader12, { size: "lg" }), /* @__PURE__ */ React137.createElement(Text75, { size: "sm", c: "dimmed" }, "Loading bid details...")), error && /* @__PURE__ */ React137.createElement(Stack101, { align: "center", justify: "center", style: { height: "100%", padding: "1rem" } }, /* @__PURE__ */ React137.createElement(Text75, { size: "sm", c: "red" }, error)), !loading && !error && surveyModel && /* @__PURE__ */ React137.createElement(Survey3, { model: surveyModel })), /* @__PURE__ */ React137.createElement(Modal2, { opened: rejectModalOpen, onClose: () => setRejectModalOpen(false), title: "Reject Bid", centered: true }, /* @__PURE__ */ React137.createElement(Stack101, { gap: "md" }, /* @__PURE__ */ React137.createElement(Text75, { size: "sm" }, "Please provide a reason for rejecting this bid:"), /* @__PURE__ */ React137.createElement(BaseTextArea, { placeholder: "Enter rejection reason...", value: rejectReason, onChange: (e) => setRejectReason(e.currentTarget.value), minRows: 3 }), /* @__PURE__ */ React137.createElement(Group44, { justify: "flex-end" }, /* @__PURE__ */ React137.createElement(Button28, { variant: "outline", onClick: () => setRejectModalOpen(false), disabled: actionLoading }, "Cancel"), /* @__PURE__ */ React137.createElement(Button28, { color: "red", onClick: handleRejectConfirm, loading: actionLoading, disabled: !rejectReason.trim() }, "Reject Bid")))));
|
|
13390
13408
|
};
|
|
13391
13409
|
|
|
13392
13410
|
// src/mantine/hooks/useUserProfile.ts
|
|
@@ -13426,7 +13444,7 @@ var BidItem = ({ bid, deedId, adminAddress, onRefresh, execution }) => {
|
|
|
13426
13444
|
const displayDate = bid.created || "";
|
|
13427
13445
|
const displayStatus = bid.status;
|
|
13428
13446
|
const displayReason = bid.reason;
|
|
13429
|
-
return /* @__PURE__ */ React138.createElement(ListItemContainer, { isChecked: false }, /* @__PURE__ */ React138.createElement(Stack102, { gap: 4, style: { flex: 1 } }, /* @__PURE__ */ React138.createElement(
|
|
13447
|
+
return /* @__PURE__ */ React138.createElement(ListItemContainer, { isChecked: false }, /* @__PURE__ */ React138.createElement(Stack102, { gap: 4, style: { flex: 1 } }, /* @__PURE__ */ React138.createElement(Group45, { gap: "xs" }, /* @__PURE__ */ React138.createElement(Text76, { size: "xs", fw: 500 }, loadingProfile ? "Loading..." : displayName), userProfile?.verified && /* @__PURE__ */ React138.createElement(Text76, { size: "xs", c: "blue", fw: 600, title: "Verified user" }, "\u2713"), /* @__PURE__ */ React138.createElement(Badge17, { size: "xs", variant: "light", color: getRoleColor(bid.role) }, getRoleLabel(bid.role))), /* @__PURE__ */ React138.createElement(Text76, { size: "xs", c: "dimmed" }, "Submitted: ", formatDate(displayDate)), displayStatus === "rejected" && displayReason && /* @__PURE__ */ React138.createElement(Text76, { size: "xs", c: "red" }, "Reason: ", displayReason)), /* @__PURE__ */ React138.createElement(Group45, { gap: "xs" }, displayStatus && /* @__PURE__ */ React138.createElement(Badge17, { size: "sm", color: getStatusColor(displayStatus) }, getStatusLabel(displayStatus)), /* @__PURE__ */ React138.createElement(ActionIcon20, { variant: "subtle", size: "lg", onClick: openBidPanel }, /* @__PURE__ */ React138.createElement(IconArrowRight2, { size: 20 }))));
|
|
13430
13448
|
};
|
|
13431
13449
|
|
|
13432
13450
|
// src/mantine/blocks/bid/flow/hooks/useBids.ts
|
|
@@ -13591,9 +13609,9 @@ var BidCollectionItem = ({ collection, deedId, adminAddress, userRole, onRefresh
|
|
|
13591
13609
|
return /* @__PURE__ */ React142.createElement(Badge18, { size: "sm", color: getRoleColor(userRole) }, getRoleLabel(userRole));
|
|
13592
13610
|
} else {
|
|
13593
13611
|
if (!isAuthorized) {
|
|
13594
|
-
return /* @__PURE__ */ React142.createElement(Tooltip13, { label: reason || "You are not authorized to apply", withArrow: true }, /* @__PURE__ */ React142.createElement(
|
|
13612
|
+
return /* @__PURE__ */ React142.createElement(Tooltip13, { label: reason || "You are not authorized to apply", withArrow: true }, /* @__PURE__ */ React142.createElement(Button29, { size: "xs", variant: "light", disabled: true, leftSection: /* @__PURE__ */ React142.createElement(IconLock, { size: 14 }) }, "Apply"));
|
|
13595
13613
|
}
|
|
13596
|
-
return /* @__PURE__ */ React142.createElement(Menu3, { shadow: "md", width: 200 }, /* @__PURE__ */ React142.createElement(Menu3.Target, null, /* @__PURE__ */ React142.createElement(
|
|
13614
|
+
return /* @__PURE__ */ React142.createElement(Menu3, { shadow: "md", width: 200 }, /* @__PURE__ */ React142.createElement(Menu3.Target, null, /* @__PURE__ */ React142.createElement(Button29, { size: "xs", variant: "light", rightSection: /* @__PURE__ */ React142.createElement(IconChevronDown8, { size: 14 }) }, "Apply")), /* @__PURE__ */ React142.createElement(Menu3.Dropdown, null, /* @__PURE__ */ React142.createElement(Menu3.Label, null, "Select Role"), /* @__PURE__ */ React142.createElement(Menu3.Item, { onClick: openServiceAgent }, "Service Agent"), /* @__PURE__ */ React142.createElement(Menu3.Item, { onClick: openEvaluationAgent }, "Evaluation Agent")));
|
|
13597
13615
|
}
|
|
13598
13616
|
};
|
|
13599
13617
|
const getCollectionIcon = () => {
|
|
@@ -13602,7 +13620,7 @@ var BidCollectionItem = ({ collection, deedId, adminAddress, userRole, onRefresh
|
|
|
13602
13620
|
}
|
|
13603
13621
|
return /* @__PURE__ */ React142.createElement(UserPlus_default, null);
|
|
13604
13622
|
};
|
|
13605
|
-
return /* @__PURE__ */ React142.createElement(ListItemContainer, { isChecked: false }, /* @__PURE__ */ React142.createElement(
|
|
13623
|
+
return /* @__PURE__ */ React142.createElement(ListItemContainer, { isChecked: false }, /* @__PURE__ */ React142.createElement(Box32, { mr: "md", style: { display: "flex", alignItems: "center" } }, getCollectionIcon()), /* @__PURE__ */ React142.createElement(Stack104, { gap: 4, style: { flex: 1 } }, /* @__PURE__ */ React142.createElement(Text78, { size: "sm", fw: 500 }, getCollectionName(collection)), collection.description && /* @__PURE__ */ React142.createElement(Text78, { size: "xs", c: "dimmed" }, collection.description)), renderActionButton());
|
|
13606
13624
|
};
|
|
13607
13625
|
|
|
13608
13626
|
// src/mantine/blocks/evaluator/flow/EvaluationCollectionItem.tsx
|
|
@@ -13611,7 +13629,7 @@ import { Stack as Stack107, Text as Text81, ActionIcon as ActionIcon23, Tooltip
|
|
|
13611
13629
|
|
|
13612
13630
|
// src/mantine/blocks/evaluator/flow/ClaimsList.tsx
|
|
13613
13631
|
import React144, { useState as useState55, useEffect as useEffect37, useCallback as useCallback32, useMemo as useMemo39 } from "react";
|
|
13614
|
-
import { Paper as Paper14, CloseButton as
|
|
13632
|
+
import { Paper as Paper14, CloseButton as CloseButton5, Title as Title5, Loader as Loader15, Stack as Stack106, Text as Text80, ActionIcon as ActionIcon22, Alert as Alert18, Badge as Badge20, Group as Group47, Button as Button30, Divider as Divider12, Tabs as Tabs3, ScrollArea as ScrollArea6 } from "@mantine/core";
|
|
13615
13633
|
import { IconAlertCircle as IconAlertCircle4, IconArrowRight as IconArrowRight4, IconRefresh as IconRefresh3, IconArrowLeft as IconArrowLeft4, IconFileText as IconFileText3, IconRobot as IconRobot3, IconChecklist as IconChecklist3 } from "@tabler/icons-react";
|
|
13616
13634
|
import { Survey as Survey4, SurveyModel as SurveyModel4 } from "@ixo/surveys";
|
|
13617
13635
|
|
|
@@ -13775,7 +13793,7 @@ var surveyTheme2 = {
|
|
|
13775
13793
|
|
|
13776
13794
|
// src/mantine/blocks/evaluator/flow/RubricEvaluationResults.tsx
|
|
13777
13795
|
import React143, { useMemo as useMemo38 } from "react";
|
|
13778
|
-
import { Paper as Paper13, Stack as Stack105, Text as Text79, Badge as Badge19, Group as
|
|
13796
|
+
import { Paper as Paper13, Stack as Stack105, Text as Text79, Badge as Badge19, Group as Group46, Progress as Progress3, Accordion as Accordion3, ThemeIcon as ThemeIcon2, Timeline, Box as Box33, Tooltip as Tooltip14, Divider as Divider11, Card as Card16, RingProgress, Center as Center7 } from "@mantine/core";
|
|
13779
13797
|
import { IconCheck as IconCheck4, IconX as IconX9, IconAlertTriangle as IconAlertTriangle2, IconClock, IconBrain, IconUser as IconUser4, IconArrowUp as IconArrowUp4, IconCalculator, IconCloud, IconChecklist as IconChecklist2, IconInfoCircle as IconInfoCircle3 } from "@tabler/icons-react";
|
|
13780
13798
|
var getOutcomeConfig = (outcome) => {
|
|
13781
13799
|
switch (outcome) {
|
|
@@ -13851,10 +13869,10 @@ var RubricEvaluationResults = ({ evaluation }) => {
|
|
|
13851
13869
|
return { passed, failed, total, passRate };
|
|
13852
13870
|
}, [trace]);
|
|
13853
13871
|
if (error) {
|
|
13854
|
-
return /* @__PURE__ */ React143.createElement(Paper13, { p: "md", radius: "md", style: { backgroundColor: IXO_PALETTE.dangerBrighter } }, /* @__PURE__ */ React143.createElement(
|
|
13872
|
+
return /* @__PURE__ */ React143.createElement(Paper13, { p: "md", radius: "md", style: { backgroundColor: IXO_PALETTE.dangerBrighter } }, /* @__PURE__ */ React143.createElement(Group46, { gap: "sm" }, /* @__PURE__ */ React143.createElement(ThemeIcon2, { color: "red", size: "lg", radius: "xl" }, /* @__PURE__ */ React143.createElement(IconX9, { size: 18 })), /* @__PURE__ */ React143.createElement(Stack105, { gap: 2 }, /* @__PURE__ */ React143.createElement(Text79, { fw: 600, c: "red.9" }, "Evaluation Failed"), /* @__PURE__ */ React143.createElement(Text79, { size: "sm", c: "red.7" }, error))));
|
|
13855
13873
|
}
|
|
13856
13874
|
if (!trace) {
|
|
13857
|
-
return /* @__PURE__ */ React143.createElement(Paper13, { p: "md", radius: "md", style: { backgroundColor: IXO_PALETTE.NeutralDark300 } }, /* @__PURE__ */ React143.createElement(
|
|
13875
|
+
return /* @__PURE__ */ React143.createElement(Paper13, { p: "md", radius: "md", style: { backgroundColor: IXO_PALETTE.NeutralDark300 } }, /* @__PURE__ */ React143.createElement(Group46, { gap: "sm" }, /* @__PURE__ */ React143.createElement(ThemeIcon2, { color: "gray", size: "lg", radius: "xl" }, /* @__PURE__ */ React143.createElement(IconInfoCircle3, { size: 18 })), /* @__PURE__ */ React143.createElement(Text79, { size: "sm", c: "dimmed" }, "No evaluation data available")));
|
|
13858
13876
|
}
|
|
13859
13877
|
const outcomeConfig = getOutcomeConfig(trace.result.outcome);
|
|
13860
13878
|
const OutcomeIcon = outcomeConfig.icon;
|
|
@@ -13868,7 +13886,7 @@ var RubricEvaluationResults = ({ evaluation }) => {
|
|
|
13868
13886
|
border: `1px solid ${outcomeConfig.color}40`
|
|
13869
13887
|
}
|
|
13870
13888
|
},
|
|
13871
|
-
/* @__PURE__ */ React143.createElement(
|
|
13889
|
+
/* @__PURE__ */ React143.createElement(Group46, { justify: "space-between", align: "flex-start" }, /* @__PURE__ */ React143.createElement(Group46, { gap: "md" }, /* @__PURE__ */ React143.createElement(
|
|
13872
13890
|
ThemeIcon2,
|
|
13873
13891
|
{
|
|
13874
13892
|
size: 56,
|
|
@@ -13879,7 +13897,7 @@ var RubricEvaluationResults = ({ evaluation }) => {
|
|
|
13879
13897
|
}
|
|
13880
13898
|
},
|
|
13881
13899
|
/* @__PURE__ */ React143.createElement(OutcomeIcon, { size: 28 })
|
|
13882
|
-
), /* @__PURE__ */ React143.createElement(Stack105, { gap: 4 }, /* @__PURE__ */ React143.createElement(
|
|
13900
|
+
), /* @__PURE__ */ React143.createElement(Stack105, { gap: 4 }, /* @__PURE__ */ React143.createElement(Group46, { gap: "xs" }, /* @__PURE__ */ React143.createElement(Text79, { size: "xl", fw: 700, style: { color: outcomeConfig.color } }, outcomeConfig.label), trace.result.outcome === "escalated" && trace.result.escalatedTo && /* @__PURE__ */ React143.createElement(
|
|
13883
13901
|
Badge19,
|
|
13884
13902
|
{
|
|
13885
13903
|
size: "sm",
|
|
@@ -13906,7 +13924,7 @@ var RubricEvaluationResults = ({ evaluation }) => {
|
|
|
13906
13924
|
label: /* @__PURE__ */ React143.createElement(Center7, null, /* @__PURE__ */ React143.createElement(Text79, { size: "sm", fw: 700 }, stats.passRate, "%"))
|
|
13907
13925
|
}
|
|
13908
13926
|
))
|
|
13909
|
-
), stats && /* @__PURE__ */ React143.createElement(
|
|
13927
|
+
), stats && /* @__PURE__ */ React143.createElement(Group46, { grow: true }, /* @__PURE__ */ React143.createElement(Card16, { padding: "sm", radius: "md", style: { backgroundColor: IXO_PALETTE.NeutralDark200 } }, /* @__PURE__ */ React143.createElement(Stack105, { gap: 4, align: "center" }, /* @__PURE__ */ React143.createElement(Text79, { size: "xs", c: "dimmed", tt: "uppercase", fw: 500 }, "Passed"), /* @__PURE__ */ React143.createElement(Text79, { size: "xl", fw: 700, c: "green" }, stats.passed))), /* @__PURE__ */ React143.createElement(Card16, { padding: "sm", radius: "md", style: { backgroundColor: IXO_PALETTE.NeutralDark200 } }, /* @__PURE__ */ React143.createElement(Stack105, { gap: 4, align: "center" }, /* @__PURE__ */ React143.createElement(Text79, { size: "xs", c: "dimmed", tt: "uppercase", fw: 500 }, "Failed"), /* @__PURE__ */ React143.createElement(Text79, { size: "xl", fw: 700, c: "red" }, stats.failed))), /* @__PURE__ */ React143.createElement(Card16, { padding: "sm", radius: "md", style: { backgroundColor: IXO_PALETTE.NeutralDark200 } }, /* @__PURE__ */ React143.createElement(Stack105, { gap: 4, align: "center" }, /* @__PURE__ */ React143.createElement(Text79, { size: "xs", c: "dimmed", tt: "uppercase", fw: 500 }, "Duration"), /* @__PURE__ */ React143.createElement(Text79, { size: "xl", fw: 700, c: IXO_PALETTE.accentActive }, formatDuration(trace.result.totalDuration))))), /* @__PURE__ */ React143.createElement(Card16, { padding: "sm", radius: "md", style: { backgroundColor: IXO_PALETTE.NeutralDark200 } }, /* @__PURE__ */ React143.createElement(Group46, { justify: "space-between", wrap: "wrap", gap: "xs" }, /* @__PURE__ */ React143.createElement(Group46, { gap: "xs" }, trace.actor && /* @__PURE__ */ React143.createElement(
|
|
13910
13928
|
Badge19,
|
|
13911
13929
|
{
|
|
13912
13930
|
variant: "light",
|
|
@@ -13918,7 +13936,7 @@ var RubricEvaluationResults = ({ evaluation }) => {
|
|
|
13918
13936
|
leftSection: trace.actor.type === "ai" ? /* @__PURE__ */ React143.createElement(IconBrain, { size: 12, style: { display: "block" } }) : /* @__PURE__ */ React143.createElement(IconUser4, { size: 12, style: { display: "block" } })
|
|
13919
13937
|
},
|
|
13920
13938
|
trace.actor.type === "ai" ? "AI Evaluated" : "Human Evaluated"
|
|
13921
|
-
), trace.rubricName && /* @__PURE__ */ React143.createElement(Badge19, { variant: "outline", color: "gray" }, trace.rubricName), /* @__PURE__ */ React143.createElement(Badge19, { variant: "outline", color: "gray" }, "v", trace.rubricVersion)), /* @__PURE__ */ React143.createElement(
|
|
13939
|
+
), trace.rubricName && /* @__PURE__ */ React143.createElement(Badge19, { variant: "outline", color: "gray" }, trace.rubricName), /* @__PURE__ */ React143.createElement(Badge19, { variant: "outline", color: "gray" }, "v", trace.rubricVersion)), /* @__PURE__ */ React143.createElement(Group46, { gap: "xs" }, /* @__PURE__ */ React143.createElement(Tooltip14, { label: "Execution ID" }, /* @__PURE__ */ React143.createElement(Text79, { size: "xs", c: "dimmed", style: { fontFamily: "monospace" } }, trace.result.executionId.slice(0, 12), "..."))))), /* @__PURE__ */ React143.createElement(Divider11, { my: "xs" }), /* @__PURE__ */ React143.createElement(
|
|
13922
13940
|
Accordion3,
|
|
13923
13941
|
{
|
|
13924
13942
|
variant: "separated",
|
|
@@ -13937,7 +13955,7 @@ var RubricEvaluationResults = ({ evaluation }) => {
|
|
|
13937
13955
|
}
|
|
13938
13956
|
}
|
|
13939
13957
|
},
|
|
13940
|
-
/* @__PURE__ */ React143.createElement(Accordion3.Item, { value: "steps" }, /* @__PURE__ */ React143.createElement(Accordion3.Control, null, /* @__PURE__ */ React143.createElement(
|
|
13958
|
+
/* @__PURE__ */ React143.createElement(Accordion3.Item, { value: "steps" }, /* @__PURE__ */ React143.createElement(Accordion3.Control, null, /* @__PURE__ */ React143.createElement(Group46, { gap: "sm" }, /* @__PURE__ */ React143.createElement(IconChecklist2, { size: 18 }), /* @__PURE__ */ React143.createElement(Text79, { fw: 600 }, "Evaluation Steps"), /* @__PURE__ */ React143.createElement(Badge19, { size: "sm", variant: "light" }, trace.result.steps.length, " steps"))), /* @__PURE__ */ React143.createElement(Accordion3.Panel, null, /* @__PURE__ */ React143.createElement(
|
|
13941
13959
|
Timeline,
|
|
13942
13960
|
{
|
|
13943
13961
|
active: trace.result.steps.length,
|
|
@@ -13968,7 +13986,7 @@ var RubricEvaluationResults = ({ evaluation }) => {
|
|
|
13968
13986
|
},
|
|
13969
13987
|
step.success ? /* @__PURE__ */ React143.createElement(IconCheck4, { size: 16 }) : /* @__PURE__ */ React143.createElement(IconX9, { size: 16 })
|
|
13970
13988
|
),
|
|
13971
|
-
title: /* @__PURE__ */ React143.createElement(
|
|
13989
|
+
title: /* @__PURE__ */ React143.createElement(Group46, { gap: "xs", justify: "space-between", wrap: "nowrap" }, /* @__PURE__ */ React143.createElement(Group46, { gap: "xs" }, /* @__PURE__ */ React143.createElement(Text79, { size: "sm", fw: 600 }, step.stepId || `Step ${index + 1}`), /* @__PURE__ */ React143.createElement(
|
|
13972
13990
|
Badge19,
|
|
13973
13991
|
{
|
|
13974
13992
|
size: "xs",
|
|
@@ -13984,7 +14002,7 @@ var RubricEvaluationResults = ({ evaluation }) => {
|
|
|
13984
14002
|
leftSection: /* @__PURE__ */ React143.createElement(KindIcon, { size: 10, style: { display: "block" } })
|
|
13985
14003
|
},
|
|
13986
14004
|
kindConfig.label
|
|
13987
|
-
)), /* @__PURE__ */ React143.createElement(
|
|
14005
|
+
)), /* @__PURE__ */ React143.createElement(Group46, { gap: "xs" }, step.duration !== void 0 && /* @__PURE__ */ React143.createElement(
|
|
13988
14006
|
Badge19,
|
|
13989
14007
|
{
|
|
13990
14008
|
size: "xs",
|
|
@@ -13999,7 +14017,7 @@ var RubricEvaluationResults = ({ evaluation }) => {
|
|
|
13999
14017
|
formatDuration(step.duration)
|
|
14000
14018
|
)))
|
|
14001
14019
|
},
|
|
14002
|
-
/* @__PURE__ */ React143.createElement(
|
|
14020
|
+
/* @__PURE__ */ React143.createElement(Box33, { mt: "xs" }, step.message && /* @__PURE__ */ React143.createElement(Text79, { size: "sm", c: "dimmed", mb: "xs" }, step.message), step.error && /* @__PURE__ */ React143.createElement(
|
|
14003
14021
|
Paper13,
|
|
14004
14022
|
{
|
|
14005
14023
|
p: "xs",
|
|
@@ -14042,7 +14060,7 @@ var RubricEvaluationResults = ({ evaluation }) => {
|
|
|
14042
14060
|
);
|
|
14043
14061
|
})
|
|
14044
14062
|
)))
|
|
14045
|
-
), stats && /* @__PURE__ */ React143.createElement(
|
|
14063
|
+
), stats && /* @__PURE__ */ React143.createElement(Box33, null, /* @__PURE__ */ React143.createElement(Group46, { justify: "space-between", mb: 4 }, /* @__PURE__ */ React143.createElement(Text79, { size: "xs", c: "dimmed" }, "Overall Progress"), /* @__PURE__ */ React143.createElement(Text79, { size: "xs", c: "dimmed" }, stats.passed, "/", stats.total, " checks passed")), /* @__PURE__ */ React143.createElement(Progress3.Root, { size: "lg", radius: "xl" }, /* @__PURE__ */ React143.createElement(Progress3.Section, { value: stats.passed / stats.total * 100, color: "green" }, /* @__PURE__ */ React143.createElement(Progress3.Label, null, stats.passed, " passed")), /* @__PURE__ */ React143.createElement(Progress3.Section, { value: stats.failed / stats.total * 100, color: "red" }, /* @__PURE__ */ React143.createElement(Progress3.Label, null, stats.failed, " failed")))));
|
|
14046
14064
|
};
|
|
14047
14065
|
|
|
14048
14066
|
// src/mantine/blocks/evaluator/flow/ClaimsList.tsx
|
|
@@ -14403,8 +14421,8 @@ var ClaimsList = ({ collectionId, collectionName, deedId, adminAddress, onEvalua
|
|
|
14403
14421
|
marginBottom: "1rem"
|
|
14404
14422
|
}
|
|
14405
14423
|
},
|
|
14406
|
-
/* @__PURE__ */ React144.createElement("div", { style: { display: "flex", alignItems: "center", gap: "0.5rem" } }, viewMode === "survey" && /* @__PURE__ */ React144.createElement(ActionIcon22, { variant: "subtle", onClick: handleBackToList }, /* @__PURE__ */ React144.createElement(IconArrowLeft4, { size: 20 })), /* @__PURE__ */ React144.createElement(
|
|
14407
|
-
/* @__PURE__ */ React144.createElement(
|
|
14424
|
+
/* @__PURE__ */ React144.createElement("div", { style: { display: "flex", alignItems: "center", gap: "0.5rem" } }, viewMode === "survey" && /* @__PURE__ */ React144.createElement(ActionIcon22, { variant: "subtle", onClick: handleBackToList }, /* @__PURE__ */ React144.createElement(IconArrowLeft4, { size: 20 })), /* @__PURE__ */ React144.createElement(Title5, { order: 3 }, viewMode === "list" ? `${collectionName} - Claims` : `Evaluate Claim #${selectedClaim?.claimId}`), viewMode === "list" && !loading && claims.length > 0 && /* @__PURE__ */ React144.createElement(Badge20, { size: "lg", variant: "light" }, claims.length)),
|
|
14425
|
+
/* @__PURE__ */ React144.createElement(Group47, { gap: "xs" }, viewMode === "list" && /* @__PURE__ */ React144.createElement(ActionIcon22, { variant: "subtle", onClick: fetchClaims, loading, title: "Refresh claims" }, /* @__PURE__ */ React144.createElement(IconRefresh3, { size: 18 })), /* @__PURE__ */ React144.createElement(CloseButton5, { onClick: closePanel }))
|
|
14408
14426
|
),
|
|
14409
14427
|
/* @__PURE__ */ React144.createElement(
|
|
14410
14428
|
"div",
|
|
@@ -14461,7 +14479,7 @@ var ClaimsList = ({ collectionId, collectionName, deedId, adminAddress, onEvalua
|
|
|
14461
14479
|
rightSection: evaluationLoading ? /* @__PURE__ */ React144.createElement(Loader15, { size: 12 }) : evaluationResult?.trace?.result?.outcome ? /* @__PURE__ */ React144.createElement(Badge20, { size: "xs", color: evaluationResult.trace.result.outcome === "pass" ? "green" : evaluationResult.trace.result.outcome === "fail" ? "red" : "orange" }, evaluationResult.trace.result.outcome) : null
|
|
14462
14480
|
},
|
|
14463
14481
|
"AI Evaluation"
|
|
14464
|
-
)), /* @__PURE__ */ React144.createElement(Tabs3.Panel, { value: "submission", style: { flex: 1, overflow: "hidden", display: activeTab === "submission" ? "flex" : "none" } }, /* @__PURE__ */ React144.createElement(ScrollArea6, { style: { flex: 1 } }, /* @__PURE__ */ React144.createElement("div", { style: surveyContainerStyle }, surveyModel && /* @__PURE__ */ React144.createElement(Survey4, { model: surveyModel })))), /* @__PURE__ */ React144.createElement(Tabs3.Panel, { value: "evaluation", style: { flex: 1, overflow: "hidden", display: activeTab === "evaluation" ? "flex" : "none" } }, /* @__PURE__ */ React144.createElement(ScrollArea6, { style: { flex: 1, padding: "1rem" } }, evaluationLoading ? /* @__PURE__ */ React144.createElement(Stack106, { align: "center", justify: "center", py: "xl" }, /* @__PURE__ */ React144.createElement(Loader15, { size: "lg" }), /* @__PURE__ */ React144.createElement(Text80, { size: "sm", c: "dimmed" }, "Running AI evaluation...")) : evaluationResult ? /* @__PURE__ */ React144.createElement(RubricEvaluationResults, { evaluation: evaluationResult }) : rubricData === null && !evaluationLoading ? /* @__PURE__ */ React144.createElement(Alert18, { color: "yellow", title: "No Rubric Available", icon: /* @__PURE__ */ React144.createElement(IconChecklist3, { size: 18 }) }, /* @__PURE__ */ React144.createElement(Text80, { size: "sm" }, "No evaluation rubric is configured for this deed. Manual evaluation is required.")) : /* @__PURE__ */ React144.createElement(Alert18, { color: "gray", title: "Evaluation Not Available", icon: /* @__PURE__ */ React144.createElement(IconAlertCircle4, { size: 18 }) }, /* @__PURE__ */ React144.createElement(Text80, { size: "sm" }, "Evaluation data is not available for this claim."))))), /* @__PURE__ */ React144.createElement(Divider12, null), /* @__PURE__ */ React144.createElement(Stack106, { gap: "sm" }, /* @__PURE__ */ React144.createElement(
|
|
14482
|
+
)), /* @__PURE__ */ React144.createElement(Tabs3.Panel, { value: "submission", style: { flex: 1, overflow: "hidden", display: activeTab === "submission" ? "flex" : "none" } }, /* @__PURE__ */ React144.createElement(ScrollArea6, { style: { flex: 1 } }, /* @__PURE__ */ React144.createElement("div", { style: surveyContainerStyle }, surveyModel && /* @__PURE__ */ React144.createElement(Survey4, { model: surveyModel })))), /* @__PURE__ */ React144.createElement(Tabs3.Panel, { value: "evaluation", style: { flex: 1, overflow: "hidden", display: activeTab === "evaluation" ? "flex" : "none" } }, /* @__PURE__ */ React144.createElement(ScrollArea6, { style: { flex: 1, padding: "1rem" } }, evaluationLoading ? /* @__PURE__ */ React144.createElement(Stack106, { align: "center", justify: "center", py: "xl" }, /* @__PURE__ */ React144.createElement(Loader15, { size: "lg" }), /* @__PURE__ */ React144.createElement(Text80, { size: "sm", c: "dimmed" }, "Running AI evaluation...")) : evaluationResult ? /* @__PURE__ */ React144.createElement(RubricEvaluationResults, { evaluation: evaluationResult }) : rubricData === null && !evaluationLoading ? /* @__PURE__ */ React144.createElement(Alert18, { color: "yellow", title: "No Rubric Available", icon: /* @__PURE__ */ React144.createElement(IconChecklist3, { size: 18 }) }, /* @__PURE__ */ React144.createElement(Text80, { size: "sm" }, "No evaluation rubric is configured for this deed. Manual evaluation is required.")) : /* @__PURE__ */ React144.createElement(Alert18, { color: "gray", title: "Evaluation Not Available", icon: /* @__PURE__ */ React144.createElement(IconAlertCircle4, { size: 18 }) }, /* @__PURE__ */ React144.createElement(Text80, { size: "sm" }, "Evaluation data is not available for this claim."))))), /* @__PURE__ */ React144.createElement(Divider12, null), /* @__PURE__ */ React144.createElement(Stack106, { gap: "sm" }, /* @__PURE__ */ React144.createElement(Group47, { grow: true }, /* @__PURE__ */ React144.createElement(Button30, { color: "green", onClick: handleApprove, loading: evaluating, disabled: evaluating || isClaimAlreadyEvaluated }, "Approve Claim"), /* @__PURE__ */ React144.createElement(Button30, { color: "red", variant: "outline", onClick: handleReject, loading: evaluating, disabled: evaluating || isClaimAlreadyEvaluated }, "Reject Claim")), evaluationResult?.trace?.result?.outcome === "escalated" && /* @__PURE__ */ React144.createElement(Alert18, { color: "orange", title: "Escalation Required", icon: /* @__PURE__ */ React144.createElement(IconAlertCircle4, { size: 18 }) }, /* @__PURE__ */ React144.createElement(Text80, { size: "sm" }, "This claim has been flagged for human review. Please carefully review all details before making a decision.", evaluationResult.trace.result.escalatedTo && /* @__PURE__ */ React144.createElement(Text80, { size: "xs", c: "dimmed", mt: "xs" }, "Escalated to: ", evaluationResult.trace.result.escalatedTo)))))
|
|
14465
14483
|
)
|
|
14466
14484
|
)
|
|
14467
14485
|
);
|
|
@@ -14529,7 +14547,7 @@ var ClaimListItem = ({ claim, onViewClaim }) => {
|
|
|
14529
14547
|
tabIndex: 0,
|
|
14530
14548
|
style: { cursor: "pointer" }
|
|
14531
14549
|
},
|
|
14532
|
-
/* @__PURE__ */ React144.createElement(ListItemContainer, { isChecked: false }, /* @__PURE__ */ React144.createElement(Stack106, { gap: 4, style: { flex: 1 } }, /* @__PURE__ */ React144.createElement(Text80, { size: "sm", fw: 500 }, "Claim #", claim.claimId), /* @__PURE__ */ React144.createElement(Text80, { size: "xs", c: "dimmed" }, "Submitted: ", formatDate(claim.submissionDate || claim.submittedAt)), claim.agentDid && /* @__PURE__ */ React144.createElement(
|
|
14550
|
+
/* @__PURE__ */ React144.createElement(ListItemContainer, { isChecked: false }, /* @__PURE__ */ React144.createElement(Stack106, { gap: 4, style: { flex: 1 } }, /* @__PURE__ */ React144.createElement(Text80, { size: "sm", fw: 500 }, "Claim #", claim.claimId), /* @__PURE__ */ React144.createElement(Text80, { size: "xs", c: "dimmed" }, "Submitted: ", formatDate(claim.submissionDate || claim.submittedAt)), claim.agentDid && /* @__PURE__ */ React144.createElement(Group47, { gap: 4 }, /* @__PURE__ */ React144.createElement(Text80, { size: "xs", c: "dimmed" }, "Agent: ", loadingProfile ? "Loading..." : displayName), userProfile?.verified && /* @__PURE__ */ React144.createElement(Text80, { size: "xs", c: "blue", fw: 600, title: "Verified user" }, "\u2713"))), /* @__PURE__ */ React144.createElement(Stack106, { gap: 4, align: "flex-end" }, /* @__PURE__ */ React144.createElement(Badge20, { color: claimStatus.color, size: "sm" }, claimStatus.status), /* @__PURE__ */ React144.createElement(ActionIcon22, { variant: "subtle", size: "sm" }, /* @__PURE__ */ React144.createElement(IconArrowRight4, { size: 16 }))))
|
|
14533
14551
|
);
|
|
14534
14552
|
};
|
|
14535
14553
|
|
|
@@ -14698,7 +14716,7 @@ var ClaimFlowView = ({ editor, block }) => {
|
|
|
14698
14716
|
if (selectedCollectionIds.length === 0) {
|
|
14699
14717
|
return /* @__PURE__ */ React147.createElement(Center9, { py: "xl" }, /* @__PURE__ */ React147.createElement(Text83, { size: "sm", c: "dimmed" }, "No claim collections selected"));
|
|
14700
14718
|
}
|
|
14701
|
-
return /* @__PURE__ */ React147.createElement(Stack109, { w: "100%" }, /* @__PURE__ */ React147.createElement(Flex27, { px: 5, align: "center", justify: "space-between" }, /* @__PURE__ */ React147.createElement(
|
|
14719
|
+
return /* @__PURE__ */ React147.createElement(Stack109, { w: "100%" }, /* @__PURE__ */ React147.createElement(Flex27, { px: 5, align: "center", justify: "space-between" }, /* @__PURE__ */ React147.createElement(Title6, { order: 4 }, "Submit Claims"), /* @__PURE__ */ React147.createElement(Flex27, { gap: "xs" }, /* @__PURE__ */ React147.createElement(AssignmentDisplay, { block, onClick: openAssignment }), /* @__PURE__ */ React147.createElement(ActionIcon24, { variant: "subtle", size: "sm", onClick: refetch, loading }, /* @__PURE__ */ React147.createElement(IconRefresh4, { size: 18 })), editable && /* @__PURE__ */ React147.createElement(ActionIcon24, { variant: "subtle", size: "sm", onClick: open }, /* @__PURE__ */ React147.createElement(IconSettings3, { size: 18 })))), loading ? /* @__PURE__ */ React147.createElement(Center9, { py: "xl" }, /* @__PURE__ */ React147.createElement(Loader17, { size: "md" })) : error ? /* @__PURE__ */ React147.createElement(Alert19, { color: "red", title: "Failed to load collections", icon: /* @__PURE__ */ React147.createElement(IconAlertCircle5, { size: 18 }) }, /* @__PURE__ */ React147.createElement(Text83, { size: "sm" }, error)) : /* @__PURE__ */ React147.createElement(
|
|
14702
14720
|
ClaimCollectionsList,
|
|
14703
14721
|
{
|
|
14704
14722
|
listType: "claims",
|
|
@@ -14770,7 +14788,7 @@ import React155 from "react";
|
|
|
14770
14788
|
|
|
14771
14789
|
// src/mantine/blocks/bid/template/TemplateView.tsx
|
|
14772
14790
|
import React153, { useMemo as useMemo43 } from "react";
|
|
14773
|
-
import { Group as
|
|
14791
|
+
import { Group as Group48, Stack as Stack110, Text as Text84 } from "@mantine/core";
|
|
14774
14792
|
|
|
14775
14793
|
// src/mantine/blocks/bid/template/TemplateConfig.tsx
|
|
14776
14794
|
import React152, { useCallback as useCallback34 } from "react";
|
|
@@ -14933,12 +14951,12 @@ var BidTemplateView = ({ editor, block }) => {
|
|
|
14933
14951
|
);
|
|
14934
14952
|
const { open: openAssignment } = usePanel(assignmentPanelId, assignmentPanelContent);
|
|
14935
14953
|
const didDisplay = block.props.did ? `${block.props.did.substring(0, 15)}...${block.props.did.substring(block.props.did.length - 10)}` : "No DID configured";
|
|
14936
|
-
return /* @__PURE__ */ React153.createElement(BaseContainer, { onClick: open }, /* @__PURE__ */ React153.createElement(
|
|
14954
|
+
return /* @__PURE__ */ React153.createElement(BaseContainer, { onClick: open }, /* @__PURE__ */ React153.createElement(Group48, { wrap: "nowrap", justify: "space-between", align: "center" }, /* @__PURE__ */ React153.createElement(Group48, { wrap: "nowrap", align: "center" }, getIcon("dollar-sign", "dollar-sign"), /* @__PURE__ */ React153.createElement(Stack110, { gap: "xs", style: { flex: 1 } }, /* @__PURE__ */ React153.createElement(Text84, { fw: 500, size: "sm", contentEditable: false }, "Bid Block"), /* @__PURE__ */ React153.createElement(Text84, { size: "xs", c: "dimmed", contentEditable: false }, block.props.did ? didDisplay : "Configure bid settings"))), /* @__PURE__ */ React153.createElement(AssignmentDisplay, { block, onClick: openAssignment })));
|
|
14937
14955
|
};
|
|
14938
14956
|
|
|
14939
14957
|
// src/mantine/blocks/bid/flow/components/FlowView.tsx
|
|
14940
14958
|
import React154, { useMemo as useMemo44 } from "react";
|
|
14941
|
-
import { Stack as Stack111, Text as Text85, Loader as Loader18, Center as Center10, Alert as Alert20, Title as
|
|
14959
|
+
import { Stack as Stack111, Text as Text85, Loader as Loader18, Center as Center10, Alert as Alert20, Title as Title7, Flex as Flex28, ActionIcon as ActionIcon25 } from "@mantine/core";
|
|
14942
14960
|
import { IconSettings as IconSettings4, IconRefresh as IconRefresh5, IconAlertCircle as IconAlertCircle6 } from "@tabler/icons-react";
|
|
14943
14961
|
var BID_FLOW_PANEL_ID = "bid-flow-panel";
|
|
14944
14962
|
var BID_ASSIGNMENT_PANEL_ID2 = "bid-assignment-panel";
|
|
@@ -15006,7 +15024,7 @@ var BidFlowView = ({ editor, block }) => {
|
|
|
15006
15024
|
if (selectedCollectionIds.length === 0) {
|
|
15007
15025
|
return /* @__PURE__ */ React154.createElement(Center10, { py: "xl" }, /* @__PURE__ */ React154.createElement(Text85, { size: "sm", c: "dimmed" }, "No claim collections selected"));
|
|
15008
15026
|
}
|
|
15009
|
-
return /* @__PURE__ */ React154.createElement(Stack111, { w: "100%" }, /* @__PURE__ */ React154.createElement(Flex28, { px: 5, align: "center", justify: "space-between" }, /* @__PURE__ */ React154.createElement(
|
|
15027
|
+
return /* @__PURE__ */ React154.createElement(Stack111, { w: "100%" }, /* @__PURE__ */ React154.createElement(Flex28, { px: 5, align: "center", justify: "space-between" }, /* @__PURE__ */ React154.createElement(Title7, { order: 4 }, "Bid Application"), /* @__PURE__ */ React154.createElement(Flex28, { gap: "xs" }, /* @__PURE__ */ React154.createElement(AssignmentDisplay, { block, onClick: openAssignment }), /* @__PURE__ */ React154.createElement(ActionIcon25, { variant: "subtle", size: "sm", onClick: refetch, loading }, /* @__PURE__ */ React154.createElement(IconRefresh5, { size: 18 })), editable && /* @__PURE__ */ React154.createElement(ActionIcon25, { variant: "subtle", size: "sm", onClick: open }, /* @__PURE__ */ React154.createElement(IconSettings4, { size: 18 })))), loading ? /* @__PURE__ */ React154.createElement(Center10, { py: "xl" }, /* @__PURE__ */ React154.createElement(Loader18, { size: "md" })) : error ? /* @__PURE__ */ React154.createElement(Alert20, { color: "red", title: "Failed to load collections", icon: /* @__PURE__ */ React154.createElement(IconAlertCircle6, { size: 18 }) }, /* @__PURE__ */ React154.createElement(Text85, { size: "sm" }, error)) : /* @__PURE__ */ React154.createElement(
|
|
15010
15028
|
ClaimCollectionsList,
|
|
15011
15029
|
{
|
|
15012
15030
|
listType: "bids",
|
|
@@ -15068,7 +15086,7 @@ import React161 from "react";
|
|
|
15068
15086
|
|
|
15069
15087
|
// src/mantine/blocks/evaluator/template/TemplateView.tsx
|
|
15070
15088
|
import React159, { useMemo as useMemo46 } from "react";
|
|
15071
|
-
import { Group as
|
|
15089
|
+
import { Group as Group49, Stack as Stack112, Text as Text86 } from "@mantine/core";
|
|
15072
15090
|
|
|
15073
15091
|
// src/mantine/blocks/evaluator/template/TemplateConfig.tsx
|
|
15074
15092
|
import React158, { useCallback as useCallback36 } from "react";
|
|
@@ -15217,12 +15235,12 @@ var EvaluatorTemplateView = ({ editor, block }) => {
|
|
|
15217
15235
|
[editor, block, closePanel]
|
|
15218
15236
|
);
|
|
15219
15237
|
const { open: openAssignment } = usePanel(assignmentPanelId, assignmentPanelContent);
|
|
15220
|
-
return /* @__PURE__ */ React159.createElement(BaseContainer, { onClick: open }, /* @__PURE__ */ React159.createElement(
|
|
15238
|
+
return /* @__PURE__ */ React159.createElement(BaseContainer, { onClick: open }, /* @__PURE__ */ React159.createElement(Group49, { wrap: "nowrap", justify: "space-between", align: "center" }, /* @__PURE__ */ React159.createElement(Group49, { wrap: "nowrap", align: "center" }, getIcon("checklist", block.props.icon), /* @__PURE__ */ React159.createElement(Stack112, { gap: "xs", style: { flex: 1 } }, /* @__PURE__ */ React159.createElement(Text86, { fw: 500, size: "sm", contentEditable: false }, block.props.title || "Evaluator Title"), /* @__PURE__ */ React159.createElement(Text86, { size: "xs", c: "dimmed", contentEditable: false }, block.props.description || "Evaluator description"))), /* @__PURE__ */ React159.createElement(AssignmentDisplay, { block, onClick: openAssignment })));
|
|
15221
15239
|
};
|
|
15222
15240
|
|
|
15223
15241
|
// src/mantine/blocks/evaluator/flow/FlowView.tsx
|
|
15224
15242
|
import React160, { useMemo as useMemo47 } from "react";
|
|
15225
|
-
import { Stack as Stack113, Text as Text87, Loader as Loader19, Center as Center11, Alert as Alert21, Title as
|
|
15243
|
+
import { Stack as Stack113, Text as Text87, Loader as Loader19, Center as Center11, Alert as Alert21, Title as Title8, Flex as Flex29, ActionIcon as ActionIcon26 } from "@mantine/core";
|
|
15226
15244
|
import { IconSettings as IconSettings5, IconRefresh as IconRefresh6, IconAlertCircle as IconAlertCircle7 } from "@tabler/icons-react";
|
|
15227
15245
|
var EVALUATOR_ASSIGNMENT_PANEL_ID2 = "evaluator-assignment-panel";
|
|
15228
15246
|
var EvaluatorFlowView = ({ editor, block }) => {
|
|
@@ -15252,7 +15270,7 @@ var EvaluatorFlowView = ({ editor, block }) => {
|
|
|
15252
15270
|
if (selectedCollectionIds.length === 0) {
|
|
15253
15271
|
return /* @__PURE__ */ React160.createElement(Center11, { py: "xl" }, /* @__PURE__ */ React160.createElement(Text87, { size: "sm", c: "dimmed" }, "No claim collections selected"));
|
|
15254
15272
|
}
|
|
15255
|
-
return /* @__PURE__ */ React160.createElement(Stack113, { w: "100%" }, /* @__PURE__ */ React160.createElement(Flex29, { px: 5, align: "center", justify: "space-between" }, /* @__PURE__ */ React160.createElement(
|
|
15273
|
+
return /* @__PURE__ */ React160.createElement(Stack113, { w: "100%" }, /* @__PURE__ */ React160.createElement(Flex29, { px: 5, align: "center", justify: "space-between" }, /* @__PURE__ */ React160.createElement(Title8, { order: 4 }, "Evaluate Claims"), /* @__PURE__ */ React160.createElement(Flex29, { gap: "xs" }, /* @__PURE__ */ React160.createElement(AssignmentDisplay, { block, onClick: openAssignment }), /* @__PURE__ */ React160.createElement(ActionIcon26, { variant: "subtle", size: "sm", onClick: refetch, loading }, /* @__PURE__ */ React160.createElement(IconRefresh6, { size: 18 })), editable && /* @__PURE__ */ React160.createElement(ActionIcon26, { variant: "subtle", size: "sm" }, /* @__PURE__ */ React160.createElement(IconSettings5, { size: 18 })))), loading ? /* @__PURE__ */ React160.createElement(Center11, { py: "xl" }, /* @__PURE__ */ React160.createElement(Loader19, { size: "md" })) : error ? /* @__PURE__ */ React160.createElement(Alert21, { color: "red", title: "Failed to load collections", icon: /* @__PURE__ */ React160.createElement(IconAlertCircle7, { size: 18 }) }, /* @__PURE__ */ React160.createElement(Text87, { size: "sm" }, error)) : /* @__PURE__ */ React160.createElement(ClaimCollectionsList, { listType: "evaluations", collections, deedId: did, adminAddress, userAddress, onRefresh: refetch }));
|
|
15256
15274
|
};
|
|
15257
15275
|
|
|
15258
15276
|
// src/mantine/blocks/evaluator/EvaluatorBlock.tsx
|
|
@@ -15301,7 +15319,7 @@ import { createReactBlockSpec as createReactBlockSpec12 } from "@blocknote/react
|
|
|
15301
15319
|
|
|
15302
15320
|
// src/mantine/blocks/visualization/VisualizationBlock.tsx
|
|
15303
15321
|
import React163, { useMemo as useMemo48, useCallback as useCallback37, useRef as useRef8, useState as useState58, useEffect as useEffect41 } from "react";
|
|
15304
|
-
import { Box as
|
|
15322
|
+
import { Box as Box34, Stack as Stack114, Text as Text88, Paper as Paper15, Group as Group50 } from "@mantine/core";
|
|
15305
15323
|
function VisualizationBlock({ block, editor }) {
|
|
15306
15324
|
const { visualizationRenderer } = useBlocknoteContext();
|
|
15307
15325
|
const { vizType, config, title, preferences } = block.props;
|
|
@@ -15356,10 +15374,10 @@ function VisualizationBlock({ block, editor }) {
|
|
|
15356
15374
|
if (visualizationRenderer) {
|
|
15357
15375
|
const renderedContent = visualizationRenderer(vizType, parsedConfig, parsedPreferences, handlePreferencesChange);
|
|
15358
15376
|
if (renderedContent) {
|
|
15359
|
-
return /* @__PURE__ */ React163.createElement(
|
|
15377
|
+
return /* @__PURE__ */ React163.createElement(Box34, { ref: containerRef, w: "100%", miw: 200, mih: 200 }, hasValidDimensions ? renderedContent : null);
|
|
15360
15378
|
}
|
|
15361
15379
|
}
|
|
15362
|
-
return /* @__PURE__ */ React163.createElement(Paper15, { p: "lg", withBorder: true, radius: "lg", w: "100%" }, /* @__PURE__ */ React163.createElement(Stack114, { gap: "sm" }, /* @__PURE__ */ React163.createElement(Text88, { fz: "18", ta: "center" }, "Visualization Block"), /* @__PURE__ */ React163.createElement(Paper15, { p: "sm", bg: "var(--mantine-color-dark-6)", radius: "sm" }, /* @__PURE__ */ React163.createElement(Stack114, { gap: "xs" }, !title && /* @__PURE__ */ React163.createElement(
|
|
15380
|
+
return /* @__PURE__ */ React163.createElement(Paper15, { p: "lg", withBorder: true, radius: "lg", w: "100%" }, /* @__PURE__ */ React163.createElement(Stack114, { gap: "sm" }, /* @__PURE__ */ React163.createElement(Text88, { fz: "18", ta: "center" }, "Visualization Block"), /* @__PURE__ */ React163.createElement(Paper15, { p: "sm", bg: "var(--mantine-color-dark-6)", radius: "sm" }, /* @__PURE__ */ React163.createElement(Stack114, { gap: "xs" }, !title && /* @__PURE__ */ React163.createElement(Group50, { gap: "xs" }, /* @__PURE__ */ React163.createElement(Text88, { size: "xs", c: "dimmed", fw: 500 }, "Title:"), /* @__PURE__ */ React163.createElement(Text88, { size: "xs", c: "white" }, title || "No title")), /* @__PURE__ */ React163.createElement(Group50, { gap: "xs" }, /* @__PURE__ */ React163.createElement(Text88, { size: "xs", c: "dimmed", fw: 500 }, "Type:"), /* @__PURE__ */ React163.createElement(Text88, { size: "xs", c: "white" }, vizType)))), /* @__PURE__ */ React163.createElement(Text88, { c: "dimmed", fz: "sm", fs: "italic", ta: "center" }, "View in a compatible client to see the full visualization.")));
|
|
15363
15381
|
}
|
|
15364
15382
|
|
|
15365
15383
|
// src/mantine/blocks/visualization/VisualizationBlockSpec.tsx
|
|
@@ -15400,7 +15418,7 @@ import React170 from "react";
|
|
|
15400
15418
|
|
|
15401
15419
|
// src/mantine/blocks/domainCreator/template/TemplateView.tsx
|
|
15402
15420
|
import React167, { useMemo as useMemo49 } from "react";
|
|
15403
|
-
import { Badge as Badge21, Group as
|
|
15421
|
+
import { Badge as Badge21, Group as Group51, Stack as Stack115, Text as Text89 } from "@mantine/core";
|
|
15404
15422
|
|
|
15405
15423
|
// src/mantine/blocks/domainCreator/template/TemplateConfig.tsx
|
|
15406
15424
|
import React166, { useCallback as useCallback38 } from "react";
|
|
@@ -15505,17 +15523,17 @@ var DomainCreatorTemplateView = ({ editor, block }) => {
|
|
|
15505
15523
|
const panelId = `${DOMAIN_CREATOR_TEMPLATE_PANEL_ID}-${block.id}`;
|
|
15506
15524
|
const panelContent = useMemo49(() => /* @__PURE__ */ React167.createElement(TemplateConfig9, { editor, block }), [editor, block]);
|
|
15507
15525
|
const { open } = usePanel(panelId, panelContent);
|
|
15508
|
-
return /* @__PURE__ */ React167.createElement(BaseContainer, { onClick: open }, /* @__PURE__ */ React167.createElement(Badge21, { size: "xs", variant: "light", color: "gray", style: { position: "absolute", top: 8, right: 8 } }, "Template"), /* @__PURE__ */ React167.createElement(
|
|
15526
|
+
return /* @__PURE__ */ React167.createElement(BaseContainer, { onClick: open }, /* @__PURE__ */ React167.createElement(Badge21, { size: "xs", variant: "light", color: "gray", style: { position: "absolute", top: 8, right: 8 } }, "Template"), /* @__PURE__ */ React167.createElement(Group51, { wrap: "nowrap", justify: "space-between", align: "center" }, /* @__PURE__ */ React167.createElement(Group51, { wrap: "nowrap", align: "center" }, getIcon("file-text", block.props.icon), /* @__PURE__ */ React167.createElement(Stack115, { gap: "xs", style: { flex: 1 } }, /* @__PURE__ */ React167.createElement(Text89, { fw: 500, size: "sm", contentEditable: false }, block.props.title || "Domain Creator"), /* @__PURE__ */ React167.createElement(Text89, { size: "xs", c: "dimmed", contentEditable: false }, block.props.description || "Configure the domain creation flow")))));
|
|
15509
15527
|
};
|
|
15510
15528
|
|
|
15511
15529
|
// src/mantine/blocks/domainCreator/flow/FlowView.tsx
|
|
15512
15530
|
import React169, { useCallback as useCallback40, useMemo as useMemo51, useState as useState61 } from "react";
|
|
15513
|
-
import { ActionIcon as ActionIcon27, Badge as Badge22, Group as
|
|
15531
|
+
import { ActionIcon as ActionIcon27, Badge as Badge22, Group as Group53, Stack as Stack117, Text as Text91, Tooltip as Tooltip16 } from "@mantine/core";
|
|
15514
15532
|
import { IconChevronRight as IconChevronRight6, IconCheck as IconCheck6, IconAlertCircle as IconAlertCircle9 } from "@tabler/icons-react";
|
|
15515
15533
|
|
|
15516
15534
|
// src/mantine/blocks/domainCreator/flow/DomainCreatorSurveyPanel.tsx
|
|
15517
15535
|
import React168, { useCallback as useCallback39, useEffect as useEffect43, useMemo as useMemo50, useRef as useRef9, useState as useState60 } from "react";
|
|
15518
|
-
import { Alert as Alert22, Button as
|
|
15536
|
+
import { Alert as Alert22, Button as Button31, Group as Group52, Loader as Loader20, Stack as Stack116, Text as Text90 } from "@mantine/core";
|
|
15519
15537
|
import { useDebouncedCallback } from "@mantine/hooks";
|
|
15520
15538
|
import { IconAlertCircle as IconAlertCircle8, IconCheck as IconCheck5 } from "@tabler/icons-react";
|
|
15521
15539
|
import { Survey as Survey5, SurveyModel as SurveyModel5 } from "@ixo/surveys";
|
|
@@ -16792,10 +16810,10 @@ var DomainCreatorSurveyPanel = ({ editor, block, onComplete, entityDid: existing
|
|
|
16792
16810
|
return /* @__PURE__ */ React168.createElement(Stack116, { gap: "md", p: "md", align: "center", justify: "center", style: { minHeight: 300 } }, /* @__PURE__ */ React168.createElement(Loader20, { size: "lg" }), /* @__PURE__ */ React168.createElement(Text90, { size: "sm", c: "dimmed" }, stepMessages[flowStep]));
|
|
16793
16811
|
}
|
|
16794
16812
|
if (flowStep === "success") {
|
|
16795
|
-
return /* @__PURE__ */ React168.createElement(Stack116, { gap: "md", p: "md" }, /* @__PURE__ */ React168.createElement(Alert22, { icon: /* @__PURE__ */ React168.createElement(IconCheck5, { size: 16 }), title: "Domain Created Successfully", color: "green" }, /* @__PURE__ */ React168.createElement(Stack116, { gap: "xs" }, /* @__PURE__ */ React168.createElement(Text90, { size: "sm" }, "Your domain has been created and the Domain Card credential has been signed and stored."), createdEntityDid && /* @__PURE__ */ React168.createElement(Text90, { size: "xs", c: "dimmed" }, "Entity DID: ", createdEntityDid))), /* @__PURE__ */ React168.createElement(
|
|
16813
|
+
return /* @__PURE__ */ React168.createElement(Stack116, { gap: "md", p: "md" }, /* @__PURE__ */ React168.createElement(Alert22, { icon: /* @__PURE__ */ React168.createElement(IconCheck5, { size: 16 }), title: "Domain Created Successfully", color: "green" }, /* @__PURE__ */ React168.createElement(Stack116, { gap: "xs" }, /* @__PURE__ */ React168.createElement(Text90, { size: "sm" }, "Your domain has been created and the Domain Card credential has been signed and stored."), createdEntityDid && /* @__PURE__ */ React168.createElement(Text90, { size: "xs", c: "dimmed" }, "Entity DID: ", createdEntityDid))), /* @__PURE__ */ React168.createElement(Button31, { onClick: handleVisitEntity }, "Visit Entity"));
|
|
16796
16814
|
}
|
|
16797
16815
|
if (flowStep === "error") {
|
|
16798
|
-
return /* @__PURE__ */ React168.createElement(Stack116, { gap: "md", p: "md" }, /* @__PURE__ */ React168.createElement(Alert22, { icon: /* @__PURE__ */ React168.createElement(IconAlertCircle8, { size: 16 }), title: "Domain Creation Failed", color: "red" }, /* @__PURE__ */ React168.createElement(Text90, { size: "sm" }, error || "An unexpected error occurred")), /* @__PURE__ */ React168.createElement(
|
|
16816
|
+
return /* @__PURE__ */ React168.createElement(Stack116, { gap: "md", p: "md" }, /* @__PURE__ */ React168.createElement(Alert22, { icon: /* @__PURE__ */ React168.createElement(IconAlertCircle8, { size: 16 }), title: "Domain Creation Failed", color: "red" }, /* @__PURE__ */ React168.createElement(Text90, { size: "sm" }, error || "An unexpected error occurred")), /* @__PURE__ */ React168.createElement(Group52, null, /* @__PURE__ */ React168.createElement(Button31, { variant: "outline", onClick: handleRetry }, "Try Again"), /* @__PURE__ */ React168.createElement(Button31, { variant: "subtle", onClick: handleClose }, "Close")));
|
|
16799
16817
|
}
|
|
16800
16818
|
return /* @__PURE__ */ React168.createElement(
|
|
16801
16819
|
BaseRightPanelLayout,
|
|
@@ -16852,7 +16870,7 @@ var DomainCreatorFlowView = ({ editor, block }) => {
|
|
|
16852
16870
|
return { variant: "light", color: "gray", text: "Click to start", icon: null };
|
|
16853
16871
|
};
|
|
16854
16872
|
const badgeProps = getBadgeProps();
|
|
16855
|
-
return /* @__PURE__ */ React169.createElement(BaseContainer, { onClick: handleOpen }, /* @__PURE__ */ React169.createElement(
|
|
16873
|
+
return /* @__PURE__ */ React169.createElement(BaseContainer, { onClick: handleOpen }, /* @__PURE__ */ React169.createElement(Group53, { wrap: "nowrap", justify: "space-between", align: "center" }, /* @__PURE__ */ React169.createElement(Group53, { wrap: "nowrap", align: "center", style: { flex: 1 } }, getIcon("file-text", block.props.icon), /* @__PURE__ */ React169.createElement(Stack117, { gap: 4, style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ React169.createElement(Group53, { gap: "xs", align: "center" }, /* @__PURE__ */ React169.createElement(Text91, { fw: 600, size: "sm", contentEditable: false }, block.props.title || "Domain Creator"), /* @__PURE__ */ React169.createElement(Badge22, { size: "xs", variant: badgeProps.variant, color: badgeProps.color, leftSection: badgeProps.icon }, badgeProps.text)), /* @__PURE__ */ React169.createElement(Text91, { size: "xs", c: "dimmed", contentEditable: false, lineClamp: 2 }, hasExistingSubmission ? `Domain created: ${lastSubmission.entityDid}` : block.props.description || "Open the survey panel to create a new domain."))), /* @__PURE__ */ React169.createElement(Tooltip16, { label: hasExistingSubmission ? "View/Edit domain" : "Create domain", withArrow: true }, /* @__PURE__ */ React169.createElement(ActionIcon27, { variant: "subtle", color: "blue" }, /* @__PURE__ */ React169.createElement(IconChevronRight6, { size: 18 })))));
|
|
16856
16874
|
};
|
|
16857
16875
|
|
|
16858
16876
|
// src/mantine/blocks/domainCreator/DomainCreatorBlock.tsx
|
|
@@ -16897,7 +16915,7 @@ import React177 from "react";
|
|
|
16897
16915
|
|
|
16898
16916
|
// src/mantine/blocks/email/template/TemplateView.tsx
|
|
16899
16917
|
import React175, { useMemo as useMemo53 } from "react";
|
|
16900
|
-
import { Badge as Badge24, Group as
|
|
16918
|
+
import { Badge as Badge24, Group as Group55, Stack as Stack120, Text as Text94 } from "@mantine/core";
|
|
16901
16919
|
|
|
16902
16920
|
// src/mantine/blocks/email/template/TemplateConfig.tsx
|
|
16903
16921
|
import React174, { useCallback as useCallback43 } from "react";
|
|
@@ -17038,7 +17056,7 @@ var GeneralTab10 = ({ block, editor, updateProp, updateProps }) => {
|
|
|
17038
17056
|
|
|
17039
17057
|
// src/mantine/blocks/email/template/VariablesTab.tsx
|
|
17040
17058
|
import React173, { useMemo as useMemo52, useCallback as useCallback42 } from "react";
|
|
17041
|
-
import { Alert as Alert23, Badge as Badge23, Divider as Divider14, Group as
|
|
17059
|
+
import { Alert as Alert23, Badge as Badge23, Divider as Divider14, Group as Group54, Stack as Stack119, Text as Text93 } from "@mantine/core";
|
|
17042
17060
|
import { IconInfoCircle as IconInfoCircle4, IconCheck as IconCheck7 } from "@tabler/icons-react";
|
|
17043
17061
|
var VariablesTab = ({ block, editor, updateProp }) => {
|
|
17044
17062
|
const extractedVariables = useMemo52(() => {
|
|
@@ -17069,7 +17087,7 @@ var VariablesTab = ({ block, editor, updateProp }) => {
|
|
|
17069
17087
|
return /* @__PURE__ */ React173.createElement(Alert23, { color: "green", icon: /* @__PURE__ */ React173.createElement(IconCheck7, { size: 16 }) }, "This template has no handlebars variables to configure.");
|
|
17070
17088
|
}
|
|
17071
17089
|
const mappedCount = getMappedCount(extractedVariables, variableMapping);
|
|
17072
|
-
return /* @__PURE__ */ React173.createElement(Stack119, { gap: "md" }, /* @__PURE__ */ React173.createElement(
|
|
17090
|
+
return /* @__PURE__ */ React173.createElement(Stack119, { gap: "md" }, /* @__PURE__ */ React173.createElement(Group54, { justify: "space-between" }, /* @__PURE__ */ React173.createElement(Text93, { size: "sm", c: "dimmed" }, "Map template variables to block data or static values"), /* @__PURE__ */ React173.createElement(Badge23, { color: mappedCount === extractedVariables.length ? "green" : "orange" }, mappedCount, "/", extractedVariables.length, " mapped")), /* @__PURE__ */ React173.createElement(Divider14, null), extractedVariables.map((variable) => /* @__PURE__ */ React173.createElement(
|
|
17073
17091
|
DataInput,
|
|
17074
17092
|
{
|
|
17075
17093
|
key: variable.name,
|
|
@@ -17156,12 +17174,12 @@ var EmailTemplateView = ({ editor, block }) => {
|
|
|
17156
17174
|
}, [block.props.variables]);
|
|
17157
17175
|
const mappedCount = getMappedCount(extractedVariables, variableMapping);
|
|
17158
17176
|
const templateName = block.props.templateName;
|
|
17159
|
-
return /* @__PURE__ */ React175.createElement(BaseContainer, { onClick: open }, /* @__PURE__ */ React175.createElement(
|
|
17177
|
+
return /* @__PURE__ */ React175.createElement(BaseContainer, { onClick: open }, /* @__PURE__ */ React175.createElement(Group55, { wrap: "nowrap", justify: "space-between", align: "center" }, /* @__PURE__ */ React175.createElement(Group55, { wrap: "nowrap", align: "center" }, getIcon("mail", block.props.icon), /* @__PURE__ */ React175.createElement(Stack120, { gap: "xs", style: { flex: 1 } }, /* @__PURE__ */ React175.createElement(Text94, { fw: 500, size: "sm", contentEditable: false }, block.props.title || "Send Email"), templateName ? /* @__PURE__ */ React175.createElement(Text94, { size: "xs", c: "dimmed", contentEditable: false }, "Template: ", templateName) : /* @__PURE__ */ React175.createElement(Text94, { size: "xs", c: "orange", contentEditable: false }, "No template selected"))), /* @__PURE__ */ React175.createElement(Group55, { gap: "xs" }, extractedVariables.length > 0 && /* @__PURE__ */ React175.createElement(Badge24, { size: "sm", variant: "light", color: mappedCount === extractedVariables.length ? "green" : "orange" }, mappedCount, "/", extractedVariables.length, " vars"))));
|
|
17160
17178
|
};
|
|
17161
17179
|
|
|
17162
17180
|
// src/mantine/blocks/email/flow/FlowView.tsx
|
|
17163
17181
|
import React176 from "react";
|
|
17164
|
-
import { Alert as Alert24, Badge as Badge25, Button as
|
|
17182
|
+
import { Alert as Alert24, Badge as Badge25, Button as Button32, Group as Group56, Loader as Loader22, Stack as Stack121, Text as Text95, Tooltip as Tooltip17 } from "@mantine/core";
|
|
17165
17183
|
import { IconMail as IconMail2, IconSend as IconSend4, IconAlertCircle as IconAlertCircle10, IconCheck as IconCheck8, IconRefresh as IconRefresh7 } from "@tabler/icons-react";
|
|
17166
17184
|
|
|
17167
17185
|
// src/mantine/blocks/email/flow/hooks/useEmailActions.ts
|
|
@@ -17315,8 +17333,8 @@ var EmailFlowView = ({ editor, block, isDisabled }) => {
|
|
|
17315
17333
|
}
|
|
17316
17334
|
};
|
|
17317
17335
|
const canSend = !disabled && !loading && block.props.templateName && block.props.to && block.props.from;
|
|
17318
|
-
const sendButton = /* @__PURE__ */ React176.createElement(
|
|
17319
|
-
return /* @__PURE__ */ React176.createElement(BaseContainer, null, /* @__PURE__ */ React176.createElement(Stack121, { gap: "sm" }, /* @__PURE__ */ React176.createElement(
|
|
17336
|
+
const sendButton = /* @__PURE__ */ React176.createElement(Button32, { leftSection: loading ? /* @__PURE__ */ React176.createElement(Loader22, { size: "xs", color: "white" }) : /* @__PURE__ */ React176.createElement(IconSend4, { size: 16 }), onClick: sendEmail, disabled: !canSend, loading, size: "sm" }, block.props.buttonLabel || "Send Email");
|
|
17337
|
+
return /* @__PURE__ */ React176.createElement(BaseContainer, null, /* @__PURE__ */ React176.createElement(Stack121, { gap: "sm" }, /* @__PURE__ */ React176.createElement(Group56, { justify: "space-between", wrap: "nowrap" }, /* @__PURE__ */ React176.createElement(Group56, { wrap: "nowrap" }, /* @__PURE__ */ React176.createElement(IconMail2, { size: 20, style: { color: "var(--mantine-color-blue-6)" } }), /* @__PURE__ */ React176.createElement(Text95, { fw: 500, size: "sm", contentEditable: false }, block.props.title || "Send Email")), /* @__PURE__ */ React176.createElement(Badge25, { color: getStatusColor2(), leftSection: getStatusIcon(), size: "sm" }, getStatusText())), block.props.description && /* @__PURE__ */ React176.createElement(Text95, { size: "xs", c: "dimmed", contentEditable: false }, block.props.description), /* @__PURE__ */ React176.createElement(Stack121, { gap: 4 }, /* @__PURE__ */ React176.createElement(Text95, { size: "xs", contentEditable: false }, /* @__PURE__ */ React176.createElement(Text95, { span: true, fw: 500 }, "To:"), " ", toDisplay || /* @__PURE__ */ React176.createElement(Text95, { span: true, c: "orange" }, "Not configured")), /* @__PURE__ */ React176.createElement(Text95, { size: "xs", contentEditable: false }, /* @__PURE__ */ React176.createElement(Text95, { span: true, fw: 500 }, "Subject:"), " ", subjectDisplay || /* @__PURE__ */ React176.createElement(Text95, { span: true, c: "dimmed" }, "No subject"))), status === "error" && block.props.error && /* @__PURE__ */ React176.createElement(Alert24, { color: "red", icon: /* @__PURE__ */ React176.createElement(IconAlertCircle10, { size: 16 }), py: "xs" }, block.props.error), /* @__PURE__ */ React176.createElement(Group56, { gap: "sm" }, disabled && isDisabled?.message ? /* @__PURE__ */ React176.createElement(Tooltip17, { label: isDisabled.message, position: "top", withArrow: true }, sendButton) : sendButton, status === "error" && /* @__PURE__ */ React176.createElement(Button32, { variant: "light", color: "gray", size: "sm", leftSection: /* @__PURE__ */ React176.createElement(IconRefresh7, { size: 16 }), onClick: resetStatus }, "Reset"), status === "sent" && /* @__PURE__ */ React176.createElement(Button32, { variant: "light", color: "blue", size: "sm", leftSection: /* @__PURE__ */ React176.createElement(IconRefresh7, { size: 16 }), onClick: resetStatus }, "Send Again")), status === "sent" && block.props.lastMessageId && /* @__PURE__ */ React176.createElement(Text95, { size: "xs", c: "dimmed", contentEditable: false }, "Message ID: ", block.props.lastMessageId)));
|
|
17320
17338
|
};
|
|
17321
17339
|
|
|
17322
17340
|
// src/mantine/blocks/email/EmailBlock.tsx
|
|
@@ -17408,7 +17426,7 @@ import React180, { useCallback as useCallback45 } from "react";
|
|
|
17408
17426
|
|
|
17409
17427
|
// src/mantine/blocks/protocolSelector/template/GeneralTab.tsx
|
|
17410
17428
|
import React179, { useEffect as useEffect45, useMemo as useMemo54, useState as useState64 } from "react";
|
|
17411
|
-
import { Divider as Divider15, Stack as Stack122, Text as Text96, PillsInput as PillsInput2, Pill as Pill2, Box as
|
|
17429
|
+
import { Divider as Divider15, Stack as Stack122, Text as Text96, PillsInput as PillsInput2, Pill as Pill2, Box as Box35 } from "@mantine/core";
|
|
17412
17430
|
var GeneralTab11 = ({ title, description, protocolDids, onTitleChange, onDescriptionChange, onProtocolDidsChange }) => {
|
|
17413
17431
|
const [localTitle, setLocalTitle] = useState64(title || "");
|
|
17414
17432
|
const [localDescription, setLocalDescription] = useState64(description || "");
|
|
@@ -17476,7 +17494,7 @@ var GeneralTab11 = ({ title, description, protocolDids, onTitleChange, onDescrip
|
|
|
17476
17494
|
}
|
|
17477
17495
|
}
|
|
17478
17496
|
}
|
|
17479
|
-
))), localDids.length > 0 && /* @__PURE__ */ React179.createElement(
|
|
17497
|
+
))), localDids.length > 0 && /* @__PURE__ */ React179.createElement(Box35, { mt: "xs" }, /* @__PURE__ */ React179.createElement(Text96, { size: "xs", c: "dimmed" }, localDids.length, " protocol", localDids.length !== 1 ? "s" : "", " configured"))));
|
|
17480
17498
|
};
|
|
17481
17499
|
|
|
17482
17500
|
// src/mantine/blocks/protocolSelector/template/TemplateConfig.tsx
|
|
@@ -17519,7 +17537,7 @@ var TemplateConfig11 = ({ editor, block }) => {
|
|
|
17519
17537
|
};
|
|
17520
17538
|
|
|
17521
17539
|
// src/mantine/blocks/protocolSelector/template/TemplateView.tsx
|
|
17522
|
-
import { Box as
|
|
17540
|
+
import { Box as Box36, Group as Group57, Stack as Stack123, Text as Text97 } from "@mantine/core";
|
|
17523
17541
|
import { IconCircleDashed as IconCircleDashed2 } from "@tabler/icons-react";
|
|
17524
17542
|
var PROTOCOL_SELECTOR_TEMPLATE_PANEL_ID = "protocol-selector-template-panel";
|
|
17525
17543
|
var ProtocolSelectorTemplateView = ({ editor, block }) => {
|
|
@@ -17534,8 +17552,8 @@ var ProtocolSelectorTemplateView = ({ editor, block }) => {
|
|
|
17534
17552
|
return [];
|
|
17535
17553
|
}
|
|
17536
17554
|
}, [block.props.protocolDids]);
|
|
17537
|
-
return /* @__PURE__ */ React181.createElement(BaseContainer, { onClick: open }, /* @__PURE__ */ React181.createElement(
|
|
17538
|
-
|
|
17555
|
+
return /* @__PURE__ */ React181.createElement(BaseContainer, { onClick: open }, /* @__PURE__ */ React181.createElement(Group57, { wrap: "nowrap", justify: "space-between", align: "center" }, /* @__PURE__ */ React181.createElement(Group57, { wrap: "nowrap", align: "center", gap: "md" }, /* @__PURE__ */ React181.createElement(
|
|
17556
|
+
Box36,
|
|
17539
17557
|
{
|
|
17540
17558
|
style: {
|
|
17541
17559
|
width: 40,
|
|
@@ -17553,12 +17571,12 @@ var ProtocolSelectorTemplateView = ({ editor, block }) => {
|
|
|
17553
17571
|
|
|
17554
17572
|
// src/mantine/blocks/protocolSelector/flow/FlowView.tsx
|
|
17555
17573
|
import React184, { useMemo as useMemo57 } from "react";
|
|
17556
|
-
import { Badge as Badge26, Box as
|
|
17574
|
+
import { Badge as Badge26, Box as Box38, Group as Group59, Stack as Stack125, Text as Text99, Tooltip as Tooltip18 } from "@mantine/core";
|
|
17557
17575
|
import { IconCircleDashed as IconCircleDashed3, IconChecks } from "@tabler/icons-react";
|
|
17558
17576
|
|
|
17559
17577
|
// src/mantine/blocks/protocolSelector/flow/ProtocolSelectionPanel.tsx
|
|
17560
17578
|
import React183, { useState as useState65, useEffect as useEffect46, useMemo as useMemo56, useCallback as useCallback46 } from "react";
|
|
17561
|
-
import { Stack as Stack124, Text as Text98, Box as
|
|
17579
|
+
import { Stack as Stack124, Text as Text98, Box as Box37, Group as Group58, Loader as Loader23 } from "@mantine/core";
|
|
17562
17580
|
|
|
17563
17581
|
// src/icons/EntityAvatar.tsx
|
|
17564
17582
|
import React182 from "react";
|
|
@@ -17680,10 +17698,10 @@ var ProtocolSelectionPanel = ({ editor, block }) => {
|
|
|
17680
17698
|
[editor, block, closePanel]
|
|
17681
17699
|
);
|
|
17682
17700
|
const selectedDid = block.props.selectedProtocolDid;
|
|
17683
|
-
return /* @__PURE__ */ React183.createElement(BaseRightPanelLayout, { title: block.props.title || "Select Protocol", onClose: closePanel }, /* @__PURE__ */ React183.createElement(Stack124, { gap: "sm", style: { flex: 1, overflow: "auto" } }, protocols.length === 0 ? /* @__PURE__ */ React183.createElement(
|
|
17701
|
+
return /* @__PURE__ */ React183.createElement(BaseRightPanelLayout, { title: block.props.title || "Select Protocol", onClose: closePanel }, /* @__PURE__ */ React183.createElement(Stack124, { gap: "sm", style: { flex: 1, overflow: "auto" } }, protocols.length === 0 ? /* @__PURE__ */ React183.createElement(Box37, { py: "md" }, /* @__PURE__ */ React183.createElement(Text98, { c: "dimmed", ta: "center" }, "No protocols configured.", /* @__PURE__ */ React183.createElement("br", null), "Add protocol DIDs in template mode.")) : protocols.map((protocol) => {
|
|
17684
17702
|
const isSelected = protocol.did === selectedDid;
|
|
17685
17703
|
return /* @__PURE__ */ React183.createElement(
|
|
17686
|
-
|
|
17704
|
+
Box37,
|
|
17687
17705
|
{
|
|
17688
17706
|
key: protocol.did,
|
|
17689
17707
|
onClick: () => !protocol.loading && handleSelectProtocol(protocol),
|
|
@@ -17699,7 +17717,7 @@ var ProtocolSelectionPanel = ({ editor, block }) => {
|
|
|
17699
17717
|
}
|
|
17700
17718
|
}
|
|
17701
17719
|
},
|
|
17702
|
-
/* @__PURE__ */ React183.createElement(
|
|
17720
|
+
/* @__PURE__ */ React183.createElement(Group58, { wrap: "nowrap", justify: "space-between", align: "flex-start" }, /* @__PURE__ */ React183.createElement(Group58, { wrap: "nowrap", align: "center", gap: "md", style: { flex: 1 } }, protocol.loading ? /* @__PURE__ */ React183.createElement(Loader23, { size: "xs", color: "white" }) : /* @__PURE__ */ React183.createElement(EntityAvatar_default, { size: 24 }), /* @__PURE__ */ React183.createElement(Stack124, { gap: 2, style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ React183.createElement(Text98, { fw: 500, size: "sm", lineClamp: 1 }, protocol.loading ? "Loading..." : protocol.type), /* @__PURE__ */ React183.createElement(Text98, { size: "xs", c: "dimmed", lineClamp: 2 }, protocol.loading ? "Fetching protocol info..." : protocol.description || protocol.did))))
|
|
17703
17721
|
);
|
|
17704
17722
|
})));
|
|
17705
17723
|
};
|
|
@@ -17716,8 +17734,8 @@ var ProtocolSelectorFlowView = ({ editor, block, isDisabled }) => {
|
|
|
17716
17734
|
if (disabled) return;
|
|
17717
17735
|
open();
|
|
17718
17736
|
};
|
|
17719
|
-
const containerContent = /* @__PURE__ */ React184.createElement(BaseContainer, { onClick: disabled ? void 0 : handleClick }, /* @__PURE__ */ React184.createElement(
|
|
17720
|
-
|
|
17737
|
+
const containerContent = /* @__PURE__ */ React184.createElement(BaseContainer, { onClick: disabled ? void 0 : handleClick }, /* @__PURE__ */ React184.createElement(Group59, { wrap: "nowrap", justify: "space-between", align: "center" }, /* @__PURE__ */ React184.createElement(Group59, { wrap: "nowrap", align: "center", gap: "md" }, /* @__PURE__ */ React184.createElement(
|
|
17738
|
+
Box38,
|
|
17721
17739
|
{
|
|
17722
17740
|
style: {
|
|
17723
17741
|
display: "flex",
|
|
@@ -17727,9 +17745,9 @@ var ProtocolSelectorFlowView = ({ editor, block, isDisabled }) => {
|
|
|
17727
17745
|
}
|
|
17728
17746
|
},
|
|
17729
17747
|
/* @__PURE__ */ React184.createElement(IconCircleDashed3, { size: 26, color: "white" })
|
|
17730
|
-
), /* @__PURE__ */ React184.createElement(Stack125, { gap: 2, style: { flex: 1 } }, /* @__PURE__ */ React184.createElement(Text99, { fw: 500, size: "sm", lineClamp: 1, style: { opacity: disabled ? 0.5 : 1 } }, block.props.title || "Select Protocol"), isCompleted && block.props.selectedProtocolType ? /* @__PURE__ */ React184.createElement(Badge26, { size: "sm", styles: { root: { backgroundColor: "var(--mantine-primary-color-light)", color: "var(--mantine-primary-color-filled)" } } }, block.props.selectedProtocolType) : /* @__PURE__ */ React184.createElement(Text99, { size: "xs", c: "dimmed", style: { opacity: disabled ? 0.5 : 1 } }, "Selection"))), /* @__PURE__ */ React184.createElement(Stack125, { gap: 2, align: "flex-end" }, isCompleted ? /* @__PURE__ */ React184.createElement(React184.Fragment, null, /* @__PURE__ */ React184.createElement(
|
|
17748
|
+
), /* @__PURE__ */ React184.createElement(Stack125, { gap: 2, style: { flex: 1 } }, /* @__PURE__ */ React184.createElement(Text99, { fw: 500, size: "sm", lineClamp: 1, style: { opacity: disabled ? 0.5 : 1 } }, block.props.title || "Select Protocol"), isCompleted && block.props.selectedProtocolType ? /* @__PURE__ */ React184.createElement(Badge26, { size: "sm", styles: { root: { backgroundColor: "var(--mantine-primary-color-light)", color: "var(--mantine-primary-color-filled)" } } }, block.props.selectedProtocolType) : /* @__PURE__ */ React184.createElement(Text99, { size: "xs", c: "dimmed", style: { opacity: disabled ? 0.5 : 1 } }, "Selection"))), /* @__PURE__ */ React184.createElement(Stack125, { gap: 2, align: "flex-end" }, isCompleted ? /* @__PURE__ */ React184.createElement(React184.Fragment, null, /* @__PURE__ */ React184.createElement(Group59, { gap: 4 }, /* @__PURE__ */ React184.createElement(IconChecks, { size: 16, color: "var(--mantine-color-green-4)" }), /* @__PURE__ */ React184.createElement(Text99, { size: "sm", c: "green.4", fw: 500 }, "Completed")), /* @__PURE__ */ React184.createElement(Text99, { size: "xs", c: "dimmed", lineClamp: 1 }, block.props.selectedProtocolName || block.props.selectedProtocolDid)) : /* @__PURE__ */ React184.createElement(React184.Fragment, null, /* @__PURE__ */ React184.createElement(Text99, { size: "sm" }, "Pending"), /* @__PURE__ */ React184.createElement(Text99, { size: "xs", c: "dimmed" }, "Complete now")))));
|
|
17731
17749
|
if (disabled && isDisabled?.message) {
|
|
17732
|
-
return /* @__PURE__ */ React184.createElement(Tooltip18, { label: isDisabled.message, position: "top", withArrow: true }, /* @__PURE__ */ React184.createElement(
|
|
17750
|
+
return /* @__PURE__ */ React184.createElement(Tooltip18, { label: isDisabled.message, position: "top", withArrow: true }, /* @__PURE__ */ React184.createElement(Box38, { style: { cursor: "not-allowed" } }, containerContent));
|
|
17733
17751
|
}
|
|
17734
17752
|
return containerContent;
|
|
17735
17753
|
};
|
|
@@ -17816,11 +17834,11 @@ import React192 from "react";
|
|
|
17816
17834
|
|
|
17817
17835
|
// src/mantine/blocks/form/template/TemplateView.tsx
|
|
17818
17836
|
import React189, { useMemo as useMemo58 } from "react";
|
|
17819
|
-
import { Badge as Badge27, Group as
|
|
17837
|
+
import { Badge as Badge27, Group as Group60, Stack as Stack126, Text as Text101 } from "@mantine/core";
|
|
17820
17838
|
|
|
17821
17839
|
// src/mantine/blocks/form/template/TemplateConfig.tsx
|
|
17822
17840
|
import React188, { useCallback as useCallback47 } from "react";
|
|
17823
|
-
import { Paper as Paper16, CloseButton as
|
|
17841
|
+
import { Paper as Paper16, CloseButton as CloseButton6, Title as Title9 } from "@mantine/core";
|
|
17824
17842
|
|
|
17825
17843
|
// src/mantine/blocks/form/template/GeneralTab.tsx
|
|
17826
17844
|
import React187, { useEffect as useEffect47, useState as useState66 } from "react";
|
|
@@ -17936,8 +17954,8 @@ var TemplateConfig12 = ({ editor, block }) => {
|
|
|
17936
17954
|
marginBottom: "1rem"
|
|
17937
17955
|
}
|
|
17938
17956
|
},
|
|
17939
|
-
/* @__PURE__ */ React188.createElement(
|
|
17940
|
-
/* @__PURE__ */ React188.createElement(
|
|
17957
|
+
/* @__PURE__ */ React188.createElement(Title9, { order: 3 }, "Form Settings"),
|
|
17958
|
+
/* @__PURE__ */ React188.createElement(CloseButton6, { onClick: closePanel })
|
|
17941
17959
|
),
|
|
17942
17960
|
/* @__PURE__ */ React188.createElement(
|
|
17943
17961
|
ReusablePanel,
|
|
@@ -17974,12 +17992,12 @@ var FormTemplateView = ({ editor, block }) => {
|
|
|
17974
17992
|
const panelContent = useMemo58(() => /* @__PURE__ */ React189.createElement(TemplateConfig12, { editor, block }), [editor, block]);
|
|
17975
17993
|
const { open } = usePanel(panelId, panelContent);
|
|
17976
17994
|
const hasSchema = Boolean(block.props.surveySchema);
|
|
17977
|
-
return /* @__PURE__ */ React189.createElement(BaseContainer, { onClick: open }, /* @__PURE__ */ React189.createElement(Badge27, { size: "xs", variant: "light", color: "gray", style: { position: "absolute", top: 8, right: 8 } }, "Template"), /* @__PURE__ */ React189.createElement(
|
|
17995
|
+
return /* @__PURE__ */ React189.createElement(BaseContainer, { onClick: open }, /* @__PURE__ */ React189.createElement(Badge27, { size: "xs", variant: "light", color: "gray", style: { position: "absolute", top: 8, right: 8 } }, "Template"), /* @__PURE__ */ React189.createElement(Group60, { wrap: "nowrap", justify: "space-between", align: "center" }, /* @__PURE__ */ React189.createElement(Group60, { wrap: "nowrap", align: "center" }, getIcon("checklist", block.props.icon), /* @__PURE__ */ React189.createElement(Stack126, { gap: "xs", style: { flex: 1 } }, /* @__PURE__ */ React189.createElement(Text101, { fw: 500, size: "sm" }, block.props.title || "Form"), /* @__PURE__ */ React189.createElement(Text101, { size: "xs", c: "dimmed" }, hasSchema ? "Form configured" : "Click to configure form schema")))));
|
|
17978
17996
|
};
|
|
17979
17997
|
|
|
17980
17998
|
// src/mantine/blocks/form/flow/FlowView.tsx
|
|
17981
17999
|
import React191, { useMemo as useMemo60, useState as useState67, useCallback as useCallback49 } from "react";
|
|
17982
|
-
import { ActionIcon as ActionIcon28, Badge as Badge28, Group as
|
|
18000
|
+
import { ActionIcon as ActionIcon28, Badge as Badge28, Group as Group61, Stack as Stack127, Text as Text103, Tooltip as Tooltip19 } from "@mantine/core";
|
|
17983
18001
|
import { IconChevronRight as IconChevronRight7 } from "@tabler/icons-react";
|
|
17984
18002
|
|
|
17985
18003
|
// src/mantine/blocks/form/flow/FormPanel.tsx
|
|
@@ -18158,7 +18176,7 @@ var FormFlowView = ({ editor, block }) => {
|
|
|
18158
18176
|
};
|
|
18159
18177
|
const badgeProps = getBadgeProps();
|
|
18160
18178
|
const hasSchema = Boolean(block.props.surveySchema);
|
|
18161
|
-
return /* @__PURE__ */ React191.createElement(BaseContainer, { onClick: handleOpen }, /* @__PURE__ */ React191.createElement(
|
|
18179
|
+
return /* @__PURE__ */ React191.createElement(BaseContainer, { onClick: handleOpen }, /* @__PURE__ */ React191.createElement(Group61, { wrap: "nowrap", justify: "space-between", align: "center" }, /* @__PURE__ */ React191.createElement(Group61, { wrap: "nowrap", align: "center", style: { flex: 1 } }, getIcon("checklist", block.props.icon), /* @__PURE__ */ React191.createElement(Stack127, { gap: 4, style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ React191.createElement(Group61, { gap: "xs", align: "center" }, /* @__PURE__ */ React191.createElement(Text103, { fw: 600, size: "sm" }, block.props.title || "Form"), /* @__PURE__ */ React191.createElement(
|
|
18162
18180
|
Badge28,
|
|
18163
18181
|
{
|
|
18164
18182
|
size: "xs",
|
|
@@ -18214,7 +18232,7 @@ import React200 from "react";
|
|
|
18214
18232
|
|
|
18215
18233
|
// src/mantine/blocks/domainCreatorSign/template/TemplateView.tsx
|
|
18216
18234
|
import React196, { useMemo as useMemo61 } from "react";
|
|
18217
|
-
import { Badge as Badge29, Group as
|
|
18235
|
+
import { Badge as Badge29, Group as Group62, Stack as Stack128, Text as Text104 } from "@mantine/core";
|
|
18218
18236
|
|
|
18219
18237
|
// src/mantine/blocks/domainCreatorSign/template/TemplateConfig.tsx
|
|
18220
18238
|
import React195, { useCallback as useCallback50 } from "react";
|
|
@@ -18322,16 +18340,16 @@ var DomainCreatorSignTemplateView = ({ editor, block }) => {
|
|
|
18322
18340
|
[editor, block, closePanel]
|
|
18323
18341
|
);
|
|
18324
18342
|
const { open: openAssignment } = usePanel(assignmentPanelId, assignmentPanelContent);
|
|
18325
|
-
return /* @__PURE__ */ React196.createElement(BaseContainer, { onClick: open }, /* @__PURE__ */ React196.createElement(Badge29, { size: "xs", variant: "light", color: "gray", style: { position: "absolute", top: 8, right: 8 } }, "Template"), /* @__PURE__ */ React196.createElement(
|
|
18343
|
+
return /* @__PURE__ */ React196.createElement(BaseContainer, { onClick: open }, /* @__PURE__ */ React196.createElement(Badge29, { size: "xs", variant: "light", color: "gray", style: { position: "absolute", top: 8, right: 8 } }, "Template"), /* @__PURE__ */ React196.createElement(Group62, { wrap: "nowrap", justify: "space-between", align: "center" }, /* @__PURE__ */ React196.createElement(Group62, { wrap: "nowrap", align: "center" }, getIcon("feather", block.props.icon), /* @__PURE__ */ React196.createElement(Stack128, { gap: "xs", style: { flex: 1 } }, /* @__PURE__ */ React196.createElement(Text104, { fw: 500, size: "sm" }, block.props.title || "Sign to Create"), /* @__PURE__ */ React196.createElement(Text104, { size: "xs", c: "dimmed" }, "Sign"))), /* @__PURE__ */ React196.createElement(AssignmentDisplay, { block, onClick: openAssignment })));
|
|
18326
18344
|
};
|
|
18327
18345
|
|
|
18328
18346
|
// src/mantine/blocks/domainCreatorSign/flow/FlowView.tsx
|
|
18329
18347
|
import React199, { useCallback as useCallback52, useMemo as useMemo62, useEffect as useEffect50 } from "react";
|
|
18330
|
-
import { ActionIcon as ActionIcon29, Badge as Badge31, Group as
|
|
18348
|
+
import { ActionIcon as ActionIcon29, Badge as Badge31, Group as Group65, Stack as Stack131, Text as Text107, Tooltip as Tooltip21 } from "@mantine/core";
|
|
18331
18349
|
import { IconChevronRight as IconChevronRight8 } from "@tabler/icons-react";
|
|
18332
18350
|
|
|
18333
18351
|
// src/mantine/blocks/domainCreatorSign/flow/SignPanel.tsx
|
|
18334
|
-
import { Alert as Alert26, Button as
|
|
18352
|
+
import { Alert as Alert26, Button as Button33, Group as Group64, Loader as Loader24, Stack as Stack130, Text as Text106 } from "@mantine/core";
|
|
18335
18353
|
import { IconAlertCircle as IconAlertCircle12, IconCheck as IconCheck9 } from "@tabler/icons-react";
|
|
18336
18354
|
import React198, { useCallback as useCallback51, useState as useState70 } from "react";
|
|
18337
18355
|
|
|
@@ -18354,7 +18372,7 @@ function buildGovernanceGroupLinkedEntities(linkedEntities) {
|
|
|
18354
18372
|
}
|
|
18355
18373
|
|
|
18356
18374
|
// src/mantine/components/Base/BaseSigning.tsx
|
|
18357
|
-
import { Badge as Badge30, Box as
|
|
18375
|
+
import { Badge as Badge30, Box as Box39, Flex as Flex30, Group as Group63, Slider, Stack as Stack129, Tabs as Tabs4, Text as Text105, Tooltip as Tooltip20 } from "@mantine/core";
|
|
18358
18376
|
import { IconClock as IconClock2, IconFeather as IconFeather2, IconUsers as IconUsers3, IconArrowsExchange as IconArrowsExchange2, IconCalendar as IconCalendar2, IconLeaf as IconLeaf2, IconBolt } from "@tabler/icons-react";
|
|
18359
18377
|
import React197, { useState as useState69 } from "react";
|
|
18360
18378
|
function BaseSigning({ handleSign }) {
|
|
@@ -18389,7 +18407,7 @@ function BaseSigning({ handleSign }) {
|
|
|
18389
18407
|
c: "var(--mantine-color-accent-2)",
|
|
18390
18408
|
fw: 400,
|
|
18391
18409
|
tt: "capitalize",
|
|
18392
|
-
leftSection: /* @__PURE__ */ React197.createElement(
|
|
18410
|
+
leftSection: /* @__PURE__ */ React197.createElement(Box39, { style: { display: "inline-flex", alignItems: "center", lineHeight: 1 } }, /* @__PURE__ */ React197.createElement(IconClock2, { size: 14 })),
|
|
18393
18411
|
styles: {
|
|
18394
18412
|
root: {
|
|
18395
18413
|
display: "inline-flex",
|
|
@@ -18399,7 +18417,7 @@ function BaseSigning({ handleSign }) {
|
|
|
18399
18417
|
},
|
|
18400
18418
|
"12h 5min"
|
|
18401
18419
|
)),
|
|
18402
|
-
/* @__PURE__ */ React197.createElement(
|
|
18420
|
+
/* @__PURE__ */ React197.createElement(Box39, { mb: "sm", bg: "neutralColor.5", p: 8, style: { borderRadius: 8 } }, /* @__PURE__ */ React197.createElement(
|
|
18403
18421
|
Tabs4,
|
|
18404
18422
|
{
|
|
18405
18423
|
value: activeTab,
|
|
@@ -18434,7 +18452,7 @@ function BaseSigning({ handleSign }) {
|
|
|
18434
18452
|
/* @__PURE__ */ React197.createElement(Tabs4.Panel, { value: "charge" }, /* @__PURE__ */ React197.createElement(Text105, { c: "white", size: "sm" }, "Charge content")),
|
|
18435
18453
|
/* @__PURE__ */ React197.createElement(Tabs4.Panel, { value: "impact" }, /* @__PURE__ */ React197.createElement(Text105, { c: "white", size: "sm" }, "Impact content"))
|
|
18436
18454
|
)),
|
|
18437
|
-
isSigned ? /* @__PURE__ */ React197.createElement(
|
|
18455
|
+
isSigned ? /* @__PURE__ */ React197.createElement(Box39, { bg: "dark.6", p: "sm", style: { borderRadius: "var(--mantine-radius-md)" } }, /* @__PURE__ */ React197.createElement(Group63, { justify: "center" }, /* @__PURE__ */ React197.createElement(Text105, { size: "sm", c: "dimmed" }, "Transaction signed successfully"))) : /* @__PURE__ */ React197.createElement(
|
|
18438
18456
|
Slider,
|
|
18439
18457
|
{
|
|
18440
18458
|
value,
|
|
@@ -18620,10 +18638,10 @@ var SignPanel = ({ editor, block, onComplete, onError }) => {
|
|
|
18620
18638
|
return /* @__PURE__ */ React198.createElement(BaseRightPanelLayout, { onClose: handleClose, title: block.props.title || "Sign to Create" }, /* @__PURE__ */ React198.createElement(Stack130, { gap: "md", align: "center", justify: "center", style: { minHeight: 300 } }, /* @__PURE__ */ React198.createElement(Loader24, { size: "lg" }), /* @__PURE__ */ React198.createElement(Text106, { size: "sm", c: "dimmed" }, stepMessages[flowStep])));
|
|
18621
18639
|
}
|
|
18622
18640
|
if (flowStep === "success") {
|
|
18623
|
-
return /* @__PURE__ */ React198.createElement(BaseRightPanelLayout, { onClose: handleClose, title: block.props.title || "Sign to Create" }, /* @__PURE__ */ React198.createElement(Stack130, { gap: "md" }, /* @__PURE__ */ React198.createElement(Alert26, { icon: /* @__PURE__ */ React198.createElement(IconCheck9, { size: 16 }), title: "Domain Created Successfully", color: "green" }, /* @__PURE__ */ React198.createElement(Stack130, { gap: "xs" }, /* @__PURE__ */ React198.createElement(Text106, { size: "sm" }, "Your domain has been created and the Domain Card credential has been signed and stored."), createdEntityDid && /* @__PURE__ */ React198.createElement(Text106, { size: "xs", c: "dimmed" }, "Entity DID: ", createdEntityDid))), /* @__PURE__ */ React198.createElement(
|
|
18641
|
+
return /* @__PURE__ */ React198.createElement(BaseRightPanelLayout, { onClose: handleClose, title: block.props.title || "Sign to Create" }, /* @__PURE__ */ React198.createElement(Stack130, { gap: "md" }, /* @__PURE__ */ React198.createElement(Alert26, { icon: /* @__PURE__ */ React198.createElement(IconCheck9, { size: 16 }), title: "Domain Created Successfully", color: "green" }, /* @__PURE__ */ React198.createElement(Stack130, { gap: "xs" }, /* @__PURE__ */ React198.createElement(Text106, { size: "sm" }, "Your domain has been created and the Domain Card credential has been signed and stored."), createdEntityDid && /* @__PURE__ */ React198.createElement(Text106, { size: "xs", c: "dimmed" }, "Entity DID: ", createdEntityDid))), /* @__PURE__ */ React198.createElement(Button33, { onClick: handleVisitEntity }, "Visit Entity")));
|
|
18624
18642
|
}
|
|
18625
18643
|
if (flowStep === "error") {
|
|
18626
|
-
return /* @__PURE__ */ React198.createElement(BaseRightPanelLayout, { onClose: handleClose, title: block.props.title || "Sign to Create" }, /* @__PURE__ */ React198.createElement(Stack130, { gap: "md" }, /* @__PURE__ */ React198.createElement(Alert26, { icon: /* @__PURE__ */ React198.createElement(IconAlertCircle12, { size: 16 }), title: "Domain Creation Failed", color: "red" }, /* @__PURE__ */ React198.createElement(Text106, { size: "sm" }, error || "An unexpected error occurred")), /* @__PURE__ */ React198.createElement(
|
|
18644
|
+
return /* @__PURE__ */ React198.createElement(BaseRightPanelLayout, { onClose: handleClose, title: block.props.title || "Sign to Create" }, /* @__PURE__ */ React198.createElement(Stack130, { gap: "md" }, /* @__PURE__ */ React198.createElement(Alert26, { icon: /* @__PURE__ */ React198.createElement(IconAlertCircle12, { size: 16 }), title: "Domain Creation Failed", color: "red" }, /* @__PURE__ */ React198.createElement(Text106, { size: "sm" }, error || "An unexpected error occurred")), /* @__PURE__ */ React198.createElement(Group64, null, /* @__PURE__ */ React198.createElement(Button33, { variant: "outline", onClick: handleRetry }, "Try Again"), /* @__PURE__ */ React198.createElement(Button33, { variant: "subtle", onClick: handleClose }, "Close"))));
|
|
18627
18645
|
}
|
|
18628
18646
|
const domainCardData = getDomainCardData();
|
|
18629
18647
|
return /* @__PURE__ */ React198.createElement(
|
|
@@ -18633,7 +18651,7 @@ var SignPanel = ({ editor, block, onComplete, onError }) => {
|
|
|
18633
18651
|
captionContent: /* @__PURE__ */ React198.createElement(Text106, { px: "xl", py: "md", size: "sm", c: "dimmed" }, "Review and sign to create your domain."),
|
|
18634
18652
|
title: block.props.title || "Sign to Create"
|
|
18635
18653
|
},
|
|
18636
|
-
/* @__PURE__ */ React198.createElement(Stack130, { gap: "xs", mb: "md", p: "md", style: { backgroundColor: "var(--mantine-color-dark-6)", borderRadius: 8 } }, /* @__PURE__ */ React198.createElement(Text106, { fw: 600, size: "sm" }, "Domain Card Summary"), /* @__PURE__ */ React198.createElement(
|
|
18654
|
+
/* @__PURE__ */ React198.createElement(Stack130, { gap: "xs", mb: "md", p: "md", style: { backgroundColor: "var(--mantine-color-dark-6)", borderRadius: 8 } }, /* @__PURE__ */ React198.createElement(Text106, { fw: 600, size: "sm" }, "Domain Card Summary"), /* @__PURE__ */ React198.createElement(Group64, { gap: "xs" }, /* @__PURE__ */ React198.createElement(Text106, { size: "xs", c: "dimmed", style: { width: 80 } }, "Name:"), /* @__PURE__ */ React198.createElement(Text106, { size: "xs" }, domainCardData?.credentialSubject?.name || "Not set")), /* @__PURE__ */ React198.createElement(Group64, { gap: "xs" }, /* @__PURE__ */ React198.createElement(Text106, { size: "xs", c: "dimmed", style: { width: 80 } }, "Type:"), /* @__PURE__ */ React198.createElement(Text106, { size: "xs" }, block.props.entityType || (domainCardData?.credentialSubject?.type?.[0]?.replace(/^schema:/i, "").toLowerCase() ?? "dao"))), domainCardData?.credentialSubject?.description && /* @__PURE__ */ React198.createElement(Group64, { gap: "xs", align: "flex-start" }, /* @__PURE__ */ React198.createElement(Text106, { size: "xs", c: "dimmed", style: { width: 80 } }, "Description:"), /* @__PURE__ */ React198.createElement(Text106, { size: "xs", lineClamp: 2, style: { flex: 1 } }, domainCardData.credentialSubject.description))),
|
|
18637
18655
|
/* @__PURE__ */ React198.createElement(BaseSigning, { handleSign })
|
|
18638
18656
|
);
|
|
18639
18657
|
};
|
|
@@ -18733,7 +18751,7 @@ var DomainCreatorSignFlowView = ({ editor, block }) => {
|
|
|
18733
18751
|
return "Waiting for domain card data";
|
|
18734
18752
|
}
|
|
18735
18753
|
};
|
|
18736
|
-
return /* @__PURE__ */ React199.createElement(BaseContainer, { onClick: isClickable ? handleOpen : void 0, style: { opacity: isClickable ? 1 : 0.7, cursor: isClickable ? "pointer" : "not-allowed" } }, /* @__PURE__ */ React199.createElement(
|
|
18754
|
+
return /* @__PURE__ */ React199.createElement(BaseContainer, { onClick: isClickable ? handleOpen : void 0, style: { opacity: isClickable ? 1 : 0.7, cursor: isClickable ? "pointer" : "not-allowed" } }, /* @__PURE__ */ React199.createElement(Group65, { wrap: "nowrap", justify: "space-between", align: "center" }, /* @__PURE__ */ React199.createElement(Group65, { wrap: "nowrap", align: "center", style: { flex: 1 } }, getIcon("feather", block.props.icon), /* @__PURE__ */ React199.createElement(Stack131, { gap: 4, style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ React199.createElement(Group65, { gap: "xs", align: "center" }, /* @__PURE__ */ React199.createElement(Text107, { fw: 600, size: "sm" }, block.props.title || "Sign to Create"), /* @__PURE__ */ React199.createElement(Badge31, { size: "xs", variant: "filled", color: badgeProps.color, styles: { root: { backgroundColor: `var(--mantine-color-${badgeProps.color}-6)`, color: "white" } } }, badgeProps.text)), /* @__PURE__ */ React199.createElement(Text107, { size: "xs", c: "dimmed", lineClamp: 2 }, getDescriptionText()))), /* @__PURE__ */ React199.createElement(Group65, null, /* @__PURE__ */ React199.createElement(AssignmentDisplay, { block, onClick: openAssignment }), isClickable && /* @__PURE__ */ React199.createElement(Tooltip21, { label: status === "completed" ? "View details" : "Sign & Create", withArrow: true }, /* @__PURE__ */ React199.createElement(ActionIcon29, { variant: "subtle", color: "blue" }, /* @__PURE__ */ React199.createElement(IconChevronRight8, { size: 18 }))))));
|
|
18737
18755
|
};
|
|
18738
18756
|
|
|
18739
18757
|
// src/mantine/blocks/domainCreatorSign/DomainCreatorSignBlock.tsx
|
|
@@ -18794,11 +18812,11 @@ import React207 from "react";
|
|
|
18794
18812
|
|
|
18795
18813
|
// src/mantine/blocks/domainCardViewer/template/TemplateView.tsx
|
|
18796
18814
|
import React204, { useMemo as useMemo63 } from "react";
|
|
18797
|
-
import { Badge as Badge32, Group as
|
|
18815
|
+
import { Badge as Badge32, Group as Group66, Stack as Stack132, Text as Text108 } from "@mantine/core";
|
|
18798
18816
|
|
|
18799
18817
|
// src/mantine/blocks/domainCardViewer/template/TemplateConfig.tsx
|
|
18800
18818
|
import React203, { useCallback as useCallback53 } from "react";
|
|
18801
|
-
import { Paper as Paper17, CloseButton as
|
|
18819
|
+
import { Paper as Paper17, CloseButton as CloseButton7, Title as Title10 } from "@mantine/core";
|
|
18802
18820
|
|
|
18803
18821
|
// src/mantine/blocks/domainCardViewer/template/GeneralTab.tsx
|
|
18804
18822
|
import React202, { useEffect as useEffect51, useState as useState71 } from "react";
|
|
@@ -18885,8 +18903,8 @@ var TemplateConfig14 = ({ editor, block }) => {
|
|
|
18885
18903
|
marginBottom: "1rem"
|
|
18886
18904
|
}
|
|
18887
18905
|
},
|
|
18888
|
-
/* @__PURE__ */ React203.createElement(
|
|
18889
|
-
/* @__PURE__ */ React203.createElement(
|
|
18906
|
+
/* @__PURE__ */ React203.createElement(Title10, { order: 5 }, "Domain Card Settings"),
|
|
18907
|
+
/* @__PURE__ */ React203.createElement(CloseButton7, { onClick: closePanel })
|
|
18890
18908
|
),
|
|
18891
18909
|
/* @__PURE__ */ React203.createElement(
|
|
18892
18910
|
ReusablePanel,
|
|
@@ -18920,17 +18938,17 @@ var DomainCardViewerTemplateView = ({ editor, block }) => {
|
|
|
18920
18938
|
const panelId = `${DOMAIN_CARD_VIEWER_TEMPLATE_PANEL_ID}-${block.id}`;
|
|
18921
18939
|
const panelContent = useMemo63(() => /* @__PURE__ */ React204.createElement(TemplateConfig14, { editor, block }), [editor, block]);
|
|
18922
18940
|
const { open } = usePanel(panelId, panelContent);
|
|
18923
|
-
return /* @__PURE__ */ React204.createElement(BaseContainer, { onClick: open }, /* @__PURE__ */ React204.createElement(Badge32, { size: "xs", variant: "light", color: "gray", style: { position: "absolute", top: 8, right: 8 } }, "Template"), /* @__PURE__ */ React204.createElement(
|
|
18941
|
+
return /* @__PURE__ */ React204.createElement(BaseContainer, { onClick: open }, /* @__PURE__ */ React204.createElement(Badge32, { size: "xs", variant: "light", color: "gray", style: { position: "absolute", top: 8, right: 8 } }, "Template"), /* @__PURE__ */ React204.createElement(Group66, { wrap: "nowrap", justify: "space-between", align: "center" }, /* @__PURE__ */ React204.createElement(Group66, { wrap: "nowrap", align: "center" }, getIcon("dots-circle", block.props.icon), /* @__PURE__ */ React204.createElement(Stack132, { gap: "xs", style: { flex: 1 } }, /* @__PURE__ */ React204.createElement(Text108, { fw: 500, size: "sm" }, block.props.title || "Domain Card"), /* @__PURE__ */ React204.createElement(Text108, { size: "xs", c: "dimmed" }, block.props.description || "Preview domain card generated by AI")))));
|
|
18924
18942
|
};
|
|
18925
18943
|
|
|
18926
18944
|
// src/mantine/blocks/domainCardViewer/flow/FlowView.tsx
|
|
18927
18945
|
import React206, { useMemo as useMemo65, useCallback as useCallback54, useEffect as useEffect52 } from "react";
|
|
18928
|
-
import { ActionIcon as ActionIcon30, Badge as Badge33, Button as
|
|
18946
|
+
import { ActionIcon as ActionIcon30, Badge as Badge33, Button as Button35, Group as Group67, Stack as Stack134, Text as Text110, Tooltip as Tooltip22 } from "@mantine/core";
|
|
18929
18947
|
import { IconChevronRight as IconChevronRight9, IconLoader, IconTestPipe, IconTrash as IconTrash5 } from "@tabler/icons-react";
|
|
18930
18948
|
|
|
18931
18949
|
// src/mantine/blocks/domainCardViewer/flow/ViewerPanel.tsx
|
|
18932
18950
|
import React205, { useMemo as useMemo64 } from "react";
|
|
18933
|
-
import { Paper as Paper18, CloseButton as
|
|
18951
|
+
import { Paper as Paper18, CloseButton as CloseButton8, Title as Title11, Stack as Stack133, Text as Text109, Loader as Loader25, Alert as Alert27, Button as Button34, Box as Box40, ScrollArea as ScrollArea7, Code as Code6 } from "@mantine/core";
|
|
18934
18952
|
import { IconAlertCircle as IconAlertCircle13, IconCheck as IconCheck10, IconSparkles as IconSparkles3 } from "@tabler/icons-react";
|
|
18935
18953
|
function parsePreviewData(jsonString) {
|
|
18936
18954
|
if (!jsonString || jsonString === "{}") return null;
|
|
@@ -18941,7 +18959,7 @@ function parsePreviewData(jsonString) {
|
|
|
18941
18959
|
}
|
|
18942
18960
|
}
|
|
18943
18961
|
var JsonViewer = ({ data }) => {
|
|
18944
|
-
return /* @__PURE__ */ React205.createElement(ScrollArea7, { h: "100%", offsetScrollbars: true }, /* @__PURE__ */ React205.createElement(Stack133, { gap: "md" }, data.name && /* @__PURE__ */ React205.createElement(
|
|
18962
|
+
return /* @__PURE__ */ React205.createElement(ScrollArea7, { h: "100%", offsetScrollbars: true }, /* @__PURE__ */ React205.createElement(Stack133, { gap: "md" }, data.name && /* @__PURE__ */ React205.createElement(Box40, null, /* @__PURE__ */ React205.createElement(Text109, { size: "xs", c: "dimmed", tt: "uppercase", fw: 600 }, "Name"), /* @__PURE__ */ React205.createElement(Text109, { size: "lg", fw: 600 }, data.name)), data.summary && /* @__PURE__ */ React205.createElement(Box40, null, /* @__PURE__ */ React205.createElement(Text109, { size: "xs", c: "dimmed", tt: "uppercase", fw: 600 }, "Summary"), /* @__PURE__ */ React205.createElement(Text109, { size: "sm" }, data.summary)), data.description && /* @__PURE__ */ React205.createElement(Box40, null, /* @__PURE__ */ React205.createElement(Text109, { size: "xs", c: "dimmed", tt: "uppercase", fw: 600 }, "Description"), /* @__PURE__ */ React205.createElement(Text109, { size: "sm" }, data.description)), data.entity_type && data.entity_type.length > 0 && /* @__PURE__ */ React205.createElement(Box40, null, /* @__PURE__ */ React205.createElement(Text109, { size: "xs", c: "dimmed", tt: "uppercase", fw: 600 }, "Type"), /* @__PURE__ */ React205.createElement(Text109, { size: "sm" }, data.entity_type.join(", "))), data.keywords && data.keywords.length > 0 && /* @__PURE__ */ React205.createElement(Box40, null, /* @__PURE__ */ React205.createElement(Text109, { size: "xs", c: "dimmed", tt: "uppercase", fw: 600 }, "Keywords"), /* @__PURE__ */ React205.createElement(Text109, { size: "sm" }, data.keywords.join(", "))), data.faq && data.faq.length > 0 && /* @__PURE__ */ React205.createElement(Box40, null, /* @__PURE__ */ React205.createElement(Text109, { size: "xs", c: "dimmed", tt: "uppercase", fw: 600, mb: "xs" }, "FAQ"), /* @__PURE__ */ React205.createElement(Stack133, { gap: "sm" }, data.faq.map((item, index) => /* @__PURE__ */ React205.createElement(Box40, { key: index, p: "sm", style: { borderRadius: 8, backgroundColor: "var(--mantine-color-dark-6)" } }, /* @__PURE__ */ React205.createElement(Text109, { size: "sm", fw: 500, mb: 4 }, item.question), /* @__PURE__ */ React205.createElement(Text109, { size: "xs", c: "dimmed" }, item.answer))))), /* @__PURE__ */ React205.createElement(Box40, null, /* @__PURE__ */ React205.createElement(Text109, { size: "xs", c: "dimmed", tt: "uppercase", fw: 600, mb: "xs" }, "Raw Data"), /* @__PURE__ */ React205.createElement(Code6, { block: true, style: { fontSize: 11, maxHeight: 200, overflow: "auto" } }, JSON.stringify(data, null, 2)))));
|
|
18945
18963
|
};
|
|
18946
18964
|
var ViewerPanel = ({ block, onApprove }) => {
|
|
18947
18965
|
const { closePanel } = usePanelStore();
|
|
@@ -18977,10 +18995,10 @@ var ViewerPanel = ({ block, onApprove }) => {
|
|
|
18977
18995
|
flexShrink: 0
|
|
18978
18996
|
}
|
|
18979
18997
|
},
|
|
18980
|
-
/* @__PURE__ */ React205.createElement(
|
|
18981
|
-
/* @__PURE__ */ React205.createElement(
|
|
18998
|
+
/* @__PURE__ */ React205.createElement(Title11, { order: 5 }, block.props.title || "Domain Card"),
|
|
18999
|
+
/* @__PURE__ */ React205.createElement(CloseButton8, { onClick: closePanel })
|
|
18982
19000
|
),
|
|
18983
|
-
/* @__PURE__ */ React205.createElement(
|
|
19001
|
+
/* @__PURE__ */ React205.createElement(Box40, { style: { flex: 1, overflow: "hidden", display: "flex", flexDirection: "column" } }, isLoading && /* @__PURE__ */ React205.createElement(Stack133, { align: "center", justify: "center", style: { flex: 1 }, gap: "md" }, /* @__PURE__ */ React205.createElement(Loader25, { size: "lg", color: "blue" }), /* @__PURE__ */ React205.createElement(Stack133, { align: "center", gap: "xs" }, /* @__PURE__ */ React205.createElement(IconSparkles3, { size: 24, color: "var(--mantine-color-blue-5)" }), /* @__PURE__ */ React205.createElement(Text109, { size: "sm", c: "dimmed", ta: "center" }, loadingMessage))), isError && /* @__PURE__ */ React205.createElement(Stack133, { style: { flex: 1 }, gap: "md" }, /* @__PURE__ */ React205.createElement(Alert27, { icon: /* @__PURE__ */ React205.createElement(IconAlertCircle13, { size: 16 }), title: "Error", color: "red", variant: "light" }, errorMessage), /* @__PURE__ */ React205.createElement(Text109, { size: "sm", c: "dimmed", ta: "center" }, "Please ask the oracle to try again.")), (isReady || isApproved) && hasData && /* @__PURE__ */ React205.createElement(Box40, { style: { flex: 1, overflow: "hidden" } }, domainCardRenderer ? (
|
|
18984
19002
|
// Use custom renderer from web app
|
|
18985
19003
|
/* @__PURE__ */ React205.createElement(ScrollArea7, { h: "100%", offsetScrollbars: true }, domainCardRenderer(domainPreviewData))
|
|
18986
19004
|
) : (
|
|
@@ -18988,7 +19006,7 @@ var ViewerPanel = ({ block, onApprove }) => {
|
|
|
18988
19006
|
/* @__PURE__ */ React205.createElement(JsonViewer, { data: domainPreviewData })
|
|
18989
19007
|
)), !isLoading && !isError && !hasData && /* @__PURE__ */ React205.createElement(Stack133, { align: "center", justify: "center", style: { flex: 1 }, gap: "md" }, /* @__PURE__ */ React205.createElement(Text109, { size: "sm", c: "dimmed", ta: "center" }, "No domain data available yet."))),
|
|
18990
19008
|
isReady && hasData && /* @__PURE__ */ React205.createElement(
|
|
18991
|
-
|
|
19009
|
+
Box40,
|
|
18992
19010
|
{
|
|
18993
19011
|
pt: "md",
|
|
18994
19012
|
mt: "md",
|
|
@@ -18999,10 +19017,10 @@ var ViewerPanel = ({ block, onApprove }) => {
|
|
|
18999
19017
|
},
|
|
19000
19018
|
/* @__PURE__ */ React205.createElement(Text109, { size: "xs", c: "dimmed", ta: "center", mb: "0" }, "This shows the domain details to see if the narrative aligns with what the domain is about."),
|
|
19001
19019
|
/* @__PURE__ */ React205.createElement(Text109, { size: "xs", c: "dimmed", ta: "center", mb: "md" }, "If you'd like changes, ask the oracle to make changes for you."),
|
|
19002
|
-
/* @__PURE__ */ React205.createElement(
|
|
19020
|
+
/* @__PURE__ */ React205.createElement(Button34, { fullWidth: true, color: "teal", leftSection: /* @__PURE__ */ React205.createElement(IconCheck10, { size: 16 }), onClick: onApprove }, "Approve")
|
|
19003
19021
|
),
|
|
19004
19022
|
isApproved && /* @__PURE__ */ React205.createElement(
|
|
19005
|
-
|
|
19023
|
+
Box40,
|
|
19006
19024
|
{
|
|
19007
19025
|
pt: "md",
|
|
19008
19026
|
mt: "md",
|
|
@@ -19335,7 +19353,7 @@ var DomainCardViewerFlowView = ({ editor, block }) => {
|
|
|
19335
19353
|
}
|
|
19336
19354
|
};
|
|
19337
19355
|
const canOpenPanel = status !== "pending";
|
|
19338
|
-
return /* @__PURE__ */ React206.createElement(BaseContainer, { onClick: canOpenPanel ? open : void 0, style: { opacity: canOpenPanel ? 1 : 0.7, cursor: canOpenPanel ? "pointer" : "not-allowed" } }, /* @__PURE__ */ React206.createElement(
|
|
19356
|
+
return /* @__PURE__ */ React206.createElement(BaseContainer, { onClick: canOpenPanel ? open : void 0, style: { opacity: canOpenPanel ? 1 : 0.7, cursor: canOpenPanel ? "pointer" : "not-allowed" } }, /* @__PURE__ */ React206.createElement(Group67, { wrap: "nowrap", justify: "space-between", align: "center" }, /* @__PURE__ */ React206.createElement(Group67, { wrap: "nowrap", align: "center", style: { flex: 1 } }, getIcon("dots-circle", block.props.icon), /* @__PURE__ */ React206.createElement(Stack134, { gap: 4, style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ React206.createElement(Group67, { gap: "xs", align: "center" }, /* @__PURE__ */ React206.createElement(Text110, { fw: 600, size: "sm" }, block.props.title || "Domain Card"), /* @__PURE__ */ React206.createElement(Badge33, { size: "xs", variant: "filled", color: badgeProps.color, styles: { root: { backgroundColor: `var(--mantine-color-${badgeProps.color}-6)`, color: "white" } } }, badgeProps.text)), /* @__PURE__ */ React206.createElement(Text110, { size: "xs", c: "dimmed", lineClamp: 2 }, getDescriptionText()))), IS_DEV && status === "pending" && /* @__PURE__ */ React206.createElement(React206.Fragment, null, /* @__PURE__ */ React206.createElement(Button35, { size: "compact-xs", variant: "light", color: "orange", leftSection: /* @__PURE__ */ React206.createElement(IconTestPipe, { size: 14 }), onClick: handleInjectDummyData }, "Test Data"), /* @__PURE__ */ React206.createElement(Button35, { size: "compact-xs", variant: "light", color: "blue", leftSection: /* @__PURE__ */ React206.createElement(IconLoader, { size: 14 }), onClick: handleSetLoading }, "Loading")), IS_DEV && (status === "ready" || status === "approved" || status === "loading") && /* @__PURE__ */ React206.createElement(Button35, { size: "compact-xs", variant: "light", color: "orange", leftSection: /* @__PURE__ */ React206.createElement(IconTrash5, { size: 14 }), onClick: handleClearData }, "Clear"), canOpenPanel && /* @__PURE__ */ React206.createElement(Tooltip22, { label: status === "approved" ? "View domain data" : "Review domain data", withArrow: true }, /* @__PURE__ */ React206.createElement(ActionIcon30, { variant: "subtle", color: "blue" }, /* @__PURE__ */ React206.createElement(IconChevronRight9, { size: 18 })))));
|
|
19339
19357
|
};
|
|
19340
19358
|
|
|
19341
19359
|
// src/mantine/blocks/domainCardViewer/DomainCardViewerBlock.tsx
|
|
@@ -19388,7 +19406,7 @@ import React215 from "react";
|
|
|
19388
19406
|
|
|
19389
19407
|
// src/mantine/blocks/governanceGroup/template/TemplateView.tsx
|
|
19390
19408
|
import React212, { useMemo as useMemo67 } from "react";
|
|
19391
|
-
import { Badge as Badge35, Group as
|
|
19409
|
+
import { Badge as Badge35, Group as Group69, Stack as Stack137, Text as Text113 } from "@mantine/core";
|
|
19392
19410
|
|
|
19393
19411
|
// src/mantine/blocks/governanceGroup/template/TemplateConfig.tsx
|
|
19394
19412
|
import React211, { useCallback as useCallback56 } from "react";
|
|
@@ -19502,7 +19520,7 @@ var GeneralTab15 = ({ title, description, icon, groupType, onTitleChange, onDesc
|
|
|
19502
19520
|
|
|
19503
19521
|
// src/mantine/blocks/governanceGroup/template/AfterCreateTab.tsx
|
|
19504
19522
|
import React210, { useCallback as useCallback55, useMemo as useMemo66 } from "react";
|
|
19505
|
-
import { Stack as Stack136, Text as Text112, Alert as Alert28, Card as Card18, Group as
|
|
19523
|
+
import { Stack as Stack136, Text as Text112, Alert as Alert28, Card as Card18, Group as Group68, ActionIcon as ActionIcon31, Badge as Badge34, Switch as Switch6, Select as Select5 } from "@mantine/core";
|
|
19506
19524
|
import { IconPlus as IconPlus5, IconTrash as IconTrash6, IconLink } from "@tabler/icons-react";
|
|
19507
19525
|
function parseAfterCreateConfig(configString) {
|
|
19508
19526
|
if (!configString) {
|
|
@@ -19586,7 +19604,7 @@ var AfterCreateTab = ({ editor, block, afterCreate, onAfterCreateChange }) => {
|
|
|
19586
19604
|
return /* @__PURE__ */ React210.createElement(BaseSection, null, /* @__PURE__ */ React210.createElement(Stack136, { gap: "md" }, /* @__PURE__ */ React210.createElement(Text112, { size: "sm", c: "dimmed" }, "Configure actions to execute after the governance group is successfully created. The group's core address will be added as a linked entity to the target domain."), /* @__PURE__ */ React210.createElement(Stack136, { gap: "sm" }, config.actions.map((action) => {
|
|
19587
19605
|
const targetBlock = availableTargetBlocks.find((b) => b.id === action.targetBlockId);
|
|
19588
19606
|
const isTargetMissing = !targetBlock;
|
|
19589
|
-
return /* @__PURE__ */ React210.createElement(Card18, { key: action.id, withBorder: true, padding: "sm", radius: "md" }, /* @__PURE__ */ React210.createElement(Stack136, { gap: "xs" }, /* @__PURE__ */ React210.createElement(
|
|
19607
|
+
return /* @__PURE__ */ React210.createElement(Card18, { key: action.id, withBorder: true, padding: "sm", radius: "md" }, /* @__PURE__ */ React210.createElement(Stack136, { gap: "xs" }, /* @__PURE__ */ React210.createElement(Group68, { justify: "space-between", align: "center" }, /* @__PURE__ */ React210.createElement(Group68, { gap: "xs" }, /* @__PURE__ */ React210.createElement(IconLink, { size: 16 }), /* @__PURE__ */ React210.createElement(Text112, { size: "sm", fw: 500 }, "Add as Linked Entity"), /* @__PURE__ */ React210.createElement(Badge34, { size: "xs", variant: "light", color: "blue" }, "Governance Group")), /* @__PURE__ */ React210.createElement(Group68, { gap: "xs" }, /* @__PURE__ */ React210.createElement(Switch6, { size: "xs", checked: action.enabled, onChange: (e) => handleUpdateAction(action.id, { enabled: e.currentTarget.checked }) }), /* @__PURE__ */ React210.createElement(ActionIcon31, { variant: "subtle", color: "red", size: "sm", onClick: () => handleRemoveAction(action.id) }, /* @__PURE__ */ React210.createElement(IconTrash6, { size: 14 })))), isTargetMissing && /* @__PURE__ */ React210.createElement(Alert28, { color: "orange", variant: "light", title: "Target block not found", p: "xs" }, /* @__PURE__ */ React210.createElement(Text112, { size: "xs" }, "The configured target block no longer exists. Please select a new target.")), /* @__PURE__ */ React210.createElement(
|
|
19590
19608
|
Select5,
|
|
19591
19609
|
{
|
|
19592
19610
|
label: "Target Block",
|
|
@@ -20399,17 +20417,17 @@ var GovernanceGroupTemplateView = ({ editor, block }) => {
|
|
|
20399
20417
|
const panelId = `${GOVERNANCE_GROUP_TEMPLATE_PANEL_ID}-${block.id}`;
|
|
20400
20418
|
const panelContent = useMemo67(() => /* @__PURE__ */ React212.createElement(TemplateConfig15, { editor, block }), [editor, block]);
|
|
20401
20419
|
const { open } = usePanel(panelId, panelContent);
|
|
20402
|
-
return /* @__PURE__ */ React212.createElement(BaseContainer, { onClick: open }, /* @__PURE__ */ React212.createElement(Badge35, { size: "xs", variant: "light", color: "gray", style: { position: "absolute", top: 8, right: 8 } }, "Template"), /* @__PURE__ */ React212.createElement(
|
|
20420
|
+
return /* @__PURE__ */ React212.createElement(BaseContainer, { onClick: open }, /* @__PURE__ */ React212.createElement(Badge35, { size: "xs", variant: "light", color: "gray", style: { position: "absolute", top: 8, right: 8 } }, "Template"), /* @__PURE__ */ React212.createElement(Group69, { wrap: "nowrap", justify: "space-between", align: "center" }, /* @__PURE__ */ React212.createElement(Group69, { wrap: "nowrap", align: "center" }, getIcon("users", block.props.icon), /* @__PURE__ */ React212.createElement(Stack137, { gap: "xs", style: { flex: 1 } }, /* @__PURE__ */ React212.createElement(Text113, { fw: 500, size: "sm", contentEditable: false }, block.props.title || "Governance Group"), /* @__PURE__ */ React212.createElement(Text113, { size: "xs", c: "dimmed", contentEditable: false }, block.props.description || "Configure the governance group creation flow")))));
|
|
20403
20421
|
};
|
|
20404
20422
|
|
|
20405
20423
|
// src/mantine/blocks/governanceGroup/flow/FlowView.tsx
|
|
20406
20424
|
import React214, { useCallback as useCallback58, useMemo as useMemo69, useState as useState74 } from "react";
|
|
20407
|
-
import { ActionIcon as ActionIcon32, Badge as Badge36, Group as
|
|
20425
|
+
import { ActionIcon as ActionIcon32, Badge as Badge36, Group as Group71, Stack as Stack139, Text as Text115, Tooltip as Tooltip23 } from "@mantine/core";
|
|
20408
20426
|
import { IconChevronRight as IconChevronRight10 } from "@tabler/icons-react";
|
|
20409
20427
|
|
|
20410
20428
|
// src/mantine/blocks/governanceGroup/flow/GovernanceGroupPanel.tsx
|
|
20411
20429
|
import React213, { useCallback as useCallback57, useEffect as useEffect54, useMemo as useMemo68, useRef as useRef11, useState as useState73 } from "react";
|
|
20412
|
-
import { Alert as Alert29, Button as
|
|
20430
|
+
import { Alert as Alert29, Button as Button36, Card as Card19, Group as Group70, Loader as Loader26, SimpleGrid as SimpleGrid3, Stack as Stack138, Text as Text114, ThemeIcon as ThemeIcon4 } from "@mantine/core";
|
|
20413
20431
|
import { useDebouncedCallback as useDebouncedCallback3 } from "@mantine/hooks";
|
|
20414
20432
|
import { IconAlertCircle as IconAlertCircle14, IconCheck as IconCheck11, IconUsers as IconUsers5, IconSignature as IconSignature2, IconPhoto as IconPhoto3, IconCoin as IconCoin2, IconArrowLeft as IconArrowLeft5 } from "@tabler/icons-react";
|
|
20415
20433
|
import { Survey as Survey7, SurveyModel as SurveyModel7 } from "@ixo/surveys";
|
|
@@ -20708,10 +20726,10 @@ var GovernanceGroupPanel = ({ editor, block, onComplete }) => {
|
|
|
20708
20726
|
}
|
|
20709
20727
|
if (flowStep === "success") {
|
|
20710
20728
|
const groupTypeName = selectedGroupType ? GROUP_TYPE_CONFIGS.find((c) => c.type === selectedGroupType)?.title || "Group" : "Group";
|
|
20711
|
-
return /* @__PURE__ */ React213.createElement(Stack138, { gap: "md", p: "md" }, /* @__PURE__ */ React213.createElement(Alert29, { icon: /* @__PURE__ */ React213.createElement(IconCheck11, { size: 16 }), title: "Group Created Successfully", color: "green" }, /* @__PURE__ */ React213.createElement(Stack138, { gap: "xs" }, /* @__PURE__ */ React213.createElement(Text114, { size: "sm" }, "Your ", groupTypeName, " has been created successfully."), createdCoreAddress && /* @__PURE__ */ React213.createElement(Text114, { size: "xs", c: "dimmed" }, "Core Address: ", createdCoreAddress), createdGroupAddress && /* @__PURE__ */ React213.createElement(Text114, { size: "xs", c: "dimmed" }, "Group Address: ", createdGroupAddress))), /* @__PURE__ */ React213.createElement(
|
|
20729
|
+
return /* @__PURE__ */ React213.createElement(Stack138, { gap: "md", p: "md" }, /* @__PURE__ */ React213.createElement(Alert29, { icon: /* @__PURE__ */ React213.createElement(IconCheck11, { size: 16 }), title: "Group Created Successfully", color: "green" }, /* @__PURE__ */ React213.createElement(Stack138, { gap: "xs" }, /* @__PURE__ */ React213.createElement(Text114, { size: "sm" }, "Your ", groupTypeName, " has been created successfully."), createdCoreAddress && /* @__PURE__ */ React213.createElement(Text114, { size: "xs", c: "dimmed" }, "Core Address: ", createdCoreAddress), createdGroupAddress && /* @__PURE__ */ React213.createElement(Text114, { size: "xs", c: "dimmed" }, "Group Address: ", createdGroupAddress))), /* @__PURE__ */ React213.createElement(Button36, { onClick: handleClose }, "Close"));
|
|
20712
20730
|
}
|
|
20713
20731
|
if (flowStep === "error") {
|
|
20714
|
-
return /* @__PURE__ */ React213.createElement(Stack138, { gap: "md", p: "md" }, /* @__PURE__ */ React213.createElement(Alert29, { icon: /* @__PURE__ */ React213.createElement(IconAlertCircle14, { size: 16 }), title: "Group Creation Failed", color: "red" }, /* @__PURE__ */ React213.createElement(Text114, { size: "sm" }, error || "An unexpected error occurred")), /* @__PURE__ */ React213.createElement(
|
|
20732
|
+
return /* @__PURE__ */ React213.createElement(Stack138, { gap: "md", p: "md" }, /* @__PURE__ */ React213.createElement(Alert29, { icon: /* @__PURE__ */ React213.createElement(IconAlertCircle14, { size: 16 }), title: "Group Creation Failed", color: "red" }, /* @__PURE__ */ React213.createElement(Text114, { size: "sm" }, error || "An unexpected error occurred")), /* @__PURE__ */ React213.createElement(Group70, null, /* @__PURE__ */ React213.createElement(Button36, { variant: "outline", onClick: handleRetry }, "Try Again"), /* @__PURE__ */ React213.createElement(Button36, { variant: "subtle", onClick: handleClose }, "Close")));
|
|
20715
20733
|
}
|
|
20716
20734
|
if (flowStep === "survey" && surveyModel) {
|
|
20717
20735
|
const groupTypeName = selectedGroupType ? GROUP_TYPE_CONFIGS.find((c) => c.type === selectedGroupType)?.title || "Group" : "Group";
|
|
@@ -20721,7 +20739,7 @@ var GovernanceGroupPanel = ({ editor, block, onComplete }) => {
|
|
|
20721
20739
|
{
|
|
20722
20740
|
title: `Create ${groupTypeName}`,
|
|
20723
20741
|
onClose: handleClose,
|
|
20724
|
-
captionContent: showChangeTypeButton ? /* @__PURE__ */ React213.createElement(
|
|
20742
|
+
captionContent: showChangeTypeButton ? /* @__PURE__ */ React213.createElement(Group70, { mb: "md", px: "xl" }, /* @__PURE__ */ React213.createElement(Button36, { variant: "subtle", size: "xs", leftSection: /* @__PURE__ */ React213.createElement(IconArrowLeft5, { size: 14 }), onClick: handleBackToTypeSelection }, "Change Type")) : void 0
|
|
20725
20743
|
},
|
|
20726
20744
|
/* @__PURE__ */ React213.createElement(Survey7, { model: surveyModel })
|
|
20727
20745
|
);
|
|
@@ -20782,7 +20800,7 @@ var GovernanceGroupFlowView = ({ editor, block }) => {
|
|
|
20782
20800
|
const groupTypeName = lastSubmission.groupType ? lastSubmission.groupType.charAt(0).toUpperCase() + lastSubmission.groupType.slice(1).replace(/([A-Z])/g, " $1") : "Group";
|
|
20783
20801
|
return `${groupTypeName} created: ${lastSubmission.coreAddress?.slice(0, 12)}...`;
|
|
20784
20802
|
};
|
|
20785
|
-
return /* @__PURE__ */ React214.createElement(BaseContainer, { onClick: handleOpen }, /* @__PURE__ */ React214.createElement(
|
|
20803
|
+
return /* @__PURE__ */ React214.createElement(BaseContainer, { onClick: handleOpen }, /* @__PURE__ */ React214.createElement(Group71, { wrap: "nowrap", justify: "space-between", align: "center" }, /* @__PURE__ */ React214.createElement(Group71, { wrap: "nowrap", align: "center", style: { flex: 1 } }, getIcon("users", block.props.icon), /* @__PURE__ */ React214.createElement(Stack139, { gap: 4, style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ React214.createElement(Group71, { gap: "xs", align: "center" }, /* @__PURE__ */ React214.createElement(Text115, { fw: 600, size: "sm", contentEditable: false }, block.props.title || "Governance Group"), /* @__PURE__ */ React214.createElement(Badge36, { size: "xs", variant: "filled", color: badgeProps.color, styles: { root: { backgroundColor: `var(--mantine-color-${badgeProps.color}-6)`, color: "white" } } }, badgeProps.text)), /* @__PURE__ */ React214.createElement(Text115, { size: "xs", c: "dimmed", contentEditable: false, lineClamp: 2 }, hasExistingSubmission ? getSubmissionDisplay() : block.props.description || "Open the panel to create a new governance group."))), /* @__PURE__ */ React214.createElement(Tooltip23, { label: hasExistingSubmission ? "View/Edit group" : "Create group", withArrow: true }, /* @__PURE__ */ React214.createElement(ActionIcon32, { variant: "subtle", color: "blue" }, /* @__PURE__ */ React214.createElement(IconChevronRight10, { size: 18 })))));
|
|
20786
20804
|
};
|
|
20787
20805
|
|
|
20788
20806
|
// src/mantine/blocks/governanceGroup/GovernanceGroupBlock.tsx
|
|
@@ -20821,6 +20839,359 @@ var GovernanceGroupBlockSpec = createReactBlockSpec19(
|
|
|
20821
20839
|
}
|
|
20822
20840
|
);
|
|
20823
20841
|
|
|
20842
|
+
// src/mantine/blocks/flowLink/FlowLinkBlockSpec.tsx
|
|
20843
|
+
import React224 from "react";
|
|
20844
|
+
import { createReactBlockSpec as createReactBlockSpec20 } from "@blocknote/react";
|
|
20845
|
+
|
|
20846
|
+
// src/mantine/blocks/flowLink/FlowLinkBlock.tsx
|
|
20847
|
+
import React223 from "react";
|
|
20848
|
+
|
|
20849
|
+
// src/mantine/blocks/flowLink/template/TemplateView.tsx
|
|
20850
|
+
import React220, { useMemo as useMemo71 } from "react";
|
|
20851
|
+
import { Group as Group73, Stack as Stack142, Text as Text117 } from "@mantine/core";
|
|
20852
|
+
|
|
20853
|
+
// src/mantine/blocks/flowLink/template/TemplateConfig.tsx
|
|
20854
|
+
import React219 from "react";
|
|
20855
|
+
|
|
20856
|
+
// src/mantine/blocks/flowLink/template/GeneralTab.tsx
|
|
20857
|
+
import React217 from "react";
|
|
20858
|
+
import { Stack as Stack140 } from "@mantine/core";
|
|
20859
|
+
var GeneralTab16 = ({ title, description, icon, onTitleChange, onDescriptionChange, onIconChange }) => {
|
|
20860
|
+
const iconOptions = Object.keys(ICON_MAP).map((key) => ({
|
|
20861
|
+
value: key,
|
|
20862
|
+
label: key.split("-").map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join(" ")
|
|
20863
|
+
}));
|
|
20864
|
+
return /* @__PURE__ */ React217.createElement(Stack140, { gap: "md" }, /* @__PURE__ */ React217.createElement(BaseTextInput, { label: "Title", placeholder: "Enter block title", value: title, onChange: (e) => onTitleChange(e.currentTarget.value) }), /* @__PURE__ */ React217.createElement(
|
|
20865
|
+
BaseTextArea,
|
|
20866
|
+
{
|
|
20867
|
+
label: "Description",
|
|
20868
|
+
placeholder: "Enter description (shown in panel)",
|
|
20869
|
+
value: description,
|
|
20870
|
+
onChange: (e) => onDescriptionChange(e.currentTarget.value),
|
|
20871
|
+
minRows: 3
|
|
20872
|
+
}
|
|
20873
|
+
), /* @__PURE__ */ React217.createElement(
|
|
20874
|
+
BaseSelect,
|
|
20875
|
+
{
|
|
20876
|
+
label: "Icon",
|
|
20877
|
+
placeholder: "Select an icon",
|
|
20878
|
+
value: icon || "external-link",
|
|
20879
|
+
onChange: (value) => onIconChange(value || "external-link"),
|
|
20880
|
+
data: iconOptions,
|
|
20881
|
+
searchable: true
|
|
20882
|
+
}
|
|
20883
|
+
));
|
|
20884
|
+
};
|
|
20885
|
+
|
|
20886
|
+
// src/mantine/blocks/flowLink/template/LinksTab.tsx
|
|
20887
|
+
import React218, { useMemo as useMemo70 } from "react";
|
|
20888
|
+
import { Stack as Stack141, Card as Card20, Group as Group72, ActionIcon as ActionIcon33, Text as Text116, Divider as Divider16 } from "@mantine/core";
|
|
20889
|
+
import { IconPlus as IconPlus6, IconTrash as IconTrash7, IconGripVertical } from "@tabler/icons-react";
|
|
20890
|
+
import { DndContext, PointerSensor, useSensor, useSensors, closestCenter, useDraggable, useDroppable } from "@dnd-kit/core";
|
|
20891
|
+
|
|
20892
|
+
// src/core/utils/json.ts
|
|
20893
|
+
function safeParseJSONArray(jsonString) {
|
|
20894
|
+
if (!jsonString || jsonString === "[]") {
|
|
20895
|
+
return [];
|
|
20896
|
+
}
|
|
20897
|
+
try {
|
|
20898
|
+
const parsed = JSON.parse(jsonString);
|
|
20899
|
+
return Array.isArray(parsed) ? parsed : [];
|
|
20900
|
+
} catch {
|
|
20901
|
+
return [];
|
|
20902
|
+
}
|
|
20903
|
+
}
|
|
20904
|
+
function generateId(prefix) {
|
|
20905
|
+
return `${prefix}_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 10)}`;
|
|
20906
|
+
}
|
|
20907
|
+
|
|
20908
|
+
// src/mantine/blocks/flowLink/template/LinksTab.tsx
|
|
20909
|
+
var DraggableLinkCard = ({ link, index, onRemove, onUpdate }) => {
|
|
20910
|
+
const { attributes, listeners, setNodeRef: setDragRef, transform, isDragging } = useDraggable({ id: link.id });
|
|
20911
|
+
const { setNodeRef: setDropRef, isOver } = useDroppable({ id: link.id });
|
|
20912
|
+
const style = {
|
|
20913
|
+
transform: transform ? `translate3d(${transform.x}px, ${transform.y}px, 0)` : void 0,
|
|
20914
|
+
opacity: isDragging ? 0.5 : 1,
|
|
20915
|
+
border: isOver ? "2px dashed var(--mantine-color-accent-5)" : void 0
|
|
20916
|
+
};
|
|
20917
|
+
return /* @__PURE__ */ React218.createElement("div", { ref: setDropRef }, /* @__PURE__ */ React218.createElement(Card20, { p: "sm", style }, /* @__PURE__ */ React218.createElement(Stack141, { gap: "xs" }, /* @__PURE__ */ React218.createElement(Group72, { justify: "space-between", align: "flex-start" }, /* @__PURE__ */ React218.createElement(Group72, { gap: "xs", align: "center" }, /* @__PURE__ */ React218.createElement("div", { ref: setDragRef, ...listeners, ...attributes, style: { cursor: "grab", display: "flex", alignItems: "center" } }, /* @__PURE__ */ React218.createElement(IconGripVertical, { size: 16, color: "gray" })), /* @__PURE__ */ React218.createElement(Text116, { size: "xs", c: "dimmed" }, link.title || `Link ${index + 1}`)), /* @__PURE__ */ React218.createElement(ActionIcon33, { variant: "subtle", color: "red", size: "sm", onClick: () => onRemove(link.id) }, /* @__PURE__ */ React218.createElement(IconTrash7, { size: 14 }))), /* @__PURE__ */ React218.createElement(Divider16, null), /* @__PURE__ */ React218.createElement(BaseTextInput, { label: "Title", placeholder: "Link title", value: link.title, onChange: (e) => onUpdate(link.id, "title", e.currentTarget.value) }), /* @__PURE__ */ React218.createElement(
|
|
20918
|
+
BaseTextInput,
|
|
20919
|
+
{
|
|
20920
|
+
label: "Description",
|
|
20921
|
+
placeholder: "Optional text to place above the link title",
|
|
20922
|
+
value: link.description,
|
|
20923
|
+
onChange: (e) => onUpdate(link.id, "description", e.currentTarget.value)
|
|
20924
|
+
}
|
|
20925
|
+
), /* @__PURE__ */ React218.createElement(
|
|
20926
|
+
BaseTextInput,
|
|
20927
|
+
{
|
|
20928
|
+
label: "Document Room ID",
|
|
20929
|
+
placeholder: "!roomId:matrix.server",
|
|
20930
|
+
value: link.docRoomId,
|
|
20931
|
+
onChange: (e) => onUpdate(link.id, "docRoomId", e.currentTarget.value),
|
|
20932
|
+
description: "Matrix room ID of the target flow document"
|
|
20933
|
+
}
|
|
20934
|
+
), /* @__PURE__ */ React218.createElement(
|
|
20935
|
+
BaseTextArea,
|
|
20936
|
+
{
|
|
20937
|
+
label: "Caption",
|
|
20938
|
+
placeholder: "Optional text to place below the link title",
|
|
20939
|
+
minRows: 2,
|
|
20940
|
+
value: link.captionText,
|
|
20941
|
+
onChange: (e) => onUpdate(link.id, "captionText", e.currentTarget.value)
|
|
20942
|
+
}
|
|
20943
|
+
))));
|
|
20944
|
+
};
|
|
20945
|
+
var LinksTab = ({ links, onLinksChange }) => {
|
|
20946
|
+
const sensors = useSensors(useSensor(PointerSensor, { activationConstraint: { distance: 8 } }));
|
|
20947
|
+
const sortedLinks = useMemo70(() => [...links].sort((a, b) => a.position - b.position), [links]);
|
|
20948
|
+
const handleAddLink = () => {
|
|
20949
|
+
const maxPosition = links.length > 0 ? Math.max(...links.map((l) => l.position)) : -1;
|
|
20950
|
+
const newLink = {
|
|
20951
|
+
id: generateId("link"),
|
|
20952
|
+
docRoomId: "",
|
|
20953
|
+
title: "",
|
|
20954
|
+
captionText: "",
|
|
20955
|
+
description: "",
|
|
20956
|
+
position: maxPosition + 1
|
|
20957
|
+
};
|
|
20958
|
+
onLinksChange([...links, newLink]);
|
|
20959
|
+
};
|
|
20960
|
+
const handleRemoveLink = (id) => {
|
|
20961
|
+
const filtered = links.filter((link) => link.id !== id);
|
|
20962
|
+
const reordered = filtered.map((link, idx) => ({ ...link, position: idx }));
|
|
20963
|
+
onLinksChange(reordered);
|
|
20964
|
+
};
|
|
20965
|
+
const handleUpdateLink = (id, field, value) => {
|
|
20966
|
+
onLinksChange(links.map((link) => link.id === id ? { ...link, [field]: value } : link));
|
|
20967
|
+
};
|
|
20968
|
+
const handleDragEnd = (event) => {
|
|
20969
|
+
const { active, over } = event;
|
|
20970
|
+
if (!over || active.id === over.id) return;
|
|
20971
|
+
const activeLink = links.find((l) => l.id === active.id);
|
|
20972
|
+
const overLink = links.find((l) => l.id === over.id);
|
|
20973
|
+
if (!activeLink || !overLink) return;
|
|
20974
|
+
const oldIndex = sortedLinks.findIndex((l) => l.id === active.id);
|
|
20975
|
+
const newIndex = sortedLinks.findIndex((l) => l.id === over.id);
|
|
20976
|
+
const reordered = [...sortedLinks];
|
|
20977
|
+
const [moved] = reordered.splice(oldIndex, 1);
|
|
20978
|
+
reordered.splice(newIndex, 0, moved);
|
|
20979
|
+
const updated = reordered.map((link, idx) => ({ ...link, position: idx }));
|
|
20980
|
+
onLinksChange(updated);
|
|
20981
|
+
};
|
|
20982
|
+
return /* @__PURE__ */ React218.createElement(Stack141, { gap: "md" }, /* @__PURE__ */ React218.createElement(Group72, { justify: "space-between", align: "center" }, /* @__PURE__ */ React218.createElement(Text116, { size: "sm", fw: 500 }, "Flow Links"), /* @__PURE__ */ React218.createElement(BaseButton, { leftSection: /* @__PURE__ */ React218.createElement(IconPlus6, { size: 16 }), size: "xs", onClick: handleAddLink }, "Add Link")), links.length === 0 ? /* @__PURE__ */ React218.createElement(BaseContainer, null, /* @__PURE__ */ React218.createElement(Text116, { size: "sm", c: "dimmed", ta: "center" }, 'No links configured. Click "Add Link" to create a link to another flow.')) : /* @__PURE__ */ React218.createElement(DndContext, { sensors, collisionDetection: closestCenter, onDragEnd: handleDragEnd }, /* @__PURE__ */ React218.createElement(Stack141, { gap: "sm" }, sortedLinks.map((link, index) => /* @__PURE__ */ React218.createElement(DraggableLinkCard, { key: link.id, link, index, onRemove: handleRemoveLink, onUpdate: handleUpdateLink })))));
|
|
20983
|
+
};
|
|
20984
|
+
|
|
20985
|
+
// src/mantine/blocks/flowLink/template/TemplateConfig.tsx
|
|
20986
|
+
var TemplateConfig16 = ({ editor, block }) => {
|
|
20987
|
+
const { closePanel } = usePanelStore();
|
|
20988
|
+
const updateProp = (key, value) => {
|
|
20989
|
+
editor.updateBlock(block, { props: { ...block.props, [key]: value } });
|
|
20990
|
+
};
|
|
20991
|
+
const links = safeParseJSONArray(block.props.links);
|
|
20992
|
+
const handleLinksChange = (newLinks) => {
|
|
20993
|
+
updateProp("links", JSON.stringify(newLinks));
|
|
20994
|
+
};
|
|
20995
|
+
return /* @__PURE__ */ React219.createElement(BaseRightPanelLayout, { title: "Flow Link Settings", onClose: closePanel }, /* @__PURE__ */ React219.createElement(
|
|
20996
|
+
ReusablePanel,
|
|
20997
|
+
{
|
|
20998
|
+
extraTabs: [
|
|
20999
|
+
{
|
|
21000
|
+
label: "General",
|
|
21001
|
+
value: "general",
|
|
21002
|
+
content: /* @__PURE__ */ React219.createElement(
|
|
21003
|
+
GeneralTab16,
|
|
21004
|
+
{
|
|
21005
|
+
title: block.props.title || "",
|
|
21006
|
+
description: block.props.description || "",
|
|
21007
|
+
icon: block.props.icon || "external-link",
|
|
21008
|
+
onTitleChange: (value) => updateProp("title", value),
|
|
21009
|
+
onDescriptionChange: (value) => updateProp("description", value),
|
|
21010
|
+
onIconChange: (value) => updateProp("icon", value)
|
|
21011
|
+
}
|
|
21012
|
+
)
|
|
21013
|
+
},
|
|
21014
|
+
{
|
|
21015
|
+
label: "Links",
|
|
21016
|
+
value: "links",
|
|
21017
|
+
content: /* @__PURE__ */ React219.createElement(LinksTab, { links, onLinksChange: handleLinksChange })
|
|
21018
|
+
}
|
|
21019
|
+
],
|
|
21020
|
+
context: { editor, block }
|
|
21021
|
+
}
|
|
21022
|
+
));
|
|
21023
|
+
};
|
|
21024
|
+
|
|
21025
|
+
// src/mantine/blocks/flowLink/template/TemplateView.tsx
|
|
21026
|
+
var FLOW_LINK_TEMPLATE_PANEL_ID = "flow-link-template-panel";
|
|
21027
|
+
var FlowLinkTemplateView = ({ editor, block }) => {
|
|
21028
|
+
const panelId = `${FLOW_LINK_TEMPLATE_PANEL_ID}-${block.id}`;
|
|
21029
|
+
const panelContent = useMemo71(() => /* @__PURE__ */ React220.createElement(TemplateConfig16, { editor, block }), [editor, block]);
|
|
21030
|
+
const { open } = usePanel(panelId, panelContent);
|
|
21031
|
+
const links = safeParseJSONArray(block.props.links);
|
|
21032
|
+
const linksCount = links.length;
|
|
21033
|
+
return /* @__PURE__ */ React220.createElement(BaseContainer, { onClick: open }, /* @__PURE__ */ React220.createElement(Group73, { wrap: "nowrap", justify: "space-between", align: "center" }, /* @__PURE__ */ React220.createElement(Group73, { wrap: "nowrap", align: "center" }, getIcon("external-link", block.props.icon), /* @__PURE__ */ React220.createElement(Stack142, { gap: "xs", style: { flex: 1 } }, /* @__PURE__ */ React220.createElement(Text117, { fw: 500, size: "sm", contentEditable: false }, block.props.title || "Flow Link"), /* @__PURE__ */ React220.createElement(Text117, { size: "xs", c: "dimmed", contentEditable: false }, block.props.description || (linksCount > 0 ? `${linksCount} link${linksCount !== 1 ? "s" : ""} configured` : "Click to configure links to other flows"))))));
|
|
21034
|
+
};
|
|
21035
|
+
|
|
21036
|
+
// src/mantine/blocks/flowLink/flow/FlowView.tsx
|
|
21037
|
+
import React222, { useMemo as useMemo72 } from "react";
|
|
21038
|
+
import { Badge as Badge38, Group as Group75, Stack as Stack144, Text as Text119, Tooltip as Tooltip25 } from "@mantine/core";
|
|
21039
|
+
|
|
21040
|
+
// src/mantine/blocks/flowLink/flow/FlowLinkPanel.tsx
|
|
21041
|
+
import React221, { useState as useState75, useEffect as useEffect55, useCallback as useCallback59 } from "react";
|
|
21042
|
+
import { Stack as Stack143, Text as Text118, Card as Card21, Group as Group74, Badge as Badge37, ActionIcon as ActionIcon34, Loader as Loader27, Tooltip as Tooltip24 } from "@mantine/core";
|
|
21043
|
+
import { IconRefresh as IconRefresh8, IconCheck as IconCheck12, IconClock as IconClock3, IconCircleDashed as IconCircleDashed4 } from "@tabler/icons-react";
|
|
21044
|
+
var FlowLinkPanel = ({ block }) => {
|
|
21045
|
+
const { closePanel } = usePanelStore();
|
|
21046
|
+
const handlers = useBlocknoteHandlers();
|
|
21047
|
+
const links = safeParseJSONArray(block.props.links).sort((a, b) => a.position - b.position);
|
|
21048
|
+
const [linksWithStatus, setLinksWithStatus] = useState75(links.map((link) => ({ ...link })));
|
|
21049
|
+
const fetchStatuses = useCallback59(async () => {
|
|
21050
|
+
if (!handlers.getFlowStatus) {
|
|
21051
|
+
return;
|
|
21052
|
+
}
|
|
21053
|
+
setLinksWithStatus((prev) => prev.map((link) => ({ ...link, isLoading: true, error: void 0 })));
|
|
21054
|
+
const updatedLinks = await Promise.all(
|
|
21055
|
+
links.map(async (link) => {
|
|
21056
|
+
try {
|
|
21057
|
+
const statusData = await handlers.getFlowStatus(link.docRoomId);
|
|
21058
|
+
return { ...link, statusData, isLoading: false };
|
|
21059
|
+
} catch (err) {
|
|
21060
|
+
return { ...link, isLoading: false, error: err instanceof Error ? err.message : "Failed to fetch status" };
|
|
21061
|
+
}
|
|
21062
|
+
})
|
|
21063
|
+
);
|
|
21064
|
+
setLinksWithStatus(updatedLinks);
|
|
21065
|
+
}, [handlers, links]);
|
|
21066
|
+
useEffect55(() => {
|
|
21067
|
+
fetchStatuses();
|
|
21068
|
+
}, []);
|
|
21069
|
+
const handleNavigate = (docRoomId) => {
|
|
21070
|
+
if (handlers.navigateToFlow) {
|
|
21071
|
+
handlers.navigateToFlow(docRoomId);
|
|
21072
|
+
}
|
|
21073
|
+
};
|
|
21074
|
+
const getStatusBadge = (link) => {
|
|
21075
|
+
if (link.isLoading) {
|
|
21076
|
+
return /* @__PURE__ */ React221.createElement(Badge37, { display: "inline-block", size: "sm", variant: "light", color: "gray", leftSection: /* @__PURE__ */ React221.createElement(Loader27, { size: 10 }) }, "Loading");
|
|
21077
|
+
}
|
|
21078
|
+
if (link.error) {
|
|
21079
|
+
return /* @__PURE__ */ React221.createElement(Tooltip24, { label: link.error }, /* @__PURE__ */ React221.createElement(Badge37, { display: "inline-block", size: "sm", variant: "light", color: "red" }, "Error"));
|
|
21080
|
+
}
|
|
21081
|
+
if (!link.statusData) {
|
|
21082
|
+
return null;
|
|
21083
|
+
}
|
|
21084
|
+
const status = link.statusData.status;
|
|
21085
|
+
switch (status) {
|
|
21086
|
+
case "completed":
|
|
21087
|
+
return /* @__PURE__ */ React221.createElement(Badge37, { display: "inline-block", size: "sm", variant: "light", color: "green", leftSection: /* @__PURE__ */ React221.createElement(IconCheck12, { size: 12 }) }, "Completed");
|
|
21088
|
+
case "in_progress":
|
|
21089
|
+
return /* @__PURE__ */ React221.createElement(Badge37, { display: "inline-block", size: "sm", variant: "light", color: "blue", leftSection: /* @__PURE__ */ React221.createElement(IconClock3, { size: 12 }) }, "In Progress");
|
|
21090
|
+
case "not_started":
|
|
21091
|
+
default:
|
|
21092
|
+
return /* @__PURE__ */ React221.createElement(Badge37, { display: "inline-block", size: "sm", variant: "light", color: "gray", leftSection: /* @__PURE__ */ React221.createElement(IconCircleDashed4, { size: 12 }) }, "Not Started");
|
|
21093
|
+
}
|
|
21094
|
+
};
|
|
21095
|
+
return /* @__PURE__ */ React221.createElement(BaseRightPanelLayout, { title: block.props.title || "Flow Links", onClose: closePanel }, /* @__PURE__ */ React221.createElement(Stack143, { gap: "md" }, handlers.getFlowStatus && /* @__PURE__ */ React221.createElement(Tooltip24, { label: "Refresh status" }, /* @__PURE__ */ React221.createElement(ActionIcon34, { variant: "subtle", size: "sm", onClick: fetchStatuses }, /* @__PURE__ */ React221.createElement(IconRefresh8, { size: 16 }))), linksWithStatus.length === 0 ? /* @__PURE__ */ React221.createElement(Card21, { withBorder: true, p: "md", bg: "gray.0" }, /* @__PURE__ */ React221.createElement(Text118, { size: "sm", c: "dimmed", ta: "center" }, "No flow links configured.")) : /* @__PURE__ */ React221.createElement(Stack143, { gap: "sm" }, linksWithStatus.map((link) => /* @__PURE__ */ React221.createElement(Stack143, { key: link.id }, link.description && /* @__PURE__ */ React221.createElement(Text118, null, link.description), /* @__PURE__ */ React221.createElement(
|
|
21096
|
+
BaseContainer,
|
|
21097
|
+
{
|
|
21098
|
+
onClick: () => handlers.navigateToFlow && handleNavigate(link.docRoomId),
|
|
21099
|
+
style: { opacity: !handlers.navigateToFlow ? 0.6 : 1, minHeight: 84, cursor: !handlers.navigateToFlow ? "not-allowed" : "pointer" }
|
|
21100
|
+
},
|
|
21101
|
+
/* @__PURE__ */ React221.createElement(Group74, { wrap: "nowrap", align: "center", style: { flex: 1 } }, getIcon("external-link", block.props.icon), /* @__PURE__ */ React221.createElement(Stack143, { gap: 4, style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ React221.createElement(Group74, { gap: "xs", align: "center" }, /* @__PURE__ */ React221.createElement(Text118, { size: "sm", fw: 600 }, link.title || "Untitled Flow"), getStatusBadge(link)), link.captionText && /* @__PURE__ */ React221.createElement(Text118, { size: "sm", c: "dimmed", lineClamp: 2 }, link.captionText)), link.statusData?.completedAt && /* @__PURE__ */ React221.createElement(Text118, { size: "sm", c: "dimmed" }, "Completed: ", new Date(link.statusData.completedAt).toLocaleDateString()))
|
|
21102
|
+
))))));
|
|
21103
|
+
};
|
|
21104
|
+
|
|
21105
|
+
// src/mantine/blocks/flowLink/flow/FlowView.tsx
|
|
21106
|
+
var FLOW_LINK_FLOW_PANEL_ID = "flow-link-flow-panel";
|
|
21107
|
+
var FlowLinkFlowView = ({ editor, block, isDisabled }) => {
|
|
21108
|
+
const disabled = isDisabled?.isDisabled === "disable";
|
|
21109
|
+
const links = safeParseJSONArray(block.props.links);
|
|
21110
|
+
const linksCount = links.length;
|
|
21111
|
+
const panelId = `${FLOW_LINK_FLOW_PANEL_ID}-${block.id}`;
|
|
21112
|
+
const panelContent = useMemo72(() => /* @__PURE__ */ React222.createElement(FlowLinkPanel, { editor, block }), [editor, block]);
|
|
21113
|
+
const { open } = usePanel(panelId, panelContent);
|
|
21114
|
+
const handleClick = () => {
|
|
21115
|
+
if (!disabled) {
|
|
21116
|
+
open();
|
|
21117
|
+
}
|
|
21118
|
+
};
|
|
21119
|
+
const getBadgeProps = () => {
|
|
21120
|
+
if (linksCount === 0) {
|
|
21121
|
+
return { color: "neutralColor.5", text: "No links" };
|
|
21122
|
+
}
|
|
21123
|
+
return { color: "accent.5", text: `${linksCount} link${linksCount !== 1 ? "s" : ""}` };
|
|
21124
|
+
};
|
|
21125
|
+
const badgeProps = getBadgeProps();
|
|
21126
|
+
const cardContent = /* @__PURE__ */ React222.createElement(BaseContainer, { onClick: handleClick, style: { opacity: disabled ? 0.6 : 1, cursor: disabled ? "not-allowed" : "pointer" } }, /* @__PURE__ */ React222.createElement(Group75, { wrap: "nowrap", align: "center", style: { flex: 1 } }, getIcon("external-link", block.props.icon), /* @__PURE__ */ React222.createElement(Stack144, { gap: 4, style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ React222.createElement(Group75, { gap: "xs", align: "center" }, /* @__PURE__ */ React222.createElement(Text119, { fw: 600, size: "sm" }, block.props.title || "Flow Link"), /* @__PURE__ */ React222.createElement(Badge38, { size: "xs", variant: "light", bg: badgeProps.color }, badgeProps.text)), /* @__PURE__ */ React222.createElement(Text119, { size: "xs", c: "dimmed", lineClamp: 2 }, block.props.description || (linksCount > 0 ? "Click to view links" : "No links configured")))));
|
|
21127
|
+
if (disabled && isDisabled?.message) {
|
|
21128
|
+
return /* @__PURE__ */ React222.createElement(Tooltip25, { label: isDisabled.message }, cardContent);
|
|
21129
|
+
}
|
|
21130
|
+
return cardContent;
|
|
21131
|
+
};
|
|
21132
|
+
|
|
21133
|
+
// src/mantine/blocks/flowLink/FlowLinkBlock.tsx
|
|
21134
|
+
function FlowLinkBlock({ editor, block }) {
|
|
21135
|
+
const { docType } = useBlocknoteContext();
|
|
21136
|
+
const { actions } = useBlockConditions(block, editor);
|
|
21137
|
+
if (docType === "template") {
|
|
21138
|
+
return /* @__PURE__ */ React223.createElement(FlowLinkTemplateView, { editor, block });
|
|
21139
|
+
}
|
|
21140
|
+
const conditionConfig = parseConditionConfig(block.props.conditions);
|
|
21141
|
+
const hasVisibility = hasVisibilityConditions(conditionConfig);
|
|
21142
|
+
const showActionExists = actions.some((a) => a.action === "show");
|
|
21143
|
+
const shouldHide = hasVisibility && !showActionExists;
|
|
21144
|
+
if (shouldHide) {
|
|
21145
|
+
return null;
|
|
21146
|
+
}
|
|
21147
|
+
const hasEnable = hasEnableConditions(conditionConfig);
|
|
21148
|
+
const enableActionExists = actions.some((a) => a.action === "enable");
|
|
21149
|
+
const shouldDisable = hasEnable && !enableActionExists;
|
|
21150
|
+
return /* @__PURE__ */ React223.createElement(
|
|
21151
|
+
FlowLinkFlowView,
|
|
21152
|
+
{
|
|
21153
|
+
block,
|
|
21154
|
+
editor,
|
|
21155
|
+
isDisabled: shouldDisable ? {
|
|
21156
|
+
isDisabled: "disable",
|
|
21157
|
+
message: "This block is currently disabled by conditions"
|
|
21158
|
+
} : void 0
|
|
21159
|
+
}
|
|
21160
|
+
);
|
|
21161
|
+
}
|
|
21162
|
+
var FlowLinkBlock_default = FlowLinkBlock;
|
|
21163
|
+
|
|
21164
|
+
// src/mantine/blocks/flowLink/FlowLinkBlockSpec.tsx
|
|
21165
|
+
var FlowLinkBlockSpec = createReactBlockSpec20(
|
|
21166
|
+
{
|
|
21167
|
+
type: "flowLink",
|
|
21168
|
+
propSchema: {
|
|
21169
|
+
title: {
|
|
21170
|
+
default: ""
|
|
21171
|
+
},
|
|
21172
|
+
description: {
|
|
21173
|
+
default: ""
|
|
21174
|
+
},
|
|
21175
|
+
icon: {
|
|
21176
|
+
default: "external-link"
|
|
21177
|
+
},
|
|
21178
|
+
links: {
|
|
21179
|
+
default: "[]"
|
|
21180
|
+
},
|
|
21181
|
+
conditions: {
|
|
21182
|
+
default: ""
|
|
21183
|
+
}
|
|
21184
|
+
},
|
|
21185
|
+
content: "none"
|
|
21186
|
+
},
|
|
21187
|
+
{
|
|
21188
|
+
render: (props) => {
|
|
21189
|
+
const ixoProps = props;
|
|
21190
|
+
return /* @__PURE__ */ React224.createElement(FlowLinkBlock_default, { ...ixoProps });
|
|
21191
|
+
}
|
|
21192
|
+
}
|
|
21193
|
+
);
|
|
21194
|
+
|
|
20824
21195
|
// src/mantine/blocks/registry/blockRegistry.ts
|
|
20825
21196
|
var BlockRegistry = class {
|
|
20826
21197
|
constructor() {
|
|
@@ -20992,10 +21363,10 @@ blockRegistry.register({
|
|
|
20992
21363
|
});
|
|
20993
21364
|
|
|
20994
21365
|
// src/mantine/blocks/hooks/useBlockDependencies.ts
|
|
20995
|
-
import { useMemo as
|
|
21366
|
+
import { useMemo as useMemo73, useEffect as useEffect56, useState as useState76, useCallback as useCallback60 } from "react";
|
|
20996
21367
|
|
|
20997
21368
|
// src/mantine/blocks/hooks/useDependsOn.ts
|
|
20998
|
-
import { useMemo as
|
|
21369
|
+
import { useMemo as useMemo74 } from "react";
|
|
20999
21370
|
|
|
21000
21371
|
// src/mantine/blocks/index.ts
|
|
21001
21372
|
var blockSpecs = {
|
|
@@ -21017,7 +21388,8 @@ var blockSpecs = {
|
|
|
21017
21388
|
form: FormBlockSpec,
|
|
21018
21389
|
domainCreatorSign: DomainCreatorSignBlockSpec,
|
|
21019
21390
|
domainCardViewer: DomainCardViewerBlockSpec,
|
|
21020
|
-
governanceGroup: GovernanceGroupBlockSpec
|
|
21391
|
+
governanceGroup: GovernanceGroupBlockSpec,
|
|
21392
|
+
flowLink: FlowLinkBlockSpec
|
|
21021
21393
|
};
|
|
21022
21394
|
var getExtraSlashMenuItems = (editor) => {
|
|
21023
21395
|
const slashMenuList = [
|
|
@@ -21457,6 +21829,30 @@ var getExtraSlashMenuItems = (editor) => {
|
|
|
21457
21829
|
aliases: ["domain-card", "domain-viewer", "card-preview"],
|
|
21458
21830
|
group: "Domains",
|
|
21459
21831
|
subtext: "Preview domain card before signing"
|
|
21832
|
+
},
|
|
21833
|
+
{
|
|
21834
|
+
title: "Flow Link",
|
|
21835
|
+
onItemClick: () => {
|
|
21836
|
+
editor.insertBlocks(
|
|
21837
|
+
[
|
|
21838
|
+
{
|
|
21839
|
+
type: "flowLink",
|
|
21840
|
+
props: {
|
|
21841
|
+
title: "",
|
|
21842
|
+
description: "",
|
|
21843
|
+
icon: "external-link",
|
|
21844
|
+
links: "[]",
|
|
21845
|
+
conditions: ""
|
|
21846
|
+
}
|
|
21847
|
+
}
|
|
21848
|
+
],
|
|
21849
|
+
editor.getTextCursorPosition().block,
|
|
21850
|
+
"after"
|
|
21851
|
+
);
|
|
21852
|
+
},
|
|
21853
|
+
aliases: ["flow-link", "link", "navigate", "redirect"],
|
|
21854
|
+
group: "Flows",
|
|
21855
|
+
subtext: "Link to other flow documents"
|
|
21460
21856
|
}
|
|
21461
21857
|
];
|
|
21462
21858
|
const yRoot = editor?._yRoot;
|
|
@@ -21537,15 +21933,15 @@ import { useCreateBlockNote as useCreateBlockNote2 } from "@blocknote/react";
|
|
|
21537
21933
|
import { BlockNoteSchema as BlockNoteSchema2, defaultBlockSpecs as defaultBlockSpecs2, defaultInlineContentSpecs as defaultInlineContentSpecs2, defaultStyleSpecs as defaultStyleSpecs2 } from "@blocknote/core";
|
|
21538
21934
|
|
|
21539
21935
|
// src/core/hooks/useMatrixProvider.ts
|
|
21540
|
-
import { useEffect as
|
|
21936
|
+
import { useEffect as useEffect57, useState as useState77, useRef as useRef12, useCallback as useCallback61, useMemo as useMemo75 } from "react";
|
|
21541
21937
|
import { MatrixProvider } from "@ixo/matrix-crdt";
|
|
21542
21938
|
function useMatrixProvider({ matrixClient, roomId, yDoc }) {
|
|
21543
|
-
const [matrixProvider, setProvider] =
|
|
21544
|
-
const [status, setStatus] =
|
|
21939
|
+
const [matrixProvider, setProvider] = useState77(null);
|
|
21940
|
+
const [status, setStatus] = useState77("disconnected");
|
|
21545
21941
|
const isMountedRef = useRef12(true);
|
|
21546
21942
|
const providerRef = useRef12(null);
|
|
21547
21943
|
const retryTimeoutRef = useRef12(null);
|
|
21548
|
-
const providerOptions =
|
|
21944
|
+
const providerOptions = useMemo75(
|
|
21549
21945
|
() => ({
|
|
21550
21946
|
translator: {
|
|
21551
21947
|
updateEventType: "matrix-crdt.doc_update",
|
|
@@ -21558,22 +21954,22 @@ function useMatrixProvider({ matrixClient, roomId, yDoc }) {
|
|
|
21558
21954
|
}),
|
|
21559
21955
|
[]
|
|
21560
21956
|
);
|
|
21561
|
-
const handleDocumentAvailable =
|
|
21957
|
+
const handleDocumentAvailable = useCallback61(() => {
|
|
21562
21958
|
if (isMountedRef.current) {
|
|
21563
21959
|
setStatus("connected");
|
|
21564
21960
|
}
|
|
21565
21961
|
}, []);
|
|
21566
|
-
const handleDocumentUnavailable =
|
|
21962
|
+
const handleDocumentUnavailable = useCallback61(() => {
|
|
21567
21963
|
if (isMountedRef.current) {
|
|
21568
21964
|
setStatus("failed");
|
|
21569
21965
|
}
|
|
21570
21966
|
}, []);
|
|
21571
|
-
const handleCanWriteChanged =
|
|
21967
|
+
const handleCanWriteChanged = useCallback61(() => {
|
|
21572
21968
|
if (isMountedRef.current && providerRef.current) {
|
|
21573
21969
|
setStatus(providerRef.current.canWrite ? "connected" : "failed");
|
|
21574
21970
|
}
|
|
21575
21971
|
}, []);
|
|
21576
|
-
const initProvider =
|
|
21972
|
+
const initProvider = useCallback61(async () => {
|
|
21577
21973
|
if (!isMountedRef.current) return;
|
|
21578
21974
|
if (retryTimeoutRef.current) {
|
|
21579
21975
|
clearTimeout(retryTimeoutRef.current);
|
|
@@ -21606,7 +22002,7 @@ function useMatrixProvider({ matrixClient, roomId, yDoc }) {
|
|
|
21606
22002
|
}
|
|
21607
22003
|
}
|
|
21608
22004
|
}, [matrixClient, providerOptions, handleDocumentAvailable, handleDocumentUnavailable, handleCanWriteChanged]);
|
|
21609
|
-
|
|
22005
|
+
useEffect57(() => {
|
|
21610
22006
|
isMountedRef.current = true;
|
|
21611
22007
|
initProvider();
|
|
21612
22008
|
return () => {
|
|
@@ -21623,7 +22019,7 @@ function useMatrixProvider({ matrixClient, roomId, yDoc }) {
|
|
|
21623
22019
|
setStatus("disconnected");
|
|
21624
22020
|
};
|
|
21625
22021
|
}, [initProvider]);
|
|
21626
|
-
|
|
22022
|
+
useEffect57(() => {
|
|
21627
22023
|
return () => {
|
|
21628
22024
|
isMountedRef.current = false;
|
|
21629
22025
|
};
|
|
@@ -21632,17 +22028,17 @@ function useMatrixProvider({ matrixClient, roomId, yDoc }) {
|
|
|
21632
22028
|
}
|
|
21633
22029
|
|
|
21634
22030
|
// src/mantine/hooks/useCollaborativeYDoc.ts
|
|
21635
|
-
import { useMemo as
|
|
22031
|
+
import { useMemo as useMemo76 } from "react";
|
|
21636
22032
|
import * as Y from "yjs";
|
|
21637
22033
|
function useCollaborativeYDoc(_options) {
|
|
21638
|
-
return
|
|
22034
|
+
return useMemo76(() => {
|
|
21639
22035
|
const doc = new Y.Doc();
|
|
21640
22036
|
return doc;
|
|
21641
22037
|
}, []);
|
|
21642
22038
|
}
|
|
21643
22039
|
|
|
21644
22040
|
// src/mantine/hooks/useCollaborativeIxoEditor.ts
|
|
21645
|
-
import { useMemo as
|
|
22041
|
+
import { useMemo as useMemo77, useEffect as useEffect58, useState as useState78 } from "react";
|
|
21646
22042
|
|
|
21647
22043
|
// src/core/lib/matrixMetadata.ts
|
|
21648
22044
|
var COVER_IMAGE_EVENT_TYPE = "ixo.page.cover_image";
|
|
@@ -21811,7 +22207,7 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
21811
22207
|
matrixClient,
|
|
21812
22208
|
permissions = { write: false }
|
|
21813
22209
|
} = options || {};
|
|
21814
|
-
const memoizedUser =
|
|
22210
|
+
const memoizedUser = useMemo77(
|
|
21815
22211
|
() => ({
|
|
21816
22212
|
id: user?.id || "",
|
|
21817
22213
|
name: user?.name || "",
|
|
@@ -21826,13 +22222,13 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
21826
22222
|
matrixClient,
|
|
21827
22223
|
roomId: options.roomId
|
|
21828
22224
|
});
|
|
21829
|
-
const metadataManager =
|
|
21830
|
-
|
|
22225
|
+
const metadataManager = useMemo77(() => new MatrixMetadataManager(matrixClient, options.roomId), [matrixClient, options.roomId]);
|
|
22226
|
+
useEffect58(() => {
|
|
21831
22227
|
return () => {
|
|
21832
22228
|
metadataManager.dispose();
|
|
21833
22229
|
};
|
|
21834
22230
|
}, [metadataManager]);
|
|
21835
|
-
const defaultUploadFile =
|
|
22231
|
+
const defaultUploadFile = useMemo77(
|
|
21836
22232
|
() => uploadFile || (async (file) => {
|
|
21837
22233
|
return new Promise((resolve, reject) => {
|
|
21838
22234
|
const reader = new FileReader();
|
|
@@ -21846,7 +22242,7 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
21846
22242
|
}),
|
|
21847
22243
|
[uploadFile]
|
|
21848
22244
|
);
|
|
21849
|
-
const schema =
|
|
22245
|
+
const schema = useMemo77(
|
|
21850
22246
|
() => BlockNoteSchema2.create({
|
|
21851
22247
|
blockSpecs: {
|
|
21852
22248
|
...defaultBlockSpecs2,
|
|
@@ -21861,13 +22257,13 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
21861
22257
|
}),
|
|
21862
22258
|
[]
|
|
21863
22259
|
);
|
|
21864
|
-
const root =
|
|
21865
|
-
const documentFragment =
|
|
21866
|
-
const flowArray =
|
|
21867
|
-
const runtimeMap =
|
|
21868
|
-
const delegationsMap =
|
|
21869
|
-
const userFragment =
|
|
21870
|
-
const collaborationConfig =
|
|
22260
|
+
const root = useMemo77(() => yDoc.getMap("root"), [yDoc]);
|
|
22261
|
+
const documentFragment = useMemo77(() => yDoc.getXmlFragment("document"), [yDoc]);
|
|
22262
|
+
const flowArray = useMemo77(() => yDoc.getArray("flow"), [yDoc]);
|
|
22263
|
+
const runtimeMap = useMemo77(() => yDoc.getMap("runtime"), [yDoc]);
|
|
22264
|
+
const delegationsMap = useMemo77(() => yDoc.getMap("delegations"), [yDoc]);
|
|
22265
|
+
const userFragment = useMemo77(() => yDoc.getMap(memoizedUser.id), [yDoc, memoizedUser.id]);
|
|
22266
|
+
const collaborationConfig = useMemo77(
|
|
21871
22267
|
() => ({
|
|
21872
22268
|
provider: matrixProvider,
|
|
21873
22269
|
fragment: documentFragment,
|
|
@@ -21879,7 +22275,7 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
21879
22275
|
}),
|
|
21880
22276
|
[matrixProvider, documentFragment, memoizedUser.name, memoizedUser.color]
|
|
21881
22277
|
);
|
|
21882
|
-
const ixoConfig =
|
|
22278
|
+
const ixoConfig = useMemo77(
|
|
21883
22279
|
() => ({
|
|
21884
22280
|
theme,
|
|
21885
22281
|
editable,
|
|
@@ -21898,7 +22294,7 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
21898
22294
|
uploadFile: defaultUploadFile,
|
|
21899
22295
|
collaboration: collaborationConfig
|
|
21900
22296
|
});
|
|
21901
|
-
const titleText =
|
|
22297
|
+
const titleText = useMemo77(() => yDoc.getText("title"), [yDoc]);
|
|
21902
22298
|
let ixoEditor;
|
|
21903
22299
|
if (editor) {
|
|
21904
22300
|
ixoEditor = editor;
|
|
@@ -22054,12 +22450,12 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
22054
22450
|
return void 0;
|
|
22055
22451
|
};
|
|
22056
22452
|
}
|
|
22057
|
-
|
|
22453
|
+
useEffect58(() => {
|
|
22058
22454
|
if (ixoEditor) {
|
|
22059
22455
|
ixoEditor.isEditable = editable;
|
|
22060
22456
|
}
|
|
22061
22457
|
}, [ixoEditor, editable]);
|
|
22062
|
-
|
|
22458
|
+
useEffect58(() => {
|
|
22063
22459
|
if (connectionStatus !== "connected") {
|
|
22064
22460
|
return;
|
|
22065
22461
|
}
|
|
@@ -22081,9 +22477,9 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
22081
22477
|
titleText.insert(0, options.title);
|
|
22082
22478
|
}
|
|
22083
22479
|
}, [connectionStatus, root, titleText, permissions.write, options.docId, options.title, memoizedUser.id]);
|
|
22084
|
-
const [connectedUsers, setConnectedUsers] =
|
|
22480
|
+
const [connectedUsers, setConnectedUsers] = useState78([]);
|
|
22085
22481
|
const webrtcProvider = matrixProvider?.webrtcProvider;
|
|
22086
|
-
|
|
22482
|
+
useEffect58(() => {
|
|
22087
22483
|
if (!matrixProvider?.awarenessInstance || !webrtcProvider || connectionStatus !== "connected") {
|
|
22088
22484
|
return;
|
|
22089
22485
|
}
|
|
@@ -22102,7 +22498,7 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
22102
22498
|
awareness.off("change", updateUsers);
|
|
22103
22499
|
};
|
|
22104
22500
|
}, [matrixProvider, webrtcProvider, connectionStatus]);
|
|
22105
|
-
|
|
22501
|
+
useEffect58(() => {
|
|
22106
22502
|
if (!matrixProvider?.awarenessInstance || !webrtcProvider || connectionStatus !== "connected") {
|
|
22107
22503
|
return;
|
|
22108
22504
|
}
|
|
@@ -22140,16 +22536,16 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
22140
22536
|
}
|
|
22141
22537
|
|
|
22142
22538
|
// src/mantine/components/Base/BaseIconPicker.tsx
|
|
22143
|
-
import
|
|
22144
|
-
import { TextInput as TextInput7, Tabs as Tabs5, Box as
|
|
22539
|
+
import React226, { useState as useState79, useMemo as useMemo78, useEffect as useEffect59 } from "react";
|
|
22540
|
+
import { TextInput as TextInput7, Tabs as Tabs5, Box as Box41, Stack as Stack145, UnstyledButton as UnstyledButton2, Text as Text120, Center as Center12, ScrollArea as ScrollArea8, Group as Group76, Popover as Popover4 } from "@mantine/core";
|
|
22145
22541
|
import * as TablerIcons from "@tabler/icons-react";
|
|
22146
22542
|
import { IconSearch as IconSearch6, IconX as IconX10, IconChevronLeft, IconChevronRight as IconChevronRight11 } from "@tabler/icons-react";
|
|
22147
22543
|
|
|
22148
22544
|
// src/mantine/components/Base/CoverImageButton.tsx
|
|
22149
|
-
import
|
|
22150
|
-
import { Button as
|
|
22151
|
-
var CoverImageButton = forwardRef(({ isActive = false, onClick, children, style, ...props }, ref) => /* @__PURE__ */
|
|
22152
|
-
|
|
22545
|
+
import React225, { forwardRef } from "react";
|
|
22546
|
+
import { Button as Button37 } from "@mantine/core";
|
|
22547
|
+
var CoverImageButton = forwardRef(({ isActive = false, onClick, children, style, ...props }, ref) => /* @__PURE__ */ React225.createElement(
|
|
22548
|
+
Button37,
|
|
22153
22549
|
{
|
|
22154
22550
|
ref,
|
|
22155
22551
|
variant: "filled",
|
|
@@ -22198,28 +22594,28 @@ var localStorageService = {
|
|
|
22198
22594
|
var iconsKey = "editor_recent_icons";
|
|
22199
22595
|
var ICONS_PER_PAGE = 500;
|
|
22200
22596
|
function BaseIconPicker({ opened, onClose, onSelectIcon, onUploadClick, children, currentIcon }) {
|
|
22201
|
-
const [searchQuery, setSearchQuery] =
|
|
22202
|
-
const [activeTab, setActiveTab] =
|
|
22203
|
-
const [currentPage, setCurrentPage] =
|
|
22204
|
-
const allIcons =
|
|
22597
|
+
const [searchQuery, setSearchQuery] = useState79("");
|
|
22598
|
+
const [activeTab, setActiveTab] = useState79("icons");
|
|
22599
|
+
const [currentPage, setCurrentPage] = useState79(1);
|
|
22600
|
+
const allIcons = useMemo78(() => {
|
|
22205
22601
|
const iconEntries = Object.entries(TablerIcons).filter(([name]) => name.startsWith("Icon") && name !== "IconProps");
|
|
22206
22602
|
return iconEntries;
|
|
22207
22603
|
}, []);
|
|
22208
|
-
const filteredIcons =
|
|
22604
|
+
const filteredIcons = useMemo78(() => {
|
|
22209
22605
|
if (!searchQuery) return allIcons;
|
|
22210
22606
|
const query = searchQuery.toLowerCase();
|
|
22211
22607
|
return allIcons.filter(([name]) => name.toLowerCase().includes(query));
|
|
22212
22608
|
}, [allIcons, searchQuery]);
|
|
22213
|
-
|
|
22609
|
+
useEffect59(() => {
|
|
22214
22610
|
setCurrentPage(1);
|
|
22215
22611
|
}, [searchQuery]);
|
|
22216
|
-
const paginatedIcons =
|
|
22612
|
+
const paginatedIcons = useMemo78(() => {
|
|
22217
22613
|
const startIndex = (currentPage - 1) * ICONS_PER_PAGE;
|
|
22218
22614
|
const endIndex = startIndex + ICONS_PER_PAGE;
|
|
22219
22615
|
return filteredIcons.slice(startIndex, endIndex);
|
|
22220
22616
|
}, [filteredIcons, currentPage]);
|
|
22221
22617
|
const totalPages = Math.ceil(filteredIcons.length / ICONS_PER_PAGE);
|
|
22222
|
-
const recentIcons =
|
|
22618
|
+
const recentIcons = useMemo78(() => {
|
|
22223
22619
|
const recentIconNames = localStorageService.get(iconsKey);
|
|
22224
22620
|
if (!recentIconNames || recentIconNames.length === 0) return [];
|
|
22225
22621
|
return recentIconNames.slice(0, 24).map((iconName) => allIcons.find(([name]) => name === iconName)).filter((entry) => entry !== void 0);
|
|
@@ -22234,10 +22630,10 @@ function BaseIconPicker({ opened, onClose, onSelectIcon, onUploadClick, children
|
|
|
22234
22630
|
};
|
|
22235
22631
|
const renderIconGrid = (icons) => {
|
|
22236
22632
|
if (icons.length === 0) {
|
|
22237
|
-
return /* @__PURE__ */
|
|
22633
|
+
return /* @__PURE__ */ React226.createElement(Center12, { py: "xl" }, /* @__PURE__ */ React226.createElement(Text120, { c: "dimmed", size: "sm" }, "No icons found"));
|
|
22238
22634
|
}
|
|
22239
|
-
return /* @__PURE__ */
|
|
22240
|
-
|
|
22635
|
+
return /* @__PURE__ */ React226.createElement(
|
|
22636
|
+
Box41,
|
|
22241
22637
|
{
|
|
22242
22638
|
style: {
|
|
22243
22639
|
display: "grid",
|
|
@@ -22248,7 +22644,7 @@ function BaseIconPicker({ opened, onClose, onSelectIcon, onUploadClick, children
|
|
|
22248
22644
|
},
|
|
22249
22645
|
icons.map(([name, IconComponent]) => {
|
|
22250
22646
|
const isSelected = currentIcon === name.replace("Icon", "").replace(/([A-Z])/g, "-$1").toLowerCase().slice(1);
|
|
22251
|
-
return /* @__PURE__ */
|
|
22647
|
+
return /* @__PURE__ */ React226.createElement(
|
|
22252
22648
|
UnstyledButton2,
|
|
22253
22649
|
{
|
|
22254
22650
|
key: name,
|
|
@@ -22274,12 +22670,12 @@ function BaseIconPicker({ opened, onClose, onSelectIcon, onUploadClick, children
|
|
|
22274
22670
|
}
|
|
22275
22671
|
}
|
|
22276
22672
|
},
|
|
22277
|
-
/* @__PURE__ */
|
|
22673
|
+
/* @__PURE__ */ React226.createElement(IconComponent, { color: "white", size: 24, stroke: 1.5 })
|
|
22278
22674
|
);
|
|
22279
22675
|
})
|
|
22280
22676
|
);
|
|
22281
22677
|
};
|
|
22282
|
-
return /* @__PURE__ */
|
|
22678
|
+
return /* @__PURE__ */ React226.createElement(Popover4, { opened, onClose, position: "right", width: 500, shadow: "xl" }, /* @__PURE__ */ React226.createElement(Popover4.Target, null, children), /* @__PURE__ */ React226.createElement(
|
|
22283
22679
|
Popover4.Dropdown,
|
|
22284
22680
|
{
|
|
22285
22681
|
style: {
|
|
@@ -22289,15 +22685,15 @@ function BaseIconPicker({ opened, onClose, onSelectIcon, onUploadClick, children
|
|
|
22289
22685
|
},
|
|
22290
22686
|
p: 0
|
|
22291
22687
|
},
|
|
22292
|
-
/* @__PURE__ */
|
|
22688
|
+
/* @__PURE__ */ React226.createElement(Stack145, { gap: "md", p: "md" }, /* @__PURE__ */ React226.createElement(Tabs5, { value: activeTab, onChange: setActiveTab, variant: "pills" }, /* @__PURE__ */ React226.createElement(Tabs5.List, null, /* @__PURE__ */ React226.createElement(Tabs5.Tab, { value: "icons" }, "Icons"), /* @__PURE__ */ React226.createElement(Tabs5.Tab, { value: "upload" }, "Upload")), /* @__PURE__ */ React226.createElement(Tabs5.Panel, { value: "icons", pt: "md" }, /* @__PURE__ */ React226.createElement(
|
|
22293
22689
|
TextInput7,
|
|
22294
22690
|
{
|
|
22295
22691
|
mb: "md",
|
|
22296
22692
|
placeholder: "Filter",
|
|
22297
|
-
leftSection: /* @__PURE__ */
|
|
22693
|
+
leftSection: /* @__PURE__ */ React226.createElement(IconSearch6, { size: 18 }),
|
|
22298
22694
|
value: searchQuery,
|
|
22299
22695
|
onChange: (e) => setSearchQuery(e.currentTarget.value),
|
|
22300
|
-
rightSection: searchQuery && /* @__PURE__ */
|
|
22696
|
+
rightSection: searchQuery && /* @__PURE__ */ React226.createElement(UnstyledButton2, { onClick: () => setSearchQuery("") }, /* @__PURE__ */ React226.createElement(IconX10, { size: 18 })),
|
|
22301
22697
|
style: { flex: 1 },
|
|
22302
22698
|
styles: {
|
|
22303
22699
|
input: {
|
|
@@ -22307,22 +22703,22 @@ function BaseIconPicker({ opened, onClose, onSelectIcon, onUploadClick, children
|
|
|
22307
22703
|
}
|
|
22308
22704
|
}
|
|
22309
22705
|
}
|
|
22310
|
-
), !searchQuery && /* @__PURE__ */
|
|
22706
|
+
), !searchQuery && /* @__PURE__ */ React226.createElement(Box41, { mb: "md" }, /* @__PURE__ */ React226.createElement(Text120, { size: "sm", fw: 500, mb: "xs", px: "xs" }, "Recent"), /* @__PURE__ */ React226.createElement(ScrollArea8.Autosize, { scrollbarSize: 0, mah: 60 }, renderIconGrid(recentIcons))), /* @__PURE__ */ React226.createElement(Box41, null, /* @__PURE__ */ React226.createElement(Group76, { justify: "space-between", mb: "xs", px: "xs" }, /* @__PURE__ */ React226.createElement(Text120, { size: "sm", fw: 500 }, searchQuery ? "Results" : "Icons"), totalPages > 1 && /* @__PURE__ */ React226.createElement(Group76, { gap: "xs" }, /* @__PURE__ */ React226.createElement(Text120, { size: "xs", c: "dimmed" }, "Page ", currentPage, " of ", totalPages, " (", filteredIcons.length, " total)"), /* @__PURE__ */ React226.createElement(BaseButton, { size: "xs", onClick: () => setCurrentPage((p) => Math.max(1, p - 1)), disabled: currentPage === 1, leftSection: /* @__PURE__ */ React226.createElement(IconChevronLeft, { size: 14 }) }, "Prev"), /* @__PURE__ */ React226.createElement(
|
|
22311
22707
|
BaseButton,
|
|
22312
22708
|
{
|
|
22313
22709
|
size: "xs",
|
|
22314
22710
|
onClick: () => setCurrentPage((p) => Math.min(totalPages, p + 1)),
|
|
22315
22711
|
disabled: currentPage === totalPages,
|
|
22316
|
-
leftSection: /* @__PURE__ */
|
|
22712
|
+
leftSection: /* @__PURE__ */ React226.createElement(IconChevronRight11, { size: 14 })
|
|
22317
22713
|
},
|
|
22318
22714
|
"Next"
|
|
22319
|
-
))), /* @__PURE__ */
|
|
22715
|
+
))), /* @__PURE__ */ React226.createElement(ScrollArea8.Autosize, { scrollbarSize: 0, mah: 200 }, renderIconGrid(paginatedIcons)))), /* @__PURE__ */ React226.createElement(Tabs5.Panel, { value: "upload", pt: "md" }, /* @__PURE__ */ React226.createElement(Center12, { py: "xl" }, /* @__PURE__ */ React226.createElement(Stack145, { align: "center", gap: "md" }, /* @__PURE__ */ React226.createElement(Text120, { size: "sm", c: "dimmed", ta: "center" }, "Upload a custom icon image", /* @__PURE__ */ React226.createElement("br", null), "(PNG, JPG, SVG)"), /* @__PURE__ */ React226.createElement(CoverImageButton, { onClick: onUploadClick }, "Choose File"))))))
|
|
22320
22716
|
));
|
|
22321
22717
|
}
|
|
22322
22718
|
|
|
22323
22719
|
// src/mantine/components/CoverImage.tsx
|
|
22324
|
-
import
|
|
22325
|
-
import { Box as
|
|
22720
|
+
import React228, { useState as useState80, useRef as useRef13, useEffect as useEffect60 } from "react";
|
|
22721
|
+
import { Box as Box43, Group as Group77 } from "@mantine/core";
|
|
22326
22722
|
|
|
22327
22723
|
// src/core/lib/imageTransform.ts
|
|
22328
22724
|
var CLOUDFLARE_CDN_BASE = "https://www.ixo.earth/cdn-cgi/image";
|
|
@@ -22455,12 +22851,12 @@ function transformIconImage(sourceUrl, size = "default", customOptions) {
|
|
|
22455
22851
|
}
|
|
22456
22852
|
|
|
22457
22853
|
// src/mantine/components/Base/PageIcon.tsx
|
|
22458
|
-
import
|
|
22459
|
-
import { Center as Center13, Box as
|
|
22854
|
+
import React227, { useMemo as useMemo79 } from "react";
|
|
22855
|
+
import { Center as Center13, Box as Box42 } from "@mantine/core";
|
|
22460
22856
|
import * as TablerIcons2 from "@tabler/icons-react";
|
|
22461
22857
|
function PageIcon({ src, iconSize = 64, useCenter = false, style }) {
|
|
22462
22858
|
const isIconName = src && !src.startsWith("http");
|
|
22463
|
-
const IconComponent =
|
|
22859
|
+
const IconComponent = useMemo79(() => {
|
|
22464
22860
|
if (!isIconName || !src) return null;
|
|
22465
22861
|
const iconComponent = TablerIcons2[src];
|
|
22466
22862
|
if (iconComponent) {
|
|
@@ -22468,10 +22864,10 @@ function PageIcon({ src, iconSize = 64, useCenter = false, style }) {
|
|
|
22468
22864
|
}
|
|
22469
22865
|
return null;
|
|
22470
22866
|
}, [isIconName, src]);
|
|
22471
|
-
const Container = useCenter ? Center13 :
|
|
22867
|
+
const Container = useCenter ? Center13 : Box42;
|
|
22472
22868
|
if (!src) return null;
|
|
22473
22869
|
if (IconComponent) {
|
|
22474
|
-
return /* @__PURE__ */
|
|
22870
|
+
return /* @__PURE__ */ React227.createElement(
|
|
22475
22871
|
Container,
|
|
22476
22872
|
{
|
|
22477
22873
|
style: {
|
|
@@ -22483,10 +22879,10 @@ function PageIcon({ src, iconSize = 64, useCenter = false, style }) {
|
|
|
22483
22879
|
...style
|
|
22484
22880
|
}
|
|
22485
22881
|
},
|
|
22486
|
-
/* @__PURE__ */
|
|
22882
|
+
/* @__PURE__ */ React227.createElement(IconComponent, { size: iconSize, color: "white", stroke: 1.5 })
|
|
22487
22883
|
);
|
|
22488
22884
|
}
|
|
22489
|
-
return /* @__PURE__ */
|
|
22885
|
+
return /* @__PURE__ */ React227.createElement(
|
|
22490
22886
|
"img",
|
|
22491
22887
|
{
|
|
22492
22888
|
src,
|
|
@@ -22507,14 +22903,14 @@ function PageIcon({ src, iconSize = 64, useCenter = false, style }) {
|
|
|
22507
22903
|
import { useDisclosure as useDisclosure5 } from "@mantine/hooks";
|
|
22508
22904
|
function CoverImage({ coverImageUrl, logoUrl }) {
|
|
22509
22905
|
const { editor, handlers, editable } = useBlocknoteContext();
|
|
22510
|
-
const [isHovering, setIsHovering] =
|
|
22511
|
-
const [isRepositioning, setIsRepositioning] =
|
|
22512
|
-
const [coverPosition, setCoverPosition] =
|
|
22906
|
+
const [isHovering, setIsHovering] = useState80(false);
|
|
22907
|
+
const [isRepositioning, setIsRepositioning] = useState80(false);
|
|
22908
|
+
const [coverPosition, setCoverPosition] = useState80(50);
|
|
22513
22909
|
const coverFileInputRef = useRef13(null);
|
|
22514
22910
|
const logoFileInputRef = useRef13(null);
|
|
22515
22911
|
const [opened, { open, close }] = useDisclosure5(false);
|
|
22516
|
-
const [metadata, setMetadata] =
|
|
22517
|
-
|
|
22912
|
+
const [metadata, setMetadata] = useState80(() => editor?.getPageMetadata?.() || null);
|
|
22913
|
+
useEffect60(() => {
|
|
22518
22914
|
if (!editor?._metadataManager) {
|
|
22519
22915
|
return;
|
|
22520
22916
|
}
|
|
@@ -22596,8 +22992,8 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
22596
22992
|
return null;
|
|
22597
22993
|
}
|
|
22598
22994
|
if (!hasCover) {
|
|
22599
|
-
return /* @__PURE__ */
|
|
22600
|
-
|
|
22995
|
+
return /* @__PURE__ */ React228.createElement(
|
|
22996
|
+
Box43,
|
|
22601
22997
|
{
|
|
22602
22998
|
style: {
|
|
22603
22999
|
position: "relative",
|
|
@@ -22609,8 +23005,8 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
22609
23005
|
onMouseEnter: () => editable && setIsHovering(true),
|
|
22610
23006
|
onMouseLeave: () => editable && setIsHovering(false)
|
|
22611
23007
|
},
|
|
22612
|
-
/* @__PURE__ */
|
|
22613
|
-
|
|
23008
|
+
/* @__PURE__ */ React228.createElement("div", { style: { maxWidth: "900px", margin: "0 auto", position: "relative", height: "100%" } }, /* @__PURE__ */ React228.createElement("input", { ref: coverFileInputRef, type: "file", accept: "image/*", style: { display: "none" }, onChange: (e) => handleFileSelect(e, "cover") }), /* @__PURE__ */ React228.createElement("input", { ref: logoFileInputRef, type: "file", accept: "image/*", style: { display: "none" }, onChange: (e) => handleFileSelect(e, "logo") }), editable && isHovering && !logoSrc && /* @__PURE__ */ React228.createElement(
|
|
23009
|
+
Group77,
|
|
22614
23010
|
{
|
|
22615
23011
|
gap: "xs",
|
|
22616
23012
|
style: {
|
|
@@ -22620,7 +23016,7 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
22620
23016
|
zIndex: 10
|
|
22621
23017
|
}
|
|
22622
23018
|
},
|
|
22623
|
-
/* @__PURE__ */
|
|
23019
|
+
/* @__PURE__ */ React228.createElement(
|
|
22624
23020
|
BaseIconPicker,
|
|
22625
23021
|
{
|
|
22626
23022
|
opened,
|
|
@@ -22629,11 +23025,11 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
22629
23025
|
onSelectIcon: (name) => handleSelectLogoIcon(name),
|
|
22630
23026
|
onUploadClick: () => logoFileInputRef.current?.click()
|
|
22631
23027
|
},
|
|
22632
|
-
/* @__PURE__ */
|
|
23028
|
+
/* @__PURE__ */ React228.createElement(CoverImageButton, { onClick: open }, "Add icon")
|
|
22633
23029
|
),
|
|
22634
|
-
/* @__PURE__ */
|
|
22635
|
-
), logoSrc && /* @__PURE__ */
|
|
22636
|
-
|
|
23030
|
+
/* @__PURE__ */ React228.createElement(CoverImageButton, { onClick: () => coverFileInputRef.current?.click() }, "Add cover")
|
|
23031
|
+
), logoSrc && /* @__PURE__ */ React228.createElement(
|
|
23032
|
+
Box43,
|
|
22637
23033
|
{
|
|
22638
23034
|
style: {
|
|
22639
23035
|
position: "relative",
|
|
@@ -22646,8 +23042,8 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
22646
23042
|
zIndex: 11
|
|
22647
23043
|
}
|
|
22648
23044
|
},
|
|
22649
|
-
/* @__PURE__ */
|
|
22650
|
-
editable && isHovering && /* @__PURE__ */
|
|
23045
|
+
/* @__PURE__ */ React228.createElement(PageIcon, { src: logoSrc, useCenter: true, iconSize: 64 }),
|
|
23046
|
+
editable && isHovering && /* @__PURE__ */ React228.createElement(
|
|
22651
23047
|
"div",
|
|
22652
23048
|
{
|
|
22653
23049
|
style: {
|
|
@@ -22662,7 +23058,7 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
22662
23058
|
alignItems: "center"
|
|
22663
23059
|
}
|
|
22664
23060
|
},
|
|
22665
|
-
/* @__PURE__ */
|
|
23061
|
+
/* @__PURE__ */ React228.createElement(
|
|
22666
23062
|
BaseIconPicker,
|
|
22667
23063
|
{
|
|
22668
23064
|
opened,
|
|
@@ -22671,16 +23067,16 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
22671
23067
|
onSelectIcon: (name) => handleSelectLogoIcon(name),
|
|
22672
23068
|
onUploadClick: () => logoFileInputRef.current?.click()
|
|
22673
23069
|
},
|
|
22674
|
-
/* @__PURE__ */
|
|
23070
|
+
/* @__PURE__ */ React228.createElement(CoverImageButton, { onClick: open }, "Change")
|
|
22675
23071
|
),
|
|
22676
|
-
/* @__PURE__ */
|
|
22677
|
-
/* @__PURE__ */
|
|
23072
|
+
/* @__PURE__ */ React228.createElement(CoverImageButton, { onClick: handleRemoveLogo }, "Remove"),
|
|
23073
|
+
/* @__PURE__ */ React228.createElement(CoverImageButton, { onClick: () => coverFileInputRef.current?.click() }, "Add cover")
|
|
22678
23074
|
)
|
|
22679
23075
|
))
|
|
22680
23076
|
);
|
|
22681
23077
|
}
|
|
22682
|
-
return /* @__PURE__ */
|
|
22683
|
-
|
|
23078
|
+
return /* @__PURE__ */ React228.createElement(
|
|
23079
|
+
Box43,
|
|
22684
23080
|
{
|
|
22685
23081
|
style: {
|
|
22686
23082
|
position: "relative",
|
|
@@ -22699,7 +23095,7 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
22699
23095
|
onMouseMove: handleMouseMove,
|
|
22700
23096
|
onClick: () => isRepositioning && setIsRepositioning(false)
|
|
22701
23097
|
},
|
|
22702
|
-
/* @__PURE__ */
|
|
23098
|
+
/* @__PURE__ */ React228.createElement(
|
|
22703
23099
|
"img",
|
|
22704
23100
|
{
|
|
22705
23101
|
src: coverUrl,
|
|
@@ -22717,8 +23113,8 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
22717
23113
|
}
|
|
22718
23114
|
}
|
|
22719
23115
|
),
|
|
22720
|
-
editable && isHovering && /* @__PURE__ */
|
|
22721
|
-
|
|
23116
|
+
editable && isHovering && /* @__PURE__ */ React228.createElement(
|
|
23117
|
+
Group77,
|
|
22722
23118
|
{
|
|
22723
23119
|
gap: "xs",
|
|
22724
23120
|
style: {
|
|
@@ -22728,12 +23124,12 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
22728
23124
|
zIndex: 10
|
|
22729
23125
|
}
|
|
22730
23126
|
},
|
|
22731
|
-
/* @__PURE__ */
|
|
22732
|
-
/* @__PURE__ */
|
|
22733
|
-
/* @__PURE__ */
|
|
23127
|
+
/* @__PURE__ */ React228.createElement(CoverImageButton, { onClick: () => coverFileInputRef.current?.click() }, "Change cover"),
|
|
23128
|
+
/* @__PURE__ */ React228.createElement(CoverImageButton, { onClick: () => setIsRepositioning(!isRepositioning), isActive: isRepositioning }, isRepositioning ? "Done" : "Reposition"),
|
|
23129
|
+
/* @__PURE__ */ React228.createElement(CoverImageButton, { onClick: handleRemoveCover }, "Remove")
|
|
22734
23130
|
),
|
|
22735
|
-
/* @__PURE__ */
|
|
22736
|
-
|
|
23131
|
+
/* @__PURE__ */ React228.createElement("div", { style: { maxWidth: "900px", margin: "0 auto", position: "absolute", bottom: 0, left: -40, right: 0, height: "70px" } }, /* @__PURE__ */ React228.createElement(
|
|
23132
|
+
Box43,
|
|
22737
23133
|
{
|
|
22738
23134
|
style: {
|
|
22739
23135
|
position: "absolute",
|
|
@@ -22744,9 +23140,9 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
22744
23140
|
zIndex: 11
|
|
22745
23141
|
}
|
|
22746
23142
|
},
|
|
22747
|
-
logoSrc && /* @__PURE__ */
|
|
22748
|
-
editable && isHovering && /* @__PURE__ */
|
|
22749
|
-
|
|
23143
|
+
logoSrc && /* @__PURE__ */ React228.createElement(PageIcon, { src: logoSrc, iconSize: 64 }),
|
|
23144
|
+
editable && isHovering && /* @__PURE__ */ React228.createElement(React228.Fragment, null, logoSrc ? /* @__PURE__ */ React228.createElement(
|
|
23145
|
+
Group77,
|
|
22750
23146
|
{
|
|
22751
23147
|
gap: "xs",
|
|
22752
23148
|
style: {
|
|
@@ -22756,7 +23152,7 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
22756
23152
|
zIndex: 12
|
|
22757
23153
|
}
|
|
22758
23154
|
},
|
|
22759
|
-
/* @__PURE__ */
|
|
23155
|
+
/* @__PURE__ */ React228.createElement(
|
|
22760
23156
|
BaseIconPicker,
|
|
22761
23157
|
{
|
|
22762
23158
|
opened,
|
|
@@ -22765,10 +23161,10 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
22765
23161
|
onSelectIcon: (name) => handleSelectLogoIcon(name),
|
|
22766
23162
|
onUploadClick: () => logoFileInputRef.current?.click()
|
|
22767
23163
|
},
|
|
22768
|
-
/* @__PURE__ */
|
|
23164
|
+
/* @__PURE__ */ React228.createElement(CoverImageButton, { onClick: open }, "Change")
|
|
22769
23165
|
),
|
|
22770
|
-
/* @__PURE__ */
|
|
22771
|
-
) : /* @__PURE__ */
|
|
23166
|
+
/* @__PURE__ */ React228.createElement(CoverImageButton, { onClick: handleRemoveLogo }, "Remove")
|
|
23167
|
+
) : /* @__PURE__ */ React228.createElement(
|
|
22772
23168
|
CoverImageButton,
|
|
22773
23169
|
{
|
|
22774
23170
|
onClick: open,
|
|
@@ -22783,13 +23179,13 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
22783
23179
|
"Add icon"
|
|
22784
23180
|
))
|
|
22785
23181
|
)),
|
|
22786
|
-
/* @__PURE__ */
|
|
22787
|
-
/* @__PURE__ */
|
|
23182
|
+
/* @__PURE__ */ React228.createElement("input", { ref: coverFileInputRef, type: "file", accept: "image/*", style: { display: "none" }, onChange: (e) => handleFileSelect(e, "cover") }),
|
|
23183
|
+
/* @__PURE__ */ React228.createElement("input", { ref: logoFileInputRef, type: "file", accept: "image/*", style: { display: "none" }, onChange: (e) => handleFileSelect(e, "logo") })
|
|
22788
23184
|
);
|
|
22789
23185
|
}
|
|
22790
23186
|
|
|
22791
23187
|
// src/mantine/components/PageHeader.tsx
|
|
22792
|
-
import
|
|
23188
|
+
import React229, { useState as useState81, useRef as useRef14, useEffect as useEffect61 } from "react";
|
|
22793
23189
|
function PageHeader({
|
|
22794
23190
|
title = "New page",
|
|
22795
23191
|
icon,
|
|
@@ -22800,9 +23196,9 @@ function PageHeader({
|
|
|
22800
23196
|
isFavorited = false,
|
|
22801
23197
|
menuItems = []
|
|
22802
23198
|
}) {
|
|
22803
|
-
const [isMenuOpen, setIsMenuOpen] =
|
|
23199
|
+
const [isMenuOpen, setIsMenuOpen] = useState81(false);
|
|
22804
23200
|
const menuRef = useRef14(null);
|
|
22805
|
-
|
|
23201
|
+
useEffect61(() => {
|
|
22806
23202
|
function handleClickOutside(event) {
|
|
22807
23203
|
if (menuRef.current && !menuRef.current.contains(event.target)) {
|
|
22808
23204
|
setIsMenuOpen(false);
|
|
@@ -22821,14 +23217,14 @@ function PageHeader({
|
|
|
22821
23217
|
setIsMenuOpen(false);
|
|
22822
23218
|
}
|
|
22823
23219
|
};
|
|
22824
|
-
return /* @__PURE__ */
|
|
23220
|
+
return /* @__PURE__ */ React229.createElement("div", { style: styles.container }, /* @__PURE__ */ React229.createElement("div", { style: styles.leftSection }, /* @__PURE__ */ React229.createElement("span", { style: styles.icon }, icon || "\u{1F4C4}"), /* @__PURE__ */ React229.createElement("span", { style: styles.title }, title), isPrivate && /* @__PURE__ */ React229.createElement("button", { style: styles.privacyBadge }, /* @__PURE__ */ React229.createElement("span", { style: styles.lockIcon }, "\u{1F512}"), /* @__PURE__ */ React229.createElement("span", null, "Private"), /* @__PURE__ */ React229.createElement("span", { style: styles.chevron }, "\u25BE"))), /* @__PURE__ */ React229.createElement("div", { style: styles.rightSection }, lastEdited && /* @__PURE__ */ React229.createElement("span", { style: styles.editedText }, lastEdited), onShare && /* @__PURE__ */ React229.createElement("button", { style: styles.shareButton, onClick: onShare }, "Share"), onFavorite && /* @__PURE__ */ React229.createElement("button", { style: styles.iconButton, onClick: onFavorite }, isFavorited ? "\u2605" : "\u2606"), menuItems.length > 0 && /* @__PURE__ */ React229.createElement("div", { style: styles.menuContainer, ref: menuRef }, /* @__PURE__ */ React229.createElement(
|
|
22825
23221
|
"button",
|
|
22826
23222
|
{
|
|
22827
23223
|
style: styles.menuButton,
|
|
22828
23224
|
onClick: () => setIsMenuOpen(!isMenuOpen),
|
|
22829
23225
|
"aria-label": "Menu"
|
|
22830
23226
|
},
|
|
22831
|
-
/* @__PURE__ */
|
|
23227
|
+
/* @__PURE__ */ React229.createElement(
|
|
22832
23228
|
"svg",
|
|
22833
23229
|
{
|
|
22834
23230
|
width: "16",
|
|
@@ -22836,11 +23232,11 @@ function PageHeader({
|
|
|
22836
23232
|
viewBox: "0 0 16 16",
|
|
22837
23233
|
fill: "currentColor"
|
|
22838
23234
|
},
|
|
22839
|
-
/* @__PURE__ */
|
|
22840
|
-
/* @__PURE__ */
|
|
22841
|
-
/* @__PURE__ */
|
|
23235
|
+
/* @__PURE__ */ React229.createElement("circle", { cx: "3", cy: "8", r: "1.5" }),
|
|
23236
|
+
/* @__PURE__ */ React229.createElement("circle", { cx: "8", cy: "8", r: "1.5" }),
|
|
23237
|
+
/* @__PURE__ */ React229.createElement("circle", { cx: "13", cy: "8", r: "1.5" })
|
|
22842
23238
|
)
|
|
22843
|
-
), isMenuOpen && /* @__PURE__ */
|
|
23239
|
+
), isMenuOpen && /* @__PURE__ */ React229.createElement("div", { style: styles.dropdown }, menuItems.map((item, index) => /* @__PURE__ */ React229.createElement(React229.Fragment, { key: index }, item.divider && index > 0 && /* @__PURE__ */ React229.createElement("div", { style: styles.divider }), /* @__PURE__ */ React229.createElement(
|
|
22844
23240
|
"button",
|
|
22845
23241
|
{
|
|
22846
23242
|
style: {
|
|
@@ -22850,8 +23246,8 @@ function PageHeader({
|
|
|
22850
23246
|
onClick: () => handleMenuItemClick(item),
|
|
22851
23247
|
disabled: item.disabled
|
|
22852
23248
|
},
|
|
22853
|
-
item.icon && /* @__PURE__ */
|
|
22854
|
-
/* @__PURE__ */
|
|
23249
|
+
item.icon && /* @__PURE__ */ React229.createElement("span", { style: styles.menuItemIcon }, item.icon),
|
|
23250
|
+
/* @__PURE__ */ React229.createElement("span", null, item.label)
|
|
22855
23251
|
)))))));
|
|
22856
23252
|
}
|
|
22857
23253
|
var styles = {
|
|
@@ -22982,8 +23378,8 @@ var styles = {
|
|
|
22982
23378
|
};
|
|
22983
23379
|
|
|
22984
23380
|
// src/mantine/components/ExternalDropZone.tsx
|
|
22985
|
-
import
|
|
22986
|
-
import { Box as
|
|
23381
|
+
import React230, { useCallback as useCallback62, useEffect as useEffect62, useRef as useRef15, useState as useState82 } from "react";
|
|
23382
|
+
import { Box as Box44 } from "@mantine/core";
|
|
22987
23383
|
var SCROLL_ZONE_SIZE = 80;
|
|
22988
23384
|
var SCROLL_SPEED = 12;
|
|
22989
23385
|
var ExternalDropZone = ({
|
|
@@ -22996,19 +23392,19 @@ var ExternalDropZone = ({
|
|
|
22996
23392
|
children
|
|
22997
23393
|
}) => {
|
|
22998
23394
|
const containerRef = useRef15(null);
|
|
22999
|
-
const [isValidDrag, setIsValidDrag] =
|
|
23000
|
-
const [isHoveringInPlacementMode, setIsHoveringInPlacementMode] =
|
|
23001
|
-
const [indicatorStyle, setIndicatorStyle] =
|
|
23395
|
+
const [isValidDrag, setIsValidDrag] = useState82(false);
|
|
23396
|
+
const [isHoveringInPlacementMode, setIsHoveringInPlacementMode] = useState82(false);
|
|
23397
|
+
const [indicatorStyle, setIndicatorStyle] = useState82({});
|
|
23002
23398
|
const dropPositionRef = useRef15(null);
|
|
23003
23399
|
const scrollAnimationRef = useRef15(null);
|
|
23004
23400
|
const scrollDirectionRef = useRef15(null);
|
|
23005
23401
|
const scrollContainerRef = useRef15(null);
|
|
23006
|
-
const getBlockElements =
|
|
23402
|
+
const getBlockElements = useCallback62(() => {
|
|
23007
23403
|
if (!containerRef.current) return [];
|
|
23008
23404
|
const blocks = containerRef.current.querySelectorAll('[data-node-type="blockContainer"]');
|
|
23009
23405
|
return Array.from(blocks);
|
|
23010
23406
|
}, []);
|
|
23011
|
-
const getScrollContainer =
|
|
23407
|
+
const getScrollContainer = useCallback62(() => {
|
|
23012
23408
|
if (scrollContainerRef.current) return scrollContainerRef.current;
|
|
23013
23409
|
let element = containerRef.current;
|
|
23014
23410
|
while (element) {
|
|
@@ -23023,7 +23419,7 @@ var ExternalDropZone = ({
|
|
|
23023
23419
|
scrollContainerRef.current = window;
|
|
23024
23420
|
return window;
|
|
23025
23421
|
}, []);
|
|
23026
|
-
const performScroll =
|
|
23422
|
+
const performScroll = useCallback62(() => {
|
|
23027
23423
|
const container = getScrollContainer();
|
|
23028
23424
|
const direction = scrollDirectionRef.current;
|
|
23029
23425
|
if (!direction) {
|
|
@@ -23038,7 +23434,7 @@ var ExternalDropZone = ({
|
|
|
23038
23434
|
}
|
|
23039
23435
|
scrollAnimationRef.current = requestAnimationFrame(performScroll);
|
|
23040
23436
|
}, [getScrollContainer]);
|
|
23041
|
-
const startAutoScroll =
|
|
23437
|
+
const startAutoScroll = useCallback62(
|
|
23042
23438
|
(direction) => {
|
|
23043
23439
|
if (scrollDirectionRef.current === direction) return;
|
|
23044
23440
|
scrollDirectionRef.current = direction;
|
|
@@ -23048,14 +23444,14 @@ var ExternalDropZone = ({
|
|
|
23048
23444
|
},
|
|
23049
23445
|
[performScroll]
|
|
23050
23446
|
);
|
|
23051
|
-
const stopAutoScroll =
|
|
23447
|
+
const stopAutoScroll = useCallback62(() => {
|
|
23052
23448
|
scrollDirectionRef.current = null;
|
|
23053
23449
|
if (scrollAnimationRef.current) {
|
|
23054
23450
|
cancelAnimationFrame(scrollAnimationRef.current);
|
|
23055
23451
|
scrollAnimationRef.current = null;
|
|
23056
23452
|
}
|
|
23057
23453
|
}, []);
|
|
23058
|
-
const checkAutoScroll =
|
|
23454
|
+
const checkAutoScroll = useCallback62(
|
|
23059
23455
|
(clientY) => {
|
|
23060
23456
|
const container = getScrollContainer();
|
|
23061
23457
|
let containerTop;
|
|
@@ -23078,7 +23474,7 @@ var ExternalDropZone = ({
|
|
|
23078
23474
|
},
|
|
23079
23475
|
[getScrollContainer, startAutoScroll, stopAutoScroll]
|
|
23080
23476
|
);
|
|
23081
|
-
const findDropPosition =
|
|
23477
|
+
const findDropPosition = useCallback62(
|
|
23082
23478
|
(clientY) => {
|
|
23083
23479
|
const blocks = getBlockElements();
|
|
23084
23480
|
if (blocks.length === 0 || !editor?.document) return null;
|
|
@@ -23111,7 +23507,7 @@ var ExternalDropZone = ({
|
|
|
23111
23507
|
},
|
|
23112
23508
|
[getBlockElements, editor]
|
|
23113
23509
|
);
|
|
23114
|
-
const handleDragOver =
|
|
23510
|
+
const handleDragOver = useCallback62(
|
|
23115
23511
|
(e) => {
|
|
23116
23512
|
if (!e.dataTransfer.types.includes(acceptedType)) return;
|
|
23117
23513
|
e.preventDefault();
|
|
@@ -23134,7 +23530,7 @@ var ExternalDropZone = ({
|
|
|
23134
23530
|
},
|
|
23135
23531
|
[acceptedType, findDropPosition, checkAutoScroll]
|
|
23136
23532
|
);
|
|
23137
|
-
const handleDragLeave =
|
|
23533
|
+
const handleDragLeave = useCallback62(
|
|
23138
23534
|
(e) => {
|
|
23139
23535
|
if (containerRef.current && !containerRef.current.contains(e.relatedTarget)) {
|
|
23140
23536
|
setIsValidDrag(false);
|
|
@@ -23144,7 +23540,7 @@ var ExternalDropZone = ({
|
|
|
23144
23540
|
},
|
|
23145
23541
|
[stopAutoScroll]
|
|
23146
23542
|
);
|
|
23147
|
-
const handleDrop =
|
|
23543
|
+
const handleDrop = useCallback62(
|
|
23148
23544
|
(e) => {
|
|
23149
23545
|
e.preventDefault();
|
|
23150
23546
|
e.stopPropagation();
|
|
@@ -23158,7 +23554,7 @@ var ExternalDropZone = ({
|
|
|
23158
23554
|
},
|
|
23159
23555
|
[onDrop, stopAutoScroll]
|
|
23160
23556
|
);
|
|
23161
|
-
|
|
23557
|
+
useEffect62(() => {
|
|
23162
23558
|
const handleGlobalDragEnd = () => {
|
|
23163
23559
|
setIsValidDrag(false);
|
|
23164
23560
|
dropPositionRef.current = null;
|
|
@@ -23167,7 +23563,7 @@ var ExternalDropZone = ({
|
|
|
23167
23563
|
window.addEventListener("dragend", handleGlobalDragEnd);
|
|
23168
23564
|
return () => window.removeEventListener("dragend", handleGlobalDragEnd);
|
|
23169
23565
|
}, [stopAutoScroll]);
|
|
23170
|
-
const handleOverlayMouseMove =
|
|
23566
|
+
const handleOverlayMouseMove = useCallback62(
|
|
23171
23567
|
(e) => {
|
|
23172
23568
|
setIsHoveringInPlacementMode(true);
|
|
23173
23569
|
checkAutoScroll(e.clientY);
|
|
@@ -23186,12 +23582,12 @@ var ExternalDropZone = ({
|
|
|
23186
23582
|
},
|
|
23187
23583
|
[findDropPosition, checkAutoScroll]
|
|
23188
23584
|
);
|
|
23189
|
-
const handleOverlayMouseLeave =
|
|
23585
|
+
const handleOverlayMouseLeave = useCallback62(() => {
|
|
23190
23586
|
setIsHoveringInPlacementMode(false);
|
|
23191
23587
|
dropPositionRef.current = null;
|
|
23192
23588
|
stopAutoScroll();
|
|
23193
23589
|
}, [stopAutoScroll]);
|
|
23194
|
-
const handleOverlayClick =
|
|
23590
|
+
const handleOverlayClick = useCallback62(
|
|
23195
23591
|
(e) => {
|
|
23196
23592
|
e.preventDefault();
|
|
23197
23593
|
e.stopPropagation();
|
|
@@ -23205,7 +23601,7 @@ var ExternalDropZone = ({
|
|
|
23205
23601
|
},
|
|
23206
23602
|
[onDrop, stopAutoScroll]
|
|
23207
23603
|
);
|
|
23208
|
-
const handleOverlayWheel =
|
|
23604
|
+
const handleOverlayWheel = useCallback62(
|
|
23209
23605
|
(e) => {
|
|
23210
23606
|
const container = getScrollContainer();
|
|
23211
23607
|
if (container === window) {
|
|
@@ -23216,7 +23612,7 @@ var ExternalDropZone = ({
|
|
|
23216
23612
|
},
|
|
23217
23613
|
[getScrollContainer]
|
|
23218
23614
|
);
|
|
23219
|
-
|
|
23615
|
+
useEffect62(() => {
|
|
23220
23616
|
if (!isPlacementMode) return;
|
|
23221
23617
|
const handleKeyDown = (e) => {
|
|
23222
23618
|
if (e.key === "Escape") {
|
|
@@ -23239,13 +23635,13 @@ var ExternalDropZone = ({
|
|
|
23239
23635
|
document.removeEventListener("click", handleGlobalClick, true);
|
|
23240
23636
|
};
|
|
23241
23637
|
}, [isPlacementMode, onPlacementCancel]);
|
|
23242
|
-
|
|
23638
|
+
useEffect62(() => {
|
|
23243
23639
|
if (!isPlacementMode) {
|
|
23244
23640
|
setIsHoveringInPlacementMode(false);
|
|
23245
23641
|
dropPositionRef.current = null;
|
|
23246
23642
|
}
|
|
23247
23643
|
}, [isPlacementMode]);
|
|
23248
|
-
|
|
23644
|
+
useEffect62(() => {
|
|
23249
23645
|
const isActive = isValidDrag || isPlacementMode && isHoveringInPlacementMode;
|
|
23250
23646
|
if (isActive) {
|
|
23251
23647
|
document.body.classList.add("external-artifact-drag-active");
|
|
@@ -23256,19 +23652,19 @@ var ExternalDropZone = ({
|
|
|
23256
23652
|
document.body.classList.remove("external-artifact-drag-active");
|
|
23257
23653
|
};
|
|
23258
23654
|
}, [isValidDrag, isPlacementMode, isHoveringInPlacementMode]);
|
|
23259
|
-
|
|
23655
|
+
useEffect62(() => {
|
|
23260
23656
|
return () => {
|
|
23261
23657
|
if (scrollAnimationRef.current) {
|
|
23262
23658
|
cancelAnimationFrame(scrollAnimationRef.current);
|
|
23263
23659
|
}
|
|
23264
23660
|
};
|
|
23265
23661
|
}, []);
|
|
23266
|
-
const indicatorWithPosition = dropIndicator &&
|
|
23662
|
+
const indicatorWithPosition = dropIndicator && React230.isValidElement(dropIndicator) ? React230.cloneElement(dropIndicator, {
|
|
23267
23663
|
indicatorTop: typeof indicatorStyle.top === "number" ? indicatorStyle.top : void 0
|
|
23268
23664
|
}) : dropIndicator;
|
|
23269
23665
|
const shouldShowIndicator = isValidDrag || isPlacementMode && isHoveringInPlacementMode;
|
|
23270
|
-
return /* @__PURE__ */
|
|
23271
|
-
|
|
23666
|
+
return /* @__PURE__ */ React230.createElement(
|
|
23667
|
+
Box44,
|
|
23272
23668
|
{
|
|
23273
23669
|
ref: containerRef,
|
|
23274
23670
|
style: {
|
|
@@ -23283,8 +23679,8 @@ var ExternalDropZone = ({
|
|
|
23283
23679
|
"data-placement-mode": isPlacementMode ? "true" : void 0
|
|
23284
23680
|
},
|
|
23285
23681
|
children,
|
|
23286
|
-
isPlacementMode && /* @__PURE__ */
|
|
23287
|
-
|
|
23682
|
+
isPlacementMode && /* @__PURE__ */ React230.createElement(
|
|
23683
|
+
Box44,
|
|
23288
23684
|
{
|
|
23289
23685
|
style: {
|
|
23290
23686
|
position: "absolute",
|
|
@@ -23303,20 +23699,20 @@ var ExternalDropZone = ({
|
|
|
23303
23699
|
onWheel: handleOverlayWheel
|
|
23304
23700
|
}
|
|
23305
23701
|
),
|
|
23306
|
-
shouldShowIndicator && indicatorWithPosition && /* @__PURE__ */
|
|
23702
|
+
shouldShowIndicator && indicatorWithPosition && /* @__PURE__ */ React230.createElement(Box44, { style: { ...indicatorStyle, background: "none", border: "none", boxShadow: "none" } }, indicatorWithPosition)
|
|
23307
23703
|
);
|
|
23308
23704
|
};
|
|
23309
23705
|
|
|
23310
23706
|
// src/mantine/IxoEditor.tsx
|
|
23311
|
-
import
|
|
23707
|
+
import React232 from "react";
|
|
23312
23708
|
import { getDefaultReactSlashMenuItems, SuggestionMenuController } from "@blocknote/react";
|
|
23313
23709
|
import { BlockNoteView } from "@blocknote/mantine";
|
|
23314
23710
|
import { filterSuggestionItems } from "@blocknote/core";
|
|
23315
23711
|
import { MantineProvider } from "@mantine/core";
|
|
23316
23712
|
|
|
23317
23713
|
// src/mantine/components/PanelContent.tsx
|
|
23318
|
-
import
|
|
23319
|
-
import { Box as
|
|
23714
|
+
import React231 from "react";
|
|
23715
|
+
import { Box as Box45 } from "@mantine/core";
|
|
23320
23716
|
var panelStyles = {
|
|
23321
23717
|
light: {
|
|
23322
23718
|
backgroundColor: "#ffffff",
|
|
@@ -23345,8 +23741,8 @@ function PanelContent({ theme }) {
|
|
|
23345
23741
|
const { activePanel, registeredPanels } = usePanelStore();
|
|
23346
23742
|
const isOpen = activePanel !== null;
|
|
23347
23743
|
const content = activePanel ? registeredPanels.get(activePanel) : null;
|
|
23348
|
-
return /* @__PURE__ */
|
|
23349
|
-
|
|
23744
|
+
return /* @__PURE__ */ React231.createElement(
|
|
23745
|
+
Box45,
|
|
23350
23746
|
{
|
|
23351
23747
|
pos: "sticky",
|
|
23352
23748
|
right: 0,
|
|
@@ -23386,7 +23782,7 @@ function IxoEditorContent({
|
|
|
23386
23782
|
}) {
|
|
23387
23783
|
const { activePanel } = usePanelStore();
|
|
23388
23784
|
const isPanelOpen = activePanel !== null;
|
|
23389
|
-
const editorContent = /* @__PURE__ */
|
|
23785
|
+
const editorContent = /* @__PURE__ */ React232.createElement(
|
|
23390
23786
|
BlockNoteView,
|
|
23391
23787
|
{
|
|
23392
23788
|
editor,
|
|
@@ -23401,7 +23797,7 @@ function IxoEditorContent({
|
|
|
23401
23797
|
onChange,
|
|
23402
23798
|
onSelectionChange
|
|
23403
23799
|
},
|
|
23404
|
-
config.slashMenu && /* @__PURE__ */
|
|
23800
|
+
config.slashMenu && /* @__PURE__ */ React232.createElement(
|
|
23405
23801
|
SuggestionMenuController,
|
|
23406
23802
|
{
|
|
23407
23803
|
triggerCharacter: "/",
|
|
@@ -23414,7 +23810,7 @@ function IxoEditorContent({
|
|
|
23414
23810
|
),
|
|
23415
23811
|
children
|
|
23416
23812
|
);
|
|
23417
|
-
return /* @__PURE__ */
|
|
23813
|
+
return /* @__PURE__ */ React232.createElement("div", { style: { display: "flex", height: "100%", width: "100%", gap: 0 } }, /* @__PURE__ */ React232.createElement(
|
|
23418
23814
|
"div",
|
|
23419
23815
|
{
|
|
23420
23816
|
className: `ixo-editor ixo-editor--theme-${config.theme} ${className}`,
|
|
@@ -23423,9 +23819,9 @@ function IxoEditorContent({
|
|
|
23423
23819
|
transition: "width 0.2s ease"
|
|
23424
23820
|
}
|
|
23425
23821
|
},
|
|
23426
|
-
selfNav && /* @__PURE__ */
|
|
23427
|
-
/* @__PURE__ */
|
|
23428
|
-
(onExternalDrop || isPlacementMode) && isEditable ? /* @__PURE__ */
|
|
23822
|
+
selfNav && /* @__PURE__ */ React232.createElement(PageHeader, { ...pageHeaderProps }),
|
|
23823
|
+
/* @__PURE__ */ React232.createElement(CoverImage, { coverImageUrl, logoUrl }),
|
|
23824
|
+
(onExternalDrop || isPlacementMode) && isEditable ? /* @__PURE__ */ React232.createElement(
|
|
23429
23825
|
ExternalDropZone,
|
|
23430
23826
|
{
|
|
23431
23827
|
editor,
|
|
@@ -23438,7 +23834,7 @@ function IxoEditorContent({
|
|
|
23438
23834
|
},
|
|
23439
23835
|
editorContent
|
|
23440
23836
|
) : editorContent
|
|
23441
|
-
), isPanelVisible && /* @__PURE__ */
|
|
23837
|
+
), isPanelVisible && /* @__PURE__ */ React232.createElement(PanelContent, { theme: config.theme }));
|
|
23442
23838
|
}
|
|
23443
23839
|
function IxoEditor({
|
|
23444
23840
|
editor,
|
|
@@ -23478,7 +23874,7 @@ function IxoEditor({
|
|
|
23478
23874
|
tableHandles: true
|
|
23479
23875
|
};
|
|
23480
23876
|
const isEditable = editable;
|
|
23481
|
-
const editorContent = /* @__PURE__ */
|
|
23877
|
+
const editorContent = /* @__PURE__ */ React232.createElement(
|
|
23482
23878
|
BlocknoteProvider,
|
|
23483
23879
|
{
|
|
23484
23880
|
editor,
|
|
@@ -23490,7 +23886,7 @@ function IxoEditor({
|
|
|
23490
23886
|
dynamicListPanelRenderer,
|
|
23491
23887
|
domainCardRenderer
|
|
23492
23888
|
},
|
|
23493
|
-
/* @__PURE__ */
|
|
23889
|
+
/* @__PURE__ */ React232.createElement(
|
|
23494
23890
|
IxoEditorContent,
|
|
23495
23891
|
{
|
|
23496
23892
|
isPanelVisible,
|
|
@@ -23514,15 +23910,15 @@ function IxoEditor({
|
|
|
23514
23910
|
)
|
|
23515
23911
|
);
|
|
23516
23912
|
if (mantineTheme) {
|
|
23517
|
-
return /* @__PURE__ */
|
|
23913
|
+
return /* @__PURE__ */ React232.createElement(MantineProvider, { theme: mantineTheme }, editorContent);
|
|
23518
23914
|
}
|
|
23519
23915
|
return editorContent;
|
|
23520
23916
|
}
|
|
23521
23917
|
|
|
23522
23918
|
// src/mantine/components/EntitySigningSetup.tsx
|
|
23523
|
-
import
|
|
23524
|
-
import { Modal as Modal3, Stack as
|
|
23525
|
-
import { IconAlertCircle as IconAlertCircle15, IconCheck as
|
|
23919
|
+
import React233, { useState as useState83 } from "react";
|
|
23920
|
+
import { Modal as Modal3, Stack as Stack146, Text as Text121, TextInput as TextInput8, Button as Button38, Alert as Alert30, Group as Group78 } from "@mantine/core";
|
|
23921
|
+
import { IconAlertCircle as IconAlertCircle15, IconCheck as IconCheck13, IconKey as IconKey2 } from "@tabler/icons-react";
|
|
23526
23922
|
var EntitySigningSetup = ({
|
|
23527
23923
|
opened,
|
|
23528
23924
|
onClose,
|
|
@@ -23530,11 +23926,11 @@ var EntitySigningSetup = ({
|
|
|
23530
23926
|
entityName,
|
|
23531
23927
|
onSetup
|
|
23532
23928
|
}) => {
|
|
23533
|
-
const [pin, setPin] =
|
|
23534
|
-
const [confirmPin, setConfirmPin] =
|
|
23535
|
-
const [loading, setLoading] =
|
|
23536
|
-
const [error, setError] =
|
|
23537
|
-
const [success, setSuccess] =
|
|
23929
|
+
const [pin, setPin] = useState83("");
|
|
23930
|
+
const [confirmPin, setConfirmPin] = useState83("");
|
|
23931
|
+
const [loading, setLoading] = useState83(false);
|
|
23932
|
+
const [error, setError] = useState83(null);
|
|
23933
|
+
const [success, setSuccess] = useState83(false);
|
|
23538
23934
|
const handleSetup = async () => {
|
|
23539
23935
|
if (pin.length < 4) {
|
|
23540
23936
|
setError("PIN must be at least 4 characters");
|
|
@@ -23574,15 +23970,15 @@ var EntitySigningSetup = ({
|
|
|
23574
23970
|
setSuccess(false);
|
|
23575
23971
|
}
|
|
23576
23972
|
};
|
|
23577
|
-
return /* @__PURE__ */
|
|
23973
|
+
return /* @__PURE__ */ React233.createElement(
|
|
23578
23974
|
Modal3,
|
|
23579
23975
|
{
|
|
23580
23976
|
opened,
|
|
23581
23977
|
onClose: handleClose,
|
|
23582
|
-
title: /* @__PURE__ */
|
|
23978
|
+
title: /* @__PURE__ */ React233.createElement(Group78, { gap: "xs" }, /* @__PURE__ */ React233.createElement(IconKey2, { size: 20 }), /* @__PURE__ */ React233.createElement(Text121, { fw: 600 }, "Entity Signing Setup")),
|
|
23583
23979
|
size: "md"
|
|
23584
23980
|
},
|
|
23585
|
-
/* @__PURE__ */
|
|
23981
|
+
/* @__PURE__ */ React233.createElement(Stack146, { gap: "md" }, success ? /* @__PURE__ */ React233.createElement(Alert30, { color: "green", icon: /* @__PURE__ */ React233.createElement(IconCheck13, { size: 16 }) }, "Entity signing key set up successfully!") : /* @__PURE__ */ React233.createElement(React233.Fragment, null, /* @__PURE__ */ React233.createElement(Text121, { size: "sm", c: "dimmed" }, "Flow authorization requires a signing key for", " ", /* @__PURE__ */ React233.createElement(Text121, { span: true, fw: 500 }, entityName || entityDid), "."), /* @__PURE__ */ React233.createElement(Alert30, { color: "blue", variant: "light" }, /* @__PURE__ */ React233.createElement(Text121, { size: "sm" }, "This is a ", /* @__PURE__ */ React233.createElement("strong", null, "one-time setup"), " that allows flows to grant permissions without requiring wallet signatures for each delegation.")), /* @__PURE__ */ React233.createElement(Stack146, { gap: "xs" }, /* @__PURE__ */ React233.createElement(Text121, { size: "sm", fw: 500 }, "What happens:"), /* @__PURE__ */ React233.createElement(Text121, { size: "sm", c: "dimmed" }, "1. A new signing key is generated"), /* @__PURE__ */ React233.createElement(Text121, { size: "sm", c: "dimmed" }, "2. Key is registered on the entity's DID document (requires wallet)"), /* @__PURE__ */ React233.createElement(Text121, { size: "sm", c: "dimmed" }, "3. Key is stored encrypted in the entity's Matrix room")), /* @__PURE__ */ React233.createElement(
|
|
23586
23982
|
TextInput8,
|
|
23587
23983
|
{
|
|
23588
23984
|
label: "Enter PIN to encrypt signing key",
|
|
@@ -23593,7 +23989,7 @@ var EntitySigningSetup = ({
|
|
|
23593
23989
|
onChange: (e) => setPin(e.currentTarget.value),
|
|
23594
23990
|
disabled: loading
|
|
23595
23991
|
}
|
|
23596
|
-
), /* @__PURE__ */
|
|
23992
|
+
), /* @__PURE__ */ React233.createElement(
|
|
23597
23993
|
TextInput8,
|
|
23598
23994
|
{
|
|
23599
23995
|
label: "Confirm PIN",
|
|
@@ -23603,12 +23999,12 @@ var EntitySigningSetup = ({
|
|
|
23603
23999
|
onChange: (e) => setConfirmPin(e.currentTarget.value),
|
|
23604
24000
|
disabled: loading
|
|
23605
24001
|
}
|
|
23606
|
-
), error && /* @__PURE__ */
|
|
23607
|
-
|
|
24002
|
+
), error && /* @__PURE__ */ React233.createElement(Alert30, { color: "red", icon: /* @__PURE__ */ React233.createElement(IconAlertCircle15, { size: 16 }) }, error), /* @__PURE__ */ React233.createElement(Group78, { justify: "flex-end", mt: "md" }, /* @__PURE__ */ React233.createElement(Button38, { variant: "subtle", onClick: handleClose, disabled: loading }, "Cancel"), /* @__PURE__ */ React233.createElement(
|
|
24003
|
+
Button38,
|
|
23608
24004
|
{
|
|
23609
24005
|
onClick: handleSetup,
|
|
23610
24006
|
loading,
|
|
23611
|
-
leftSection: /* @__PURE__ */
|
|
24007
|
+
leftSection: /* @__PURE__ */ React233.createElement(IconKey2, { size: 16 })
|
|
23612
24008
|
},
|
|
23613
24009
|
"Setup Entity Signing"
|
|
23614
24010
|
))))
|
|
@@ -23616,9 +24012,9 @@ var EntitySigningSetup = ({
|
|
|
23616
24012
|
};
|
|
23617
24013
|
|
|
23618
24014
|
// src/mantine/components/FlowPermissionsPanel.tsx
|
|
23619
|
-
import
|
|
23620
|
-
import { Stack as
|
|
23621
|
-
import { IconPlus as
|
|
24015
|
+
import React234, { useState as useState84, useEffect as useEffect63, useMemo as useMemo80 } from "react";
|
|
24016
|
+
import { Stack as Stack147, Text as Text122, Paper as Paper19, Group as Group79, Badge as Badge39, Button as Button39, ActionIcon as ActionIcon35, Loader as Loader28, Alert as Alert31, Divider as Divider17 } from "@mantine/core";
|
|
24017
|
+
import { IconPlus as IconPlus7, IconTrash as IconTrash8, IconShieldCheck as IconShieldCheck2, IconUser as IconUser5, IconRobot as IconRobot4, IconBuilding } from "@tabler/icons-react";
|
|
23622
24018
|
var FlowPermissionsPanel = ({
|
|
23623
24019
|
editor,
|
|
23624
24020
|
entityDid,
|
|
@@ -23627,11 +24023,11 @@ var FlowPermissionsPanel = ({
|
|
|
23627
24023
|
onRevokePermission,
|
|
23628
24024
|
getUserDisplayName
|
|
23629
24025
|
}) => {
|
|
23630
|
-
const [delegations, setDelegations] =
|
|
23631
|
-
const [loading, setLoading] =
|
|
23632
|
-
const [revoking, setRevoking] =
|
|
23633
|
-
const rootCapability =
|
|
23634
|
-
|
|
24026
|
+
const [delegations, setDelegations] = useState84([]);
|
|
24027
|
+
const [loading, setLoading] = useState84(true);
|
|
24028
|
+
const [revoking, setRevoking] = useState84(null);
|
|
24029
|
+
const rootCapability = useMemo80(() => editor.getRootCapability?.(), [editor]);
|
|
24030
|
+
useEffect63(() => {
|
|
23635
24031
|
const loadDelegations = async () => {
|
|
23636
24032
|
setLoading(true);
|
|
23637
24033
|
const allDelegations = editor.getAllDelegations?.() || [];
|
|
@@ -23670,11 +24066,11 @@ var FlowPermissionsPanel = ({
|
|
|
23670
24066
|
const getIcon2 = (type) => {
|
|
23671
24067
|
switch (type) {
|
|
23672
24068
|
case "oracle":
|
|
23673
|
-
return /* @__PURE__ */
|
|
24069
|
+
return /* @__PURE__ */ React234.createElement(IconRobot4, { size: 16 });
|
|
23674
24070
|
case "entity":
|
|
23675
|
-
return /* @__PURE__ */
|
|
24071
|
+
return /* @__PURE__ */ React234.createElement(IconBuilding, { size: 16 });
|
|
23676
24072
|
default:
|
|
23677
|
-
return /* @__PURE__ */
|
|
24073
|
+
return /* @__PURE__ */ React234.createElement(IconUser5, { size: 16 });
|
|
23678
24074
|
}
|
|
23679
24075
|
};
|
|
23680
24076
|
const formatCapabilities = (caps) => {
|
|
@@ -23693,8 +24089,8 @@ var FlowPermissionsPanel = ({
|
|
|
23693
24089
|
if (date < /* @__PURE__ */ new Date()) return "Expired";
|
|
23694
24090
|
return date.toLocaleDateString();
|
|
23695
24091
|
};
|
|
23696
|
-
return /* @__PURE__ */
|
|
23697
|
-
|
|
24092
|
+
return /* @__PURE__ */ React234.createElement(Stack147, { gap: "md" }, /* @__PURE__ */ React234.createElement(Stack147, { gap: "xs" }, /* @__PURE__ */ React234.createElement(Text122, { fw: 600, size: "sm" }, "Root Authority"), /* @__PURE__ */ React234.createElement(Paper19, { p: "sm", withBorder: true }, /* @__PURE__ */ React234.createElement(Group79, { gap: "xs" }, /* @__PURE__ */ React234.createElement(IconShieldCheck2, { size: 20, color: "var(--mantine-color-green-6)" }), /* @__PURE__ */ React234.createElement(Stack147, { gap: 2, style: { flex: 1 } }, /* @__PURE__ */ React234.createElement(Text122, { size: "sm", fw: 500 }, entityName || entityDid), /* @__PURE__ */ React234.createElement(Text122, { size: "xs", c: "dimmed" }, rootCapability ? `Granted: ${new Date(rootCapability.issuedAt).toLocaleDateString()}` : "Root capability not set up")), /* @__PURE__ */ React234.createElement(Badge39, { color: "green", variant: "light" }, "Entity")))), /* @__PURE__ */ React234.createElement(Divider17, { label: "Delegated Permissions", labelPosition: "center" }), loading ? /* @__PURE__ */ React234.createElement(Group79, { justify: "center", py: "xl" }, /* @__PURE__ */ React234.createElement(Loader28, { size: "sm" })) : delegations.length === 0 ? /* @__PURE__ */ React234.createElement(Alert31, { color: "gray", variant: "light" }, /* @__PURE__ */ React234.createElement(Text122, { size: "sm" }, "No permissions have been granted yet.")) : /* @__PURE__ */ React234.createElement(Stack147, { gap: "xs" }, delegations.map(({ capability, displayName, type }) => /* @__PURE__ */ React234.createElement(Paper19, { key: capability.id, p: "sm", withBorder: true }, /* @__PURE__ */ React234.createElement(Group79, { justify: "space-between" }, /* @__PURE__ */ React234.createElement(Group79, { gap: "xs" }, getIcon2(type), /* @__PURE__ */ React234.createElement(Stack147, { gap: 2 }, /* @__PURE__ */ React234.createElement(Text122, { size: "sm", fw: 500 }, displayName), /* @__PURE__ */ React234.createElement(Text122, { size: "xs", c: "dimmed" }, formatCapabilities(capability.capabilities)), /* @__PURE__ */ React234.createElement(Group79, { gap: "xs" }, /* @__PURE__ */ React234.createElement(Text122, { size: "xs", c: "dimmed" }, "Expires: ", formatExpiration(capability.expiration)), /* @__PURE__ */ React234.createElement(Text122, { size: "xs", c: "dimmed" }, "\u2022"), /* @__PURE__ */ React234.createElement(Text122, { size: "xs", c: "dimmed" }, "Granted by: ", capability.issuer === entityDid ? "Entity" : capability.issuer.slice(-8))))), /* @__PURE__ */ React234.createElement(
|
|
24093
|
+
ActionIcon35,
|
|
23698
24094
|
{
|
|
23699
24095
|
color: "red",
|
|
23700
24096
|
variant: "subtle",
|
|
@@ -23702,11 +24098,11 @@ var FlowPermissionsPanel = ({
|
|
|
23702
24098
|
loading: revoking === capability.id,
|
|
23703
24099
|
disabled: !!revoking
|
|
23704
24100
|
},
|
|
23705
|
-
/* @__PURE__ */
|
|
23706
|
-
))))), /* @__PURE__ */
|
|
23707
|
-
|
|
24101
|
+
/* @__PURE__ */ React234.createElement(IconTrash8, { size: 16 })
|
|
24102
|
+
))))), /* @__PURE__ */ React234.createElement(
|
|
24103
|
+
Button39,
|
|
23708
24104
|
{
|
|
23709
|
-
leftSection: /* @__PURE__ */
|
|
24105
|
+
leftSection: /* @__PURE__ */ React234.createElement(IconPlus7, { size: 16 }),
|
|
23710
24106
|
variant: "light",
|
|
23711
24107
|
onClick: onGrantPermission
|
|
23712
24108
|
},
|
|
@@ -23715,22 +24111,22 @@ var FlowPermissionsPanel = ({
|
|
|
23715
24111
|
};
|
|
23716
24112
|
|
|
23717
24113
|
// src/mantine/components/GrantPermissionModal.tsx
|
|
23718
|
-
import
|
|
24114
|
+
import React235, { useState as useState85, useCallback as useCallback63 } from "react";
|
|
23719
24115
|
import {
|
|
23720
24116
|
Modal as Modal4,
|
|
23721
|
-
Stack as
|
|
23722
|
-
Text as
|
|
24117
|
+
Stack as Stack148,
|
|
24118
|
+
Text as Text123,
|
|
23723
24119
|
TextInput as TextInput9,
|
|
23724
|
-
Button as
|
|
23725
|
-
Group as
|
|
24120
|
+
Button as Button40,
|
|
24121
|
+
Group as Group80,
|
|
23726
24122
|
Radio as Radio6,
|
|
23727
24123
|
Checkbox as Checkbox12,
|
|
23728
24124
|
Alert as Alert32,
|
|
23729
24125
|
Paper as Paper20,
|
|
23730
|
-
Loader as
|
|
23731
|
-
Badge as
|
|
23732
|
-
ActionIcon as
|
|
23733
|
-
Divider as
|
|
24126
|
+
Loader as Loader29,
|
|
24127
|
+
Badge as Badge40,
|
|
24128
|
+
ActionIcon as ActionIcon36,
|
|
24129
|
+
Divider as Divider18,
|
|
23734
24130
|
NumberInput as NumberInput3
|
|
23735
24131
|
} from "@mantine/core";
|
|
23736
24132
|
import { IconSearch as IconSearch7, IconUser as IconUser6, IconRobot as IconRobot5, IconX as IconX11, IconShieldPlus as IconShieldPlus4 } from "@tabler/icons-react";
|
|
@@ -23747,21 +24143,21 @@ var GrantPermissionModal = ({
|
|
|
23747
24143
|
const singleBlockMode = !!targetBlockId || blocks.length === 1;
|
|
23748
24144
|
const fixedBlockId = targetBlockId || (blocks.length === 1 ? blocks[0].id : null);
|
|
23749
24145
|
const fixedBlock = fixedBlockId ? blocks.find((b) => b.id === fixedBlockId) || blocks[0] : null;
|
|
23750
|
-
const [recipientType, setRecipientType] =
|
|
23751
|
-
const [searchQuery, setSearchQuery] =
|
|
23752
|
-
const [searchResults, setSearchResults] =
|
|
23753
|
-
const [searching, setSearching] =
|
|
23754
|
-
const [selectedRecipient, setSelectedRecipient] =
|
|
23755
|
-
const [manualDid, setManualDid] =
|
|
23756
|
-
const [scopeType, setScopeType] =
|
|
23757
|
-
const [selectedBlocks, setSelectedBlocks] =
|
|
23758
|
-
const [expirationEnabled, setExpirationEnabled] =
|
|
23759
|
-
const [expirationDays, setExpirationDays] =
|
|
23760
|
-
const [canDelegate, setCanDelegate] =
|
|
23761
|
-
const [pin, setPin] =
|
|
23762
|
-
const [loading, setLoading] =
|
|
23763
|
-
const [error, setError] =
|
|
23764
|
-
const handleSearch =
|
|
24146
|
+
const [recipientType, setRecipientType] = useState85("user");
|
|
24147
|
+
const [searchQuery, setSearchQuery] = useState85("");
|
|
24148
|
+
const [searchResults, setSearchResults] = useState85([]);
|
|
24149
|
+
const [searching, setSearching] = useState85(false);
|
|
24150
|
+
const [selectedRecipient, setSelectedRecipient] = useState85(null);
|
|
24151
|
+
const [manualDid, setManualDid] = useState85("");
|
|
24152
|
+
const [scopeType, setScopeType] = useState85("full");
|
|
24153
|
+
const [selectedBlocks, setSelectedBlocks] = useState85([]);
|
|
24154
|
+
const [expirationEnabled, setExpirationEnabled] = useState85(false);
|
|
24155
|
+
const [expirationDays, setExpirationDays] = useState85(30);
|
|
24156
|
+
const [canDelegate, setCanDelegate] = useState85(false);
|
|
24157
|
+
const [pin, setPin] = useState85("");
|
|
24158
|
+
const [loading, setLoading] = useState85(false);
|
|
24159
|
+
const [error, setError] = useState85(null);
|
|
24160
|
+
const handleSearch = useCallback63(async () => {
|
|
23765
24161
|
if (searchQuery.length < 2) return;
|
|
23766
24162
|
setSearching(true);
|
|
23767
24163
|
try {
|
|
@@ -23848,30 +24244,30 @@ var GrantPermissionModal = ({
|
|
|
23848
24244
|
resetForm();
|
|
23849
24245
|
}
|
|
23850
24246
|
};
|
|
23851
|
-
return /* @__PURE__ */
|
|
24247
|
+
return /* @__PURE__ */ React235.createElement(
|
|
23852
24248
|
Modal4,
|
|
23853
24249
|
{
|
|
23854
24250
|
opened,
|
|
23855
24251
|
onClose: handleClose,
|
|
23856
|
-
title: /* @__PURE__ */
|
|
24252
|
+
title: /* @__PURE__ */ React235.createElement(Group80, { gap: "xs" }, /* @__PURE__ */ React235.createElement(IconShieldPlus4, { size: 20 }), /* @__PURE__ */ React235.createElement(Text123, { fw: 600 }, "Grant Permission")),
|
|
23857
24253
|
size: "lg"
|
|
23858
24254
|
},
|
|
23859
|
-
/* @__PURE__ */
|
|
24255
|
+
/* @__PURE__ */ React235.createElement(Stack148, { gap: "md" }, /* @__PURE__ */ React235.createElement(Stack148, { gap: "xs" }, /* @__PURE__ */ React235.createElement(Text123, { size: "sm", fw: 500 }, "Recipient Type"), /* @__PURE__ */ React235.createElement(Radio6.Group, { value: recipientType, onChange: (v) => {
|
|
23860
24256
|
setRecipientType(v);
|
|
23861
24257
|
setSelectedRecipient(null);
|
|
23862
24258
|
setSearchResults([]);
|
|
23863
|
-
} }, /* @__PURE__ */
|
|
24259
|
+
} }, /* @__PURE__ */ React235.createElement(Group80, null, /* @__PURE__ */ React235.createElement(Radio6, { value: "user", label: "User" }), /* @__PURE__ */ React235.createElement(Radio6, { value: "oracle", label: "Oracle" }), /* @__PURE__ */ React235.createElement(Radio6, { value: "manual", label: "Enter DID" })))), recipientType !== "manual" ? /* @__PURE__ */ React235.createElement(Stack148, { gap: "xs" }, /* @__PURE__ */ React235.createElement(
|
|
23864
24260
|
TextInput9,
|
|
23865
24261
|
{
|
|
23866
24262
|
placeholder: recipientType === "oracle" ? "Search oracles..." : "Search users...",
|
|
23867
|
-
leftSection: /* @__PURE__ */
|
|
23868
|
-
rightSection: searching ? /* @__PURE__ */
|
|
24263
|
+
leftSection: /* @__PURE__ */ React235.createElement(IconSearch7, { size: 16 }),
|
|
24264
|
+
rightSection: searching ? /* @__PURE__ */ React235.createElement(Loader29, { size: 14 }) : null,
|
|
23869
24265
|
value: searchQuery,
|
|
23870
24266
|
onChange: (e) => setSearchQuery(e.currentTarget.value),
|
|
23871
24267
|
onKeyDown: (e) => e.key === "Enter" && handleSearch()
|
|
23872
24268
|
}
|
|
23873
|
-
), selectedRecipient ? /* @__PURE__ */
|
|
23874
|
-
|
|
24269
|
+
), selectedRecipient ? /* @__PURE__ */ React235.createElement(Paper20, { p: "sm", withBorder: true }, /* @__PURE__ */ React235.createElement(Group80, { justify: "space-between" }, /* @__PURE__ */ React235.createElement(Group80, { gap: "xs" }, recipientType === "oracle" ? /* @__PURE__ */ React235.createElement(IconRobot5, { size: 16 }) : /* @__PURE__ */ React235.createElement(IconUser6, { size: 16 }), /* @__PURE__ */ React235.createElement(Text123, { size: "sm" }, selectedRecipient.displayName), /* @__PURE__ */ React235.createElement(Badge40, { size: "xs", variant: "light" }, selectedRecipient.did.slice(-12))), /* @__PURE__ */ React235.createElement(ActionIcon36, { size: "sm", variant: "subtle", onClick: () => setSelectedRecipient(null) }, /* @__PURE__ */ React235.createElement(IconX11, { size: 14 })))) : searchResults.length > 0 ? /* @__PURE__ */ React235.createElement(Paper20, { p: "xs", withBorder: true, style: { maxHeight: 150, overflow: "auto" } }, /* @__PURE__ */ React235.createElement(Stack148, { gap: 4 }, searchResults.map((result) => /* @__PURE__ */ React235.createElement(
|
|
24270
|
+
Button40,
|
|
23875
24271
|
{
|
|
23876
24272
|
key: result.did,
|
|
23877
24273
|
variant: "subtle",
|
|
@@ -23880,7 +24276,7 @@ var GrantPermissionModal = ({
|
|
|
23880
24276
|
onClick: () => setSelectedRecipient(result)
|
|
23881
24277
|
},
|
|
23882
24278
|
result.displayName
|
|
23883
|
-
)))) : null) : /* @__PURE__ */
|
|
24279
|
+
)))) : null) : /* @__PURE__ */ React235.createElement(
|
|
23884
24280
|
TextInput9,
|
|
23885
24281
|
{
|
|
23886
24282
|
label: "Recipient DID",
|
|
@@ -23888,12 +24284,12 @@ var GrantPermissionModal = ({
|
|
|
23888
24284
|
value: manualDid,
|
|
23889
24285
|
onChange: (e) => setManualDid(e.currentTarget.value)
|
|
23890
24286
|
}
|
|
23891
|
-
), /* @__PURE__ */
|
|
24287
|
+
), /* @__PURE__ */ React235.createElement(Divider18, null), /* @__PURE__ */ React235.createElement(Stack148, { gap: "xs" }, /* @__PURE__ */ React235.createElement(Text123, { size: "sm", fw: 500 }, "Permission Scope"), singleBlockMode && fixedBlock ? (
|
|
23892
24288
|
// Single block mode: show fixed block info
|
|
23893
|
-
/* @__PURE__ */
|
|
24289
|
+
/* @__PURE__ */ React235.createElement(Paper20, { p: "sm", withBorder: true }, /* @__PURE__ */ React235.createElement(Group80, { gap: "xs" }, /* @__PURE__ */ React235.createElement(Badge40, { variant: "light", color: "blue" }, fixedBlock.type), /* @__PURE__ */ React235.createElement(Text123, { size: "sm" }, fixedBlock.name || `Block ${fixedBlock.id.slice(-8)}`)), /* @__PURE__ */ React235.createElement(Text123, { size: "xs", c: "dimmed", mt: "xs" }, "Permission will be granted to execute this specific block."))
|
|
23894
24290
|
) : (
|
|
23895
24291
|
// Multi-block mode: show scope selection
|
|
23896
|
-
/* @__PURE__ */
|
|
24292
|
+
/* @__PURE__ */ React235.createElement(React235.Fragment, null, /* @__PURE__ */ React235.createElement(Radio6.Group, { value: scopeType, onChange: (v) => setScopeType(v) }, /* @__PURE__ */ React235.createElement(Stack148, { gap: "xs" }, /* @__PURE__ */ React235.createElement(Radio6, { value: "full", label: "Full flow access (can execute any block)" }), /* @__PURE__ */ React235.createElement(Radio6, { value: "blocks", label: "Specific blocks only" }))), scopeType === "blocks" && /* @__PURE__ */ React235.createElement(Paper20, { p: "sm", withBorder: true, style: { maxHeight: 150, overflow: "auto" } }, /* @__PURE__ */ React235.createElement(Stack148, { gap: "xs" }, blocks.map((block) => /* @__PURE__ */ React235.createElement(
|
|
23897
24293
|
Checkbox12,
|
|
23898
24294
|
{
|
|
23899
24295
|
key: block.id,
|
|
@@ -23908,14 +24304,14 @@ var GrantPermissionModal = ({
|
|
|
23908
24304
|
}
|
|
23909
24305
|
}
|
|
23910
24306
|
)))))
|
|
23911
|
-
)), /* @__PURE__ */
|
|
24307
|
+
)), /* @__PURE__ */ React235.createElement(Divider18, null), /* @__PURE__ */ React235.createElement(Stack148, { gap: "xs" }, /* @__PURE__ */ React235.createElement(
|
|
23912
24308
|
Checkbox12,
|
|
23913
24309
|
{
|
|
23914
24310
|
label: "Set expiration",
|
|
23915
24311
|
checked: expirationEnabled,
|
|
23916
24312
|
onChange: (e) => setExpirationEnabled(e.currentTarget.checked)
|
|
23917
24313
|
}
|
|
23918
|
-
), expirationEnabled && /* @__PURE__ */
|
|
24314
|
+
), expirationEnabled && /* @__PURE__ */ React235.createElement(
|
|
23919
24315
|
NumberInput3,
|
|
23920
24316
|
{
|
|
23921
24317
|
label: "Expires in (days)",
|
|
@@ -23925,7 +24321,7 @@ var GrantPermissionModal = ({
|
|
|
23925
24321
|
min: 1,
|
|
23926
24322
|
max: 365
|
|
23927
24323
|
}
|
|
23928
|
-
)), /* @__PURE__ */
|
|
24324
|
+
)), /* @__PURE__ */ React235.createElement(
|
|
23929
24325
|
Checkbox12,
|
|
23930
24326
|
{
|
|
23931
24327
|
label: "Recipient can grant permissions to others",
|
|
@@ -23933,7 +24329,7 @@ var GrantPermissionModal = ({
|
|
|
23933
24329
|
checked: canDelegate,
|
|
23934
24330
|
onChange: (e) => setCanDelegate(e.currentTarget.checked)
|
|
23935
24331
|
}
|
|
23936
|
-
), /* @__PURE__ */
|
|
24332
|
+
), /* @__PURE__ */ React235.createElement(Divider18, null), /* @__PURE__ */ React235.createElement(
|
|
23937
24333
|
TextInput9,
|
|
23938
24334
|
{
|
|
23939
24335
|
label: "Enter your PIN to sign this delegation",
|
|
@@ -23942,7 +24338,7 @@ var GrantPermissionModal = ({
|
|
|
23942
24338
|
value: pin,
|
|
23943
24339
|
onChange: (e) => setPin(e.currentTarget.value)
|
|
23944
24340
|
}
|
|
23945
|
-
), error && /* @__PURE__ */
|
|
24341
|
+
), error && /* @__PURE__ */ React235.createElement(Alert32, { color: "red" }, error), /* @__PURE__ */ React235.createElement(Group80, { justify: "flex-end" }, /* @__PURE__ */ React235.createElement(Button40, { variant: "subtle", onClick: handleClose, disabled: loading }, "Cancel"), /* @__PURE__ */ React235.createElement(Button40, { onClick: handleGrant, loading }, "Grant Permission")))
|
|
23946
24342
|
);
|
|
23947
24343
|
};
|
|
23948
24344
|
|
|
@@ -24049,4 +24445,4 @@ export {
|
|
|
24049
24445
|
ixoGraphQLClient,
|
|
24050
24446
|
getEntity
|
|
24051
24447
|
};
|
|
24052
|
-
//# sourceMappingURL=chunk-
|
|
24448
|
+
//# sourceMappingURL=chunk-CZDCWQZR.mjs.map
|