@ixo/editor 2.24.0 → 2.25.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-44NJWFQK.mjs} +633 -224
- package/dist/chunk-44NJWFQK.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;
|
|
@@ -20821,6 +20852,359 @@ var GovernanceGroupBlockSpec = createReactBlockSpec19(
|
|
|
20821
20852
|
}
|
|
20822
20853
|
);
|
|
20823
20854
|
|
|
20855
|
+
// src/mantine/blocks/flowLink/FlowLinkBlockSpec.tsx
|
|
20856
|
+
import React224 from "react";
|
|
20857
|
+
import { createReactBlockSpec as createReactBlockSpec20 } from "@blocknote/react";
|
|
20858
|
+
|
|
20859
|
+
// src/mantine/blocks/flowLink/FlowLinkBlock.tsx
|
|
20860
|
+
import React223 from "react";
|
|
20861
|
+
|
|
20862
|
+
// src/mantine/blocks/flowLink/template/TemplateView.tsx
|
|
20863
|
+
import React220, { useMemo as useMemo71 } from "react";
|
|
20864
|
+
import { Group as Group72, Stack as Stack142, Text as Text117 } from "@mantine/core";
|
|
20865
|
+
|
|
20866
|
+
// src/mantine/blocks/flowLink/template/TemplateConfig.tsx
|
|
20867
|
+
import React219 from "react";
|
|
20868
|
+
|
|
20869
|
+
// src/mantine/blocks/flowLink/template/GeneralTab.tsx
|
|
20870
|
+
import React217 from "react";
|
|
20871
|
+
import { Stack as Stack140 } from "@mantine/core";
|
|
20872
|
+
var GeneralTab16 = ({ title, description, icon, onTitleChange, onDescriptionChange, onIconChange }) => {
|
|
20873
|
+
const iconOptions = Object.keys(ICON_MAP).map((key) => ({
|
|
20874
|
+
value: key,
|
|
20875
|
+
label: key.split("-").map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join(" ")
|
|
20876
|
+
}));
|
|
20877
|
+
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(
|
|
20878
|
+
BaseTextArea,
|
|
20879
|
+
{
|
|
20880
|
+
label: "Description",
|
|
20881
|
+
placeholder: "Enter description (shown in panel)",
|
|
20882
|
+
value: description,
|
|
20883
|
+
onChange: (e) => onDescriptionChange(e.currentTarget.value),
|
|
20884
|
+
minRows: 3
|
|
20885
|
+
}
|
|
20886
|
+
), /* @__PURE__ */ React217.createElement(
|
|
20887
|
+
BaseSelect,
|
|
20888
|
+
{
|
|
20889
|
+
label: "Icon",
|
|
20890
|
+
placeholder: "Select an icon",
|
|
20891
|
+
value: icon || "external-link",
|
|
20892
|
+
onChange: (value) => onIconChange(value || "external-link"),
|
|
20893
|
+
data: iconOptions,
|
|
20894
|
+
searchable: true
|
|
20895
|
+
}
|
|
20896
|
+
));
|
|
20897
|
+
};
|
|
20898
|
+
|
|
20899
|
+
// src/mantine/blocks/flowLink/template/LinksTab.tsx
|
|
20900
|
+
import React218, { useMemo as useMemo70 } from "react";
|
|
20901
|
+
import { Stack as Stack141, Card as Card20, Group as Group71, ActionIcon as ActionIcon33, Text as Text116, Divider as Divider16 } from "@mantine/core";
|
|
20902
|
+
import { IconPlus as IconPlus6, IconTrash as IconTrash7, IconGripVertical } from "@tabler/icons-react";
|
|
20903
|
+
import { DndContext, PointerSensor, useSensor, useSensors, closestCenter, useDraggable, useDroppable } from "@dnd-kit/core";
|
|
20904
|
+
|
|
20905
|
+
// src/core/utils/json.ts
|
|
20906
|
+
function safeParseJSONArray(jsonString) {
|
|
20907
|
+
if (!jsonString || jsonString === "[]") {
|
|
20908
|
+
return [];
|
|
20909
|
+
}
|
|
20910
|
+
try {
|
|
20911
|
+
const parsed = JSON.parse(jsonString);
|
|
20912
|
+
return Array.isArray(parsed) ? parsed : [];
|
|
20913
|
+
} catch {
|
|
20914
|
+
return [];
|
|
20915
|
+
}
|
|
20916
|
+
}
|
|
20917
|
+
function generateId(prefix) {
|
|
20918
|
+
return `${prefix}_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 10)}`;
|
|
20919
|
+
}
|
|
20920
|
+
|
|
20921
|
+
// src/mantine/blocks/flowLink/template/LinksTab.tsx
|
|
20922
|
+
var DraggableLinkCard = ({ link, index, onRemove, onUpdate }) => {
|
|
20923
|
+
const { attributes, listeners, setNodeRef: setDragRef, transform, isDragging } = useDraggable({ id: link.id });
|
|
20924
|
+
const { setNodeRef: setDropRef, isOver } = useDroppable({ id: link.id });
|
|
20925
|
+
const style = {
|
|
20926
|
+
transform: transform ? `translate3d(${transform.x}px, ${transform.y}px, 0)` : void 0,
|
|
20927
|
+
opacity: isDragging ? 0.5 : 1,
|
|
20928
|
+
border: isOver ? "2px dashed var(--mantine-color-accent-5)" : void 0
|
|
20929
|
+
};
|
|
20930
|
+
return /* @__PURE__ */ React218.createElement("div", { ref: setDropRef }, /* @__PURE__ */ React218.createElement(Card20, { p: "sm", style }, /* @__PURE__ */ React218.createElement(Stack141, { gap: "xs" }, /* @__PURE__ */ React218.createElement(Group71, { justify: "space-between", align: "flex-start" }, /* @__PURE__ */ React218.createElement(Group71, { 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(
|
|
20931
|
+
BaseTextInput,
|
|
20932
|
+
{
|
|
20933
|
+
label: "Description",
|
|
20934
|
+
placeholder: "Optional text to place above the link title",
|
|
20935
|
+
value: link.description,
|
|
20936
|
+
onChange: (e) => onUpdate(link.id, "description", e.currentTarget.value)
|
|
20937
|
+
}
|
|
20938
|
+
), /* @__PURE__ */ React218.createElement(
|
|
20939
|
+
BaseTextInput,
|
|
20940
|
+
{
|
|
20941
|
+
label: "Document Room ID",
|
|
20942
|
+
placeholder: "!roomId:matrix.server",
|
|
20943
|
+
value: link.docRoomId,
|
|
20944
|
+
onChange: (e) => onUpdate(link.id, "docRoomId", e.currentTarget.value),
|
|
20945
|
+
description: "Matrix room ID of the target flow document"
|
|
20946
|
+
}
|
|
20947
|
+
), /* @__PURE__ */ React218.createElement(
|
|
20948
|
+
BaseTextArea,
|
|
20949
|
+
{
|
|
20950
|
+
label: "Caption",
|
|
20951
|
+
placeholder: "Optional text to place below the link title",
|
|
20952
|
+
minRows: 2,
|
|
20953
|
+
value: link.captionText,
|
|
20954
|
+
onChange: (e) => onUpdate(link.id, "captionText", e.currentTarget.value)
|
|
20955
|
+
}
|
|
20956
|
+
))));
|
|
20957
|
+
};
|
|
20958
|
+
var LinksTab = ({ links, onLinksChange }) => {
|
|
20959
|
+
const sensors = useSensors(useSensor(PointerSensor, { activationConstraint: { distance: 8 } }));
|
|
20960
|
+
const sortedLinks = useMemo70(() => [...links].sort((a, b) => a.position - b.position), [links]);
|
|
20961
|
+
const handleAddLink = () => {
|
|
20962
|
+
const maxPosition = links.length > 0 ? Math.max(...links.map((l) => l.position)) : -1;
|
|
20963
|
+
const newLink = {
|
|
20964
|
+
id: generateId("link"),
|
|
20965
|
+
docRoomId: "",
|
|
20966
|
+
title: "",
|
|
20967
|
+
captionText: "",
|
|
20968
|
+
description: "",
|
|
20969
|
+
position: maxPosition + 1
|
|
20970
|
+
};
|
|
20971
|
+
onLinksChange([...links, newLink]);
|
|
20972
|
+
};
|
|
20973
|
+
const handleRemoveLink = (id) => {
|
|
20974
|
+
const filtered = links.filter((link) => link.id !== id);
|
|
20975
|
+
const reordered = filtered.map((link, idx) => ({ ...link, position: idx }));
|
|
20976
|
+
onLinksChange(reordered);
|
|
20977
|
+
};
|
|
20978
|
+
const handleUpdateLink = (id, field, value) => {
|
|
20979
|
+
onLinksChange(links.map((link) => link.id === id ? { ...link, [field]: value } : link));
|
|
20980
|
+
};
|
|
20981
|
+
const handleDragEnd = (event) => {
|
|
20982
|
+
const { active, over } = event;
|
|
20983
|
+
if (!over || active.id === over.id) return;
|
|
20984
|
+
const activeLink = links.find((l) => l.id === active.id);
|
|
20985
|
+
const overLink = links.find((l) => l.id === over.id);
|
|
20986
|
+
if (!activeLink || !overLink) return;
|
|
20987
|
+
const oldIndex = sortedLinks.findIndex((l) => l.id === active.id);
|
|
20988
|
+
const newIndex = sortedLinks.findIndex((l) => l.id === over.id);
|
|
20989
|
+
const reordered = [...sortedLinks];
|
|
20990
|
+
const [moved] = reordered.splice(oldIndex, 1);
|
|
20991
|
+
reordered.splice(newIndex, 0, moved);
|
|
20992
|
+
const updated = reordered.map((link, idx) => ({ ...link, position: idx }));
|
|
20993
|
+
onLinksChange(updated);
|
|
20994
|
+
};
|
|
20995
|
+
return /* @__PURE__ */ React218.createElement(Stack141, { gap: "md" }, /* @__PURE__ */ React218.createElement(Group71, { 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 })))));
|
|
20996
|
+
};
|
|
20997
|
+
|
|
20998
|
+
// src/mantine/blocks/flowLink/template/TemplateConfig.tsx
|
|
20999
|
+
var TemplateConfig16 = ({ editor, block }) => {
|
|
21000
|
+
const { closePanel } = usePanelStore();
|
|
21001
|
+
const updateProp = (key, value) => {
|
|
21002
|
+
editor.updateBlock(block, { props: { ...block.props, [key]: value } });
|
|
21003
|
+
};
|
|
21004
|
+
const links = safeParseJSONArray(block.props.links);
|
|
21005
|
+
const handleLinksChange = (newLinks) => {
|
|
21006
|
+
updateProp("links", JSON.stringify(newLinks));
|
|
21007
|
+
};
|
|
21008
|
+
return /* @__PURE__ */ React219.createElement(BaseRightPanelLayout, { title: "Flow Link Settings", onClose: closePanel }, /* @__PURE__ */ React219.createElement(
|
|
21009
|
+
ReusablePanel,
|
|
21010
|
+
{
|
|
21011
|
+
extraTabs: [
|
|
21012
|
+
{
|
|
21013
|
+
label: "General",
|
|
21014
|
+
value: "general",
|
|
21015
|
+
content: /* @__PURE__ */ React219.createElement(
|
|
21016
|
+
GeneralTab16,
|
|
21017
|
+
{
|
|
21018
|
+
title: block.props.title || "",
|
|
21019
|
+
description: block.props.description || "",
|
|
21020
|
+
icon: block.props.icon || "external-link",
|
|
21021
|
+
onTitleChange: (value) => updateProp("title", value),
|
|
21022
|
+
onDescriptionChange: (value) => updateProp("description", value),
|
|
21023
|
+
onIconChange: (value) => updateProp("icon", value)
|
|
21024
|
+
}
|
|
21025
|
+
)
|
|
21026
|
+
},
|
|
21027
|
+
{
|
|
21028
|
+
label: "Links",
|
|
21029
|
+
value: "links",
|
|
21030
|
+
content: /* @__PURE__ */ React219.createElement(LinksTab, { links, onLinksChange: handleLinksChange })
|
|
21031
|
+
}
|
|
21032
|
+
],
|
|
21033
|
+
context: { editor, block }
|
|
21034
|
+
}
|
|
21035
|
+
));
|
|
21036
|
+
};
|
|
21037
|
+
|
|
21038
|
+
// src/mantine/blocks/flowLink/template/TemplateView.tsx
|
|
21039
|
+
var FLOW_LINK_TEMPLATE_PANEL_ID = "flow-link-template-panel";
|
|
21040
|
+
var FlowLinkTemplateView = ({ editor, block }) => {
|
|
21041
|
+
const panelId = `${FLOW_LINK_TEMPLATE_PANEL_ID}-${block.id}`;
|
|
21042
|
+
const panelContent = useMemo71(() => /* @__PURE__ */ React220.createElement(TemplateConfig16, { editor, block }), [editor, block]);
|
|
21043
|
+
const { open } = usePanel(panelId, panelContent);
|
|
21044
|
+
const links = safeParseJSONArray(block.props.links);
|
|
21045
|
+
const linksCount = links.length;
|
|
21046
|
+
return /* @__PURE__ */ React220.createElement(BaseContainer, { onClick: open }, /* @__PURE__ */ React220.createElement(Group72, { wrap: "nowrap", justify: "space-between", align: "center" }, /* @__PURE__ */ React220.createElement(Group72, { 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"))))));
|
|
21047
|
+
};
|
|
21048
|
+
|
|
21049
|
+
// src/mantine/blocks/flowLink/flow/FlowView.tsx
|
|
21050
|
+
import React222, { useMemo as useMemo72 } from "react";
|
|
21051
|
+
import { Badge as Badge38, Group as Group74, Stack as Stack144, Text as Text119, Tooltip as Tooltip25 } from "@mantine/core";
|
|
21052
|
+
|
|
21053
|
+
// src/mantine/blocks/flowLink/flow/FlowLinkPanel.tsx
|
|
21054
|
+
import React221, { useState as useState75, useEffect as useEffect55, useCallback as useCallback59 } from "react";
|
|
21055
|
+
import { Stack as Stack143, Text as Text118, Card as Card21, Group as Group73, Badge as Badge37, ActionIcon as ActionIcon34, Loader as Loader27, Tooltip as Tooltip24 } from "@mantine/core";
|
|
21056
|
+
import { IconRefresh as IconRefresh8, IconCheck as IconCheck12, IconClock as IconClock3, IconCircleDashed as IconCircleDashed4 } from "@tabler/icons-react";
|
|
21057
|
+
var FlowLinkPanel = ({ block }) => {
|
|
21058
|
+
const { closePanel } = usePanelStore();
|
|
21059
|
+
const handlers = useBlocknoteHandlers();
|
|
21060
|
+
const links = safeParseJSONArray(block.props.links).sort((a, b) => a.position - b.position);
|
|
21061
|
+
const [linksWithStatus, setLinksWithStatus] = useState75(links.map((link) => ({ ...link })));
|
|
21062
|
+
const fetchStatuses = useCallback59(async () => {
|
|
21063
|
+
if (!handlers.getFlowStatus) {
|
|
21064
|
+
return;
|
|
21065
|
+
}
|
|
21066
|
+
setLinksWithStatus((prev) => prev.map((link) => ({ ...link, isLoading: true, error: void 0 })));
|
|
21067
|
+
const updatedLinks = await Promise.all(
|
|
21068
|
+
links.map(async (link) => {
|
|
21069
|
+
try {
|
|
21070
|
+
const statusData = await handlers.getFlowStatus(link.docRoomId);
|
|
21071
|
+
return { ...link, statusData, isLoading: false };
|
|
21072
|
+
} catch (err) {
|
|
21073
|
+
return { ...link, isLoading: false, error: err instanceof Error ? err.message : "Failed to fetch status" };
|
|
21074
|
+
}
|
|
21075
|
+
})
|
|
21076
|
+
);
|
|
21077
|
+
setLinksWithStatus(updatedLinks);
|
|
21078
|
+
}, [handlers, links]);
|
|
21079
|
+
useEffect55(() => {
|
|
21080
|
+
fetchStatuses();
|
|
21081
|
+
}, []);
|
|
21082
|
+
const handleNavigate = (docRoomId) => {
|
|
21083
|
+
if (handlers.navigateToFlow) {
|
|
21084
|
+
handlers.navigateToFlow(docRoomId);
|
|
21085
|
+
}
|
|
21086
|
+
};
|
|
21087
|
+
const getStatusBadge = (link) => {
|
|
21088
|
+
if (link.isLoading) {
|
|
21089
|
+
return /* @__PURE__ */ React221.createElement(Badge37, { display: "inline-block", size: "sm", variant: "light", color: "gray", leftSection: /* @__PURE__ */ React221.createElement(Loader27, { size: 10 }) }, "Loading");
|
|
21090
|
+
}
|
|
21091
|
+
if (link.error) {
|
|
21092
|
+
return /* @__PURE__ */ React221.createElement(Tooltip24, { label: link.error }, /* @__PURE__ */ React221.createElement(Badge37, { display: "inline-block", size: "sm", variant: "light", color: "red" }, "Error"));
|
|
21093
|
+
}
|
|
21094
|
+
if (!link.statusData) {
|
|
21095
|
+
return null;
|
|
21096
|
+
}
|
|
21097
|
+
const status = link.statusData.status;
|
|
21098
|
+
switch (status) {
|
|
21099
|
+
case "completed":
|
|
21100
|
+
return /* @__PURE__ */ React221.createElement(Badge37, { display: "inline-block", size: "sm", variant: "light", color: "green", leftSection: /* @__PURE__ */ React221.createElement(IconCheck12, { size: 12 }) }, "Completed");
|
|
21101
|
+
case "in_progress":
|
|
21102
|
+
return /* @__PURE__ */ React221.createElement(Badge37, { display: "inline-block", size: "sm", variant: "light", color: "blue", leftSection: /* @__PURE__ */ React221.createElement(IconClock3, { size: 12 }) }, "In Progress");
|
|
21103
|
+
case "not_started":
|
|
21104
|
+
default:
|
|
21105
|
+
return /* @__PURE__ */ React221.createElement(Badge37, { display: "inline-block", size: "sm", variant: "light", color: "gray", leftSection: /* @__PURE__ */ React221.createElement(IconCircleDashed4, { size: 12 }) }, "Not Started");
|
|
21106
|
+
}
|
|
21107
|
+
};
|
|
21108
|
+
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(
|
|
21109
|
+
BaseContainer,
|
|
21110
|
+
{
|
|
21111
|
+
onClick: () => handlers.navigateToFlow && handleNavigate(link.docRoomId),
|
|
21112
|
+
style: { opacity: !handlers.navigateToFlow ? 0.6 : 1, minHeight: 84, cursor: !handlers.navigateToFlow ? "not-allowed" : "pointer" }
|
|
21113
|
+
},
|
|
21114
|
+
/* @__PURE__ */ React221.createElement(Group73, { 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(Group73, { 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()))
|
|
21115
|
+
))))));
|
|
21116
|
+
};
|
|
21117
|
+
|
|
21118
|
+
// src/mantine/blocks/flowLink/flow/FlowView.tsx
|
|
21119
|
+
var FLOW_LINK_FLOW_PANEL_ID = "flow-link-flow-panel";
|
|
21120
|
+
var FlowLinkFlowView = ({ editor, block, isDisabled }) => {
|
|
21121
|
+
const disabled = isDisabled?.isDisabled === "disable";
|
|
21122
|
+
const links = safeParseJSONArray(block.props.links);
|
|
21123
|
+
const linksCount = links.length;
|
|
21124
|
+
const panelId = `${FLOW_LINK_FLOW_PANEL_ID}-${block.id}`;
|
|
21125
|
+
const panelContent = useMemo72(() => /* @__PURE__ */ React222.createElement(FlowLinkPanel, { editor, block }), [editor, block]);
|
|
21126
|
+
const { open } = usePanel(panelId, panelContent);
|
|
21127
|
+
const handleClick = () => {
|
|
21128
|
+
if (!disabled) {
|
|
21129
|
+
open();
|
|
21130
|
+
}
|
|
21131
|
+
};
|
|
21132
|
+
const getBadgeProps = () => {
|
|
21133
|
+
if (linksCount === 0) {
|
|
21134
|
+
return { color: "neutralColor.5", text: "No links" };
|
|
21135
|
+
}
|
|
21136
|
+
return { color: "accent.5", text: `${linksCount} link${linksCount !== 1 ? "s" : ""}` };
|
|
21137
|
+
};
|
|
21138
|
+
const badgeProps = getBadgeProps();
|
|
21139
|
+
const cardContent = /* @__PURE__ */ React222.createElement(BaseContainer, { onClick: handleClick, style: { opacity: disabled ? 0.6 : 1, cursor: disabled ? "not-allowed" : "pointer" } }, /* @__PURE__ */ React222.createElement(Group74, { 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(Group74, { 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")))));
|
|
21140
|
+
if (disabled && isDisabled?.message) {
|
|
21141
|
+
return /* @__PURE__ */ React222.createElement(Tooltip25, { label: isDisabled.message }, cardContent);
|
|
21142
|
+
}
|
|
21143
|
+
return cardContent;
|
|
21144
|
+
};
|
|
21145
|
+
|
|
21146
|
+
// src/mantine/blocks/flowLink/FlowLinkBlock.tsx
|
|
21147
|
+
function FlowLinkBlock({ editor, block }) {
|
|
21148
|
+
const { docType } = useBlocknoteContext();
|
|
21149
|
+
const { actions } = useBlockConditions(block, editor);
|
|
21150
|
+
if (docType === "template") {
|
|
21151
|
+
return /* @__PURE__ */ React223.createElement(FlowLinkTemplateView, { editor, block });
|
|
21152
|
+
}
|
|
21153
|
+
const conditionConfig = parseConditionConfig(block.props.conditions);
|
|
21154
|
+
const hasVisibility = hasVisibilityConditions(conditionConfig);
|
|
21155
|
+
const showActionExists = actions.some((a) => a.action === "show");
|
|
21156
|
+
const shouldHide = hasVisibility && !showActionExists;
|
|
21157
|
+
if (shouldHide) {
|
|
21158
|
+
return null;
|
|
21159
|
+
}
|
|
21160
|
+
const hasEnable = hasEnableConditions(conditionConfig);
|
|
21161
|
+
const enableActionExists = actions.some((a) => a.action === "enable");
|
|
21162
|
+
const shouldDisable = hasEnable && !enableActionExists;
|
|
21163
|
+
return /* @__PURE__ */ React223.createElement(
|
|
21164
|
+
FlowLinkFlowView,
|
|
21165
|
+
{
|
|
21166
|
+
block,
|
|
21167
|
+
editor,
|
|
21168
|
+
isDisabled: shouldDisable ? {
|
|
21169
|
+
isDisabled: "disable",
|
|
21170
|
+
message: "This block is currently disabled by conditions"
|
|
21171
|
+
} : void 0
|
|
21172
|
+
}
|
|
21173
|
+
);
|
|
21174
|
+
}
|
|
21175
|
+
var FlowLinkBlock_default = FlowLinkBlock;
|
|
21176
|
+
|
|
21177
|
+
// src/mantine/blocks/flowLink/FlowLinkBlockSpec.tsx
|
|
21178
|
+
var FlowLinkBlockSpec = createReactBlockSpec20(
|
|
21179
|
+
{
|
|
21180
|
+
type: "flowLink",
|
|
21181
|
+
propSchema: {
|
|
21182
|
+
title: {
|
|
21183
|
+
default: ""
|
|
21184
|
+
},
|
|
21185
|
+
description: {
|
|
21186
|
+
default: ""
|
|
21187
|
+
},
|
|
21188
|
+
icon: {
|
|
21189
|
+
default: "external-link"
|
|
21190
|
+
},
|
|
21191
|
+
links: {
|
|
21192
|
+
default: "[]"
|
|
21193
|
+
},
|
|
21194
|
+
conditions: {
|
|
21195
|
+
default: ""
|
|
21196
|
+
}
|
|
21197
|
+
},
|
|
21198
|
+
content: "none"
|
|
21199
|
+
},
|
|
21200
|
+
{
|
|
21201
|
+
render: (props) => {
|
|
21202
|
+
const ixoProps = props;
|
|
21203
|
+
return /* @__PURE__ */ React224.createElement(FlowLinkBlock_default, { ...ixoProps });
|
|
21204
|
+
}
|
|
21205
|
+
}
|
|
21206
|
+
);
|
|
21207
|
+
|
|
20824
21208
|
// src/mantine/blocks/registry/blockRegistry.ts
|
|
20825
21209
|
var BlockRegistry = class {
|
|
20826
21210
|
constructor() {
|
|
@@ -20992,10 +21376,10 @@ blockRegistry.register({
|
|
|
20992
21376
|
});
|
|
20993
21377
|
|
|
20994
21378
|
// src/mantine/blocks/hooks/useBlockDependencies.ts
|
|
20995
|
-
import { useMemo as
|
|
21379
|
+
import { useMemo as useMemo73, useEffect as useEffect56, useState as useState76, useCallback as useCallback60 } from "react";
|
|
20996
21380
|
|
|
20997
21381
|
// src/mantine/blocks/hooks/useDependsOn.ts
|
|
20998
|
-
import { useMemo as
|
|
21382
|
+
import { useMemo as useMemo74 } from "react";
|
|
20999
21383
|
|
|
21000
21384
|
// src/mantine/blocks/index.ts
|
|
21001
21385
|
var blockSpecs = {
|
|
@@ -21017,7 +21401,8 @@ var blockSpecs = {
|
|
|
21017
21401
|
form: FormBlockSpec,
|
|
21018
21402
|
domainCreatorSign: DomainCreatorSignBlockSpec,
|
|
21019
21403
|
domainCardViewer: DomainCardViewerBlockSpec,
|
|
21020
|
-
governanceGroup: GovernanceGroupBlockSpec
|
|
21404
|
+
governanceGroup: GovernanceGroupBlockSpec,
|
|
21405
|
+
flowLink: FlowLinkBlockSpec
|
|
21021
21406
|
};
|
|
21022
21407
|
var getExtraSlashMenuItems = (editor) => {
|
|
21023
21408
|
const slashMenuList = [
|
|
@@ -21457,6 +21842,30 @@ var getExtraSlashMenuItems = (editor) => {
|
|
|
21457
21842
|
aliases: ["domain-card", "domain-viewer", "card-preview"],
|
|
21458
21843
|
group: "Domains",
|
|
21459
21844
|
subtext: "Preview domain card before signing"
|
|
21845
|
+
},
|
|
21846
|
+
{
|
|
21847
|
+
title: "Flow Link",
|
|
21848
|
+
onItemClick: () => {
|
|
21849
|
+
editor.insertBlocks(
|
|
21850
|
+
[
|
|
21851
|
+
{
|
|
21852
|
+
type: "flowLink",
|
|
21853
|
+
props: {
|
|
21854
|
+
title: "",
|
|
21855
|
+
description: "",
|
|
21856
|
+
icon: "external-link",
|
|
21857
|
+
links: "[]",
|
|
21858
|
+
conditions: ""
|
|
21859
|
+
}
|
|
21860
|
+
}
|
|
21861
|
+
],
|
|
21862
|
+
editor.getTextCursorPosition().block,
|
|
21863
|
+
"after"
|
|
21864
|
+
);
|
|
21865
|
+
},
|
|
21866
|
+
aliases: ["flow-link", "link", "navigate", "redirect"],
|
|
21867
|
+
group: "Flows",
|
|
21868
|
+
subtext: "Link to other flow documents"
|
|
21460
21869
|
}
|
|
21461
21870
|
];
|
|
21462
21871
|
const yRoot = editor?._yRoot;
|
|
@@ -21537,15 +21946,15 @@ import { useCreateBlockNote as useCreateBlockNote2 } from "@blocknote/react";
|
|
|
21537
21946
|
import { BlockNoteSchema as BlockNoteSchema2, defaultBlockSpecs as defaultBlockSpecs2, defaultInlineContentSpecs as defaultInlineContentSpecs2, defaultStyleSpecs as defaultStyleSpecs2 } from "@blocknote/core";
|
|
21538
21947
|
|
|
21539
21948
|
// src/core/hooks/useMatrixProvider.ts
|
|
21540
|
-
import { useEffect as
|
|
21949
|
+
import { useEffect as useEffect57, useState as useState77, useRef as useRef12, useCallback as useCallback61, useMemo as useMemo75 } from "react";
|
|
21541
21950
|
import { MatrixProvider } from "@ixo/matrix-crdt";
|
|
21542
21951
|
function useMatrixProvider({ matrixClient, roomId, yDoc }) {
|
|
21543
|
-
const [matrixProvider, setProvider] =
|
|
21544
|
-
const [status, setStatus] =
|
|
21952
|
+
const [matrixProvider, setProvider] = useState77(null);
|
|
21953
|
+
const [status, setStatus] = useState77("disconnected");
|
|
21545
21954
|
const isMountedRef = useRef12(true);
|
|
21546
21955
|
const providerRef = useRef12(null);
|
|
21547
21956
|
const retryTimeoutRef = useRef12(null);
|
|
21548
|
-
const providerOptions =
|
|
21957
|
+
const providerOptions = useMemo75(
|
|
21549
21958
|
() => ({
|
|
21550
21959
|
translator: {
|
|
21551
21960
|
updateEventType: "matrix-crdt.doc_update",
|
|
@@ -21558,22 +21967,22 @@ function useMatrixProvider({ matrixClient, roomId, yDoc }) {
|
|
|
21558
21967
|
}),
|
|
21559
21968
|
[]
|
|
21560
21969
|
);
|
|
21561
|
-
const handleDocumentAvailable =
|
|
21970
|
+
const handleDocumentAvailable = useCallback61(() => {
|
|
21562
21971
|
if (isMountedRef.current) {
|
|
21563
21972
|
setStatus("connected");
|
|
21564
21973
|
}
|
|
21565
21974
|
}, []);
|
|
21566
|
-
const handleDocumentUnavailable =
|
|
21975
|
+
const handleDocumentUnavailable = useCallback61(() => {
|
|
21567
21976
|
if (isMountedRef.current) {
|
|
21568
21977
|
setStatus("failed");
|
|
21569
21978
|
}
|
|
21570
21979
|
}, []);
|
|
21571
|
-
const handleCanWriteChanged =
|
|
21980
|
+
const handleCanWriteChanged = useCallback61(() => {
|
|
21572
21981
|
if (isMountedRef.current && providerRef.current) {
|
|
21573
21982
|
setStatus(providerRef.current.canWrite ? "connected" : "failed");
|
|
21574
21983
|
}
|
|
21575
21984
|
}, []);
|
|
21576
|
-
const initProvider =
|
|
21985
|
+
const initProvider = useCallback61(async () => {
|
|
21577
21986
|
if (!isMountedRef.current) return;
|
|
21578
21987
|
if (retryTimeoutRef.current) {
|
|
21579
21988
|
clearTimeout(retryTimeoutRef.current);
|
|
@@ -21606,7 +22015,7 @@ function useMatrixProvider({ matrixClient, roomId, yDoc }) {
|
|
|
21606
22015
|
}
|
|
21607
22016
|
}
|
|
21608
22017
|
}, [matrixClient, providerOptions, handleDocumentAvailable, handleDocumentUnavailable, handleCanWriteChanged]);
|
|
21609
|
-
|
|
22018
|
+
useEffect57(() => {
|
|
21610
22019
|
isMountedRef.current = true;
|
|
21611
22020
|
initProvider();
|
|
21612
22021
|
return () => {
|
|
@@ -21623,7 +22032,7 @@ function useMatrixProvider({ matrixClient, roomId, yDoc }) {
|
|
|
21623
22032
|
setStatus("disconnected");
|
|
21624
22033
|
};
|
|
21625
22034
|
}, [initProvider]);
|
|
21626
|
-
|
|
22035
|
+
useEffect57(() => {
|
|
21627
22036
|
return () => {
|
|
21628
22037
|
isMountedRef.current = false;
|
|
21629
22038
|
};
|
|
@@ -21632,17 +22041,17 @@ function useMatrixProvider({ matrixClient, roomId, yDoc }) {
|
|
|
21632
22041
|
}
|
|
21633
22042
|
|
|
21634
22043
|
// src/mantine/hooks/useCollaborativeYDoc.ts
|
|
21635
|
-
import { useMemo as
|
|
22044
|
+
import { useMemo as useMemo76 } from "react";
|
|
21636
22045
|
import * as Y from "yjs";
|
|
21637
22046
|
function useCollaborativeYDoc(_options) {
|
|
21638
|
-
return
|
|
22047
|
+
return useMemo76(() => {
|
|
21639
22048
|
const doc = new Y.Doc();
|
|
21640
22049
|
return doc;
|
|
21641
22050
|
}, []);
|
|
21642
22051
|
}
|
|
21643
22052
|
|
|
21644
22053
|
// src/mantine/hooks/useCollaborativeIxoEditor.ts
|
|
21645
|
-
import { useMemo as
|
|
22054
|
+
import { useMemo as useMemo77, useEffect as useEffect58, useState as useState78 } from "react";
|
|
21646
22055
|
|
|
21647
22056
|
// src/core/lib/matrixMetadata.ts
|
|
21648
22057
|
var COVER_IMAGE_EVENT_TYPE = "ixo.page.cover_image";
|
|
@@ -21811,7 +22220,7 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
21811
22220
|
matrixClient,
|
|
21812
22221
|
permissions = { write: false }
|
|
21813
22222
|
} = options || {};
|
|
21814
|
-
const memoizedUser =
|
|
22223
|
+
const memoizedUser = useMemo77(
|
|
21815
22224
|
() => ({
|
|
21816
22225
|
id: user?.id || "",
|
|
21817
22226
|
name: user?.name || "",
|
|
@@ -21826,13 +22235,13 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
21826
22235
|
matrixClient,
|
|
21827
22236
|
roomId: options.roomId
|
|
21828
22237
|
});
|
|
21829
|
-
const metadataManager =
|
|
21830
|
-
|
|
22238
|
+
const metadataManager = useMemo77(() => new MatrixMetadataManager(matrixClient, options.roomId), [matrixClient, options.roomId]);
|
|
22239
|
+
useEffect58(() => {
|
|
21831
22240
|
return () => {
|
|
21832
22241
|
metadataManager.dispose();
|
|
21833
22242
|
};
|
|
21834
22243
|
}, [metadataManager]);
|
|
21835
|
-
const defaultUploadFile =
|
|
22244
|
+
const defaultUploadFile = useMemo77(
|
|
21836
22245
|
() => uploadFile || (async (file) => {
|
|
21837
22246
|
return new Promise((resolve, reject) => {
|
|
21838
22247
|
const reader = new FileReader();
|
|
@@ -21846,7 +22255,7 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
21846
22255
|
}),
|
|
21847
22256
|
[uploadFile]
|
|
21848
22257
|
);
|
|
21849
|
-
const schema =
|
|
22258
|
+
const schema = useMemo77(
|
|
21850
22259
|
() => BlockNoteSchema2.create({
|
|
21851
22260
|
blockSpecs: {
|
|
21852
22261
|
...defaultBlockSpecs2,
|
|
@@ -21861,13 +22270,13 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
21861
22270
|
}),
|
|
21862
22271
|
[]
|
|
21863
22272
|
);
|
|
21864
|
-
const root =
|
|
21865
|
-
const documentFragment =
|
|
21866
|
-
const flowArray =
|
|
21867
|
-
const runtimeMap =
|
|
21868
|
-
const delegationsMap =
|
|
21869
|
-
const userFragment =
|
|
21870
|
-
const collaborationConfig =
|
|
22273
|
+
const root = useMemo77(() => yDoc.getMap("root"), [yDoc]);
|
|
22274
|
+
const documentFragment = useMemo77(() => yDoc.getXmlFragment("document"), [yDoc]);
|
|
22275
|
+
const flowArray = useMemo77(() => yDoc.getArray("flow"), [yDoc]);
|
|
22276
|
+
const runtimeMap = useMemo77(() => yDoc.getMap("runtime"), [yDoc]);
|
|
22277
|
+
const delegationsMap = useMemo77(() => yDoc.getMap("delegations"), [yDoc]);
|
|
22278
|
+
const userFragment = useMemo77(() => yDoc.getMap(memoizedUser.id), [yDoc, memoizedUser.id]);
|
|
22279
|
+
const collaborationConfig = useMemo77(
|
|
21871
22280
|
() => ({
|
|
21872
22281
|
provider: matrixProvider,
|
|
21873
22282
|
fragment: documentFragment,
|
|
@@ -21879,7 +22288,7 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
21879
22288
|
}),
|
|
21880
22289
|
[matrixProvider, documentFragment, memoizedUser.name, memoizedUser.color]
|
|
21881
22290
|
);
|
|
21882
|
-
const ixoConfig =
|
|
22291
|
+
const ixoConfig = useMemo77(
|
|
21883
22292
|
() => ({
|
|
21884
22293
|
theme,
|
|
21885
22294
|
editable,
|
|
@@ -21898,7 +22307,7 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
21898
22307
|
uploadFile: defaultUploadFile,
|
|
21899
22308
|
collaboration: collaborationConfig
|
|
21900
22309
|
});
|
|
21901
|
-
const titleText =
|
|
22310
|
+
const titleText = useMemo77(() => yDoc.getText("title"), [yDoc]);
|
|
21902
22311
|
let ixoEditor;
|
|
21903
22312
|
if (editor) {
|
|
21904
22313
|
ixoEditor = editor;
|
|
@@ -22054,12 +22463,12 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
22054
22463
|
return void 0;
|
|
22055
22464
|
};
|
|
22056
22465
|
}
|
|
22057
|
-
|
|
22466
|
+
useEffect58(() => {
|
|
22058
22467
|
if (ixoEditor) {
|
|
22059
22468
|
ixoEditor.isEditable = editable;
|
|
22060
22469
|
}
|
|
22061
22470
|
}, [ixoEditor, editable]);
|
|
22062
|
-
|
|
22471
|
+
useEffect58(() => {
|
|
22063
22472
|
if (connectionStatus !== "connected") {
|
|
22064
22473
|
return;
|
|
22065
22474
|
}
|
|
@@ -22081,9 +22490,9 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
22081
22490
|
titleText.insert(0, options.title);
|
|
22082
22491
|
}
|
|
22083
22492
|
}, [connectionStatus, root, titleText, permissions.write, options.docId, options.title, memoizedUser.id]);
|
|
22084
|
-
const [connectedUsers, setConnectedUsers] =
|
|
22493
|
+
const [connectedUsers, setConnectedUsers] = useState78([]);
|
|
22085
22494
|
const webrtcProvider = matrixProvider?.webrtcProvider;
|
|
22086
|
-
|
|
22495
|
+
useEffect58(() => {
|
|
22087
22496
|
if (!matrixProvider?.awarenessInstance || !webrtcProvider || connectionStatus !== "connected") {
|
|
22088
22497
|
return;
|
|
22089
22498
|
}
|
|
@@ -22102,7 +22511,7 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
22102
22511
|
awareness.off("change", updateUsers);
|
|
22103
22512
|
};
|
|
22104
22513
|
}, [matrixProvider, webrtcProvider, connectionStatus]);
|
|
22105
|
-
|
|
22514
|
+
useEffect58(() => {
|
|
22106
22515
|
if (!matrixProvider?.awarenessInstance || !webrtcProvider || connectionStatus !== "connected") {
|
|
22107
22516
|
return;
|
|
22108
22517
|
}
|
|
@@ -22140,15 +22549,15 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
22140
22549
|
}
|
|
22141
22550
|
|
|
22142
22551
|
// src/mantine/components/Base/BaseIconPicker.tsx
|
|
22143
|
-
import
|
|
22144
|
-
import { TextInput as TextInput7, Tabs as Tabs5, Box as Box40, Stack as
|
|
22552
|
+
import React226, { useState as useState79, useMemo as useMemo78, useEffect as useEffect59 } from "react";
|
|
22553
|
+
import { TextInput as TextInput7, Tabs as Tabs5, Box as Box40, Stack as Stack145, UnstyledButton as UnstyledButton2, Text as Text120, Center as Center12, ScrollArea as ScrollArea8, Group as Group75, Popover as Popover4 } from "@mantine/core";
|
|
22145
22554
|
import * as TablerIcons from "@tabler/icons-react";
|
|
22146
22555
|
import { IconSearch as IconSearch6, IconX as IconX10, IconChevronLeft, IconChevronRight as IconChevronRight11 } from "@tabler/icons-react";
|
|
22147
22556
|
|
|
22148
22557
|
// src/mantine/components/Base/CoverImageButton.tsx
|
|
22149
|
-
import
|
|
22558
|
+
import React225, { forwardRef } from "react";
|
|
22150
22559
|
import { Button as Button38 } from "@mantine/core";
|
|
22151
|
-
var CoverImageButton = forwardRef(({ isActive = false, onClick, children, style, ...props }, ref) => /* @__PURE__ */
|
|
22560
|
+
var CoverImageButton = forwardRef(({ isActive = false, onClick, children, style, ...props }, ref) => /* @__PURE__ */ React225.createElement(
|
|
22152
22561
|
Button38,
|
|
22153
22562
|
{
|
|
22154
22563
|
ref,
|
|
@@ -22198,28 +22607,28 @@ var localStorageService = {
|
|
|
22198
22607
|
var iconsKey = "editor_recent_icons";
|
|
22199
22608
|
var ICONS_PER_PAGE = 500;
|
|
22200
22609
|
function BaseIconPicker({ opened, onClose, onSelectIcon, onUploadClick, children, currentIcon }) {
|
|
22201
|
-
const [searchQuery, setSearchQuery] =
|
|
22202
|
-
const [activeTab, setActiveTab] =
|
|
22203
|
-
const [currentPage, setCurrentPage] =
|
|
22204
|
-
const allIcons =
|
|
22610
|
+
const [searchQuery, setSearchQuery] = useState79("");
|
|
22611
|
+
const [activeTab, setActiveTab] = useState79("icons");
|
|
22612
|
+
const [currentPage, setCurrentPage] = useState79(1);
|
|
22613
|
+
const allIcons = useMemo78(() => {
|
|
22205
22614
|
const iconEntries = Object.entries(TablerIcons).filter(([name]) => name.startsWith("Icon") && name !== "IconProps");
|
|
22206
22615
|
return iconEntries;
|
|
22207
22616
|
}, []);
|
|
22208
|
-
const filteredIcons =
|
|
22617
|
+
const filteredIcons = useMemo78(() => {
|
|
22209
22618
|
if (!searchQuery) return allIcons;
|
|
22210
22619
|
const query = searchQuery.toLowerCase();
|
|
22211
22620
|
return allIcons.filter(([name]) => name.toLowerCase().includes(query));
|
|
22212
22621
|
}, [allIcons, searchQuery]);
|
|
22213
|
-
|
|
22622
|
+
useEffect59(() => {
|
|
22214
22623
|
setCurrentPage(1);
|
|
22215
22624
|
}, [searchQuery]);
|
|
22216
|
-
const paginatedIcons =
|
|
22625
|
+
const paginatedIcons = useMemo78(() => {
|
|
22217
22626
|
const startIndex = (currentPage - 1) * ICONS_PER_PAGE;
|
|
22218
22627
|
const endIndex = startIndex + ICONS_PER_PAGE;
|
|
22219
22628
|
return filteredIcons.slice(startIndex, endIndex);
|
|
22220
22629
|
}, [filteredIcons, currentPage]);
|
|
22221
22630
|
const totalPages = Math.ceil(filteredIcons.length / ICONS_PER_PAGE);
|
|
22222
|
-
const recentIcons =
|
|
22631
|
+
const recentIcons = useMemo78(() => {
|
|
22223
22632
|
const recentIconNames = localStorageService.get(iconsKey);
|
|
22224
22633
|
if (!recentIconNames || recentIconNames.length === 0) return [];
|
|
22225
22634
|
return recentIconNames.slice(0, 24).map((iconName) => allIcons.find(([name]) => name === iconName)).filter((entry) => entry !== void 0);
|
|
@@ -22234,9 +22643,9 @@ function BaseIconPicker({ opened, onClose, onSelectIcon, onUploadClick, children
|
|
|
22234
22643
|
};
|
|
22235
22644
|
const renderIconGrid = (icons) => {
|
|
22236
22645
|
if (icons.length === 0) {
|
|
22237
|
-
return /* @__PURE__ */
|
|
22646
|
+
return /* @__PURE__ */ React226.createElement(Center12, { py: "xl" }, /* @__PURE__ */ React226.createElement(Text120, { c: "dimmed", size: "sm" }, "No icons found"));
|
|
22238
22647
|
}
|
|
22239
|
-
return /* @__PURE__ */
|
|
22648
|
+
return /* @__PURE__ */ React226.createElement(
|
|
22240
22649
|
Box40,
|
|
22241
22650
|
{
|
|
22242
22651
|
style: {
|
|
@@ -22248,7 +22657,7 @@ function BaseIconPicker({ opened, onClose, onSelectIcon, onUploadClick, children
|
|
|
22248
22657
|
},
|
|
22249
22658
|
icons.map(([name, IconComponent]) => {
|
|
22250
22659
|
const isSelected = currentIcon === name.replace("Icon", "").replace(/([A-Z])/g, "-$1").toLowerCase().slice(1);
|
|
22251
|
-
return /* @__PURE__ */
|
|
22660
|
+
return /* @__PURE__ */ React226.createElement(
|
|
22252
22661
|
UnstyledButton2,
|
|
22253
22662
|
{
|
|
22254
22663
|
key: name,
|
|
@@ -22274,12 +22683,12 @@ function BaseIconPicker({ opened, onClose, onSelectIcon, onUploadClick, children
|
|
|
22274
22683
|
}
|
|
22275
22684
|
}
|
|
22276
22685
|
},
|
|
22277
|
-
/* @__PURE__ */
|
|
22686
|
+
/* @__PURE__ */ React226.createElement(IconComponent, { color: "white", size: 24, stroke: 1.5 })
|
|
22278
22687
|
);
|
|
22279
22688
|
})
|
|
22280
22689
|
);
|
|
22281
22690
|
};
|
|
22282
|
-
return /* @__PURE__ */
|
|
22691
|
+
return /* @__PURE__ */ React226.createElement(Popover4, { opened, onClose, position: "right", width: 500, shadow: "xl" }, /* @__PURE__ */ React226.createElement(Popover4.Target, null, children), /* @__PURE__ */ React226.createElement(
|
|
22283
22692
|
Popover4.Dropdown,
|
|
22284
22693
|
{
|
|
22285
22694
|
style: {
|
|
@@ -22289,15 +22698,15 @@ function BaseIconPicker({ opened, onClose, onSelectIcon, onUploadClick, children
|
|
|
22289
22698
|
},
|
|
22290
22699
|
p: 0
|
|
22291
22700
|
},
|
|
22292
|
-
/* @__PURE__ */
|
|
22701
|
+
/* @__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
22702
|
TextInput7,
|
|
22294
22703
|
{
|
|
22295
22704
|
mb: "md",
|
|
22296
22705
|
placeholder: "Filter",
|
|
22297
|
-
leftSection: /* @__PURE__ */
|
|
22706
|
+
leftSection: /* @__PURE__ */ React226.createElement(IconSearch6, { size: 18 }),
|
|
22298
22707
|
value: searchQuery,
|
|
22299
22708
|
onChange: (e) => setSearchQuery(e.currentTarget.value),
|
|
22300
|
-
rightSection: searchQuery && /* @__PURE__ */
|
|
22709
|
+
rightSection: searchQuery && /* @__PURE__ */ React226.createElement(UnstyledButton2, { onClick: () => setSearchQuery("") }, /* @__PURE__ */ React226.createElement(IconX10, { size: 18 })),
|
|
22301
22710
|
style: { flex: 1 },
|
|
22302
22711
|
styles: {
|
|
22303
22712
|
input: {
|
|
@@ -22307,22 +22716,22 @@ function BaseIconPicker({ opened, onClose, onSelectIcon, onUploadClick, children
|
|
|
22307
22716
|
}
|
|
22308
22717
|
}
|
|
22309
22718
|
}
|
|
22310
|
-
), !searchQuery && /* @__PURE__ */
|
|
22719
|
+
), !searchQuery && /* @__PURE__ */ React226.createElement(Box40, { 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(Box40, null, /* @__PURE__ */ React226.createElement(Group75, { justify: "space-between", mb: "xs", px: "xs" }, /* @__PURE__ */ React226.createElement(Text120, { size: "sm", fw: 500 }, searchQuery ? "Results" : "Icons"), totalPages > 1 && /* @__PURE__ */ React226.createElement(Group75, { 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
22720
|
BaseButton,
|
|
22312
22721
|
{
|
|
22313
22722
|
size: "xs",
|
|
22314
22723
|
onClick: () => setCurrentPage((p) => Math.min(totalPages, p + 1)),
|
|
22315
22724
|
disabled: currentPage === totalPages,
|
|
22316
|
-
leftSection: /* @__PURE__ */
|
|
22725
|
+
leftSection: /* @__PURE__ */ React226.createElement(IconChevronRight11, { size: 14 })
|
|
22317
22726
|
},
|
|
22318
22727
|
"Next"
|
|
22319
|
-
))), /* @__PURE__ */
|
|
22728
|
+
))), /* @__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
22729
|
));
|
|
22321
22730
|
}
|
|
22322
22731
|
|
|
22323
22732
|
// src/mantine/components/CoverImage.tsx
|
|
22324
|
-
import
|
|
22325
|
-
import { Box as Box42, Group as
|
|
22733
|
+
import React228, { useState as useState80, useRef as useRef13, useEffect as useEffect60 } from "react";
|
|
22734
|
+
import { Box as Box42, Group as Group76 } from "@mantine/core";
|
|
22326
22735
|
|
|
22327
22736
|
// src/core/lib/imageTransform.ts
|
|
22328
22737
|
var CLOUDFLARE_CDN_BASE = "https://www.ixo.earth/cdn-cgi/image";
|
|
@@ -22455,12 +22864,12 @@ function transformIconImage(sourceUrl, size = "default", customOptions) {
|
|
|
22455
22864
|
}
|
|
22456
22865
|
|
|
22457
22866
|
// src/mantine/components/Base/PageIcon.tsx
|
|
22458
|
-
import
|
|
22867
|
+
import React227, { useMemo as useMemo79 } from "react";
|
|
22459
22868
|
import { Center as Center13, Box as Box41 } from "@mantine/core";
|
|
22460
22869
|
import * as TablerIcons2 from "@tabler/icons-react";
|
|
22461
22870
|
function PageIcon({ src, iconSize = 64, useCenter = false, style }) {
|
|
22462
22871
|
const isIconName = src && !src.startsWith("http");
|
|
22463
|
-
const IconComponent =
|
|
22872
|
+
const IconComponent = useMemo79(() => {
|
|
22464
22873
|
if (!isIconName || !src) return null;
|
|
22465
22874
|
const iconComponent = TablerIcons2[src];
|
|
22466
22875
|
if (iconComponent) {
|
|
@@ -22471,7 +22880,7 @@ function PageIcon({ src, iconSize = 64, useCenter = false, style }) {
|
|
|
22471
22880
|
const Container = useCenter ? Center13 : Box41;
|
|
22472
22881
|
if (!src) return null;
|
|
22473
22882
|
if (IconComponent) {
|
|
22474
|
-
return /* @__PURE__ */
|
|
22883
|
+
return /* @__PURE__ */ React227.createElement(
|
|
22475
22884
|
Container,
|
|
22476
22885
|
{
|
|
22477
22886
|
style: {
|
|
@@ -22483,10 +22892,10 @@ function PageIcon({ src, iconSize = 64, useCenter = false, style }) {
|
|
|
22483
22892
|
...style
|
|
22484
22893
|
}
|
|
22485
22894
|
},
|
|
22486
|
-
/* @__PURE__ */
|
|
22895
|
+
/* @__PURE__ */ React227.createElement(IconComponent, { size: iconSize, color: "white", stroke: 1.5 })
|
|
22487
22896
|
);
|
|
22488
22897
|
}
|
|
22489
|
-
return /* @__PURE__ */
|
|
22898
|
+
return /* @__PURE__ */ React227.createElement(
|
|
22490
22899
|
"img",
|
|
22491
22900
|
{
|
|
22492
22901
|
src,
|
|
@@ -22507,14 +22916,14 @@ function PageIcon({ src, iconSize = 64, useCenter = false, style }) {
|
|
|
22507
22916
|
import { useDisclosure as useDisclosure5 } from "@mantine/hooks";
|
|
22508
22917
|
function CoverImage({ coverImageUrl, logoUrl }) {
|
|
22509
22918
|
const { editor, handlers, editable } = useBlocknoteContext();
|
|
22510
|
-
const [isHovering, setIsHovering] =
|
|
22511
|
-
const [isRepositioning, setIsRepositioning] =
|
|
22512
|
-
const [coverPosition, setCoverPosition] =
|
|
22919
|
+
const [isHovering, setIsHovering] = useState80(false);
|
|
22920
|
+
const [isRepositioning, setIsRepositioning] = useState80(false);
|
|
22921
|
+
const [coverPosition, setCoverPosition] = useState80(50);
|
|
22513
22922
|
const coverFileInputRef = useRef13(null);
|
|
22514
22923
|
const logoFileInputRef = useRef13(null);
|
|
22515
22924
|
const [opened, { open, close }] = useDisclosure5(false);
|
|
22516
|
-
const [metadata, setMetadata] =
|
|
22517
|
-
|
|
22925
|
+
const [metadata, setMetadata] = useState80(() => editor?.getPageMetadata?.() || null);
|
|
22926
|
+
useEffect60(() => {
|
|
22518
22927
|
if (!editor?._metadataManager) {
|
|
22519
22928
|
return;
|
|
22520
22929
|
}
|
|
@@ -22596,7 +23005,7 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
22596
23005
|
return null;
|
|
22597
23006
|
}
|
|
22598
23007
|
if (!hasCover) {
|
|
22599
|
-
return /* @__PURE__ */
|
|
23008
|
+
return /* @__PURE__ */ React228.createElement(
|
|
22600
23009
|
Box42,
|
|
22601
23010
|
{
|
|
22602
23011
|
style: {
|
|
@@ -22609,8 +23018,8 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
22609
23018
|
onMouseEnter: () => editable && setIsHovering(true),
|
|
22610
23019
|
onMouseLeave: () => editable && setIsHovering(false)
|
|
22611
23020
|
},
|
|
22612
|
-
/* @__PURE__ */
|
|
22613
|
-
|
|
23021
|
+
/* @__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(
|
|
23022
|
+
Group76,
|
|
22614
23023
|
{
|
|
22615
23024
|
gap: "xs",
|
|
22616
23025
|
style: {
|
|
@@ -22620,7 +23029,7 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
22620
23029
|
zIndex: 10
|
|
22621
23030
|
}
|
|
22622
23031
|
},
|
|
22623
|
-
/* @__PURE__ */
|
|
23032
|
+
/* @__PURE__ */ React228.createElement(
|
|
22624
23033
|
BaseIconPicker,
|
|
22625
23034
|
{
|
|
22626
23035
|
opened,
|
|
@@ -22629,10 +23038,10 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
22629
23038
|
onSelectIcon: (name) => handleSelectLogoIcon(name),
|
|
22630
23039
|
onUploadClick: () => logoFileInputRef.current?.click()
|
|
22631
23040
|
},
|
|
22632
|
-
/* @__PURE__ */
|
|
23041
|
+
/* @__PURE__ */ React228.createElement(CoverImageButton, { onClick: open }, "Add icon")
|
|
22633
23042
|
),
|
|
22634
|
-
/* @__PURE__ */
|
|
22635
|
-
), logoSrc && /* @__PURE__ */
|
|
23043
|
+
/* @__PURE__ */ React228.createElement(CoverImageButton, { onClick: () => coverFileInputRef.current?.click() }, "Add cover")
|
|
23044
|
+
), logoSrc && /* @__PURE__ */ React228.createElement(
|
|
22636
23045
|
Box42,
|
|
22637
23046
|
{
|
|
22638
23047
|
style: {
|
|
@@ -22646,8 +23055,8 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
22646
23055
|
zIndex: 11
|
|
22647
23056
|
}
|
|
22648
23057
|
},
|
|
22649
|
-
/* @__PURE__ */
|
|
22650
|
-
editable && isHovering && /* @__PURE__ */
|
|
23058
|
+
/* @__PURE__ */ React228.createElement(PageIcon, { src: logoSrc, useCenter: true, iconSize: 64 }),
|
|
23059
|
+
editable && isHovering && /* @__PURE__ */ React228.createElement(
|
|
22651
23060
|
"div",
|
|
22652
23061
|
{
|
|
22653
23062
|
style: {
|
|
@@ -22662,7 +23071,7 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
22662
23071
|
alignItems: "center"
|
|
22663
23072
|
}
|
|
22664
23073
|
},
|
|
22665
|
-
/* @__PURE__ */
|
|
23074
|
+
/* @__PURE__ */ React228.createElement(
|
|
22666
23075
|
BaseIconPicker,
|
|
22667
23076
|
{
|
|
22668
23077
|
opened,
|
|
@@ -22671,15 +23080,15 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
22671
23080
|
onSelectIcon: (name) => handleSelectLogoIcon(name),
|
|
22672
23081
|
onUploadClick: () => logoFileInputRef.current?.click()
|
|
22673
23082
|
},
|
|
22674
|
-
/* @__PURE__ */
|
|
23083
|
+
/* @__PURE__ */ React228.createElement(CoverImageButton, { onClick: open }, "Change")
|
|
22675
23084
|
),
|
|
22676
|
-
/* @__PURE__ */
|
|
22677
|
-
/* @__PURE__ */
|
|
23085
|
+
/* @__PURE__ */ React228.createElement(CoverImageButton, { onClick: handleRemoveLogo }, "Remove"),
|
|
23086
|
+
/* @__PURE__ */ React228.createElement(CoverImageButton, { onClick: () => coverFileInputRef.current?.click() }, "Add cover")
|
|
22678
23087
|
)
|
|
22679
23088
|
))
|
|
22680
23089
|
);
|
|
22681
23090
|
}
|
|
22682
|
-
return /* @__PURE__ */
|
|
23091
|
+
return /* @__PURE__ */ React228.createElement(
|
|
22683
23092
|
Box42,
|
|
22684
23093
|
{
|
|
22685
23094
|
style: {
|
|
@@ -22699,7 +23108,7 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
22699
23108
|
onMouseMove: handleMouseMove,
|
|
22700
23109
|
onClick: () => isRepositioning && setIsRepositioning(false)
|
|
22701
23110
|
},
|
|
22702
|
-
/* @__PURE__ */
|
|
23111
|
+
/* @__PURE__ */ React228.createElement(
|
|
22703
23112
|
"img",
|
|
22704
23113
|
{
|
|
22705
23114
|
src: coverUrl,
|
|
@@ -22717,8 +23126,8 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
22717
23126
|
}
|
|
22718
23127
|
}
|
|
22719
23128
|
),
|
|
22720
|
-
editable && isHovering && /* @__PURE__ */
|
|
22721
|
-
|
|
23129
|
+
editable && isHovering && /* @__PURE__ */ React228.createElement(
|
|
23130
|
+
Group76,
|
|
22722
23131
|
{
|
|
22723
23132
|
gap: "xs",
|
|
22724
23133
|
style: {
|
|
@@ -22728,11 +23137,11 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
22728
23137
|
zIndex: 10
|
|
22729
23138
|
}
|
|
22730
23139
|
},
|
|
22731
|
-
/* @__PURE__ */
|
|
22732
|
-
/* @__PURE__ */
|
|
22733
|
-
/* @__PURE__ */
|
|
23140
|
+
/* @__PURE__ */ React228.createElement(CoverImageButton, { onClick: () => coverFileInputRef.current?.click() }, "Change cover"),
|
|
23141
|
+
/* @__PURE__ */ React228.createElement(CoverImageButton, { onClick: () => setIsRepositioning(!isRepositioning), isActive: isRepositioning }, isRepositioning ? "Done" : "Reposition"),
|
|
23142
|
+
/* @__PURE__ */ React228.createElement(CoverImageButton, { onClick: handleRemoveCover }, "Remove")
|
|
22734
23143
|
),
|
|
22735
|
-
/* @__PURE__ */
|
|
23144
|
+
/* @__PURE__ */ React228.createElement("div", { style: { maxWidth: "900px", margin: "0 auto", position: "absolute", bottom: 0, left: -40, right: 0, height: "70px" } }, /* @__PURE__ */ React228.createElement(
|
|
22736
23145
|
Box42,
|
|
22737
23146
|
{
|
|
22738
23147
|
style: {
|
|
@@ -22744,9 +23153,9 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
22744
23153
|
zIndex: 11
|
|
22745
23154
|
}
|
|
22746
23155
|
},
|
|
22747
|
-
logoSrc && /* @__PURE__ */
|
|
22748
|
-
editable && isHovering && /* @__PURE__ */
|
|
22749
|
-
|
|
23156
|
+
logoSrc && /* @__PURE__ */ React228.createElement(PageIcon, { src: logoSrc, iconSize: 64 }),
|
|
23157
|
+
editable && isHovering && /* @__PURE__ */ React228.createElement(React228.Fragment, null, logoSrc ? /* @__PURE__ */ React228.createElement(
|
|
23158
|
+
Group76,
|
|
22750
23159
|
{
|
|
22751
23160
|
gap: "xs",
|
|
22752
23161
|
style: {
|
|
@@ -22756,7 +23165,7 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
22756
23165
|
zIndex: 12
|
|
22757
23166
|
}
|
|
22758
23167
|
},
|
|
22759
|
-
/* @__PURE__ */
|
|
23168
|
+
/* @__PURE__ */ React228.createElement(
|
|
22760
23169
|
BaseIconPicker,
|
|
22761
23170
|
{
|
|
22762
23171
|
opened,
|
|
@@ -22765,10 +23174,10 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
22765
23174
|
onSelectIcon: (name) => handleSelectLogoIcon(name),
|
|
22766
23175
|
onUploadClick: () => logoFileInputRef.current?.click()
|
|
22767
23176
|
},
|
|
22768
|
-
/* @__PURE__ */
|
|
23177
|
+
/* @__PURE__ */ React228.createElement(CoverImageButton, { onClick: open }, "Change")
|
|
22769
23178
|
),
|
|
22770
|
-
/* @__PURE__ */
|
|
22771
|
-
) : /* @__PURE__ */
|
|
23179
|
+
/* @__PURE__ */ React228.createElement(CoverImageButton, { onClick: handleRemoveLogo }, "Remove")
|
|
23180
|
+
) : /* @__PURE__ */ React228.createElement(
|
|
22772
23181
|
CoverImageButton,
|
|
22773
23182
|
{
|
|
22774
23183
|
onClick: open,
|
|
@@ -22783,13 +23192,13 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
22783
23192
|
"Add icon"
|
|
22784
23193
|
))
|
|
22785
23194
|
)),
|
|
22786
|
-
/* @__PURE__ */
|
|
22787
|
-
/* @__PURE__ */
|
|
23195
|
+
/* @__PURE__ */ React228.createElement("input", { ref: coverFileInputRef, type: "file", accept: "image/*", style: { display: "none" }, onChange: (e) => handleFileSelect(e, "cover") }),
|
|
23196
|
+
/* @__PURE__ */ React228.createElement("input", { ref: logoFileInputRef, type: "file", accept: "image/*", style: { display: "none" }, onChange: (e) => handleFileSelect(e, "logo") })
|
|
22788
23197
|
);
|
|
22789
23198
|
}
|
|
22790
23199
|
|
|
22791
23200
|
// src/mantine/components/PageHeader.tsx
|
|
22792
|
-
import
|
|
23201
|
+
import React229, { useState as useState81, useRef as useRef14, useEffect as useEffect61 } from "react";
|
|
22793
23202
|
function PageHeader({
|
|
22794
23203
|
title = "New page",
|
|
22795
23204
|
icon,
|
|
@@ -22800,9 +23209,9 @@ function PageHeader({
|
|
|
22800
23209
|
isFavorited = false,
|
|
22801
23210
|
menuItems = []
|
|
22802
23211
|
}) {
|
|
22803
|
-
const [isMenuOpen, setIsMenuOpen] =
|
|
23212
|
+
const [isMenuOpen, setIsMenuOpen] = useState81(false);
|
|
22804
23213
|
const menuRef = useRef14(null);
|
|
22805
|
-
|
|
23214
|
+
useEffect61(() => {
|
|
22806
23215
|
function handleClickOutside(event) {
|
|
22807
23216
|
if (menuRef.current && !menuRef.current.contains(event.target)) {
|
|
22808
23217
|
setIsMenuOpen(false);
|
|
@@ -22821,14 +23230,14 @@ function PageHeader({
|
|
|
22821
23230
|
setIsMenuOpen(false);
|
|
22822
23231
|
}
|
|
22823
23232
|
};
|
|
22824
|
-
return /* @__PURE__ */
|
|
23233
|
+
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
23234
|
"button",
|
|
22826
23235
|
{
|
|
22827
23236
|
style: styles.menuButton,
|
|
22828
23237
|
onClick: () => setIsMenuOpen(!isMenuOpen),
|
|
22829
23238
|
"aria-label": "Menu"
|
|
22830
23239
|
},
|
|
22831
|
-
/* @__PURE__ */
|
|
23240
|
+
/* @__PURE__ */ React229.createElement(
|
|
22832
23241
|
"svg",
|
|
22833
23242
|
{
|
|
22834
23243
|
width: "16",
|
|
@@ -22836,11 +23245,11 @@ function PageHeader({
|
|
|
22836
23245
|
viewBox: "0 0 16 16",
|
|
22837
23246
|
fill: "currentColor"
|
|
22838
23247
|
},
|
|
22839
|
-
/* @__PURE__ */
|
|
22840
|
-
/* @__PURE__ */
|
|
22841
|
-
/* @__PURE__ */
|
|
23248
|
+
/* @__PURE__ */ React229.createElement("circle", { cx: "3", cy: "8", r: "1.5" }),
|
|
23249
|
+
/* @__PURE__ */ React229.createElement("circle", { cx: "8", cy: "8", r: "1.5" }),
|
|
23250
|
+
/* @__PURE__ */ React229.createElement("circle", { cx: "13", cy: "8", r: "1.5" })
|
|
22842
23251
|
)
|
|
22843
|
-
), isMenuOpen && /* @__PURE__ */
|
|
23252
|
+
), 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
23253
|
"button",
|
|
22845
23254
|
{
|
|
22846
23255
|
style: {
|
|
@@ -22850,8 +23259,8 @@ function PageHeader({
|
|
|
22850
23259
|
onClick: () => handleMenuItemClick(item),
|
|
22851
23260
|
disabled: item.disabled
|
|
22852
23261
|
},
|
|
22853
|
-
item.icon && /* @__PURE__ */
|
|
22854
|
-
/* @__PURE__ */
|
|
23262
|
+
item.icon && /* @__PURE__ */ React229.createElement("span", { style: styles.menuItemIcon }, item.icon),
|
|
23263
|
+
/* @__PURE__ */ React229.createElement("span", null, item.label)
|
|
22855
23264
|
)))))));
|
|
22856
23265
|
}
|
|
22857
23266
|
var styles = {
|
|
@@ -22982,7 +23391,7 @@ var styles = {
|
|
|
22982
23391
|
};
|
|
22983
23392
|
|
|
22984
23393
|
// src/mantine/components/ExternalDropZone.tsx
|
|
22985
|
-
import
|
|
23394
|
+
import React230, { useCallback as useCallback62, useEffect as useEffect62, useRef as useRef15, useState as useState82 } from "react";
|
|
22986
23395
|
import { Box as Box43 } from "@mantine/core";
|
|
22987
23396
|
var SCROLL_ZONE_SIZE = 80;
|
|
22988
23397
|
var SCROLL_SPEED = 12;
|
|
@@ -22996,19 +23405,19 @@ var ExternalDropZone = ({
|
|
|
22996
23405
|
children
|
|
22997
23406
|
}) => {
|
|
22998
23407
|
const containerRef = useRef15(null);
|
|
22999
|
-
const [isValidDrag, setIsValidDrag] =
|
|
23000
|
-
const [isHoveringInPlacementMode, setIsHoveringInPlacementMode] =
|
|
23001
|
-
const [indicatorStyle, setIndicatorStyle] =
|
|
23408
|
+
const [isValidDrag, setIsValidDrag] = useState82(false);
|
|
23409
|
+
const [isHoveringInPlacementMode, setIsHoveringInPlacementMode] = useState82(false);
|
|
23410
|
+
const [indicatorStyle, setIndicatorStyle] = useState82({});
|
|
23002
23411
|
const dropPositionRef = useRef15(null);
|
|
23003
23412
|
const scrollAnimationRef = useRef15(null);
|
|
23004
23413
|
const scrollDirectionRef = useRef15(null);
|
|
23005
23414
|
const scrollContainerRef = useRef15(null);
|
|
23006
|
-
const getBlockElements =
|
|
23415
|
+
const getBlockElements = useCallback62(() => {
|
|
23007
23416
|
if (!containerRef.current) return [];
|
|
23008
23417
|
const blocks = containerRef.current.querySelectorAll('[data-node-type="blockContainer"]');
|
|
23009
23418
|
return Array.from(blocks);
|
|
23010
23419
|
}, []);
|
|
23011
|
-
const getScrollContainer =
|
|
23420
|
+
const getScrollContainer = useCallback62(() => {
|
|
23012
23421
|
if (scrollContainerRef.current) return scrollContainerRef.current;
|
|
23013
23422
|
let element = containerRef.current;
|
|
23014
23423
|
while (element) {
|
|
@@ -23023,7 +23432,7 @@ var ExternalDropZone = ({
|
|
|
23023
23432
|
scrollContainerRef.current = window;
|
|
23024
23433
|
return window;
|
|
23025
23434
|
}, []);
|
|
23026
|
-
const performScroll =
|
|
23435
|
+
const performScroll = useCallback62(() => {
|
|
23027
23436
|
const container = getScrollContainer();
|
|
23028
23437
|
const direction = scrollDirectionRef.current;
|
|
23029
23438
|
if (!direction) {
|
|
@@ -23038,7 +23447,7 @@ var ExternalDropZone = ({
|
|
|
23038
23447
|
}
|
|
23039
23448
|
scrollAnimationRef.current = requestAnimationFrame(performScroll);
|
|
23040
23449
|
}, [getScrollContainer]);
|
|
23041
|
-
const startAutoScroll =
|
|
23450
|
+
const startAutoScroll = useCallback62(
|
|
23042
23451
|
(direction) => {
|
|
23043
23452
|
if (scrollDirectionRef.current === direction) return;
|
|
23044
23453
|
scrollDirectionRef.current = direction;
|
|
@@ -23048,14 +23457,14 @@ var ExternalDropZone = ({
|
|
|
23048
23457
|
},
|
|
23049
23458
|
[performScroll]
|
|
23050
23459
|
);
|
|
23051
|
-
const stopAutoScroll =
|
|
23460
|
+
const stopAutoScroll = useCallback62(() => {
|
|
23052
23461
|
scrollDirectionRef.current = null;
|
|
23053
23462
|
if (scrollAnimationRef.current) {
|
|
23054
23463
|
cancelAnimationFrame(scrollAnimationRef.current);
|
|
23055
23464
|
scrollAnimationRef.current = null;
|
|
23056
23465
|
}
|
|
23057
23466
|
}, []);
|
|
23058
|
-
const checkAutoScroll =
|
|
23467
|
+
const checkAutoScroll = useCallback62(
|
|
23059
23468
|
(clientY) => {
|
|
23060
23469
|
const container = getScrollContainer();
|
|
23061
23470
|
let containerTop;
|
|
@@ -23078,7 +23487,7 @@ var ExternalDropZone = ({
|
|
|
23078
23487
|
},
|
|
23079
23488
|
[getScrollContainer, startAutoScroll, stopAutoScroll]
|
|
23080
23489
|
);
|
|
23081
|
-
const findDropPosition =
|
|
23490
|
+
const findDropPosition = useCallback62(
|
|
23082
23491
|
(clientY) => {
|
|
23083
23492
|
const blocks = getBlockElements();
|
|
23084
23493
|
if (blocks.length === 0 || !editor?.document) return null;
|
|
@@ -23111,7 +23520,7 @@ var ExternalDropZone = ({
|
|
|
23111
23520
|
},
|
|
23112
23521
|
[getBlockElements, editor]
|
|
23113
23522
|
);
|
|
23114
|
-
const handleDragOver =
|
|
23523
|
+
const handleDragOver = useCallback62(
|
|
23115
23524
|
(e) => {
|
|
23116
23525
|
if (!e.dataTransfer.types.includes(acceptedType)) return;
|
|
23117
23526
|
e.preventDefault();
|
|
@@ -23134,7 +23543,7 @@ var ExternalDropZone = ({
|
|
|
23134
23543
|
},
|
|
23135
23544
|
[acceptedType, findDropPosition, checkAutoScroll]
|
|
23136
23545
|
);
|
|
23137
|
-
const handleDragLeave =
|
|
23546
|
+
const handleDragLeave = useCallback62(
|
|
23138
23547
|
(e) => {
|
|
23139
23548
|
if (containerRef.current && !containerRef.current.contains(e.relatedTarget)) {
|
|
23140
23549
|
setIsValidDrag(false);
|
|
@@ -23144,7 +23553,7 @@ var ExternalDropZone = ({
|
|
|
23144
23553
|
},
|
|
23145
23554
|
[stopAutoScroll]
|
|
23146
23555
|
);
|
|
23147
|
-
const handleDrop =
|
|
23556
|
+
const handleDrop = useCallback62(
|
|
23148
23557
|
(e) => {
|
|
23149
23558
|
e.preventDefault();
|
|
23150
23559
|
e.stopPropagation();
|
|
@@ -23158,7 +23567,7 @@ var ExternalDropZone = ({
|
|
|
23158
23567
|
},
|
|
23159
23568
|
[onDrop, stopAutoScroll]
|
|
23160
23569
|
);
|
|
23161
|
-
|
|
23570
|
+
useEffect62(() => {
|
|
23162
23571
|
const handleGlobalDragEnd = () => {
|
|
23163
23572
|
setIsValidDrag(false);
|
|
23164
23573
|
dropPositionRef.current = null;
|
|
@@ -23167,7 +23576,7 @@ var ExternalDropZone = ({
|
|
|
23167
23576
|
window.addEventListener("dragend", handleGlobalDragEnd);
|
|
23168
23577
|
return () => window.removeEventListener("dragend", handleGlobalDragEnd);
|
|
23169
23578
|
}, [stopAutoScroll]);
|
|
23170
|
-
const handleOverlayMouseMove =
|
|
23579
|
+
const handleOverlayMouseMove = useCallback62(
|
|
23171
23580
|
(e) => {
|
|
23172
23581
|
setIsHoveringInPlacementMode(true);
|
|
23173
23582
|
checkAutoScroll(e.clientY);
|
|
@@ -23186,12 +23595,12 @@ var ExternalDropZone = ({
|
|
|
23186
23595
|
},
|
|
23187
23596
|
[findDropPosition, checkAutoScroll]
|
|
23188
23597
|
);
|
|
23189
|
-
const handleOverlayMouseLeave =
|
|
23598
|
+
const handleOverlayMouseLeave = useCallback62(() => {
|
|
23190
23599
|
setIsHoveringInPlacementMode(false);
|
|
23191
23600
|
dropPositionRef.current = null;
|
|
23192
23601
|
stopAutoScroll();
|
|
23193
23602
|
}, [stopAutoScroll]);
|
|
23194
|
-
const handleOverlayClick =
|
|
23603
|
+
const handleOverlayClick = useCallback62(
|
|
23195
23604
|
(e) => {
|
|
23196
23605
|
e.preventDefault();
|
|
23197
23606
|
e.stopPropagation();
|
|
@@ -23205,7 +23614,7 @@ var ExternalDropZone = ({
|
|
|
23205
23614
|
},
|
|
23206
23615
|
[onDrop, stopAutoScroll]
|
|
23207
23616
|
);
|
|
23208
|
-
const handleOverlayWheel =
|
|
23617
|
+
const handleOverlayWheel = useCallback62(
|
|
23209
23618
|
(e) => {
|
|
23210
23619
|
const container = getScrollContainer();
|
|
23211
23620
|
if (container === window) {
|
|
@@ -23216,7 +23625,7 @@ var ExternalDropZone = ({
|
|
|
23216
23625
|
},
|
|
23217
23626
|
[getScrollContainer]
|
|
23218
23627
|
);
|
|
23219
|
-
|
|
23628
|
+
useEffect62(() => {
|
|
23220
23629
|
if (!isPlacementMode) return;
|
|
23221
23630
|
const handleKeyDown = (e) => {
|
|
23222
23631
|
if (e.key === "Escape") {
|
|
@@ -23239,13 +23648,13 @@ var ExternalDropZone = ({
|
|
|
23239
23648
|
document.removeEventListener("click", handleGlobalClick, true);
|
|
23240
23649
|
};
|
|
23241
23650
|
}, [isPlacementMode, onPlacementCancel]);
|
|
23242
|
-
|
|
23651
|
+
useEffect62(() => {
|
|
23243
23652
|
if (!isPlacementMode) {
|
|
23244
23653
|
setIsHoveringInPlacementMode(false);
|
|
23245
23654
|
dropPositionRef.current = null;
|
|
23246
23655
|
}
|
|
23247
23656
|
}, [isPlacementMode]);
|
|
23248
|
-
|
|
23657
|
+
useEffect62(() => {
|
|
23249
23658
|
const isActive = isValidDrag || isPlacementMode && isHoveringInPlacementMode;
|
|
23250
23659
|
if (isActive) {
|
|
23251
23660
|
document.body.classList.add("external-artifact-drag-active");
|
|
@@ -23256,18 +23665,18 @@ var ExternalDropZone = ({
|
|
|
23256
23665
|
document.body.classList.remove("external-artifact-drag-active");
|
|
23257
23666
|
};
|
|
23258
23667
|
}, [isValidDrag, isPlacementMode, isHoveringInPlacementMode]);
|
|
23259
|
-
|
|
23668
|
+
useEffect62(() => {
|
|
23260
23669
|
return () => {
|
|
23261
23670
|
if (scrollAnimationRef.current) {
|
|
23262
23671
|
cancelAnimationFrame(scrollAnimationRef.current);
|
|
23263
23672
|
}
|
|
23264
23673
|
};
|
|
23265
23674
|
}, []);
|
|
23266
|
-
const indicatorWithPosition = dropIndicator &&
|
|
23675
|
+
const indicatorWithPosition = dropIndicator && React230.isValidElement(dropIndicator) ? React230.cloneElement(dropIndicator, {
|
|
23267
23676
|
indicatorTop: typeof indicatorStyle.top === "number" ? indicatorStyle.top : void 0
|
|
23268
23677
|
}) : dropIndicator;
|
|
23269
23678
|
const shouldShowIndicator = isValidDrag || isPlacementMode && isHoveringInPlacementMode;
|
|
23270
|
-
return /* @__PURE__ */
|
|
23679
|
+
return /* @__PURE__ */ React230.createElement(
|
|
23271
23680
|
Box43,
|
|
23272
23681
|
{
|
|
23273
23682
|
ref: containerRef,
|
|
@@ -23283,7 +23692,7 @@ var ExternalDropZone = ({
|
|
|
23283
23692
|
"data-placement-mode": isPlacementMode ? "true" : void 0
|
|
23284
23693
|
},
|
|
23285
23694
|
children,
|
|
23286
|
-
isPlacementMode && /* @__PURE__ */
|
|
23695
|
+
isPlacementMode && /* @__PURE__ */ React230.createElement(
|
|
23287
23696
|
Box43,
|
|
23288
23697
|
{
|
|
23289
23698
|
style: {
|
|
@@ -23303,19 +23712,19 @@ var ExternalDropZone = ({
|
|
|
23303
23712
|
onWheel: handleOverlayWheel
|
|
23304
23713
|
}
|
|
23305
23714
|
),
|
|
23306
|
-
shouldShowIndicator && indicatorWithPosition && /* @__PURE__ */
|
|
23715
|
+
shouldShowIndicator && indicatorWithPosition && /* @__PURE__ */ React230.createElement(Box43, { style: { ...indicatorStyle, background: "none", border: "none", boxShadow: "none" } }, indicatorWithPosition)
|
|
23307
23716
|
);
|
|
23308
23717
|
};
|
|
23309
23718
|
|
|
23310
23719
|
// src/mantine/IxoEditor.tsx
|
|
23311
|
-
import
|
|
23720
|
+
import React232 from "react";
|
|
23312
23721
|
import { getDefaultReactSlashMenuItems, SuggestionMenuController } from "@blocknote/react";
|
|
23313
23722
|
import { BlockNoteView } from "@blocknote/mantine";
|
|
23314
23723
|
import { filterSuggestionItems } from "@blocknote/core";
|
|
23315
23724
|
import { MantineProvider } from "@mantine/core";
|
|
23316
23725
|
|
|
23317
23726
|
// src/mantine/components/PanelContent.tsx
|
|
23318
|
-
import
|
|
23727
|
+
import React231 from "react";
|
|
23319
23728
|
import { Box as Box44 } from "@mantine/core";
|
|
23320
23729
|
var panelStyles = {
|
|
23321
23730
|
light: {
|
|
@@ -23345,7 +23754,7 @@ function PanelContent({ theme }) {
|
|
|
23345
23754
|
const { activePanel, registeredPanels } = usePanelStore();
|
|
23346
23755
|
const isOpen = activePanel !== null;
|
|
23347
23756
|
const content = activePanel ? registeredPanels.get(activePanel) : null;
|
|
23348
|
-
return /* @__PURE__ */
|
|
23757
|
+
return /* @__PURE__ */ React231.createElement(
|
|
23349
23758
|
Box44,
|
|
23350
23759
|
{
|
|
23351
23760
|
pos: "sticky",
|
|
@@ -23386,7 +23795,7 @@ function IxoEditorContent({
|
|
|
23386
23795
|
}) {
|
|
23387
23796
|
const { activePanel } = usePanelStore();
|
|
23388
23797
|
const isPanelOpen = activePanel !== null;
|
|
23389
|
-
const editorContent = /* @__PURE__ */
|
|
23798
|
+
const editorContent = /* @__PURE__ */ React232.createElement(
|
|
23390
23799
|
BlockNoteView,
|
|
23391
23800
|
{
|
|
23392
23801
|
editor,
|
|
@@ -23401,7 +23810,7 @@ function IxoEditorContent({
|
|
|
23401
23810
|
onChange,
|
|
23402
23811
|
onSelectionChange
|
|
23403
23812
|
},
|
|
23404
|
-
config.slashMenu && /* @__PURE__ */
|
|
23813
|
+
config.slashMenu && /* @__PURE__ */ React232.createElement(
|
|
23405
23814
|
SuggestionMenuController,
|
|
23406
23815
|
{
|
|
23407
23816
|
triggerCharacter: "/",
|
|
@@ -23414,7 +23823,7 @@ function IxoEditorContent({
|
|
|
23414
23823
|
),
|
|
23415
23824
|
children
|
|
23416
23825
|
);
|
|
23417
|
-
return /* @__PURE__ */
|
|
23826
|
+
return /* @__PURE__ */ React232.createElement("div", { style: { display: "flex", height: "100%", width: "100%", gap: 0 } }, /* @__PURE__ */ React232.createElement(
|
|
23418
23827
|
"div",
|
|
23419
23828
|
{
|
|
23420
23829
|
className: `ixo-editor ixo-editor--theme-${config.theme} ${className}`,
|
|
@@ -23423,9 +23832,9 @@ function IxoEditorContent({
|
|
|
23423
23832
|
transition: "width 0.2s ease"
|
|
23424
23833
|
}
|
|
23425
23834
|
},
|
|
23426
|
-
selfNav && /* @__PURE__ */
|
|
23427
|
-
/* @__PURE__ */
|
|
23428
|
-
(onExternalDrop || isPlacementMode) && isEditable ? /* @__PURE__ */
|
|
23835
|
+
selfNav && /* @__PURE__ */ React232.createElement(PageHeader, { ...pageHeaderProps }),
|
|
23836
|
+
/* @__PURE__ */ React232.createElement(CoverImage, { coverImageUrl, logoUrl }),
|
|
23837
|
+
(onExternalDrop || isPlacementMode) && isEditable ? /* @__PURE__ */ React232.createElement(
|
|
23429
23838
|
ExternalDropZone,
|
|
23430
23839
|
{
|
|
23431
23840
|
editor,
|
|
@@ -23438,7 +23847,7 @@ function IxoEditorContent({
|
|
|
23438
23847
|
},
|
|
23439
23848
|
editorContent
|
|
23440
23849
|
) : editorContent
|
|
23441
|
-
), isPanelVisible && /* @__PURE__ */
|
|
23850
|
+
), isPanelVisible && /* @__PURE__ */ React232.createElement(PanelContent, { theme: config.theme }));
|
|
23442
23851
|
}
|
|
23443
23852
|
function IxoEditor({
|
|
23444
23853
|
editor,
|
|
@@ -23478,7 +23887,7 @@ function IxoEditor({
|
|
|
23478
23887
|
tableHandles: true
|
|
23479
23888
|
};
|
|
23480
23889
|
const isEditable = editable;
|
|
23481
|
-
const editorContent = /* @__PURE__ */
|
|
23890
|
+
const editorContent = /* @__PURE__ */ React232.createElement(
|
|
23482
23891
|
BlocknoteProvider,
|
|
23483
23892
|
{
|
|
23484
23893
|
editor,
|
|
@@ -23490,7 +23899,7 @@ function IxoEditor({
|
|
|
23490
23899
|
dynamicListPanelRenderer,
|
|
23491
23900
|
domainCardRenderer
|
|
23492
23901
|
},
|
|
23493
|
-
/* @__PURE__ */
|
|
23902
|
+
/* @__PURE__ */ React232.createElement(
|
|
23494
23903
|
IxoEditorContent,
|
|
23495
23904
|
{
|
|
23496
23905
|
isPanelVisible,
|
|
@@ -23514,15 +23923,15 @@ function IxoEditor({
|
|
|
23514
23923
|
)
|
|
23515
23924
|
);
|
|
23516
23925
|
if (mantineTheme) {
|
|
23517
|
-
return /* @__PURE__ */
|
|
23926
|
+
return /* @__PURE__ */ React232.createElement(MantineProvider, { theme: mantineTheme }, editorContent);
|
|
23518
23927
|
}
|
|
23519
23928
|
return editorContent;
|
|
23520
23929
|
}
|
|
23521
23930
|
|
|
23522
23931
|
// src/mantine/components/EntitySigningSetup.tsx
|
|
23523
|
-
import
|
|
23524
|
-
import { Modal as Modal3, Stack as
|
|
23525
|
-
import { IconAlertCircle as IconAlertCircle15, IconCheck as
|
|
23932
|
+
import React233, { useState as useState83 } from "react";
|
|
23933
|
+
import { Modal as Modal3, Stack as Stack146, Text as Text121, TextInput as TextInput8, Button as Button39, Alert as Alert30, Group as Group77 } from "@mantine/core";
|
|
23934
|
+
import { IconAlertCircle as IconAlertCircle15, IconCheck as IconCheck13, IconKey as IconKey2 } from "@tabler/icons-react";
|
|
23526
23935
|
var EntitySigningSetup = ({
|
|
23527
23936
|
opened,
|
|
23528
23937
|
onClose,
|
|
@@ -23530,11 +23939,11 @@ var EntitySigningSetup = ({
|
|
|
23530
23939
|
entityName,
|
|
23531
23940
|
onSetup
|
|
23532
23941
|
}) => {
|
|
23533
|
-
const [pin, setPin] =
|
|
23534
|
-
const [confirmPin, setConfirmPin] =
|
|
23535
|
-
const [loading, setLoading] =
|
|
23536
|
-
const [error, setError] =
|
|
23537
|
-
const [success, setSuccess] =
|
|
23942
|
+
const [pin, setPin] = useState83("");
|
|
23943
|
+
const [confirmPin, setConfirmPin] = useState83("");
|
|
23944
|
+
const [loading, setLoading] = useState83(false);
|
|
23945
|
+
const [error, setError] = useState83(null);
|
|
23946
|
+
const [success, setSuccess] = useState83(false);
|
|
23538
23947
|
const handleSetup = async () => {
|
|
23539
23948
|
if (pin.length < 4) {
|
|
23540
23949
|
setError("PIN must be at least 4 characters");
|
|
@@ -23574,15 +23983,15 @@ var EntitySigningSetup = ({
|
|
|
23574
23983
|
setSuccess(false);
|
|
23575
23984
|
}
|
|
23576
23985
|
};
|
|
23577
|
-
return /* @__PURE__ */
|
|
23986
|
+
return /* @__PURE__ */ React233.createElement(
|
|
23578
23987
|
Modal3,
|
|
23579
23988
|
{
|
|
23580
23989
|
opened,
|
|
23581
23990
|
onClose: handleClose,
|
|
23582
|
-
title: /* @__PURE__ */
|
|
23991
|
+
title: /* @__PURE__ */ React233.createElement(Group77, { gap: "xs" }, /* @__PURE__ */ React233.createElement(IconKey2, { size: 20 }), /* @__PURE__ */ React233.createElement(Text121, { fw: 600 }, "Entity Signing Setup")),
|
|
23583
23992
|
size: "md"
|
|
23584
23993
|
},
|
|
23585
|
-
/* @__PURE__ */
|
|
23994
|
+
/* @__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
23995
|
TextInput8,
|
|
23587
23996
|
{
|
|
23588
23997
|
label: "Enter PIN to encrypt signing key",
|
|
@@ -23593,7 +24002,7 @@ var EntitySigningSetup = ({
|
|
|
23593
24002
|
onChange: (e) => setPin(e.currentTarget.value),
|
|
23594
24003
|
disabled: loading
|
|
23595
24004
|
}
|
|
23596
|
-
), /* @__PURE__ */
|
|
24005
|
+
), /* @__PURE__ */ React233.createElement(
|
|
23597
24006
|
TextInput8,
|
|
23598
24007
|
{
|
|
23599
24008
|
label: "Confirm PIN",
|
|
@@ -23603,12 +24012,12 @@ var EntitySigningSetup = ({
|
|
|
23603
24012
|
onChange: (e) => setConfirmPin(e.currentTarget.value),
|
|
23604
24013
|
disabled: loading
|
|
23605
24014
|
}
|
|
23606
|
-
), error && /* @__PURE__ */
|
|
24015
|
+
), error && /* @__PURE__ */ React233.createElement(Alert30, { color: "red", icon: /* @__PURE__ */ React233.createElement(IconAlertCircle15, { size: 16 }) }, error), /* @__PURE__ */ React233.createElement(Group77, { justify: "flex-end", mt: "md" }, /* @__PURE__ */ React233.createElement(Button39, { variant: "subtle", onClick: handleClose, disabled: loading }, "Cancel"), /* @__PURE__ */ React233.createElement(
|
|
23607
24016
|
Button39,
|
|
23608
24017
|
{
|
|
23609
24018
|
onClick: handleSetup,
|
|
23610
24019
|
loading,
|
|
23611
|
-
leftSection: /* @__PURE__ */
|
|
24020
|
+
leftSection: /* @__PURE__ */ React233.createElement(IconKey2, { size: 16 })
|
|
23612
24021
|
},
|
|
23613
24022
|
"Setup Entity Signing"
|
|
23614
24023
|
))))
|
|
@@ -23616,9 +24025,9 @@ var EntitySigningSetup = ({
|
|
|
23616
24025
|
};
|
|
23617
24026
|
|
|
23618
24027
|
// src/mantine/components/FlowPermissionsPanel.tsx
|
|
23619
|
-
import
|
|
23620
|
-
import { Stack as
|
|
23621
|
-
import { IconPlus as
|
|
24028
|
+
import React234, { useState as useState84, useEffect as useEffect63, useMemo as useMemo80 } from "react";
|
|
24029
|
+
import { Stack as Stack147, Text as Text122, Paper as Paper19, Group as Group78, Badge as Badge39, Button as Button40, ActionIcon as ActionIcon35, Loader as Loader28, Alert as Alert31, Divider as Divider17 } from "@mantine/core";
|
|
24030
|
+
import { IconPlus as IconPlus7, IconTrash as IconTrash8, IconShieldCheck as IconShieldCheck2, IconUser as IconUser5, IconRobot as IconRobot4, IconBuilding } from "@tabler/icons-react";
|
|
23622
24031
|
var FlowPermissionsPanel = ({
|
|
23623
24032
|
editor,
|
|
23624
24033
|
entityDid,
|
|
@@ -23627,11 +24036,11 @@ var FlowPermissionsPanel = ({
|
|
|
23627
24036
|
onRevokePermission,
|
|
23628
24037
|
getUserDisplayName
|
|
23629
24038
|
}) => {
|
|
23630
|
-
const [delegations, setDelegations] =
|
|
23631
|
-
const [loading, setLoading] =
|
|
23632
|
-
const [revoking, setRevoking] =
|
|
23633
|
-
const rootCapability =
|
|
23634
|
-
|
|
24039
|
+
const [delegations, setDelegations] = useState84([]);
|
|
24040
|
+
const [loading, setLoading] = useState84(true);
|
|
24041
|
+
const [revoking, setRevoking] = useState84(null);
|
|
24042
|
+
const rootCapability = useMemo80(() => editor.getRootCapability?.(), [editor]);
|
|
24043
|
+
useEffect63(() => {
|
|
23635
24044
|
const loadDelegations = async () => {
|
|
23636
24045
|
setLoading(true);
|
|
23637
24046
|
const allDelegations = editor.getAllDelegations?.() || [];
|
|
@@ -23670,11 +24079,11 @@ var FlowPermissionsPanel = ({
|
|
|
23670
24079
|
const getIcon2 = (type) => {
|
|
23671
24080
|
switch (type) {
|
|
23672
24081
|
case "oracle":
|
|
23673
|
-
return /* @__PURE__ */
|
|
24082
|
+
return /* @__PURE__ */ React234.createElement(IconRobot4, { size: 16 });
|
|
23674
24083
|
case "entity":
|
|
23675
|
-
return /* @__PURE__ */
|
|
24084
|
+
return /* @__PURE__ */ React234.createElement(IconBuilding, { size: 16 });
|
|
23676
24085
|
default:
|
|
23677
|
-
return /* @__PURE__ */
|
|
24086
|
+
return /* @__PURE__ */ React234.createElement(IconUser5, { size: 16 });
|
|
23678
24087
|
}
|
|
23679
24088
|
};
|
|
23680
24089
|
const formatCapabilities = (caps) => {
|
|
@@ -23693,8 +24102,8 @@ var FlowPermissionsPanel = ({
|
|
|
23693
24102
|
if (date < /* @__PURE__ */ new Date()) return "Expired";
|
|
23694
24103
|
return date.toLocaleDateString();
|
|
23695
24104
|
};
|
|
23696
|
-
return /* @__PURE__ */
|
|
23697
|
-
|
|
24105
|
+
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(Group78, { 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(Group78, { 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(Group78, { justify: "space-between" }, /* @__PURE__ */ React234.createElement(Group78, { 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(Group78, { 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(
|
|
24106
|
+
ActionIcon35,
|
|
23698
24107
|
{
|
|
23699
24108
|
color: "red",
|
|
23700
24109
|
variant: "subtle",
|
|
@@ -23702,11 +24111,11 @@ var FlowPermissionsPanel = ({
|
|
|
23702
24111
|
loading: revoking === capability.id,
|
|
23703
24112
|
disabled: !!revoking
|
|
23704
24113
|
},
|
|
23705
|
-
/* @__PURE__ */
|
|
23706
|
-
))))), /* @__PURE__ */
|
|
24114
|
+
/* @__PURE__ */ React234.createElement(IconTrash8, { size: 16 })
|
|
24115
|
+
))))), /* @__PURE__ */ React234.createElement(
|
|
23707
24116
|
Button40,
|
|
23708
24117
|
{
|
|
23709
|
-
leftSection: /* @__PURE__ */
|
|
24118
|
+
leftSection: /* @__PURE__ */ React234.createElement(IconPlus7, { size: 16 }),
|
|
23710
24119
|
variant: "light",
|
|
23711
24120
|
onClick: onGrantPermission
|
|
23712
24121
|
},
|
|
@@ -23715,22 +24124,22 @@ var FlowPermissionsPanel = ({
|
|
|
23715
24124
|
};
|
|
23716
24125
|
|
|
23717
24126
|
// src/mantine/components/GrantPermissionModal.tsx
|
|
23718
|
-
import
|
|
24127
|
+
import React235, { useState as useState85, useCallback as useCallback63 } from "react";
|
|
23719
24128
|
import {
|
|
23720
24129
|
Modal as Modal4,
|
|
23721
|
-
Stack as
|
|
23722
|
-
Text as
|
|
24130
|
+
Stack as Stack148,
|
|
24131
|
+
Text as Text123,
|
|
23723
24132
|
TextInput as TextInput9,
|
|
23724
24133
|
Button as Button41,
|
|
23725
|
-
Group as
|
|
24134
|
+
Group as Group79,
|
|
23726
24135
|
Radio as Radio6,
|
|
23727
24136
|
Checkbox as Checkbox12,
|
|
23728
24137
|
Alert as Alert32,
|
|
23729
24138
|
Paper as Paper20,
|
|
23730
|
-
Loader as
|
|
23731
|
-
Badge as
|
|
23732
|
-
ActionIcon as
|
|
23733
|
-
Divider as
|
|
24139
|
+
Loader as Loader29,
|
|
24140
|
+
Badge as Badge40,
|
|
24141
|
+
ActionIcon as ActionIcon36,
|
|
24142
|
+
Divider as Divider18,
|
|
23734
24143
|
NumberInput as NumberInput3
|
|
23735
24144
|
} from "@mantine/core";
|
|
23736
24145
|
import { IconSearch as IconSearch7, IconUser as IconUser6, IconRobot as IconRobot5, IconX as IconX11, IconShieldPlus as IconShieldPlus4 } from "@tabler/icons-react";
|
|
@@ -23747,21 +24156,21 @@ var GrantPermissionModal = ({
|
|
|
23747
24156
|
const singleBlockMode = !!targetBlockId || blocks.length === 1;
|
|
23748
24157
|
const fixedBlockId = targetBlockId || (blocks.length === 1 ? blocks[0].id : null);
|
|
23749
24158
|
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 =
|
|
24159
|
+
const [recipientType, setRecipientType] = useState85("user");
|
|
24160
|
+
const [searchQuery, setSearchQuery] = useState85("");
|
|
24161
|
+
const [searchResults, setSearchResults] = useState85([]);
|
|
24162
|
+
const [searching, setSearching] = useState85(false);
|
|
24163
|
+
const [selectedRecipient, setSelectedRecipient] = useState85(null);
|
|
24164
|
+
const [manualDid, setManualDid] = useState85("");
|
|
24165
|
+
const [scopeType, setScopeType] = useState85("full");
|
|
24166
|
+
const [selectedBlocks, setSelectedBlocks] = useState85([]);
|
|
24167
|
+
const [expirationEnabled, setExpirationEnabled] = useState85(false);
|
|
24168
|
+
const [expirationDays, setExpirationDays] = useState85(30);
|
|
24169
|
+
const [canDelegate, setCanDelegate] = useState85(false);
|
|
24170
|
+
const [pin, setPin] = useState85("");
|
|
24171
|
+
const [loading, setLoading] = useState85(false);
|
|
24172
|
+
const [error, setError] = useState85(null);
|
|
24173
|
+
const handleSearch = useCallback63(async () => {
|
|
23765
24174
|
if (searchQuery.length < 2) return;
|
|
23766
24175
|
setSearching(true);
|
|
23767
24176
|
try {
|
|
@@ -23848,29 +24257,29 @@ var GrantPermissionModal = ({
|
|
|
23848
24257
|
resetForm();
|
|
23849
24258
|
}
|
|
23850
24259
|
};
|
|
23851
|
-
return /* @__PURE__ */
|
|
24260
|
+
return /* @__PURE__ */ React235.createElement(
|
|
23852
24261
|
Modal4,
|
|
23853
24262
|
{
|
|
23854
24263
|
opened,
|
|
23855
24264
|
onClose: handleClose,
|
|
23856
|
-
title: /* @__PURE__ */
|
|
24265
|
+
title: /* @__PURE__ */ React235.createElement(Group79, { gap: "xs" }, /* @__PURE__ */ React235.createElement(IconShieldPlus4, { size: 20 }), /* @__PURE__ */ React235.createElement(Text123, { fw: 600 }, "Grant Permission")),
|
|
23857
24266
|
size: "lg"
|
|
23858
24267
|
},
|
|
23859
|
-
/* @__PURE__ */
|
|
24268
|
+
/* @__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
24269
|
setRecipientType(v);
|
|
23861
24270
|
setSelectedRecipient(null);
|
|
23862
24271
|
setSearchResults([]);
|
|
23863
|
-
} }, /* @__PURE__ */
|
|
24272
|
+
} }, /* @__PURE__ */ React235.createElement(Group79, 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
24273
|
TextInput9,
|
|
23865
24274
|
{
|
|
23866
24275
|
placeholder: recipientType === "oracle" ? "Search oracles..." : "Search users...",
|
|
23867
|
-
leftSection: /* @__PURE__ */
|
|
23868
|
-
rightSection: searching ? /* @__PURE__ */
|
|
24276
|
+
leftSection: /* @__PURE__ */ React235.createElement(IconSearch7, { size: 16 }),
|
|
24277
|
+
rightSection: searching ? /* @__PURE__ */ React235.createElement(Loader29, { size: 14 }) : null,
|
|
23869
24278
|
value: searchQuery,
|
|
23870
24279
|
onChange: (e) => setSearchQuery(e.currentTarget.value),
|
|
23871
24280
|
onKeyDown: (e) => e.key === "Enter" && handleSearch()
|
|
23872
24281
|
}
|
|
23873
|
-
), selectedRecipient ? /* @__PURE__ */
|
|
24282
|
+
), selectedRecipient ? /* @__PURE__ */ React235.createElement(Paper20, { p: "sm", withBorder: true }, /* @__PURE__ */ React235.createElement(Group79, { justify: "space-between" }, /* @__PURE__ */ React235.createElement(Group79, { 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(
|
|
23874
24283
|
Button41,
|
|
23875
24284
|
{
|
|
23876
24285
|
key: result.did,
|
|
@@ -23880,7 +24289,7 @@ var GrantPermissionModal = ({
|
|
|
23880
24289
|
onClick: () => setSelectedRecipient(result)
|
|
23881
24290
|
},
|
|
23882
24291
|
result.displayName
|
|
23883
|
-
)))) : null) : /* @__PURE__ */
|
|
24292
|
+
)))) : null) : /* @__PURE__ */ React235.createElement(
|
|
23884
24293
|
TextInput9,
|
|
23885
24294
|
{
|
|
23886
24295
|
label: "Recipient DID",
|
|
@@ -23888,12 +24297,12 @@ var GrantPermissionModal = ({
|
|
|
23888
24297
|
value: manualDid,
|
|
23889
24298
|
onChange: (e) => setManualDid(e.currentTarget.value)
|
|
23890
24299
|
}
|
|
23891
|
-
), /* @__PURE__ */
|
|
24300
|
+
), /* @__PURE__ */ React235.createElement(Divider18, null), /* @__PURE__ */ React235.createElement(Stack148, { gap: "xs" }, /* @__PURE__ */ React235.createElement(Text123, { size: "sm", fw: 500 }, "Permission Scope"), singleBlockMode && fixedBlock ? (
|
|
23892
24301
|
// Single block mode: show fixed block info
|
|
23893
|
-
/* @__PURE__ */
|
|
24302
|
+
/* @__PURE__ */ React235.createElement(Paper20, { p: "sm", withBorder: true }, /* @__PURE__ */ React235.createElement(Group79, { 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
24303
|
) : (
|
|
23895
24304
|
// Multi-block mode: show scope selection
|
|
23896
|
-
/* @__PURE__ */
|
|
24305
|
+
/* @__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
24306
|
Checkbox12,
|
|
23898
24307
|
{
|
|
23899
24308
|
key: block.id,
|
|
@@ -23908,14 +24317,14 @@ var GrantPermissionModal = ({
|
|
|
23908
24317
|
}
|
|
23909
24318
|
}
|
|
23910
24319
|
)))))
|
|
23911
|
-
)), /* @__PURE__ */
|
|
24320
|
+
)), /* @__PURE__ */ React235.createElement(Divider18, null), /* @__PURE__ */ React235.createElement(Stack148, { gap: "xs" }, /* @__PURE__ */ React235.createElement(
|
|
23912
24321
|
Checkbox12,
|
|
23913
24322
|
{
|
|
23914
24323
|
label: "Set expiration",
|
|
23915
24324
|
checked: expirationEnabled,
|
|
23916
24325
|
onChange: (e) => setExpirationEnabled(e.currentTarget.checked)
|
|
23917
24326
|
}
|
|
23918
|
-
), expirationEnabled && /* @__PURE__ */
|
|
24327
|
+
), expirationEnabled && /* @__PURE__ */ React235.createElement(
|
|
23919
24328
|
NumberInput3,
|
|
23920
24329
|
{
|
|
23921
24330
|
label: "Expires in (days)",
|
|
@@ -23925,7 +24334,7 @@ var GrantPermissionModal = ({
|
|
|
23925
24334
|
min: 1,
|
|
23926
24335
|
max: 365
|
|
23927
24336
|
}
|
|
23928
|
-
)), /* @__PURE__ */
|
|
24337
|
+
)), /* @__PURE__ */ React235.createElement(
|
|
23929
24338
|
Checkbox12,
|
|
23930
24339
|
{
|
|
23931
24340
|
label: "Recipient can grant permissions to others",
|
|
@@ -23933,7 +24342,7 @@ var GrantPermissionModal = ({
|
|
|
23933
24342
|
checked: canDelegate,
|
|
23934
24343
|
onChange: (e) => setCanDelegate(e.currentTarget.checked)
|
|
23935
24344
|
}
|
|
23936
|
-
), /* @__PURE__ */
|
|
24345
|
+
), /* @__PURE__ */ React235.createElement(Divider18, null), /* @__PURE__ */ React235.createElement(
|
|
23937
24346
|
TextInput9,
|
|
23938
24347
|
{
|
|
23939
24348
|
label: "Enter your PIN to sign this delegation",
|
|
@@ -23942,7 +24351,7 @@ var GrantPermissionModal = ({
|
|
|
23942
24351
|
value: pin,
|
|
23943
24352
|
onChange: (e) => setPin(e.currentTarget.value)
|
|
23944
24353
|
}
|
|
23945
|
-
), error && /* @__PURE__ */
|
|
24354
|
+
), error && /* @__PURE__ */ React235.createElement(Alert32, { color: "red" }, error), /* @__PURE__ */ React235.createElement(Group79, { justify: "flex-end" }, /* @__PURE__ */ React235.createElement(Button41, { variant: "subtle", onClick: handleClose, disabled: loading }, "Cancel"), /* @__PURE__ */ React235.createElement(Button41, { onClick: handleGrant, loading }, "Grant Permission")))
|
|
23946
24355
|
);
|
|
23947
24356
|
};
|
|
23948
24357
|
|
|
@@ -24049,4 +24458,4 @@ export {
|
|
|
24049
24458
|
ixoGraphQLClient,
|
|
24050
24459
|
getEntity
|
|
24051
24460
|
};
|
|
24052
|
-
//# sourceMappingURL=chunk-
|
|
24461
|
+
//# sourceMappingURL=chunk-44NJWFQK.mjs.map
|