@ixo/editor 3.2.1 → 3.3.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-ZCRLP7QH.mjs → chunk-T6RCHQV6.mjs} +565 -237
- package/dist/chunk-T6RCHQV6.mjs.map +1 -0
- package/dist/{chunk-F2JSGDES.mjs → chunk-UBCN5SXM.mjs} +8 -7
- package/dist/{chunk-F2JSGDES.mjs.map → chunk-UBCN5SXM.mjs.map} +1 -1
- package/dist/{chunk-IQX6H7AK.mjs → chunk-VG4NLEZB.mjs} +2 -2
- package/dist/core/index.d.ts +4 -3
- package/dist/core/index.mjs +2 -2
- package/dist/{graphql-client-BxmM6bOC.d.ts → graphql-client-DY0fpuUe.d.ts} +68 -22
- package/dist/{index-DMrZ4EwQ.d.ts → index-BNmOWWd8.d.ts} +2 -0
- package/dist/index.d.ts +3 -3
- package/dist/index.mjs +3 -3
- package/dist/mantine/index.d.ts +12 -12
- package/dist/mantine/index.mjs +2 -2
- package/dist/{setup-B0la8n04.d.ts → setup-BFQp9-K3.d.ts} +1 -1
- package/package.json +1 -1
- package/dist/chunk-ZCRLP7QH.mjs.map +0 -1
- /package/dist/{chunk-IQX6H7AK.mjs.map → chunk-VG4NLEZB.mjs.map} +0 -0
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
resolveActionType,
|
|
22
22
|
sendDirectMessage,
|
|
23
23
|
transformSurveyToCredentialSubject
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-UBCN5SXM.mjs";
|
|
25
25
|
|
|
26
26
|
// src/mantine/hooks/useCreateIxoEditor.ts
|
|
27
27
|
import { useCreateBlockNote } from "@blocknote/react";
|
|
@@ -46,7 +46,19 @@ var ixoPasteHandler = ({
|
|
|
46
46
|
void editor.pasteHTML(tightenHtmlList(html));
|
|
47
47
|
return true;
|
|
48
48
|
}
|
|
49
|
-
|
|
49
|
+
try {
|
|
50
|
+
return defaultPasteHandler();
|
|
51
|
+
} catch {
|
|
52
|
+
if (plain) {
|
|
53
|
+
const view = editor.prosemirrorView;
|
|
54
|
+
if (view) {
|
|
55
|
+
const { from, to } = view.state.selection;
|
|
56
|
+
view.dispatch(view.state.tr.insertText(plain, from, to));
|
|
57
|
+
return true;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return void 0;
|
|
61
|
+
}
|
|
50
62
|
};
|
|
51
63
|
|
|
52
64
|
// src/mantine/blocks/checkbox/CheckboxBlockSpec.tsx
|
|
@@ -9283,10 +9295,10 @@ var ListSelectionPanel = ({ selectedIds, listConfig, listData, listType, userRol
|
|
|
9283
9295
|
captionContent: panelConfig?.description && /* @__PURE__ */ React83.createElement(Text55, { pb: "md", px: "40px" }, panelConfig.description(itemHandlerData)),
|
|
9284
9296
|
context: { editor, block }
|
|
9285
9297
|
},
|
|
9286
|
-
!supportTabsLists.includes(listType) && /* @__PURE__ */ React83.createElement(Stack55, { gap: "md", style: { flex: 1 } }, panelConfig?.image && /* @__PURE__ */ React83.createElement(
|
|
9298
|
+
!supportTabsLists.includes(listType) && /* @__PURE__ */ React83.createElement(Stack55, { gap: "md", style: { flex: 1 } }, panelConfig?.image && panelConfig.image(itemHandlerData) && /* @__PURE__ */ React83.createElement(
|
|
9287
9299
|
"img",
|
|
9288
9300
|
{
|
|
9289
|
-
src: panelConfig
|
|
9301
|
+
src: panelConfig.image(itemHandlerData),
|
|
9290
9302
|
alt: "Selected item preview",
|
|
9291
9303
|
style: {
|
|
9292
9304
|
borderRadius: 8,
|
|
@@ -30226,6 +30238,26 @@ var EmbedBlockSpec = createReactBlockSpec22(
|
|
|
30226
30238
|
}
|
|
30227
30239
|
);
|
|
30228
30240
|
|
|
30241
|
+
// src/mantine/blocks/index.ts
|
|
30242
|
+
import {
|
|
30243
|
+
IconCheckbox as IconCheckbox4,
|
|
30244
|
+
IconFileDescription as IconFileDescription4,
|
|
30245
|
+
IconUsers as IconUsers6,
|
|
30246
|
+
IconList,
|
|
30247
|
+
IconChecklist as IconChecklist7,
|
|
30248
|
+
IconLayoutDashboard,
|
|
30249
|
+
IconGavel,
|
|
30250
|
+
IconChartBar,
|
|
30251
|
+
IconTable,
|
|
30252
|
+
IconGitBranch,
|
|
30253
|
+
IconPencil,
|
|
30254
|
+
IconId,
|
|
30255
|
+
IconBolt as IconBolt9,
|
|
30256
|
+
IconExternalLink as IconExternalLink3,
|
|
30257
|
+
IconMapPin as IconMapPin3,
|
|
30258
|
+
IconCode as IconCode3
|
|
30259
|
+
} from "@tabler/icons-react";
|
|
30260
|
+
|
|
30229
30261
|
// src/mantine/blocks/registry/blockRegistry.ts
|
|
30230
30262
|
var BlockRegistry = class {
|
|
30231
30263
|
constructor() {
|
|
@@ -30475,6 +30507,7 @@ var getExtraSlashMenuItems = (editor) => {
|
|
|
30475
30507
|
const slashMenuList = [
|
|
30476
30508
|
{
|
|
30477
30509
|
title: "Checkbox",
|
|
30510
|
+
icon: icon(IconCheckbox4),
|
|
30478
30511
|
onItemClick: () => {
|
|
30479
30512
|
editor.insertBlocks(
|
|
30480
30513
|
[
|
|
@@ -30502,6 +30535,7 @@ var getExtraSlashMenuItems = (editor) => {
|
|
|
30502
30535
|
},
|
|
30503
30536
|
{
|
|
30504
30537
|
title: "Domain Creator",
|
|
30538
|
+
icon: icon(IconFileDescription4),
|
|
30505
30539
|
onItemClick: () => {
|
|
30506
30540
|
editor.insertBlocks(
|
|
30507
30541
|
[
|
|
@@ -30525,6 +30559,7 @@ var getExtraSlashMenuItems = (editor) => {
|
|
|
30525
30559
|
},
|
|
30526
30560
|
{
|
|
30527
30561
|
title: "Governance Group",
|
|
30562
|
+
icon: icon(IconUsers6),
|
|
30528
30563
|
onItemClick: () => {
|
|
30529
30564
|
editor.insertBlocks(
|
|
30530
30565
|
[
|
|
@@ -30553,6 +30588,7 @@ var getExtraSlashMenuItems = (editor) => {
|
|
|
30553
30588
|
},
|
|
30554
30589
|
{
|
|
30555
30590
|
title: "List",
|
|
30591
|
+
icon: icon(IconList),
|
|
30556
30592
|
onItemClick: () => {
|
|
30557
30593
|
editor.insertBlocks(
|
|
30558
30594
|
[
|
|
@@ -30575,6 +30611,7 @@ var getExtraSlashMenuItems = (editor) => {
|
|
|
30575
30611
|
},
|
|
30576
30612
|
{
|
|
30577
30613
|
title: "Enum Checklist",
|
|
30614
|
+
icon: icon(IconChecklist7),
|
|
30578
30615
|
onItemClick: () => {
|
|
30579
30616
|
editor.insertBlocks(
|
|
30580
30617
|
[
|
|
@@ -30596,6 +30633,7 @@ var getExtraSlashMenuItems = (editor) => {
|
|
|
30596
30633
|
},
|
|
30597
30634
|
{
|
|
30598
30635
|
title: "Overview",
|
|
30636
|
+
icon: icon(IconLayoutDashboard),
|
|
30599
30637
|
onItemClick: () => {
|
|
30600
30638
|
editor.insertBlocks(
|
|
30601
30639
|
[
|
|
@@ -30614,6 +30652,7 @@ var getExtraSlashMenuItems = (editor) => {
|
|
|
30614
30652
|
},
|
|
30615
30653
|
{
|
|
30616
30654
|
title: "Proposal",
|
|
30655
|
+
icon: icon(IconGavel),
|
|
30617
30656
|
onItemClick: () => {
|
|
30618
30657
|
editor.insertBlocks(
|
|
30619
30658
|
[
|
|
@@ -30638,6 +30677,7 @@ var getExtraSlashMenuItems = (editor) => {
|
|
|
30638
30677
|
},
|
|
30639
30678
|
{
|
|
30640
30679
|
title: "Visualization",
|
|
30680
|
+
icon: icon(IconChartBar),
|
|
30641
30681
|
onItemClick: () => {
|
|
30642
30682
|
editor.insertBlocks(
|
|
30643
30683
|
[
|
|
@@ -30660,6 +30700,7 @@ var getExtraSlashMenuItems = (editor) => {
|
|
|
30660
30700
|
},
|
|
30661
30701
|
{
|
|
30662
30702
|
title: "Dynamic List",
|
|
30703
|
+
icon: icon(IconTable),
|
|
30663
30704
|
onItemClick: () => {
|
|
30664
30705
|
editor.insertBlocks(
|
|
30665
30706
|
[
|
|
@@ -30685,6 +30726,7 @@ var getExtraSlashMenuItems = (editor) => {
|
|
|
30685
30726
|
},
|
|
30686
30727
|
{
|
|
30687
30728
|
title: "Protocol Selector",
|
|
30729
|
+
icon: icon(IconGitBranch),
|
|
30688
30730
|
onItemClick: () => {
|
|
30689
30731
|
editor.insertBlocks(
|
|
30690
30732
|
[
|
|
@@ -30712,6 +30754,7 @@ var getExtraSlashMenuItems = (editor) => {
|
|
|
30712
30754
|
},
|
|
30713
30755
|
{
|
|
30714
30756
|
title: "Sign to Create",
|
|
30757
|
+
icon: icon(IconPencil),
|
|
30715
30758
|
onItemClick: () => {
|
|
30716
30759
|
editor.insertBlocks(
|
|
30717
30760
|
[
|
|
@@ -30740,6 +30783,7 @@ var getExtraSlashMenuItems = (editor) => {
|
|
|
30740
30783
|
},
|
|
30741
30784
|
{
|
|
30742
30785
|
title: "Domain Card",
|
|
30786
|
+
icon: icon(IconId),
|
|
30743
30787
|
onItemClick: () => {
|
|
30744
30788
|
editor.insertBlocks(
|
|
30745
30789
|
[
|
|
@@ -30767,6 +30811,7 @@ var getExtraSlashMenuItems = (editor) => {
|
|
|
30767
30811
|
},
|
|
30768
30812
|
{
|
|
30769
30813
|
title: "Action",
|
|
30814
|
+
icon: icon(IconBolt9),
|
|
30770
30815
|
onItemClick: () => {
|
|
30771
30816
|
editor.insertBlocks(
|
|
30772
30817
|
[
|
|
@@ -30793,6 +30838,7 @@ var getExtraSlashMenuItems = (editor) => {
|
|
|
30793
30838
|
},
|
|
30794
30839
|
{
|
|
30795
30840
|
title: "Flow Link",
|
|
30841
|
+
icon: icon(IconExternalLink3),
|
|
30796
30842
|
onItemClick: () => {
|
|
30797
30843
|
editor.insertBlocks(
|
|
30798
30844
|
[
|
|
@@ -30817,6 +30863,7 @@ var getExtraSlashMenuItems = (editor) => {
|
|
|
30817
30863
|
},
|
|
30818
30864
|
{
|
|
30819
30865
|
title: "Location",
|
|
30866
|
+
icon: icon(IconMapPin3),
|
|
30820
30867
|
onItemClick: () => {
|
|
30821
30868
|
editor.insertBlocks(
|
|
30822
30869
|
[
|
|
@@ -30839,6 +30886,7 @@ var getExtraSlashMenuItems = (editor) => {
|
|
|
30839
30886
|
},
|
|
30840
30887
|
{
|
|
30841
30888
|
title: "Embed",
|
|
30889
|
+
icon: icon(IconCode3),
|
|
30842
30890
|
onItemClick: () => {
|
|
30843
30891
|
editor.insertBlocks(
|
|
30844
30892
|
[
|
|
@@ -30862,10 +30910,9 @@ var getExtraSlashMenuItems = (editor) => {
|
|
|
30862
30910
|
subtext: "Embed an external website or content via iframe"
|
|
30863
30911
|
}
|
|
30864
30912
|
];
|
|
30865
|
-
const
|
|
30866
|
-
const docType = yRoot?.get("docType");
|
|
30913
|
+
const docType = editor?.docType;
|
|
30867
30914
|
if (docType === "page") {
|
|
30868
|
-
return slashMenuList.filter((item) => item.title !== "Proposal");
|
|
30915
|
+
return slashMenuList.filter((item) => item.title !== "Proposal" && item.title !== "Action" && item.title !== "Protocol Selector");
|
|
30869
30916
|
}
|
|
30870
30917
|
return slashMenuList;
|
|
30871
30918
|
};
|
|
@@ -31551,6 +31598,47 @@ function useFlowLifecycle({ editor, connectionStatus, enabled = true }) {
|
|
|
31551
31598
|
}, [editor, connectionStatus, enabled, runPipeline]);
|
|
31552
31599
|
}
|
|
31553
31600
|
|
|
31601
|
+
// src/mantine/utils/iconToAvatar.ts
|
|
31602
|
+
import { renderToStaticMarkup } from "react-dom/server";
|
|
31603
|
+
import * as TablerIcons from "@tabler/icons-react";
|
|
31604
|
+
import { createElement } from "react";
|
|
31605
|
+
function isTablerIconName(value) {
|
|
31606
|
+
return value.startsWith("Icon") && typeof TablerIcons[value] === "function";
|
|
31607
|
+
}
|
|
31608
|
+
function tablerIconToSvgBlob(iconName) {
|
|
31609
|
+
const Icon = TablerIcons[iconName];
|
|
31610
|
+
if (!Icon || typeof Icon !== "function") return null;
|
|
31611
|
+
const svg = renderToStaticMarkup(createElement(Icon, { size: 120, stroke: 1.5, color: "#868e96" }));
|
|
31612
|
+
return new Blob([svg], { type: "image/svg+xml" });
|
|
31613
|
+
}
|
|
31614
|
+
async function uploadToMatrix(matrixClient, blob, contentType, fileName) {
|
|
31615
|
+
const result = await matrixClient.uploadContent(blob, {
|
|
31616
|
+
type: contentType,
|
|
31617
|
+
name: fileName
|
|
31618
|
+
});
|
|
31619
|
+
return result.content_uri ?? result;
|
|
31620
|
+
}
|
|
31621
|
+
async function mirrorIconToRoomAvatar(matrixClient, roomId, iconValue) {
|
|
31622
|
+
if (!iconValue) {
|
|
31623
|
+
await matrixClient.sendStateEvent(roomId, "m.room.avatar", {}, "");
|
|
31624
|
+
return;
|
|
31625
|
+
}
|
|
31626
|
+
let blob = null;
|
|
31627
|
+
let contentType = "image/svg+xml";
|
|
31628
|
+
let fileName = "avatar.svg";
|
|
31629
|
+
if (isTablerIconName(iconValue)) {
|
|
31630
|
+
blob = tablerIconToSvgBlob(iconValue);
|
|
31631
|
+
} else if (iconValue.startsWith("http")) {
|
|
31632
|
+
const response = await fetch(iconValue);
|
|
31633
|
+
blob = await response.blob();
|
|
31634
|
+
contentType = blob.type || "image/png";
|
|
31635
|
+
fileName = `avatar.${contentType.split("/")[1] || "png"}`;
|
|
31636
|
+
}
|
|
31637
|
+
if (!blob) return;
|
|
31638
|
+
const mxcUri = await uploadToMatrix(matrixClient, blob, contentType, fileName);
|
|
31639
|
+
await matrixClient.sendStateEvent(roomId, "m.room.avatar", { url: mxcUri }, "");
|
|
31640
|
+
}
|
|
31641
|
+
|
|
31554
31642
|
// src/mantine/hooks/useCollaborativeIxoEditor.ts
|
|
31555
31643
|
function useCreateCollaborativeIxoEditor(options) {
|
|
31556
31644
|
const yDoc = useCollaborativeYDoc(options);
|
|
@@ -31838,6 +31926,11 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
31838
31926
|
}
|
|
31839
31927
|
const current = metadataManager.getMetadata() || {};
|
|
31840
31928
|
await metadataManager.setMetadata({ ...current, ...updates }, permissions);
|
|
31929
|
+
if ("icon" in updates) {
|
|
31930
|
+
mirrorIconToRoomAvatar(matrixClient, options.roomId, updates.icon).catch((error) => {
|
|
31931
|
+
console.error("Failed to mirror icon to m.room.avatar:", error);
|
|
31932
|
+
});
|
|
31933
|
+
}
|
|
31841
31934
|
};
|
|
31842
31935
|
ixoEditor.getPageMetadata = () => {
|
|
31843
31936
|
return metadataManager.getMetadata();
|
|
@@ -31959,15 +32052,224 @@ function useCreateCollaborativeIxoEditor(options) {
|
|
|
31959
32052
|
}
|
|
31960
32053
|
|
|
31961
32054
|
// src/mantine/IxoEditor.tsx
|
|
31962
|
-
import
|
|
31963
|
-
import { SuggestionMenuController } from "@blocknote/react";
|
|
32055
|
+
import React300 from "react";
|
|
32056
|
+
import { SuggestionMenuController, getDefaultReactSlashMenuItems } from "@blocknote/react";
|
|
31964
32057
|
import { BlockNoteView } from "@blocknote/mantine";
|
|
31965
32058
|
import { filterSuggestionItems } from "@blocknote/core";
|
|
31966
32059
|
import { MantineProvider } from "@mantine/core";
|
|
31967
32060
|
|
|
32061
|
+
// src/mantine/components/CommandPalette.tsx
|
|
32062
|
+
import React291, { useEffect as useEffect108, useRef as useRef29, useState as useState133, useMemo as useMemo120, useCallback as useCallback109 } from "react";
|
|
32063
|
+
import { Box as Box58, Text as Text170, Stack as Stack196 } from "@mantine/core";
|
|
32064
|
+
var GROUP_ORDER = {
|
|
32065
|
+
Headings: 0,
|
|
32066
|
+
"Basic blocks": 1,
|
|
32067
|
+
Media: 2,
|
|
32068
|
+
Advanced: 3,
|
|
32069
|
+
Others: 4,
|
|
32070
|
+
Basics: 5,
|
|
32071
|
+
Domains: 6,
|
|
32072
|
+
DAO: 7,
|
|
32073
|
+
Flows: 8
|
|
32074
|
+
};
|
|
32075
|
+
function PaletteItem({ item, isSelected, onClick, id }) {
|
|
32076
|
+
const ref = useRef29(null);
|
|
32077
|
+
const [hovered, setHovered] = useState133(false);
|
|
32078
|
+
useEffect108(() => {
|
|
32079
|
+
if (isSelected && ref.current) {
|
|
32080
|
+
ref.current.scrollIntoView({ block: "nearest" });
|
|
32081
|
+
}
|
|
32082
|
+
}, [isSelected]);
|
|
32083
|
+
const highlighted = isSelected || hovered;
|
|
32084
|
+
return /* @__PURE__ */ React291.createElement(
|
|
32085
|
+
Box58,
|
|
32086
|
+
{
|
|
32087
|
+
ref,
|
|
32088
|
+
id,
|
|
32089
|
+
role: "option",
|
|
32090
|
+
"aria-selected": isSelected || void 0,
|
|
32091
|
+
onClick,
|
|
32092
|
+
onMouseEnter: () => setHovered(true),
|
|
32093
|
+
onMouseLeave: () => setHovered(false),
|
|
32094
|
+
style: {
|
|
32095
|
+
display: "flex",
|
|
32096
|
+
alignItems: "center",
|
|
32097
|
+
gap: 10,
|
|
32098
|
+
padding: "6px 8px",
|
|
32099
|
+
cursor: "pointer",
|
|
32100
|
+
borderRadius: 6,
|
|
32101
|
+
margin: "0 6px",
|
|
32102
|
+
transition: "background-color 0.1s ease",
|
|
32103
|
+
backgroundColor: highlighted ? "var(--mantine-color-neutralColor-4)" : "transparent"
|
|
32104
|
+
}
|
|
32105
|
+
},
|
|
32106
|
+
/* @__PURE__ */ React291.createElement(
|
|
32107
|
+
Box58,
|
|
32108
|
+
{
|
|
32109
|
+
style: {
|
|
32110
|
+
width: 32,
|
|
32111
|
+
height: 32,
|
|
32112
|
+
minWidth: 32,
|
|
32113
|
+
display: "flex",
|
|
32114
|
+
alignItems: "center",
|
|
32115
|
+
justifyContent: "center",
|
|
32116
|
+
borderRadius: 6,
|
|
32117
|
+
backgroundColor: "var(--mantine-color-neutralColor-4)",
|
|
32118
|
+
border: "1px solid var(--mantine-color-neutralColor-5)"
|
|
32119
|
+
}
|
|
32120
|
+
},
|
|
32121
|
+
item.icon
|
|
32122
|
+
),
|
|
32123
|
+
/* @__PURE__ */ React291.createElement(Stack196, { gap: 0, style: { overflow: "hidden", minWidth: 0, flex: 1 } }, /* @__PURE__ */ React291.createElement(
|
|
32124
|
+
Text170,
|
|
32125
|
+
{
|
|
32126
|
+
size: "sm",
|
|
32127
|
+
fw: 500,
|
|
32128
|
+
truncate: true,
|
|
32129
|
+
style: {
|
|
32130
|
+
color: "var(--mantine-color-neutralColor-8) !important"
|
|
32131
|
+
}
|
|
32132
|
+
},
|
|
32133
|
+
item.title
|
|
32134
|
+
), item.subtext && /* @__PURE__ */ React291.createElement(
|
|
32135
|
+
Text170,
|
|
32136
|
+
{
|
|
32137
|
+
size: "xs",
|
|
32138
|
+
truncate: true,
|
|
32139
|
+
style: {
|
|
32140
|
+
color: "var(--mantine-color-neutralColor-7) !important"
|
|
32141
|
+
}
|
|
32142
|
+
},
|
|
32143
|
+
item.subtext
|
|
32144
|
+
))
|
|
32145
|
+
);
|
|
32146
|
+
}
|
|
32147
|
+
function CommandPalette({ items, onItemClick, loadingState, selectedIndex }) {
|
|
32148
|
+
const groupedItems = useMemo120(() => {
|
|
32149
|
+
const groups = [];
|
|
32150
|
+
let currentGroup;
|
|
32151
|
+
for (let i = 0; i < items.length; i++) {
|
|
32152
|
+
const item = items[i];
|
|
32153
|
+
if (item.group !== currentGroup) {
|
|
32154
|
+
currentGroup = item.group;
|
|
32155
|
+
groups.push({ label: currentGroup || "", items: [] });
|
|
32156
|
+
}
|
|
32157
|
+
groups[groups.length - 1].items.push({ item, globalIndex: i });
|
|
32158
|
+
}
|
|
32159
|
+
return groups;
|
|
32160
|
+
}, [items]);
|
|
32161
|
+
const handleItemClick = useCallback109(
|
|
32162
|
+
(item) => {
|
|
32163
|
+
onItemClick?.(item);
|
|
32164
|
+
},
|
|
32165
|
+
[onItemClick]
|
|
32166
|
+
);
|
|
32167
|
+
if (loadingState === "loading-initial") {
|
|
32168
|
+
return /* @__PURE__ */ React291.createElement(
|
|
32169
|
+
Box58,
|
|
32170
|
+
{
|
|
32171
|
+
style: {
|
|
32172
|
+
width: 330,
|
|
32173
|
+
padding: "12px",
|
|
32174
|
+
backgroundColor: "var(--mantine-color-neutralColor-3)",
|
|
32175
|
+
border: "1px solid var(--mantine-color-neutralColor-5)",
|
|
32176
|
+
borderRadius: 10,
|
|
32177
|
+
boxShadow: "0 4px 16px rgba(0, 0, 0, 0.2)"
|
|
32178
|
+
}
|
|
32179
|
+
},
|
|
32180
|
+
/* @__PURE__ */ React291.createElement(Text170, { size: "sm", style: { color: "var(--mantine-color-neutralColor-7) !important", textAlign: "center" } }, "Loading...")
|
|
32181
|
+
);
|
|
32182
|
+
}
|
|
32183
|
+
return /* @__PURE__ */ React291.createElement(
|
|
32184
|
+
Box58,
|
|
32185
|
+
{
|
|
32186
|
+
id: "bn-suggestion-menu",
|
|
32187
|
+
role: "listbox",
|
|
32188
|
+
style: {
|
|
32189
|
+
width: 330,
|
|
32190
|
+
maxHeight: 350,
|
|
32191
|
+
overflow: "hidden",
|
|
32192
|
+
backgroundColor: "var(--mantine-color-neutralColor-3)",
|
|
32193
|
+
border: "1px solid var(--mantine-color-neutralColor-5)",
|
|
32194
|
+
borderRadius: 10,
|
|
32195
|
+
boxShadow: "0 4px 16px rgba(0, 0, 0, 0.2)",
|
|
32196
|
+
padding: "6px 0"
|
|
32197
|
+
}
|
|
32198
|
+
},
|
|
32199
|
+
/* @__PURE__ */ React291.createElement(
|
|
32200
|
+
Box58,
|
|
32201
|
+
{
|
|
32202
|
+
style: {
|
|
32203
|
+
maxHeight: 338,
|
|
32204
|
+
overflowY: "auto",
|
|
32205
|
+
overflowX: "hidden",
|
|
32206
|
+
scrollbarWidth: "none",
|
|
32207
|
+
msOverflowStyle: "none"
|
|
32208
|
+
}
|
|
32209
|
+
},
|
|
32210
|
+
groupedItems.map((group) => /* @__PURE__ */ React291.createElement(React291.Fragment, { key: group.label }, /* @__PURE__ */ React291.createElement(
|
|
32211
|
+
Text170,
|
|
32212
|
+
{
|
|
32213
|
+
size: "xs",
|
|
32214
|
+
fw: 600,
|
|
32215
|
+
style: {
|
|
32216
|
+
textTransform: "uppercase",
|
|
32217
|
+
letterSpacing: "0.04em",
|
|
32218
|
+
color: "var(--mantine-color-neutralColor-7) !important",
|
|
32219
|
+
padding: "8px 14px 4px 14px",
|
|
32220
|
+
fontSize: 11
|
|
32221
|
+
}
|
|
32222
|
+
},
|
|
32223
|
+
group.label
|
|
32224
|
+
), group.items.map(({ item, globalIndex }) => /* @__PURE__ */ React291.createElement(
|
|
32225
|
+
PaletteItem,
|
|
32226
|
+
{
|
|
32227
|
+
key: `${item.title}-${globalIndex}`,
|
|
32228
|
+
item,
|
|
32229
|
+
isSelected: globalIndex === selectedIndex,
|
|
32230
|
+
onClick: () => handleItemClick(item),
|
|
32231
|
+
id: `bn-suggestion-menu-item-${globalIndex}`
|
|
32232
|
+
}
|
|
32233
|
+
)))),
|
|
32234
|
+
items.length === 0 && (loadingState === "loaded" || loadingState === "loading") && /* @__PURE__ */ React291.createElement(
|
|
32235
|
+
Text170,
|
|
32236
|
+
{
|
|
32237
|
+
size: "sm",
|
|
32238
|
+
style: {
|
|
32239
|
+
color: "var(--mantine-color-neutralColor-7) !important",
|
|
32240
|
+
textAlign: "center",
|
|
32241
|
+
padding: "12px"
|
|
32242
|
+
}
|
|
32243
|
+
},
|
|
32244
|
+
"No results"
|
|
32245
|
+
)
|
|
32246
|
+
)
|
|
32247
|
+
);
|
|
32248
|
+
}
|
|
32249
|
+
|
|
32250
|
+
// src/mantine/IxoEditor.tsx
|
|
32251
|
+
import {
|
|
32252
|
+
IconH1,
|
|
32253
|
+
IconH2,
|
|
32254
|
+
IconH3,
|
|
32255
|
+
IconBlockquote,
|
|
32256
|
+
IconListNumbers,
|
|
32257
|
+
IconList as IconList2,
|
|
32258
|
+
IconListCheck,
|
|
32259
|
+
IconPilcrow,
|
|
32260
|
+
IconCode as IconCode4,
|
|
32261
|
+
IconTable as IconTable2,
|
|
32262
|
+
IconPhoto as IconPhoto5,
|
|
32263
|
+
IconVideo,
|
|
32264
|
+
IconVolume,
|
|
32265
|
+
IconFile as IconFile5,
|
|
32266
|
+
IconMoodSmile as IconMoodSmile2,
|
|
32267
|
+
IconPageBreak
|
|
32268
|
+
} from "@tabler/icons-react";
|
|
32269
|
+
|
|
31968
32270
|
// src/mantine/components/PanelContent.tsx
|
|
31969
|
-
import
|
|
31970
|
-
import { Box as
|
|
32271
|
+
import React292 from "react";
|
|
32272
|
+
import { Box as Box59 } from "@mantine/core";
|
|
31971
32273
|
var panelStyles = {
|
|
31972
32274
|
light: {
|
|
31973
32275
|
backgroundColor: "#ffffff",
|
|
@@ -31996,8 +32298,8 @@ function PanelContent({ theme }) {
|
|
|
31996
32298
|
const { activePanel, registeredPanels } = usePanelStore();
|
|
31997
32299
|
const isOpen = activePanel !== null;
|
|
31998
32300
|
const content = activePanel ? registeredPanels.get(activePanel) : null;
|
|
31999
|
-
return /* @__PURE__ */
|
|
32000
|
-
|
|
32301
|
+
return /* @__PURE__ */ React292.createElement(
|
|
32302
|
+
Box59,
|
|
32001
32303
|
{
|
|
32002
32304
|
pos: "sticky",
|
|
32003
32305
|
right: 0,
|
|
@@ -32016,8 +32318,8 @@ function PanelContent({ theme }) {
|
|
|
32016
32318
|
}
|
|
32017
32319
|
|
|
32018
32320
|
// src/mantine/components/CoverImage.tsx
|
|
32019
|
-
import
|
|
32020
|
-
import { Box as
|
|
32321
|
+
import React297, { useState as useState137, useRef as useRef30, useEffect as useEffect111, useMemo as useMemo123 } from "react";
|
|
32322
|
+
import { Box as Box63, Group as Group109 } from "@mantine/core";
|
|
32021
32323
|
import { IconMoodSmile, IconPhoto as IconPhoto4, IconSettings as IconSettings22, IconArrowsMove, IconTrash as IconTrash11, IconRefresh as IconRefresh5 } from "@tabler/icons-react";
|
|
32022
32324
|
|
|
32023
32325
|
// src/core/lib/imageTransform.ts
|
|
@@ -32151,11 +32453,11 @@ function transformIconImage(sourceUrl, size = "default", customOptions) {
|
|
|
32151
32453
|
}
|
|
32152
32454
|
|
|
32153
32455
|
// src/mantine/components/Base/CoverImageButton.tsx
|
|
32154
|
-
import
|
|
32155
|
-
import { UnstyledButton as UnstyledButton6, Group as Group106, Text as
|
|
32456
|
+
import React293, { forwardRef, useState as useState134 } from "react";
|
|
32457
|
+
import { UnstyledButton as UnstyledButton6, Group as Group106, Text as Text171 } from "@mantine/core";
|
|
32156
32458
|
var CoverImageButton = forwardRef(function CoverImageButton2({ isActive = false, onClick, icon: icon2, children, style }, ref) {
|
|
32157
|
-
const [hovered, setHovered] =
|
|
32158
|
-
return /* @__PURE__ */
|
|
32459
|
+
const [hovered, setHovered] = useState134(false);
|
|
32460
|
+
return /* @__PURE__ */ React293.createElement(
|
|
32159
32461
|
UnstyledButton6,
|
|
32160
32462
|
{
|
|
32161
32463
|
ref,
|
|
@@ -32171,7 +32473,7 @@ var CoverImageButton = forwardRef(function CoverImageButton2({ isActive = false,
|
|
|
32171
32473
|
...style
|
|
32172
32474
|
}
|
|
32173
32475
|
},
|
|
32174
|
-
/* @__PURE__ */
|
|
32476
|
+
/* @__PURE__ */ React293.createElement(Group106, { gap: 4, wrap: "nowrap" }, icon2 && /* @__PURE__ */ React293.createElement(
|
|
32175
32477
|
"span",
|
|
32176
32478
|
{
|
|
32177
32479
|
style: {
|
|
@@ -32181,8 +32483,8 @@ var CoverImageButton = forwardRef(function CoverImageButton2({ isActive = false,
|
|
|
32181
32483
|
}
|
|
32182
32484
|
},
|
|
32183
32485
|
icon2
|
|
32184
|
-
), /* @__PURE__ */
|
|
32185
|
-
|
|
32486
|
+
), /* @__PURE__ */ React293.createElement(
|
|
32487
|
+
Text171,
|
|
32186
32488
|
{
|
|
32187
32489
|
fz: 12,
|
|
32188
32490
|
style: {
|
|
@@ -32196,9 +32498,9 @@ var CoverImageButton = forwardRef(function CoverImageButton2({ isActive = false,
|
|
|
32196
32498
|
});
|
|
32197
32499
|
|
|
32198
32500
|
// src/mantine/components/Base/BaseIconPicker.tsx
|
|
32199
|
-
import
|
|
32200
|
-
import { TextInput as TextInput7, Tabs as Tabs4, Box as
|
|
32201
|
-
import * as
|
|
32501
|
+
import React294, { useState as useState135, useMemo as useMemo121, useEffect as useEffect109 } from "react";
|
|
32502
|
+
import { TextInput as TextInput7, Tabs as Tabs4, Box as Box60, Stack as Stack197, UnstyledButton as UnstyledButton7, Text as Text172, Center as Center14, ScrollArea as ScrollArea9, Group as Group107, Popover as Popover6 } from "@mantine/core";
|
|
32503
|
+
import * as TablerIcons2 from "@tabler/icons-react";
|
|
32202
32504
|
import { IconSearch as IconSearch7, IconX as IconX13, IconChevronLeft, IconChevronRight as IconChevronRight13 } from "@tabler/icons-react";
|
|
32203
32505
|
|
|
32204
32506
|
// src/core/services/localStorage.ts
|
|
@@ -32229,28 +32531,28 @@ var localStorageService = {
|
|
|
32229
32531
|
var iconsKey = "editor_recent_icons";
|
|
32230
32532
|
var ICONS_PER_PAGE = 500;
|
|
32231
32533
|
function BaseIconPicker({ opened, onClose, onSelectIcon, onUploadClick, onRemove, children, currentIcon }) {
|
|
32232
|
-
const [searchQuery, setSearchQuery] =
|
|
32233
|
-
const [activeTab, setActiveTab] =
|
|
32234
|
-
const [currentPage, setCurrentPage] =
|
|
32235
|
-
const allIcons =
|
|
32236
|
-
const iconEntries = Object.entries(
|
|
32534
|
+
const [searchQuery, setSearchQuery] = useState135("");
|
|
32535
|
+
const [activeTab, setActiveTab] = useState135("icons");
|
|
32536
|
+
const [currentPage, setCurrentPage] = useState135(1);
|
|
32537
|
+
const allIcons = useMemo121(() => {
|
|
32538
|
+
const iconEntries = Object.entries(TablerIcons2).filter(([name]) => name.startsWith("Icon") && name !== "IconProps");
|
|
32237
32539
|
return iconEntries;
|
|
32238
32540
|
}, []);
|
|
32239
|
-
const filteredIcons =
|
|
32541
|
+
const filteredIcons = useMemo121(() => {
|
|
32240
32542
|
if (!searchQuery) return allIcons;
|
|
32241
32543
|
const query = searchQuery.toLowerCase();
|
|
32242
32544
|
return allIcons.filter(([name]) => name.toLowerCase().includes(query));
|
|
32243
32545
|
}, [allIcons, searchQuery]);
|
|
32244
|
-
|
|
32546
|
+
useEffect109(() => {
|
|
32245
32547
|
setCurrentPage(1);
|
|
32246
32548
|
}, [searchQuery]);
|
|
32247
|
-
const paginatedIcons =
|
|
32549
|
+
const paginatedIcons = useMemo121(() => {
|
|
32248
32550
|
const startIndex = (currentPage - 1) * ICONS_PER_PAGE;
|
|
32249
32551
|
const endIndex = startIndex + ICONS_PER_PAGE;
|
|
32250
32552
|
return filteredIcons.slice(startIndex, endIndex);
|
|
32251
32553
|
}, [filteredIcons, currentPage]);
|
|
32252
32554
|
const totalPages = Math.ceil(filteredIcons.length / ICONS_PER_PAGE);
|
|
32253
|
-
const recentIcons =
|
|
32555
|
+
const recentIcons = useMemo121(() => {
|
|
32254
32556
|
const recentIconNames = localStorageService.get(iconsKey);
|
|
32255
32557
|
if (!recentIconNames || recentIconNames.length === 0) return [];
|
|
32256
32558
|
return recentIconNames.slice(0, 24).map((iconName) => allIcons.find(([name]) => name === iconName)).filter((entry) => entry !== void 0);
|
|
@@ -32265,10 +32567,10 @@ function BaseIconPicker({ opened, onClose, onSelectIcon, onUploadClick, onRemove
|
|
|
32265
32567
|
};
|
|
32266
32568
|
const renderIconGrid = (icons) => {
|
|
32267
32569
|
if (icons.length === 0) {
|
|
32268
|
-
return /* @__PURE__ */
|
|
32570
|
+
return /* @__PURE__ */ React294.createElement(Center14, { py: "xl" }, /* @__PURE__ */ React294.createElement(Text172, { c: "dimmed", size: "sm" }, "No icons found"));
|
|
32269
32571
|
}
|
|
32270
|
-
return /* @__PURE__ */
|
|
32271
|
-
|
|
32572
|
+
return /* @__PURE__ */ React294.createElement(
|
|
32573
|
+
Box60,
|
|
32272
32574
|
{
|
|
32273
32575
|
style: {
|
|
32274
32576
|
display: "grid",
|
|
@@ -32279,7 +32581,7 @@ function BaseIconPicker({ opened, onClose, onSelectIcon, onUploadClick, onRemove
|
|
|
32279
32581
|
},
|
|
32280
32582
|
icons.map(([name, IconComponent]) => {
|
|
32281
32583
|
const isSelected = currentIcon === name.replace("Icon", "").replace(/([A-Z])/g, "-$1").toLowerCase().slice(1);
|
|
32282
|
-
return /* @__PURE__ */
|
|
32584
|
+
return /* @__PURE__ */ React294.createElement(
|
|
32283
32585
|
UnstyledButton7,
|
|
32284
32586
|
{
|
|
32285
32587
|
key: name,
|
|
@@ -32305,12 +32607,12 @@ function BaseIconPicker({ opened, onClose, onSelectIcon, onUploadClick, onRemove
|
|
|
32305
32607
|
}
|
|
32306
32608
|
}
|
|
32307
32609
|
},
|
|
32308
|
-
/* @__PURE__ */
|
|
32610
|
+
/* @__PURE__ */ React294.createElement(IconComponent, { size: 24, stroke: 1.5, style: { color: "var(--mantine-color-neutralColor-8) !important" } })
|
|
32309
32611
|
);
|
|
32310
32612
|
})
|
|
32311
32613
|
);
|
|
32312
32614
|
};
|
|
32313
|
-
return /* @__PURE__ */
|
|
32615
|
+
return /* @__PURE__ */ React294.createElement(Popover6, { opened, onClose, position: "right", width: 500, shadow: "xl" }, /* @__PURE__ */ React294.createElement(Popover6.Target, null, children), /* @__PURE__ */ React294.createElement(
|
|
32314
32616
|
Popover6.Dropdown,
|
|
32315
32617
|
{
|
|
32316
32618
|
style: {
|
|
@@ -32320,7 +32622,7 @@ function BaseIconPicker({ opened, onClose, onSelectIcon, onUploadClick, onRemove
|
|
|
32320
32622
|
},
|
|
32321
32623
|
p: 0
|
|
32322
32624
|
},
|
|
32323
|
-
onRemove && /* @__PURE__ */
|
|
32625
|
+
onRemove && /* @__PURE__ */ React294.createElement(
|
|
32324
32626
|
UnstyledButton7,
|
|
32325
32627
|
{
|
|
32326
32628
|
onClick: () => {
|
|
@@ -32338,17 +32640,17 @@ function BaseIconPicker({ opened, onClose, onSelectIcon, onUploadClick, onRemove
|
|
|
32338
32640
|
transition: "background 0.15s ease"
|
|
32339
32641
|
}
|
|
32340
32642
|
},
|
|
32341
|
-
/* @__PURE__ */
|
|
32643
|
+
/* @__PURE__ */ React294.createElement(Group107, { gap: 4, wrap: "nowrap" }, /* @__PURE__ */ React294.createElement(IconX13, { size: 14 }), /* @__PURE__ */ React294.createElement(Text172, { fz: 12, style: { color: "var(--mantine-color-neutralColor-7) !important", whiteSpace: "nowrap" } }, "Remove"))
|
|
32342
32644
|
),
|
|
32343
|
-
/* @__PURE__ */
|
|
32645
|
+
/* @__PURE__ */ React294.createElement(Stack197, { gap: "md", p: "md" }, /* @__PURE__ */ React294.createElement(Tabs4, { value: activeTab, onChange: setActiveTab, variant: "pills" }, /* @__PURE__ */ React294.createElement(Tabs4.List, null, /* @__PURE__ */ React294.createElement(Tabs4.Tab, { value: "icons" }, "Icons"), /* @__PURE__ */ React294.createElement(Tabs4.Tab, { value: "upload" }, "Upload")), /* @__PURE__ */ React294.createElement(Tabs4.Panel, { value: "icons", pt: "md" }, /* @__PURE__ */ React294.createElement(
|
|
32344
32646
|
TextInput7,
|
|
32345
32647
|
{
|
|
32346
32648
|
mb: "md",
|
|
32347
32649
|
placeholder: "Filter",
|
|
32348
|
-
leftSection: /* @__PURE__ */
|
|
32650
|
+
leftSection: /* @__PURE__ */ React294.createElement(IconSearch7, { size: 18 }),
|
|
32349
32651
|
value: searchQuery,
|
|
32350
32652
|
onChange: (e) => setSearchQuery(e.currentTarget.value),
|
|
32351
|
-
rightSection: searchQuery && /* @__PURE__ */
|
|
32653
|
+
rightSection: searchQuery && /* @__PURE__ */ React294.createElement(UnstyledButton7, { onClick: () => setSearchQuery("") }, /* @__PURE__ */ React294.createElement(IconX13, { size: 18 })),
|
|
32352
32654
|
style: { flex: 1 },
|
|
32353
32655
|
styles: {
|
|
32354
32656
|
input: {
|
|
@@ -32358,37 +32660,37 @@ function BaseIconPicker({ opened, onClose, onSelectIcon, onUploadClick, onRemove
|
|
|
32358
32660
|
}
|
|
32359
32661
|
}
|
|
32360
32662
|
}
|
|
32361
|
-
), !searchQuery && /* @__PURE__ */
|
|
32663
|
+
), !searchQuery && /* @__PURE__ */ React294.createElement(Box60, { mb: "md" }, /* @__PURE__ */ React294.createElement(Text172, { size: "sm", fw: 500, mb: "xs", px: "xs" }, "Recent"), /* @__PURE__ */ React294.createElement(ScrollArea9.Autosize, { scrollbarSize: 0, mah: 60 }, renderIconGrid(recentIcons))), /* @__PURE__ */ React294.createElement(Box60, null, /* @__PURE__ */ React294.createElement(Group107, { justify: "space-between", mb: "xs", px: "xs" }, /* @__PURE__ */ React294.createElement(Text172, { size: "sm", fw: 500 }, searchQuery ? "Results" : "Icons"), totalPages > 1 && /* @__PURE__ */ React294.createElement(Group107, { gap: "xs" }, /* @__PURE__ */ React294.createElement(Text172, { size: "xs", c: "dimmed" }, "Page ", currentPage, " of ", totalPages, " (", filteredIcons.length, " total)"), /* @__PURE__ */ React294.createElement(BaseButton, { size: "xs", onClick: () => setCurrentPage((p) => Math.max(1, p - 1)), disabled: currentPage === 1, leftSection: /* @__PURE__ */ React294.createElement(IconChevronLeft, { size: 14 }) }, "Prev"), /* @__PURE__ */ React294.createElement(
|
|
32362
32664
|
BaseButton,
|
|
32363
32665
|
{
|
|
32364
32666
|
size: "xs",
|
|
32365
32667
|
onClick: () => setCurrentPage((p) => Math.min(totalPages, p + 1)),
|
|
32366
32668
|
disabled: currentPage === totalPages,
|
|
32367
|
-
leftSection: /* @__PURE__ */
|
|
32669
|
+
leftSection: /* @__PURE__ */ React294.createElement(IconChevronRight13, { size: 14 })
|
|
32368
32670
|
},
|
|
32369
32671
|
"Next"
|
|
32370
|
-
))), /* @__PURE__ */
|
|
32672
|
+
))), /* @__PURE__ */ React294.createElement(ScrollArea9.Autosize, { scrollbarSize: 0, mah: 200 }, renderIconGrid(paginatedIcons)))), /* @__PURE__ */ React294.createElement(Tabs4.Panel, { value: "upload", pt: "md" }, /* @__PURE__ */ React294.createElement(Center14, { py: "xl" }, /* @__PURE__ */ React294.createElement(Stack197, { align: "center", gap: "md" }, /* @__PURE__ */ React294.createElement(Text172, { size: "sm", c: "dimmed", ta: "center" }, "Upload a custom icon image", /* @__PURE__ */ React294.createElement("br", null), "(PNG, JPG, SVG)"), /* @__PURE__ */ React294.createElement(CoverImageButton, { onClick: onUploadClick }, "Choose File"))))))
|
|
32371
32673
|
));
|
|
32372
32674
|
}
|
|
32373
32675
|
|
|
32374
32676
|
// src/mantine/components/Base/PageIcon.tsx
|
|
32375
|
-
import
|
|
32376
|
-
import { Center as Center15, Box as
|
|
32377
|
-
import * as
|
|
32677
|
+
import React295, { useMemo as useMemo122 } from "react";
|
|
32678
|
+
import { Center as Center15, Box as Box61 } from "@mantine/core";
|
|
32679
|
+
import * as TablerIcons3 from "@tabler/icons-react";
|
|
32378
32680
|
function PageIcon({ src, iconSize = 64, useCenter = false, style }) {
|
|
32379
32681
|
const isIconName = src && !src.startsWith("http");
|
|
32380
|
-
const IconComponent =
|
|
32682
|
+
const IconComponent = useMemo122(() => {
|
|
32381
32683
|
if (!isIconName || !src) return null;
|
|
32382
|
-
const iconComponent =
|
|
32684
|
+
const iconComponent = TablerIcons3[src];
|
|
32383
32685
|
if (iconComponent) {
|
|
32384
32686
|
return iconComponent;
|
|
32385
32687
|
}
|
|
32386
32688
|
return null;
|
|
32387
32689
|
}, [isIconName, src]);
|
|
32388
|
-
const Container = useCenter ? Center15 :
|
|
32690
|
+
const Container = useCenter ? Center15 : Box61;
|
|
32389
32691
|
if (!src) return null;
|
|
32390
32692
|
if (IconComponent) {
|
|
32391
|
-
return /* @__PURE__ */
|
|
32693
|
+
return /* @__PURE__ */ React295.createElement(
|
|
32392
32694
|
Container,
|
|
32393
32695
|
{
|
|
32394
32696
|
style: {
|
|
@@ -32400,10 +32702,10 @@ function PageIcon({ src, iconSize = 64, useCenter = false, style }) {
|
|
|
32400
32702
|
...style
|
|
32401
32703
|
}
|
|
32402
32704
|
},
|
|
32403
|
-
/* @__PURE__ */
|
|
32705
|
+
/* @__PURE__ */ React295.createElement(IconComponent, { size: iconSize, stroke: 1.5, style: { color: "var(--mantine-color-neutralColor-8) !important" } })
|
|
32404
32706
|
);
|
|
32405
32707
|
}
|
|
32406
|
-
return /* @__PURE__ */
|
|
32708
|
+
return /* @__PURE__ */ React295.createElement(
|
|
32407
32709
|
"img",
|
|
32408
32710
|
{
|
|
32409
32711
|
src,
|
|
@@ -32424,14 +32726,14 @@ function PageIcon({ src, iconSize = 64, useCenter = false, style }) {
|
|
|
32424
32726
|
import { useDisclosure as useDisclosure7 } from "@mantine/hooks";
|
|
32425
32727
|
|
|
32426
32728
|
// src/mantine/components/FlowSettingsPanel.tsx
|
|
32427
|
-
import
|
|
32428
|
-
import { Stack as
|
|
32729
|
+
import React296, { useState as useState136, useEffect as useEffect110, useCallback as useCallback110 } from "react";
|
|
32730
|
+
import { Stack as Stack198, Group as Group108, Button as Button55, ActionIcon as ActionIcon37, Text as Text173, Box as Box62 } from "@mantine/core";
|
|
32429
32731
|
import { IconPlus as IconPlus10, IconTrash as IconTrash10 } from "@tabler/icons-react";
|
|
32430
32732
|
var SYSTEM_KEYS = /* @__PURE__ */ new Set(["@context", "_type", "schema_version", "doc_id", "title", "createdAt", "createdBy", "flowOwnerDid"]);
|
|
32431
32733
|
var FlowSettingsPanel = ({ editor }) => {
|
|
32432
32734
|
const { closePanel } = usePanelStore();
|
|
32433
|
-
const [rows, setRows] =
|
|
32434
|
-
const loadSettings =
|
|
32735
|
+
const [rows, setRows] = useState136([]);
|
|
32736
|
+
const loadSettings = useCallback110(() => {
|
|
32435
32737
|
const metadata = editor.getFlowMetadata?.();
|
|
32436
32738
|
if (!metadata) return;
|
|
32437
32739
|
const customRows = [];
|
|
@@ -32442,10 +32744,10 @@ var FlowSettingsPanel = ({ editor }) => {
|
|
|
32442
32744
|
}
|
|
32443
32745
|
setRows(customRows);
|
|
32444
32746
|
}, [editor]);
|
|
32445
|
-
|
|
32747
|
+
useEffect110(() => {
|
|
32446
32748
|
loadSettings();
|
|
32447
32749
|
}, [loadSettings]);
|
|
32448
|
-
const handleKeyChange =
|
|
32750
|
+
const handleKeyChange = useCallback110(
|
|
32449
32751
|
(index, newKey) => {
|
|
32450
32752
|
setRows((prev) => {
|
|
32451
32753
|
const updated = [...prev];
|
|
@@ -32462,7 +32764,7 @@ var FlowSettingsPanel = ({ editor }) => {
|
|
|
32462
32764
|
},
|
|
32463
32765
|
[editor]
|
|
32464
32766
|
);
|
|
32465
|
-
const handleValueChange =
|
|
32767
|
+
const handleValueChange = useCallback110(
|
|
32466
32768
|
(index, newValue) => {
|
|
32467
32769
|
setRows((prev) => {
|
|
32468
32770
|
const updated = [...prev];
|
|
@@ -32476,10 +32778,10 @@ var FlowSettingsPanel = ({ editor }) => {
|
|
|
32476
32778
|
},
|
|
32477
32779
|
[editor]
|
|
32478
32780
|
);
|
|
32479
|
-
const handleAdd =
|
|
32781
|
+
const handleAdd = useCallback110(() => {
|
|
32480
32782
|
setRows((prev) => [...prev, { key: "", value: "" }]);
|
|
32481
32783
|
}, []);
|
|
32482
|
-
const handleDelete =
|
|
32784
|
+
const handleDelete = useCallback110(
|
|
32483
32785
|
(index) => {
|
|
32484
32786
|
setRows((prev) => {
|
|
32485
32787
|
const row = prev[index];
|
|
@@ -32491,23 +32793,23 @@ var FlowSettingsPanel = ({ editor }) => {
|
|
|
32491
32793
|
},
|
|
32492
32794
|
[editor]
|
|
32493
32795
|
);
|
|
32494
|
-
const subtitle = /* @__PURE__ */
|
|
32495
|
-
return /* @__PURE__ */
|
|
32796
|
+
const subtitle = /* @__PURE__ */ React296.createElement(Box62, { px: 40, mb: "md" }, /* @__PURE__ */ React296.createElement(Text173, { size: "sm", c: "dimmed" }, "Add key-value settings for this flow. These are available to oracles and action blocks at runtime."));
|
|
32797
|
+
return /* @__PURE__ */ React296.createElement(BaseRightPanelLayout, { title: "Flow Details", onClose: closePanel, isTemplate: true, captionContent: subtitle }, /* @__PURE__ */ React296.createElement(Stack198, { gap: "lg" }, rows.map((row, index) => /* @__PURE__ */ React296.createElement(Stack198, { key: index, gap: "xs" }, /* @__PURE__ */ React296.createElement(Group108, { gap: "xs", align: "center", wrap: "nowrap" }, /* @__PURE__ */ React296.createElement(BaseTextInput, { placeholder: "Key (e.g. protocolDid)", value: row.key, onChange: (e) => handleKeyChange(index, e.currentTarget.value), style: { flex: 1 } }), /* @__PURE__ */ React296.createElement(ActionIcon37, { variant: "subtle", color: "red", onClick: () => handleDelete(index), size: "lg" }, /* @__PURE__ */ React296.createElement(IconTrash10, { size: 16 }))), /* @__PURE__ */ React296.createElement(BaseTextArea, { placeholder: "Value", value: row.value, onChange: (e) => handleValueChange(index, e.currentTarget.value), minRows: 1, maxRows: 8 }))), /* @__PURE__ */ React296.createElement(Button55, { variant: "subtle", leftSection: /* @__PURE__ */ React296.createElement(IconPlus10, { size: 16 }), onClick: handleAdd, size: "sm" }, "Add detail")));
|
|
32496
32798
|
};
|
|
32497
32799
|
|
|
32498
32800
|
// src/mantine/components/CoverImage.tsx
|
|
32499
32801
|
function CoverImage({ coverImageUrl, logoUrl }) {
|
|
32500
32802
|
const { editor, handlers, editable } = useBlocknoteContext();
|
|
32501
|
-
const [isHovering, setIsHovering] =
|
|
32502
|
-
const [isRepositioning, setIsRepositioning] =
|
|
32503
|
-
const [coverPosition, setCoverPosition] =
|
|
32504
|
-
const coverFileInputRef =
|
|
32505
|
-
const logoFileInputRef =
|
|
32803
|
+
const [isHovering, setIsHovering] = useState137(false);
|
|
32804
|
+
const [isRepositioning, setIsRepositioning] = useState137(false);
|
|
32805
|
+
const [coverPosition, setCoverPosition] = useState137(() => editor?.getPageMetadata?.()?.coverPosition ?? 50);
|
|
32806
|
+
const coverFileInputRef = useRef30(null);
|
|
32807
|
+
const logoFileInputRef = useRef30(null);
|
|
32506
32808
|
const [opened, { open, close }] = useDisclosure7(false);
|
|
32507
|
-
const [metadata, setMetadata] =
|
|
32508
|
-
const settingsPanelContent =
|
|
32809
|
+
const [metadata, setMetadata] = useState137(() => editor?.getPageMetadata?.() || null);
|
|
32810
|
+
const settingsPanelContent = useMemo123(() => editor ? /* @__PURE__ */ React297.createElement(FlowSettingsPanel, { editor }) : null, [editor]);
|
|
32509
32811
|
const { open: openSettings } = usePanel("flow-settings-panel", settingsPanelContent);
|
|
32510
|
-
|
|
32812
|
+
useEffect111(() => {
|
|
32511
32813
|
if (!editor?._metadataManager) {
|
|
32512
32814
|
return;
|
|
32513
32815
|
}
|
|
@@ -32595,8 +32897,8 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
32595
32897
|
return null;
|
|
32596
32898
|
}
|
|
32597
32899
|
if (!hasCover) {
|
|
32598
|
-
return /* @__PURE__ */
|
|
32599
|
-
|
|
32900
|
+
return /* @__PURE__ */ React297.createElement(
|
|
32901
|
+
Box63,
|
|
32600
32902
|
{
|
|
32601
32903
|
style: {
|
|
32602
32904
|
position: "relative",
|
|
@@ -32607,8 +32909,8 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
32607
32909
|
onMouseEnter: () => editable && setIsHovering(true),
|
|
32608
32910
|
onMouseLeave: () => editable && setIsHovering(false)
|
|
32609
32911
|
},
|
|
32610
|
-
/* @__PURE__ */
|
|
32611
|
-
|
|
32912
|
+
/* @__PURE__ */ React297.createElement("div", { style: { maxWidth: "900px", margin: "0 auto", position: "relative", minHeight: "inherit" } }, /* @__PURE__ */ React297.createElement("input", { ref: coverFileInputRef, type: "file", accept: "image/*", style: { display: "none" }, onChange: (e) => handleFileSelect(e, "cover") }), /* @__PURE__ */ React297.createElement("input", { ref: logoFileInputRef, type: "file", accept: "image/*", style: { display: "none" }, onChange: (e) => handleFileSelect(e, "logo") }), logoSrc && /* @__PURE__ */ React297.createElement(
|
|
32913
|
+
Box63,
|
|
32612
32914
|
{
|
|
32613
32915
|
style: {
|
|
32614
32916
|
position: "relative",
|
|
@@ -32620,8 +32922,8 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
32620
32922
|
zIndex: 11
|
|
32621
32923
|
}
|
|
32622
32924
|
},
|
|
32623
|
-
/* @__PURE__ */
|
|
32624
|
-
editable && /* @__PURE__ */
|
|
32925
|
+
/* @__PURE__ */ React297.createElement(PageIcon, { src: logoSrc, useCenter: true, iconSize: 64 }),
|
|
32926
|
+
editable && /* @__PURE__ */ React297.createElement(
|
|
32625
32927
|
BaseIconPicker,
|
|
32626
32928
|
{
|
|
32627
32929
|
opened,
|
|
@@ -32631,8 +32933,8 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
32631
32933
|
onUploadClick: () => logoFileInputRef.current?.click(),
|
|
32632
32934
|
onRemove: handleRemoveLogo
|
|
32633
32935
|
},
|
|
32634
|
-
/* @__PURE__ */
|
|
32635
|
-
|
|
32936
|
+
/* @__PURE__ */ React297.createElement(
|
|
32937
|
+
Box63,
|
|
32636
32938
|
{
|
|
32637
32939
|
onClick: open,
|
|
32638
32940
|
style: {
|
|
@@ -32644,7 +32946,7 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
32644
32946
|
}
|
|
32645
32947
|
)
|
|
32646
32948
|
)
|
|
32647
|
-
), editable && (isHovering || opened) && /* @__PURE__ */
|
|
32949
|
+
), editable && (isHovering || opened) && /* @__PURE__ */ React297.createElement(Group109, { gap: 4, style: { position: "absolute", bottom: hasLogo ? -18 : 0, left: 0, zIndex: 10 } }, !logoSrc && /* @__PURE__ */ React297.createElement(
|
|
32648
32950
|
BaseIconPicker,
|
|
32649
32951
|
{
|
|
32650
32952
|
opened,
|
|
@@ -32653,12 +32955,12 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
32653
32955
|
onSelectIcon: (name) => handleSelectLogoIcon(name),
|
|
32654
32956
|
onUploadClick: () => logoFileInputRef.current?.click()
|
|
32655
32957
|
},
|
|
32656
|
-
/* @__PURE__ */
|
|
32657
|
-
), /* @__PURE__ */
|
|
32958
|
+
/* @__PURE__ */ React297.createElement(CoverImageButton, { onClick: open, icon: /* @__PURE__ */ React297.createElement(IconMoodSmile, { size: 14 }) }, "Add icon")
|
|
32959
|
+
), /* @__PURE__ */ React297.createElement(CoverImageButton, { onClick: () => coverFileInputRef.current?.click(), icon: /* @__PURE__ */ React297.createElement(IconPhoto4, { size: 14 }) }, "Add cover"), /* @__PURE__ */ React297.createElement(CoverImageButton, { onClick: openSettings, icon: /* @__PURE__ */ React297.createElement(IconSettings22, { size: 14 }) }, "Details")))
|
|
32658
32960
|
);
|
|
32659
32961
|
}
|
|
32660
|
-
return /* @__PURE__ */
|
|
32661
|
-
|
|
32962
|
+
return /* @__PURE__ */ React297.createElement(
|
|
32963
|
+
Box63,
|
|
32662
32964
|
{
|
|
32663
32965
|
style: {
|
|
32664
32966
|
position: "relative",
|
|
@@ -32685,7 +32987,7 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
32685
32987
|
}
|
|
32686
32988
|
}
|
|
32687
32989
|
},
|
|
32688
|
-
/* @__PURE__ */
|
|
32990
|
+
/* @__PURE__ */ React297.createElement(
|
|
32689
32991
|
"img",
|
|
32690
32992
|
{
|
|
32691
32993
|
src: coverUrl,
|
|
@@ -32703,7 +33005,7 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
32703
33005
|
}
|
|
32704
33006
|
}
|
|
32705
33007
|
),
|
|
32706
|
-
editable && isHovering && /* @__PURE__ */
|
|
33008
|
+
editable && isHovering && /* @__PURE__ */ React297.createElement(
|
|
32707
33009
|
Group109,
|
|
32708
33010
|
{
|
|
32709
33011
|
gap: "xs",
|
|
@@ -32714,8 +33016,8 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
32714
33016
|
zIndex: 10
|
|
32715
33017
|
}
|
|
32716
33018
|
},
|
|
32717
|
-
/* @__PURE__ */
|
|
32718
|
-
/* @__PURE__ */
|
|
33019
|
+
/* @__PURE__ */ React297.createElement(CoverImageButton, { onClick: () => coverFileInputRef.current?.click(), icon: /* @__PURE__ */ React297.createElement(IconRefresh5, { size: 14 }) }, "Change cover"),
|
|
33020
|
+
/* @__PURE__ */ React297.createElement(
|
|
32719
33021
|
CoverImageButton,
|
|
32720
33022
|
{
|
|
32721
33023
|
onClick: () => {
|
|
@@ -32725,14 +33027,14 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
32725
33027
|
setIsRepositioning(!isRepositioning);
|
|
32726
33028
|
},
|
|
32727
33029
|
isActive: isRepositioning,
|
|
32728
|
-
icon: /* @__PURE__ */
|
|
33030
|
+
icon: /* @__PURE__ */ React297.createElement(IconArrowsMove, { size: 14 })
|
|
32729
33031
|
},
|
|
32730
33032
|
isRepositioning ? "Done" : "Reposition"
|
|
32731
33033
|
),
|
|
32732
|
-
/* @__PURE__ */
|
|
33034
|
+
/* @__PURE__ */ React297.createElement(CoverImageButton, { onClick: handleRemoveCover, icon: /* @__PURE__ */ React297.createElement(IconTrash11, { size: 14 }) }, "Remove")
|
|
32733
33035
|
),
|
|
32734
|
-
/* @__PURE__ */
|
|
32735
|
-
|
|
33036
|
+
/* @__PURE__ */ React297.createElement("div", { style: { maxWidth: "900px", margin: "0 auto", position: "absolute", bottom: 0, left: 0, right: 0, height: "70px" } }, /* @__PURE__ */ React297.createElement(
|
|
33037
|
+
Box63,
|
|
32736
33038
|
{
|
|
32737
33039
|
style: {
|
|
32738
33040
|
position: "absolute",
|
|
@@ -32743,7 +33045,7 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
32743
33045
|
zIndex: 11
|
|
32744
33046
|
}
|
|
32745
33047
|
},
|
|
32746
|
-
logoSrc ? /* @__PURE__ */
|
|
33048
|
+
logoSrc ? /* @__PURE__ */ React297.createElement(React297.Fragment, null, /* @__PURE__ */ React297.createElement(PageIcon, { src: logoSrc, useCenter: true, iconSize: 64 }), editable && /* @__PURE__ */ React297.createElement(
|
|
32747
33049
|
BaseIconPicker,
|
|
32748
33050
|
{
|
|
32749
33051
|
opened,
|
|
@@ -32753,8 +33055,8 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
32753
33055
|
onUploadClick: () => logoFileInputRef.current?.click(),
|
|
32754
33056
|
onRemove: handleRemoveLogo
|
|
32755
33057
|
},
|
|
32756
|
-
/* @__PURE__ */
|
|
32757
|
-
|
|
33058
|
+
/* @__PURE__ */ React297.createElement(
|
|
33059
|
+
Box63,
|
|
32758
33060
|
{
|
|
32759
33061
|
onClick: open,
|
|
32760
33062
|
style: {
|
|
@@ -32765,7 +33067,7 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
32765
33067
|
}
|
|
32766
33068
|
}
|
|
32767
33069
|
)
|
|
32768
|
-
)) : editable && isHovering && /* @__PURE__ */
|
|
33070
|
+
)) : editable && isHovering && /* @__PURE__ */ React297.createElement(
|
|
32769
33071
|
BaseIconPicker,
|
|
32770
33072
|
{
|
|
32771
33073
|
opened,
|
|
@@ -32774,11 +33076,11 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
32774
33076
|
onSelectIcon: (name) => handleSelectLogoIcon(name),
|
|
32775
33077
|
onUploadClick: () => logoFileInputRef.current?.click()
|
|
32776
33078
|
},
|
|
32777
|
-
/* @__PURE__ */
|
|
33079
|
+
/* @__PURE__ */ React297.createElement(
|
|
32778
33080
|
CoverImageButton,
|
|
32779
33081
|
{
|
|
32780
33082
|
onClick: open,
|
|
32781
|
-
icon: /* @__PURE__ */
|
|
33083
|
+
icon: /* @__PURE__ */ React297.createElement(IconMoodSmile, { size: 14 }),
|
|
32782
33084
|
style: {
|
|
32783
33085
|
position: "absolute",
|
|
32784
33086
|
top: "50%",
|
|
@@ -32791,14 +33093,14 @@ function CoverImage({ coverImageUrl, logoUrl }) {
|
|
|
32791
33093
|
)
|
|
32792
33094
|
)
|
|
32793
33095
|
)),
|
|
32794
|
-
/* @__PURE__ */
|
|
32795
|
-
/* @__PURE__ */
|
|
33096
|
+
/* @__PURE__ */ React297.createElement("input", { ref: coverFileInputRef, type: "file", accept: "image/*", style: { display: "none" }, onChange: (e) => handleFileSelect(e, "cover") }),
|
|
33097
|
+
/* @__PURE__ */ React297.createElement("input", { ref: logoFileInputRef, type: "file", accept: "image/*", style: { display: "none" }, onChange: (e) => handleFileSelect(e, "logo") })
|
|
32796
33098
|
);
|
|
32797
33099
|
}
|
|
32798
33100
|
|
|
32799
33101
|
// src/mantine/components/PageTitle.tsx
|
|
32800
|
-
import
|
|
32801
|
-
import { Box as
|
|
33102
|
+
import React298, { useState as useState138, useEffect as useEffect112, useRef as useRef31, useCallback as useCallback111 } from "react";
|
|
33103
|
+
import { Box as Box64 } from "@mantine/core";
|
|
32802
33104
|
var DEFAULT_TITLE = "New page";
|
|
32803
33105
|
function isUserTitle(name) {
|
|
32804
33106
|
if (!name) return "";
|
|
@@ -32813,11 +33115,11 @@ function cleanEmptyEditable(el) {
|
|
|
32813
33115
|
}
|
|
32814
33116
|
}
|
|
32815
33117
|
function PageTitle({ editor, editable }) {
|
|
32816
|
-
const [title, setTitle] =
|
|
32817
|
-
const [hasIcon, setHasIcon] =
|
|
32818
|
-
const titleRef =
|
|
32819
|
-
const isComposing =
|
|
32820
|
-
|
|
33118
|
+
const [title, setTitle] = useState138("");
|
|
33119
|
+
const [hasIcon, setHasIcon] = useState138(false);
|
|
33120
|
+
const titleRef = useRef31(null);
|
|
33121
|
+
const isComposing = useRef31(false);
|
|
33122
|
+
useEffect112(() => {
|
|
32821
33123
|
if (!editor?._metadataManager) return;
|
|
32822
33124
|
const metadata = editor._metadataManager.getMetadata();
|
|
32823
33125
|
const initial = isUserTitle(metadata?.title);
|
|
@@ -32837,12 +33139,12 @@ function PageTitle({ editor, editable }) {
|
|
|
32837
33139
|
});
|
|
32838
33140
|
return unsubscribe;
|
|
32839
33141
|
}, [editor]);
|
|
32840
|
-
|
|
33142
|
+
useEffect112(() => {
|
|
32841
33143
|
if (titleRef.current && title && !titleRef.current.textContent) {
|
|
32842
33144
|
titleRef.current.textContent = title;
|
|
32843
33145
|
}
|
|
32844
33146
|
}, [title]);
|
|
32845
|
-
const saveTitle =
|
|
33147
|
+
const saveTitle = useCallback111(
|
|
32846
33148
|
async (newTitle) => {
|
|
32847
33149
|
const trimmed = newTitle.trim();
|
|
32848
33150
|
const toSave = trimmed || DEFAULT_TITLE;
|
|
@@ -32858,19 +33160,19 @@ function PageTitle({ editor, editable }) {
|
|
|
32858
33160
|
},
|
|
32859
33161
|
[editor]
|
|
32860
33162
|
);
|
|
32861
|
-
const handleInput =
|
|
33163
|
+
const handleInput = useCallback111(() => {
|
|
32862
33164
|
if (titleRef.current) {
|
|
32863
33165
|
cleanEmptyEditable(titleRef.current);
|
|
32864
33166
|
setTitle(titleRef.current.textContent || "");
|
|
32865
33167
|
}
|
|
32866
33168
|
}, []);
|
|
32867
|
-
const handleBlur =
|
|
33169
|
+
const handleBlur = useCallback111(() => {
|
|
32868
33170
|
if (titleRef.current) {
|
|
32869
33171
|
cleanEmptyEditable(titleRef.current);
|
|
32870
33172
|
saveTitle(titleRef.current.textContent || "");
|
|
32871
33173
|
}
|
|
32872
33174
|
}, [saveTitle]);
|
|
32873
|
-
const handleKeyDown =
|
|
33175
|
+
const handleKeyDown = useCallback111(
|
|
32874
33176
|
(e) => {
|
|
32875
33177
|
if (isComposing.current) return;
|
|
32876
33178
|
if (e.key === "Enter" || e.key === "ArrowDown") {
|
|
@@ -32881,9 +33183,10 @@ function PageTitle({ editor, editable }) {
|
|
|
32881
33183
|
},
|
|
32882
33184
|
[editor, saveTitle]
|
|
32883
33185
|
);
|
|
32884
|
-
|
|
33186
|
+
useEffect112(() => {
|
|
32885
33187
|
const handleEditorKeyDown = (e) => {
|
|
32886
33188
|
if (e.key !== "ArrowUp" || !titleRef.current) return;
|
|
33189
|
+
if (document.getElementById("bn-suggestion-menu")) return;
|
|
32887
33190
|
try {
|
|
32888
33191
|
const pos = editor.getTextCursorPosition?.();
|
|
32889
33192
|
if (pos && !pos.prevBlock) {
|
|
@@ -32904,13 +33207,13 @@ function PageTitle({ editor, editable }) {
|
|
|
32904
33207
|
container?.removeEventListener("keydown", handleEditorKeyDown, true);
|
|
32905
33208
|
};
|
|
32906
33209
|
}, [editor]);
|
|
32907
|
-
const handlePaste =
|
|
33210
|
+
const handlePaste = useCallback111((e) => {
|
|
32908
33211
|
e.preventDefault();
|
|
32909
33212
|
const text = e.clipboardData.getData("text/plain").replace(/\n/g, " ");
|
|
32910
33213
|
document.execCommand("insertText", false, text);
|
|
32911
33214
|
}, []);
|
|
32912
|
-
return /* @__PURE__ */
|
|
32913
|
-
|
|
33215
|
+
return /* @__PURE__ */ React298.createElement(Box64, { maw: 900, mx: "auto", w: "100%" }, /* @__PURE__ */ React298.createElement(
|
|
33216
|
+
Box64,
|
|
32914
33217
|
{
|
|
32915
33218
|
ref: titleRef,
|
|
32916
33219
|
component: "div",
|
|
@@ -32966,8 +33269,8 @@ if (typeof document !== "undefined") {
|
|
|
32966
33269
|
}
|
|
32967
33270
|
|
|
32968
33271
|
// src/mantine/components/ExternalDropZone.tsx
|
|
32969
|
-
import
|
|
32970
|
-
import { Box as
|
|
33272
|
+
import React299, { useCallback as useCallback112, useEffect as useEffect113, useRef as useRef32, useState as useState139 } from "react";
|
|
33273
|
+
import { Box as Box65 } from "@mantine/core";
|
|
32971
33274
|
var SCROLL_ZONE_SIZE = 80;
|
|
32972
33275
|
var SCROLL_SPEED = 12;
|
|
32973
33276
|
var ExternalDropZone = ({
|
|
@@ -32979,20 +33282,20 @@ var ExternalDropZone = ({
|
|
|
32979
33282
|
onPlacementCancel,
|
|
32980
33283
|
children
|
|
32981
33284
|
}) => {
|
|
32982
|
-
const containerRef =
|
|
32983
|
-
const [isValidDrag, setIsValidDrag] =
|
|
32984
|
-
const [isHoveringInPlacementMode, setIsHoveringInPlacementMode] =
|
|
32985
|
-
const [indicatorStyle, setIndicatorStyle] =
|
|
32986
|
-
const dropPositionRef =
|
|
32987
|
-
const scrollAnimationRef =
|
|
32988
|
-
const scrollDirectionRef =
|
|
32989
|
-
const scrollContainerRef =
|
|
32990
|
-
const getBlockElements =
|
|
33285
|
+
const containerRef = useRef32(null);
|
|
33286
|
+
const [isValidDrag, setIsValidDrag] = useState139(false);
|
|
33287
|
+
const [isHoveringInPlacementMode, setIsHoveringInPlacementMode] = useState139(false);
|
|
33288
|
+
const [indicatorStyle, setIndicatorStyle] = useState139({});
|
|
33289
|
+
const dropPositionRef = useRef32(null);
|
|
33290
|
+
const scrollAnimationRef = useRef32(null);
|
|
33291
|
+
const scrollDirectionRef = useRef32(null);
|
|
33292
|
+
const scrollContainerRef = useRef32(null);
|
|
33293
|
+
const getBlockElements = useCallback112(() => {
|
|
32991
33294
|
if (!containerRef.current) return [];
|
|
32992
33295
|
const blocks = containerRef.current.querySelectorAll('[data-node-type="blockContainer"]');
|
|
32993
33296
|
return Array.from(blocks);
|
|
32994
33297
|
}, []);
|
|
32995
|
-
const getScrollContainer =
|
|
33298
|
+
const getScrollContainer = useCallback112(() => {
|
|
32996
33299
|
if (scrollContainerRef.current) return scrollContainerRef.current;
|
|
32997
33300
|
let element = containerRef.current;
|
|
32998
33301
|
while (element) {
|
|
@@ -33007,7 +33310,7 @@ var ExternalDropZone = ({
|
|
|
33007
33310
|
scrollContainerRef.current = window;
|
|
33008
33311
|
return window;
|
|
33009
33312
|
}, []);
|
|
33010
|
-
const performScroll =
|
|
33313
|
+
const performScroll = useCallback112(() => {
|
|
33011
33314
|
const container = getScrollContainer();
|
|
33012
33315
|
const direction = scrollDirectionRef.current;
|
|
33013
33316
|
if (!direction) {
|
|
@@ -33022,7 +33325,7 @@ var ExternalDropZone = ({
|
|
|
33022
33325
|
}
|
|
33023
33326
|
scrollAnimationRef.current = requestAnimationFrame(performScroll);
|
|
33024
33327
|
}, [getScrollContainer]);
|
|
33025
|
-
const startAutoScroll =
|
|
33328
|
+
const startAutoScroll = useCallback112(
|
|
33026
33329
|
(direction) => {
|
|
33027
33330
|
if (scrollDirectionRef.current === direction) return;
|
|
33028
33331
|
scrollDirectionRef.current = direction;
|
|
@@ -33032,14 +33335,14 @@ var ExternalDropZone = ({
|
|
|
33032
33335
|
},
|
|
33033
33336
|
[performScroll]
|
|
33034
33337
|
);
|
|
33035
|
-
const stopAutoScroll =
|
|
33338
|
+
const stopAutoScroll = useCallback112(() => {
|
|
33036
33339
|
scrollDirectionRef.current = null;
|
|
33037
33340
|
if (scrollAnimationRef.current) {
|
|
33038
33341
|
cancelAnimationFrame(scrollAnimationRef.current);
|
|
33039
33342
|
scrollAnimationRef.current = null;
|
|
33040
33343
|
}
|
|
33041
33344
|
}, []);
|
|
33042
|
-
const checkAutoScroll =
|
|
33345
|
+
const checkAutoScroll = useCallback112(
|
|
33043
33346
|
(clientY) => {
|
|
33044
33347
|
const container = getScrollContainer();
|
|
33045
33348
|
let containerTop;
|
|
@@ -33062,7 +33365,7 @@ var ExternalDropZone = ({
|
|
|
33062
33365
|
},
|
|
33063
33366
|
[getScrollContainer, startAutoScroll, stopAutoScroll]
|
|
33064
33367
|
);
|
|
33065
|
-
const findDropPosition =
|
|
33368
|
+
const findDropPosition = useCallback112(
|
|
33066
33369
|
(clientY) => {
|
|
33067
33370
|
const blocks = getBlockElements();
|
|
33068
33371
|
if (blocks.length === 0 || !editor?.document) return null;
|
|
@@ -33095,7 +33398,7 @@ var ExternalDropZone = ({
|
|
|
33095
33398
|
},
|
|
33096
33399
|
[getBlockElements, editor]
|
|
33097
33400
|
);
|
|
33098
|
-
const handleDragOver =
|
|
33401
|
+
const handleDragOver = useCallback112(
|
|
33099
33402
|
(e) => {
|
|
33100
33403
|
if (!e.dataTransfer.types.includes(acceptedType)) return;
|
|
33101
33404
|
e.preventDefault();
|
|
@@ -33118,7 +33421,7 @@ var ExternalDropZone = ({
|
|
|
33118
33421
|
},
|
|
33119
33422
|
[acceptedType, findDropPosition, checkAutoScroll]
|
|
33120
33423
|
);
|
|
33121
|
-
const handleDragLeave =
|
|
33424
|
+
const handleDragLeave = useCallback112(
|
|
33122
33425
|
(e) => {
|
|
33123
33426
|
if (containerRef.current && !containerRef.current.contains(e.relatedTarget)) {
|
|
33124
33427
|
setIsValidDrag(false);
|
|
@@ -33128,7 +33431,7 @@ var ExternalDropZone = ({
|
|
|
33128
33431
|
},
|
|
33129
33432
|
[stopAutoScroll]
|
|
33130
33433
|
);
|
|
33131
|
-
const handleDrop =
|
|
33434
|
+
const handleDrop = useCallback112(
|
|
33132
33435
|
(e) => {
|
|
33133
33436
|
e.preventDefault();
|
|
33134
33437
|
e.stopPropagation();
|
|
@@ -33142,7 +33445,7 @@ var ExternalDropZone = ({
|
|
|
33142
33445
|
},
|
|
33143
33446
|
[onDrop, stopAutoScroll]
|
|
33144
33447
|
);
|
|
33145
|
-
|
|
33448
|
+
useEffect113(() => {
|
|
33146
33449
|
const handleGlobalDragEnd = () => {
|
|
33147
33450
|
setIsValidDrag(false);
|
|
33148
33451
|
dropPositionRef.current = null;
|
|
@@ -33151,7 +33454,7 @@ var ExternalDropZone = ({
|
|
|
33151
33454
|
window.addEventListener("dragend", handleGlobalDragEnd);
|
|
33152
33455
|
return () => window.removeEventListener("dragend", handleGlobalDragEnd);
|
|
33153
33456
|
}, [stopAutoScroll]);
|
|
33154
|
-
const handleOverlayMouseMove =
|
|
33457
|
+
const handleOverlayMouseMove = useCallback112(
|
|
33155
33458
|
(e) => {
|
|
33156
33459
|
setIsHoveringInPlacementMode(true);
|
|
33157
33460
|
checkAutoScroll(e.clientY);
|
|
@@ -33170,12 +33473,12 @@ var ExternalDropZone = ({
|
|
|
33170
33473
|
},
|
|
33171
33474
|
[findDropPosition, checkAutoScroll]
|
|
33172
33475
|
);
|
|
33173
|
-
const handleOverlayMouseLeave =
|
|
33476
|
+
const handleOverlayMouseLeave = useCallback112(() => {
|
|
33174
33477
|
setIsHoveringInPlacementMode(false);
|
|
33175
33478
|
dropPositionRef.current = null;
|
|
33176
33479
|
stopAutoScroll();
|
|
33177
33480
|
}, [stopAutoScroll]);
|
|
33178
|
-
const handleOverlayClick =
|
|
33481
|
+
const handleOverlayClick = useCallback112(
|
|
33179
33482
|
(e) => {
|
|
33180
33483
|
e.preventDefault();
|
|
33181
33484
|
e.stopPropagation();
|
|
@@ -33189,7 +33492,7 @@ var ExternalDropZone = ({
|
|
|
33189
33492
|
},
|
|
33190
33493
|
[onDrop, stopAutoScroll]
|
|
33191
33494
|
);
|
|
33192
|
-
const handleOverlayWheel =
|
|
33495
|
+
const handleOverlayWheel = useCallback112(
|
|
33193
33496
|
(e) => {
|
|
33194
33497
|
const container = getScrollContainer();
|
|
33195
33498
|
if (container === window) {
|
|
@@ -33200,7 +33503,7 @@ var ExternalDropZone = ({
|
|
|
33200
33503
|
},
|
|
33201
33504
|
[getScrollContainer]
|
|
33202
33505
|
);
|
|
33203
|
-
|
|
33506
|
+
useEffect113(() => {
|
|
33204
33507
|
if (!isPlacementMode) return;
|
|
33205
33508
|
const handleKeyDown = (e) => {
|
|
33206
33509
|
if (e.key === "Escape") {
|
|
@@ -33223,13 +33526,13 @@ var ExternalDropZone = ({
|
|
|
33223
33526
|
document.removeEventListener("click", handleGlobalClick, true);
|
|
33224
33527
|
};
|
|
33225
33528
|
}, [isPlacementMode, onPlacementCancel]);
|
|
33226
|
-
|
|
33529
|
+
useEffect113(() => {
|
|
33227
33530
|
if (!isPlacementMode) {
|
|
33228
33531
|
setIsHoveringInPlacementMode(false);
|
|
33229
33532
|
dropPositionRef.current = null;
|
|
33230
33533
|
}
|
|
33231
33534
|
}, [isPlacementMode]);
|
|
33232
|
-
|
|
33535
|
+
useEffect113(() => {
|
|
33233
33536
|
const isActive = isValidDrag || isPlacementMode && isHoveringInPlacementMode;
|
|
33234
33537
|
if (isActive) {
|
|
33235
33538
|
document.body.classList.add("external-artifact-drag-active");
|
|
@@ -33240,19 +33543,19 @@ var ExternalDropZone = ({
|
|
|
33240
33543
|
document.body.classList.remove("external-artifact-drag-active");
|
|
33241
33544
|
};
|
|
33242
33545
|
}, [isValidDrag, isPlacementMode, isHoveringInPlacementMode]);
|
|
33243
|
-
|
|
33546
|
+
useEffect113(() => {
|
|
33244
33547
|
return () => {
|
|
33245
33548
|
if (scrollAnimationRef.current) {
|
|
33246
33549
|
cancelAnimationFrame(scrollAnimationRef.current);
|
|
33247
33550
|
}
|
|
33248
33551
|
};
|
|
33249
33552
|
}, []);
|
|
33250
|
-
const indicatorWithPosition = dropIndicator &&
|
|
33553
|
+
const indicatorWithPosition = dropIndicator && React299.isValidElement(dropIndicator) ? React299.cloneElement(dropIndicator, {
|
|
33251
33554
|
indicatorTop: typeof indicatorStyle.top === "number" ? indicatorStyle.top : void 0
|
|
33252
33555
|
}) : dropIndicator;
|
|
33253
33556
|
const shouldShowIndicator = isValidDrag || isPlacementMode && isHoveringInPlacementMode;
|
|
33254
|
-
return /* @__PURE__ */
|
|
33255
|
-
|
|
33557
|
+
return /* @__PURE__ */ React299.createElement(
|
|
33558
|
+
Box65,
|
|
33256
33559
|
{
|
|
33257
33560
|
ref: containerRef,
|
|
33258
33561
|
style: {
|
|
@@ -33267,8 +33570,8 @@ var ExternalDropZone = ({
|
|
|
33267
33570
|
"data-placement-mode": isPlacementMode ? "true" : void 0
|
|
33268
33571
|
},
|
|
33269
33572
|
children,
|
|
33270
|
-
isPlacementMode && /* @__PURE__ */
|
|
33271
|
-
|
|
33573
|
+
isPlacementMode && /* @__PURE__ */ React299.createElement(
|
|
33574
|
+
Box65,
|
|
33272
33575
|
{
|
|
33273
33576
|
style: {
|
|
33274
33577
|
position: "absolute",
|
|
@@ -33287,11 +33590,29 @@ var ExternalDropZone = ({
|
|
|
33287
33590
|
onWheel: handleOverlayWheel
|
|
33288
33591
|
}
|
|
33289
33592
|
),
|
|
33290
|
-
shouldShowIndicator && indicatorWithPosition && /* @__PURE__ */
|
|
33593
|
+
shouldShowIndicator && indicatorWithPosition && /* @__PURE__ */ React299.createElement(Box65, { style: { ...indicatorStyle, background: "none", border: "none", boxShadow: "none" } }, indicatorWithPosition)
|
|
33291
33594
|
);
|
|
33292
33595
|
};
|
|
33293
33596
|
|
|
33294
33597
|
// src/mantine/IxoEditor.tsx
|
|
33598
|
+
var DEFAULT_ICON_MAP = {
|
|
33599
|
+
"Heading 1": icon(IconH1),
|
|
33600
|
+
"Heading 2": icon(IconH2),
|
|
33601
|
+
"Heading 3": icon(IconH3),
|
|
33602
|
+
Quote: icon(IconBlockquote),
|
|
33603
|
+
"Numbered List": icon(IconListNumbers),
|
|
33604
|
+
"Bullet List": icon(IconList2),
|
|
33605
|
+
"Check List": icon(IconListCheck),
|
|
33606
|
+
Paragraph: icon(IconPilcrow),
|
|
33607
|
+
"Code Block": icon(IconCode4),
|
|
33608
|
+
Table: icon(IconTable2),
|
|
33609
|
+
Image: icon(IconPhoto5),
|
|
33610
|
+
Video: icon(IconVideo),
|
|
33611
|
+
Audio: icon(IconVolume),
|
|
33612
|
+
File: icon(IconFile5),
|
|
33613
|
+
Emoji: icon(IconMoodSmile2),
|
|
33614
|
+
"Page Break": icon(IconPageBreak)
|
|
33615
|
+
};
|
|
33295
33616
|
function IxoEditorContent({
|
|
33296
33617
|
editor,
|
|
33297
33618
|
config,
|
|
@@ -33311,7 +33632,7 @@ function IxoEditorContent({
|
|
|
33311
33632
|
}) {
|
|
33312
33633
|
const { activePanel } = usePanelStore();
|
|
33313
33634
|
const isPanelOpen = activePanel !== null;
|
|
33314
|
-
const editorContent = /* @__PURE__ */
|
|
33635
|
+
const editorContent = /* @__PURE__ */ React300.createElement(
|
|
33315
33636
|
BlockNoteView,
|
|
33316
33637
|
{
|
|
33317
33638
|
editor,
|
|
@@ -33326,17 +33647,24 @@ function IxoEditorContent({
|
|
|
33326
33647
|
onChange,
|
|
33327
33648
|
onSelectionChange
|
|
33328
33649
|
},
|
|
33329
|
-
config.slashMenu && /* @__PURE__ */
|
|
33650
|
+
config.slashMenu && /* @__PURE__ */ React300.createElement(
|
|
33330
33651
|
SuggestionMenuController,
|
|
33331
33652
|
{
|
|
33332
33653
|
triggerCharacter: "/",
|
|
33654
|
+
suggestionMenuComponent: CommandPalette,
|
|
33333
33655
|
getItems: async (query) => {
|
|
33334
33656
|
const customItems = getExtraSlashMenuItems(editor);
|
|
33335
|
-
const
|
|
33657
|
+
const defaultItems = getDefaultReactSlashMenuItems(editor).map((item) => ({
|
|
33658
|
+
...item,
|
|
33659
|
+
icon: DEFAULT_ICON_MAP[item.title] ?? item.icon
|
|
33660
|
+
}));
|
|
33661
|
+
const allItems = [...defaultItems, ...customItems];
|
|
33336
33662
|
allItems.sort((a, b) => {
|
|
33337
33663
|
const groupA = a.group || "";
|
|
33338
33664
|
const groupB = b.group || "";
|
|
33339
|
-
|
|
33665
|
+
const orderA = GROUP_ORDER[groupA] ?? 99;
|
|
33666
|
+
const orderB = GROUP_ORDER[groupB] ?? 99;
|
|
33667
|
+
return orderA - orderB;
|
|
33340
33668
|
});
|
|
33341
33669
|
return filterSuggestionItems(allItems, query);
|
|
33342
33670
|
}
|
|
@@ -33344,7 +33672,7 @@ function IxoEditorContent({
|
|
|
33344
33672
|
),
|
|
33345
33673
|
children
|
|
33346
33674
|
);
|
|
33347
|
-
return /* @__PURE__ */
|
|
33675
|
+
return /* @__PURE__ */ React300.createElement("div", { style: { display: "flex", height: "100%", width: "100%", gap: 0 } }, /* @__PURE__ */ React300.createElement(
|
|
33348
33676
|
"div",
|
|
33349
33677
|
{
|
|
33350
33678
|
className: `ixo-editor ixo-editor--theme-${config.theme} ${className}`,
|
|
@@ -33353,9 +33681,9 @@ function IxoEditorContent({
|
|
|
33353
33681
|
transition: "width 0.2s ease"
|
|
33354
33682
|
}
|
|
33355
33683
|
},
|
|
33356
|
-
/* @__PURE__ */
|
|
33357
|
-
/* @__PURE__ */
|
|
33358
|
-
(onExternalDrop || isPlacementMode) && isEditable ? /* @__PURE__ */
|
|
33684
|
+
/* @__PURE__ */ React300.createElement(CoverImage, { coverImageUrl, logoUrl }),
|
|
33685
|
+
/* @__PURE__ */ React300.createElement(PageTitle, { editor, editable: isEditable }),
|
|
33686
|
+
(onExternalDrop || isPlacementMode) && isEditable ? /* @__PURE__ */ React300.createElement(
|
|
33359
33687
|
ExternalDropZone,
|
|
33360
33688
|
{
|
|
33361
33689
|
editor,
|
|
@@ -33368,7 +33696,7 @@ function IxoEditorContent({
|
|
|
33368
33696
|
},
|
|
33369
33697
|
editorContent
|
|
33370
33698
|
) : editorContent
|
|
33371
|
-
), isPanelVisible && /* @__PURE__ */
|
|
33699
|
+
), isPanelVisible && /* @__PURE__ */ React300.createElement(PanelContent, { theme: config.theme }));
|
|
33372
33700
|
}
|
|
33373
33701
|
function IxoEditor({
|
|
33374
33702
|
editor,
|
|
@@ -33409,7 +33737,7 @@ function IxoEditor({
|
|
|
33409
33737
|
tableHandles: true
|
|
33410
33738
|
};
|
|
33411
33739
|
const isEditable = editable;
|
|
33412
|
-
const editorContent = /* @__PURE__ */
|
|
33740
|
+
const editorContent = /* @__PURE__ */ React300.createElement(
|
|
33413
33741
|
BlocknoteProvider,
|
|
33414
33742
|
{
|
|
33415
33743
|
editor,
|
|
@@ -33424,7 +33752,7 @@ function IxoEditor({
|
|
|
33424
33752
|
connectedUsers,
|
|
33425
33753
|
awarenessInstance
|
|
33426
33754
|
},
|
|
33427
|
-
/* @__PURE__ */
|
|
33755
|
+
/* @__PURE__ */ React300.createElement(
|
|
33428
33756
|
IxoEditorContent,
|
|
33429
33757
|
{
|
|
33430
33758
|
isPanelVisible,
|
|
@@ -33446,13 +33774,13 @@ function IxoEditor({
|
|
|
33446
33774
|
)
|
|
33447
33775
|
);
|
|
33448
33776
|
if (mantineTheme) {
|
|
33449
|
-
return /* @__PURE__ */
|
|
33777
|
+
return /* @__PURE__ */ React300.createElement(MantineProvider, { theme: mantineTheme }, editorContent);
|
|
33450
33778
|
}
|
|
33451
33779
|
return editorContent;
|
|
33452
33780
|
}
|
|
33453
33781
|
|
|
33454
33782
|
// src/mantine/components/DebugButton.tsx
|
|
33455
|
-
import
|
|
33783
|
+
import React301 from "react";
|
|
33456
33784
|
function DebugButton({ editor }) {
|
|
33457
33785
|
const yMapToObject = (map) => {
|
|
33458
33786
|
if (!map) return null;
|
|
@@ -33479,7 +33807,7 @@ function DebugButton({ editor }) {
|
|
|
33479
33807
|
const json = JSON.stringify(dump, null, 2);
|
|
33480
33808
|
console.log("Editor Debug Dump:\n" + json);
|
|
33481
33809
|
};
|
|
33482
|
-
return /* @__PURE__ */
|
|
33810
|
+
return /* @__PURE__ */ React301.createElement(
|
|
33483
33811
|
"button",
|
|
33484
33812
|
{
|
|
33485
33813
|
onClick: handleClick,
|
|
@@ -33505,7 +33833,7 @@ function DebugButton({ editor }) {
|
|
|
33505
33833
|
}
|
|
33506
33834
|
|
|
33507
33835
|
// src/mantine/components/PageHeader.tsx
|
|
33508
|
-
import
|
|
33836
|
+
import React302, { useState as useState140, useRef as useRef33, useEffect as useEffect114 } from "react";
|
|
33509
33837
|
function PageHeader({
|
|
33510
33838
|
title = "New page",
|
|
33511
33839
|
icon: icon2,
|
|
@@ -33517,11 +33845,11 @@ function PageHeader({
|
|
|
33517
33845
|
isFavorited = false,
|
|
33518
33846
|
menuItems = []
|
|
33519
33847
|
}) {
|
|
33520
|
-
const [isMenuOpen, setIsMenuOpen] =
|
|
33521
|
-
const [isPrivacyOpen, setIsPrivacyOpen] =
|
|
33522
|
-
const menuRef =
|
|
33523
|
-
const privacyRef =
|
|
33524
|
-
|
|
33848
|
+
const [isMenuOpen, setIsMenuOpen] = useState140(false);
|
|
33849
|
+
const [isPrivacyOpen, setIsPrivacyOpen] = useState140(false);
|
|
33850
|
+
const menuRef = useRef33(null);
|
|
33851
|
+
const privacyRef = useRef33(null);
|
|
33852
|
+
useEffect114(() => {
|
|
33525
33853
|
function handleClickOutside(event) {
|
|
33526
33854
|
if (menuRef.current && !menuRef.current.contains(event.target)) {
|
|
33527
33855
|
setIsMenuOpen(false);
|
|
@@ -33543,7 +33871,7 @@ function PageHeader({
|
|
|
33543
33871
|
setIsMenuOpen(false);
|
|
33544
33872
|
}
|
|
33545
33873
|
};
|
|
33546
|
-
return /* @__PURE__ */
|
|
33874
|
+
return /* @__PURE__ */ React302.createElement("div", { style: styles.container }, /* @__PURE__ */ React302.createElement("div", { style: styles.leftSection }, /* @__PURE__ */ React302.createElement("span", { style: styles.icon }, icon2 || "\u{1F4C4}"), /* @__PURE__ */ React302.createElement("span", { style: styles.title }, title), /* @__PURE__ */ React302.createElement("div", { style: styles.privacyContainer, ref: privacyRef }, /* @__PURE__ */ React302.createElement("button", { style: styles.privacyBadge, onClick: () => onPrivacyChange && setIsPrivacyOpen(!isPrivacyOpen) }, /* @__PURE__ */ React302.createElement("span", { style: styles.lockIcon }, isPrivate ? "\u{1F512}" : "\u{1F310}"), /* @__PURE__ */ React302.createElement("span", null, isPrivate ? "Private" : "Public"), onPrivacyChange && /* @__PURE__ */ React302.createElement("span", { style: styles.chevron }, "\u25BE")), isPrivacyOpen && onPrivacyChange && /* @__PURE__ */ React302.createElement("div", { style: styles.dropdown }, /* @__PURE__ */ React302.createElement(
|
|
33547
33875
|
"button",
|
|
33548
33876
|
{
|
|
33549
33877
|
style: {
|
|
@@ -33555,9 +33883,9 @@ function PageHeader({
|
|
|
33555
33883
|
setIsPrivacyOpen(false);
|
|
33556
33884
|
}
|
|
33557
33885
|
},
|
|
33558
|
-
/* @__PURE__ */
|
|
33559
|
-
/* @__PURE__ */
|
|
33560
|
-
), /* @__PURE__ */
|
|
33886
|
+
/* @__PURE__ */ React302.createElement("span", { style: styles.menuItemIcon }, "\u{1F512}"),
|
|
33887
|
+
/* @__PURE__ */ React302.createElement("span", null, "Private")
|
|
33888
|
+
), /* @__PURE__ */ React302.createElement(
|
|
33561
33889
|
"button",
|
|
33562
33890
|
{
|
|
33563
33891
|
style: {
|
|
@@ -33569,9 +33897,9 @@ function PageHeader({
|
|
|
33569
33897
|
setIsPrivacyOpen(false);
|
|
33570
33898
|
}
|
|
33571
33899
|
},
|
|
33572
|
-
/* @__PURE__ */
|
|
33573
|
-
/* @__PURE__ */
|
|
33574
|
-
)))), /* @__PURE__ */
|
|
33900
|
+
/* @__PURE__ */ React302.createElement("span", { style: styles.menuItemIcon }, "\u{1F310}"),
|
|
33901
|
+
/* @__PURE__ */ React302.createElement("span", null, "Public")
|
|
33902
|
+
)))), /* @__PURE__ */ React302.createElement("div", { style: styles.rightSection }, lastEdited && /* @__PURE__ */ React302.createElement("span", { style: styles.editedText }, lastEdited), onShare && /* @__PURE__ */ React302.createElement("button", { style: styles.shareButton, onClick: onShare }, "Share"), onFavorite && /* @__PURE__ */ React302.createElement("button", { style: styles.iconButton, onClick: onFavorite }, isFavorited ? "\u2605" : "\u2606"), menuItems.length > 0 && /* @__PURE__ */ React302.createElement("div", { style: styles.menuContainer, ref: menuRef }, /* @__PURE__ */ React302.createElement("button", { style: styles.menuButton, onClick: () => setIsMenuOpen(!isMenuOpen), "aria-label": "Menu" }, /* @__PURE__ */ React302.createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor" }, /* @__PURE__ */ React302.createElement("circle", { cx: "3", cy: "8", r: "1.5" }), /* @__PURE__ */ React302.createElement("circle", { cx: "8", cy: "8", r: "1.5" }), /* @__PURE__ */ React302.createElement("circle", { cx: "13", cy: "8", r: "1.5" }))), isMenuOpen && /* @__PURE__ */ React302.createElement("div", { style: styles.dropdown }, menuItems.map((item, index) => /* @__PURE__ */ React302.createElement(React302.Fragment, { key: index }, item.divider && index > 0 && /* @__PURE__ */ React302.createElement("div", { style: styles.divider }), /* @__PURE__ */ React302.createElement(
|
|
33575
33903
|
"button",
|
|
33576
33904
|
{
|
|
33577
33905
|
style: {
|
|
@@ -33581,8 +33909,8 @@ function PageHeader({
|
|
|
33581
33909
|
onClick: () => handleMenuItemClick(item),
|
|
33582
33910
|
disabled: item.disabled
|
|
33583
33911
|
},
|
|
33584
|
-
item.icon && /* @__PURE__ */
|
|
33585
|
-
/* @__PURE__ */
|
|
33912
|
+
item.icon && /* @__PURE__ */ React302.createElement("span", { style: styles.menuItemIcon }, item.icon),
|
|
33913
|
+
/* @__PURE__ */ React302.createElement("span", null, item.label)
|
|
33586
33914
|
)))))));
|
|
33587
33915
|
}
|
|
33588
33916
|
var styles = {
|
|
@@ -33719,15 +34047,15 @@ var styles = {
|
|
|
33719
34047
|
};
|
|
33720
34048
|
|
|
33721
34049
|
// src/mantine/components/EntitySigningSetup.tsx
|
|
33722
|
-
import
|
|
33723
|
-
import { Modal as Modal3, Stack as
|
|
34050
|
+
import React303, { useState as useState141 } from "react";
|
|
34051
|
+
import { Modal as Modal3, Stack as Stack199, Text as Text174, TextInput as TextInput8, Button as Button56, Alert as Alert54, Group as Group110 } from "@mantine/core";
|
|
33724
34052
|
import { IconAlertCircle as IconAlertCircle20, IconCheck as IconCheck23, IconKey as IconKey2 } from "@tabler/icons-react";
|
|
33725
34053
|
var EntitySigningSetup = ({ opened, onClose, entityDid, entityName, onSetup }) => {
|
|
33726
|
-
const [pin, setPin] =
|
|
33727
|
-
const [confirmPin, setConfirmPin] =
|
|
33728
|
-
const [loading, setLoading] =
|
|
33729
|
-
const [error, setError] =
|
|
33730
|
-
const [success, setSuccess] =
|
|
34054
|
+
const [pin, setPin] = useState141("");
|
|
34055
|
+
const [confirmPin, setConfirmPin] = useState141("");
|
|
34056
|
+
const [loading, setLoading] = useState141(false);
|
|
34057
|
+
const [error, setError] = useState141(null);
|
|
34058
|
+
const [success, setSuccess] = useState141(false);
|
|
33731
34059
|
const handleSetup = async () => {
|
|
33732
34060
|
if (pin.length < 4) {
|
|
33733
34061
|
setError("PIN must be at least 4 characters");
|
|
@@ -33767,15 +34095,15 @@ var EntitySigningSetup = ({ opened, onClose, entityDid, entityName, onSetup }) =
|
|
|
33767
34095
|
setSuccess(false);
|
|
33768
34096
|
}
|
|
33769
34097
|
};
|
|
33770
|
-
return /* @__PURE__ */
|
|
34098
|
+
return /* @__PURE__ */ React303.createElement(
|
|
33771
34099
|
Modal3,
|
|
33772
34100
|
{
|
|
33773
34101
|
opened,
|
|
33774
34102
|
onClose: handleClose,
|
|
33775
|
-
title: /* @__PURE__ */
|
|
34103
|
+
title: /* @__PURE__ */ React303.createElement(Group110, { gap: "xs" }, /* @__PURE__ */ React303.createElement(IconKey2, { size: 20 }), /* @__PURE__ */ React303.createElement(Text174, { fw: 600 }, "Entity Signing Setup")),
|
|
33776
34104
|
size: "md"
|
|
33777
34105
|
},
|
|
33778
|
-
/* @__PURE__ */
|
|
34106
|
+
/* @__PURE__ */ React303.createElement(Stack199, { gap: "md" }, success ? /* @__PURE__ */ React303.createElement(Alert54, { color: "green", icon: /* @__PURE__ */ React303.createElement(IconCheck23, { size: 16 }) }, "Entity signing key set up successfully!") : /* @__PURE__ */ React303.createElement(React303.Fragment, null, /* @__PURE__ */ React303.createElement(Text174, { size: "sm", c: "dimmed" }, "Flow authorization requires a signing key for", " ", /* @__PURE__ */ React303.createElement(Text174, { span: true, fw: 500 }, entityName || entityDid), "."), /* @__PURE__ */ React303.createElement(Alert54, { color: "blue", variant: "light" }, /* @__PURE__ */ React303.createElement(Text174, { size: "sm" }, "This is a ", /* @__PURE__ */ React303.createElement("strong", null, "one-time setup"), " that allows flows to grant permissions without requiring wallet signatures for each delegation.")), /* @__PURE__ */ React303.createElement(Stack199, { gap: "xs" }, /* @__PURE__ */ React303.createElement(Text174, { size: "sm", fw: 500 }, "What happens:"), /* @__PURE__ */ React303.createElement(Text174, { size: "sm", c: "dimmed" }, "1. A new signing key is generated"), /* @__PURE__ */ React303.createElement(Text174, { size: "sm", c: "dimmed" }, "2. Key is registered on the entity's DID document (requires wallet)"), /* @__PURE__ */ React303.createElement(Text174, { size: "sm", c: "dimmed" }, "3. Key is stored encrypted in the entity's Matrix room")), /* @__PURE__ */ React303.createElement(
|
|
33779
34107
|
TextInput8,
|
|
33780
34108
|
{
|
|
33781
34109
|
label: "Enter PIN to encrypt signing key",
|
|
@@ -33786,25 +34114,25 @@ var EntitySigningSetup = ({ opened, onClose, entityDid, entityName, onSetup }) =
|
|
|
33786
34114
|
onChange: (e) => setPin(e.currentTarget.value),
|
|
33787
34115
|
disabled: loading
|
|
33788
34116
|
}
|
|
33789
|
-
), /* @__PURE__ */
|
|
34117
|
+
), /* @__PURE__ */ React303.createElement(TextInput8, { label: "Confirm PIN", type: "password", placeholder: "Confirm PIN", value: confirmPin, onChange: (e) => setConfirmPin(e.currentTarget.value), disabled: loading }), error && /* @__PURE__ */ React303.createElement(Alert54, { color: "red", icon: /* @__PURE__ */ React303.createElement(IconAlertCircle20, { size: 16 }) }, error), /* @__PURE__ */ React303.createElement(Group110, { justify: "flex-end", mt: "md" }, /* @__PURE__ */ React303.createElement(Button56, { variant: "subtle", onClick: handleClose, disabled: loading }, "Cancel"), /* @__PURE__ */ React303.createElement(Button56, { onClick: handleSetup, loading, leftSection: /* @__PURE__ */ React303.createElement(IconKey2, { size: 16 }) }, "Setup Entity Signing"))))
|
|
33790
34118
|
);
|
|
33791
34119
|
};
|
|
33792
34120
|
|
|
33793
34121
|
// src/mantine/components/FlowPermissionsPanel.tsx
|
|
33794
|
-
import
|
|
33795
|
-
import { Stack as
|
|
34122
|
+
import React304, { useState as useState142, useEffect as useEffect115, useMemo as useMemo124 } from "react";
|
|
34123
|
+
import { Stack as Stack200, Text as Text175, Paper as Paper18, Group as Group111, Badge as Badge45, Button as Button57, ActionIcon as ActionIcon38, Loader as Loader54, Alert as Alert55, Divider as Divider29 } from "@mantine/core";
|
|
33796
34124
|
import { IconPlus as IconPlus11, IconTrash as IconTrash12, IconShieldCheck as IconShieldCheck16, IconUser as IconUser14, IconRobot as IconRobot4, IconBuilding as IconBuilding2 } from "@tabler/icons-react";
|
|
33797
34125
|
var FlowPermissionsPanel = ({ editor, entityDid, entityName, onGrantPermission, onRevokePermission, getUserDisplayName }) => {
|
|
33798
|
-
const [delegations, setDelegations] =
|
|
33799
|
-
const [loading, setLoading] =
|
|
33800
|
-
const [revoking, setRevoking] =
|
|
33801
|
-
const rootDelegation =
|
|
34126
|
+
const [delegations, setDelegations] = useState142([]);
|
|
34127
|
+
const [loading, setLoading] = useState142(true);
|
|
34128
|
+
const [revoking, setRevoking] = useState142(null);
|
|
34129
|
+
const rootDelegation = useMemo124(() => {
|
|
33802
34130
|
if (editor.getUcanService) {
|
|
33803
34131
|
return editor.getUcanService()?.getRootDelegation() || null;
|
|
33804
34132
|
}
|
|
33805
34133
|
return null;
|
|
33806
34134
|
}, [editor]);
|
|
33807
|
-
|
|
34135
|
+
useEffect115(() => {
|
|
33808
34136
|
const loadDelegations = async () => {
|
|
33809
34137
|
setLoading(true);
|
|
33810
34138
|
let allDelegations = [];
|
|
@@ -33846,11 +34174,11 @@ var FlowPermissionsPanel = ({ editor, entityDid, entityName, onGrantPermission,
|
|
|
33846
34174
|
const getIcon2 = (type) => {
|
|
33847
34175
|
switch (type) {
|
|
33848
34176
|
case "oracle":
|
|
33849
|
-
return /* @__PURE__ */
|
|
34177
|
+
return /* @__PURE__ */ React304.createElement(IconRobot4, { size: 16 });
|
|
33850
34178
|
case "entity":
|
|
33851
|
-
return /* @__PURE__ */
|
|
34179
|
+
return /* @__PURE__ */ React304.createElement(IconBuilding2, { size: 16 });
|
|
33852
34180
|
default:
|
|
33853
|
-
return /* @__PURE__ */
|
|
34181
|
+
return /* @__PURE__ */ React304.createElement(IconUser14, { size: 16 });
|
|
33854
34182
|
}
|
|
33855
34183
|
};
|
|
33856
34184
|
const formatCapabilities = (caps) => {
|
|
@@ -33869,32 +34197,32 @@ var FlowPermissionsPanel = ({ editor, entityDid, entityName, onGrantPermission,
|
|
|
33869
34197
|
if (date < /* @__PURE__ */ new Date()) return "Expired";
|
|
33870
34198
|
return date.toLocaleDateString();
|
|
33871
34199
|
};
|
|
33872
|
-
return /* @__PURE__ */
|
|
34200
|
+
return /* @__PURE__ */ React304.createElement(Stack200, { gap: "md" }, /* @__PURE__ */ React304.createElement(Stack200, { gap: "xs" }, /* @__PURE__ */ React304.createElement(Text175, { fw: 600, size: "sm" }, "Root Authority"), /* @__PURE__ */ React304.createElement(Paper18, { p: "sm", withBorder: true }, /* @__PURE__ */ React304.createElement(Group111, { gap: "xs" }, /* @__PURE__ */ React304.createElement(IconShieldCheck16, { size: 20, color: "var(--mantine-color-green-6)" }), /* @__PURE__ */ React304.createElement(Stack200, { gap: 2, style: { flex: 1 } }, /* @__PURE__ */ React304.createElement(Text175, { size: "sm", fw: 500 }, entityName || entityDid), /* @__PURE__ */ React304.createElement(Text175, { size: "xs", c: "dimmed" }, rootDelegation ? `Granted: ${new Date(rootDelegation.createdAt).toLocaleDateString()}` : "Root capability not set up")), /* @__PURE__ */ React304.createElement(Badge45, { color: "green", variant: "light" }, "Entity")))), /* @__PURE__ */ React304.createElement(Divider29, { label: "Delegated Permissions", labelPosition: "center" }), loading ? /* @__PURE__ */ React304.createElement(Group111, { justify: "center", py: "xl" }, /* @__PURE__ */ React304.createElement(Loader54, { size: "sm" })) : delegations.length === 0 ? /* @__PURE__ */ React304.createElement(Alert55, { color: "gray", variant: "light" }, /* @__PURE__ */ React304.createElement(Text175, { size: "sm" }, "No permissions have been granted yet.")) : /* @__PURE__ */ React304.createElement(Stack200, { gap: "xs" }, delegations.map(({ delegation, displayName, type }) => /* @__PURE__ */ React304.createElement(Paper18, { key: delegation.cid, p: "sm", withBorder: true }, /* @__PURE__ */ React304.createElement(Group111, { justify: "space-between" }, /* @__PURE__ */ React304.createElement(Group111, { gap: "xs" }, getIcon2(type), /* @__PURE__ */ React304.createElement(Stack200, { gap: 2 }, /* @__PURE__ */ React304.createElement(Text175, { size: "sm", fw: 500 }, displayName), /* @__PURE__ */ React304.createElement(Text175, { size: "xs", c: "dimmed" }, formatCapabilities(delegation.capabilities)), /* @__PURE__ */ React304.createElement(Group111, { gap: "xs" }, /* @__PURE__ */ React304.createElement(Text175, { size: "xs", c: "dimmed" }, "Expires: ", formatExpiration(delegation.expiration)), /* @__PURE__ */ React304.createElement(Text175, { size: "xs", c: "dimmed" }, "\u2022"), /* @__PURE__ */ React304.createElement(Text175, { size: "xs", c: "dimmed" }, "Granted by: ", delegation.issuerDid === entityDid ? "Entity" : delegation.issuerDid.slice(-8))))), /* @__PURE__ */ React304.createElement(ActionIcon38, { color: "red", variant: "subtle", onClick: () => handleRevoke(delegation.cid), loading: revoking === delegation.cid, disabled: !!revoking }, /* @__PURE__ */ React304.createElement(IconTrash12, { size: 16 })))))), /* @__PURE__ */ React304.createElement(Button57, { leftSection: /* @__PURE__ */ React304.createElement(IconPlus11, { size: 16 }), variant: "light", onClick: onGrantPermission }, "Grant Permission"));
|
|
33873
34201
|
};
|
|
33874
34202
|
|
|
33875
34203
|
// src/mantine/components/GrantPermissionModal.tsx
|
|
33876
|
-
import
|
|
33877
|
-
import { Modal as Modal4, Stack as
|
|
34204
|
+
import React305, { useState as useState143, useCallback as useCallback113 } from "react";
|
|
34205
|
+
import { Modal as Modal4, Stack as Stack201, Text as Text176, TextInput as TextInput9, Button as Button58, Group as Group112, Radio as Radio5, Checkbox as Checkbox13, Alert as Alert56, Paper as Paper19, Loader as Loader55, Badge as Badge46, ActionIcon as ActionIcon39, Divider as Divider30, NumberInput as NumberInput3 } from "@mantine/core";
|
|
33878
34206
|
import { IconSearch as IconSearch8, IconUser as IconUser15, IconRobot as IconRobot5, IconX as IconX14, IconShieldPlus as IconShieldPlus4 } from "@tabler/icons-react";
|
|
33879
34207
|
var GrantPermissionModal = ({ opened, onClose, flowUri, blocks, targetBlockId, searchUsers, getOracles, onGrant }) => {
|
|
33880
34208
|
const singleBlockMode = !!targetBlockId || blocks.length === 1;
|
|
33881
34209
|
const fixedBlockId = targetBlockId || (blocks.length === 1 ? blocks[0].id : null);
|
|
33882
34210
|
const fixedBlock = fixedBlockId ? blocks.find((b) => b.id === fixedBlockId) || blocks[0] : null;
|
|
33883
|
-
const [recipientType, setRecipientType] =
|
|
33884
|
-
const [searchQuery, setSearchQuery] =
|
|
33885
|
-
const [searchResults, setSearchResults] =
|
|
33886
|
-
const [searching, setSearching] =
|
|
33887
|
-
const [selectedRecipient, setSelectedRecipient] =
|
|
33888
|
-
const [manualDid, setManualDid] =
|
|
33889
|
-
const [scopeType, setScopeType] =
|
|
33890
|
-
const [selectedBlocks, setSelectedBlocks] =
|
|
33891
|
-
const [expirationEnabled, setExpirationEnabled] =
|
|
33892
|
-
const [expirationDays, setExpirationDays] =
|
|
33893
|
-
const [canDelegate, setCanDelegate] =
|
|
33894
|
-
const [pin, setPin] =
|
|
33895
|
-
const [loading, setLoading] =
|
|
33896
|
-
const [error, setError] =
|
|
33897
|
-
const handleSearch =
|
|
34211
|
+
const [recipientType, setRecipientType] = useState143("user");
|
|
34212
|
+
const [searchQuery, setSearchQuery] = useState143("");
|
|
34213
|
+
const [searchResults, setSearchResults] = useState143([]);
|
|
34214
|
+
const [searching, setSearching] = useState143(false);
|
|
34215
|
+
const [selectedRecipient, setSelectedRecipient] = useState143(null);
|
|
34216
|
+
const [manualDid, setManualDid] = useState143("");
|
|
34217
|
+
const [scopeType, setScopeType] = useState143("full");
|
|
34218
|
+
const [selectedBlocks, setSelectedBlocks] = useState143([]);
|
|
34219
|
+
const [expirationEnabled, setExpirationEnabled] = useState143(false);
|
|
34220
|
+
const [expirationDays, setExpirationDays] = useState143(30);
|
|
34221
|
+
const [canDelegate, setCanDelegate] = useState143(false);
|
|
34222
|
+
const [pin, setPin] = useState143("");
|
|
34223
|
+
const [loading, setLoading] = useState143(false);
|
|
34224
|
+
const [error, setError] = useState143(null);
|
|
34225
|
+
const handleSearch = useCallback113(async () => {
|
|
33898
34226
|
if (searchQuery.length < 2) return;
|
|
33899
34227
|
setSearching(true);
|
|
33900
34228
|
try {
|
|
@@ -33981,15 +34309,15 @@ var GrantPermissionModal = ({ opened, onClose, flowUri, blocks, targetBlockId, s
|
|
|
33981
34309
|
resetForm();
|
|
33982
34310
|
}
|
|
33983
34311
|
};
|
|
33984
|
-
return /* @__PURE__ */
|
|
34312
|
+
return /* @__PURE__ */ React305.createElement(
|
|
33985
34313
|
Modal4,
|
|
33986
34314
|
{
|
|
33987
34315
|
opened,
|
|
33988
34316
|
onClose: handleClose,
|
|
33989
|
-
title: /* @__PURE__ */
|
|
34317
|
+
title: /* @__PURE__ */ React305.createElement(Group112, { gap: "xs" }, /* @__PURE__ */ React305.createElement(IconShieldPlus4, { size: 20 }), /* @__PURE__ */ React305.createElement(Text176, { fw: 600 }, "Grant Permission")),
|
|
33990
34318
|
size: "lg"
|
|
33991
34319
|
},
|
|
33992
|
-
/* @__PURE__ */
|
|
34320
|
+
/* @__PURE__ */ React305.createElement(Stack201, { gap: "md" }, /* @__PURE__ */ React305.createElement(Stack201, { gap: "xs" }, /* @__PURE__ */ React305.createElement(Text176, { size: "sm", fw: 500 }, "Recipient Type"), /* @__PURE__ */ React305.createElement(
|
|
33993
34321
|
Radio5.Group,
|
|
33994
34322
|
{
|
|
33995
34323
|
value: recipientType,
|
|
@@ -33999,23 +34327,23 @@ var GrantPermissionModal = ({ opened, onClose, flowUri, blocks, targetBlockId, s
|
|
|
33999
34327
|
setSearchResults([]);
|
|
34000
34328
|
}
|
|
34001
34329
|
},
|
|
34002
|
-
/* @__PURE__ */
|
|
34003
|
-
)), recipientType !== "manual" ? /* @__PURE__ */
|
|
34330
|
+
/* @__PURE__ */ React305.createElement(Group112, null, /* @__PURE__ */ React305.createElement(Radio5, { value: "user", label: "User" }), /* @__PURE__ */ React305.createElement(Radio5, { value: "oracle", label: "Oracle" }), /* @__PURE__ */ React305.createElement(Radio5, { value: "manual", label: "Enter DID" }))
|
|
34331
|
+
)), recipientType !== "manual" ? /* @__PURE__ */ React305.createElement(Stack201, { gap: "xs" }, /* @__PURE__ */ React305.createElement(
|
|
34004
34332
|
TextInput9,
|
|
34005
34333
|
{
|
|
34006
34334
|
placeholder: recipientType === "oracle" ? "Search oracles..." : "Search users...",
|
|
34007
|
-
leftSection: /* @__PURE__ */
|
|
34008
|
-
rightSection: searching ? /* @__PURE__ */
|
|
34335
|
+
leftSection: /* @__PURE__ */ React305.createElement(IconSearch8, { size: 16 }),
|
|
34336
|
+
rightSection: searching ? /* @__PURE__ */ React305.createElement(Loader55, { size: 14 }) : null,
|
|
34009
34337
|
value: searchQuery,
|
|
34010
34338
|
onChange: (e) => setSearchQuery(e.currentTarget.value),
|
|
34011
34339
|
onKeyDown: (e) => e.key === "Enter" && handleSearch()
|
|
34012
34340
|
}
|
|
34013
|
-
), selectedRecipient ? /* @__PURE__ */
|
|
34341
|
+
), selectedRecipient ? /* @__PURE__ */ React305.createElement(Paper19, { p: "sm", withBorder: true }, /* @__PURE__ */ React305.createElement(Group112, { justify: "space-between" }, /* @__PURE__ */ React305.createElement(Group112, { gap: "xs" }, recipientType === "oracle" ? /* @__PURE__ */ React305.createElement(IconRobot5, { size: 16 }) : /* @__PURE__ */ React305.createElement(IconUser15, { size: 16 }), /* @__PURE__ */ React305.createElement(Text176, { size: "sm" }, selectedRecipient.displayName), /* @__PURE__ */ React305.createElement(Badge46, { size: "xs", variant: "light" }, selectedRecipient.did.slice(-12))), /* @__PURE__ */ React305.createElement(ActionIcon39, { size: "sm", variant: "subtle", onClick: () => setSelectedRecipient(null) }, /* @__PURE__ */ React305.createElement(IconX14, { size: 14 })))) : searchResults.length > 0 ? /* @__PURE__ */ React305.createElement(Paper19, { p: "xs", withBorder: true, style: { maxHeight: 150, overflow: "auto" } }, /* @__PURE__ */ React305.createElement(Stack201, { gap: 4 }, searchResults.map((result) => /* @__PURE__ */ React305.createElement(Button58, { key: result.did, variant: "subtle", size: "sm", justify: "flex-start", onClick: () => setSelectedRecipient(result) }, result.displayName)))) : null) : /* @__PURE__ */ React305.createElement(TextInput9, { label: "Recipient DID", placeholder: "did:ixo:...", value: manualDid, onChange: (e) => setManualDid(e.currentTarget.value) }), /* @__PURE__ */ React305.createElement(Divider30, null), /* @__PURE__ */ React305.createElement(Stack201, { gap: "xs" }, /* @__PURE__ */ React305.createElement(Text176, { size: "sm", fw: 500 }, "Permission Scope"), singleBlockMode && fixedBlock ? (
|
|
34014
34342
|
// Single block mode: show fixed block info
|
|
34015
|
-
/* @__PURE__ */
|
|
34343
|
+
/* @__PURE__ */ React305.createElement(Paper19, { p: "sm", withBorder: true }, /* @__PURE__ */ React305.createElement(Group112, { gap: "xs" }, /* @__PURE__ */ React305.createElement(Badge46, { variant: "light", color: "blue" }, fixedBlock.type), /* @__PURE__ */ React305.createElement(Text176, { size: "sm" }, fixedBlock.name || `Block ${fixedBlock.id.slice(-8)}`)), /* @__PURE__ */ React305.createElement(Text176, { size: "xs", c: "dimmed", mt: "xs" }, "Permission will be granted to execute this specific block."))
|
|
34016
34344
|
) : (
|
|
34017
34345
|
// Multi-block mode: show scope selection
|
|
34018
|
-
/* @__PURE__ */
|
|
34346
|
+
/* @__PURE__ */ React305.createElement(React305.Fragment, null, /* @__PURE__ */ React305.createElement(Radio5.Group, { value: scopeType, onChange: (v) => setScopeType(v) }, /* @__PURE__ */ React305.createElement(Stack201, { gap: "xs" }, /* @__PURE__ */ React305.createElement(Radio5, { value: "full", label: "Full flow access (can execute any block)" }), /* @__PURE__ */ React305.createElement(Radio5, { value: "blocks", label: "Specific blocks only" }))), scopeType === "blocks" && /* @__PURE__ */ React305.createElement(Paper19, { p: "sm", withBorder: true, style: { maxHeight: 150, overflow: "auto" } }, /* @__PURE__ */ React305.createElement(Stack201, { gap: "xs" }, blocks.map((block) => /* @__PURE__ */ React305.createElement(
|
|
34019
34347
|
Checkbox13,
|
|
34020
34348
|
{
|
|
34021
34349
|
key: block.id,
|
|
@@ -34030,7 +34358,7 @@ var GrantPermissionModal = ({ opened, onClose, flowUri, blocks, targetBlockId, s
|
|
|
34030
34358
|
}
|
|
34031
34359
|
}
|
|
34032
34360
|
)))))
|
|
34033
|
-
)), /* @__PURE__ */
|
|
34361
|
+
)), /* @__PURE__ */ React305.createElement(Divider30, null), /* @__PURE__ */ React305.createElement(Stack201, { gap: "xs" }, /* @__PURE__ */ React305.createElement(Checkbox13, { label: "Set expiration", checked: expirationEnabled, onChange: (e) => setExpirationEnabled(e.currentTarget.checked) }), expirationEnabled && /* @__PURE__ */ React305.createElement(NumberInput3, { label: "Expires in (days)", placeholder: "30", value: expirationDays, onChange: setExpirationDays, min: 1, max: 365 })), /* @__PURE__ */ React305.createElement(
|
|
34034
34362
|
Checkbox13,
|
|
34035
34363
|
{
|
|
34036
34364
|
label: "Recipient can grant permissions to others",
|
|
@@ -34038,7 +34366,7 @@ var GrantPermissionModal = ({ opened, onClose, flowUri, blocks, targetBlockId, s
|
|
|
34038
34366
|
checked: canDelegate,
|
|
34039
34367
|
onChange: (e) => setCanDelegate(e.currentTarget.checked)
|
|
34040
34368
|
}
|
|
34041
|
-
), /* @__PURE__ */
|
|
34369
|
+
), /* @__PURE__ */ React305.createElement(Divider30, null), /* @__PURE__ */ React305.createElement(TextInput9, { label: "Enter your PIN to sign this delegation", type: "password", placeholder: "PIN", value: pin, onChange: (e) => setPin(e.currentTarget.value) }), error && /* @__PURE__ */ React305.createElement(Alert56, { color: "red" }, error), /* @__PURE__ */ React305.createElement(Group112, { justify: "flex-end" }, /* @__PURE__ */ React305.createElement(Button58, { variant: "subtle", onClick: handleClose, disabled: loading }, "Cancel"), /* @__PURE__ */ React305.createElement(Button58, { onClick: handleGrant, loading }, "Grant Permission")))
|
|
34042
34370
|
);
|
|
34043
34371
|
};
|
|
34044
34372
|
|
|
@@ -34152,4 +34480,4 @@ export {
|
|
|
34152
34480
|
getExtraSlashMenuItems,
|
|
34153
34481
|
useCreateIxoEditor
|
|
34154
34482
|
};
|
|
34155
|
-
//# sourceMappingURL=chunk-
|
|
34483
|
+
//# sourceMappingURL=chunk-T6RCHQV6.mjs.map
|