@ixo/editor 2.29.0 → 2.30.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-BHBXPXWA.mjs → chunk-5CXU2GBG.mjs} +305 -210
- package/dist/chunk-5CXU2GBG.mjs.map +1 -0
- package/dist/{graphql-client-Cww8ZOPN.d.ts → graphql-client-B4MaQJb7.d.ts} +17 -3
- 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 +1 -1
- package/dist/chunk-BHBXPXWA.mjs.map +0 -1
|
@@ -22466,18 +22466,18 @@ var GovernanceGroupBlockSpec = createReactBlockSpec19(
|
|
|
22466
22466
|
);
|
|
22467
22467
|
|
|
22468
22468
|
// src/mantine/blocks/flowLink/FlowLinkBlockSpec.tsx
|
|
22469
|
-
import
|
|
22469
|
+
import React226 from "react";
|
|
22470
22470
|
import { createReactBlockSpec as createReactBlockSpec20 } from "@blocknote/react";
|
|
22471
22471
|
|
|
22472
22472
|
// src/mantine/blocks/flowLink/FlowLinkBlock.tsx
|
|
22473
|
-
import
|
|
22473
|
+
import React225 from "react";
|
|
22474
22474
|
|
|
22475
22475
|
// src/mantine/blocks/flowLink/template/TemplateView.tsx
|
|
22476
|
-
import
|
|
22476
|
+
import React222, { useMemo as useMemo74 } from "react";
|
|
22477
22477
|
import { Group as Group75, Stack as Stack144, Text as Text119 } from "@mantine/core";
|
|
22478
22478
|
|
|
22479
22479
|
// src/mantine/blocks/flowLink/template/TemplateConfig.tsx
|
|
22480
|
-
import
|
|
22480
|
+
import React221 from "react";
|
|
22481
22481
|
|
|
22482
22482
|
// src/mantine/blocks/flowLink/template/GeneralTab.tsx
|
|
22483
22483
|
import React218 from "react";
|
|
@@ -22510,8 +22510,8 @@ var GeneralTab16 = ({ title, description, icon, onTitleChange, onDescriptionChan
|
|
|
22510
22510
|
};
|
|
22511
22511
|
|
|
22512
22512
|
// src/mantine/blocks/flowLink/template/LinksTab.tsx
|
|
22513
|
-
import
|
|
22514
|
-
import { Stack as Stack143, Card as Card20, Group as Group74, ActionIcon as ActionIcon34, Text as Text118, Divider as Divider18 } from "@mantine/core";
|
|
22513
|
+
import React220, { useMemo as useMemo73 } from "react";
|
|
22514
|
+
import { Stack as Stack143, Card as Card20, Group as Group74, ActionIcon as ActionIcon34, Text as Text118, Divider as Divider18, Checkbox as Checkbox12 } from "@mantine/core";
|
|
22515
22515
|
import { IconPlus as IconPlus6, IconTrash as IconTrash7, IconGripVertical } from "@tabler/icons-react";
|
|
22516
22516
|
import { DndContext, PointerSensor, useSensor, useSensors, closestCenter, useDraggable, useDroppable } from "@dnd-kit/core";
|
|
22517
22517
|
|
|
@@ -22531,6 +22531,59 @@ function generateId(prefix) {
|
|
|
22531
22531
|
return `${prefix}_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 10)}`;
|
|
22532
22532
|
}
|
|
22533
22533
|
|
|
22534
|
+
// src/mantine/blocks/flowLink/template/WorkspacePageSelector.tsx
|
|
22535
|
+
import React219, { useEffect as useEffect62, useState as useState78 } from "react";
|
|
22536
|
+
import { Loader as Loader28, Alert as Alert30 } from "@mantine/core";
|
|
22537
|
+
var WorkspacePageSelector = ({ selectedPageId, onSelect }) => {
|
|
22538
|
+
const handlers = useBlocknoteHandlers();
|
|
22539
|
+
const [pages, setPages] = useState78([]);
|
|
22540
|
+
const [loading, setLoading] = useState78(false);
|
|
22541
|
+
const [error, setError] = useState78(null);
|
|
22542
|
+
useEffect62(() => {
|
|
22543
|
+
const fetchPages = async () => {
|
|
22544
|
+
if (!handlers.getWorkspacePages) {
|
|
22545
|
+
setError("Workspace pages not supported");
|
|
22546
|
+
return;
|
|
22547
|
+
}
|
|
22548
|
+
setLoading(true);
|
|
22549
|
+
setError(null);
|
|
22550
|
+
try {
|
|
22551
|
+
const result = await handlers.getWorkspacePages();
|
|
22552
|
+
setPages(result);
|
|
22553
|
+
} catch (err) {
|
|
22554
|
+
setError(err instanceof Error ? err.message : "Failed to fetch pages");
|
|
22555
|
+
} finally {
|
|
22556
|
+
setLoading(false);
|
|
22557
|
+
}
|
|
22558
|
+
};
|
|
22559
|
+
fetchPages();
|
|
22560
|
+
}, []);
|
|
22561
|
+
if (loading) {
|
|
22562
|
+
return /* @__PURE__ */ React219.createElement(Loader28, { size: "sm" });
|
|
22563
|
+
}
|
|
22564
|
+
if (error) {
|
|
22565
|
+
return /* @__PURE__ */ React219.createElement(Alert30, { color: "red" }, error);
|
|
22566
|
+
}
|
|
22567
|
+
return /* @__PURE__ */ React219.createElement(
|
|
22568
|
+
BaseSelect,
|
|
22569
|
+
{
|
|
22570
|
+
label: "Workspace Page",
|
|
22571
|
+
placeholder: "Select a workspace page",
|
|
22572
|
+
value: selectedPageId || "",
|
|
22573
|
+
onChange: (value) => {
|
|
22574
|
+
const page = pages.find((p) => p.id === value);
|
|
22575
|
+
if (page) onSelect(page);
|
|
22576
|
+
},
|
|
22577
|
+
data: pages.map((page) => ({
|
|
22578
|
+
value: page.id,
|
|
22579
|
+
label: page.description
|
|
22580
|
+
})),
|
|
22581
|
+
searchable: true,
|
|
22582
|
+
description: "Choose which workspace page to link to"
|
|
22583
|
+
}
|
|
22584
|
+
);
|
|
22585
|
+
};
|
|
22586
|
+
|
|
22534
22587
|
// src/mantine/blocks/flowLink/template/LinksTab.tsx
|
|
22535
22588
|
var DraggableLinkCard = ({ link, index, onRemove, onUpdate }) => {
|
|
22536
22589
|
const { attributes, listeners, setNodeRef: setDragRef, transform, isDragging } = useDraggable({ id: link.id });
|
|
@@ -22540,31 +22593,69 @@ var DraggableLinkCard = ({ link, index, onRemove, onUpdate }) => {
|
|
|
22540
22593
|
opacity: isDragging ? 0.5 : 1,
|
|
22541
22594
|
border: isOver ? "2px dashed var(--mantine-color-accent-5)" : void 0
|
|
22542
22595
|
};
|
|
22543
|
-
return /* @__PURE__ */
|
|
22596
|
+
return /* @__PURE__ */ React220.createElement("div", { ref: setDropRef }, /* @__PURE__ */ React220.createElement(Card20, { p: "sm", style }, /* @__PURE__ */ React220.createElement(Stack143, { gap: "xs" }, /* @__PURE__ */ React220.createElement(Group74, { justify: "space-between", align: "flex-start" }, /* @__PURE__ */ React220.createElement(Group74, { gap: "xs", align: "center" }, /* @__PURE__ */ React220.createElement("div", { ref: setDragRef, ...listeners, ...attributes, style: { cursor: "grab", display: "flex", alignItems: "center" } }, /* @__PURE__ */ React220.createElement(IconGripVertical, { size: 16, color: "gray" })), /* @__PURE__ */ React220.createElement(Text118, { size: "xs", c: "dimmed" }, link.title || `Link ${index + 1}`)), /* @__PURE__ */ React220.createElement(ActionIcon34, { variant: "subtle", color: "red", size: "sm", onClick: () => onRemove(link.id) }, /* @__PURE__ */ React220.createElement(IconTrash7, { size: 14 }))), /* @__PURE__ */ React220.createElement(Divider18, null), /* @__PURE__ */ React220.createElement(BaseTextInput, { label: "Title", placeholder: "Link title", value: link.title, onChange: (e) => onUpdate(link.id, { title: e.currentTarget.value }) }), /* @__PURE__ */ React220.createElement(
|
|
22544
22597
|
BaseTextInput,
|
|
22545
22598
|
{
|
|
22546
22599
|
label: "Description",
|
|
22547
22600
|
placeholder: "Optional text to place above the link title",
|
|
22548
22601
|
value: link.description,
|
|
22549
|
-
onChange: (e) => onUpdate(link.id,
|
|
22602
|
+
onChange: (e) => onUpdate(link.id, { description: e.currentTarget.value })
|
|
22603
|
+
}
|
|
22604
|
+
), /* @__PURE__ */ React220.createElement(
|
|
22605
|
+
Checkbox12,
|
|
22606
|
+
{
|
|
22607
|
+
label: "Workspace Link",
|
|
22608
|
+
description: "Link to a user's workspace page instead of a flow",
|
|
22609
|
+
checked: link.isWorkspaceLink || false,
|
|
22610
|
+
onChange: (e) => {
|
|
22611
|
+
const isWorkspace = e.currentTarget.checked;
|
|
22612
|
+
onUpdate(link.id, {
|
|
22613
|
+
isWorkspaceLink: isWorkspace,
|
|
22614
|
+
// Clear workspace-specific fields when switching to regular link
|
|
22615
|
+
...isWorkspace === false && {
|
|
22616
|
+
workspacePageId: "",
|
|
22617
|
+
workspacePageDescription: "",
|
|
22618
|
+
docRoomId: ""
|
|
22619
|
+
// Clear docRoomId from workspace selector
|
|
22620
|
+
},
|
|
22621
|
+
// Clear docRoomId when switching to workspace link (will be set by selector)
|
|
22622
|
+
...isWorkspace === true && {
|
|
22623
|
+
docRoomId: ""
|
|
22624
|
+
}
|
|
22625
|
+
});
|
|
22626
|
+
}
|
|
22550
22627
|
}
|
|
22551
|
-
), /* @__PURE__ */
|
|
22628
|
+
), link.isWorkspaceLink && /* @__PURE__ */ React220.createElement(
|
|
22629
|
+
WorkspacePageSelector,
|
|
22630
|
+
{
|
|
22631
|
+
selectedPageId: link.workspacePageId,
|
|
22632
|
+
onSelect: (page) => {
|
|
22633
|
+
console.log("[LinksTab] link:", link);
|
|
22634
|
+
console.log("[LinksTab] link - page:", page);
|
|
22635
|
+
onUpdate(link.id, {
|
|
22636
|
+
workspacePageId: page.id,
|
|
22637
|
+
workspacePageDescription: page.description,
|
|
22638
|
+
docRoomId: page.serviceEndpoint
|
|
22639
|
+
});
|
|
22640
|
+
}
|
|
22641
|
+
}
|
|
22642
|
+
), !link.isWorkspaceLink && /* @__PURE__ */ React220.createElement(
|
|
22552
22643
|
BaseTextInput,
|
|
22553
22644
|
{
|
|
22554
22645
|
label: "Document Room ID",
|
|
22555
22646
|
placeholder: "!roomId:matrix.server",
|
|
22556
22647
|
value: link.docRoomId,
|
|
22557
|
-
onChange: (e) => onUpdate(link.id,
|
|
22648
|
+
onChange: (e) => onUpdate(link.id, { docRoomId: e.currentTarget.value }),
|
|
22558
22649
|
description: "Matrix room ID of the target flow document"
|
|
22559
22650
|
}
|
|
22560
|
-
), /* @__PURE__ */
|
|
22651
|
+
), /* @__PURE__ */ React220.createElement(
|
|
22561
22652
|
BaseTextArea,
|
|
22562
22653
|
{
|
|
22563
22654
|
label: "Caption",
|
|
22564
22655
|
placeholder: "Optional text to place below the link title",
|
|
22565
22656
|
minRows: 2,
|
|
22566
22657
|
value: link.captionText,
|
|
22567
|
-
onChange: (e) => onUpdate(link.id,
|
|
22658
|
+
onChange: (e) => onUpdate(link.id, { captionText: e.currentTarget.value })
|
|
22568
22659
|
}
|
|
22569
22660
|
))));
|
|
22570
22661
|
};
|
|
@@ -22579,6 +22670,9 @@ var LinksTab = ({ links, onLinksChange }) => {
|
|
|
22579
22670
|
title: "",
|
|
22580
22671
|
captionText: "",
|
|
22581
22672
|
description: "",
|
|
22673
|
+
isWorkspaceLink: false,
|
|
22674
|
+
workspacePageId: "",
|
|
22675
|
+
workspacePageDescription: "",
|
|
22582
22676
|
position: maxPosition + 1
|
|
22583
22677
|
};
|
|
22584
22678
|
onLinksChange([...links, newLink]);
|
|
@@ -22588,8 +22682,9 @@ var LinksTab = ({ links, onLinksChange }) => {
|
|
|
22588
22682
|
const reordered = filtered.map((link, idx) => ({ ...link, position: idx }));
|
|
22589
22683
|
onLinksChange(reordered);
|
|
22590
22684
|
};
|
|
22591
|
-
const handleUpdateLink = (id,
|
|
22592
|
-
|
|
22685
|
+
const handleUpdateLink = (id, updates) => {
|
|
22686
|
+
const updatedLinks = links.map((link) => link.id === id ? { ...link, ...updates } : link);
|
|
22687
|
+
onLinksChange(updatedLinks);
|
|
22593
22688
|
};
|
|
22594
22689
|
const handleDragEnd = (event) => {
|
|
22595
22690
|
const { active, over } = event;
|
|
@@ -22605,7 +22700,7 @@ var LinksTab = ({ links, onLinksChange }) => {
|
|
|
22605
22700
|
const updated = reordered.map((link, idx) => ({ ...link, position: idx }));
|
|
22606
22701
|
onLinksChange(updated);
|
|
22607
22702
|
};
|
|
22608
|
-
return /* @__PURE__ */
|
|
22703
|
+
return /* @__PURE__ */ React220.createElement(Stack143, { gap: "md" }, /* @__PURE__ */ React220.createElement(Group74, { justify: "space-between", align: "center" }, /* @__PURE__ */ React220.createElement(Text118, { size: "sm", fw: 500 }, "Flow Links"), /* @__PURE__ */ React220.createElement(BaseButton, { leftSection: /* @__PURE__ */ React220.createElement(IconPlus6, { size: 16 }), size: "xs", onClick: handleAddLink }, "Add Link")), links.length === 0 ? /* @__PURE__ */ React220.createElement(BaseContainer, null, /* @__PURE__ */ React220.createElement(Text118, { size: "sm", c: "dimmed", ta: "center" }, 'No links configured. Click "Add Link" to create a link to another flow.')) : /* @__PURE__ */ React220.createElement(DndContext, { sensors, collisionDetection: closestCenter, onDragEnd: handleDragEnd }, /* @__PURE__ */ React220.createElement(Stack143, { gap: "sm" }, sortedLinks.map((link, index) => /* @__PURE__ */ React220.createElement(DraggableLinkCard, { key: link.id, link, index, onRemove: handleRemoveLink, onUpdate: handleUpdateLink })))));
|
|
22609
22704
|
};
|
|
22610
22705
|
|
|
22611
22706
|
// src/mantine/blocks/flowLink/template/TemplateConfig.tsx
|
|
@@ -22618,14 +22713,14 @@ var TemplateConfig16 = ({ editor, block }) => {
|
|
|
22618
22713
|
const handleLinksChange = (newLinks) => {
|
|
22619
22714
|
updateProp("links", JSON.stringify(newLinks));
|
|
22620
22715
|
};
|
|
22621
|
-
return /* @__PURE__ */
|
|
22716
|
+
return /* @__PURE__ */ React221.createElement(BaseRightPanelLayout, { title: "Flow Link Settings", onClose: closePanel }, /* @__PURE__ */ React221.createElement(
|
|
22622
22717
|
ReusablePanel,
|
|
22623
22718
|
{
|
|
22624
22719
|
extraTabs: [
|
|
22625
22720
|
{
|
|
22626
22721
|
label: "General",
|
|
22627
22722
|
value: "general",
|
|
22628
|
-
content: /* @__PURE__ */
|
|
22723
|
+
content: /* @__PURE__ */ React221.createElement(
|
|
22629
22724
|
GeneralTab16,
|
|
22630
22725
|
{
|
|
22631
22726
|
title: block.props.title || "",
|
|
@@ -22640,7 +22735,7 @@ var TemplateConfig16 = ({ editor, block }) => {
|
|
|
22640
22735
|
{
|
|
22641
22736
|
label: "Links",
|
|
22642
22737
|
value: "links",
|
|
22643
|
-
content: /* @__PURE__ */
|
|
22738
|
+
content: /* @__PURE__ */ React221.createElement(LinksTab, { links, onLinksChange: handleLinksChange })
|
|
22644
22739
|
}
|
|
22645
22740
|
],
|
|
22646
22741
|
context: { editor, block }
|
|
@@ -22652,26 +22747,26 @@ var TemplateConfig16 = ({ editor, block }) => {
|
|
|
22652
22747
|
var FLOW_LINK_TEMPLATE_PANEL_ID = "flow-link-template-panel";
|
|
22653
22748
|
var FlowLinkTemplateView = ({ editor, block }) => {
|
|
22654
22749
|
const panelId = `${FLOW_LINK_TEMPLATE_PANEL_ID}-${block.id}`;
|
|
22655
|
-
const panelContent = useMemo74(() => /* @__PURE__ */
|
|
22750
|
+
const panelContent = useMemo74(() => /* @__PURE__ */ React222.createElement(TemplateConfig16, { editor, block }), [editor, block]);
|
|
22656
22751
|
const { open } = usePanel(panelId, panelContent);
|
|
22657
22752
|
const links = safeParseJSONArray(block.props.links);
|
|
22658
22753
|
const linksCount = links.length;
|
|
22659
|
-
return /* @__PURE__ */
|
|
22754
|
+
return /* @__PURE__ */ React222.createElement(BaseContainer, { onClick: open }, /* @__PURE__ */ React222.createElement(Group75, { wrap: "nowrap", justify: "space-between", align: "center" }, /* @__PURE__ */ React222.createElement(Group75, { wrap: "nowrap", align: "center" }, getIcon("external-link", block.props.icon), /* @__PURE__ */ React222.createElement(Stack144, { gap: "xs", style: { flex: 1 } }, /* @__PURE__ */ React222.createElement(Text119, { fw: 500, size: "sm", contentEditable: false }, block.props.title || "Flow Link"), /* @__PURE__ */ React222.createElement(Text119, { size: "xs", c: "dimmed", contentEditable: false }, block.props.description || (linksCount > 0 ? `${linksCount} link${linksCount !== 1 ? "s" : ""} configured` : "Click to configure links to other flows"))))));
|
|
22660
22755
|
};
|
|
22661
22756
|
|
|
22662
22757
|
// src/mantine/blocks/flowLink/flow/FlowView.tsx
|
|
22663
|
-
import
|
|
22758
|
+
import React224, { useMemo as useMemo75 } from "react";
|
|
22664
22759
|
import { Badge as Badge39, Group as Group77, Stack as Stack146, Text as Text121, Tooltip as Tooltip25 } from "@mantine/core";
|
|
22665
22760
|
|
|
22666
22761
|
// src/mantine/blocks/flowLink/flow/FlowLinkPanel.tsx
|
|
22667
|
-
import
|
|
22668
|
-
import { Stack as Stack145, Text as Text120, Card as Card21, Group as Group76, Badge as Badge38, ActionIcon as ActionIcon35, Loader as
|
|
22762
|
+
import React223, { useState as useState79, useEffect as useEffect63, useCallback as useCallback64 } from "react";
|
|
22763
|
+
import { Stack as Stack145, Text as Text120, Card as Card21, Group as Group76, Badge as Badge38, ActionIcon as ActionIcon35, Loader as Loader29, Tooltip as Tooltip24 } from "@mantine/core";
|
|
22669
22764
|
import { IconRefresh as IconRefresh7, IconCheck as IconCheck12, IconClock as IconClock3, IconCircleDashed as IconCircleDashed4 } from "@tabler/icons-react";
|
|
22670
22765
|
var FlowLinkPanel = ({ block }) => {
|
|
22671
22766
|
const { closePanel } = usePanelStore();
|
|
22672
22767
|
const handlers = useBlocknoteHandlers();
|
|
22673
22768
|
const links = safeParseJSONArray(block.props.links).sort((a, b) => a.position - b.position);
|
|
22674
|
-
const [linksWithStatus, setLinksWithStatus] =
|
|
22769
|
+
const [linksWithStatus, setLinksWithStatus] = useState79(links.map((link) => ({ ...link })));
|
|
22675
22770
|
const fetchStatuses = useCallback64(async () => {
|
|
22676
22771
|
if (!handlers.getFlowStatus) {
|
|
22677
22772
|
return;
|
|
@@ -22689,20 +22784,20 @@ var FlowLinkPanel = ({ block }) => {
|
|
|
22689
22784
|
);
|
|
22690
22785
|
setLinksWithStatus(updatedLinks);
|
|
22691
22786
|
}, [handlers, links]);
|
|
22692
|
-
|
|
22787
|
+
useEffect63(() => {
|
|
22693
22788
|
fetchStatuses();
|
|
22694
22789
|
}, []);
|
|
22695
|
-
const handleNavigate = (
|
|
22790
|
+
const handleNavigate = (link) => {
|
|
22696
22791
|
if (handlers.navigateToFlow) {
|
|
22697
|
-
handlers.navigateToFlow(docRoomId);
|
|
22792
|
+
handlers.navigateToFlow(link.docRoomId, link.isWorkspaceLink);
|
|
22698
22793
|
}
|
|
22699
22794
|
};
|
|
22700
22795
|
const getStatusBadge = (link) => {
|
|
22701
22796
|
if (link.isLoading) {
|
|
22702
|
-
return /* @__PURE__ */
|
|
22797
|
+
return /* @__PURE__ */ React223.createElement(Badge38, { display: "inline-block", size: "sm", variant: "light", color: "gray", leftSection: /* @__PURE__ */ React223.createElement(Loader29, { size: 10 }) }, "Loading");
|
|
22703
22798
|
}
|
|
22704
22799
|
if (link.error) {
|
|
22705
|
-
return /* @__PURE__ */
|
|
22800
|
+
return /* @__PURE__ */ React223.createElement(Tooltip24, { label: link.error }, /* @__PURE__ */ React223.createElement(Badge38, { display: "inline-block", size: "sm", variant: "light", color: "red" }, "Error"));
|
|
22706
22801
|
}
|
|
22707
22802
|
if (!link.statusData) {
|
|
22708
22803
|
return null;
|
|
@@ -22710,21 +22805,21 @@ var FlowLinkPanel = ({ block }) => {
|
|
|
22710
22805
|
const status = link.statusData.status;
|
|
22711
22806
|
switch (status) {
|
|
22712
22807
|
case "completed":
|
|
22713
|
-
return /* @__PURE__ */
|
|
22808
|
+
return /* @__PURE__ */ React223.createElement(Badge38, { display: "inline-block", size: "sm", variant: "light", color: "green", leftSection: /* @__PURE__ */ React223.createElement(IconCheck12, { size: 12 }) }, "Completed");
|
|
22714
22809
|
case "in_progress":
|
|
22715
|
-
return /* @__PURE__ */
|
|
22810
|
+
return /* @__PURE__ */ React223.createElement(Badge38, { display: "inline-block", size: "sm", variant: "light", color: "blue", leftSection: /* @__PURE__ */ React223.createElement(IconClock3, { size: 12 }) }, "In Progress");
|
|
22716
22811
|
case "not_started":
|
|
22717
22812
|
default:
|
|
22718
|
-
return /* @__PURE__ */
|
|
22813
|
+
return /* @__PURE__ */ React223.createElement(Badge38, { display: "inline-block", size: "sm", variant: "light", color: "gray", leftSection: /* @__PURE__ */ React223.createElement(IconCircleDashed4, { size: 12 }) }, "Not Started");
|
|
22719
22814
|
}
|
|
22720
22815
|
};
|
|
22721
|
-
return /* @__PURE__ */
|
|
22816
|
+
return /* @__PURE__ */ React223.createElement(BaseRightPanelLayout, { title: block.props.title || "Flow Links", onClose: closePanel }, /* @__PURE__ */ React223.createElement(Stack145, { gap: "md" }, handlers.getFlowStatus && /* @__PURE__ */ React223.createElement(Tooltip24, { label: "Refresh status" }, /* @__PURE__ */ React223.createElement(ActionIcon35, { variant: "subtle", size: "sm", onClick: fetchStatuses }, /* @__PURE__ */ React223.createElement(IconRefresh7, { size: 16 }))), linksWithStatus.length === 0 ? /* @__PURE__ */ React223.createElement(Card21, { withBorder: true, p: "md", bg: "gray.0" }, /* @__PURE__ */ React223.createElement(Text120, { size: "sm", c: "dimmed", ta: "center" }, "No flow links configured.")) : /* @__PURE__ */ React223.createElement(Stack145, { gap: "sm" }, linksWithStatus.map((link) => /* @__PURE__ */ React223.createElement(Stack145, { key: link.id }, link.description && /* @__PURE__ */ React223.createElement(Text120, null, link.description), /* @__PURE__ */ React223.createElement(
|
|
22722
22817
|
BaseContainer,
|
|
22723
22818
|
{
|
|
22724
|
-
onClick: () =>
|
|
22819
|
+
onClick: () => handleNavigate(link),
|
|
22725
22820
|
style: { opacity: !handlers.navigateToFlow ? 0.6 : 1, minHeight: 84, cursor: !handlers.navigateToFlow ? "not-allowed" : "pointer" }
|
|
22726
22821
|
},
|
|
22727
|
-
/* @__PURE__ */
|
|
22822
|
+
/* @__PURE__ */ React223.createElement(Group76, { wrap: "nowrap", align: "center", style: { flex: 1 } }, getIcon("external-link", block.props.icon), /* @__PURE__ */ React223.createElement(Stack145, { gap: 4, style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ React223.createElement(Group76, { gap: "xs", align: "center" }, /* @__PURE__ */ React223.createElement(Text120, { size: "sm", fw: 600 }, link.title || "Untitled Flow"), link.isWorkspaceLink && /* @__PURE__ */ React223.createElement(Badge38, { size: "xs", variant: "light", color: "blue" }, "Workspace"), getStatusBadge(link)), link.isWorkspaceLink && link.workspacePageDescription && /* @__PURE__ */ React223.createElement(Text120, { size: "xs", c: "dimmed" }, "\u2192 ", link.workspacePageDescription), link.captionText && /* @__PURE__ */ React223.createElement(Text120, { size: "sm", c: "dimmed", lineClamp: 2 }, link.captionText)), link.statusData?.completedAt && /* @__PURE__ */ React223.createElement(Text120, { size: "sm", c: "dimmed" }, "Completed: ", new Date(link.statusData.completedAt).toLocaleDateString()))
|
|
22728
22823
|
))))));
|
|
22729
22824
|
};
|
|
22730
22825
|
|
|
@@ -22735,7 +22830,7 @@ var FlowLinkFlowView = ({ editor, block, isDisabled }) => {
|
|
|
22735
22830
|
const links = safeParseJSONArray(block.props.links);
|
|
22736
22831
|
const linksCount = links.length;
|
|
22737
22832
|
const panelId = `${FLOW_LINK_FLOW_PANEL_ID}-${block.id}`;
|
|
22738
|
-
const panelContent = useMemo75(() => /* @__PURE__ */
|
|
22833
|
+
const panelContent = useMemo75(() => /* @__PURE__ */ React224.createElement(FlowLinkPanel, { editor, block }), [editor, block]);
|
|
22739
22834
|
const { open } = usePanel(panelId, panelContent);
|
|
22740
22835
|
const handleClick = () => {
|
|
22741
22836
|
if (!disabled) {
|
|
@@ -22749,9 +22844,9 @@ var FlowLinkFlowView = ({ editor, block, isDisabled }) => {
|
|
|
22749
22844
|
return { color: "accent.5", text: `${linksCount} link${linksCount !== 1 ? "s" : ""}` };
|
|
22750
22845
|
};
|
|
22751
22846
|
const badgeProps = getBadgeProps();
|
|
22752
|
-
const cardContent = /* @__PURE__ */
|
|
22847
|
+
const cardContent = /* @__PURE__ */ React224.createElement(BaseContainer, { onClick: handleClick, style: { opacity: disabled ? 0.6 : 1, cursor: disabled ? "not-allowed" : "pointer" } }, /* @__PURE__ */ React224.createElement(Group77, { wrap: "nowrap", align: "center", style: { flex: 1 } }, getIcon("external-link", block.props.icon), /* @__PURE__ */ React224.createElement(Stack146, { gap: 4, style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ React224.createElement(Group77, { gap: "xs", align: "center" }, /* @__PURE__ */ React224.createElement(Text121, { fw: 600, size: "sm" }, block.props.title || "Flow Link"), /* @__PURE__ */ React224.createElement(Badge39, { size: "xs", variant: "light", bg: badgeProps.color }, badgeProps.text)), /* @__PURE__ */ React224.createElement(Text121, { size: "xs", c: "dimmed", lineClamp: 2 }, block.props.description || (linksCount > 0 ? "Click to view links" : "No links configured")))));
|
|
22753
22848
|
if (disabled && isDisabled?.message) {
|
|
22754
|
-
return /* @__PURE__ */
|
|
22849
|
+
return /* @__PURE__ */ React224.createElement(Tooltip25, { label: isDisabled.message }, cardContent);
|
|
22755
22850
|
}
|
|
22756
22851
|
return cardContent;
|
|
22757
22852
|
};
|
|
@@ -22761,7 +22856,7 @@ function FlowLinkBlock({ editor, block }) {
|
|
|
22761
22856
|
const { docType } = useBlocknoteContext();
|
|
22762
22857
|
const { actions } = useBlockConditions(block, editor);
|
|
22763
22858
|
if (docType === "template") {
|
|
22764
|
-
return /* @__PURE__ */
|
|
22859
|
+
return /* @__PURE__ */ React225.createElement(FlowLinkTemplateView, { editor, block });
|
|
22765
22860
|
}
|
|
22766
22861
|
const conditionConfig = parseConditionConfig(block.props.conditions);
|
|
22767
22862
|
const hasVisibility = hasVisibilityConditions(conditionConfig);
|
|
@@ -22773,7 +22868,7 @@ function FlowLinkBlock({ editor, block }) {
|
|
|
22773
22868
|
const hasEnable = hasEnableConditions(conditionConfig);
|
|
22774
22869
|
const enableActionExists = actions.some((a) => a.action === "enable");
|
|
22775
22870
|
const shouldDisable = hasEnable && !enableActionExists;
|
|
22776
|
-
return /* @__PURE__ */
|
|
22871
|
+
return /* @__PURE__ */ React225.createElement(
|
|
22777
22872
|
FlowLinkFlowView,
|
|
22778
22873
|
{
|
|
22779
22874
|
block,
|
|
@@ -22813,7 +22908,7 @@ var FlowLinkBlockSpec = createReactBlockSpec20(
|
|
|
22813
22908
|
{
|
|
22814
22909
|
render: (props) => {
|
|
22815
22910
|
const ixoProps = props;
|
|
22816
|
-
return /* @__PURE__ */
|
|
22911
|
+
return /* @__PURE__ */ React226.createElement(FlowLinkBlock_default, { ...ixoProps });
|
|
22817
22912
|
}
|
|
22818
22913
|
}
|
|
22819
22914
|
);
|
|
@@ -22989,7 +23084,7 @@ blockRegistry.register({
|
|
|
22989
23084
|
});
|
|
22990
23085
|
|
|
22991
23086
|
// src/mantine/blocks/hooks/useBlockDependencies.ts
|
|
22992
|
-
import { useMemo as useMemo76, useEffect as
|
|
23087
|
+
import { useMemo as useMemo76, useEffect as useEffect64, useState as useState80, useCallback as useCallback65 } from "react";
|
|
22993
23088
|
|
|
22994
23089
|
// src/mantine/blocks/hooks/useDependsOn.ts
|
|
22995
23090
|
import { useMemo as useMemo77 } from "react";
|
|
@@ -23559,11 +23654,11 @@ import { useCreateBlockNote as useCreateBlockNote2 } from "@blocknote/react";
|
|
|
23559
23654
|
import { BlockNoteSchema as BlockNoteSchema2, defaultBlockSpecs as defaultBlockSpecs2, defaultInlineContentSpecs as defaultInlineContentSpecs2, defaultStyleSpecs as defaultStyleSpecs2 } from "@blocknote/core";
|
|
23560
23655
|
|
|
23561
23656
|
// src/core/hooks/useMatrixProvider.ts
|
|
23562
|
-
import { useEffect as
|
|
23657
|
+
import { useEffect as useEffect65, useState as useState81, useRef as useRef17, useCallback as useCallback66, useMemo as useMemo78 } from "react";
|
|
23563
23658
|
import { MatrixProvider } from "@ixo/matrix-crdt";
|
|
23564
23659
|
function useMatrixProvider({ matrixClient, roomId, yDoc }) {
|
|
23565
|
-
const [matrixProvider, setProvider] =
|
|
23566
|
-
const [status, setStatus] =
|
|
23660
|
+
const [matrixProvider, setProvider] = useState81(null);
|
|
23661
|
+
const [status, setStatus] = useState81("disconnected");
|
|
23567
23662
|
const isMountedRef = useRef17(true);
|
|
23568
23663
|
const providerRef = useRef17(null);
|
|
23569
23664
|
const retryTimeoutRef = useRef17(null);
|
|
@@ -23628,7 +23723,7 @@ function useMatrixProvider({ matrixClient, roomId, yDoc }) {
|
|
|
23628
23723
|
}
|
|
23629
23724
|
}
|
|
23630
23725
|
}, [matrixClient, providerOptions, handleDocumentAvailable, handleDocumentUnavailable, handleCanWriteChanged]);
|
|
23631
|
-
|
|
23726
|
+
useEffect65(() => {
|
|
23632
23727
|
isMountedRef.current = true;
|
|
23633
23728
|
initProvider();
|
|
23634
23729
|
return () => {
|
|
@@ -23645,7 +23740,7 @@ function useMatrixProvider({ matrixClient, roomId, yDoc }) {
|
|
|
23645
23740
|
setStatus("disconnected");
|
|
23646
23741
|
};
|
|
23647
23742
|
}, [initProvider]);
|
|
23648
|
-
|
|
23743
|
+
useEffect65(() => {
|
|
23649
23744
|
return () => {
|
|
23650
23745
|
isMountedRef.current = false;
|
|
23651
23746
|
};
|
|
@@ -23664,7 +23759,7 @@ function useCollaborativeYDoc(_options) {
|
|
|
23664
23759
|
}
|
|
23665
23760
|
|
|
23666
23761
|
// src/mantine/hooks/useCollaborativeIxoEditor.ts
|
|
23667
|
-
import { useMemo as useMemo80, useEffect as
|
|
23762
|
+
import { useMemo as useMemo80, useEffect as useEffect66, useState as useState82 } from "react";
|
|
23668
23763
|
|
|
23669
23764
|
// src/core/lib/matrixMetadata.ts
|
|
23670
23765
|
var COVER_IMAGE_EVENT_TYPE = "ixo.page.cover_image";
|
|
@@ -23849,7 +23944,7 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
23849
23944
|
roomId: options.roomId
|
|
23850
23945
|
});
|
|
23851
23946
|
const metadataManager = useMemo80(() => new MatrixMetadataManager(matrixClient, options.roomId), [matrixClient, options.roomId]);
|
|
23852
|
-
|
|
23947
|
+
useEffect66(() => {
|
|
23853
23948
|
return () => {
|
|
23854
23949
|
metadataManager.dispose();
|
|
23855
23950
|
};
|
|
@@ -24101,12 +24196,12 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
24101
24196
|
return void 0;
|
|
24102
24197
|
};
|
|
24103
24198
|
}
|
|
24104
|
-
|
|
24199
|
+
useEffect66(() => {
|
|
24105
24200
|
if (ixoEditor) {
|
|
24106
24201
|
ixoEditor.isEditable = editable;
|
|
24107
24202
|
}
|
|
24108
24203
|
}, [ixoEditor, editable]);
|
|
24109
|
-
|
|
24204
|
+
useEffect66(() => {
|
|
24110
24205
|
if (connectionStatus !== "connected") {
|
|
24111
24206
|
return;
|
|
24112
24207
|
}
|
|
@@ -24128,9 +24223,9 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
24128
24223
|
titleText.insert(0, options.title);
|
|
24129
24224
|
}
|
|
24130
24225
|
}, [connectionStatus, root, titleText, permissions.write, options.docId, options.title, memoizedUser.id]);
|
|
24131
|
-
const [connectedUsers, setConnectedUsers] =
|
|
24226
|
+
const [connectedUsers, setConnectedUsers] = useState82([]);
|
|
24132
24227
|
const webrtcProvider = matrixProvider?.webrtcProvider;
|
|
24133
|
-
|
|
24228
|
+
useEffect66(() => {
|
|
24134
24229
|
if (!matrixProvider?.awarenessInstance || !webrtcProvider || connectionStatus !== "connected") {
|
|
24135
24230
|
return;
|
|
24136
24231
|
}
|
|
@@ -24149,7 +24244,7 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
24149
24244
|
awareness.off("change", updateUsers);
|
|
24150
24245
|
};
|
|
24151
24246
|
}, [matrixProvider, webrtcProvider, connectionStatus]);
|
|
24152
|
-
|
|
24247
|
+
useEffect66(() => {
|
|
24153
24248
|
if (!matrixProvider?.awarenessInstance || !webrtcProvider || connectionStatus !== "connected") {
|
|
24154
24249
|
return;
|
|
24155
24250
|
}
|
|
@@ -24187,15 +24282,15 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
24187
24282
|
}
|
|
24188
24283
|
|
|
24189
24284
|
// src/mantine/components/Base/BaseIconPicker.tsx
|
|
24190
|
-
import
|
|
24285
|
+
import React228, { useState as useState83, useMemo as useMemo81, useEffect as useEffect67 } from "react";
|
|
24191
24286
|
import { TextInput as TextInput7, Tabs as Tabs5, Box as Box41, Stack as Stack147, UnstyledButton as UnstyledButton2, Text as Text122, Center as Center12, ScrollArea as ScrollArea8, Group as Group78, Popover as Popover4 } from "@mantine/core";
|
|
24192
24287
|
import * as TablerIcons from "@tabler/icons-react";
|
|
24193
24288
|
import { IconSearch as IconSearch6, IconX as IconX11, IconChevronLeft, IconChevronRight as IconChevronRight11 } from "@tabler/icons-react";
|
|
24194
24289
|
|
|
24195
24290
|
// src/mantine/components/Base/CoverImageButton.tsx
|
|
24196
|
-
import
|
|
24291
|
+
import React227, { forwardRef } from "react";
|
|
24197
24292
|
import { Button as Button38 } from "@mantine/core";
|
|
24198
|
-
var CoverImageButton = forwardRef(({ isActive = false, onClick, children, style, ...props }, ref) => /* @__PURE__ */
|
|
24293
|
+
var CoverImageButton = forwardRef(({ isActive = false, onClick, children, style, ...props }, ref) => /* @__PURE__ */ React227.createElement(
|
|
24199
24294
|
Button38,
|
|
24200
24295
|
{
|
|
24201
24296
|
ref,
|
|
@@ -24245,9 +24340,9 @@ var localStorageService = {
|
|
|
24245
24340
|
var iconsKey = "editor_recent_icons";
|
|
24246
24341
|
var ICONS_PER_PAGE = 500;
|
|
24247
24342
|
function BaseIconPicker({ opened, onClose, onSelectIcon, onUploadClick, children, currentIcon }) {
|
|
24248
|
-
const [searchQuery, setSearchQuery] =
|
|
24249
|
-
const [activeTab, setActiveTab] =
|
|
24250
|
-
const [currentPage, setCurrentPage] =
|
|
24343
|
+
const [searchQuery, setSearchQuery] = useState83("");
|
|
24344
|
+
const [activeTab, setActiveTab] = useState83("icons");
|
|
24345
|
+
const [currentPage, setCurrentPage] = useState83(1);
|
|
24251
24346
|
const allIcons = useMemo81(() => {
|
|
24252
24347
|
const iconEntries = Object.entries(TablerIcons).filter(([name]) => name.startsWith("Icon") && name !== "IconProps");
|
|
24253
24348
|
return iconEntries;
|
|
@@ -24257,7 +24352,7 @@ function BaseIconPicker({ opened, onClose, onSelectIcon, onUploadClick, children
|
|
|
24257
24352
|
const query = searchQuery.toLowerCase();
|
|
24258
24353
|
return allIcons.filter(([name]) => name.toLowerCase().includes(query));
|
|
24259
24354
|
}, [allIcons, searchQuery]);
|
|
24260
|
-
|
|
24355
|
+
useEffect67(() => {
|
|
24261
24356
|
setCurrentPage(1);
|
|
24262
24357
|
}, [searchQuery]);
|
|
24263
24358
|
const paginatedIcons = useMemo81(() => {
|
|
@@ -24281,9 +24376,9 @@ function BaseIconPicker({ opened, onClose, onSelectIcon, onUploadClick, children
|
|
|
24281
24376
|
};
|
|
24282
24377
|
const renderIconGrid = (icons) => {
|
|
24283
24378
|
if (icons.length === 0) {
|
|
24284
|
-
return /* @__PURE__ */
|
|
24379
|
+
return /* @__PURE__ */ React228.createElement(Center12, { py: "xl" }, /* @__PURE__ */ React228.createElement(Text122, { c: "dimmed", size: "sm" }, "No icons found"));
|
|
24285
24380
|
}
|
|
24286
|
-
return /* @__PURE__ */
|
|
24381
|
+
return /* @__PURE__ */ React228.createElement(
|
|
24287
24382
|
Box41,
|
|
24288
24383
|
{
|
|
24289
24384
|
style: {
|
|
@@ -24295,7 +24390,7 @@ function BaseIconPicker({ opened, onClose, onSelectIcon, onUploadClick, children
|
|
|
24295
24390
|
},
|
|
24296
24391
|
icons.map(([name, IconComponent]) => {
|
|
24297
24392
|
const isSelected = currentIcon === name.replace("Icon", "").replace(/([A-Z])/g, "-$1").toLowerCase().slice(1);
|
|
24298
|
-
return /* @__PURE__ */
|
|
24393
|
+
return /* @__PURE__ */ React228.createElement(
|
|
24299
24394
|
UnstyledButton2,
|
|
24300
24395
|
{
|
|
24301
24396
|
key: name,
|
|
@@ -24321,12 +24416,12 @@ function BaseIconPicker({ opened, onClose, onSelectIcon, onUploadClick, children
|
|
|
24321
24416
|
}
|
|
24322
24417
|
}
|
|
24323
24418
|
},
|
|
24324
|
-
/* @__PURE__ */
|
|
24419
|
+
/* @__PURE__ */ React228.createElement(IconComponent, { color: "white", size: 24, stroke: 1.5 })
|
|
24325
24420
|
);
|
|
24326
24421
|
})
|
|
24327
24422
|
);
|
|
24328
24423
|
};
|
|
24329
|
-
return /* @__PURE__ */
|
|
24424
|
+
return /* @__PURE__ */ React228.createElement(Popover4, { opened, onClose, position: "right", width: 500, shadow: "xl" }, /* @__PURE__ */ React228.createElement(Popover4.Target, null, children), /* @__PURE__ */ React228.createElement(
|
|
24330
24425
|
Popover4.Dropdown,
|
|
24331
24426
|
{
|
|
24332
24427
|
style: {
|
|
@@ -24336,15 +24431,15 @@ function BaseIconPicker({ opened, onClose, onSelectIcon, onUploadClick, children
|
|
|
24336
24431
|
},
|
|
24337
24432
|
p: 0
|
|
24338
24433
|
},
|
|
24339
|
-
/* @__PURE__ */
|
|
24434
|
+
/* @__PURE__ */ React228.createElement(Stack147, { gap: "md", p: "md" }, /* @__PURE__ */ React228.createElement(Tabs5, { value: activeTab, onChange: setActiveTab, variant: "pills" }, /* @__PURE__ */ React228.createElement(Tabs5.List, null, /* @__PURE__ */ React228.createElement(Tabs5.Tab, { value: "icons" }, "Icons"), /* @__PURE__ */ React228.createElement(Tabs5.Tab, { value: "upload" }, "Upload")), /* @__PURE__ */ React228.createElement(Tabs5.Panel, { value: "icons", pt: "md" }, /* @__PURE__ */ React228.createElement(
|
|
24340
24435
|
TextInput7,
|
|
24341
24436
|
{
|
|
24342
24437
|
mb: "md",
|
|
24343
24438
|
placeholder: "Filter",
|
|
24344
|
-
leftSection: /* @__PURE__ */
|
|
24439
|
+
leftSection: /* @__PURE__ */ React228.createElement(IconSearch6, { size: 18 }),
|
|
24345
24440
|
value: searchQuery,
|
|
24346
24441
|
onChange: (e) => setSearchQuery(e.currentTarget.value),
|
|
24347
|
-
rightSection: searchQuery && /* @__PURE__ */
|
|
24442
|
+
rightSection: searchQuery && /* @__PURE__ */ React228.createElement(UnstyledButton2, { onClick: () => setSearchQuery("") }, /* @__PURE__ */ React228.createElement(IconX11, { size: 18 })),
|
|
24348
24443
|
style: { flex: 1 },
|
|
24349
24444
|
styles: {
|
|
24350
24445
|
input: {
|
|
@@ -24354,21 +24449,21 @@ function BaseIconPicker({ opened, onClose, onSelectIcon, onUploadClick, children
|
|
|
24354
24449
|
}
|
|
24355
24450
|
}
|
|
24356
24451
|
}
|
|
24357
|
-
), !searchQuery && /* @__PURE__ */
|
|
24452
|
+
), !searchQuery && /* @__PURE__ */ React228.createElement(Box41, { mb: "md" }, /* @__PURE__ */ React228.createElement(Text122, { size: "sm", fw: 500, mb: "xs", px: "xs" }, "Recent"), /* @__PURE__ */ React228.createElement(ScrollArea8.Autosize, { scrollbarSize: 0, mah: 60 }, renderIconGrid(recentIcons))), /* @__PURE__ */ React228.createElement(Box41, null, /* @__PURE__ */ React228.createElement(Group78, { justify: "space-between", mb: "xs", px: "xs" }, /* @__PURE__ */ React228.createElement(Text122, { size: "sm", fw: 500 }, searchQuery ? "Results" : "Icons"), totalPages > 1 && /* @__PURE__ */ React228.createElement(Group78, { gap: "xs" }, /* @__PURE__ */ React228.createElement(Text122, { size: "xs", c: "dimmed" }, "Page ", currentPage, " of ", totalPages, " (", filteredIcons.length, " total)"), /* @__PURE__ */ React228.createElement(BaseButton, { size: "xs", onClick: () => setCurrentPage((p) => Math.max(1, p - 1)), disabled: currentPage === 1, leftSection: /* @__PURE__ */ React228.createElement(IconChevronLeft, { size: 14 }) }, "Prev"), /* @__PURE__ */ React228.createElement(
|
|
24358
24453
|
BaseButton,
|
|
24359
24454
|
{
|
|
24360
24455
|
size: "xs",
|
|
24361
24456
|
onClick: () => setCurrentPage((p) => Math.min(totalPages, p + 1)),
|
|
24362
24457
|
disabled: currentPage === totalPages,
|
|
24363
|
-
leftSection: /* @__PURE__ */
|
|
24458
|
+
leftSection: /* @__PURE__ */ React228.createElement(IconChevronRight11, { size: 14 })
|
|
24364
24459
|
},
|
|
24365
24460
|
"Next"
|
|
24366
|
-
))), /* @__PURE__ */
|
|
24461
|
+
))), /* @__PURE__ */ React228.createElement(ScrollArea8.Autosize, { scrollbarSize: 0, mah: 200 }, renderIconGrid(paginatedIcons)))), /* @__PURE__ */ React228.createElement(Tabs5.Panel, { value: "upload", pt: "md" }, /* @__PURE__ */ React228.createElement(Center12, { py: "xl" }, /* @__PURE__ */ React228.createElement(Stack147, { align: "center", gap: "md" }, /* @__PURE__ */ React228.createElement(Text122, { size: "sm", c: "dimmed", ta: "center" }, "Upload a custom icon image", /* @__PURE__ */ React228.createElement("br", null), "(PNG, JPG, SVG)"), /* @__PURE__ */ React228.createElement(CoverImageButton, { onClick: onUploadClick }, "Choose File"))))))
|
|
24367
24462
|
));
|
|
24368
24463
|
}
|
|
24369
24464
|
|
|
24370
24465
|
// src/mantine/components/CoverImage.tsx
|
|
24371
|
-
import
|
|
24466
|
+
import React230, { useState as useState84, useRef as useRef18, useEffect as useEffect68 } from "react";
|
|
24372
24467
|
import { Box as Box43, Group as Group79 } from "@mantine/core";
|
|
24373
24468
|
|
|
24374
24469
|
// src/core/lib/imageTransform.ts
|
|
@@ -24502,7 +24597,7 @@ function transformIconImage(sourceUrl, size = "default", customOptions) {
|
|
|
24502
24597
|
}
|
|
24503
24598
|
|
|
24504
24599
|
// src/mantine/components/Base/PageIcon.tsx
|
|
24505
|
-
import
|
|
24600
|
+
import React229, { useMemo as useMemo82 } from "react";
|
|
24506
24601
|
import { Center as Center13, Box as Box42 } from "@mantine/core";
|
|
24507
24602
|
import * as TablerIcons2 from "@tabler/icons-react";
|
|
24508
24603
|
function PageIcon({ src, iconSize = 64, useCenter = false, style }) {
|
|
@@ -24518,7 +24613,7 @@ function PageIcon({ src, iconSize = 64, useCenter = false, style }) {
|
|
|
24518
24613
|
const Container = useCenter ? Center13 : Box42;
|
|
24519
24614
|
if (!src) return null;
|
|
24520
24615
|
if (IconComponent) {
|
|
24521
|
-
return /* @__PURE__ */
|
|
24616
|
+
return /* @__PURE__ */ React229.createElement(
|
|
24522
24617
|
Container,
|
|
24523
24618
|
{
|
|
24524
24619
|
style: {
|
|
@@ -24530,10 +24625,10 @@ function PageIcon({ src, iconSize = 64, useCenter = false, style }) {
|
|
|
24530
24625
|
...style
|
|
24531
24626
|
}
|
|
24532
24627
|
},
|
|
24533
|
-
/* @__PURE__ */
|
|
24628
|
+
/* @__PURE__ */ React229.createElement(IconComponent, { size: iconSize, color: "white", stroke: 1.5 })
|
|
24534
24629
|
);
|
|
24535
24630
|
}
|
|
24536
|
-
return /* @__PURE__ */
|
|
24631
|
+
return /* @__PURE__ */ React229.createElement(
|
|
24537
24632
|
"img",
|
|
24538
24633
|
{
|
|
24539
24634
|
src,
|
|
@@ -24554,14 +24649,14 @@ function PageIcon({ src, iconSize = 64, useCenter = false, style }) {
|
|
|
24554
24649
|
import { useDisclosure as useDisclosure5 } from "@mantine/hooks";
|
|
24555
24650
|
function CoverImage({ coverImageUrl, logoUrl }) {
|
|
24556
24651
|
const { editor, handlers, editable } = useBlocknoteContext();
|
|
24557
|
-
const [isHovering, setIsHovering] =
|
|
24558
|
-
const [isRepositioning, setIsRepositioning] =
|
|
24559
|
-
const [coverPosition, setCoverPosition] =
|
|
24652
|
+
const [isHovering, setIsHovering] = useState84(false);
|
|
24653
|
+
const [isRepositioning, setIsRepositioning] = useState84(false);
|
|
24654
|
+
const [coverPosition, setCoverPosition] = useState84(50);
|
|
24560
24655
|
const coverFileInputRef = useRef18(null);
|
|
24561
24656
|
const logoFileInputRef = useRef18(null);
|
|
24562
24657
|
const [opened, { open, close }] = useDisclosure5(false);
|
|
24563
|
-
const [metadata, setMetadata] =
|
|
24564
|
-
|
|
24658
|
+
const [metadata, setMetadata] = useState84(() => editor?.getPageMetadata?.() || null);
|
|
24659
|
+
useEffect68(() => {
|
|
24565
24660
|
if (!editor?._metadataManager) {
|
|
24566
24661
|
return;
|
|
24567
24662
|
}
|
|
@@ -24643,7 +24738,7 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
24643
24738
|
return null;
|
|
24644
24739
|
}
|
|
24645
24740
|
if (!hasCover) {
|
|
24646
|
-
return /* @__PURE__ */
|
|
24741
|
+
return /* @__PURE__ */ React230.createElement(
|
|
24647
24742
|
Box43,
|
|
24648
24743
|
{
|
|
24649
24744
|
style: {
|
|
@@ -24656,7 +24751,7 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
24656
24751
|
onMouseEnter: () => editable && setIsHovering(true),
|
|
24657
24752
|
onMouseLeave: () => editable && setIsHovering(false)
|
|
24658
24753
|
},
|
|
24659
|
-
/* @__PURE__ */
|
|
24754
|
+
/* @__PURE__ */ React230.createElement("div", { style: { maxWidth: "900px", margin: "0 auto", position: "relative", height: "100%" } }, /* @__PURE__ */ React230.createElement("input", { ref: coverFileInputRef, type: "file", accept: "image/*", style: { display: "none" }, onChange: (e) => handleFileSelect(e, "cover") }), /* @__PURE__ */ React230.createElement("input", { ref: logoFileInputRef, type: "file", accept: "image/*", style: { display: "none" }, onChange: (e) => handleFileSelect(e, "logo") }), editable && isHovering && !logoSrc && /* @__PURE__ */ React230.createElement(
|
|
24660
24755
|
Group79,
|
|
24661
24756
|
{
|
|
24662
24757
|
gap: "xs",
|
|
@@ -24667,7 +24762,7 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
24667
24762
|
zIndex: 10
|
|
24668
24763
|
}
|
|
24669
24764
|
},
|
|
24670
|
-
/* @__PURE__ */
|
|
24765
|
+
/* @__PURE__ */ React230.createElement(
|
|
24671
24766
|
BaseIconPicker,
|
|
24672
24767
|
{
|
|
24673
24768
|
opened,
|
|
@@ -24676,10 +24771,10 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
24676
24771
|
onSelectIcon: (name) => handleSelectLogoIcon(name),
|
|
24677
24772
|
onUploadClick: () => logoFileInputRef.current?.click()
|
|
24678
24773
|
},
|
|
24679
|
-
/* @__PURE__ */
|
|
24774
|
+
/* @__PURE__ */ React230.createElement(CoverImageButton, { onClick: open }, "Add icon")
|
|
24680
24775
|
),
|
|
24681
|
-
/* @__PURE__ */
|
|
24682
|
-
), logoSrc && /* @__PURE__ */
|
|
24776
|
+
/* @__PURE__ */ React230.createElement(CoverImageButton, { onClick: () => coverFileInputRef.current?.click() }, "Add cover")
|
|
24777
|
+
), logoSrc && /* @__PURE__ */ React230.createElement(
|
|
24683
24778
|
Box43,
|
|
24684
24779
|
{
|
|
24685
24780
|
style: {
|
|
@@ -24693,8 +24788,8 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
24693
24788
|
zIndex: 11
|
|
24694
24789
|
}
|
|
24695
24790
|
},
|
|
24696
|
-
/* @__PURE__ */
|
|
24697
|
-
editable && isHovering && /* @__PURE__ */
|
|
24791
|
+
/* @__PURE__ */ React230.createElement(PageIcon, { src: logoSrc, useCenter: true, iconSize: 64 }),
|
|
24792
|
+
editable && isHovering && /* @__PURE__ */ React230.createElement(
|
|
24698
24793
|
"div",
|
|
24699
24794
|
{
|
|
24700
24795
|
style: {
|
|
@@ -24709,7 +24804,7 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
24709
24804
|
alignItems: "center"
|
|
24710
24805
|
}
|
|
24711
24806
|
},
|
|
24712
|
-
/* @__PURE__ */
|
|
24807
|
+
/* @__PURE__ */ React230.createElement(
|
|
24713
24808
|
BaseIconPicker,
|
|
24714
24809
|
{
|
|
24715
24810
|
opened,
|
|
@@ -24718,15 +24813,15 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
24718
24813
|
onSelectIcon: (name) => handleSelectLogoIcon(name),
|
|
24719
24814
|
onUploadClick: () => logoFileInputRef.current?.click()
|
|
24720
24815
|
},
|
|
24721
|
-
/* @__PURE__ */
|
|
24816
|
+
/* @__PURE__ */ React230.createElement(CoverImageButton, { onClick: open }, "Change")
|
|
24722
24817
|
),
|
|
24723
|
-
/* @__PURE__ */
|
|
24724
|
-
/* @__PURE__ */
|
|
24818
|
+
/* @__PURE__ */ React230.createElement(CoverImageButton, { onClick: handleRemoveLogo }, "Remove"),
|
|
24819
|
+
/* @__PURE__ */ React230.createElement(CoverImageButton, { onClick: () => coverFileInputRef.current?.click() }, "Add cover")
|
|
24725
24820
|
)
|
|
24726
24821
|
))
|
|
24727
24822
|
);
|
|
24728
24823
|
}
|
|
24729
|
-
return /* @__PURE__ */
|
|
24824
|
+
return /* @__PURE__ */ React230.createElement(
|
|
24730
24825
|
Box43,
|
|
24731
24826
|
{
|
|
24732
24827
|
style: {
|
|
@@ -24746,7 +24841,7 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
24746
24841
|
onMouseMove: handleMouseMove,
|
|
24747
24842
|
onClick: () => isRepositioning && setIsRepositioning(false)
|
|
24748
24843
|
},
|
|
24749
|
-
/* @__PURE__ */
|
|
24844
|
+
/* @__PURE__ */ React230.createElement(
|
|
24750
24845
|
"img",
|
|
24751
24846
|
{
|
|
24752
24847
|
src: coverUrl,
|
|
@@ -24764,7 +24859,7 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
24764
24859
|
}
|
|
24765
24860
|
}
|
|
24766
24861
|
),
|
|
24767
|
-
editable && isHovering && /* @__PURE__ */
|
|
24862
|
+
editable && isHovering && /* @__PURE__ */ React230.createElement(
|
|
24768
24863
|
Group79,
|
|
24769
24864
|
{
|
|
24770
24865
|
gap: "xs",
|
|
@@ -24775,11 +24870,11 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
24775
24870
|
zIndex: 10
|
|
24776
24871
|
}
|
|
24777
24872
|
},
|
|
24778
|
-
/* @__PURE__ */
|
|
24779
|
-
/* @__PURE__ */
|
|
24780
|
-
/* @__PURE__ */
|
|
24873
|
+
/* @__PURE__ */ React230.createElement(CoverImageButton, { onClick: () => coverFileInputRef.current?.click() }, "Change cover"),
|
|
24874
|
+
/* @__PURE__ */ React230.createElement(CoverImageButton, { onClick: () => setIsRepositioning(!isRepositioning), isActive: isRepositioning }, isRepositioning ? "Done" : "Reposition"),
|
|
24875
|
+
/* @__PURE__ */ React230.createElement(CoverImageButton, { onClick: handleRemoveCover }, "Remove")
|
|
24781
24876
|
),
|
|
24782
|
-
/* @__PURE__ */
|
|
24877
|
+
/* @__PURE__ */ React230.createElement("div", { style: { maxWidth: "900px", margin: "0 auto", position: "absolute", bottom: 0, left: -40, right: 0, height: "70px" } }, /* @__PURE__ */ React230.createElement(
|
|
24783
24878
|
Box43,
|
|
24784
24879
|
{
|
|
24785
24880
|
style: {
|
|
@@ -24791,8 +24886,8 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
24791
24886
|
zIndex: 11
|
|
24792
24887
|
}
|
|
24793
24888
|
},
|
|
24794
|
-
logoSrc && /* @__PURE__ */
|
|
24795
|
-
editable && isHovering && /* @__PURE__ */
|
|
24889
|
+
logoSrc && /* @__PURE__ */ React230.createElement(PageIcon, { src: logoSrc, iconSize: 64 }),
|
|
24890
|
+
editable && isHovering && /* @__PURE__ */ React230.createElement(React230.Fragment, null, logoSrc ? /* @__PURE__ */ React230.createElement(
|
|
24796
24891
|
Group79,
|
|
24797
24892
|
{
|
|
24798
24893
|
gap: "xs",
|
|
@@ -24803,7 +24898,7 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
24803
24898
|
zIndex: 12
|
|
24804
24899
|
}
|
|
24805
24900
|
},
|
|
24806
|
-
/* @__PURE__ */
|
|
24901
|
+
/* @__PURE__ */ React230.createElement(
|
|
24807
24902
|
BaseIconPicker,
|
|
24808
24903
|
{
|
|
24809
24904
|
opened,
|
|
@@ -24812,10 +24907,10 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
24812
24907
|
onSelectIcon: (name) => handleSelectLogoIcon(name),
|
|
24813
24908
|
onUploadClick: () => logoFileInputRef.current?.click()
|
|
24814
24909
|
},
|
|
24815
|
-
/* @__PURE__ */
|
|
24910
|
+
/* @__PURE__ */ React230.createElement(CoverImageButton, { onClick: open }, "Change")
|
|
24816
24911
|
),
|
|
24817
|
-
/* @__PURE__ */
|
|
24818
|
-
) : /* @__PURE__ */
|
|
24912
|
+
/* @__PURE__ */ React230.createElement(CoverImageButton, { onClick: handleRemoveLogo }, "Remove")
|
|
24913
|
+
) : /* @__PURE__ */ React230.createElement(
|
|
24819
24914
|
CoverImageButton,
|
|
24820
24915
|
{
|
|
24821
24916
|
onClick: open,
|
|
@@ -24830,13 +24925,13 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
24830
24925
|
"Add icon"
|
|
24831
24926
|
))
|
|
24832
24927
|
)),
|
|
24833
|
-
/* @__PURE__ */
|
|
24834
|
-
/* @__PURE__ */
|
|
24928
|
+
/* @__PURE__ */ React230.createElement("input", { ref: coverFileInputRef, type: "file", accept: "image/*", style: { display: "none" }, onChange: (e) => handleFileSelect(e, "cover") }),
|
|
24929
|
+
/* @__PURE__ */ React230.createElement("input", { ref: logoFileInputRef, type: "file", accept: "image/*", style: { display: "none" }, onChange: (e) => handleFileSelect(e, "logo") })
|
|
24835
24930
|
);
|
|
24836
24931
|
}
|
|
24837
24932
|
|
|
24838
24933
|
// src/mantine/components/PageHeader.tsx
|
|
24839
|
-
import
|
|
24934
|
+
import React231, { useState as useState85, useRef as useRef19, useEffect as useEffect69 } from "react";
|
|
24840
24935
|
function PageHeader({
|
|
24841
24936
|
title = "New page",
|
|
24842
24937
|
icon,
|
|
@@ -24847,9 +24942,9 @@ function PageHeader({
|
|
|
24847
24942
|
isFavorited = false,
|
|
24848
24943
|
menuItems = []
|
|
24849
24944
|
}) {
|
|
24850
|
-
const [isMenuOpen, setIsMenuOpen] =
|
|
24945
|
+
const [isMenuOpen, setIsMenuOpen] = useState85(false);
|
|
24851
24946
|
const menuRef = useRef19(null);
|
|
24852
|
-
|
|
24947
|
+
useEffect69(() => {
|
|
24853
24948
|
function handleClickOutside(event) {
|
|
24854
24949
|
if (menuRef.current && !menuRef.current.contains(event.target)) {
|
|
24855
24950
|
setIsMenuOpen(false);
|
|
@@ -24868,14 +24963,14 @@ function PageHeader({
|
|
|
24868
24963
|
setIsMenuOpen(false);
|
|
24869
24964
|
}
|
|
24870
24965
|
};
|
|
24871
|
-
return /* @__PURE__ */
|
|
24966
|
+
return /* @__PURE__ */ React231.createElement("div", { style: styles.container }, /* @__PURE__ */ React231.createElement("div", { style: styles.leftSection }, /* @__PURE__ */ React231.createElement("span", { style: styles.icon }, icon || "\u{1F4C4}"), /* @__PURE__ */ React231.createElement("span", { style: styles.title }, title), isPrivate && /* @__PURE__ */ React231.createElement("button", { style: styles.privacyBadge }, /* @__PURE__ */ React231.createElement("span", { style: styles.lockIcon }, "\u{1F512}"), /* @__PURE__ */ React231.createElement("span", null, "Private"), /* @__PURE__ */ React231.createElement("span", { style: styles.chevron }, "\u25BE"))), /* @__PURE__ */ React231.createElement("div", { style: styles.rightSection }, lastEdited && /* @__PURE__ */ React231.createElement("span", { style: styles.editedText }, lastEdited), onShare && /* @__PURE__ */ React231.createElement("button", { style: styles.shareButton, onClick: onShare }, "Share"), onFavorite && /* @__PURE__ */ React231.createElement("button", { style: styles.iconButton, onClick: onFavorite }, isFavorited ? "\u2605" : "\u2606"), menuItems.length > 0 && /* @__PURE__ */ React231.createElement("div", { style: styles.menuContainer, ref: menuRef }, /* @__PURE__ */ React231.createElement(
|
|
24872
24967
|
"button",
|
|
24873
24968
|
{
|
|
24874
24969
|
style: styles.menuButton,
|
|
24875
24970
|
onClick: () => setIsMenuOpen(!isMenuOpen),
|
|
24876
24971
|
"aria-label": "Menu"
|
|
24877
24972
|
},
|
|
24878
|
-
/* @__PURE__ */
|
|
24973
|
+
/* @__PURE__ */ React231.createElement(
|
|
24879
24974
|
"svg",
|
|
24880
24975
|
{
|
|
24881
24976
|
width: "16",
|
|
@@ -24883,11 +24978,11 @@ function PageHeader({
|
|
|
24883
24978
|
viewBox: "0 0 16 16",
|
|
24884
24979
|
fill: "currentColor"
|
|
24885
24980
|
},
|
|
24886
|
-
/* @__PURE__ */
|
|
24887
|
-
/* @__PURE__ */
|
|
24888
|
-
/* @__PURE__ */
|
|
24981
|
+
/* @__PURE__ */ React231.createElement("circle", { cx: "3", cy: "8", r: "1.5" }),
|
|
24982
|
+
/* @__PURE__ */ React231.createElement("circle", { cx: "8", cy: "8", r: "1.5" }),
|
|
24983
|
+
/* @__PURE__ */ React231.createElement("circle", { cx: "13", cy: "8", r: "1.5" })
|
|
24889
24984
|
)
|
|
24890
|
-
), isMenuOpen && /* @__PURE__ */
|
|
24985
|
+
), isMenuOpen && /* @__PURE__ */ React231.createElement("div", { style: styles.dropdown }, menuItems.map((item, index) => /* @__PURE__ */ React231.createElement(React231.Fragment, { key: index }, item.divider && index > 0 && /* @__PURE__ */ React231.createElement("div", { style: styles.divider }), /* @__PURE__ */ React231.createElement(
|
|
24891
24986
|
"button",
|
|
24892
24987
|
{
|
|
24893
24988
|
style: {
|
|
@@ -24897,8 +24992,8 @@ function PageHeader({
|
|
|
24897
24992
|
onClick: () => handleMenuItemClick(item),
|
|
24898
24993
|
disabled: item.disabled
|
|
24899
24994
|
},
|
|
24900
|
-
item.icon && /* @__PURE__ */
|
|
24901
|
-
/* @__PURE__ */
|
|
24995
|
+
item.icon && /* @__PURE__ */ React231.createElement("span", { style: styles.menuItemIcon }, item.icon),
|
|
24996
|
+
/* @__PURE__ */ React231.createElement("span", null, item.label)
|
|
24902
24997
|
)))))));
|
|
24903
24998
|
}
|
|
24904
24999
|
var styles = {
|
|
@@ -25029,7 +25124,7 @@ var styles = {
|
|
|
25029
25124
|
};
|
|
25030
25125
|
|
|
25031
25126
|
// src/mantine/components/ExternalDropZone.tsx
|
|
25032
|
-
import
|
|
25127
|
+
import React232, { useCallback as useCallback67, useEffect as useEffect70, useRef as useRef20, useState as useState86 } from "react";
|
|
25033
25128
|
import { Box as Box44 } from "@mantine/core";
|
|
25034
25129
|
var SCROLL_ZONE_SIZE = 80;
|
|
25035
25130
|
var SCROLL_SPEED = 12;
|
|
@@ -25043,9 +25138,9 @@ var ExternalDropZone = ({
|
|
|
25043
25138
|
children
|
|
25044
25139
|
}) => {
|
|
25045
25140
|
const containerRef = useRef20(null);
|
|
25046
|
-
const [isValidDrag, setIsValidDrag] =
|
|
25047
|
-
const [isHoveringInPlacementMode, setIsHoveringInPlacementMode] =
|
|
25048
|
-
const [indicatorStyle, setIndicatorStyle] =
|
|
25141
|
+
const [isValidDrag, setIsValidDrag] = useState86(false);
|
|
25142
|
+
const [isHoveringInPlacementMode, setIsHoveringInPlacementMode] = useState86(false);
|
|
25143
|
+
const [indicatorStyle, setIndicatorStyle] = useState86({});
|
|
25049
25144
|
const dropPositionRef = useRef20(null);
|
|
25050
25145
|
const scrollAnimationRef = useRef20(null);
|
|
25051
25146
|
const scrollDirectionRef = useRef20(null);
|
|
@@ -25205,7 +25300,7 @@ var ExternalDropZone = ({
|
|
|
25205
25300
|
},
|
|
25206
25301
|
[onDrop, stopAutoScroll]
|
|
25207
25302
|
);
|
|
25208
|
-
|
|
25303
|
+
useEffect70(() => {
|
|
25209
25304
|
const handleGlobalDragEnd = () => {
|
|
25210
25305
|
setIsValidDrag(false);
|
|
25211
25306
|
dropPositionRef.current = null;
|
|
@@ -25263,7 +25358,7 @@ var ExternalDropZone = ({
|
|
|
25263
25358
|
},
|
|
25264
25359
|
[getScrollContainer]
|
|
25265
25360
|
);
|
|
25266
|
-
|
|
25361
|
+
useEffect70(() => {
|
|
25267
25362
|
if (!isPlacementMode) return;
|
|
25268
25363
|
const handleKeyDown = (e) => {
|
|
25269
25364
|
if (e.key === "Escape") {
|
|
@@ -25286,13 +25381,13 @@ var ExternalDropZone = ({
|
|
|
25286
25381
|
document.removeEventListener("click", handleGlobalClick, true);
|
|
25287
25382
|
};
|
|
25288
25383
|
}, [isPlacementMode, onPlacementCancel]);
|
|
25289
|
-
|
|
25384
|
+
useEffect70(() => {
|
|
25290
25385
|
if (!isPlacementMode) {
|
|
25291
25386
|
setIsHoveringInPlacementMode(false);
|
|
25292
25387
|
dropPositionRef.current = null;
|
|
25293
25388
|
}
|
|
25294
25389
|
}, [isPlacementMode]);
|
|
25295
|
-
|
|
25390
|
+
useEffect70(() => {
|
|
25296
25391
|
const isActive = isValidDrag || isPlacementMode && isHoveringInPlacementMode;
|
|
25297
25392
|
if (isActive) {
|
|
25298
25393
|
document.body.classList.add("external-artifact-drag-active");
|
|
@@ -25303,18 +25398,18 @@ var ExternalDropZone = ({
|
|
|
25303
25398
|
document.body.classList.remove("external-artifact-drag-active");
|
|
25304
25399
|
};
|
|
25305
25400
|
}, [isValidDrag, isPlacementMode, isHoveringInPlacementMode]);
|
|
25306
|
-
|
|
25401
|
+
useEffect70(() => {
|
|
25307
25402
|
return () => {
|
|
25308
25403
|
if (scrollAnimationRef.current) {
|
|
25309
25404
|
cancelAnimationFrame(scrollAnimationRef.current);
|
|
25310
25405
|
}
|
|
25311
25406
|
};
|
|
25312
25407
|
}, []);
|
|
25313
|
-
const indicatorWithPosition = dropIndicator &&
|
|
25408
|
+
const indicatorWithPosition = dropIndicator && React232.isValidElement(dropIndicator) ? React232.cloneElement(dropIndicator, {
|
|
25314
25409
|
indicatorTop: typeof indicatorStyle.top === "number" ? indicatorStyle.top : void 0
|
|
25315
25410
|
}) : dropIndicator;
|
|
25316
25411
|
const shouldShowIndicator = isValidDrag || isPlacementMode && isHoveringInPlacementMode;
|
|
25317
|
-
return /* @__PURE__ */
|
|
25412
|
+
return /* @__PURE__ */ React232.createElement(
|
|
25318
25413
|
Box44,
|
|
25319
25414
|
{
|
|
25320
25415
|
ref: containerRef,
|
|
@@ -25330,7 +25425,7 @@ var ExternalDropZone = ({
|
|
|
25330
25425
|
"data-placement-mode": isPlacementMode ? "true" : void 0
|
|
25331
25426
|
},
|
|
25332
25427
|
children,
|
|
25333
|
-
isPlacementMode && /* @__PURE__ */
|
|
25428
|
+
isPlacementMode && /* @__PURE__ */ React232.createElement(
|
|
25334
25429
|
Box44,
|
|
25335
25430
|
{
|
|
25336
25431
|
style: {
|
|
@@ -25350,19 +25445,19 @@ var ExternalDropZone = ({
|
|
|
25350
25445
|
onWheel: handleOverlayWheel
|
|
25351
25446
|
}
|
|
25352
25447
|
),
|
|
25353
|
-
shouldShowIndicator && indicatorWithPosition && /* @__PURE__ */
|
|
25448
|
+
shouldShowIndicator && indicatorWithPosition && /* @__PURE__ */ React232.createElement(Box44, { style: { ...indicatorStyle, background: "none", border: "none", boxShadow: "none" } }, indicatorWithPosition)
|
|
25354
25449
|
);
|
|
25355
25450
|
};
|
|
25356
25451
|
|
|
25357
25452
|
// src/mantine/IxoEditor.tsx
|
|
25358
|
-
import
|
|
25453
|
+
import React234 from "react";
|
|
25359
25454
|
import { getDefaultReactSlashMenuItems, SuggestionMenuController } from "@blocknote/react";
|
|
25360
25455
|
import { BlockNoteView } from "@blocknote/mantine";
|
|
25361
25456
|
import { filterSuggestionItems } from "@blocknote/core";
|
|
25362
25457
|
import { MantineProvider } from "@mantine/core";
|
|
25363
25458
|
|
|
25364
25459
|
// src/mantine/components/PanelContent.tsx
|
|
25365
|
-
import
|
|
25460
|
+
import React233 from "react";
|
|
25366
25461
|
import { Box as Box45 } from "@mantine/core";
|
|
25367
25462
|
var panelStyles = {
|
|
25368
25463
|
light: {
|
|
@@ -25392,7 +25487,7 @@ function PanelContent({ theme }) {
|
|
|
25392
25487
|
const { activePanel, registeredPanels } = usePanelStore();
|
|
25393
25488
|
const isOpen = activePanel !== null;
|
|
25394
25489
|
const content = activePanel ? registeredPanels.get(activePanel) : null;
|
|
25395
|
-
return /* @__PURE__ */
|
|
25490
|
+
return /* @__PURE__ */ React233.createElement(
|
|
25396
25491
|
Box45,
|
|
25397
25492
|
{
|
|
25398
25493
|
pos: "sticky",
|
|
@@ -25433,7 +25528,7 @@ function IxoEditorContent({
|
|
|
25433
25528
|
}) {
|
|
25434
25529
|
const { activePanel } = usePanelStore();
|
|
25435
25530
|
const isPanelOpen = activePanel !== null;
|
|
25436
|
-
const editorContent = /* @__PURE__ */
|
|
25531
|
+
const editorContent = /* @__PURE__ */ React234.createElement(
|
|
25437
25532
|
BlockNoteView,
|
|
25438
25533
|
{
|
|
25439
25534
|
editor,
|
|
@@ -25448,7 +25543,7 @@ function IxoEditorContent({
|
|
|
25448
25543
|
onChange,
|
|
25449
25544
|
onSelectionChange
|
|
25450
25545
|
},
|
|
25451
|
-
config.slashMenu && /* @__PURE__ */
|
|
25546
|
+
config.slashMenu && /* @__PURE__ */ React234.createElement(
|
|
25452
25547
|
SuggestionMenuController,
|
|
25453
25548
|
{
|
|
25454
25549
|
triggerCharacter: "/",
|
|
@@ -25461,7 +25556,7 @@ function IxoEditorContent({
|
|
|
25461
25556
|
),
|
|
25462
25557
|
children
|
|
25463
25558
|
);
|
|
25464
|
-
return /* @__PURE__ */
|
|
25559
|
+
return /* @__PURE__ */ React234.createElement("div", { style: { display: "flex", height: "100%", width: "100%", gap: 0 } }, /* @__PURE__ */ React234.createElement(
|
|
25465
25560
|
"div",
|
|
25466
25561
|
{
|
|
25467
25562
|
className: `ixo-editor ixo-editor--theme-${config.theme} ${className}`,
|
|
@@ -25470,9 +25565,9 @@ function IxoEditorContent({
|
|
|
25470
25565
|
transition: "width 0.2s ease"
|
|
25471
25566
|
}
|
|
25472
25567
|
},
|
|
25473
|
-
selfNav && /* @__PURE__ */
|
|
25474
|
-
/* @__PURE__ */
|
|
25475
|
-
(onExternalDrop || isPlacementMode) && isEditable ? /* @__PURE__ */
|
|
25568
|
+
selfNav && /* @__PURE__ */ React234.createElement(PageHeader, { ...pageHeaderProps }),
|
|
25569
|
+
/* @__PURE__ */ React234.createElement(CoverImage, { coverImageUrl, logoUrl }),
|
|
25570
|
+
(onExternalDrop || isPlacementMode) && isEditable ? /* @__PURE__ */ React234.createElement(
|
|
25476
25571
|
ExternalDropZone,
|
|
25477
25572
|
{
|
|
25478
25573
|
editor,
|
|
@@ -25485,7 +25580,7 @@ function IxoEditorContent({
|
|
|
25485
25580
|
},
|
|
25486
25581
|
editorContent
|
|
25487
25582
|
) : editorContent
|
|
25488
|
-
), isPanelVisible && /* @__PURE__ */
|
|
25583
|
+
), isPanelVisible && /* @__PURE__ */ React234.createElement(PanelContent, { theme: config.theme }));
|
|
25489
25584
|
}
|
|
25490
25585
|
function IxoEditor({
|
|
25491
25586
|
editor,
|
|
@@ -25525,7 +25620,7 @@ function IxoEditor({
|
|
|
25525
25620
|
tableHandles: true
|
|
25526
25621
|
};
|
|
25527
25622
|
const isEditable = editable;
|
|
25528
|
-
const editorContent = /* @__PURE__ */
|
|
25623
|
+
const editorContent = /* @__PURE__ */ React234.createElement(
|
|
25529
25624
|
BlocknoteProvider,
|
|
25530
25625
|
{
|
|
25531
25626
|
editor,
|
|
@@ -25537,7 +25632,7 @@ function IxoEditor({
|
|
|
25537
25632
|
dynamicListPanelRenderer,
|
|
25538
25633
|
domainCardRenderer
|
|
25539
25634
|
},
|
|
25540
|
-
/* @__PURE__ */
|
|
25635
|
+
/* @__PURE__ */ React234.createElement(
|
|
25541
25636
|
IxoEditorContent,
|
|
25542
25637
|
{
|
|
25543
25638
|
isPanelVisible,
|
|
@@ -25561,14 +25656,14 @@ function IxoEditor({
|
|
|
25561
25656
|
)
|
|
25562
25657
|
);
|
|
25563
25658
|
if (mantineTheme) {
|
|
25564
|
-
return /* @__PURE__ */
|
|
25659
|
+
return /* @__PURE__ */ React234.createElement(MantineProvider, { theme: mantineTheme }, editorContent);
|
|
25565
25660
|
}
|
|
25566
25661
|
return editorContent;
|
|
25567
25662
|
}
|
|
25568
25663
|
|
|
25569
25664
|
// src/mantine/components/EntitySigningSetup.tsx
|
|
25570
|
-
import
|
|
25571
|
-
import { Modal as Modal3, Stack as Stack148, Text as Text123, TextInput as TextInput8, Button as Button39, Alert as
|
|
25665
|
+
import React235, { useState as useState87 } from "react";
|
|
25666
|
+
import { Modal as Modal3, Stack as Stack148, Text as Text123, TextInput as TextInput8, Button as Button39, Alert as Alert31, Group as Group80 } from "@mantine/core";
|
|
25572
25667
|
import { IconAlertCircle as IconAlertCircle14, IconCheck as IconCheck13, IconKey as IconKey2 } from "@tabler/icons-react";
|
|
25573
25668
|
var EntitySigningSetup = ({
|
|
25574
25669
|
opened,
|
|
@@ -25577,11 +25672,11 @@ var EntitySigningSetup = ({
|
|
|
25577
25672
|
entityName,
|
|
25578
25673
|
onSetup
|
|
25579
25674
|
}) => {
|
|
25580
|
-
const [pin, setPin] =
|
|
25581
|
-
const [confirmPin, setConfirmPin] =
|
|
25582
|
-
const [loading, setLoading] =
|
|
25583
|
-
const [error, setError] =
|
|
25584
|
-
const [success, setSuccess] =
|
|
25675
|
+
const [pin, setPin] = useState87("");
|
|
25676
|
+
const [confirmPin, setConfirmPin] = useState87("");
|
|
25677
|
+
const [loading, setLoading] = useState87(false);
|
|
25678
|
+
const [error, setError] = useState87(null);
|
|
25679
|
+
const [success, setSuccess] = useState87(false);
|
|
25585
25680
|
const handleSetup = async () => {
|
|
25586
25681
|
if (pin.length < 4) {
|
|
25587
25682
|
setError("PIN must be at least 4 characters");
|
|
@@ -25621,15 +25716,15 @@ var EntitySigningSetup = ({
|
|
|
25621
25716
|
setSuccess(false);
|
|
25622
25717
|
}
|
|
25623
25718
|
};
|
|
25624
|
-
return /* @__PURE__ */
|
|
25719
|
+
return /* @__PURE__ */ React235.createElement(
|
|
25625
25720
|
Modal3,
|
|
25626
25721
|
{
|
|
25627
25722
|
opened,
|
|
25628
25723
|
onClose: handleClose,
|
|
25629
|
-
title: /* @__PURE__ */
|
|
25724
|
+
title: /* @__PURE__ */ React235.createElement(Group80, { gap: "xs" }, /* @__PURE__ */ React235.createElement(IconKey2, { size: 20 }), /* @__PURE__ */ React235.createElement(Text123, { fw: 600 }, "Entity Signing Setup")),
|
|
25630
25725
|
size: "md"
|
|
25631
25726
|
},
|
|
25632
|
-
/* @__PURE__ */
|
|
25727
|
+
/* @__PURE__ */ React235.createElement(Stack148, { gap: "md" }, success ? /* @__PURE__ */ React235.createElement(Alert31, { color: "green", icon: /* @__PURE__ */ React235.createElement(IconCheck13, { size: 16 }) }, "Entity signing key set up successfully!") : /* @__PURE__ */ React235.createElement(React235.Fragment, null, /* @__PURE__ */ React235.createElement(Text123, { size: "sm", c: "dimmed" }, "Flow authorization requires a signing key for", " ", /* @__PURE__ */ React235.createElement(Text123, { span: true, fw: 500 }, entityName || entityDid), "."), /* @__PURE__ */ React235.createElement(Alert31, { color: "blue", variant: "light" }, /* @__PURE__ */ React235.createElement(Text123, { size: "sm" }, "This is a ", /* @__PURE__ */ React235.createElement("strong", null, "one-time setup"), " that allows flows to grant permissions without requiring wallet signatures for each delegation.")), /* @__PURE__ */ React235.createElement(Stack148, { gap: "xs" }, /* @__PURE__ */ React235.createElement(Text123, { size: "sm", fw: 500 }, "What happens:"), /* @__PURE__ */ React235.createElement(Text123, { size: "sm", c: "dimmed" }, "1. A new signing key is generated"), /* @__PURE__ */ React235.createElement(Text123, { size: "sm", c: "dimmed" }, "2. Key is registered on the entity's DID document (requires wallet)"), /* @__PURE__ */ React235.createElement(Text123, { size: "sm", c: "dimmed" }, "3. Key is stored encrypted in the entity's Matrix room")), /* @__PURE__ */ React235.createElement(
|
|
25633
25728
|
TextInput8,
|
|
25634
25729
|
{
|
|
25635
25730
|
label: "Enter PIN to encrypt signing key",
|
|
@@ -25640,7 +25735,7 @@ var EntitySigningSetup = ({
|
|
|
25640
25735
|
onChange: (e) => setPin(e.currentTarget.value),
|
|
25641
25736
|
disabled: loading
|
|
25642
25737
|
}
|
|
25643
|
-
), /* @__PURE__ */
|
|
25738
|
+
), /* @__PURE__ */ React235.createElement(
|
|
25644
25739
|
TextInput8,
|
|
25645
25740
|
{
|
|
25646
25741
|
label: "Confirm PIN",
|
|
@@ -25650,12 +25745,12 @@ var EntitySigningSetup = ({
|
|
|
25650
25745
|
onChange: (e) => setConfirmPin(e.currentTarget.value),
|
|
25651
25746
|
disabled: loading
|
|
25652
25747
|
}
|
|
25653
|
-
), error && /* @__PURE__ */
|
|
25748
|
+
), error && /* @__PURE__ */ React235.createElement(Alert31, { color: "red", icon: /* @__PURE__ */ React235.createElement(IconAlertCircle14, { size: 16 }) }, error), /* @__PURE__ */ React235.createElement(Group80, { justify: "flex-end", mt: "md" }, /* @__PURE__ */ React235.createElement(Button39, { variant: "subtle", onClick: handleClose, disabled: loading }, "Cancel"), /* @__PURE__ */ React235.createElement(
|
|
25654
25749
|
Button39,
|
|
25655
25750
|
{
|
|
25656
25751
|
onClick: handleSetup,
|
|
25657
25752
|
loading,
|
|
25658
|
-
leftSection: /* @__PURE__ */
|
|
25753
|
+
leftSection: /* @__PURE__ */ React235.createElement(IconKey2, { size: 16 })
|
|
25659
25754
|
},
|
|
25660
25755
|
"Setup Entity Signing"
|
|
25661
25756
|
))))
|
|
@@ -25663,8 +25758,8 @@ var EntitySigningSetup = ({
|
|
|
25663
25758
|
};
|
|
25664
25759
|
|
|
25665
25760
|
// src/mantine/components/FlowPermissionsPanel.tsx
|
|
25666
|
-
import
|
|
25667
|
-
import { Stack as Stack149, Text as Text124, Paper as Paper19, Group as Group81, Badge as Badge40, Button as Button40, ActionIcon as ActionIcon36, Loader as
|
|
25761
|
+
import React236, { useState as useState88, useEffect as useEffect71, useMemo as useMemo83 } from "react";
|
|
25762
|
+
import { Stack as Stack149, Text as Text124, Paper as Paper19, Group as Group81, Badge as Badge40, Button as Button40, ActionIcon as ActionIcon36, Loader as Loader30, Alert as Alert32, Divider as Divider19 } from "@mantine/core";
|
|
25668
25763
|
import { IconPlus as IconPlus7, IconTrash as IconTrash8, IconShieldCheck as IconShieldCheck2, IconUser as IconUser5, IconRobot as IconRobot4, IconBuilding } from "@tabler/icons-react";
|
|
25669
25764
|
var FlowPermissionsPanel = ({
|
|
25670
25765
|
editor,
|
|
@@ -25674,11 +25769,11 @@ var FlowPermissionsPanel = ({
|
|
|
25674
25769
|
onRevokePermission,
|
|
25675
25770
|
getUserDisplayName
|
|
25676
25771
|
}) => {
|
|
25677
|
-
const [delegations, setDelegations] =
|
|
25678
|
-
const [loading, setLoading] =
|
|
25679
|
-
const [revoking, setRevoking] =
|
|
25772
|
+
const [delegations, setDelegations] = useState88([]);
|
|
25773
|
+
const [loading, setLoading] = useState88(true);
|
|
25774
|
+
const [revoking, setRevoking] = useState88(null);
|
|
25680
25775
|
const rootCapability = useMemo83(() => editor.getRootCapability?.(), [editor]);
|
|
25681
|
-
|
|
25776
|
+
useEffect71(() => {
|
|
25682
25777
|
const loadDelegations = async () => {
|
|
25683
25778
|
setLoading(true);
|
|
25684
25779
|
const allDelegations = editor.getAllDelegations?.() || [];
|
|
@@ -25717,11 +25812,11 @@ var FlowPermissionsPanel = ({
|
|
|
25717
25812
|
const getIcon2 = (type) => {
|
|
25718
25813
|
switch (type) {
|
|
25719
25814
|
case "oracle":
|
|
25720
|
-
return /* @__PURE__ */
|
|
25815
|
+
return /* @__PURE__ */ React236.createElement(IconRobot4, { size: 16 });
|
|
25721
25816
|
case "entity":
|
|
25722
|
-
return /* @__PURE__ */
|
|
25817
|
+
return /* @__PURE__ */ React236.createElement(IconBuilding, { size: 16 });
|
|
25723
25818
|
default:
|
|
25724
|
-
return /* @__PURE__ */
|
|
25819
|
+
return /* @__PURE__ */ React236.createElement(IconUser5, { size: 16 });
|
|
25725
25820
|
}
|
|
25726
25821
|
};
|
|
25727
25822
|
const formatCapabilities = (caps) => {
|
|
@@ -25740,7 +25835,7 @@ var FlowPermissionsPanel = ({
|
|
|
25740
25835
|
if (date < /* @__PURE__ */ new Date()) return "Expired";
|
|
25741
25836
|
return date.toLocaleDateString();
|
|
25742
25837
|
};
|
|
25743
|
-
return /* @__PURE__ */
|
|
25838
|
+
return /* @__PURE__ */ React236.createElement(Stack149, { gap: "md" }, /* @__PURE__ */ React236.createElement(Stack149, { gap: "xs" }, /* @__PURE__ */ React236.createElement(Text124, { fw: 600, size: "sm" }, "Root Authority"), /* @__PURE__ */ React236.createElement(Paper19, { p: "sm", withBorder: true }, /* @__PURE__ */ React236.createElement(Group81, { gap: "xs" }, /* @__PURE__ */ React236.createElement(IconShieldCheck2, { size: 20, color: "var(--mantine-color-green-6)" }), /* @__PURE__ */ React236.createElement(Stack149, { gap: 2, style: { flex: 1 } }, /* @__PURE__ */ React236.createElement(Text124, { size: "sm", fw: 500 }, entityName || entityDid), /* @__PURE__ */ React236.createElement(Text124, { size: "xs", c: "dimmed" }, rootCapability ? `Granted: ${new Date(rootCapability.issuedAt).toLocaleDateString()}` : "Root capability not set up")), /* @__PURE__ */ React236.createElement(Badge40, { color: "green", variant: "light" }, "Entity")))), /* @__PURE__ */ React236.createElement(Divider19, { label: "Delegated Permissions", labelPosition: "center" }), loading ? /* @__PURE__ */ React236.createElement(Group81, { justify: "center", py: "xl" }, /* @__PURE__ */ React236.createElement(Loader30, { size: "sm" })) : delegations.length === 0 ? /* @__PURE__ */ React236.createElement(Alert32, { color: "gray", variant: "light" }, /* @__PURE__ */ React236.createElement(Text124, { size: "sm" }, "No permissions have been granted yet.")) : /* @__PURE__ */ React236.createElement(Stack149, { gap: "xs" }, delegations.map(({ capability, displayName, type }) => /* @__PURE__ */ React236.createElement(Paper19, { key: capability.id, p: "sm", withBorder: true }, /* @__PURE__ */ React236.createElement(Group81, { justify: "space-between" }, /* @__PURE__ */ React236.createElement(Group81, { gap: "xs" }, getIcon2(type), /* @__PURE__ */ React236.createElement(Stack149, { gap: 2 }, /* @__PURE__ */ React236.createElement(Text124, { size: "sm", fw: 500 }, displayName), /* @__PURE__ */ React236.createElement(Text124, { size: "xs", c: "dimmed" }, formatCapabilities(capability.capabilities)), /* @__PURE__ */ React236.createElement(Group81, { gap: "xs" }, /* @__PURE__ */ React236.createElement(Text124, { size: "xs", c: "dimmed" }, "Expires: ", formatExpiration(capability.expiration)), /* @__PURE__ */ React236.createElement(Text124, { size: "xs", c: "dimmed" }, "\u2022"), /* @__PURE__ */ React236.createElement(Text124, { size: "xs", c: "dimmed" }, "Granted by: ", capability.issuer === entityDid ? "Entity" : capability.issuer.slice(-8))))), /* @__PURE__ */ React236.createElement(
|
|
25744
25839
|
ActionIcon36,
|
|
25745
25840
|
{
|
|
25746
25841
|
color: "red",
|
|
@@ -25749,11 +25844,11 @@ var FlowPermissionsPanel = ({
|
|
|
25749
25844
|
loading: revoking === capability.id,
|
|
25750
25845
|
disabled: !!revoking
|
|
25751
25846
|
},
|
|
25752
|
-
/* @__PURE__ */
|
|
25753
|
-
))))), /* @__PURE__ */
|
|
25847
|
+
/* @__PURE__ */ React236.createElement(IconTrash8, { size: 16 })
|
|
25848
|
+
))))), /* @__PURE__ */ React236.createElement(
|
|
25754
25849
|
Button40,
|
|
25755
25850
|
{
|
|
25756
|
-
leftSection: /* @__PURE__ */
|
|
25851
|
+
leftSection: /* @__PURE__ */ React236.createElement(IconPlus7, { size: 16 }),
|
|
25757
25852
|
variant: "light",
|
|
25758
25853
|
onClick: onGrantPermission
|
|
25759
25854
|
},
|
|
@@ -25762,7 +25857,7 @@ var FlowPermissionsPanel = ({
|
|
|
25762
25857
|
};
|
|
25763
25858
|
|
|
25764
25859
|
// src/mantine/components/GrantPermissionModal.tsx
|
|
25765
|
-
import
|
|
25860
|
+
import React237, { useState as useState89, useCallback as useCallback68 } from "react";
|
|
25766
25861
|
import {
|
|
25767
25862
|
Modal as Modal4,
|
|
25768
25863
|
Stack as Stack150,
|
|
@@ -25771,10 +25866,10 @@ import {
|
|
|
25771
25866
|
Button as Button41,
|
|
25772
25867
|
Group as Group82,
|
|
25773
25868
|
Radio as Radio6,
|
|
25774
|
-
Checkbox as
|
|
25775
|
-
Alert as
|
|
25869
|
+
Checkbox as Checkbox13,
|
|
25870
|
+
Alert as Alert33,
|
|
25776
25871
|
Paper as Paper20,
|
|
25777
|
-
Loader as
|
|
25872
|
+
Loader as Loader31,
|
|
25778
25873
|
Badge as Badge41,
|
|
25779
25874
|
ActionIcon as ActionIcon37,
|
|
25780
25875
|
Divider as Divider20,
|
|
@@ -25794,20 +25889,20 @@ var GrantPermissionModal = ({
|
|
|
25794
25889
|
const singleBlockMode = !!targetBlockId || blocks.length === 1;
|
|
25795
25890
|
const fixedBlockId = targetBlockId || (blocks.length === 1 ? blocks[0].id : null);
|
|
25796
25891
|
const fixedBlock = fixedBlockId ? blocks.find((b) => b.id === fixedBlockId) || blocks[0] : null;
|
|
25797
|
-
const [recipientType, setRecipientType] =
|
|
25798
|
-
const [searchQuery, setSearchQuery] =
|
|
25799
|
-
const [searchResults, setSearchResults] =
|
|
25800
|
-
const [searching, setSearching] =
|
|
25801
|
-
const [selectedRecipient, setSelectedRecipient] =
|
|
25802
|
-
const [manualDid, setManualDid] =
|
|
25803
|
-
const [scopeType, setScopeType] =
|
|
25804
|
-
const [selectedBlocks, setSelectedBlocks] =
|
|
25805
|
-
const [expirationEnabled, setExpirationEnabled] =
|
|
25806
|
-
const [expirationDays, setExpirationDays] =
|
|
25807
|
-
const [canDelegate, setCanDelegate] =
|
|
25808
|
-
const [pin, setPin] =
|
|
25809
|
-
const [loading, setLoading] =
|
|
25810
|
-
const [error, setError] =
|
|
25892
|
+
const [recipientType, setRecipientType] = useState89("user");
|
|
25893
|
+
const [searchQuery, setSearchQuery] = useState89("");
|
|
25894
|
+
const [searchResults, setSearchResults] = useState89([]);
|
|
25895
|
+
const [searching, setSearching] = useState89(false);
|
|
25896
|
+
const [selectedRecipient, setSelectedRecipient] = useState89(null);
|
|
25897
|
+
const [manualDid, setManualDid] = useState89("");
|
|
25898
|
+
const [scopeType, setScopeType] = useState89("full");
|
|
25899
|
+
const [selectedBlocks, setSelectedBlocks] = useState89([]);
|
|
25900
|
+
const [expirationEnabled, setExpirationEnabled] = useState89(false);
|
|
25901
|
+
const [expirationDays, setExpirationDays] = useState89(30);
|
|
25902
|
+
const [canDelegate, setCanDelegate] = useState89(false);
|
|
25903
|
+
const [pin, setPin] = useState89("");
|
|
25904
|
+
const [loading, setLoading] = useState89(false);
|
|
25905
|
+
const [error, setError] = useState89(null);
|
|
25811
25906
|
const handleSearch = useCallback68(async () => {
|
|
25812
25907
|
if (searchQuery.length < 2) return;
|
|
25813
25908
|
setSearching(true);
|
|
@@ -25895,29 +25990,29 @@ var GrantPermissionModal = ({
|
|
|
25895
25990
|
resetForm();
|
|
25896
25991
|
}
|
|
25897
25992
|
};
|
|
25898
|
-
return /* @__PURE__ */
|
|
25993
|
+
return /* @__PURE__ */ React237.createElement(
|
|
25899
25994
|
Modal4,
|
|
25900
25995
|
{
|
|
25901
25996
|
opened,
|
|
25902
25997
|
onClose: handleClose,
|
|
25903
|
-
title: /* @__PURE__ */
|
|
25998
|
+
title: /* @__PURE__ */ React237.createElement(Group82, { gap: "xs" }, /* @__PURE__ */ React237.createElement(IconShieldPlus4, { size: 20 }), /* @__PURE__ */ React237.createElement(Text125, { fw: 600 }, "Grant Permission")),
|
|
25904
25999
|
size: "lg"
|
|
25905
26000
|
},
|
|
25906
|
-
/* @__PURE__ */
|
|
26001
|
+
/* @__PURE__ */ React237.createElement(Stack150, { gap: "md" }, /* @__PURE__ */ React237.createElement(Stack150, { gap: "xs" }, /* @__PURE__ */ React237.createElement(Text125, { size: "sm", fw: 500 }, "Recipient Type"), /* @__PURE__ */ React237.createElement(Radio6.Group, { value: recipientType, onChange: (v) => {
|
|
25907
26002
|
setRecipientType(v);
|
|
25908
26003
|
setSelectedRecipient(null);
|
|
25909
26004
|
setSearchResults([]);
|
|
25910
|
-
} }, /* @__PURE__ */
|
|
26005
|
+
} }, /* @__PURE__ */ React237.createElement(Group82, null, /* @__PURE__ */ React237.createElement(Radio6, { value: "user", label: "User" }), /* @__PURE__ */ React237.createElement(Radio6, { value: "oracle", label: "Oracle" }), /* @__PURE__ */ React237.createElement(Radio6, { value: "manual", label: "Enter DID" })))), recipientType !== "manual" ? /* @__PURE__ */ React237.createElement(Stack150, { gap: "xs" }, /* @__PURE__ */ React237.createElement(
|
|
25911
26006
|
TextInput9,
|
|
25912
26007
|
{
|
|
25913
26008
|
placeholder: recipientType === "oracle" ? "Search oracles..." : "Search users...",
|
|
25914
|
-
leftSection: /* @__PURE__ */
|
|
25915
|
-
rightSection: searching ? /* @__PURE__ */
|
|
26009
|
+
leftSection: /* @__PURE__ */ React237.createElement(IconSearch7, { size: 16 }),
|
|
26010
|
+
rightSection: searching ? /* @__PURE__ */ React237.createElement(Loader31, { size: 14 }) : null,
|
|
25916
26011
|
value: searchQuery,
|
|
25917
26012
|
onChange: (e) => setSearchQuery(e.currentTarget.value),
|
|
25918
26013
|
onKeyDown: (e) => e.key === "Enter" && handleSearch()
|
|
25919
26014
|
}
|
|
25920
|
-
), selectedRecipient ? /* @__PURE__ */
|
|
26015
|
+
), selectedRecipient ? /* @__PURE__ */ React237.createElement(Paper20, { p: "sm", withBorder: true }, /* @__PURE__ */ React237.createElement(Group82, { justify: "space-between" }, /* @__PURE__ */ React237.createElement(Group82, { gap: "xs" }, recipientType === "oracle" ? /* @__PURE__ */ React237.createElement(IconRobot5, { size: 16 }) : /* @__PURE__ */ React237.createElement(IconUser6, { size: 16 }), /* @__PURE__ */ React237.createElement(Text125, { size: "sm" }, selectedRecipient.displayName), /* @__PURE__ */ React237.createElement(Badge41, { size: "xs", variant: "light" }, selectedRecipient.did.slice(-12))), /* @__PURE__ */ React237.createElement(ActionIcon37, { size: "sm", variant: "subtle", onClick: () => setSelectedRecipient(null) }, /* @__PURE__ */ React237.createElement(IconX12, { size: 14 })))) : searchResults.length > 0 ? /* @__PURE__ */ React237.createElement(Paper20, { p: "xs", withBorder: true, style: { maxHeight: 150, overflow: "auto" } }, /* @__PURE__ */ React237.createElement(Stack150, { gap: 4 }, searchResults.map((result) => /* @__PURE__ */ React237.createElement(
|
|
25921
26016
|
Button41,
|
|
25922
26017
|
{
|
|
25923
26018
|
key: result.did,
|
|
@@ -25927,7 +26022,7 @@ var GrantPermissionModal = ({
|
|
|
25927
26022
|
onClick: () => setSelectedRecipient(result)
|
|
25928
26023
|
},
|
|
25929
26024
|
result.displayName
|
|
25930
|
-
)))) : null) : /* @__PURE__ */
|
|
26025
|
+
)))) : null) : /* @__PURE__ */ React237.createElement(
|
|
25931
26026
|
TextInput9,
|
|
25932
26027
|
{
|
|
25933
26028
|
label: "Recipient DID",
|
|
@@ -25935,13 +26030,13 @@ var GrantPermissionModal = ({
|
|
|
25935
26030
|
value: manualDid,
|
|
25936
26031
|
onChange: (e) => setManualDid(e.currentTarget.value)
|
|
25937
26032
|
}
|
|
25938
|
-
), /* @__PURE__ */
|
|
26033
|
+
), /* @__PURE__ */ React237.createElement(Divider20, null), /* @__PURE__ */ React237.createElement(Stack150, { gap: "xs" }, /* @__PURE__ */ React237.createElement(Text125, { size: "sm", fw: 500 }, "Permission Scope"), singleBlockMode && fixedBlock ? (
|
|
25939
26034
|
// Single block mode: show fixed block info
|
|
25940
|
-
/* @__PURE__ */
|
|
26035
|
+
/* @__PURE__ */ React237.createElement(Paper20, { p: "sm", withBorder: true }, /* @__PURE__ */ React237.createElement(Group82, { gap: "xs" }, /* @__PURE__ */ React237.createElement(Badge41, { variant: "light", color: "blue" }, fixedBlock.type), /* @__PURE__ */ React237.createElement(Text125, { size: "sm" }, fixedBlock.name || `Block ${fixedBlock.id.slice(-8)}`)), /* @__PURE__ */ React237.createElement(Text125, { size: "xs", c: "dimmed", mt: "xs" }, "Permission will be granted to execute this specific block."))
|
|
25941
26036
|
) : (
|
|
25942
26037
|
// Multi-block mode: show scope selection
|
|
25943
|
-
/* @__PURE__ */
|
|
25944
|
-
|
|
26038
|
+
/* @__PURE__ */ React237.createElement(React237.Fragment, null, /* @__PURE__ */ React237.createElement(Radio6.Group, { value: scopeType, onChange: (v) => setScopeType(v) }, /* @__PURE__ */ React237.createElement(Stack150, { gap: "xs" }, /* @__PURE__ */ React237.createElement(Radio6, { value: "full", label: "Full flow access (can execute any block)" }), /* @__PURE__ */ React237.createElement(Radio6, { value: "blocks", label: "Specific blocks only" }))), scopeType === "blocks" && /* @__PURE__ */ React237.createElement(Paper20, { p: "sm", withBorder: true, style: { maxHeight: 150, overflow: "auto" } }, /* @__PURE__ */ React237.createElement(Stack150, { gap: "xs" }, blocks.map((block) => /* @__PURE__ */ React237.createElement(
|
|
26039
|
+
Checkbox13,
|
|
25945
26040
|
{
|
|
25946
26041
|
key: block.id,
|
|
25947
26042
|
label: block.name || `${block.type} (${block.id.slice(-8)})`,
|
|
@@ -25955,14 +26050,14 @@ var GrantPermissionModal = ({
|
|
|
25955
26050
|
}
|
|
25956
26051
|
}
|
|
25957
26052
|
)))))
|
|
25958
|
-
)), /* @__PURE__ */
|
|
25959
|
-
|
|
26053
|
+
)), /* @__PURE__ */ React237.createElement(Divider20, null), /* @__PURE__ */ React237.createElement(Stack150, { gap: "xs" }, /* @__PURE__ */ React237.createElement(
|
|
26054
|
+
Checkbox13,
|
|
25960
26055
|
{
|
|
25961
26056
|
label: "Set expiration",
|
|
25962
26057
|
checked: expirationEnabled,
|
|
25963
26058
|
onChange: (e) => setExpirationEnabled(e.currentTarget.checked)
|
|
25964
26059
|
}
|
|
25965
|
-
), expirationEnabled && /* @__PURE__ */
|
|
26060
|
+
), expirationEnabled && /* @__PURE__ */ React237.createElement(
|
|
25966
26061
|
NumberInput3,
|
|
25967
26062
|
{
|
|
25968
26063
|
label: "Expires in (days)",
|
|
@@ -25972,15 +26067,15 @@ var GrantPermissionModal = ({
|
|
|
25972
26067
|
min: 1,
|
|
25973
26068
|
max: 365
|
|
25974
26069
|
}
|
|
25975
|
-
)), /* @__PURE__ */
|
|
25976
|
-
|
|
26070
|
+
)), /* @__PURE__ */ React237.createElement(
|
|
26071
|
+
Checkbox13,
|
|
25977
26072
|
{
|
|
25978
26073
|
label: "Recipient can grant permissions to others",
|
|
25979
26074
|
description: "Allow this recipient to delegate their permissions",
|
|
25980
26075
|
checked: canDelegate,
|
|
25981
26076
|
onChange: (e) => setCanDelegate(e.currentTarget.checked)
|
|
25982
26077
|
}
|
|
25983
|
-
), /* @__PURE__ */
|
|
26078
|
+
), /* @__PURE__ */ React237.createElement(Divider20, null), /* @__PURE__ */ React237.createElement(
|
|
25984
26079
|
TextInput9,
|
|
25985
26080
|
{
|
|
25986
26081
|
label: "Enter your PIN to sign this delegation",
|
|
@@ -25989,7 +26084,7 @@ var GrantPermissionModal = ({
|
|
|
25989
26084
|
value: pin,
|
|
25990
26085
|
onChange: (e) => setPin(e.currentTarget.value)
|
|
25991
26086
|
}
|
|
25992
|
-
), error && /* @__PURE__ */
|
|
26087
|
+
), error && /* @__PURE__ */ React237.createElement(Alert33, { color: "red" }, error), /* @__PURE__ */ React237.createElement(Group82, { justify: "flex-end" }, /* @__PURE__ */ React237.createElement(Button41, { variant: "subtle", onClick: handleClose, disabled: loading }, "Cancel"), /* @__PURE__ */ React237.createElement(Button41, { onClick: handleGrant, loading }, "Grant Permission")))
|
|
25993
26088
|
);
|
|
25994
26089
|
};
|
|
25995
26090
|
|
|
@@ -26105,4 +26200,4 @@ export {
|
|
|
26105
26200
|
ixoGraphQLClient,
|
|
26106
26201
|
getEntity
|
|
26107
26202
|
};
|
|
26108
|
-
//# sourceMappingURL=chunk-
|
|
26203
|
+
//# sourceMappingURL=chunk-5CXU2GBG.mjs.map
|